mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
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.
This commit is contained in:
@ -4349,6 +4349,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
unsigned int tagv = dyn.d_un.d_val;
|
||||
audit = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
|
||||
}
|
||||
if (dyn.d_tag == DT_FLAGS_1)
|
||||
elf_tdata (abfd)->is_pie = (dyn.d_un.d_val & DF_1_PIE) != 0;
|
||||
}
|
||||
|
||||
free (dynbuf);
|
||||
|
Reference in New Issue
Block a user