[PATCH] D145118: [ELF][RISCV] Make .sdata and .sbss closer

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 14:02:04 PST 2023


MaskRay created this revision.
MaskRay added reviewers: asb, craig.topper, jrtc27, kito-cheng.
Herald added subscribers: luke, VincentWu, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, arichardson, emaste.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD.
Herald added a project: LLVM.

GNU ld's internal linker scripts for RISC-V place .sdata and .sbss close.
This makes GP relaxation more profitable.

While here, when .sbss is present, set `__bss_start` to the start of
.sbss instead of .bss, to match GNU ld.

Note: GNU ld's internal linker scripts have symbol assignments and input
section descriptions which are not relevant for modern systems. We only
add things that make sense.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145118

Files:
  lld/ELF/Writer.cpp
  lld/test/ELF/riscv-gp-no-sdata.s
  lld/test/ELF/riscv-section-layout.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145118.501659.patch
Type: text/x-patch
Size: 4573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230301/1d268c6c/attachment.bin>


More information about the llvm-commits mailing list