This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

S/390: Revert relro patch from Jan 14

The current version of Binutils as well as version 2.32 currently does
not create functional 32 bit binaries.

$ echo -e "#include <stdio.h>\nint main () { puts(\"hello\"); }" | gcc -x c /dev/stdin -m31 -fPIE
-pie -o t; ./t
Segmentation fault (core dumped)

The problem was introduced with this patch:

commit 5a12586d44fa8d5dfc74cbca4f2f36a273a16335
Author: Maamoun Tarsha <>
Date:   Mon Jan 14 16:00:14 2019 +0000

    Add support to GNU ld to separate got related plt entries from
normal ones in order to be able to s witch the non-plt got entries to
read-only after startup, conforming to revised Linux for zSeries ABI.

The patch adds SEPARATE_GOTPLT definitions to the s390 emulation
scripts.  While this change does appear to be a NOP for 64 bit since
there is already such a line later in the file it really hurts on 32
bit. With that change the _GLOBAL_OFFSET_TABLE_ symbol does not point
to the beginning of the .got anymore. But this is mandated by our ABI.
The first PLT entry for position indpendent code relies on that fact.
That's why the example above crashes.

I'm going to revert this patch on mainline and 2.32 branch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]