diff options
author | Alan Modra <amodra@gmail.com> | 2003-08-07 07:25:34 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2003-08-07 07:25:34 +0000 |
commit | c39a58e6ffd208012eda73a92c52dc65127b2581 (patch) | |
tree | dd1fad8f288d7437b0b603bb6bc59fbe75158535 | |
parent | 29ceeffbdecd52296cecbc0d2d5148b204a4f930 (diff) | |
download | gdb-c39a58e6ffd208012eda73a92c52dc65127b2581.zip gdb-c39a58e6ffd208012eda73a92c52dc65127b2581.tar.gz gdb-c39a58e6ffd208012eda73a92c52dc65127b2581.tar.bz2 |
* elf-bfd.h: Remove PARAMS macro. Replace PTR with void *.
(NAME): Use ## rather than CONCAT4 macro.
* elfcode.h: Remove one remaining PARAMS macro.
* elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes.
* elf-strtab.c: Likewise.
* elf-hppa.h: Likewise.
* elf32-hppa.h: Likewise.
* elf32-hppa.c: Likewise.
(elf32_hppa_add_symbol_hook): Delete.
(elf_backend_add_symbol_hook): Don't define.
* libhppa.h: Convert to C90. Replace INLINE with inline.
-rw-r--r-- | bfd/ChangeLog | 14 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 577 | ||||
-rw-r--r-- | bfd/elf-eh-frame.c | 137 | ||||
-rw-r--r-- | bfd/elf-hppa.h | 221 | ||||
-rw-r--r-- | bfd/elf-strtab.c | 102 | ||||
-rw-r--r-- | bfd/elf32-hppa.c | 464 | ||||
-rw-r--r-- | bfd/elf32-hppa.h | 19 | ||||
-rw-r--r-- | bfd/elfcode.h | 2 | ||||
-rw-r--r-- | bfd/libhppa.h | 121 |
9 files changed, 641 insertions, 1016 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b3ec7cb..3fabd26 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,17 @@ +2003-08-07 Alan Modra <amodra@bigpond.net.au> + + * elf-bfd.h: Remove PARAMS macro. Replace PTR with void *. + (NAME): Use ## rather than CONCAT4 macro. + * elfcode.h: Remove one remaining PARAMS macro. + * elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes. + * elf-strtab.c: Likewise. + * elf-hppa.h: Likewise. + * elf32-hppa.h: Likewise. + * elf32-hppa.c: Likewise. + (elf32_hppa_add_symbol_hook): Delete. + (elf_backend_add_symbol_hook): Don't define. + * libhppa.h: Convert to C90. Replace INLINE with inline. + 2003-08-06 Alan Modra <amodra@bigpond.net.au> * elf64-ppc.c (ppc_stub_name): Tweak names for better readability. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index d297a77..02cb302 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -33,20 +33,17 @@ #define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize) /* If size isn't specified as 64 or 32, NAME macro should fail. */ -/* Do not "beautify" the CONCAT* macro args. Traditional C will not - remove whitespace added here, and thus will fail to concatenate - the tokens. */ #ifndef NAME -#if ARCH_SIZE==64 -#define NAME(x,y) CONCAT4 (x,64,_,y) +#if ARCH_SIZE == 64 +#define NAME(x, y) x ## 64 ## _ ## y #endif -#if ARCH_SIZE==32 -#define NAME(x,y) CONCAT4 (x,32,_,y) +#if ARCH_SIZE == 32 +#define NAME(x, y) x ## 32 ## _ ## y #endif #endif #ifndef NAME -#define NAME(x,y) CONCAT4 (x,NOSIZE,_,y) +#define NAME(x, y) x ## NOSIZE ## _ ## y #endif #define ElfNAME(X) NAME(Elf,X) @@ -67,8 +64,8 @@ typedef struct union { unsigned int hppa_arg_reloc; - PTR mips_extr; - PTR any; + void *mips_extr; + void *any; } tc_data; @@ -365,10 +362,10 @@ struct elf_link_hash_table struct elf_link_hash_entry *hgot; /* A pointer to information used to link stabs in sections. */ - PTR stab_info; + void *stab_info; /* A pointer to information used to merge SEC_MERGE sections. */ - PTR merge_info; + void *merge_info; /* Used by eh_frame code when editing .eh_frame. */ struct eh_frame_hdr_info eh_info; @@ -399,7 +396,7 @@ struct elf_link_hash_table #define elf_link_hash_traverse(table, func, info) \ (bfd_link_hash_traverse \ (&(table)->root, \ - (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) (struct bfd_link_hash_entry *, void *)) (func), \ (info))) /* Get the ELF linker hash table from a link_info structure. */ @@ -439,43 +436,43 @@ struct elf_size_info { unsigned char arch_size, log_file_align; unsigned char elfclass, ev_current; int (*write_out_phdrs) - PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); - bfd_boolean (*write_shdrs_and_ehdr) - PARAMS ((bfd *)); + (bfd *, const Elf_Internal_Phdr *, unsigned int); + bfd_boolean + (*write_shdrs_and_ehdr) (bfd *); void (*write_relocs) - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); void (*swap_symbol_in) - PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); + (bfd *, const void *, const void *, Elf_Internal_Sym *); void (*swap_symbol_out) - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); + (bfd *, const Elf_Internal_Sym *, void *, void *); bfd_boolean (*slurp_reloc_table) - PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); + (bfd *, asection *, asymbol **, bfd_boolean); long (*slurp_symbol_table) - PARAMS ((bfd *, asymbol **, bfd_boolean)); + (bfd *, asymbol **, bfd_boolean); void (*swap_dyn_in) - PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + (bfd *, const void *, Elf_Internal_Dyn *); void (*swap_dyn_out) - PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); + (bfd *, const Elf_Internal_Dyn *, void *); /* This function is called to swap in a REL relocation. If an external relocation corresponds to more than one internal relocation, then all relocations are swapped in at once. */ void (*swap_reloc_in) - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); /* This function is called to swap out a REL relocation. */ void (*swap_reloc_out) - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); /* This function is called to swap in a RELA relocation. If an external relocation corresponds to more than one internal relocation, then all relocations are swapped in at once. */ void (*swap_reloca_in) - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); /* This function is called to swap out a RELA relocation. */ void (*swap_reloca_out) - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); }; #define elf_symbol_from(ABFD,S) \ @@ -535,12 +532,12 @@ struct elf_backend_data /* A function to translate an ELF RELA relocation to a BFD arelent structure. */ void (*elf_info_to_howto) - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); /* A function to translate an ELF REL relocation to a BFD arelent structure. */ void (*elf_info_to_howto_rel) - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); /* A function to determine whether a symbol is global when partitioning the symbol table into local and global symbols. @@ -548,7 +545,7 @@ struct elf_backend_data thing will be done. MIPS ELF, at least on the Irix 5, has special requirements. */ bfd_boolean (*elf_backend_sym_is_global) - PARAMS ((bfd *, asymbol *)); + (bfd *, asymbol *); /* The remaining functions are hooks which are called only if they are not NULL. */ @@ -560,58 +557,58 @@ struct elf_backend_data used with caution. If this returns FALSE, the check_format routine will return a bfd_error_wrong_format error. */ bfd_boolean (*elf_backend_object_p) - PARAMS ((bfd *)); + (bfd *); /* A function to do additional symbol processing when reading the ELF symbol table. This is where any processor-specific special section indices are handled. */ void (*elf_backend_symbol_processing) - PARAMS ((bfd *, asymbol *)); + (bfd *, asymbol *); /* A function to do additional symbol processing after reading the entire ELF symbol table. */ bfd_boolean (*elf_backend_symbol_table_processing) - PARAMS ((bfd *, elf_symbol_type *, unsigned int)); + (bfd *, elf_symbol_type *, unsigned int); /* A function to set the type of the info field. Processor-specific types should be handled here. */ int (*elf_backend_get_symbol_type) - PARAMS (( Elf_Internal_Sym *, int)); + (Elf_Internal_Sym *, int); /* A function to do additional processing on the ELF section header just before writing it out. This is used to set the flags and type fields for some sections, or to actually write out data for unusual sections. */ bfd_boolean (*elf_backend_section_processing) - PARAMS ((bfd *, Elf_Internal_Shdr *)); + (bfd *, Elf_Internal_Shdr *); /* A function to handle unusual section types when creating BFD sections from ELF sections. */ bfd_boolean (*elf_backend_section_from_shdr) - PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); + (bfd *, Elf_Internal_Shdr *, const char *); /* A function to convert machine dependent section header flags to BFD internal section header flags. */ bfd_boolean (*elf_backend_section_flags) - PARAMS ((flagword *, Elf_Internal_Shdr *)); + (flagword *, Elf_Internal_Shdr *); /* A function to handle unusual program segment types when creating BFD sections from ELF program segments. */ bfd_boolean (*elf_backend_section_from_phdr) - PARAMS ((bfd *, Elf_Internal_Phdr *, int)); + (bfd *, Elf_Internal_Phdr *, int); /* A function to set up the ELF section header for a BFD section in preparation for writing it out. This is where the flags and type fields are set for unusual sections. */ bfd_boolean (*elf_backend_fake_sections) - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); + (bfd *, Elf_Internal_Shdr *, asection *); /* A function to get the ELF section index for a BFD section. If this returns TRUE, the section was found. If it is a normal ELF section, *RETVAL should be left unchanged. If it is not a normal ELF section *RETVAL should be set to the SHN_xxxx index. */ bfd_boolean (*elf_backend_section_from_bfd_section) - PARAMS ((bfd *, asection *, int *retval)); + (bfd *, asection *, int *retval); /* If this field is not NULL, it is called by the add_symbols phase of a link just before adding a symbol to the global linker hash @@ -622,15 +619,14 @@ struct elf_backend_data indices, and must set at least *FLAGS and *SEC for each processor dependent case; failure to do so will cause a link error. */ bfd_boolean (*elf_add_symbol_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *info, - const Elf_Internal_Sym *, const char **name, - flagword *flags, asection **sec, bfd_vma *value)); + (bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *, + const char **name, flagword *flags, asection **sec, bfd_vma *value); /* If this field is not NULL, it is called by the elf_link_output_sym phase of a link for each symbol which will appear in the object file. */ bfd_boolean (*elf_backend_link_output_symbol_hook) - PARAMS ((bfd *, struct bfd_link_info *info, const char *, - Elf_Internal_Sym *, asection *)); + (bfd *, struct bfd_link_info *info, const char *, Elf_Internal_Sym *, + asection *); /* The CREATE_DYNAMIC_SECTIONS function is called by the ELF backend linker the first time it encounters a dynamic object in the link. @@ -641,7 +637,7 @@ struct elf_backend_data desired. This function will normally create the .got and .plt sections, but different backends have different requirements. */ bfd_boolean (*elf_backend_create_dynamic_sections) - PARAMS ((bfd *abfd, struct bfd_link_info *info)); + (bfd *abfd, struct bfd_link_info *info); /* The CHECK_RELOCS function is called by the add_symbols phase of the ELF backend linker. It is called once for each section with @@ -654,8 +650,8 @@ struct elf_backend_data actually uses Rel structures, the r_addend field will always be zero. */ bfd_boolean (*check_relocs) - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, - const Elf_Internal_Rela *relocs)); + (bfd *abfd, struct bfd_link_info *info, asection *o, + const Elf_Internal_Rela *relocs); /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend linker for every symbol which is defined by a dynamic object and @@ -670,14 +666,14 @@ struct elf_backend_data entry to the .plt or .got or some such section, and setting the symbol to point to that. */ bfd_boolean (*elf_backend_adjust_dynamic_symbol) - PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h)); + (struct bfd_link_info *info, struct elf_link_hash_entry *h); /* The ALWAYS_SIZE_SECTIONS function is called by the backend linker after all the linker input files have been seen but before the section sizes have been set. This is called after ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */ bfd_boolean (*elf_backend_always_size_sections) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); + (bfd *output_bfd, struct bfd_link_info *info); /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend linker after all the linker input files have been seen but before @@ -690,7 +686,7 @@ struct elf_backend_data .interp section and any sections created by the CREATE_DYNAMIC_SECTIONS entry point. */ bfd_boolean (*elf_backend_size_dynamic_sections) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); + (bfd *output_bfd, struct bfd_link_info *info); /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -721,10 +717,9 @@ struct elf_backend_data section, which means that the addend must be adjusted accordingly. */ bfd_boolean (*elf_backend_relocate_section) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info, - bfd *input_bfd, asection *input_section, bfd_byte *contents, - Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, - asection **local_sections)); + (bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd, + asection *input_section, bfd_byte *contents, Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, asection **local_sections); /* The FINISH_DYNAMIC_SYMBOL function is called by the ELF backend linker just before it writes a symbol out to the .dynsym section. @@ -734,70 +729,70 @@ struct elf_backend_data all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called on those symbols which are defined by a dynamic object. */ bfd_boolean (*elf_backend_finish_dynamic_symbol) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info, - struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); + (bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym); /* The FINISH_DYNAMIC_SECTIONS function is called by the ELF backend linker just before it writes all the dynamic sections out to the output file. The FINISH_DYNAMIC_SYMBOL will have been called on all dynamic symbols. */ bfd_boolean (*elf_backend_finish_dynamic_sections) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); + (bfd *output_bfd, struct bfd_link_info *info); /* A function to do any beginning processing needed for the ELF file before building the ELF headers and computing file positions. */ void (*elf_backend_begin_write_processing) - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); /* A function to do any final processing needed for the ELF file before writing it out. The LINKER argument is TRUE if this BFD was created by the ELF backend linker. */ void (*elf_backend_final_write_processing) - PARAMS ((bfd *, bfd_boolean linker)); + (bfd *, bfd_boolean linker); /* This function is called by get_program_header_size. It should return the number of additional program segments which this BFD will need. It should return -1 on error. */ int (*elf_backend_additional_program_headers) - PARAMS ((bfd *)); + (bfd *); /* This function is called to modify an existing segment map in a backend specific fashion. */ bfd_boolean (*elf_backend_modify_segment_map) - PARAMS ((bfd *)); + (bfd *); /* This function is called during section gc to discover the section a particular relocation refers to. */ asection * (*gc_mark_hook) - PARAMS ((asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *h, Elf_Internal_Sym *)); + (asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *h, Elf_Internal_Sym *); /* This function, if defined, is called during the sweep phase of gc in order that a backend might update any data structures it might be maintaining. */ bfd_boolean (*gc_sweep_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, - const Elf_Internal_Rela *relocs)); + (bfd *abfd, struct bfd_link_info *info, asection *o, + const Elf_Internal_Rela *relocs); /* This function, if defined, is called after the ELF headers have been created. This allows for things like the OS and ABI versions to be changed. */ void (*elf_backend_post_process_headers) - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); /* This function, if defined, prints a symbol to file and returns the name of the symbol to be printed. It should return NULL to fall back to default symbol printing. */ const char *(*elf_backend_print_symbol_all) - PARAMS ((bfd *, PTR, asymbol *)); + (bfd *, void *, asymbol *); /* This function, if defined, is called after all local symbols and global symbols converted to locals are emited into the symtab section. It allows the backend to emit special global symbols not handled in the hash table. */ bfd_boolean (*elf_backend_output_arch_syms) - PARAMS ((bfd *, struct bfd_link_info *, PTR, - bfd_boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); + (bfd *, struct bfd_link_info *, void *, + bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *)); /* Copy any information related to dynamic linking from a pre-existing symbol to a newly created symbol. Also called to copy flags and @@ -805,66 +800,66 @@ struct elf_backend_data newly created and plt/got refcounts and dynamic indices should not be copied. */ void (*elf_backend_copy_indirect_symbol) - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); + (struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *); /* Modify any information related to dynamic linking such that the symbol is not exported. */ void (*elf_backend_hide_symbol) - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean)); + (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); /* Emit relocations. Overrides default routine for emitting relocs, except during a relocatable link, or if all relocs are being emitted. */ bfd_boolean (*elf_backend_emit_relocs) - PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); + (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *); /* Count relocations. Not called for relocatable links or if all relocs are being preserved in the output. */ unsigned int (*elf_backend_count_relocs) - PARAMS ((asection *, Elf_Internal_Rela *)); + (asection *, Elf_Internal_Rela *); /* This function, if defined, is called when an NT_PRSTATUS note is found in a core file. */ bfd_boolean (*elf_backend_grok_prstatus) - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO note is found in a core file. */ bfd_boolean (*elf_backend_grok_psinfo) - PARAMS ((bfd *, Elf_Internal_Note *)); + (bfd *, Elf_Internal_Note *); /* Functions to print VMAs. Special code to handle 64 bit ELF files. */ void (* elf_backend_sprintf_vma) - PARAMS ((bfd *, char *, bfd_vma)); + (bfd *, char *, bfd_vma); void (* elf_backend_fprintf_vma) - PARAMS ((bfd *, PTR, bfd_vma)); + (bfd *, void *, bfd_vma); /* This function returns class of a reloc type. */ enum elf_reloc_type_class (*elf_backend_reloc_type_class) - PARAMS ((const Elf_Internal_Rela *)); + (const Elf_Internal_Rela *); /* This function, if defined, removes information about discarded functions from other sections which mention them. */ bfd_boolean (*elf_backend_discard_info) - PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *)); + (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *); /* This function, if defined, signals that the function above has removed the discarded relocations for this section. */ bfd_boolean (*elf_backend_ignore_discarded_relocs) - PARAMS ((asection *)); + (asection *); /* This function, if defined, may write out the given section. Returns TRUE if it did so and FALSE if the caller should. */ bfd_boolean (*elf_backend_write_section) - PARAMS ((bfd *, asection *, bfd_byte *)); + (bfd *, asection *, bfd_byte *); /* The level of IRIX compatibility we're striving for. MIPS ELF specific function. */ irix_compat_t (*elf_backend_mips_irix_compat) - PARAMS ((bfd *)); + (bfd *); reloc_howto_type *(*elf_backend_mips_rtype_to_howto) - PARAMS ((unsigned int, bfd_boolean)); + (unsigned int, bfd_boolean); /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ @@ -873,8 +868,8 @@ struct elf_backend_data /* This function implements `bfd_elf_bfd_from_remote_memory'; see elf.c, elfcode.h. */ bfd *(*elf_backend_bfd_from_remote_memory) - PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, char *myaddr, int len))); + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len)); /* Alternate EM_xxxx machine codes for this backend. */ int elf_machine_alt1; @@ -998,7 +993,7 @@ struct bfd_elf_section_data /* A pointer to a linked list tracking dynamic relocs copied for local symbols. */ - PTR local_dynrel; + void *local_dynrel; /* A pointer to the bfd section used for dynamic relocs. */ asection *sreloc; @@ -1016,7 +1011,7 @@ struct bfd_elf_section_data asection *next_in_group; /* A pointer used for various section optimizations. */ - PTR sec_info; + void *sec_info; }; #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd) @@ -1166,7 +1161,7 @@ struct elf_obj_tdata bfd_size_type program_header_size; /* Used by find_nearest_line entry point. */ - PTR line_info; + void *line_info; /* Used by MIPS ELF find_nearest_line entry point. The structure could be included directly in this one, but there's no point to @@ -1178,7 +1173,7 @@ struct elf_obj_tdata struct dwarf1_debug *dwarf1_find_line_info; /* A place to stash dwarf2 info for this bfd. */ - PTR dwarf2_find_line_info; + void *dwarf2_find_line_info; /* An array of stub sections indexed by symbol number, used by the MIPS ELF linker. FIXME: We should figure out some way to only @@ -1244,377 +1239,375 @@ struct elf_obj_tdata #define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init) extern void _bfd_elf_swap_verdef_in - PARAMS ((bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *)); + (bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *); extern void _bfd_elf_swap_verdef_out - PARAMS ((bfd *, const Elf_Internal_Verdef *, Elf_External_Verdef *)); + (bfd *, const Elf_Internal_Verdef *, Elf_External_Verdef *); extern void _bfd_elf_swap_verdaux_in - PARAMS ((bfd *, const Elf_External_Verdaux *, Elf_Internal_Verdaux *)); + (bfd *, const Elf_External_Verdaux *, Elf_Internal_Verdaux *); extern void _bfd_elf_swap_verdaux_out - PARAMS ((bfd *, const Elf_Internal_Verdaux *, Elf_External_Verdaux *)); + (bfd *, const Elf_Internal_Verdaux *, Elf_External_Verdaux *); extern void _bfd_elf_swap_verneed_in - PARAMS ((bfd *, const Elf_External_Verneed *, Elf_Internal_Verneed *)); + (bfd *, const Elf_External_Verneed *, Elf_Internal_Verneed *); extern void _bfd_elf_swap_verneed_out - PARAMS ((bfd *, const Elf_Internal_Verneed *, Elf_External_Verneed *)); + (bfd *, const Elf_Internal_Verneed *, Elf_External_Verneed *); extern void _bfd_elf_swap_vernaux_in - PARAMS ((bfd *, const Elf_External_Vernaux *, Elf_Internal_Vernaux *)); + (bfd *, const Elf_External_Vernaux *, Elf_Internal_Vernaux *); extern void _bfd_elf_swap_vernaux_out - PARAMS ((bfd *, const Elf_Internal_Vernaux *, Elf_External_Vernaux *)); + (bfd *, const Elf_Internal_Vernaux *, Elf_External_Vernaux *); extern void _bfd_elf_swap_versym_in - PARAMS ((bfd *, const Elf_External_Versym *, Elf_Internal_Versym *)); + (bfd *, const Elf_External_Versym *, Elf_Internal_Versym *); extern void _bfd_elf_swap_versym_out - PARAMS ((bfd *, const Elf_Internal_Versym *, Elf_External_Versym *)); + (bfd *, const Elf_Internal_Versym *, Elf_External_Versym *); extern int _bfd_elf_section_from_bfd_section - PARAMS ((bfd *, asection *)); + (bfd *, asection *); extern char *bfd_elf_string_from_elf_section - PARAMS ((bfd *, unsigned, unsigned)); + (bfd *, unsigned, unsigned); extern char *bfd_elf_get_str_section - PARAMS ((bfd *, unsigned)); + (bfd *, unsigned); extern Elf_Internal_Sym *bfd_elf_get_elf_syms - PARAMS ((bfd *, Elf_Internal_Shdr *, size_t, size_t, - Elf_Internal_Sym *, PTR, Elf_External_Sym_Shndx *)); + (bfd *, Elf_Internal_Shdr *, size_t, size_t, Elf_Internal_Sym *, void *, + Elf_External_Sym_Shndx *); extern const char *bfd_elf_local_sym_name - PARAMS ((bfd *, Elf_Internal_Sym *)); + (bfd *, Elf_Internal_Sym *); extern bfd_boolean _bfd_elf_copy_private_bfd_data - PARAMS ((bfd *, bfd *)); + (bfd *, bfd *); extern bfd_boolean _bfd_elf_print_private_bfd_data - PARAMS ((bfd *, PTR)); + (bfd *, void *); extern void bfd_elf_print_symbol - PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); + (bfd *, void *, asymbol *, bfd_print_symbol_type); #define elf_string_from_elf_strtab(abfd, strindex) \ - bfd_elf_string_from_elf_section(abfd, elf_elfheader(abfd)->e_shstrndx, \ - strindex) + bfd_elf_string_from_elf_section (abfd, elf_elfheader(abfd)->e_shstrndx, \ + strindex) #define bfd_elf32_print_symbol bfd_elf_print_symbol #define bfd_elf64_print_symbol bfd_elf_print_symbol extern void _bfd_elf_sprintf_vma - PARAMS ((bfd *, char *, bfd_vma)); + (bfd *, char *, bfd_vma); extern void _bfd_elf_fprintf_vma - PARAMS ((bfd *, PTR, bfd_vma)); + (bfd *, void *, bfd_vma); extern enum elf_reloc_type_class _bfd_elf_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); + (const Elf_Internal_Rela *); extern bfd_vma _bfd_elf_rela_local_sym - PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *)); + (bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *); extern bfd_vma _bfd_elf_rel_local_sym - PARAMS ((bfd *, Elf_Internal_Sym *, asection **, bfd_vma)); + (bfd *, Elf_Internal_Sym *, asection **, bfd_vma); extern bfd_vma _bfd_elf_section_offset - PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_vma)); + (bfd *, struct bfd_link_info *, asection *, bfd_vma); extern unsigned long bfd_elf_hash - PARAMS ((const char *)); + (const char *); extern bfd_reloc_status_type bfd_elf_generic_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); extern bfd_boolean bfd_elf_mkobject - PARAMS ((bfd *)); + (bfd *); extern bfd_boolean bfd_elf_mkcorefile - PARAMS ((bfd *)); + (bfd *); extern Elf_Internal_Shdr *bfd_elf_find_section - PARAMS ((bfd *, char *)); + (bfd *, char *); extern bfd_boolean _bfd_elf_make_section_from_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); + (bfd *, Elf_Internal_Shdr *, const char *); extern bfd_boolean _bfd_elf_make_section_from_phdr - PARAMS ((bfd *, Elf_Internal_Phdr *, int, const char *)); + (bfd *, Elf_Internal_Phdr *, int, const char *); extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create - PARAMS ((bfd *)); + (bfd *); extern void _bfd_elf_link_hash_copy_indirect - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); + (struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *); extern void _bfd_elf_link_hash_hide_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean)); + (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); extern bfd_boolean _bfd_elf_link_hash_table_init - PARAMS ((struct elf_link_hash_table *, bfd *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); + (struct elf_link_hash_table *, bfd *, + struct bfd_hash_entry *(*) + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); extern bfd_boolean _bfd_elf_slurp_version_tables - PARAMS ((bfd *)); + (bfd *); extern bfd_boolean _bfd_elf_merge_sections - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_elf_discard_group - PARAMS ((bfd *, struct sec *)); + (bfd *, struct sec *); extern void bfd_elf_set_group_contents - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); extern void _bfd_elf_link_just_syms - PARAMS ((asection *, struct bfd_link_info *)); + (asection *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_copy_private_symbol_data - PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); + (bfd *, asymbol *, bfd *, asymbol *); extern bfd_boolean _bfd_elf_copy_private_section_data - PARAMS ((bfd *, asection *, bfd *, asection *)); + (bfd *, asection *, bfd *, asection *); extern bfd_boolean _bfd_elf_write_object_contents - PARAMS ((bfd *)); + (bfd *); extern bfd_boolean _bfd_elf_write_corefile_contents - PARAMS ((bfd *)); + (bfd *); extern bfd_boolean _bfd_elf_set_section_contents - PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); + (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); extern long _bfd_elf_get_symtab_upper_bound - PARAMS ((bfd *)); + (bfd *); extern long _bfd_elf_get_symtab - PARAMS ((bfd *, asymbol **)); + (bfd *, asymbol **); extern long _bfd_elf_get_dynamic_symtab_upper_bound - PARAMS ((bfd *)); + (bfd *); extern long _bfd_elf_canonicalize_dynamic_symtab - PARAMS ((bfd *, asymbol **)); + (bfd *, asymbol **); extern long _bfd_elf_get_reloc_upper_bound - PARAMS ((bfd *, sec_ptr)); + (bfd *, sec_ptr); extern long _bfd_elf_canonicalize_reloc - PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); + (bfd *, sec_ptr, arelent **, asymbol **); extern long _bfd_elf_get_dynamic_reloc_upper_bound - PARAMS ((bfd *)); + (bfd *); extern long _bfd_elf_canonicalize_dynamic_reloc - PARAMS ((bfd *, arelent **, asymbol **)); + (bfd *, arelent **, asymbol **); extern asymbol *_bfd_elf_make_empty_symbol - PARAMS ((bfd *)); + (bfd *); extern void _bfd_elf_get_symbol_info - PARAMS ((bfd *, asymbol *, symbol_info *)); + (bfd *, asymbol *, symbol_info *); extern bfd_boolean _bfd_elf_is_local_label_name - PARAMS ((bfd *, const char *)); + (bfd *, const char *); extern alent *_bfd_elf_get_lineno - PARAMS ((bfd *, asymbol *)); + (bfd *, asymbol *); extern bfd_boolean _bfd_elf_set_arch_mach - PARAMS ((bfd *, enum bfd_architecture, unsigned long)); + (bfd *, enum bfd_architecture, unsigned long); extern bfd_boolean _bfd_elf_find_nearest_line - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *)); + (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, + unsigned int *); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers - PARAMS ((bfd *, bfd_boolean)); + (bfd *, bfd_boolean); extern bfd_boolean _bfd_elf_new_section_hook - PARAMS ((bfd *, asection *)); + (bfd *, asection *); extern bfd_boolean _bfd_elf_init_reloc_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean)); -extern bfd_boolean _bfd_elf_get_sec_type_attr (bfd *, const char *, - int *, int *); + (bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean); +extern bfd_boolean _bfd_elf_get_sec_type_attr + (bfd *, const char *, int *, int *); /* If the target doesn't have reloc handling written yet: */ extern void _bfd_elf_no_info_to_howto - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); extern bfd_boolean bfd_section_from_shdr - PARAMS ((bfd *, unsigned int shindex)); + (bfd *, unsigned int shindex); extern bfd_boolean bfd_section_from_phdr - PARAMS ((bfd *, Elf_Internal_Phdr *, int)); + (bfd *, Elf_Internal_Phdr *, int); extern int _bfd_elf_symbol_from_bfd_symbol - PARAMS ((bfd *, asymbol **)); + (bfd *, asymbol **); extern asection *bfd_section_from_r_symndx - PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long)); + (bfd *, struct sym_sec_cache *, asection *, unsigned long); extern asection *bfd_section_from_elf_index - PARAMS ((bfd *, unsigned int)); + (bfd *, unsigned int); extern struct bfd_strtab_hash *_bfd_elf_stringtab_init - PARAMS ((void)); + (void); extern struct elf_strtab_hash * _bfd_elf_strtab_init - PARAMS ((void)); + (void); extern void _bfd_elf_strtab_free - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); extern bfd_size_type _bfd_elf_strtab_add - PARAMS ((struct elf_strtab_hash *, const char *, bfd_boolean)); + (struct elf_strtab_hash *, const char *, bfd_boolean); extern void _bfd_elf_strtab_addref - PARAMS ((struct elf_strtab_hash *, bfd_size_type)); + (struct elf_strtab_hash *, bfd_size_type); extern void _bfd_elf_strtab_delref - PARAMS ((struct elf_strtab_hash *, bfd_size_type)); + (struct elf_strtab_hash *, bfd_size_type); extern void _bfd_elf_strtab_clear_all_refs - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); extern bfd_size_type _bfd_elf_strtab_size - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); extern bfd_size_type _bfd_elf_strtab_offset - PARAMS ((struct elf_strtab_hash *, bfd_size_type)); + (struct elf_strtab_hash *, bfd_size_type); extern bfd_boolean _bfd_elf_strtab_emit - PARAMS ((bfd *, struct elf_strtab_hash *)); + (bfd *, struct elf_strtab_hash *); extern void _bfd_elf_strtab_finalize - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); extern bfd_boolean _bfd_elf_discard_section_eh_frame - PARAMS ((bfd *, struct bfd_link_info *, asection *, - bfd_boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *)); + (bfd *, struct bfd_link_info *, asection *, + bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *); extern bfd_boolean _bfd_elf_discard_section_eh_frame_hdr - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_vma _bfd_elf_eh_frame_section_offset - PARAMS ((bfd *, asection *, bfd_vma)); + (bfd *, asection *, bfd_vma); extern bfd_boolean _bfd_elf_write_section_eh_frame - PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_byte *)); + (bfd *, struct bfd_link_info *, asection *, bfd_byte *); extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr - PARAMS ((struct bfd_link_info *)); + (struct bfd_link_info *); extern bfd_boolean _bfd_elf_merge_symbol - PARAMS ((bfd *, struct bfd_link_info *, const char *, - Elf_Internal_Sym *, asection **, bfd_vma *, - struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *, - bfd_boolean *, bfd_boolean *, bfd_boolean)); + (bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, + asection **, bfd_vma *, struct elf_link_hash_entry **, bfd_boolean *, + bfd_boolean *, bfd_boolean *, bfd_boolean *, bfd_boolean); extern bfd_boolean _bfd_elf_add_default_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - const char *, Elf_Internal_Sym *, asection **, bfd_vma *, - bfd_boolean *, bfd_boolean, bfd_boolean)); + (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + const char *, Elf_Internal_Sym *, asection **, bfd_vma *, + bfd_boolean *, bfd_boolean, bfd_boolean); extern bfd_boolean _bfd_elf_export_symbol - PARAMS ((struct elf_link_hash_entry *, PTR)); + (struct elf_link_hash_entry *, void *); extern bfd_boolean _bfd_elf_link_find_version_dependencies - PARAMS ((struct elf_link_hash_entry *, PTR)); + (struct elf_link_hash_entry *, void *); extern bfd_boolean _bfd_elf_link_assign_sym_version - PARAMS ((struct elf_link_hash_entry *, PTR)); + (struct elf_link_hash_entry *, void *); extern bfd_boolean _bfd_elf_link_record_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + (struct bfd_link_info *, struct elf_link_hash_entry *); extern long _bfd_elf_link_lookup_local_dynindx - PARAMS ((struct bfd_link_info *, bfd *, long)); + (struct bfd_link_info *, bfd *, long); extern bfd_boolean _bfd_elf_compute_section_file_positions - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern void _bfd_elf_assign_file_positions_for_relocs - PARAMS ((bfd *)); + (bfd *); extern file_ptr _bfd_elf_assign_file_position_for_section - PARAMS ((Elf_Internal_Shdr *, file_ptr, bfd_boolean)); + (Elf_Internal_Shdr *, file_ptr, bfd_boolean); extern bfd_boolean _bfd_elf_validate_reloc - PARAMS ((bfd *, arelent *)); + (bfd *, arelent *); extern bfd_boolean _bfd_elf_link_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf_create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern unsigned long _bfd_elf_link_renumber_dynsyms - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elfcore_make_pseudosection - PARAMS ((bfd *, char *, size_t, ufile_ptr)); + (bfd *, char *, size_t, ufile_ptr); extern char *_bfd_elfcore_strndup - PARAMS ((bfd *, char *, size_t)); + (bfd *, char *, size_t); extern Elf_Internal_Rela *_bfd_elf_link_read_relocs - PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean)); + (bfd *, asection *, void *, Elf_Internal_Rela *, bfd_boolean); extern bfd_boolean _bfd_elf_link_size_reloc_section - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); + (bfd *, Elf_Internal_Shdr *, asection *); extern bfd_boolean _bfd_elf_link_output_relocs - PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); + (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *); extern bfd_boolean _bfd_elf_fix_symbol_flags - PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *)); + (struct elf_link_hash_entry *, struct elf_info_failed *); extern bfd_boolean _bfd_elf_adjust_dynamic_symbol - PARAMS ((struct elf_link_hash_entry *, PTR)); + (struct elf_link_hash_entry *, void *); extern bfd_boolean _bfd_elf_link_sec_merge_syms - PARAMS ((struct elf_link_hash_entry *, PTR)); + (struct elf_link_hash_entry *, void *); extern bfd_boolean _bfd_elf_dynamic_symbol_p - PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean)); + (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean); extern bfd_boolean _bfd_elf_symbol_refs_local_p - PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean)); + (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean); extern const bfd_target *bfd_elf32_object_p - PARAMS ((bfd *)); + (bfd *); extern const bfd_target *bfd_elf32_core_file_p - PARAMS ((bfd *)); + (bfd *); extern char *bfd_elf32_core_file_failing_command - PARAMS ((bfd *)); + (bfd *); extern int bfd_elf32_core_file_failing_signal - PARAMS ((bfd *)); + (bfd *); extern bfd_boolean bfd_elf32_core_file_matches_executable_p - PARAMS ((bfd *, bfd *)); + (bfd *, bfd *); extern bfd_boolean bfd_elf32_bfd_link_add_symbols - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_elf32_bfd_final_link - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern void bfd_elf32_swap_symbol_in - PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); + (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf32_swap_symbol_out - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); + (bfd *, const Elf_Internal_Sym *, void *, void *); extern void bfd_elf32_swap_reloc_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf32_swap_reloc_out - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf32_swap_reloca_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf32_swap_reloca_out - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf32_swap_phdr_in - PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *)); + (bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *); extern void bfd_elf32_swap_phdr_out - PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *)); + (bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *); extern void bfd_elf32_swap_dyn_in - PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + (bfd *, const void *, Elf_Internal_Dyn *); extern void bfd_elf32_swap_dyn_out - PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); + (bfd *, const Elf_Internal_Dyn *, void *); extern long bfd_elf32_slurp_symbol_table - PARAMS ((bfd *, asymbol **, bfd_boolean)); + (bfd *, asymbol **, bfd_boolean); extern bfd_boolean bfd_elf32_write_shdrs_and_ehdr - PARAMS ((bfd *)); + (bfd *); extern int bfd_elf32_write_out_phdrs - PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); + (bfd *, const Elf_Internal_Phdr *, unsigned int); extern void bfd_elf32_write_relocs - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); extern bfd_boolean bfd_elf32_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); + (bfd *, asection *, asymbol **, bfd_boolean); extern bfd_boolean bfd_elf32_add_dynamic_entry - PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); + (struct bfd_link_info *, bfd_vma, bfd_vma); extern const bfd_target *bfd_elf64_object_p - PARAMS ((bfd *)); + (bfd *); extern const bfd_target *bfd_elf64_core_file_p - PARAMS ((bfd *)); + (bfd *); extern char *bfd_elf64_core_file_failing_command - PARAMS ((bfd *)); + (bfd *); extern int bfd_elf64_core_file_failing_signal - PARAMS ((bfd *)); + (bfd *); extern bfd_boolean bfd_elf64_core_file_matches_executable_p - PARAMS ((bfd *, bfd *)); + (bfd *, bfd *); extern bfd_boolean bfd_elf64_bfd_link_add_symbols - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_elf64_bfd_final_link - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern void bfd_elf64_swap_symbol_in - PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); + (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf64_swap_symbol_out - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); + (bfd *, const Elf_Internal_Sym *, void *, void *); extern void bfd_elf64_swap_reloc_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf64_swap_reloc_out - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf64_swap_reloca_in - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf64_swap_reloca_out - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf64_swap_phdr_in - PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *)); + (bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *); extern void bfd_elf64_swap_phdr_out - PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *)); + (bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *); extern void bfd_elf64_swap_dyn_in - PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + (bfd *, const void *, Elf_Internal_Dyn *); extern void bfd_elf64_swap_dyn_out - PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); + (bfd *, const Elf_Internal_Dyn *, void *); extern long bfd_elf64_slurp_symbol_table - PARAMS ((bfd *, asymbol **, bfd_boolean)); + (bfd *, asymbol **, bfd_boolean); extern bfd_boolean bfd_elf64_write_shdrs_and_ehdr - PARAMS ((bfd *)); + (bfd *); extern int bfd_elf64_write_out_phdrs - PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); + (bfd *, const Elf_Internal_Phdr *, unsigned int); extern void bfd_elf64_write_relocs - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); extern bfd_boolean bfd_elf64_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); + (bfd *, asection *, asymbol **, bfd_boolean); extern bfd_boolean bfd_elf64_add_dynamic_entry - PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); + (struct bfd_link_info *, bfd_vma, bfd_vma); #define bfd_elf32_link_record_dynamic_symbol \ _bfd_elf_link_record_dynamic_symbol @@ -1622,71 +1615,71 @@ extern bfd_boolean bfd_elf64_add_dynamic_entry _bfd_elf_link_record_dynamic_symbol extern int elf_link_record_local_dynamic_symbol - PARAMS ((struct bfd_link_info *, bfd *, long)); + (struct bfd_link_info *, bfd *, long); #define _bfd_elf32_link_record_local_dynamic_symbol \ elf_link_record_local_dynamic_symbol #define _bfd_elf64_link_record_local_dynamic_symbol \ elf_link_record_local_dynamic_symbol extern bfd_boolean _bfd_elf_close_and_cleanup - PARAMS ((bfd *)); + (bfd *); extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn - PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, - asection *, bfd *, char **)); + (bfd *, arelent *, struct symbol_cache_entry *, void *, + asection *, bfd *, char **); extern bfd_boolean _bfd_elf32_gc_sections - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf32_gc_common_finalize_got_offsets - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf32_gc_common_final_link - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf32_gc_record_vtinherit - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); + (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); extern bfd_boolean _bfd_elf32_gc_record_vtentry - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); + (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); extern bfd_boolean _bfd_elf64_gc_sections - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf64_gc_common_finalize_got_offsets - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf64_gc_common_final_link - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); extern bfd_boolean _bfd_elf64_gc_record_vtinherit - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); + (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); extern bfd_boolean _bfd_elf64_gc_record_vtentry - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); + (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); extern bfd_boolean _bfd_elf32_reloc_symbol_deleted_p - PARAMS ((bfd_vma, PTR)); + (bfd_vma, void *); extern bfd_boolean _bfd_elf64_reloc_symbol_deleted_p - PARAMS ((bfd_vma, PTR)); + (bfd_vma, void *); /* Exported interface for writing elf corefile notes. */ extern char *elfcore_write_note - PARAMS ((bfd *, char *, int *, const char *, int, const PTR, int)); + (bfd *, char *, int *, const char *, int, const void *, int); extern char *elfcore_write_prpsinfo - PARAMS ((bfd *, char *, int *, const char *, const char *)); + (bfd *, char *, int *, const char *, const char *); extern char *elfcore_write_prstatus - PARAMS ((bfd *, char *, int *, long, int, const PTR)); + (bfd *, char *, int *, long, int, const void *); extern char * elfcore_write_pstatus - PARAMS ((bfd *, char *, int *, long, int, const PTR)); + (bfd *, char *, int *, long, int, const void *); extern char *elfcore_write_prfpreg - PARAMS ((bfd *, char *, int *, const PTR, int)); + (bfd *, char *, int *, const void *, int); extern char *elfcore_write_prxfpreg - PARAMS ((bfd *, char *, int *, const PTR, int)); + (bfd *, char *, int *, const void *, int); extern char *elfcore_write_lwpstatus - PARAMS ((bfd *, char *, int *, long, int, const PTR)); + (bfd *, char *, int *, long, int, const void *); extern bfd *_bfd_elf32_bfd_from_remote_memory - PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, char *, int))); + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int)); extern bfd *_bfd_elf64_bfd_from_remote_memory - PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, char *, int))); + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int)); /* SH ELF specific routine. */ extern bfd_boolean _sh_elf_set_mach_from_flags - PARAMS ((bfd *)); + (bfd *); #endif /* _LIBELF_H_ */ diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index e422aa9..c71129e 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -26,61 +26,44 @@ #define EH_FRAME_HDR_SIZE 8 -static bfd_vma read_unsigned_leb128 - PARAMS ((bfd *, char *, unsigned int *)); -static bfd_signed_vma read_signed_leb128 - PARAMS ((bfd *, char *, unsigned int *)); -static int get_DW_EH_PE_width - PARAMS ((int, int)); -static bfd_vma read_value - PARAMS ((bfd *, bfd_byte *, int, int)); -static void write_value - PARAMS ((bfd *, bfd_byte *, bfd_vma, int)); -static int cie_compare - PARAMS ((struct cie *, struct cie *)); -static int vma_compare - PARAMS ((const PTR, const PTR)); - /* Helper function for reading uleb128 encoded data. */ static bfd_vma -read_unsigned_leb128 (abfd, buf, bytes_read_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int *bytes_read_ptr; +read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int *bytes_read_ptr) { - bfd_vma result; - unsigned int num_read; - int shift; + bfd_vma result; + unsigned int num_read; + int shift; unsigned char byte; - result = 0; - shift = 0; + result = 0; + shift = 0; num_read = 0; do { byte = bfd_get_8 (abfd, (bfd_byte *) buf); - buf ++; - num_read ++; + buf++; + num_read++; result |= (((bfd_vma) byte & 0x7f) << shift); shift += 7; } while (byte & 0x80); - * bytes_read_ptr = num_read; + *bytes_read_ptr = num_read; return result; } /* Helper function for reading sleb128 encoded data. */ static bfd_signed_vma -read_signed_leb128 (abfd, buf, bytes_read_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int * bytes_read_ptr; +read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int * bytes_read_ptr) { - bfd_vma result; - int shift; - int num_read; + bfd_vma result; + int shift; + int num_read; unsigned char byte; result = 0; @@ -97,7 +80,7 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr) while (byte & 0x80); if (byte & 0x40) result |= (((bfd_vma) -1) << (shift - 7)) << 7; - * bytes_read_ptr = num_read; + *bytes_read_ptr = num_read; return result; } @@ -120,8 +103,7 @@ while (0) /* Return 0 if either encoding is variable width, or not yet known to bfd. */ static -int get_DW_EH_PE_width (encoding, ptr_size) - int encoding, ptr_size; +int get_DW_EH_PE_width (int encoding, int ptr_size) { /* DW_EH_PE_ values of 0x60 and 0x70 weren't defined at the time .eh_frame was added to bfd. */ @@ -146,11 +128,7 @@ int get_DW_EH_PE_width (encoding, ptr_size) /* Read a width sized value from memory. */ static bfd_vma -read_value (abfd, buf, width, is_signed) - bfd *abfd; - bfd_byte *buf; - int width; - int is_signed; +read_value (bfd *abfd, bfd_byte *buf, int width, int is_signed) { bfd_vma value; @@ -185,11 +163,7 @@ read_value (abfd, buf, width, is_signed) /* Store a width sized value to memory. */ static void -write_value (abfd, buf, value, width) - bfd *abfd; - bfd_byte *buf; - bfd_vma value; - int width; +write_value (bfd *abfd, bfd_byte *buf, bfd_vma value, int width) { switch (width) { @@ -203,8 +177,7 @@ write_value (abfd, buf, value, width) /* Return zero if C1 and C2 CIEs can be merged. */ static -int cie_compare (c1, c2) - struct cie *c1, *c2; +int cie_compare (struct cie *c1, struct cie *c2) { if (c1->hdr.length == c2->hdr.length && c1->version == c2->version @@ -218,8 +191,7 @@ int cie_compare (c1, c2) && c1->per_encoding == c2->per_encoding && c1->lsda_encoding == c2->lsda_encoding && c1->fde_encoding == c2->fde_encoding - && (c1->initial_insn_length - == c2->initial_insn_length) + && c1->initial_insn_length == c2->initial_insn_length && memcmp (c1->initial_instructions, c2->initial_instructions, c1->initial_insn_length) == 0) @@ -234,13 +206,10 @@ int cie_compare (c1, c2) deleted. */ bfd_boolean -_bfd_elf_discard_section_eh_frame (abfd, info, sec, - reloc_symbol_deleted_p, cookie) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - bfd_boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR)); - struct elf_reloc_cookie *cookie; +_bfd_elf_discard_section_eh_frame + (bfd *abfd, struct bfd_link_info *info, asection *sec, + bfd_boolean (*reloc_symbol_deleted_p) (bfd_vma, void *), + struct elf_reloc_cookie *cookie) { bfd_byte *ehbuf = NULL, *buf; bfd_byte *last_cie, *last_fde; @@ -274,12 +243,11 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, /* Read the frame unwind information from abfd. */ - ehbuf = (bfd_byte *) bfd_malloc (sec->_raw_size); + ehbuf = bfd_malloc (sec->_raw_size); if (ehbuf == NULL) goto free_no_table; - if (! bfd_get_section_contents (abfd, sec, ehbuf, (bfd_vma) 0, - sec->_raw_size)) + if (! bfd_get_section_contents (abfd, sec, ehbuf, 0, sec->_raw_size)) goto free_no_table; if (sec->_raw_size >= 4 @@ -693,9 +661,7 @@ free_no_table: input sections. It finalizes the size of .eh_frame_hdr section. */ bfd_boolean -_bfd_elf_discard_section_eh_frame_hdr (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +_bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) { struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; @@ -723,8 +689,7 @@ _bfd_elf_discard_section_eh_frame_hdr (abfd, info) since dynamic symbol table has been sized. */ bfd_boolean -_bfd_elf_maybe_strip_eh_frame_hdr (info) - struct bfd_link_info *info; +_bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *info) { asection *o; bfd *abfd; @@ -770,18 +735,16 @@ _bfd_elf_maybe_strip_eh_frame_hdr (info) or to offset with dynamic relocation which is no longer needed. */ bfd_vma -_bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) - bfd *output_bfd ATTRIBUTE_UNUSED; - asection *sec; - bfd_vma offset; +_bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, + asection *sec, + bfd_vma offset) { struct eh_frame_sec_info *sec_info; unsigned int lo, hi, mid; if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME) return offset; - sec_info = (struct eh_frame_sec_info *) - elf_section_data (sec)->sec_info; + sec_info = elf_section_data (sec)->sec_info; if (offset >= sec->_raw_size) return offset - (sec->_cooked_size - sec->_raw_size); @@ -830,11 +793,10 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) contents. */ bfd_boolean -_bfd_elf_write_section_eh_frame (abfd, info, sec, contents) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - bfd_byte *contents; +_bfd_elf_write_section_eh_frame (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + bfd_byte *contents) { struct eh_frame_sec_info *sec_info; struct elf_link_hash_table *htab; @@ -849,12 +811,9 @@ _bfd_elf_write_section_eh_frame (abfd, info, sec, contents) == ELFCLASS64) ? 8 : 4; if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME) - return bfd_set_section_contents (abfd, sec->output_section, - contents, - (file_ptr) sec->output_offset, - sec->_raw_size); - sec_info = (struct eh_frame_sec_info *) - elf_section_data (sec)->sec_info; + return bfd_set_section_contents (abfd, sec->output_section, contents, + sec->output_offset, sec->_raw_size); + sec_info = elf_section_data (sec)->sec_info; htab = elf_hash_table (info); hdr_info = &htab->eh_info; if (hdr_info->table && hdr_info->array == NULL) @@ -1079,12 +1038,10 @@ _bfd_elf_write_section_eh_frame (abfd, info, sec, contents) VMA of FDE initial location. */ static int -vma_compare (a, b) - const PTR a; - const PTR b; +vma_compare (const void *a, const void *b) { - struct eh_frame_array_ent *p = (struct eh_frame_array_ent *) a; - struct eh_frame_array_ent *q = (struct eh_frame_array_ent *) b; + const struct eh_frame_array_ent *p = a; + const struct eh_frame_array_ent *q = b; if (p->initial_loc > q->initial_loc) return 1; if (p->initial_loc < q->initial_loc) @@ -1115,9 +1072,7 @@ vma_compare (a, b) sorted by increasing initial_loc). */ bfd_boolean -_bfd_elf_write_section_eh_frame_hdr (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +_bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) { struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index 90f6482..b0be701 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -44,62 +44,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_hppa_final_link elf32_hppa_final_link #endif -static void elf_hppa_info_to_howto - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); - -static void elf_hppa_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); - -static reloc_howto_type * elf_hppa_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); - -static bfd_boolean elf_hppa_is_local_label_name - PARAMS ((bfd *, const char *)); - -static bfd_boolean elf_hppa_fake_sections - PARAMS ((bfd *abfd, Elf_Internal_Shdr *, asection *)); - -static void elf_hppa_final_write_processing - PARAMS ((bfd *, bfd_boolean)); - -static int hppa_unwind_entry_compare - PARAMS ((const PTR, const PTR)); - -static bfd_boolean elf_hppa_sort_unwind - PARAMS ((bfd *)); - #if ARCH_SIZE == 64 -static bfd_boolean elf_hppa_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, - const char **, flagword *, asection **, bfd_vma *)); - -static bfd_boolean elf_hppa_unmark_useless_dynamic_symbols - PARAMS ((struct elf_link_hash_entry *, PTR)); - -static bfd_boolean elf_hppa_remark_useless_dynamic_symbols - PARAMS ((struct elf_link_hash_entry *, PTR)); - -static bfd_boolean elf_hppa_is_dynamic_loader_symbol - PARAMS ((const char *)); - -static void elf_hppa_record_segment_addrs - PARAMS ((bfd *, asection *, PTR)); - -static bfd_boolean elf_hppa_final_link - PARAMS ((bfd *, struct bfd_link_info *)); - -static bfd_boolean elf_hppa_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, - bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); - static bfd_reloc_status_type elf_hppa_final_link_relocate - PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *, - bfd_byte *, bfd_vma, struct bfd_link_info *, - asection *, struct elf_link_hash_entry *, - struct elf64_hppa_dyn_hash_entry *)); + (Elf_Internal_Rela *, bfd *, bfd *, asection *, bfd_byte *, bfd_vma, + struct bfd_link_info *, asection *, struct elf_link_hash_entry *, + struct elf64_hppa_dyn_hash_entry *); static int elf_hppa_relocate_insn - PARAMS ((int, int, unsigned int)); + (int, int, unsigned int); #endif /* ELF/PA relocation howto entries. */ @@ -615,11 +567,10 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = format, and field selector. */ elf_hppa_reloc_type -elf_hppa_reloc_final_type (abfd, base_type, format, field) - bfd *abfd; - elf_hppa_reloc_type base_type; - int format; - unsigned int field; +elf_hppa_reloc_final_type (bfd *abfd, + elf_hppa_reloc_type base_type, + int format, + unsigned int field) { elf_hppa_reloc_type final_type = base_type; @@ -884,26 +835,25 @@ elf_hppa_reloc_final_type (abfd, base_type, format, field) relocation with modifications based on format and field. */ elf_hppa_reloc_type ** -_bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) - bfd *abfd; - elf_hppa_reloc_type base_type; - int format; - unsigned int field; - int ignore ATTRIBUTE_UNUSED; - asymbol *sym ATTRIBUTE_UNUSED; +_bfd_elf_hppa_gen_reloc_type (bfd *abfd, + elf_hppa_reloc_type base_type, + int format, + unsigned int field, + int ignore ATTRIBUTE_UNUSED, + asymbol *sym ATTRIBUTE_UNUSED) { elf_hppa_reloc_type *finaltype; elf_hppa_reloc_type **final_types; bfd_size_type amt = sizeof (elf_hppa_reloc_type *) * 2; /* Allocate slots for the BFD relocation. */ - final_types = (elf_hppa_reloc_type **) bfd_alloc (abfd, amt); + final_types = bfd_alloc (abfd, amt); if (final_types == NULL) return NULL; /* Allocate space for the relocation itself. */ amt = sizeof (elf_hppa_reloc_type); - finaltype = (elf_hppa_reloc_type *) bfd_alloc (abfd, amt); + finaltype = bfd_alloc (abfd, amt); if (finaltype == NULL) return NULL; @@ -919,12 +869,11 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) /* Translate from an elf into field into a howto relocation pointer. */ static void -elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *bfd_reloc; - Elf_Internal_Rela *elf_reloc; +elf_hppa_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *bfd_reloc, + Elf_Internal_Rela *elf_reloc) { - BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info) + BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info) < (unsigned int) R_PARISC_UNIMPLEMENTED); bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)]; } @@ -932,10 +881,9 @@ elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc) /* Translate from an elf into field into a howto relocation pointer. */ static void -elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *bfd_reloc; - Elf_Internal_Rela *elf_reloc; +elf_hppa_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, + arelent *bfd_reloc, + Elf_Internal_Rela *elf_reloc) { BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info) < (unsigned int) R_PARISC_UNIMPLEMENTED); @@ -946,9 +894,8 @@ elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) relocation for an ARCH machine. */ static reloc_howto_type * -elf_hppa_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +elf_hppa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { if ((int) code < (int) R_PARISC_UNIMPLEMENTED) { @@ -961,9 +908,7 @@ elf_hppa_reloc_type_lookup (abfd, code) /* Return TRUE if SYM represents a local label symbol. */ static bfd_boolean -elf_hppa_is_local_label_name (abfd, name) - bfd *abfd ATTRIBUTE_UNUSED; - const char *name; +elf_hppa_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name) { if (name[0] == 'L' && name[1] == '$') return 1; @@ -974,12 +919,9 @@ elf_hppa_is_local_label_name (abfd, name) section name, which is a hack, but ought to work. */ static bfd_boolean -elf_hppa_fake_sections (abfd, hdr, sec) - bfd *abfd; - Elf_Internal_Shdr *hdr; - asection *sec; +elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec) { - register const char *name; + const char *name; name = bfd_get_section_name (abfd, sec); @@ -1017,9 +959,8 @@ elf_hppa_fake_sections (abfd, hdr, sec) } static void -elf_hppa_final_write_processing (abfd, linker) - bfd *abfd; - bfd_boolean linker ATTRIBUTE_UNUSED; +elf_hppa_final_write_processing (bfd *abfd, + bfd_boolean linker ATTRIBUTE_UNUSED) { int mach = bfd_get_mach (abfd); @@ -1048,20 +989,18 @@ elf_hppa_final_write_processing (abfd, linker) final link. */ static int -hppa_unwind_entry_compare (a, b) - const PTR a; - const PTR b; +hppa_unwind_entry_compare (const void *a, const void *b) { const bfd_byte *ap, *bp; unsigned long av, bv; - ap = (const bfd_byte *) a; + ap = a; av = (unsigned long) ap[0] << 24; av |= (unsigned long) ap[1] << 16; av |= (unsigned long) ap[2] << 8; av |= (unsigned long) ap[3]; - bp = (const bfd_byte *) b; + bp = b; bv = (unsigned long) bp[0] << 24; bv |= (unsigned long) bp[1] << 16; bv |= (unsigned long) bp[2] << 8; @@ -1070,8 +1009,7 @@ hppa_unwind_entry_compare (a, b) return av < bv ? -1 : av > bv ? 1 : 0; } -static bfd_boolean elf_hppa_sort_unwind (abfd) - bfd *abfd; +static bfd_boolean elf_hppa_sort_unwind (bfd *abfd) { asection *s; @@ -1108,14 +1046,13 @@ static bfd_boolean elf_hppa_sort_unwind (abfd) indices, which we have to handle. */ static bfd_boolean -elf_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const Elf_Internal_Sym *sym; - const char **namep ATTRIBUTE_UNUSED; - flagword *flagsp ATTRIBUTE_UNUSED; - asection **secp; - bfd_vma *valp; +elf_hppa_add_symbol_hook (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + const Elf_Internal_Sym *sym, + const char **namep ATTRIBUTE_UNUSED, + flagword *flagsp ATTRIBUTE_UNUSED, + asection **secp, + bfd_vma *valp) { int index = sym->st_shndx; @@ -1138,11 +1075,10 @@ elf_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) } static bfd_boolean -elf_hppa_unmark_useless_dynamic_symbols (h, data) - struct elf_link_hash_entry *h; - PTR data; +elf_hppa_unmark_useless_dynamic_symbols (struct elf_link_hash_entry *h, + void *data) { - struct bfd_link_info *info = (struct bfd_link_info *)data; + struct bfd_link_info *info = data; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -1174,11 +1110,10 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data) } static bfd_boolean -elf_hppa_remark_useless_dynamic_symbols (h, data) - struct elf_link_hash_entry *h; - PTR data; +elf_hppa_remark_useless_dynamic_symbols (struct elf_link_hash_entry *h, + void *data) { - struct bfd_link_info *info = (struct bfd_link_info *)data; + struct bfd_link_info *info = data; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -1211,8 +1146,7 @@ elf_hppa_remark_useless_dynamic_symbols (h, data) } static bfd_boolean -elf_hppa_is_dynamic_loader_symbol (name) - const char * name; +elf_hppa_is_dynamic_loader_symbol (const char *name) { return (! strcmp (name, "__CPU_REVISION") || ! strcmp (name, "__CPU_KEYBITS_1") @@ -1229,15 +1163,14 @@ elf_hppa_is_dynamic_loader_symbol (name) /* Record the lowest address for the data and text segments. */ static void -elf_hppa_record_segment_addrs (abfd, section, data) - bfd *abfd ATTRIBUTE_UNUSED; - asection *section; - PTR data; +elf_hppa_record_segment_addrs (bfd *abfd ATTRIBUTE_UNUSED, + asection *section, + void *data) { struct elf64_hppa_link_hash_table *hppa_info; bfd_vma value; - hppa_info = (struct elf64_hppa_link_hash_table *)data; + hppa_info = data; value = section->vma - section->filepos; @@ -1258,9 +1191,7 @@ elf_hppa_record_segment_addrs (abfd, section, data) fall back to the generic ELF final link routine. */ static bfd_boolean -elf_hppa_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +elf_hppa_final_link (bfd *abfd, struct bfd_link_info *info) { bfd_boolean retval; struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info); @@ -1360,16 +1291,14 @@ elf_hppa_final_link (abfd, info) /* Relocate an HPPA ELF section. */ static bfd_boolean -elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +elf_hppa_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *rel; @@ -1578,19 +1507,16 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, function. */ static bfd_reloc_status_type -elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, - input_section, contents, value, - info, sym_sec, h, dyn_h) - Elf_Internal_Rela *rel; - bfd *input_bfd; - bfd *output_bfd; - asection *input_section; - bfd_byte *contents; - bfd_vma value; - struct bfd_link_info *info; - asection *sym_sec; - struct elf_link_hash_entry *h ATTRIBUTE_UNUSED; - struct elf64_hppa_dyn_hash_entry *dyn_h; +elf_hppa_final_link_relocate (Elf_Internal_Rela *rel, + bfd *input_bfd, + bfd *output_bfd, + asection *input_section, + bfd_byte *contents, + bfd_vma value, + struct bfd_link_info *info, + asection *sym_sec, + struct elf_link_hash_entry *h ATTRIBUTE_UNUSED, + struct elf64_hppa_dyn_hash_entry *dyn_h) { int insn; bfd_vma offset = rel->r_offset; @@ -2136,10 +2062,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, to insert the relocation into the given instruction. */ static int -elf_hppa_relocate_insn (insn, sym_value, r_type) - int insn; - int sym_value; - unsigned int r_type; +elf_hppa_relocate_insn (int insn, int sym_value, unsigned int r_type) { switch (r_type) { diff --git a/bfd/elf-strtab.c b/bfd/elf-strtab.c index 3bd5531..764ab54 100644 --- a/bfd/elf-strtab.c +++ b/bfd/elf-strtab.c @@ -57,53 +57,46 @@ struct elf_strtab_hash struct elf_strtab_hash_entry **array; }; -static struct bfd_hash_entry *elf_strtab_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static int cmplengthentry PARAMS ((const PTR, const PTR)); -static int last4_eq PARAMS ((const PTR, const PTR)); - /* Routine to create an entry in a section merge hashtab. */ static struct bfd_hash_entry * -elf_strtab_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +elf_strtab_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { - struct elf_strtab_hash_entry *ret = (struct elf_strtab_hash_entry *) entry; - /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct elf_strtab_hash_entry *) NULL) - ret = ((struct elf_strtab_hash_entry *) - bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry))); - if (ret == (struct elf_strtab_hash_entry *) NULL) + if (entry == NULL) + entry = bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry)); + if (entry == NULL) return NULL; /* Call the allocation method of the superclass. */ - ret = ((struct elf_strtab_hash_entry *) - bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + entry = bfd_hash_newfunc (entry, table, string); - if (ret) + if (entry) { /* Initialize the local fields. */ + struct elf_strtab_hash_entry *ret; + + ret = (struct elf_strtab_hash_entry *) entry; ret->u.index = -1; ret->refcount = 0; ret->len = 0; } - return (struct bfd_hash_entry *)ret; + return entry; } /* Create a new hash table. */ struct elf_strtab_hash * -_bfd_elf_strtab_init () +_bfd_elf_strtab_init (void) { struct elf_strtab_hash *table; bfd_size_type amt = sizeof (struct elf_strtab_hash); - table = (struct elf_strtab_hash *) bfd_malloc (amt); + table = bfd_malloc (amt); if (table == NULL) return NULL; @@ -117,8 +110,7 @@ _bfd_elf_strtab_init () table->size = 1; table->alloced = 64; amt = sizeof (struct elf_strtab_hasn_entry *); - table->array = (struct elf_strtab_hash_entry **) - bfd_malloc (table->alloced * amt); + table->array = bfd_malloc (table->alloced * amt); if (table->array == NULL) { free (table); @@ -133,8 +125,7 @@ _bfd_elf_strtab_init () /* Free a strtab. */ void -_bfd_elf_strtab_free (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_free (struct elf_strtab_hash *tab) { bfd_hash_table_free (&tab->table); free (tab->array); @@ -145,10 +136,9 @@ _bfd_elf_strtab_free (tab) already present. */ bfd_size_type -_bfd_elf_strtab_add (tab, str, copy) - struct elf_strtab_hash *tab; - const char *str; - bfd_boolean copy; +_bfd_elf_strtab_add (struct elf_strtab_hash *tab, + const char *str, + bfd_boolean copy) { register struct elf_strtab_hash_entry *entry; @@ -172,8 +162,7 @@ _bfd_elf_strtab_add (tab, str, copy) { bfd_size_type amt = sizeof (struct elf_strtab_hash_entry *); tab->alloced *= 2; - tab->array = (struct elf_strtab_hash_entry **) - bfd_realloc (tab->array, tab->alloced * amt); + tab->array = bfd_realloc (tab->array, tab->alloced * amt); if (tab->array == NULL) return (bfd_size_type) -1; } @@ -185,9 +174,7 @@ _bfd_elf_strtab_add (tab, str, copy) } void -_bfd_elf_strtab_addref (tab, idx) - struct elf_strtab_hash *tab; - bfd_size_type idx; +_bfd_elf_strtab_addref (struct elf_strtab_hash *tab, bfd_size_type idx) { if (idx == 0 || idx == (bfd_size_type) -1) return; @@ -197,9 +184,7 @@ _bfd_elf_strtab_addref (tab, idx) } void -_bfd_elf_strtab_delref (tab, idx) - struct elf_strtab_hash *tab; - bfd_size_type idx; +_bfd_elf_strtab_delref (struct elf_strtab_hash *tab, bfd_size_type idx) { if (idx == 0 || idx == (bfd_size_type) -1) return; @@ -210,8 +195,7 @@ _bfd_elf_strtab_delref (tab, idx) } void -_bfd_elf_strtab_clear_all_refs (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_clear_all_refs (struct elf_strtab_hash *tab) { bfd_size_type idx; @@ -220,16 +204,13 @@ _bfd_elf_strtab_clear_all_refs (tab) } bfd_size_type -_bfd_elf_strtab_size (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_size (struct elf_strtab_hash *tab) { return tab->sec_size ? tab->sec_size : tab->size; } bfd_size_type -_bfd_elf_strtab_offset (tab, idx) - struct elf_strtab_hash *tab; - bfd_size_type idx; +_bfd_elf_strtab_offset (struct elf_strtab_hash *tab, bfd_size_type idx) { struct elf_strtab_hash_entry *entry; @@ -244,9 +225,7 @@ _bfd_elf_strtab_offset (tab, idx) } bfd_boolean -_bfd_elf_strtab_emit (abfd, tab) - register bfd *abfd; - struct elf_strtab_hash *tab; +_bfd_elf_strtab_emit (register bfd *abfd, struct elf_strtab_hash *tab) { bfd_size_type off = 1, i; @@ -264,7 +243,7 @@ _bfd_elf_strtab_emit (abfd, tab) if (len == 0) continue; - if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len) + if (bfd_bwrite (str, len, abfd) != len) return FALSE; off += len; @@ -277,12 +256,10 @@ _bfd_elf_strtab_emit (abfd, tab) /* Compare two elf_strtab_hash_entry structures. This is called via qsort. */ static int -cmplengthentry (a, b) - const PTR a; - const PTR b; +cmplengthentry (const void *a, const void *b) { - struct elf_strtab_hash_entry * A = *(struct elf_strtab_hash_entry **) a; - struct elf_strtab_hash_entry * B = *(struct elf_strtab_hash_entry **) b; + struct elf_strtab_hash_entry *A = *(struct elf_strtab_hash_entry **) a; + struct elf_strtab_hash_entry *B = *(struct elf_strtab_hash_entry **) b; if (A->len < B->len) return 1; @@ -293,12 +270,10 @@ cmplengthentry (a, b) } static int -last4_eq (a, b) - const PTR a; - const PTR b; +last4_eq (const void *a, const void *b) { - struct elf_strtab_hash_entry * A = (struct elf_strtab_hash_entry *) a; - struct elf_strtab_hash_entry * B = (struct elf_strtab_hash_entry *) b; + const struct elf_strtab_hash_entry *A = a; + const struct elf_strtab_hash_entry *B = b; if (memcmp (A->root.string + A->len - 5, B->root.string + B->len - 5, 4) != 0) @@ -318,8 +293,7 @@ last4_eq (a, b) merging strings matching suffixes of longer strings if possible. */ void -_bfd_elf_strtab_finalize (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_finalize (struct elf_strtab_hash *tab) { struct elf_strtab_hash_entry **array, **a, **end, *e; htab_t last4tab = NULL; @@ -335,7 +309,7 @@ _bfd_elf_strtab_finalize (tab) /* Now sort the strings by length, longest first. */ array = NULL; amt = tab->size * sizeof (struct elf_strtab_hash_entry *); - array = (struct elf_strtab_hash_entry **) bfd_malloc (amt); + array = bfd_malloc (amt); if (array == NULL) goto alloc_failure; @@ -365,7 +339,7 @@ _bfd_elf_strtab_finalize (tab) unsigned int c; unsigned int j; const unsigned char *s; - PTR *p; + void **p; e = *a; if (e->len > 4) @@ -385,13 +359,13 @@ _bfd_elf_strtab_finalize (tab) { struct elf_strtab_hash_entry *ent; - ent = (struct elf_strtab_hash_entry *) *p; + ent = *p; e->u.suffix = ent; e->len = 0; continue; } else - *p = (PTR) e; + *p = e; } else { diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index ca3e8e1..9338793 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -223,8 +223,8 @@ struct elf32_hppa_link_hash_table { bfd *stub_bfd; /* Linker call-backs. */ - asection * (*add_stub_section) PARAMS ((const char *, asection *)); - void (*layout_sections_again) PARAMS ((void)); + asection * (*add_stub_section) (const char *, asection *); + void (*layout_sections_again) (void); /* Array to keep track of which stub sections have been created, and information on stub grouping. */ @@ -279,139 +279,14 @@ struct elf32_hppa_link_hash_table { ((struct elf32_hppa_stub_hash_entry *) \ bfd_hash_lookup ((table), (string), (create), (copy))) -static struct bfd_hash_entry *stub_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); - -static struct bfd_hash_entry *hppa_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); - -static struct bfd_link_hash_table *elf32_hppa_link_hash_table_create - PARAMS ((bfd *)); - -static void elf32_hppa_link_hash_table_free - PARAMS ((struct bfd_link_hash_table *)); - -/* Stub handling functions. */ -static char *hppa_stub_name - PARAMS ((const asection *, const asection *, - const struct elf32_hppa_link_hash_entry *, - const Elf_Internal_Rela *)); - -static struct elf32_hppa_stub_hash_entry *hppa_get_stub_entry - PARAMS ((const asection *, const asection *, - struct elf32_hppa_link_hash_entry *, - const Elf_Internal_Rela *, - struct elf32_hppa_link_hash_table *)); - -static struct elf32_hppa_stub_hash_entry *hppa_add_stub - PARAMS ((const char *, asection *, struct elf32_hppa_link_hash_table *)); - -static enum elf32_hppa_stub_type hppa_type_of_stub - PARAMS ((asection *, const Elf_Internal_Rela *, - struct elf32_hppa_link_hash_entry *, bfd_vma)); - -static bfd_boolean hppa_build_one_stub - PARAMS ((struct bfd_hash_entry *, PTR)); - -static bfd_boolean hppa_size_one_stub - PARAMS ((struct bfd_hash_entry *, PTR)); - -/* BFD and elf backend functions. */ -static bfd_boolean elf32_hppa_object_p PARAMS ((bfd *)); - -static bfd_boolean elf32_hppa_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, - const char **, flagword *, asection **, bfd_vma *)); - -static bfd_boolean elf32_hppa_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -static void elf32_hppa_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); - -static bfd_boolean elf32_hppa_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, - asection *, const Elf_Internal_Rela *)); - -static asection *elf32_hppa_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); - -static bfd_boolean elf32_hppa_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, - asection *, const Elf_Internal_Rela *)); - -static void elf32_hppa_hide_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean)); - -static bfd_boolean elf32_hppa_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); - -static bfd_boolean mark_PIC_calls - PARAMS ((struct elf_link_hash_entry *, PTR)); - -static bfd_boolean allocate_plt_static - PARAMS ((struct elf_link_hash_entry *, PTR)); - -static bfd_boolean allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); - -static bfd_boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); - -static bfd_boolean clobber_millicode_symbols - PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *)); - -static bfd_boolean elf32_hppa_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -static void group_sections - PARAMS ((struct elf32_hppa_link_hash_table *, bfd_size_type, bfd_boolean)); - -static int get_local_syms - PARAMS ((bfd *, bfd *, struct bfd_link_info *)); - -static bfd_boolean elf32_hppa_final_link - PARAMS ((bfd *, struct bfd_link_info *)); - -static void hppa_record_segment_addr - PARAMS ((bfd *, asection *, PTR)); - -static bfd_reloc_status_type final_link_relocate - PARAMS ((asection *, bfd_byte *, const Elf_Internal_Rela *, - bfd_vma, struct elf32_hppa_link_hash_table *, asection *, - struct elf32_hppa_link_hash_entry *)); - -static bfd_boolean elf32_hppa_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, - bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); - -static bfd_boolean elf32_hppa_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); - -static enum elf_reloc_type_class elf32_hppa_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); - -static bfd_boolean elf32_hppa_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -static void elf32_hppa_post_process_headers - PARAMS ((bfd *, struct bfd_link_info *)); - -static int elf32_hppa_elf_get_symbol_type - PARAMS ((Elf_Internal_Sym *, int)); - /* Assorted hash table functions. */ /* Initialize an entry in the stub hash table. */ static struct bfd_hash_entry * -stub_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +stub_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -446,10 +321,9 @@ stub_hash_newfunc (entry, table, string) /* Initialize an entry in the link hash table. */ static struct bfd_hash_entry * -hppa_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +hppa_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -483,13 +357,12 @@ hppa_link_hash_newfunc (entry, table, string) using static variables). */ static struct bfd_link_hash_table * -elf32_hppa_link_hash_table_create (abfd) - bfd *abfd; +elf32_hppa_link_hash_table_create (bfd *abfd) { struct elf32_hppa_link_hash_table *ret; bfd_size_type amt = sizeof (*ret); - ret = (struct elf32_hppa_link_hash_table *) bfd_malloc (amt); + ret = bfd_malloc (amt); if (ret == NULL) return NULL; @@ -528,8 +401,7 @@ elf32_hppa_link_hash_table_create (abfd) /* Free the derived linker hash table. */ static void -elf32_hppa_link_hash_table_free (hash) - struct bfd_link_hash_table *hash; +elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *hash) { struct elf32_hppa_link_hash_table *ret = (struct elf32_hppa_link_hash_table *) hash; @@ -541,11 +413,10 @@ elf32_hppa_link_hash_table_free (hash) /* Build a name for an entry in the stub hash table. */ static char * -hppa_stub_name (input_section, sym_sec, hash, rel) - const asection *input_section; - const asection *sym_sec; - const struct elf32_hppa_link_hash_entry *hash; - const Elf_Internal_Rela *rel; +hppa_stub_name (const asection *input_section, + const asection *sym_sec, + const struct elf32_hppa_link_hash_entry *hash, + const Elf_Internal_Rela *rel) { char *stub_name; bfd_size_type len; @@ -582,12 +453,11 @@ hppa_stub_name (input_section, sym_sec, hash, rel) creating the stub name takes a bit of time. */ static struct elf32_hppa_stub_hash_entry * -hppa_get_stub_entry (input_section, sym_sec, hash, rel, htab) - const asection *input_section; - const asection *sym_sec; - struct elf32_hppa_link_hash_entry *hash; - const Elf_Internal_Rela *rel; - struct elf32_hppa_link_hash_table *htab; +hppa_get_stub_entry (const asection *input_section, + const asection *sym_sec, + struct elf32_hppa_link_hash_entry *hash, + const Elf_Internal_Rela *rel, + struct elf32_hppa_link_hash_table *htab) { struct elf32_hppa_stub_hash_entry *stub_entry; const asection *id_sec; @@ -628,10 +498,9 @@ hppa_get_stub_entry (input_section, sym_sec, hash, rel, htab) stub entry are initialised. */ static struct elf32_hppa_stub_hash_entry * -hppa_add_stub (stub_name, section, htab) - const char *stub_name; - asection *section; - struct elf32_hppa_link_hash_table *htab; +hppa_add_stub (const char *stub_name, + asection *section, + struct elf32_hppa_link_hash_table *htab) { asection *link_sec; asection *stub_sec; @@ -684,11 +553,10 @@ hppa_add_stub (stub_name, section, htab) /* Determine the type of stub needed, if any, for a call. */ static enum elf32_hppa_stub_type -hppa_type_of_stub (input_sec, rel, hash, destination) - asection *input_sec; - const Elf_Internal_Rela *rel; - struct elf32_hppa_link_hash_entry *hash; - bfd_vma destination; +hppa_type_of_stub (asection *input_sec, + const Elf_Internal_Rela *rel, + struct elf32_hppa_link_hash_entry *hash, + bfd_vma destination) { bfd_vma location; bfd_vma branch_offset; @@ -777,9 +645,7 @@ hppa_type_of_stub (input_sec, rel, hash, destination) #endif static bfd_boolean -hppa_build_one_stub (gen_entry, in_arg) - struct bfd_hash_entry *gen_entry; - PTR in_arg; +hppa_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct elf32_hppa_stub_hash_entry *stub_entry; struct bfd_link_info *info; @@ -795,7 +661,7 @@ hppa_build_one_stub (gen_entry, in_arg) /* Massage our args to the form they really have. */ stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry; - info = (struct bfd_link_info *) in_arg; + info = in_arg; htab = hppa_link_hash_table (info); stub_sec = stub_entry->stub_sec; @@ -817,11 +683,11 @@ hppa_build_one_stub (gen_entry, in_arg) + stub_entry->target_section->output_offset + stub_entry->target_section->output_section->vma); - val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_lrsel); + val = hppa_field_adjust (sym_value, 0, e_lrsel); insn = hppa_rebuild_insn ((int) LDIL_R1, val, 21); bfd_put_32 (stub_bfd, insn, loc); - val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_rrsel) >> 2; + val = hppa_field_adjust (sym_value, 0, e_rrsel) >> 2; insn = hppa_rebuild_insn ((int) BE_SR4_R1, val, 17); bfd_put_32 (stub_bfd, insn, loc + 4); @@ -867,7 +733,7 @@ hppa_build_one_stub (gen_entry, in_arg) if (stub_entry->stub_type == hppa_stub_import_shared) insn = ADDIL_R19; #endif - val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_lrsel), + val = hppa_field_adjust (sym_value, 0, e_lrsel), insn = hppa_rebuild_insn ((int) insn, val, 21); bfd_put_32 (stub_bfd, insn, loc); @@ -876,7 +742,7 @@ hppa_build_one_stub (gen_entry, in_arg) lsel/rsel then with unfortunate sym_values we will round sym_value+4 up to the next 2k block leading to a mis-match between the lsel and rsel value. */ - val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_rrsel); + val = hppa_field_adjust (sym_value, 0, e_rrsel); insn = hppa_rebuild_insn ((int) LDW_R1_R21, val, 14); bfd_put_32 (stub_bfd, insn, loc + 4); @@ -1018,9 +884,7 @@ hppa_build_one_stub (gen_entry, in_arg) we know stub section sizes. */ static bfd_boolean -hppa_size_one_stub (gen_entry, in_arg) - struct bfd_hash_entry *gen_entry; - PTR in_arg; +hppa_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct elf32_hppa_stub_hash_entry *stub_entry; struct elf32_hppa_link_hash_table *htab; @@ -1028,7 +892,7 @@ hppa_size_one_stub (gen_entry, in_arg) /* Massage our args to the form they really have. */ stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry; - htab = (struct elf32_hppa_link_hash_table *) in_arg; + htab = in_arg; if (stub_entry->stub_type == hppa_stub_long_branch) size = 8; @@ -1052,8 +916,7 @@ hppa_size_one_stub (gen_entry, in_arg) Additionally we set the default architecture and machine. */ static bfd_boolean -elf32_hppa_object_p (abfd) - bfd *abfd; +elf32_hppa_object_p (bfd *abfd) { Elf_Internal_Ehdr * i_ehdrp; unsigned int flags; @@ -1085,30 +948,11 @@ elf32_hppa_object_p (abfd) return TRUE; } -/* Undo the generic ELF code's subtraction of section->vma from the - value of each external symbol. */ - -static bfd_boolean -elf32_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - const Elf_Internal_Sym *sym ATTRIBUTE_UNUSED; - const char **namep ATTRIBUTE_UNUSED; - flagword *flagsp ATTRIBUTE_UNUSED; - asection **secp; - bfd_vma *valp; -{ - *valp += (*secp)->vma; - return TRUE; -} - /* Create the .plt and .got sections, and set up our hash table short-cuts to various dynamic sections. */ static bfd_boolean -elf32_hppa_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +elf32_hppa_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { struct elf32_hppa_link_hash_table *htab; @@ -1146,9 +990,9 @@ elf32_hppa_create_dynamic_sections (abfd, info) /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf32_hppa_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; - struct elf_link_hash_entry *dir, *ind; +elf32_hppa_copy_indirect_symbol (struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { struct elf32_hppa_link_hash_entry *edir, *eind; @@ -1200,11 +1044,10 @@ elf32_hppa_copy_indirect_symbol (bed, dir, ind) necessarily read all the input files. */ static bfd_boolean -elf32_hppa_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +elf32_hppa_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1422,8 +1265,7 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs) pointer. */ size = symtab_hdr->sh_info; size *= 2 * sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); + local_got_refcounts = bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return FALSE; elf_local_got_refcounts (abfd) = local_got_refcounts; @@ -1469,8 +1311,7 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs) plt offsets. */ size = symtab_hdr->sh_info; size *= 2 * sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); + local_got_refcounts = bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return FALSE; elf_local_got_refcounts (abfd) = local_got_refcounts; @@ -1604,9 +1445,7 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs) p = *head; if (p == NULL || p->sec != sec) { - p = ((struct elf32_hppa_dyn_reloc_entry *) - bfd_alloc (htab->elf.dynobj, - (bfd_size_type) sizeof *p)); + p = bfd_alloc (htab->elf.dynobj, sizeof *p); if (p == NULL) return FALSE; p->next = *head; @@ -1634,12 +1473,11 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs) for a given relocation. */ static asection * -elf32_hppa_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf32_hppa_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) { @@ -1674,11 +1512,10 @@ elf32_hppa_gc_mark_hook (sec, info, rel, h, sym) removed. */ static bfd_boolean -elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec; - const Elf_Internal_Rela *relocs; +elf32_hppa_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sec, + const Elf_Internal_Rela *relocs) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; @@ -1777,10 +1614,9 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs) plabels. */ static void -elf32_hppa_hide_symbol (info, h, force_local) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - bfd_boolean force_local; +elf32_hppa_hide_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h, + bfd_boolean force_local) { if (force_local) { @@ -1818,9 +1654,8 @@ elf32_hppa_hide_symbol (info, h, force_local) understand. */ static bfd_boolean -elf32_hppa_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { struct elf32_hppa_link_hash_table *htab; struct elf32_hppa_link_hash_entry *eh; @@ -1963,9 +1798,7 @@ elf32_hppa_adjust_dynamic_symbol (info, h) the first part of elf32_hppa_adjust_dynamic_symbol. */ static bfd_boolean -mark_PIC_calls (h, inf) - struct elf_link_hash_entry *h; - PTR inf ATTRIBUTE_UNUSED; +mark_PIC_calls (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) { if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -1990,9 +1823,7 @@ mark_PIC_calls (h, inf) ie. pic_call and plabel entries. */ static bfd_boolean -allocate_plt_static (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +allocate_plt_static (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct elf32_hppa_link_hash_table *htab; @@ -2004,7 +1835,7 @@ allocate_plt_static (h, inf) if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - info = (struct bfd_link_info *) inf; + info = inf; htab = hppa_link_hash_table (info); if (((struct elf32_hppa_link_hash_entry *) h)->pic_call) { @@ -2064,9 +1895,7 @@ allocate_plt_static (h, inf) global syms. */ static bfd_boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct elf32_hppa_link_hash_table *htab; @@ -2080,7 +1909,7 @@ allocate_dynrelocs (h, inf) if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - info = (struct bfd_link_info *) inf; + info = inf; htab = hppa_link_hash_table (info); if (htab->elf.dynamic_sections_created && h->plt.offset != (bfd_vma) -1 @@ -2205,9 +2034,8 @@ allocate_dynrelocs (h, inf) elf_adjust_dynamic_symbol. */ static bfd_boolean -clobber_millicode_symbols (h, info) - struct elf_link_hash_entry *h; - struct bfd_link_info *info; +clobber_millicode_symbols (struct elf_link_hash_entry *h, + struct bfd_link_info *info) { if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -2223,9 +2051,7 @@ clobber_millicode_symbols (h, info) /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct elf32_hppa_link_hash_entry *eh; struct elf32_hppa_dyn_reloc_entry *p; @@ -2240,7 +2066,7 @@ readonly_dynrelocs (h, inf) if (s != NULL && (s->flags & SEC_READONLY) != 0) { - struct bfd_link_info *info = (struct bfd_link_info *) inf; + struct bfd_link_info *info = inf; info->flags |= DF_TEXTREL; @@ -2254,9 +2080,8 @@ readonly_dynrelocs (h, inf) /* Set the sizes of the dynamic sections. */ static bfd_boolean -elf32_hppa_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct elf32_hppa_link_hash_table *htab; bfd *dynobj; @@ -2292,7 +2117,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info) PIC, and mark them as needing .plt entries so that %r19 will be set up. */ if (! info->shared) - elf_link_hash_traverse (&htab->elf, mark_PIC_calls, (PTR) info); + elf_link_hash_traverse (&htab->elf, mark_PIC_calls, info); } /* Set up .got and .plt offsets for local syms, and space for local @@ -2389,11 +2214,11 @@ elf32_hppa_size_dynamic_sections (output_bfd, info) /* Do all the .plt entries without relocs first. The dynamic linker uses the last .plt reloc to find the end of the .plt (and hence the start of the .got) for lazy linking. */ - elf_link_hash_traverse (&htab->elf, allocate_plt_static, (PTR) info); + elf_link_hash_traverse (&htab->elf, allocate_plt_static, info); /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate @@ -2460,7 +2285,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info) /* Allocate memory for the section contents. Zero it, because we may not fill in all the reloc sections. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + s->contents = bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return FALSE; } @@ -2506,8 +2331,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info) /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, - (PTR) info); + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info); if ((info->flags & DF_TEXTREL) != 0) { @@ -2528,9 +2352,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info) 0 when no stubs will be needed, and 1 on success. */ int -elf32_hppa_setup_section_lists (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +elf32_hppa_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) { bfd *input_bfd; unsigned int bfd_count; @@ -2560,7 +2382,7 @@ elf32_hppa_setup_section_lists (output_bfd, info) htab->bfd_count = bfd_count; amt = sizeof (struct map_stub) * (top_id + 1); - htab->stub_group = (struct map_stub *) bfd_zmalloc (amt); + htab->stub_group = bfd_zmalloc (amt); if (htab->stub_group == NULL) return -1; @@ -2577,7 +2399,7 @@ elf32_hppa_setup_section_lists (output_bfd, info) htab->top_index = top_index; amt = sizeof (asection *) * (top_index + 1); - input_list = (asection **) bfd_malloc (amt); + input_list = bfd_malloc (amt); htab->input_list = input_list; if (input_list == NULL) return -1; @@ -2606,9 +2428,7 @@ elf32_hppa_setup_section_lists (output_bfd, info) we may insert linker stubs. */ void -elf32_hppa_next_input_section (info, isec) - struct bfd_link_info *info; - asection *isec; +elf32_hppa_next_input_section (struct bfd_link_info *info, asection *isec) { struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info); @@ -2635,10 +2455,9 @@ elf32_hppa_next_input_section (info, isec) the middle of a function is not a good idea. */ static void -group_sections (htab, stub_group_size, stubs_always_before_branch) - struct elf32_hppa_link_hash_table *htab; - bfd_size_type stub_group_size; - bfd_boolean stubs_always_before_branch; +group_sections (struct elf32_hppa_link_hash_table *htab, + bfd_size_type stub_group_size, + bfd_boolean stubs_always_before_branch) { asection **list = htab->input_list + htab->top_index; do @@ -2716,10 +2535,7 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) Returns -1 on error, 1 if export stubs created, 0 otherwise. */ static int -get_local_syms (output_bfd, input_bfd, info) - bfd *output_bfd; - bfd *input_bfd; - struct bfd_link_info *info; +get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info) { unsigned int bfd_indx; Elf_Internal_Sym *local_syms, **all_local_syms; @@ -2730,7 +2546,7 @@ get_local_syms (output_bfd, input_bfd, info) we need to read in the local symbols in parallel and save them for later use; so hold pointers to the local symbols in an array. */ bfd_size_type amt = sizeof (Elf_Internal_Sym *) * htab->bfd_count; - all_local_syms = (Elf_Internal_Sym **) bfd_zmalloc (amt); + all_local_syms = bfd_zmalloc (amt); htab->all_local_syms = all_local_syms; if (all_local_syms == NULL) return -1; @@ -2844,15 +2660,11 @@ get_local_syms (output_bfd, input_bfd, info) instruction. */ bfd_boolean -elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, - add_stub_section, layout_sections_again) - bfd *output_bfd; - bfd *stub_bfd; - struct bfd_link_info *info; - bfd_boolean multi_subspace; - bfd_signed_vma group_size; - asection * (*add_stub_section) PARAMS ((const char *, asection *)); - void (*layout_sections_again) PARAMS ((void)); +elf32_hppa_size_stubs + (bfd *output_bfd, bfd *stub_bfd, struct bfd_link_info *info, + bfd_boolean multi_subspace, bfd_signed_vma group_size, + asection * (*add_stub_section) (const char *, asection *), + void (*layout_sections_again) (void)) { bfd_size_type stub_group_size; bfd_boolean stubs_always_before_branch; @@ -2950,8 +2762,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, /* Get the relocs. */ internal_relocs - = _bfd_elf_link_read_relocs (input_bfd, section, NULL, - (Elf_Internal_Rela *) NULL, + = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL, info->keep_memory); if (internal_relocs == NULL) goto error_ret_free_local; @@ -3138,9 +2949,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, stubs to provide a value for __gp. */ bfd_boolean -elf32_hppa_set_gp (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +elf32_hppa_set_gp (bfd *abfd, struct bfd_link_info *info) { struct bfd_link_hash_entry *h; asection *sec = NULL; @@ -3234,8 +3043,7 @@ elf32_hppa_set_gp (abfd, info) linker. */ bfd_boolean -elf32_hppa_build_stubs (info) - struct bfd_link_info *info; +elf32_hppa_build_stubs (struct bfd_link_info *info) { asection *stub_sec; struct bfd_hash_table *table; @@ -3251,7 +3059,7 @@ elf32_hppa_build_stubs (info) /* Allocate memory to hold the linker stubs. */ size = stub_sec->_raw_size; - stub_sec->contents = (unsigned char *) bfd_zalloc (htab->stub_bfd, size); + stub_sec->contents = bfd_zalloc (htab->stub_bfd, size); if (stub_sec->contents == NULL && size != 0) return FALSE; stub_sec->_raw_size = 0; @@ -3267,9 +3075,7 @@ elf32_hppa_build_stubs (info) /* Perform a final link. */ static bfd_boolean -elf32_hppa_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +elf32_hppa_final_link (bfd *abfd, struct bfd_link_info *info) { /* Invoke the regular ELF linker to do all the work. */ if (!bfd_elf32_bfd_final_link (abfd, info)) @@ -3283,10 +3089,9 @@ elf32_hppa_final_link (abfd, info) /* Record the lowest address for the data and text segments. */ static void -hppa_record_segment_addr (abfd, section, data) - bfd *abfd ATTRIBUTE_UNUSED; - asection *section; - PTR data; +hppa_record_segment_addr (bfd *abfd ATTRIBUTE_UNUSED, + asection *section, + void *data) { struct elf32_hppa_link_hash_table *htab; @@ -3312,14 +3117,13 @@ hppa_record_segment_addr (abfd, section, data) /* Perform a relocation as part of a final link. */ static bfd_reloc_status_type -final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h) - asection *input_section; - bfd_byte *contents; - const Elf_Internal_Rela *rel; - bfd_vma value; - struct elf32_hppa_link_hash_table *htab; - asection *sym_sec; - struct elf32_hppa_link_hash_entry *h; +final_link_relocate (asection *input_section, + bfd_byte *contents, + const Elf_Internal_Rela *rel, + bfd_vma value, + struct elf32_hppa_link_hash_table *htab, + asection *sym_sec, + struct elf32_hppa_link_hash_entry *h) { int insn; unsigned int r_type = ELF32_R_TYPE (rel->r_info); @@ -3576,16 +3380,14 @@ final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h) /* Relocate an HPPA ELF section. */ static bfd_boolean -elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +elf32_hppa_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { bfd_vma *local_got_offsets; struct elf32_hppa_link_hash_table *htab; @@ -4049,8 +3851,8 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, else { if (!((*info->callbacks->reloc_overflow) - (info, sym_name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) + (info, sym_name, howto->name, 0, input_bfd, input_section, + rel->r_offset))) return FALSE; } } @@ -4062,11 +3864,10 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section, dynamic sections here. */ static bfd_boolean -elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf32_hppa_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { struct elf32_hppa_link_hash_table *htab; @@ -4171,8 +3972,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) { if ((h->got.offset & 1) != 0) abort (); - bfd_put_32 (output_bfd, (bfd_vma) 0, - htab->sgot->contents + h->got.offset); + bfd_put_32 (output_bfd, 0, htab->sgot->contents + h->got.offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_DIR32); rel.r_addend = 0; } @@ -4221,8 +4021,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym) dynamic linker, before writing them out. */ static enum elf_reloc_type_class -elf32_hppa_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela) { if (ELF32_R_SYM (rela->r_info) == 0) return reloc_class_relative; @@ -4241,9 +4040,8 @@ elf32_hppa_reloc_type_class (rela) /* Finish up the dynamic sections. */ static bfd_boolean -elf32_hppa_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +elf32_hppa_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { bfd *dynobj; struct elf32_hppa_link_hash_table *htab; @@ -4321,9 +4119,7 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info) /* Fill in the first entry in the global offset table. We use it to point to our dynamic section, if we have one. */ bfd_put_32 (output_bfd, - (sdyn != NULL - ? sdyn->output_section->vma + sdyn->output_offset - : (bfd_vma) 0), + sdyn ? sdyn->output_section->vma + sdyn->output_offset : 0, htab->sgot->contents); /* The second entry is reserved for use by the dynamic linker. */ @@ -4366,9 +4162,8 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info) /* Tweak the OSABI field of the elf header. */ static void -elf32_hppa_post_process_headers (abfd, link_info) - bfd *abfd; - struct bfd_link_info *link_info ATTRIBUTE_UNUSED; +elf32_hppa_post_process_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { Elf_Internal_Ehdr * i_ehdrp; @@ -4387,9 +4182,7 @@ elf32_hppa_post_process_headers (abfd, link_info) /* Called when writing out an object file to decide the type of a symbol. */ static int -elf32_hppa_elf_get_symbol_type (elf_sym, type) - Elf_Internal_Sym *elf_sym; - int type; +elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) { if (ELF_ST_TYPE (elf_sym->st_info) == STT_PARISC_MILLI) return STT_PARISC_MILLI; @@ -4407,7 +4200,6 @@ elf32_hppa_elf_get_symbol_type (elf_sym, type) #define bfd_elf32_bfd_final_link elf32_hppa_final_link #define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create #define bfd_elf32_bfd_link_hash_table_free elf32_hppa_link_hash_table_free -#define elf_backend_add_symbol_hook elf32_hppa_add_symbol_hook #define elf_backend_adjust_dynamic_symbol elf32_hppa_adjust_dynamic_symbol #define elf_backend_copy_indirect_symbol elf32_hppa_copy_indirect_symbol #define elf_backend_check_relocs elf32_hppa_check_relocs diff --git a/bfd/elf32-hppa.h b/bfd/elf32-hppa.h index 7c8c687..000602e 100644 --- a/bfd/elf32-hppa.h +++ b/bfd/elf32-hppa.h @@ -5,7 +5,7 @@ February 1994. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. Written by: @@ -37,27 +37,26 @@ #include "elf/hppa.h" int elf32_hppa_setup_section_lists - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); void elf32_hppa_next_input_section - PARAMS ((struct bfd_link_info *, asection *)); + (struct bfd_link_info *, asection *); bfd_boolean elf32_hppa_size_stubs - PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_boolean, bfd_signed_vma, - asection * (*) PARAMS ((const char *, asection *)), - void (*) PARAMS ((void)))); + (bfd *, bfd *, struct bfd_link_info *, bfd_boolean, bfd_signed_vma, + asection * (*) (const char *, asection *), void (*) (void)); bfd_boolean elf32_hppa_set_gp - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); bfd_boolean elf32_hppa_build_stubs - PARAMS ((struct bfd_link_info *)); + (struct bfd_link_info *); elf_hppa_reloc_type elf32_hppa_reloc_final_type - PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int)); + (bfd *, elf_hppa_reloc_type, int, unsigned int); extern elf_hppa_reloc_type ** _bfd_elf32_hppa_gen_reloc_type - PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *)); + (bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *); /* Define groups of basic relocations. FIXME: These should be the only basic relocations created by GAS. The rest diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 601d208..7eaac98 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -818,7 +818,7 @@ elf_write_relocs (bfd *abfd, asection *sec, void *data) bfd_boolean *failedp = data; Elf_Internal_Shdr *rela_hdr; bfd_vma addr_offset; - void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *); size_t extsize; bfd_byte *dst_rela; unsigned int idx; diff --git a/bfd/libhppa.h b/bfd/libhppa.h index 52ebf51..f6aa234 100644 --- a/bfd/libhppa.h +++ b/bfd/libhppa.h @@ -1,6 +1,6 @@ /* HP PA-RISC SOM object file format: definitions internal to BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, + 2003 Free Software Foundation, Inc. Contributed by the Center for Software Science at the University of Utah (pa-gdb-bugs@cs.utah.edu). @@ -27,14 +27,6 @@ #define BYTES_IN_WORD 4 #define PA_PAGESIZE 0x1000 -#ifndef INLINE -#ifdef __GNUC__ -#define INLINE inline -#else -#define INLINE -#endif /* GNU C? */ -#endif /* INLINE */ - /* The PA instruction set variants. */ enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25}; @@ -164,40 +156,38 @@ enum hppa_reloc_expr_type_alt /* Some functions to manipulate PA instructions. */ /* Declare the functions with the unused attribute to avoid warnings. */ -static INLINE int sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED; -static INLINE int low_sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED; -static INLINE int sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED; -static INLINE int low_sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED; -static INLINE int re_assemble_3 PARAMS ((int)) ATTRIBUTE_UNUSED; -static INLINE int re_assemble_12 PARAMS ((int)) ATTRIBUTE_UNUSED; -static INLINE int re_assemble_14 PARAMS ((int)) ATTRIBUTE_UNUSED; -static INLINE int re_assemble_16 PARAMS ((int)) ATTRIBUTE_UNUSED; -static INLINE int re_assemble_17 PARAMS ((int)) ATTRIBUTE_UNUSED; -static INLINE int re_assemble_21 PARAMS ((int)) ATTRIBUTE_UNUSED; -static INLINE int re_assemble_22 PARAMS ((int)) ATTRIBUTE_UNUSED; -static INLINE bfd_signed_vma hppa_field_adjust - PARAMS ((bfd_vma, bfd_signed_vma, - enum hppa_reloc_field_selector_type_alt)) ATTRIBUTE_UNUSED; -static INLINE int bfd_hppa_insn2fmt PARAMS ((bfd *, int)) ATTRIBUTE_UNUSED; -static INLINE int hppa_rebuild_insn PARAMS ((int, int, int)) ATTRIBUTE_UNUSED; +static inline int sign_extend (int, int) ATTRIBUTE_UNUSED; +static inline int low_sign_extend (int, int) ATTRIBUTE_UNUSED; +static inline int sign_unext (int, int) ATTRIBUTE_UNUSED; +static inline int low_sign_unext (int, int) ATTRIBUTE_UNUSED; +static inline int re_assemble_3 (int) ATTRIBUTE_UNUSED; +static inline int re_assemble_12 (int) ATTRIBUTE_UNUSED; +static inline int re_assemble_14 (int) ATTRIBUTE_UNUSED; +static inline int re_assemble_16 (int) ATTRIBUTE_UNUSED; +static inline int re_assemble_17 (int) ATTRIBUTE_UNUSED; +static inline int re_assemble_21 (int) ATTRIBUTE_UNUSED; +static inline int re_assemble_22 (int) ATTRIBUTE_UNUSED; +static inline bfd_signed_vma hppa_field_adjust + (bfd_vma, bfd_signed_vma, enum hppa_reloc_field_selector_type_alt) + ATTRIBUTE_UNUSED; +static inline int bfd_hppa_insn2fmt (bfd *, int) ATTRIBUTE_UNUSED; +static inline int hppa_rebuild_insn (int, int, int) ATTRIBUTE_UNUSED; /* The *sign_extend functions are used to assemble various bitfields taken from an instruction and return the resulting immediate value. */ -static INLINE int -sign_extend (x, len) - int x, len; +static inline int +sign_extend (int x, int len) { int signbit = (1 << (len - 1)); int mask = (signbit << 1) - 1; return ((x & mask) ^ signbit) - signbit; } -static INLINE int -low_sign_extend (x, len) - int x, len; +static inline int +low_sign_extend (int x, int len) { return (x >> 1) - ((x & 1) << (len - 1)); } @@ -207,9 +197,8 @@ low_sign_extend (x, len) insertion into an opcode. pa-risc uses all sorts of weird bitfields in the instruction to hold the value. */ -static INLINE int -sign_unext (x, len) - int x, len; +static inline int +sign_unext (int x, int len) { int len_ones; @@ -218,9 +207,8 @@ sign_unext (x, len) return x & len_ones; } -static INLINE int -low_sign_unext (x, len) - int x, len; +static inline int +low_sign_unext (int x, int len) { int temp; int sign; @@ -232,34 +220,30 @@ low_sign_unext (x, len) return (temp << 1) | sign; } -static INLINE int -re_assemble_3 (as3) - int as3; +static inline int +re_assemble_3 (int as3) { return (( (as3 & 4) << (13-2)) | ((as3 & 3) << (13+1))); } -static INLINE int -re_assemble_12 (as12) - int as12; +static inline int +re_assemble_12 (int as12) { return (( (as12 & 0x800) >> 11) | ((as12 & 0x400) >> (10 - 2)) | ((as12 & 0x3ff) << (1 + 2))); } -static INLINE int -re_assemble_14 (as14) - int as14; +static inline int +re_assemble_14 (int as14) { return (( (as14 & 0x1fff) << 1) | ((as14 & 0x2000) >> 13)); } -static INLINE int -re_assemble_16 (as16) - int as16; +static inline int +re_assemble_16 (int as16) { int s, t; @@ -269,9 +253,8 @@ re_assemble_16 (as16) return (t ^ s ^ (s >> 1)) | (s >> 15); } -static INLINE int -re_assemble_17 (as17) - int as17; +static inline int +re_assemble_17 (int as17) { return (( (as17 & 0x10000) >> 16) | ((as17 & 0x0f800) << (16 - 11)) @@ -279,9 +262,8 @@ re_assemble_17 (as17) | ((as17 & 0x003ff) << (1 + 2))); } -static INLINE int -re_assemble_21 (as21) - int as21; +static inline int +re_assemble_21 (int as21) { return (( (as21 & 0x100000) >> 20) | ((as21 & 0x0ffe00) >> 8) @@ -290,9 +272,8 @@ re_assemble_21 (as21) | ((as21 & 0x000003) << 12)); } -static INLINE int -re_assemble_22 (as22) - int as22; +static inline int +re_assemble_22 (int as22) { return (( (as22 & 0x200000) >> 21) | ((as22 & 0x1f0000) << (21 - 16)) @@ -312,11 +293,10 @@ re_assemble_22 (as22) This function returns sign extended values in all cases. */ -static INLINE bfd_signed_vma -hppa_field_adjust (sym_val, addend, r_field) - bfd_vma sym_val; - bfd_signed_vma addend; - enum hppa_reloc_field_selector_type_alt r_field; +static inline bfd_signed_vma +hppa_field_adjust (bfd_vma sym_val, + bfd_signed_vma addend, + enum hppa_reloc_field_selector_type_alt r_field) { bfd_signed_vma value; @@ -479,10 +459,8 @@ enum hppa_opcode_type /* Given a machine instruction, return its format. */ -static INLINE int -bfd_hppa_insn2fmt (abfd, insn) - bfd *abfd; - int insn; +static inline int +bfd_hppa_insn2fmt (bfd *abfd, int insn) { enum hppa_opcode_type op = get_opcode (insn); @@ -563,11 +541,8 @@ bfd_hppa_insn2fmt (abfd, insn) /* Insert VALUE into INSN using R_FORMAT to determine exactly what bits to change. */ -static INLINE int -hppa_rebuild_insn (insn, value, r_format) - int insn; - int value; - int r_format; +static inline int +hppa_rebuild_insn (int insn, int value, int r_format) { switch (r_format) { |