From 29ca8dc5bbf7312b8f264e5ad5efee8db6a7d95a Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 7 Oct 2003 08:53:42 +0000 Subject: bfd/Changelog: * libbfd-in.h (_bfd_link_section_stabs): Add string offset parameter. * cofflink.c (coff_link_add_symbols): Deal with split stab sections. * elflink.h (elf_link_add_object_symbols): Deal with split stab sections. * stabs.c (_bfd_link_section_stabs): Add string offset parameter. * libbfd.h: Regenerated. ld/ChangeLog: * ldwrite.c (unsplittable_name): New. (clone_section): Strip existing numeric suffix. Only truncate names for coff targets. (split_sections): Use unsplittable_name. binutils/ChangeLog: * objdump.c (read_section_stabs): Just read one section, return pointer to it. Add size parameter. (print_section_stabs): Add string offset parameter. Adjust. (struct stab_section_names): Add string offset member. (find_stabs_sections): Correct check for split section suffix, adjust read_section_stabs and print_section_stabs calls. (dump_stabs_section): Clear string_offset, free string table. --- bfd/stabs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bfd/stabs.c') diff --git a/bfd/stabs.c b/bfd/stabs.c index 6e6d290..13c6049 100644 --- a/bfd/stabs.c +++ b/bfd/stabs.c @@ -169,12 +169,13 @@ stab_link_includes_newfunc (entry, table, string) pass of the linker. */ bfd_boolean -_bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) +_bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo, pstring_offset) bfd *abfd; PTR *psinfo; asection *stabsec; asection *stabstrsec; PTR *psecinfo; + bfd_size_type *pstring_offset; { bfd_boolean first; struct stab_info *sinfo; @@ -276,7 +277,11 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) and identify N_BINCL symbols which can be eliminated. */ stroff = 0; - next_stroff = 0; + /* The stabs sections can be split when + -split-by-reloc/-split-by-file is used. We must keep track of + each stab section's place in the single concatenated string + table. */ + next_stroff = pstring_offset ? *pstring_offset : 0; skip = 0; symend = stabbuf + stabsec->_raw_size; @@ -302,6 +307,8 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) string table. We only copy the very first one. */ stroff = next_stroff; next_stroff += bfd_get_32 (abfd, sym + 8); + if (pstring_offset) + *pstring_offset = next_stroff; if (! first) { *pstridx = (bfd_size_type) -1; -- cgit v1.1