ld64 emits string tables which start with a space and a zero byte. We
match its behavior here since some tools depend on it.
Similar rationale as D89561: [MC] Adjust StringTableBuilder for linked Mach-O binaries.
Paths
| Differential D89639
[lld-macho] Emit empty string as first entry of string table ClosedPublic Authored by int3 on Oct 17 2020, 8:46 PM.
Details
Summary ld64 emits string tables which start with a space and a zero byte. We Similar rationale as D89561: [MC] Adjust StringTableBuilder for linked Mach-O binaries.
Diff Detail
Event TimelineComment Actions Note that unlike D89561, this diff doesn't need to make any alignment-related changes as LLD should already be handling that correctly. See the linkedit-contiguity.s test for more details. Comment Actions Do we have any logic to emit an n_strx for an empty string? If so, that would need to be adjusted to emit 1 instead of 0. If not, LGTM. Comment Actions
Nope. In general, we don't make any attempt to dedup strings (I think ld64 does the same thing) This revision is now accepted and ready to land.Oct 20 2020, 10:00 PM This revision was landed with ongoing or failed builds.Dec 1 2020, 3:05 PM Closed by commit rGd0c4be42e35d: [lld-macho] Emit empty string as first entry of string table (authored by int3). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 308788 lld/MachO/SyntheticSections.h
lld/test/MachO/symtab.s
|