summaryrefslogtreecommitdiff
path: root/bfd/stabs.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-10-07 08:53:42 +0000
committerNathan Sidwell <nathan@codesourcery.com>2003-10-07 08:53:42 +0000
commitafcc52fc8495e679fc81a84742293766923ec731 (patch)
treeb0a8022beebbab966af0a853db1654acd03c6288 /bfd/stabs.c
parent663de987e6b34497f8aa33aa67f0ddf6da983ebc (diff)
downloadbinutils-redhat-afcc52fc8495e679fc81a84742293766923ec731.tar.gz
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.
Diffstat (limited to 'bfd/stabs.c')
-rw-r--r--bfd/stabs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bfd/stabs.c b/bfd/stabs.c
index 6e6d290d46..13c60497ea 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;