diff options
author | Alan Modra <amodra@gmail.com> | 2002-07-25 06:54:51 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-07-25 06:54:51 +0000 |
commit | 8c58d23b6d454082b0e55ccb2a948397ab4b58c8 (patch) | |
tree | 6875b3e59ffda2ae412d37c033acf16dcf9bfbac /bfd/elflink.h | |
parent | 8c554d79d1d9d2ee28545381da20e7a88133266e (diff) | |
download | gdb-8c58d23b6d454082b0e55ccb2a948397ab4b58c8.zip gdb-8c58d23b6d454082b0e55ccb2a948397ab4b58c8.tar.gz gdb-8c58d23b6d454082b0e55ccb2a948397ab4b58c8.tar.bz2 |
* elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define
as elf_link_record_local_dynamic_symbol.
(_bfd_elf64_link_record_local_dynamic_symbol): Likewise.
(elf_link_record_local_dynamic_symbol): Declare. Now returns int.
* elflink.h (elf_link_record_local_dynamic_symbol): Move to..
* elflink.c: .. here. Use bfd_elf_get_elf_syms. Check whether an
attempt is made to record a symbol in a discarded section, and
return `2' in that case.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 956f691..29c5551 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2448,93 +2448,6 @@ elf_add_dynamic_entry (info, tag, val) return true; } - -/* Record a new local dynamic symbol. */ - -boolean -elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) - struct bfd_link_info *info; - bfd *input_bfd; - long input_indx; -{ - struct elf_link_local_dynamic_entry *entry; - struct elf_link_hash_table *eht; - struct elf_strtab_hash *dynstr; - Elf_External_Sym esym; - Elf_External_Sym_Shndx eshndx; - Elf_External_Sym_Shndx *shndx; - unsigned long dynstr_index; - char *name; - file_ptr pos; - bfd_size_type amt; - - if (! is_elf_hash_table (info)) - return false; - - /* See if the entry exists already. */ - for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next) - if (entry->input_bfd == input_bfd && entry->input_indx == input_indx) - return true; - - entry = (struct elf_link_local_dynamic_entry *) - bfd_alloc (input_bfd, (bfd_size_type) sizeof (*entry)); - if (entry == NULL) - return false; - - /* Go find the symbol, so that we can find it's name. */ - amt = sizeof (Elf_External_Sym); - pos = elf_tdata (input_bfd)->symtab_hdr.sh_offset + input_indx * amt; - if (bfd_seek (input_bfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) &esym, amt, input_bfd) != amt) - return false; - shndx = NULL; - if (elf_tdata (input_bfd)->symtab_shndx_hdr.sh_size != 0) - { - amt = sizeof (Elf_External_Sym_Shndx); - pos = elf_tdata (input_bfd)->symtab_shndx_hdr.sh_offset; - pos += input_indx * amt; - shndx = &eshndx; - if (bfd_seek (input_bfd, pos, SEEK_SET) != 0 - || bfd_bread ((PTR) shndx, amt, input_bfd) != amt) - return false; - } - elf_swap_symbol_in (input_bfd, (const PTR) &esym, (const PTR) shndx, - &entry->isym); - - name = (bfd_elf_string_from_elf_section - (input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link, - entry->isym.st_name)); - - dynstr = elf_hash_table (info)->dynstr; - if (dynstr == NULL) - { - /* Create a strtab to hold the dynamic symbol names. */ - elf_hash_table (info)->dynstr = dynstr = _bfd_elf_strtab_init (); - if (dynstr == NULL) - return false; - } - - dynstr_index = _bfd_elf_strtab_add (dynstr, name, false); - if (dynstr_index == (unsigned long) -1) - return false; - entry->isym.st_name = dynstr_index; - - eht = elf_hash_table (info); - - entry->next = eht->dynlocal; - eht->dynlocal = entry; - entry->input_bfd = input_bfd; - entry->input_indx = input_indx; - eht->dynsymcount++; - - /* Whatever binding the symbol had before, it's now local. */ - entry->isym.st_info - = ELF_ST_INFO (STB_LOCAL, ELF_ST_TYPE (entry->isym.st_info)); - - /* The dynindx will be set at the end of size_dynamic_sections. */ - - return true; -} /* Read and swap the relocs from the section indicated by SHDR. This may be either a REL or a RELA section. The relocations are |