aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-02-06 23:21:44 +0000
committerAlan Modra <amodra@gmail.com>2005-02-06 23:21:44 +0000
commit1b3a857543e77eedd244b0d7d8cadce4e2e0500e (patch)
tree2fea28b0b37a37d070fb02efd4112fbc4417609a /bfd/elfcode.h
parent7fd26c52dabccc7984990c93b71f36f3c9a83dc9 (diff)
downloadfsf-binutils-gdb-1b3a857543e77eedd244b0d7d8cadce4e2e0500e.zip
fsf-binutils-gdb-1b3a857543e77eedd244b0d7d8cadce4e2e0500e.tar.gz
fsf-binutils-gdb-1b3a857543e77eedd244b0d7d8cadce4e2e0500e.tar.bz2
* elf-bfd.h (elf_string_from_elf_strtab): Delete macro.
* elf.c (bfd_elf_string_from_elf_section): Expand occurrence of elf_string_from_elf_strtab. (_bfd_elf_setup_group_pointers, bfd_section_from_shdr): Likewise. (bfd_section_from_shdr): For SHT_SYMTAB, load SHT_SYMTAB_SHNDX too if it exists. Don't do the reverse for SHT_SYMTAB_SHNDX. For SHT_STRTAB, check whether the strtab is for symtab or dynsymtab by looking at cached symtab info first, before iterating over headers. For SHT_REL and SHT_RELA, load dynsymtab if needed. * elfcode.h (elf_object_p): Don't load section header stringtab
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index e1e995a..87b2663 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -475,7 +475,6 @@ elf_object_p (bfd *abfd)
Elf_Internal_Shdr i_shdr;
Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */
unsigned int shindex;
- char *shstrtab; /* Internal copy of section header stringtab */
const struct elf_backend_data *ebd;
struct bfd_preserve preserve;
asection *s;
@@ -686,12 +685,6 @@ elf_object_p (bfd *abfd)
}
}
- if (i_ehdrp->e_shstrndx && i_ehdrp->e_shoff)
- {
- if (! bfd_section_from_shdr (abfd, i_ehdrp->e_shstrndx))
- goto got_no_match;
- }
-
/* Read in the program headers. */
if (i_ehdrp->e_phnum == 0)
elf_tdata (abfd)->phdr = NULL;
@@ -717,20 +710,10 @@ elf_object_p (bfd *abfd)
}
}
- /* Read in the string table containing the names of the sections. We
- will need the base pointer to this table later. */
- /* We read this inline now, so that we don't have to go through
- bfd_section_from_shdr with it (since this particular strtab is
- used to find all of the ELF section names.) */
-
- if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff)
+ if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff != 0)
{
unsigned int num_sec;
- shstrtab = bfd_elf_get_str_section (abfd, i_ehdrp->e_shstrndx);
- if (!shstrtab)
- goto got_no_match;
-
/* Once all of the section headers have been read and converted, we
can start processing them. Note that the first section header is
a dummy placeholder entry, so we ignore it. */