aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-target.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-02-14 10:45:51 +1030
committerAlan Modra <amodra@gmail.com>2017-02-16 23:09:38 +1030
commita8c75b765e57aaebb99d4e32e0f228835cff2737 (patch)
tree2cea5382768b3cae9de0e04d151a7313d1024e77 /bfd/elfxx-target.h
parent247d6c4c14769b7576d810a381a68e35388ee874 (diff)
downloadgdb-a8c75b765e57aaebb99d4e32e0f228835cff2737.zip
gdb-a8c75b765e57aaebb99d4e32e0f228835cff2737.tar.gz
gdb-a8c75b765e57aaebb99d4e32e0f228835cff2737.tar.bz2
hppa -z relro again
I misunderstood the hppa alias problem. File offsets of segments need to be such that no page is mapped twice with different permissions. (Which still seems to me like something the kernel could fix, but anyhow, this is not so difficult to achieve in ld.) PR 21000 bfd/ * elf-bfd.h (struct elf_backend_data): Add no_page_alias. * elfxx-target.h (elf_backend_no_page_alias): Define. (elfNN_bed): Init new field. * elf.c (assign_file_positions_for_load_sections): If no_page_alias ensure PT_LOAD segment starts on a new page. * elf32-hppa.c (elf_backend_no_page_alias): Define. ld/ * testsuite/ld-elf/loadaddr1.d: Adjust for hppa file offsets. * testsuite/ld-elf/loadaddr2.d: Likewise. * testsuite/ld-elf/loadaddr3a.d: Likewise. * testsuite/ld-scripts/rgn-at5.d: Likewise.
Diffstat (limited to 'bfd/elfxx-target.h')
-rw-r--r--bfd/elfxx-target.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 00252ce..d063fb7 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -114,6 +114,9 @@
#ifndef elf_backend_want_p_paddr_set_to_zero
#define elf_backend_want_p_paddr_set_to_zero 0
#endif
+#ifndef elf_backend_no_page_alias
+#define elf_backend_no_page_alias 0
+#endif
#ifndef elf_backend_default_execstack
#define elf_backend_default_execstack 1
#endif
@@ -860,6 +863,7 @@ static struct elf_backend_data elfNN_bed =
elf_backend_want_dynbss,
elf_backend_want_dynrelro,
elf_backend_want_p_paddr_set_to_zero,
+ elf_backend_no_page_alias,
elf_backend_default_execstack,
elf_backend_caches_rawsize,
elf_backend_extern_protected_data