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

elfutils's eu-elflint isn't happy #255

Closed
rossburton opened this issue Jan 5, 2022 · 2 comments
Closed

elfutils's eu-elflint isn't happy #255

rossburton opened this issue Jan 5, 2022 · 2 comments

Comments

@rossburton
Copy link

rossburton commented Jan 5, 2022

elfutils has an elflint tool. Whilst trying to figure out why RPM can't find the SONAME in libraries linked with mold, I ran this:

$ eu-elflint glib-mold/image/usr/lib/libgthread-2.0.so
section [ 8] '.gnu.hash': symbol 1 referenced in chain for bucket 0 is undefined
section [ 8] '.gnu.hash': symbol 5 referenced in chain for bucket 1 is undefined
section [ 8] '.gnu.hash': symbol 6 referenced in chain for bucket 1 is undefined
section [12] '.rodata.str': merge flag set but entry size is zero
section [28] '.symtab': symbol 45: st_value out of bounds
section [28] '.symtab': _DYNAMIC symbol size 0 does not match dynamic segment size 576
section [28] '.symtab': symbol 58: st_value out of bounds
section [29] '.comment': merge flag set but entry size is zero
section [34] '.debug_line_str' has wrong flags: expected none, is MERGE|STRINGS
section [34] '.debug_line_str': merge flag set but entry size is zero
section [37] '.debug_str': merge flag set but entry size is zero
@rui314
Copy link
Owner

rui314 commented Jan 6, 2022

This one is a real issue. I'll fix it soon.

section [ 8] '.gnu.hash': symbol 1 referenced in chain for bucket 0 is undefined
section [ 8] '.gnu.hash': symbol 5 referenced in chain for bucket 1 is undefined
section [ 8] '.gnu.hash': symbol 6 referenced in chain for bucket 1 is undefined

The following errors are harmless

section [12] '.rodata.str': merge flag set but entry size is zero
section [28] '.symtab': symbol 45: st_value out of bounds

This error for _DYNAMIC is "good to have". I'll file an issue to manage it separately.

section [28] '.symtab': _DYNAMIC symbol size 0 does not match dynamic segment size 576

The following errors are harmless.

section [28] '.symtab': symbol 58: st_value out of bounds
section [29] '.comment': merge flag set but entry size is zero
section [34] '.debug_line_str' has wrong flags: expected none, is MERGE|STRINGS
section [34] '.debug_line_str': merge flag set but entry size is zero
section [37] '.debug_str': merge flag set but entry size is zero

rui314 added a commit that referenced this issue Jan 6, 2022
Previously, mold put all global symbols into .gnu.hash. Although I
believe it was not an error, it bloated the size of .gnu.hash because
.gnu.hash needs only exported symbols.

#255
rui314 added a commit that referenced this issue Jan 6, 2022
Previously, mold put all global symbols into .gnu.hash. Although I
believe it was not an error, it bloated the size of .gnu.hash because
.gnu.hash needs only exported symbols.

#255
@rui314
Copy link
Owner

rui314 commented Jan 6, 2022

I committed a few changes to make the elflint tool happier. mold's output isn't still elflint-clean, but I think we don't need to make any more changes to completely satisfy it, as it's not an authoritative tool or anything. The tool complains about even GNU ld's outputs.

@rui314 rui314 closed this as completed Jan 6, 2022
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

No branches or pull requests

2 participants