aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
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/elflink.h
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/elflink.h')
-rw-r--r--bfd/elflink.h47
1 files changed, 27 insertions, 20 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 48b86cf..bd94cbf 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -20,6 +20,8 @@
/* ELF linker code. */
+#include "safe-ctype.h"
+
static bfd_boolean elf_link_add_object_symbols (bfd *, struct bfd_link_info *);
static bfd_boolean elf_link_add_archive_symbols (bfd *,
struct bfd_link_info *);
@@ -1607,27 +1609,32 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
&& is_elf_hash_table (info)
&& (info->strip != strip_all && info->strip != strip_debugger))
{
- asection *stab, *stabstr;
-
- stab = bfd_get_section_by_name (abfd, ".stab");
- if (stab != NULL
- && (stab->flags & SEC_MERGE) == 0
- && !bfd_is_abs_section (stab->output_section))
+ asection *stabstr;
+
+ stabstr = bfd_get_section_by_name (abfd, ".stabstr");
+ if (stabstr != NULL)
{
- stabstr = bfd_get_section_by_name (abfd, ".stabstr");
-
- if (stabstr != NULL)
- {
- struct bfd_elf_section_data *secdata;
-
- secdata = elf_section_data (stab);
- if (! _bfd_link_section_stabs (abfd,
- & hash_table->stab_info,
- stab, stabstr,
- &secdata->sec_info))
- goto error_return;
- if (secdata->sec_info)
- stab->sec_info_type = ELF_INFO_TYPE_STABS;
+ bfd_size_type string_offset = 0;
+ asection *stab;
+
+ for (stab = abfd->sections; stab; stab = stab->next)
+ if (strncmp (".stab", stab->name, 5) == 0
+ && (!stab->name[5] ||
+ (stab->name[5] == '.' && ISDIGIT (stab->name[6])))
+ && (stab->flags & SEC_MERGE) == 0
+ && !bfd_is_abs_section (stab->output_section))
+ {
+ struct bfd_elf_section_data *secdata;
+
+ secdata = elf_section_data (stab);
+ if (! _bfd_link_section_stabs (abfd,
+ & hash_table->stab_info,
+ stab, stabstr,
+ &secdata->sec_info,
+ &string_offset))
+ goto error_return;
+ if (secdata->sec_info)
+ stab->sec_info_type = ELF_INFO_TYPE_STABS;
}
}
}