Skip to content
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

Remove dependency on scanelf by using readelf -s #9

Merged
merged 1 commit into from
Aug 24, 2020

Conversation

blackle
Copy link

@blackle blackle commented Aug 24, 2020

I "accidentally" worked on a different issue than you wanted. these changes worked with the test binaries and also enamel_pin. it also adds a new error message in the event that two different libraries provide the same symbol. this closes #4

@PoroCYon
Copy link
Owner

PoroCYon commented Aug 24, 2020

Nice work! This is also fine.

However, how exactly does this interact with weak symbols? Eg. my libglib-2.0 defines g_timer_new:

  1874: 000000000007d9a0    36 FUNC    GLOBAL DEFAULT   11 g_timer_new

But so does my libgtk-3:

  1647: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND g_timer_new

The latter being a weak symbol (st_value == 0).

Does this always use the one defined in the correct library? Or randomly picks one of the two? Or does it error even though there's only one 'real' definition of the symbol? Because if it's the latter (and it looks like it is?), this might get problematic? (Nice how this ties back into #5 :P )

EDIT: NOTE: which version of the symbol that will get used depends on the order in which libraries are listed in the DYNAMIC header, not the order of the hashes themselves. Though, the Python controls the former as well.

@blackle
Copy link
Author

blackle commented Aug 24, 2020

the weak symbol in libgtk-3 will be filtered out because its NDX value is UND, so it will only choose the symbol in libglib-2.0. if multiple libraries supply the same symbol, as in they are both defined, it is reported as an error

@PoroCYon
Copy link
Owner

Ah I see, Then this should be good. Thanks!

@PoroCYon PoroCYon merged commit 405d8eb into PoroCYon:master Aug 24, 2020
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.

Eliminate dependency on scanelf/pax-utils
2 participants