summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2013-08-26 19:27:24 +0000
committerRoland McGrath <roland@gnu.org>2013-08-26 19:27:24 +0000
commit5c79b11db972441a103aa6e573b8444a54dcf334 (patch)
treec1d80d3b86a90658ca9cf4bb672308605429d671 /ld
parent43f793cf7160f259b86ad9636ba65a38a25802c2 (diff)
downloadbinutils-redhat-5c79b11db972441a103aa6e573b8444a54dcf334.tar.gz
bfd/
* elf-nacl.c (nacl_modify_segment_map): Fix logic reordering the elf_segment_map list. If an executable segment is page-aligned but does not end with a full page, then append a fake section into the segment map entry that pads out the page. (nacl_final_write_processing): New function. Write the code fill laid out in nacl_modify_segment_map. * elf-nacl.h: Declare it. * elf32-arm.c (elf32_arm_nacl_final_write_processing): New function. (elf_backend_final_write_processing): Define it for NaCl backend. * elf32-i386.c (elf_backend_final_write_processing): Likewise. * elf64-x86-64.c (elf_backend_final_write_processing): Likewise. * elf-nacl.c (segment_eligible_for_headers): Rename MAXPAGESIZE parameter to MINPAGESIZE. (nacl_modify_segment_map): Use minpagesize instead of maxpagesize. * elf32-arm.c (ELF_MINPAGESIZE, ELF_COMMONPAGESIZE): Set to 0x10000 for NaCl targets. ld/testsuite/ * ld-x86-64/ilp32-4-nacl.d: Loosen .shstrtab line regexp to match any file offset. * ld-x86-64/tlsbin-nacl.rd: Update expected code segment PT_LOAD. * ld-x86-64/tlsbindesc-nacl.rd: Likewise. * ld-scripts/rgn-at3.d: XFAIL for *-*-nacl* targets. * ld-scripts/rgn-over8-ok.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog9
-rw-r--r--ld/testsuite/ld-scripts/rgn-at3.d6
-rw-r--r--ld/testsuite/ld-scripts/rgn-over8-ok.d6
-rw-r--r--ld/testsuite/ld-x86-64/ilp32-4-nacl.d2
-rw-r--r--ld/testsuite/ld-x86-64/tlsbin-nacl.rd2
-rw-r--r--ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd2
6 files changed, 22 insertions, 5 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 765d4be6c5..3adba9b2a1 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2013-08-26 Roland McGrath <mcgrathr@google.com>
+
+ * ld-x86-64/ilp32-4-nacl.d: Loosen .shstrtab line regexp to match
+ any file offset.
+ * ld-x86-64/tlsbin-nacl.rd: Update expected code segment PT_LOAD.
+ * ld-x86-64/tlsbindesc-nacl.rd: Likewise.
+ * ld-scripts/rgn-at3.d: XFAIL for *-*-nacl* targets.
+ * ld-scripts/rgn-over8-ok.d: Likewise.
+
2013-08-24 Maciej W. Rozycki <macro@linux-mips.org>
* ld-elf/comm-data.exp: Use check_shared_lib_support rather than
diff --git a/ld/testsuite/ld-scripts/rgn-at3.d b/ld/testsuite/ld-scripts/rgn-at3.d
index 1d21956b7b..b0ea08a260 100644
--- a/ld/testsuite/ld-scripts/rgn-at3.d
+++ b/ld/testsuite/ld-scripts/rgn-at3.d
@@ -2,9 +2,13 @@
# source: rgn-at.s
# ld: -T rgn-at3.t
# objdump: -w -h
-# xfail: rx-*-*
+# xfail: rx-*-* *-*-nacl*
# FAILS on the RX because the linker has to set LMA == VMA for the
# Renesas loader.
+# FAILs on NaCl targets because the linker extends the first segment
+# to fill out the page, making its p_vaddr+p_memsz cover the sh_addr
+# of .bss too, which makes BFD compute its LMA from the p_paddr of the
+# text segment.
.*: file format .*
diff --git a/ld/testsuite/ld-scripts/rgn-over8-ok.d b/ld/testsuite/ld-scripts/rgn-over8-ok.d
index 300e94788a..fe6b1c9c21 100644
--- a/ld/testsuite/ld-scripts/rgn-over8-ok.d
+++ b/ld/testsuite/ld-scripts/rgn-over8-ok.d
@@ -2,9 +2,13 @@
# source: rgn-over8.s
# ld: -T rgn-over8.t
# objdump: -w -h
-# xfail: rx-*-*
+# xfail: rx-*-* *-*-nacl*
# FAILS on the RX because the linker has to set LMA == VMA for the
# Renesas loader.
+# FAILs on NaCl targets because the linker extends the first segment
+# to fill out the page, making its p_vaddr+p_memsz cover the sh_addr
+# of .bss too, which makes BFD compute its LMA from the p_paddr of the
+# text segment.
.*: file format .*
diff --git a/ld/testsuite/ld-x86-64/ilp32-4-nacl.d b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d
index 8170e1353a..181868c1a4 100644
--- a/ld/testsuite/ld-x86-64/ilp32-4-nacl.d
+++ b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d
@@ -14,7 +14,7 @@ Section Headers:
+\[ 3\] \.dynsym +DYNSYM +100000e0 +0+e0 +0+60 +10 +A +4 +2 +4
+\[ 4\] \.dynstr +STRTAB +10000140 +0+140 +0+19 +00 +A +0 +0 +1
+\[ 5\] \.dynamic +DYNAMIC +1001015c +0+15c +0+58 +08 +WA +4 +0 +4
- +\[ 6\] \.shstrtab +STRTAB +0+ +0+10001 +0+40 +00 +0 +0 +1
+ +\[ 6\] \.shstrtab +STRTAB +0+ +[0-9a-f]+ +0+40 +00 +0 +0 +1
+\[ 7\] \.symtab +SYMTAB +0+0 +[0-9a-f]+ +[0-9a-f]+ +10 +8 +[0-9] +4
+\[ 8\] \.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +00 +0 +0 +1
Key to Flags:
diff --git a/ld/testsuite/ld-x86-64/tlsbin-nacl.rd b/ld/testsuite/ld-x86-64/tlsbin-nacl.rd
index c0a8502ef2..86f1fe1816 100644
--- a/ld/testsuite/ld-x86-64/tlsbin-nacl.rd
+++ b/ld/testsuite/ld-x86-64/tlsbin-nacl.rd
@@ -40,7 +40,7 @@ Program Headers:
+PHDR.*
+INTERP.*
.*Requesting program interpreter.*
- +LOAD +0x0+10000 0x0+20000 0x0+20000 0x0+1231 0x0+1231 R E +0x10000
+ +LOAD +0x0+10000 0x0+20000 0x0+20000 0x0+10000 0x0+10000 R E +0x10000
+LOAD +0x0+ 0x0+10020000 0x0+10020000 0x0+3b0 0x0+3b0 R +0x10000
+LOAD +0x0+3b0 0x0+100303b0 0x0+100303b0 0x0+1e0 0x0+1e0 RW +0x10000
+DYNAMIC +0x0+410 0x0+10030410 0x0+10030410 0x0+140 0x0+140 RW +0x8
diff --git a/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd b/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd
index 51ff16c3ff..67f660be88 100644
--- a/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd
+++ b/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd
@@ -38,7 +38,7 @@ Program Headers:
+PHDR.*
+INTERP.*
.*Requesting program interpreter.*
- +LOAD +0x0+10000 0x0+20000 0x0+20000 0x0+1fd 0x0+1fd R E 0x10000
+ +LOAD +0x0+10000 0x0+20000 0x0+20000 0x0+10000 0x0+10000 R E 0x10000
+LOAD +0x0+ 0x0+10020000 0x0+10020000 0x0+370 0x0+370 R +0x10000
+LOAD +0x0+370 0x0+10030370 0x0+10030370 0x0+198 0x0+198 RW +0x10000
+DYNAMIC +0x0+3d0 0x0+100303d0 0x0+100303d0 0x0+100 0x0+100 RW +0x8