Skip to content

Add flag to write symbols for PLT / GOT entries#827

Merged
davidlattimore merged 2 commits into
wild-linker:mainfrom
lapla-cogito:gotpltsym
Jun 4, 2025
Merged

Add flag to write symbols for PLT / GOT entries#827
davidlattimore merged 2 commits into
wild-linker:mainfrom
lapla-cogito:gotpltsym

Conversation

@lapla-cogito

Copy link
Copy Markdown
Member

This patch modifies the behavior by adding extra entries to the symbol table that point to GOT and PLT entries via the --got-plt-syms option. While this is the default behavior in mold, it represents an operation not present in other linkers like GNU ld, and therefore this option is disabled by default at present.

close #526

@lapla-cogito

Copy link
Copy Markdown
Member Author

When considering adding tests for this scenario, note that --got-plt-syms is a wild-specific option with no comparison target linker, causing linker-diff to panic (the same underlying issue discussed previously on Zulip). Therefore, we need to determine how to address this linker-diff bug while testing this option.

@davidlattimore davidlattimore left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing, I'd suggest a test that does something like the following:

//#SkipLinker:ld
//#DiffEnabled:false
//#ExpectSym:foo$got .got

Comment thread libwild/src/layout.rs Outdated
Comment thread libwild/src/elf_writer.rs Outdated
Comment thread libwild/src/elf_writer.rs Outdated
Comment thread libwild/src/elf_writer.rs Outdated
@lapla-cogito lapla-cogito force-pushed the gotpltsym branch 5 times, most recently from 2d6f2a6 to 4ae9d41 Compare June 4, 2025 01:15
Comment thread libwild/src/layout.rs Outdated
@davidlattimore davidlattimore merged commit 4e9fe3a into wild-linker:main Jun 4, 2025
18 checks passed
@lapla-cogito lapla-cogito deleted the gotpltsym branch June 4, 2025 12:35
@marxin

marxin commented Jun 4, 2025

Copy link
Copy Markdown
Collaborator

Noticed #834.

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.

Add flag to write symbols for PLT / GOT entries

3 participants