summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
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 /bfd/elf32-arm.c
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 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 6d2d5534b1..5af1643bf5 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -15860,6 +15860,14 @@ elf32_arm_nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
&& nacl_modify_segment_map (abfd, info));
}
+static void
+elf32_arm_nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+ elf32_arm_final_write_processing (abfd, linker);
+ nacl_final_write_processing (abfd, linker);
+}
+
+
#undef elf32_bed
#define elf32_bed elf32_arm_nacl_bed
#undef bfd_elf32_bfd_link_hash_table_create
@@ -15871,9 +15879,14 @@ elf32_arm_nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
#define elf_backend_modify_segment_map elf32_arm_nacl_modify_segment_map
#undef elf_backend_modify_program_headers
#define elf_backend_modify_program_headers nacl_modify_program_headers
+#undef elf_backend_final_write_processing
+#define elf_backend_final_write_processing elf32_arm_nacl_final_write_processing
#undef ELF_MAXPAGESIZE
#define ELF_MAXPAGESIZE 0x10000
+#undef ELF_MINPAGESIZE
+#undef ELF_COMMONPAGESIZE
+
#include "elf32-target.h"
@@ -15882,6 +15895,13 @@ elf32_arm_nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
#undef elf_backend_modify_segment_map
#define elf_backend_modify_segment_map elf32_arm_modify_segment_map
#undef elf_backend_modify_program_headers
+#undef elf_backend_final_write_processing
+#define elf_backend_final_write_processing elf32_arm_final_write_processing
+#undef ELF_MINPAGESIZE
+#define ELF_MINPAGESIZE 0x1000
+#undef ELF_COMMONPAGESIZE
+#define ELF_COMMONPAGESIZE 0x1000
+
/* VxWorks Targets. */