aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-06-11 14:06:47 +0930
committerAlan Modra <amodra@gmail.com>2021-06-11 14:06:47 +0930
commitf64b9b13ce4bb927f47a1fe0257c3794c6357c8c (patch)
tree241f0a0b457807eb8e4ec179728e38899087ebe5 /bfd/elf-bfd.h
parent860cc54cd40334ec8709529f01e42fb4ac50b54f (diff)
downloadgdb-f64b9b13ce4bb927f47a1fe0257c3794c6357c8c.zip
gdb-f64b9b13ce4bb927f47a1fe0257c3794c6357c8c.tar.gz
gdb-f64b9b13ce4bb927f47a1fe0257c3794c6357c8c.tar.bz2
PR27952, Disallow ET_DYN DF_1_PIE linker input
This patch adds a new elf_tdata flag, is_pie, set during the linker's open_input_bfds processing. The flag is then used to reject attempts to link a PIE as if it were a shared library. bfd/ PR 27952 * elf-bfd.h (struct elf_obj_tdata): Add is_pie. * elflink.c (elf_link_add_object_symbols): Set is_pie. ld/ PR 27952 * ldelf.c (ldelf_after_open): Error on input PIEs too.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 92b1722..8f985ab 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2080,6 +2080,9 @@ struct elf_obj_tdata
symbols. */
unsigned int bad_symtab : 1;
+ /* Set if DT_FLAGS_1 has DF_1_PIE set. */
+ unsigned int is_pie : 1;
+
/* Information grabbed from an elf core file. */
struct core_elf_obj_tdata *core;