Skip to content

Use Rela instead of object::Relocation#5

Merged
davidlattimore merged 2 commits intowild-linker:mainfrom
philipc:relocations
May 10, 2024
Merged

Use Rela instead of object::Relocation#5
davidlattimore merged 2 commits intowild-linker:mainfrom
philipc:relocations

Conversation

@philipc
Copy link
Copy Markdown
Contributor

@philipc philipc commented Apr 25, 2024

This is a draft for #4. It needs some small helpers in object first.

In doing this I've been merrily deleting all the support for RelocationTarget::Section because object never returns that for ELF, instead returning a RelocationTarget::Symbol that may refer to a section symbol. However, maybe I shouldn't be deleting this, and instead fixing it to handle section symbols, even though it previously didn't? I don't understand enough of the code to know.

@davidlattimore
Copy link
Copy Markdown
Member

Great! I had noticed that RelocationTarget::Section didn't seem to be coming up. I'd assumed it was somewhat obscure and wasn't used often. I guess I should have investigated further. Deleting unnecessary code is fine. It's also fine to leave it for later if you'd prefer.

@philipc philipc marked this pull request as ready for review May 10, 2024 05:47
@philipc
Copy link
Copy Markdown
Contributor Author

philipc commented May 10, 2024

This is ready. I've updated object to use a git version. I've left one function that was handling section symbols as dead code; it can probably be deleted. There definitely are relocations referencing section symbols in practice, and the regular symbol handling appears to work fine for section symbols too.

@davidlattimore davidlattimore merged commit 17c7cd9 into wild-linker:main May 10, 2024
@davidlattimore
Copy link
Copy Markdown
Member

Thanks for doing this!

@davidlattimore
Copy link
Copy Markdown
Member

I deleted the dead code. It definitely seems that it's not needed. Symbols with no names and only a section are handled via a different path that's more or less the same as any other symbol. That code was for handling relocations that reference sections not via a symbol.... which erm, seems to not be a thing.

@philipc philipc deleted the relocations branch May 10, 2024 07:04
gilescope added a commit to gilescope/wild that referenced this pull request Apr 24, 2026
…nker#5)

Flips DebugCompression::default() from None to Zstd. Release builds
emit no .debug_* sections so the post-write pass is a no-op for them;
debug builds get SHF_COMPRESSED zstd automatically without needing
-O1 or an explicit flag. Users opting out pass --compress-debug-sections=none.

Updates the docstrings on compress_debug_sections and opt_level to
reflect that the baseline (no -O) already includes debug compression;
-O1 now adds the line v4→v5 upgrade on top.

Signed-off-by: Giles Cope <[email protected]>
gilescope added a commit to gilescope/wild that referenced this pull request Apr 24, 2026
…e -O1 doc

Dwarf-size-plan table rows for items wild-linker#3 (.debug_abbrev hash-and-collapse)
and wild-linker#5 (default --compress-debug-sections=zstd) updated from pending
to shipped. The 'What wild does today' status table gets matching ✓
entries and the wild-linker#5 prioritisation paragraph drops the 'cheapest win'
framing.

libwild's opt_level docstring moves .debug_abbrev dedup from the
placeholder -O2 bucket to the -O1 line where it now actually runs.

Signed-off-by: Giles Cope <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants