aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-02-08 10:33:17 +1030
committerAlan Modra <amodra@gmail.com>2022-02-13 14:00:56 +1030
commit7d6aa4b321f2722512be7422394629eec526448b (patch)
tree7d133ad767ab4844a056e2682ed5eccc9ab2e4bf
parent31b4d3a16f200bf04db8439a63b72bba7af4e1be (diff)
downloadgdb-7d6aa4b321f2722512be7422394629eec526448b.zip
gdb-7d6aa4b321f2722512be7422394629eec526448b.tar.gz
gdb-7d6aa4b321f2722512be7422394629eec526448b.tar.bz2
Remove bfd ELF_RELROPAGESIZE
Now that ld properly aligns the end of the relro segment, the hack to make relro work on powerpc can disappear. bfd/ * bfd.c (bfd_emul_get_commonpagesize): Remove relro param. Don't return bed->relropagesize. * elf-bfd.h (struct elf_backend_data): Remove relropagesize. * elfxx-target.h (ELF_RELROPAGESIZE): Remove. * elf32-ppc.c (ELF_RELROPAGESIZE): Don't define. * elf64-ppc.c: Likewise. * bfd-in2.h: Regenerate. ld/ * ldemul.c (after_parse_default): Adjust bfd_emul_get_commonpagesize call.
-rw-r--r--bfd/bfd-in2.h2
-rw-r--r--bfd/bfd.c9
-rw-r--r--bfd/elf-bfd.h3
-rw-r--r--bfd/elf32-ppc.c1
-rw-r--r--bfd/elf64-ppc.c1
-rw-r--r--bfd/elfxx-target.h11
-rw-r--r--ld/ldemul.c3
7 files changed, 5 insertions, 25 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 8e815ba..3b2a4f4 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -7273,7 +7273,7 @@ bool bfd_alt_mach_code (bfd *abfd, int alternative);
bfd_vma bfd_emul_get_maxpagesize (const char *);
-bfd_vma bfd_emul_get_commonpagesize (const char *, bool);
+bfd_vma bfd_emul_get_commonpagesize (const char *);
char *bfd_demangle (bfd *, const char *, int);
diff --git a/bfd/bfd.c b/bfd/bfd.c
index d833713..913ce2d 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -2344,7 +2344,7 @@ FUNCTION
bfd_emul_get_commonpagesize
SYNOPSIS
- bfd_vma bfd_emul_get_commonpagesize (const char *, bool);
+ bfd_vma bfd_emul_get_commonpagesize (const char *);
DESCRIPTION
Returns the common page size, in bytes, as determined by
@@ -2355,7 +2355,7 @@ RETURNS
*/
bfd_vma
-bfd_emul_get_commonpagesize (const char *emul, bool relro)
+bfd_emul_get_commonpagesize (const char *emul)
{
const bfd_target *target;
@@ -2366,10 +2366,7 @@ bfd_emul_get_commonpagesize (const char *emul, bool relro)
const struct elf_backend_data *bed;
bed = xvec_get_elf_backend_data (target);
- if (relro)
- return bed->relropagesize;
- else
- return bed->commonpagesize;
+ return bed->commonpagesize;
}
return 0;
}
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 1d3ae76..889a474 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -946,9 +946,6 @@ struct elf_backend_data
/* The common page size for this backend. */
bfd_vma commonpagesize;
- /* The value of commonpagesize to use when -z relro for this backend. */
- bfd_vma relropagesize;
-
/* The p_align value for this backend. If it is set, p_align of
PT_LOAD alignment will be to p_align by default. */
bfd_vma p_align;
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 5305130..42273ca 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -10373,7 +10373,6 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd,
#define ELF_MACHINE_CODE EM_PPC
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x1000
-#define ELF_RELROPAGESIZE ELF_MAXPAGESIZE
#define elf_info_to_howto ppc_elf_info_to_howto
#ifdef EM_CYGNUS_POWERPC
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 7b7bfa1..dd79c05 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -75,7 +75,6 @@ static bfd_vma opd_entry_value
#define ELF_MACHINE_CODE EM_PPC64
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x1000
-#define ELF_RELROPAGESIZE ELF_MAXPAGESIZE
#define elf_info_to_howto ppc64_elf_info_to_howto
#define elf_backend_want_got_sym 0
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index e31985e..0579f64 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -379,10 +379,6 @@
#define ELF_COMMONPAGESIZE ELF_MAXPAGESIZE
#endif
-#ifndef ELF_RELROPAGESIZE
-#define ELF_RELROPAGESIZE ELF_COMMONPAGESIZE
-#endif
-
#ifndef ELF_MINPAGESIZE
#define ELF_MINPAGESIZE ELF_COMMONPAGESIZE
#endif
@@ -390,15 +386,9 @@
#if ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
# error ELF_COMMONPAGESIZE > ELF_MAXPAGESIZE
#endif
-#if ELF_RELROPAGESIZE > ELF_MAXPAGESIZE
-# error ELF_RELROPAGESIZE > ELF_MAXPAGESIZE
-#endif
#if ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
# error ELF_MINPAGESIZE > ELF_COMMONPAGESIZE
#endif
-#if ELF_MINPAGESIZE > ELF_RELROPAGESIZE
-# error ELF_MINPAGESIZE > ELF_RELROPAGESIZE
-#endif
#ifndef ELF_P_ALIGN
#define ELF_P_ALIGN 0
@@ -822,7 +812,6 @@ static const struct elf_backend_data elfNN_bed =
ELF_MAXPAGESIZE, /* maxpagesize */
ELF_MINPAGESIZE, /* minpagesize */
ELF_COMMONPAGESIZE, /* commonpagesize */
- ELF_RELROPAGESIZE, /* commonpagesize to use with -z relro */
ELF_P_ALIGN, /* p_align */
ELF_DYNAMIC_SEC_FLAGS, /* dynamic_sec_flags */
elf_backend_arch_data,
diff --git a/ld/ldemul.c b/ld/ldemul.c
index 5c5adef..85c00de 100644
--- a/ld/ldemul.c
+++ b/ld/ldemul.c
@@ -235,8 +235,7 @@ after_parse_default (void)
if (link_info.maxpagesize == 0)
link_info.maxpagesize = bfd_emul_get_maxpagesize (default_target);
if (link_info.commonpagesize == 0)
- link_info.commonpagesize = bfd_emul_get_commonpagesize (default_target,
- link_info.relro);
+ link_info.commonpagesize = bfd_emul_get_commonpagesize (default_target);
}
void