This is an archive of the discontinued LLVM Phabricator instance.

[ELF][RISCV] Make .sdata and .sbss closer
ClosedPublic

Authored by MaskRay on Mar 1 2023, 2:02 PM.

Details

Summary

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.

Diff Detail

Event Timeline

MaskRay created this revision.Mar 1 2023, 2:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2023, 2:02 PM
MaskRay requested review of this revision.Mar 1 2023, 2:02 PM
craig.topper added inline comments.Mar 1 2023, 2:47 PM
lld/ELF/Writer.cpp
977

one of these .sdata should be .sbss?

MaskRay updated this revision to Diff 501675.Mar 1 2023, 3:06 PM

fix a comment

This revision is now accepted and ready to land.Mar 7 2023, 9:29 AM
This revision was automatically updated to reflect the committed changes.
lld/ELF/Writer.cpp