Since RISCVELFTargetObjectFile does not inherit RISCVMCObjectFileInfo,
the alignment of code section is always 4 even if c extension was enabled.
If c extension was enabled, the nop instruction is 2 bytes, which will
make the assember to emit a code align fixup.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Time | Test | |
---|---|---|
60,050 ms | x64 debian > MLIR.Examples/standalone::test.toy |
Event Timeline
Comment Actions
Could we make the text segment alignment a member variable of MCObjectInfo instead of needing to use a virtual method in MCObjectInfo? Then we'd just need to assign that member from RISCVMCObjectInfo and
RISCVTargetObjectFile.
Comment Actions
- Add setTextSectionAlignment function to allow target set text section alignment
- Set RISCV's text section alignment when initialize RISCVELFTargetObjectFile
- Set RISCV's text section alignment when create RISCVMCObjectFileInfo
llvm/test/CodeGen/RISCV/unnecessary-code-align.ll | ||
---|---|---|
5 | ; CHECK: Relocations [ ; CHECK-NEXT: ] |
Comment Actions
If this tests alignment, you probably want to check llvm-readelf -S -r output. -S for the Al column. -r is to check there is no relocation.