From: Alan Modra Date: Fri, 10 Aug 2012 02:14:50 +0000 (+0000) Subject: PR binutils/14444 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44534af395e517016f70c2b0baee26f810391843;p=binutils-gdb.git PR binutils/14444 * elf.c (IS_VALID_GROUP_SECTION_HEADER) Add minsize param. (setup_group): Adjust uses. (bfd_section_from_shdr): Allow SHT_GROUP sections with just a flag word. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index af00be77bc0..b1dcf8607cd 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2012-08-10 Alan Modra + + PR binutils/14444 + * elf.c (IS_VALID_GROUP_SECTION_HEADER) Add minsize param. + (setup_group): Adjust uses. + (bfd_section_from_shdr): Allow SHT_GROUP sections with just a flag + word. + 2012-08-09 Nick Clifton * po/vi.po: Updated Vietnamese translation. @@ -139,47 +147,47 @@ * dwarf2.c (struct line_info): Add discriminator field. (add_line_info): Fill in new discriminator field. (decode_line_info): Record discriminator information instead - of ignoring it. + of ignoring it. (lookup_address_in_line_info_table): Return discriminator field if - requested. + requested. (comp_unit_find_nearest_line): Add discriminator argument. (find_line): Likewise. (_bfd_dwarf2_find_nearest_line): Likewise. (_bfd_dwarf2_find_line): Likewise. * elf-bfd.h (_bfd_elf_find_nearest_line_discriminator): New. - (_bfd_elf_find_line_discriminator): Likewise. - (_bfd_generic_find_nearest_line_discriminator): Likewise. Defined. + (_bfd_elf_find_line_discriminator): Likewise. + (_bfd_generic_find_nearest_line_discriminator): Likewise. Defined. * elf.c (_bfd_elf_find_nearest_line): Change to a wrapper - that invokes _bfd_elf_find_nearest_line_discriminator with correct - arguments. + that invokes _bfd_elf_find_nearest_line_discriminator with correct + arguments. (_bfd_elf_find_nearest_line_discriminator): New. (_bfd_elf_find_line): Change to a wrapper - that invokes _bfd_elf_find_line_discriminator with correct - arguments. + that invokes _bfd_elf_find_line_discriminator with correct + arguments. (_bfd_elf_find_line_discriminator): New. * coffgen.c (coff_find_nearest_line_with_names): Handle - new discriminator argument. + new discriminator argument. * elf32-arm.c (elf32_arm_find_nearest_line): Likewise. * elf64-alpha.c (elf64_alpha_find_nearest_line): Likewise. * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise. * mach-o.c (bfd_mach_o_find_nearest_line): Likewise. * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Add discriminator - argument. - (_bfd_dwarf2_find_line): Likewise. - (_bfd_generic_find_nearest_line_discriminator): New. + argument. + (_bfd_dwarf2_find_line): Likewise. + (_bfd_generic_find_nearest_line_discriminator): New. * libbfd.c (_bfd_generic_find_nearest_line_discriminator): New. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. * targets.c (BFD_JUMP_TABLE_SYMBOLS): Initialize - _bfd_find_nearest_line_discriminator with - _bfd_generic_find_nearest_line_discriminator. - (bfd_target): Add _bfd_find_nearest_line_discriminator. + _bfd_find_nearest_line_discriminator with + _bfd_generic_find_nearest_line_discriminator. + (bfd_target): Add _bfd_find_nearest_line_discriminator. 2012-07-24 Sean Keys - * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Added code + * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Added code that enables the linker to offset addresses, when linking against - symbols from the XGATE processor and vice versa. + symbols from the XGATE processor and vice versa. 2012-07-23 Nick Clifton @@ -657,7 +665,7 @@ 2012-05-23 Alan Modra * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Handle - BFDs with multiple .eh_frame sections. + BFDs with multiple .eh_frame sections. 2012-05-23 Alan Modra @@ -891,8 +899,8 @@ 2012-05-16 Alan Modra - PR ld/13962 - PR ld/7023 + PR ld/13962 + PR ld/7023 * elf.c (bfd_section_from_shdr): Fail when .dynsym sh_info is out of range. As a special case, fix sh_info for zero sh_size. Do the same for .symtab. diff --git a/bfd/elf.c b/bfd/elf.c index 0ac4032b699..0208e05ec1f 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -545,9 +545,9 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) shnum = elf_numsections (abfd); num_group = 0; -#define IS_VALID_GROUP_SECTION_HEADER(shdr) \ +#define IS_VALID_GROUP_SECTION_HEADER(shdr, minsize) \ ( (shdr)->sh_type == SHT_GROUP \ - && (shdr)->sh_size >= (2 * GRP_ENTRY_SIZE) \ + && (shdr)->sh_size >= minsize \ && (shdr)->sh_entsize == GRP_ENTRY_SIZE \ && ((shdr)->sh_size % GRP_ENTRY_SIZE) == 0) @@ -555,7 +555,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) { Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; - if (IS_VALID_GROUP_SECTION_HEADER (shdr)) + if (IS_VALID_GROUP_SECTION_HEADER (shdr, 2 * GRP_ENTRY_SIZE)) num_group += 1; } @@ -581,7 +581,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) { Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[i]; - if (IS_VALID_GROUP_SECTION_HEADER (shdr)) + if (IS_VALID_GROUP_SECTION_HEADER (shdr, 2 * GRP_ENTRY_SIZE)) { unsigned char *src; Elf_Internal_Group *dest; @@ -1929,7 +1929,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) return TRUE; case SHT_GROUP: - if (! IS_VALID_GROUP_SECTION_HEADER (hdr)) + if (! IS_VALID_GROUP_SECTION_HEADER (hdr, GRP_ENTRY_SIZE)) return FALSE; if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) return FALSE;