-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to generate a list of symbols for dynamic linkage #916
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - I might need exactly something like this in a project of mine in the next few months.
in a format that the linker (ld) can understand.
Which linkers specifically support this option? Is the --dynamic-list
option of the gold linker compatible with the format, or did you only test with ldd
? Is there any documentation on the exact format?
3bb7400
to
f4cd4a1
Compare
The manual doesn't clearly explain the format. Gnu linker's manual reads "The format of the dynamic list is the same as the version node without scope and node name. See VERSION", and that "version" thing is introduced here. I would expect at least GNU ld, lld and gold to work with that (I have only tested ld for the moment, but I'm confident that it works with lld too since it's been implemented with the same format in 2016). It would be weird for a linker to offer the same option but with a different format IMO. |
f4cd4a1
to
6fc7d2b
Compare
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks good. Probably needs a rebase (can get to it if you can't) and I have one suggestion to avoid a couple intermediary allocations. But lmk if it's unreasonable.
6fc7d2b
to
4ce4067
Compare
4ce4067
to
f961663
Compare
f961663
to
c604d2e
Compare
Sorry for the (very) late reply, it's been a busy year! I've rebased the branch and applied your suggestions. |
This resolves #907 by adding the ability to generate the list of exportable symbols (i.e. functions and globals), in a format that the linker (ld) can understand. Like
depfile
, this new feature is available both as a CLI option (--symfile
) and as a method inBindings
. Therefore, it's easy to use it in a build script.Most of the new files are tests on the output of the new option
--symfile
.