PATCH: PR ld/13180: strip -g -> objdump: bad value
Alan Modra
amodra@gmail.com
Mon Sep 12 23:51:00 GMT 2011
On Mon, Sep 12, 2011 at 02:50:07PM -0700, H.J. Lu wrote:
> + /* Remove the group section if all members are removed. */
> + if (!bfd_get_full_section_contents (abfd, sec, &memhunk))
> + {
> + status = 1;
> + bfd_nonfatal_message (NULL, abfd, sec, NULL);
> + return TRUE;
> + }
> +
> + src = memhunk + bfd_section_size (abfd, sec) - 4;
> + for (; src > memhunk; src -= 4)
> + {
> + unsigned int idx;
> + Elf_Internal_Shdr *shdr;
> + idx = H_GET_32 (abfd, src);
> + shdr = elf_elfsections (abfd)[idx];
> + if (!is_strip_section_1 (abfd, shdr->bfd_section))
> + break;
> + }
> +
> + free (memhunk);
> +
> + if (src == memhunk)
> + return TRUE;
I think it would be better if you didn't duplicate the low level
group handling code here. Iterate over the group sections using
elf_next_in_group.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list