diff options
author | Daniel Jacobowitz <drow@false.org> | 2004-06-17 02:27:12 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2004-06-17 02:27:12 +0000 |
commit | 8528d62e32504a993c2c653ac34ec81fba897e9e (patch) | |
tree | e0499d6745e7ee32a14c40aef4ea9371ea2c91d8 /bfd/elf32-ppc.c | |
parent | a8fc9bf447e7f0929c341ae7f919acd48159027d (diff) | |
download | gdb-8528d62e32504a993c2c653ac34ec81fba897e9e.zip gdb-8528d62e32504a993c2c653ac34ec81fba897e9e.tar.gz gdb-8528d62e32504a993c2c653ac34ec81fba897e9e.tar.bz2 |
* elf32-ppc.c (ppc_elf_create_linker_section): Create symbols in
the pre-existing section.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r-- | bfd/elf32-ppc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 980dcb9..be05270 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -2593,7 +2593,7 @@ ppc_elf_create_linker_section (bfd *abfd, { elf_linker_section_t *lsect; struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info); - asection *s; + asection *s, *sym_sec; bfd_size_type amt; flagword flags; const char *name; @@ -2642,13 +2642,15 @@ ppc_elf_create_linker_section (bfd *abfd, lsect->sym_offset = sym_offset; /* See if the sections already exist. */ - s = bfd_get_section_by_name (htab->elf.dynobj, name); + sym_sec = s = bfd_get_section_by_name (htab->elf.dynobj, name); if (s == NULL || (s->flags & flags) != flags) { s = bfd_make_section_anyway (htab->elf.dynobj, name); if (s == NULL || !bfd_set_section_flags (htab->elf.dynobj, s, flags)) return NULL; + if (sym_sec == NULL) + sym_sec = s; } lsect->section = s; @@ -2676,7 +2678,7 @@ ppc_elf_create_linker_section (bfd *abfd, if ((bh == NULL || bh->type == bfd_link_hash_undefined) && !(_bfd_generic_link_add_one_symbol - (info, abfd, sym_name, BSF_GLOBAL, s, sym_offset, NULL, + (info, abfd, sym_name, BSF_GLOBAL, sym_sec, sym_offset, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) return NULL; h = (struct elf_link_hash_entry *) bh; |