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

Fix rename-dynamic-symbols.sh test (issue #503) #547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamborm
Copy link

@jamborm jamborm commented Mar 8, 2024

when building and then checking patchelf on openSUSE Leap 15.5, the rename-dynamic-symbols.sh test fails. The test builds a test library and executable called many-syms-main, then runs patchelf to rename symbols and then checks that many-syms-main still runs successfully.

On Leap the run fails with many messages like

./many-syms-main: Symbol `f1947' causes overflow in R_X86_64_PC32 relocation

and then terminates with a Segmentation fault. The interesting bit is that it however fails so even before patchelf touches it.

The binary is built and linked with option -pie which produces an executable which is supposedly position independent but does not actually contain code position independent code which requires compiler option -fPIE (of -fpie or -fPIC or -fpic). As a result the calls in the generated assembly do not go through the PLT.

This patch merely adresses that by adding the -fPIE option to the CFLAGS for the test.

Thank you!

Please do your best to include a regression test
so that the quality of future releases can be preserved.

when building and then checking patchelf on openSUSE Leap 15.5, the
rename-dynamic-symbols.sh test fails.  The test builds a test library
and executable called many-syms-main, then runs patchelf to rename
symbols and then checks that many-syms-main still runs successfully.

On Leap the run fails with many messages like

  ./many-syms-main: Symbol `f1947' causes overflow in R_X86_64_PC32 relocation

and then terminates with a Segmentation fault.  The interesting bit is
that it however fails so even before patchelf touches it.

The binary is built and linked with option -pie which produces an
executable which is supposedly position independent but does not
actually contain code position independent code which requires
compiler option -fPIE (of -fpie or -fPIC or -fpic).  As a result the
calls in the generated assembly do not go through the PLT.

This patch merely adresses that by adding the -fPIE option to the
CFLAGS for the test.
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

1 participant