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

Linux strip command report problem with 32-bit ELF executable created by OW linker #803

Closed
jmalak opened this issue Jan 18, 2022 · 3 comments
Labels

Comments

@jmalak
Copy link
Member

jmalak commented Jan 18, 2022

the problem is reported here
PHDR segment not covered by LOAD segment #802

I reproduced it on created 32-bit wcc compiler executable by command
strip --remove-section=.comment --remove-section=.note wcc
It output following messages
strip: stC34TK5: error: PHDR segment not covered by LOAD segment
strip:stC34TK5[.text]: file in wrong format

@jmalak jmalak added the bug label Jan 18, 2022
@jmalak
Copy link
Member Author

jmalak commented Jan 18, 2022

It looks like two problems.

  • PHDR header should not be generated for executable for now (OW doesn't use any dynamic loading of any shared object)
  • wrong ordering of symbols in symbol table, first should be all local then all global symbols

Both problem must be fixed to OW ELF executable follow ELF standard.
OW linker ELF stuff is based on very old implementation developed by IBM for OS/2 but it declines from ELF standard.

jmalak added a commit that referenced this issue Jan 18, 2022
don't emit ELF Program header for OW executable until not support dynymical linking
@jmalak
Copy link
Member Author

jmalak commented Jan 18, 2022

The problem with program header is fixed.

jmalak added a commit that referenced this issue Jan 19, 2022
@jmalak
Copy link
Member Author

jmalak commented Jan 19, 2022

Now correct order of symbols in ELF image.
first are local symbols then global or weak symbols.

@jmalak jmalak closed this as completed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant