This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
delete bfd_elf_find_section
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 2 Feb 2009 13:59:20 +1030
- Subject: delete bfd_elf_find_section
bfd_elf_find_section hasn't been used by gdb for ages, so let's delete
it. I also couldn't find a use for bfd_elf_get_str_section outside of
elf.c
* elf-bfd.h (bfd_elf_get_str_section): Don't declare.
(bfd_elf_find_section, _sh_elf_set_mach_from_flags): Likewise.
* elf.c (bfd_elf_get_str_section): Make static.
(bfd_elf_find_section): Delete.
* libbfd.h: Regenerate.
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.279
diff -u -p -r1.279 elf-bfd.h
--- bfd/elf-bfd.h 23 Jan 2009 12:15:27 -0000 1.279
+++ bfd/elf-bfd.h 2 Feb 2009 00:10:10 -0000
@@ -1626,8 +1626,6 @@ extern unsigned int _bfd_elf_section_fro
(bfd *, asection *);
extern char *bfd_elf_string_from_elf_section
(bfd *, unsigned, unsigned);
-extern char *bfd_elf_get_str_section
- (bfd *, unsigned);
extern Elf_Internal_Sym *bfd_elf_get_elf_syms
(bfd *, Elf_Internal_Shdr *, size_t, size_t, Elf_Internal_Sym *, void *,
Elf_External_Sym_Shndx *);
@@ -1671,8 +1669,6 @@ extern bfd_boolean bfd_elf_make_generic_
(bfd *);
extern bfd_boolean bfd_elf_mkcorefile
(bfd *);
-extern Elf_Internal_Shdr *bfd_elf_find_section
- (bfd *, char *);
extern bfd_boolean _bfd_elf_make_section_from_shdr
(bfd *, Elf_Internal_Shdr *, const char *, int);
extern bfd_boolean _bfd_elf_make_section_from_phdr
@@ -2143,11 +2139,6 @@ extern bfd_boolean _bfd_elf_merge_object
/* Large common section. */
extern asection _bfd_elf_large_com_section;
-/* SH ELF specific routine. */
-
-extern bfd_boolean _sh_elf_set_mach_from_flags
- (bfd *);
-
/* This is the condition under which finish_dynamic_symbol will be called.
If our finish_dynamic_symbol isn't called, we'll need to do something
about initializing any .plt and .got entries in relocate_section. */
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.475
diff -u -p -r1.475 elf.c
--- bfd/elf.c 15 Jan 2009 12:42:52 -0000 1.475
+++ bfd/elf.c 2 Feb 2009 00:10:15 -0000
@@ -258,7 +258,7 @@ bfd_elf_mkcorefile (bfd *abfd)
return bfd_elf_make_generic_object (abfd);
}
-char *
+static char *
bfd_elf_get_str_section (bfd *abfd, unsigned int shindex)
{
Elf_Internal_Shdr **i_shdrp;
@@ -1019,45 +1019,6 @@ _bfd_elf_make_section_from_shdr (bfd *ab
return TRUE;
}
-/*
-INTERNAL_FUNCTION
- bfd_elf_find_section
-
-SYNOPSIS
- struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name);
-
-DESCRIPTION
- Helper functions for GDB to locate the string tables.
- Since BFD hides string tables from callers, GDB needs to use an
- internal hook to find them. Sun's .stabstr, in particular,
- isn't even pointed to by the .stab section, so ordinary
- mechanisms wouldn't work to find it, even if we had some.
-*/
-
-struct elf_internal_shdr *
-bfd_elf_find_section (bfd *abfd, char *name)
-{
- Elf_Internal_Shdr **i_shdrp;
- char *shstrtab;
- unsigned int max;
- unsigned int i;
-
- i_shdrp = elf_elfsections (abfd);
- if (i_shdrp != NULL)
- {
- shstrtab = bfd_elf_get_str_section (abfd,
- elf_elfheader (abfd)->e_shstrndx);
- if (shstrtab != NULL)
- {
- max = elf_numsections (abfd);
- for (i = 1; i < max; i++)
- if (!strcmp (&shstrtab[i_shdrp[i]->sh_name], name))
- return i_shdrp[i];
- }
- }
- return 0;
-}
-
const char *const bfd_elf_section_type_names[] = {
"SHT_NULL", "SHT_PROGBITS", "SHT_SYMTAB", "SHT_STRTAB",
"SHT_RELA", "SHT_HASH", "SHT_DYNAMIC", "SHT_NOTE",
Index: bfd/libbfd.h
===================================================================
RCS file: /cvs/src/src/bfd/libbfd.h,v
retrieving revision 1.209
diff -u -p -r1.209 libbfd.h
--- bfd/libbfd.h 23 Dec 2008 19:10:18 -0000 1.209
+++ bfd/libbfd.h 2 Feb 2009 00:10:33 -0000
@@ -2075,5 +2077,3 @@ bfd_boolean bfd_default_scan
(const struct bfd_arch_info *info, const char *string);
/* Extracted from elf.c. */
-struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name);
-
--
Alan Modra
Australia Development Lab, IBM