aboutsummaryrefslogtreecommitdiff
path: root/bfd/libnlm.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-03-30 22:15:07 +0000
committerIan Lance Taylor <ian@airs.com>1994-03-30 22:15:07 +0000
commit326e32d7ce8a83f59192657c48c9b9980466b939 (patch)
treea6d893226affe8172c0ad504e14f8aded908d849 /bfd/libnlm.h
parent70f42bae0b1b4d71dfa1b0da6a29d1e82053b118 (diff)
downloadgdb-326e32d7ce8a83f59192657c48c9b9980466b939.zip
gdb-326e32d7ce8a83f59192657c48c9b9980466b939.tar.gz
gdb-326e32d7ce8a83f59192657c48c9b9980466b939.tar.bz2
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
Diffstat (limited to 'bfd/libnlm.h')
-rw-r--r--bfd/libnlm.h66
1 files changed, 46 insertions, 20 deletions
diff --git a/bfd/libnlm.h b/bfd/libnlm.h
index 22d779d..cf6885d 100644
--- a/bfd/libnlm.h
+++ b/bfd/libnlm.h
@@ -58,17 +58,17 @@ extern boolean nlm_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
extern void nlmNAME(get_symbol_info)
PARAMS ((bfd *, asymbol *, symbol_info *));
-extern unsigned int nlmNAME(get_symtab_upper_bound)
+extern long nlmNAME(get_symtab_upper_bound)
PARAMS ((bfd *));
-extern unsigned int nlmNAME(get_symtab)
+extern long nlmNAME(get_symtab)
PARAMS ((bfd *, asymbol **));
extern asymbol *nlmNAME(make_empty_symbol)
PARAMS ((bfd *));
extern void nlmNAME(print_symbol)
PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
-extern unsigned int nlmNAME(get_reloc_upper_bound)
+extern long nlmNAME(get_reloc_upper_bound)
PARAMS ((bfd *, asection *));
-extern unsigned int nlmNAME(canonicalize_reloc)
+extern long nlmNAME(canonicalize_reloc)
PARAMS ((bfd *, asection *, arelent **, asymbol **));
extern bfd_target *nlmNAME(object_p)
PARAMS ((bfd *));
@@ -99,6 +99,20 @@ struct nlm_obj_tdata
/* Caches for data read from object file. */
arelent * nlm_reloc_fixups;
asection ** nlm_reloc_fixup_secs;
+ /* Backend specific information. This should probably be a pointer,
+ but that would require yet another entry point to initialize the
+ structure. */
+ union
+ {
+ struct /* Alpha backend information. */
+ {
+ bfd_vma gp; /* GP value. */
+ bfd_vma lita_address; /* .lita section address. */
+ bfd_size_type lita_size; /* .lita section size. */
+ }
+ alpha_backend_data;
+ }
+ backend_data;
};
#define nlm_tdata(bfd) ((bfd) -> tdata.nlm_obj_data)
@@ -117,6 +131,9 @@ struct nlm_obj_tdata
#define nlm_relocation_fixups(bfd) (nlm_tdata(bfd) -> nlm_reloc_fixups)
#define nlm_relocation_fixup_secs(bfd) (nlm_tdata(bfd)->nlm_reloc_fixup_secs)
+#define nlm_alpha_backend_data(bfd) \
+ (&nlm_tdata (bfd)->backend_data.alpha_backend_data)
+
/* This is used when writing out the external relocs. */
struct reloc_and_sec
@@ -143,6 +160,10 @@ struct nlm_backend_data
enum bfd_architecture arch;
/* Machine. */
long mach;
+ /* Some NLM formats do not use the uninitialized data section, so
+ all uninitialized data must be put into the regular data section
+ instead. */
+ boolean no_uninitialized_data;
/* Some NLM formats have a prefix on the file. If this function is
not NULL, it will be called by nlm_object_p. It should return
true if this file could match this format, and it should leave
@@ -188,42 +209,47 @@ struct nlm_backend_data
boolean (*nlm_write_external) PARAMS ((bfd *, bfd_size_type,
asymbol *,
struct reloc_and_sec *));
+ boolean (*nlm_write_export) PARAMS ((bfd *, asymbol *, bfd_vma));
};
#define nlm_backend(bfd) \
((struct nlm_backend_data *)((bfd) -> xvec -> backend_data))
#define nlm_signature(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> signature : "")
+ (nlm_backend(bfd) -> signature)
#define nlm_fixed_header_size(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> fixed_header_size : 0)
+ (nlm_backend(bfd) -> fixed_header_size)
#define nlm_optional_prefix_size(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> optional_prefix_size : 0)
+ (nlm_backend(bfd) -> optional_prefix_size)
#define nlm_architecture(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> arch : bfd_arch_unknown)
+ (nlm_backend(bfd) -> arch)
#define nlm_machine(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> mach : 0)
+ (nlm_backend(bfd) -> mach)
+#define nlm_no_uninitialized_data(bfd) \
+ (nlm_backend(bfd) -> no_uninitialized_data)
#define nlm_backend_object_p_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_backend_object_p : 0)
+ (nlm_backend(bfd) -> nlm_backend_object_p)
#define nlm_write_prefix_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_write_prefix : 0)
+ (nlm_backend(bfd) -> nlm_write_prefix)
#define nlm_read_reloc_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_read_reloc : 0)
+ (nlm_backend(bfd) -> nlm_read_reloc)
#define nlm_mangle_relocs_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_mangle_relocs : 0)
+ (nlm_backend(bfd) -> nlm_mangle_relocs)
#define nlm_read_import_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_read_import : 0)
+ (nlm_backend(bfd) -> nlm_read_import)
#define nlm_write_import_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_write_import : 0)
+ (nlm_backend(bfd) -> nlm_write_import)
#define nlm_set_public_section_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_set_public_section : 0)
+ (nlm_backend(bfd) -> nlm_set_public_section)
#define nlm_get_public_offset_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_get_public_offset : 0)
+ (nlm_backend(bfd) -> nlm_get_public_offset)
#define nlm_swap_fixed_header_in_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_swap_fhdr_in : 0)
+ (nlm_backend(bfd) -> nlm_swap_fhdr_in)
#define nlm_swap_fixed_header_out_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_swap_fhdr_out : 0)
+ (nlm_backend(bfd) -> nlm_swap_fhdr_out)
#define nlm_write_external_func(bfd) \
- (nlm_backend(bfd) ? nlm_backend(bfd) -> nlm_write_external : 0)
+ (nlm_backend(bfd) -> nlm_write_external)
+#define nlm_write_export_func(bfd) \
+ (nlm_backend(bfd) -> nlm_write_export)
/* The NLM code, data, and uninitialized sections have no names defined
in the NLM, but bfd wants to give them names, so use the traditional