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

Skip empty section (fixes #66) #95

Closed
wants to merge 1 commit into from
Closed

Conversation

DoomHammer
Copy link

Title says it all. More details in #66 .

@DoomHammer
Copy link
Author

@edolstra, could you take a look at this?

@edolstra
Copy link
Member

See my remark at #66 (comment).

@sjackman
Copy link

PR #95 may fix the latter, but it's not clear to me whether skipping sections with empty names (which is not necessarily the same as an empty section) is the right thing to do.

Why do sections with empty names cause patchelf to fail? This PR fixes that issue.

cannot find section .interp

This error is caused by running patchelf on a static ELF. By default a static ELF should give an error message, although the message could be more informative. An option --ignore-static would be helpful to reduce this error to a warning when running patchelf on many executables, some of which are static.

@sjackman
Copy link

This issue seems to affect primarily Go executables, whose ELF files start with an empty first section with no name.

@steveej
Copy link

steveej commented Dec 29, 2017

This issue seems to affect primarily Go executables, whose ELF files start with an empty first section with no name.

Not knowing whether or not skipping sections with empty names is correct, we could opt for skipping the first section if it matches the given example.

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0

This would extend the if-clause by matching all fields with the respective zero value.
@DoomHammer @edolstra is this feasible?

@DoomHammer
Copy link
Author

Frankly I've quite forgotten what the original fuss was all about. @sjackman do you think this suggestion is feasible?

@sjackman
Copy link

sjackman commented Jan 2, 2018

Sure, yeah. If it fixes patchelf for Go executables, it's good enough for me.

@iMichka
Copy link

iMichka commented Mar 6, 2019

Since #149 was merged, I think this PR can be closed.

@domenkozar domenkozar closed this Mar 6, 2019
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.

None yet

6 participants