aboutsummaryrefslogtreecommitdiff
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
commit29ca8dc5bbf7312b8f264e5ad5efee8db6a7d95a (patch)
treee5cba2ea74dcb45d1da4e85db7282c1bff99797f /bfd/stabs.c
parentcd339148dea20e4fffc4a184329a978c7894a9e5 (diff)
downloadgdb-29ca8dc5bbf7312b8f264e5ad5efee8db6a7d95a.zip
gdb-29ca8dc5bbf7312b8f264e5ad5efee8db6a7d95a.tar.gz
gdb-29ca8dc5bbf7312b8f264e5ad5efee8db6a7d95a.tar.bz2
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 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;