aboutsummaryrefslogtreecommitdiff
path: root/bfd/libelf.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1993-06-02 21:24:35 +0000
committerKen Raeburn <raeburn@cygnus>1993-06-02 21:24:35 +0000
commit7050286db6c6aeae6a65803a34978ee9e01b5c04 (patch)
tree3ef3b70f9498345f686f38d8b3809f242b682b03 /bfd/libelf.h
parentcef91d759ccb09252c953a954b8d527f176ef247 (diff)
downloadgdb-7050286db6c6aeae6a65803a34978ee9e01b5c04.zip
gdb-7050286db6c6aeae6a65803a34978ee9e01b5c04.tar.gz
gdb-7050286db6c6aeae6a65803a34978ee9e01b5c04.tar.bz2
elfcode.h
Diffstat (limited to 'bfd/libelf.h')
-rw-r--r--bfd/libelf.h71
1 files changed, 54 insertions, 17 deletions
diff --git a/bfd/libelf.h b/bfd/libelf.h
index 3d16ae5..220fdaf 100644
--- a/bfd/libelf.h
+++ b/bfd/libelf.h
@@ -25,44 +25,64 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "elf/internal.h"
#include "elf/external.h"
-#ifdef __STDC__
-#define CAT3(a,b,c) a##b##c
-#else
-#define CAT3(a,b,c) a/**/b/**/c
-#endif
-
-#if ARCH_SIZE==64
#ifndef NAME
+#if ARCH_SIZE==64
#define NAME(x,y) CAT3(x,64_,y)
-#endif
#else /* ARCH_SIZE==32 */
-#ifndef NAME
#define NAME(x,y) CAT3(x,32_,y)
#endif
#endif
+#define ElfNAME(X) NAME(Elf,X)
+#define elfNAME(X) NAME(elf,X)
+
typedef struct
{
asymbol symbol;
- NAME(Elf,Internal_Sym) internal_elf_sym;
- NAME(Elf,External_Sym) native_elf_sym;
+ ElfNAME (Internal_Sym) internal_elf_sym;
+ ElfNAME (External_Sym) native_elf_sym;
/* these are used for the generation of .stabX symbols (?) */
short desc;
unsigned char type;
char other;
-} NAME(elf,symbol_type);
+ union
+ {
+ unsigned int hppa_arg_reloc;
+ PTR any;
+ }
+ tc_data;
+}
-struct NAME(elf,backend_data) {
- void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,
- NAME(Elf,Internal_Rela) *));
+elfNAME (symbol_type);
+
+/* Lacking nested functions and nested types, set up for mapping over
+ BFD sections to produce ELF sections. */
+typedef struct
+{
+ ElfNAME (Internal_Ehdr) * i_ehdr;
+ ElfNAME (Internal_Shdr) * i_shdrp;
+ struct strtab *shstrtab;
+ int symtab_section;
+}
+
+elf_sect_thunk;
+
+struct elfNAME(backend_data)
+{
+ int use_rela_p;
+ int elf_64_p;
enum bfd_architecture arch;
+ void (*elf_info_to_howto) PARAMS ((bfd *, arelent *,
+ ElfNAME (Internal_Rela) *));
+ void (*elf_info_to_howto_rel) PARAMS ((bfd *, arelent *,
+ ElfNAME (Internal_Rel) *));
/* @@ I really don't think this should be here. I don't know what
global_sym is supposed to be used for, but I doubt it's something
that would be considered global, e.g., if you've got a program
reading and writing many BFDs. My hunch is that it's specific to
the output BFD. If not, put a comment here explaining why. */
- NAME(elf,symbol_type) *global_sym;
+ elfNAME (symbol_type) * global_sym;
};
extern bfd_target *bfd_elf32_object_p PARAMS ((bfd *));
@@ -76,6 +96,8 @@ extern boolean bfd_elf32_core_file_matches_executable_p PARAMS ((bfd *,
extern boolean bfd_elf32_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
file_ptr,
bfd_size_type));
+
+extern boolean elf_get_sect_thunk PARAMS ((bfd *, elf_sect_thunk *));
extern unsigned int bfd_elf32_get_symtab_upper_bound PARAMS ((bfd *));
extern unsigned int bfd_elf32_get_symtab PARAMS ((bfd *, asymbol **));
extern unsigned int bfd_elf32_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
@@ -86,7 +108,7 @@ extern asymbol *bfd_elf32_make_empty_symbol PARAMS ((bfd *));
extern void bfd_elf32_print_symbol PARAMS ((bfd *, PTR, asymbol *,
bfd_print_symbol_type));
extern void bfd_elf32_get_symbol_info PARAMS ((bfd *, asymbol *,
- symbol_info *));
+ symbol_info *));
extern alent *bfd_elf32_get_lineno PARAMS ((bfd *, asymbol *));
extern boolean bfd_elf32_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
unsigned long));
@@ -96,9 +118,24 @@ extern boolean bfd_elf32_find_nearest_line PARAMS ((bfd *, asection *,
CONST char **,
unsigned int *));
extern int bfd_elf32_sizeof_headers PARAMS ((bfd *, boolean));
+extern unsigned long elf_hash PARAMS ((CONST unsigned char *));
/* If the target doesn't have reloc handling written yet: */
extern void bfd_elf32_no_info_to_howto PARAMS ((bfd *, arelent *,
Elf32_Internal_Rela *));
+#define get_elf_backend_data(abfd) \
+ ((struct elfNAME (backend_data) *) (abfd)->xvec->backend_data)
+
+struct strtab
+{
+ char *tab;
+ int nentries;
+ int length;
+};
+
+extern struct elf32_internal_shdr *
+bfd_elf_locate_sh PARAMS ((bfd *, struct strtab *,
+ struct elf32_internal_shdr *, CONST char *));
+
#endif /* _LIBELF_H_ */