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
Time | Test | |
---|---|---|
60,050 ms | x64 debian > MLIR.Examples/standalone::test.toy Script:
--
: 'RUN: at line 1'; /usr/bin/cmake /var/lib/buildkite-agent/builds/llvm-project/mlir/examples/standalone -G "Ninja" -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/var/lib/buildkite-agent/builds/llvm-project/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld
|
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.