aboutsummaryrefslogtreecommitdiff
path: root/gas/ChangeLog-2006
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2014-12-02 16:35:47 +0100
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-12-02 16:35:47 +0100
commitfdb09caf2386b09272df3cac6ec65be724ace3b9 (patch)
treee98ceea7fd335ceb1fdaaeb93e740d9a874df150 /gas/ChangeLog-2006
parent538baf8b7e6d17a490f126f8565638469da70204 (diff)
downloadgdb-fdb09caf2386b09272df3cac6ec65be724ace3b9.zip
gdb-fdb09caf2386b09272df3cac6ec65be724ace3b9.tar.gz
gdb-fdb09caf2386b09272df3cac6ec65be724ace3b9.tar.bz2
execl-update-breakpoints.exp: Move whole segment instead of .text section
The test case builds two copies of the program, one with the compile option "ldflags=-Wl,-Ttext=0x1000000" and the other with the address changed to 0x2000000. However, when linking with ld.bfd, the resulting executables crash early in ld.so on S390 and i386. Analysis of the crash: The default linker script establishes a certain order of loadable sections, and the option "-Ttext" effectively splits these into an "unaffected" lot (everything before .text) and an "affected" lot. The affected lot is placed at the given address, whereas the unaffected lot stays at its default address. The unaffected lot starts at an aligned address plus Elf header sizes, which is good if it is the first LOAD segment (like on AMD64). But if the affected lot comes first instead (like on S390 and i386), the PHDR doesn't fit there and is placed *outside* any LOAD segments. Then the PHDR is not mapped when the loader gets control, and the loader runs into a segmentation fault while trying to access it. Since we are lucky about the order of segments on AMD64, the test succeeds there, but the resulting binaries are unusually large -- 2.1M each, with lots of padding within. When replacing '-Ttext' by '-Ttext-segment', the linker moves all segments consistently, the binaries have normal sizes, and the test case succeeds on all mentioned platforms. Since old versions of the gold linker don't support '-Ttext-segment', the patch also adds logic for falling back to '-Ttext'. gdb/testsuite/ChangeLog: * gdb.base/execl-update-breakpoints.exp: Specify the link address with '-Ttext-segment' instead of '-Ttext'. Fall back to '-Ttext' if the linker doesn't understand this.
Diffstat (limited to 'gas/ChangeLog-2006')
0 files changed, 0 insertions, 0 deletions