From 8df52eeeb06efcccd6b840689ad8e11ebb264e7f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 4 Feb 2022 19:30:47 +1030 Subject: Detect .eh_frame_hdr earlier for SIZEOF_HEADERS Current code detects the need for PT_GNU_EH_FRAME using a field set by _bfd_elf_discard_section_eh_frame_hdr, which is called fairly late in the linking process. Use the elf hash table eh_info instead, which is set up earlier by size_dynamic_sections. * elf-bfd.h (struct output_elf_obj_tdata): Delete eh_frame_hdr. (elf_eh_frame_hdr): Don't define. (_bfd_elf_discard_section_eh_frame_hdr): Update prototype. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Delete abfd parameter. Don't set elf_eh_frame_hdr. * elf.c (elf_eh_frame_hdr): New function. (get_program_header_size): Adjust elf_eh_frame_hdr call. (_bfd_elf_map_sections_to_segments): Likewise. --- bfd/elflink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bfd/elflink.c') diff --git a/bfd/elflink.c b/bfd/elflink.c index 2677561..6fa18d9 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -14888,7 +14888,7 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) if (info->eh_frame_hdr_type && !bfd_link_relocatable (info) - && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info)) + && _bfd_elf_discard_section_eh_frame_hdr (info)) changed = 1; return changed; -- cgit v1.1