#include "elf-bfd.h"
#include "libiberty.h"
-static INLINE struct elf_segment_map *make_mapping
- PARAMS ((bfd *, asection **, unsigned int, unsigned int, bfd_boolean));
-static bfd_boolean map_sections_to_segments
- PARAMS ((bfd *));
-static int elf_sort_sections
- PARAMS ((const PTR, const PTR));
-static bfd_boolean assign_file_positions_for_segments
- PARAMS ((bfd *));
-static bfd_boolean assign_file_positions_except_relocs
- PARAMS ((bfd *));
-static bfd_boolean prep_headers
- PARAMS ((bfd *));
-static bfd_boolean swap_out_syms
- PARAMS ((bfd *, struct bfd_strtab_hash **, int));
-static bfd_boolean copy_private_bfd_data
- PARAMS ((bfd *, bfd *));
-static char *elf_read
- PARAMS ((bfd *, file_ptr, bfd_size_type));
-static const char *group_signature
- PARAMS ((bfd *, Elf_Internal_Shdr *));
-static bfd_boolean setup_group
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
-static void merge_sections_remove_hook
- PARAMS ((bfd *, asection *));
-static void elf_fake_sections
- PARAMS ((bfd *, asection *, PTR));
-static bfd_boolean assign_section_numbers
- PARAMS ((bfd *));
-static INLINE int sym_is_global
- PARAMS ((bfd *, asymbol *));
-static bfd_boolean elf_map_symbols
- PARAMS ((bfd *));
-static bfd_size_type get_program_header_size
- PARAMS ((bfd *));
-static bfd_boolean elfcore_read_notes
- PARAMS ((bfd *, file_ptr, bfd_size_type));
-static bfd_boolean elf_find_function
- PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **));
-static int elfcore_make_pid
- PARAMS ((bfd *));
-static bfd_boolean elfcore_maybe_make_sect
- PARAMS ((bfd *, char *, asection *));
-static bfd_boolean elfcore_make_note_pseudosection
- PARAMS ((bfd *, char *, Elf_Internal_Note *));
-static bfd_boolean elfcore_grok_prfpreg
- PARAMS ((bfd *, Elf_Internal_Note *));
-static bfd_boolean elfcore_grok_prxfpreg
- PARAMS ((bfd *, Elf_Internal_Note *));
-static bfd_boolean elfcore_grok_note
- PARAMS ((bfd *, Elf_Internal_Note *));
-static bfd_boolean elfcore_netbsd_get_lwpid
- PARAMS ((Elf_Internal_Note *, int *));
-static bfd_boolean elfcore_grok_netbsd_procinfo
- PARAMS ((bfd *, Elf_Internal_Note *));
-static bfd_boolean elfcore_grok_netbsd_note
- PARAMS ((bfd *, Elf_Internal_Note *));
-static bfd_boolean elfcore_grok_nto_gregs
- PARAMS ((bfd *, Elf_Internal_Note *, pid_t));
-static bfd_boolean elfcore_grok_nto_status
- PARAMS ((bfd *, Elf_Internal_Note *, pid_t *));
-static bfd_boolean elfcore_grok_nto_note
- PARAMS ((bfd *, Elf_Internal_Note *));
+static int elf_sort_sections (const void *, const void *);
+static bfd_boolean assign_file_positions_except_relocs (bfd *);
+static bfd_boolean prep_headers (bfd *);
+static bfd_boolean swap_out_syms (bfd *, struct bfd_strtab_hash **, int) ;
+static bfd_boolean elfcore_read_notes (bfd *, file_ptr, bfd_size_type) ;
/* Swap version information in and out. The version information is
currently size independent. If that ever changes, this code will
/* Swap in a Verdef structure. */
void
-_bfd_elf_swap_verdef_in (abfd, src, dst)
- bfd *abfd;
- const Elf_External_Verdef *src;
- Elf_Internal_Verdef *dst;
+_bfd_elf_swap_verdef_in (bfd *abfd,
+ const Elf_External_Verdef *src,
+ Elf_Internal_Verdef *dst)
{
dst->vd_version = H_GET_16 (abfd, src->vd_version);
dst->vd_flags = H_GET_16 (abfd, src->vd_flags);
/* Swap out a Verdef structure. */
void
-_bfd_elf_swap_verdef_out (abfd, src, dst)
- bfd *abfd;
- const Elf_Internal_Verdef *src;
- Elf_External_Verdef *dst;
+_bfd_elf_swap_verdef_out (bfd *abfd,
+ const Elf_Internal_Verdef *src,
+ Elf_External_Verdef *dst)
{
H_PUT_16 (abfd, src->vd_version, dst->vd_version);
H_PUT_16 (abfd, src->vd_flags, dst->vd_flags);
/* Swap in a Verdaux structure. */
void
-_bfd_elf_swap_verdaux_in (abfd, src, dst)
- bfd *abfd;
- const Elf_External_Verdaux *src;
- Elf_Internal_Verdaux *dst;
+_bfd_elf_swap_verdaux_in (bfd *abfd,
+ const Elf_External_Verdaux *src,
+ Elf_Internal_Verdaux *dst)
{
dst->vda_name = H_GET_32 (abfd, src->vda_name);
dst->vda_next = H_GET_32 (abfd, src->vda_next);
/* Swap out a Verdaux structure. */
void
-_bfd_elf_swap_verdaux_out (abfd, src, dst)
- bfd *abfd;
- const Elf_Internal_Verdaux *src;
- Elf_External_Verdaux *dst;
+_bfd_elf_swap_verdaux_out (bfd *abfd,
+ const Elf_Internal_Verdaux *src,
+ Elf_External_Verdaux *dst)
{
H_PUT_32 (abfd, src->vda_name, dst->vda_name);
H_PUT_32 (abfd, src->vda_next, dst->vda_next);
/* Swap in a Verneed structure. */
void
-_bfd_elf_swap_verneed_in (abfd, src, dst)
- bfd *abfd;
- const Elf_External_Verneed *src;
- Elf_Internal_Verneed *dst;
+_bfd_elf_swap_verneed_in (bfd *abfd,
+ const Elf_External_Verneed *src,
+ Elf_Internal_Verneed *dst)
{
dst->vn_version = H_GET_16 (abfd, src->vn_version);
dst->vn_cnt = H_GET_16 (abfd, src->vn_cnt);
/* Swap out a Verneed structure. */
void
-_bfd_elf_swap_verneed_out (abfd, src, dst)
- bfd *abfd;
- const Elf_Internal_Verneed *src;
- Elf_External_Verneed *dst;
+_bfd_elf_swap_verneed_out (bfd *abfd,
+ const Elf_Internal_Verneed *src,
+ Elf_External_Verneed *dst)
{
H_PUT_16 (abfd, src->vn_version, dst->vn_version);
H_PUT_16 (abfd, src->vn_cnt, dst->vn_cnt);
/* Swap in a Vernaux structure. */
void
-_bfd_elf_swap_vernaux_in (abfd, src, dst)
- bfd *abfd;
- const Elf_External_Vernaux *src;
- Elf_Internal_Vernaux *dst;
+_bfd_elf_swap_vernaux_in (bfd *abfd,
+ const Elf_External_Vernaux *src,
+ Elf_Internal_Vernaux *dst)
{
dst->vna_hash = H_GET_32 (abfd, src->vna_hash);
dst->vna_flags = H_GET_16 (abfd, src->vna_flags);
/* Swap out a Vernaux structure. */
void
-_bfd_elf_swap_vernaux_out (abfd, src, dst)
- bfd *abfd;
- const Elf_Internal_Vernaux *src;
- Elf_External_Vernaux *dst;
+_bfd_elf_swap_vernaux_out (bfd *abfd,
+ const Elf_Internal_Vernaux *src,
+ Elf_External_Vernaux *dst)
{
H_PUT_32 (abfd, src->vna_hash, dst->vna_hash);
H_PUT_16 (abfd, src->vna_flags, dst->vna_flags);
/* Swap in a Versym structure. */
void
-_bfd_elf_swap_versym_in (abfd, src, dst)
- bfd *abfd;
- const Elf_External_Versym *src;
- Elf_Internal_Versym *dst;
+_bfd_elf_swap_versym_in (bfd *abfd,
+ const Elf_External_Versym *src,
+ Elf_Internal_Versym *dst)
{
dst->vs_vers = H_GET_16 (abfd, src->vs_vers);
}
/* Swap out a Versym structure. */
void
-_bfd_elf_swap_versym_out (abfd, src, dst)
- bfd *abfd;
- const Elf_Internal_Versym *src;
- Elf_External_Versym *dst;
+_bfd_elf_swap_versym_out (bfd *abfd,
+ const Elf_Internal_Versym *src,
+ Elf_External_Versym *dst)
{
H_PUT_16 (abfd, src->vs_vers, dst->vs_vers);
}
cause invalid hash tables to be generated. */
unsigned long
-bfd_elf_hash (namearg)
- const char *namearg;
+bfd_elf_hash (const char *namearg)
{
const unsigned char *name = (const unsigned char *) namearg;
unsigned long h = 0;
buffer. */
static char *
-elf_read (abfd, offset, size)
- bfd *abfd;
- file_ptr offset;
- bfd_size_type size;
+elf_read (bfd *abfd, file_ptr offset, bfd_size_type size)
{
char *buf;
return NULL;
if (bfd_seek (abfd, offset, SEEK_SET) != 0)
return NULL;
- if (bfd_bread ((PTR) buf, size, abfd) != size)
+ if (bfd_bread (buf, size, abfd) != size)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_file_truncated);
}
bfd_boolean
-bfd_elf_mkobject (abfd)
- bfd *abfd;
+bfd_elf_mkobject (bfd *abfd)
{
/* This just does initialization. */
/* coff_mkobject zalloc's space for tdata.coff_obj_data ... */
- bfd_size_type amt = sizeof (struct elf_obj_tdata);
- elf_tdata (abfd) = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt);
+ elf_tdata (abfd) = bfd_zalloc (abfd, sizeof (struct elf_obj_tdata));
if (elf_tdata (abfd) == 0)
return FALSE;
/* Since everything is done at close time, do we need any
}
bfd_boolean
-bfd_elf_mkcorefile (abfd)
- bfd *abfd;
+bfd_elf_mkcorefile (bfd *abfd)
{
/* I think this can be done just like an object file. */
return bfd_elf_mkobject (abfd);
}
char *
-bfd_elf_get_str_section (abfd, shindex)
- bfd *abfd;
- unsigned int shindex;
+bfd_elf_get_str_section (bfd *abfd, unsigned int shindex)
{
Elf_Internal_Shdr **i_shdrp;
char *shstrtab = NULL;
offset = i_shdrp[shindex]->sh_offset;
shstrtabsize = i_shdrp[shindex]->sh_size;
shstrtab = elf_read (abfd, offset, shstrtabsize);
- i_shdrp[shindex]->contents = (PTR) shstrtab;
+ i_shdrp[shindex]->contents = shstrtab;
}
return shstrtab;
}
char *
-bfd_elf_string_from_elf_section (abfd, shindex, strindex)
- bfd *abfd;
- unsigned int shindex;
- unsigned int strindex;
+bfd_elf_string_from_elf_section (bfd *abfd,
+ unsigned int shindex,
+ unsigned int strindex)
{
Elf_Internal_Shdr *hdr;
symbols, and symbol section index extensions, respectively. */
Elf_Internal_Sym *
-bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset,
- intsym_buf, extsym_buf, extshndx_buf)
- bfd *ibfd;
- Elf_Internal_Shdr *symtab_hdr;
- size_t symcount;
- size_t symoffset;
- Elf_Internal_Sym *intsym_buf;
- PTR extsym_buf;
- Elf_External_Sym_Shndx *extshndx_buf;
+bfd_elf_get_elf_syms (bfd *ibfd,
+ Elf_Internal_Shdr *symtab_hdr,
+ size_t symcount,
+ size_t symoffset,
+ Elf_Internal_Sym *intsym_buf,
+ void *extsym_buf,
+ Elf_External_Sym_Shndx *extshndx_buf)
{
Elf_Internal_Shdr *shndx_hdr;
- PTR alloc_ext;
+ void *alloc_ext;
const bfd_byte *esym;
Elf_External_Sym_Shndx *alloc_extshndx;
Elf_External_Sym_Shndx *shndx;
pos = shndx_hdr->sh_offset + symoffset * sizeof (Elf_External_Sym_Shndx);
if (extshndx_buf == NULL)
{
- alloc_extshndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
+ alloc_extshndx = bfd_malloc (amt);
extshndx_buf = alloc_extshndx;
}
if (extshndx_buf == NULL
if (intsym_buf == NULL)
{
bfd_size_type amt = symcount * sizeof (Elf_Internal_Sym);
- intsym_buf = (Elf_Internal_Sym *) bfd_malloc (amt);
+ intsym_buf = bfd_malloc (amt);
if (intsym_buf == NULL)
goto out;
}
for (esym = extsym_buf, isym = intsym_buf, shndx = extshndx_buf;
isym < isymend;
esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL)
- (*bed->s->swap_symbol_in) (ibfd, esym, (const PTR) shndx, isym);
+ (*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym);
out:
if (alloc_ext != NULL)
/* Look up a symbol name. */
const char *
-bfd_elf_local_sym_name (abfd, isym)
- bfd *abfd;
- Elf_Internal_Sym *isym;
+bfd_elf_local_sym_name (bfd *abfd, Elf_Internal_Sym *isym)
{
unsigned int iname = isym->st_name;
unsigned int shindex = elf_tdata (abfd)->symtab_hdr.sh_link;
signature just a string? */
static const char *
-group_signature (abfd, ghdr)
- bfd *abfd;
- Elf_Internal_Shdr *ghdr;
+group_signature (bfd *abfd, Elf_Internal_Shdr *ghdr)
{
Elf_Internal_Shdr *hdr;
unsigned char esym[sizeof (Elf64_External_Sym)];
/* Set next_in_group list pointer, and group name for NEWSECT. */
static bfd_boolean
-setup_group (abfd, hdr, newsect)
- bfd *abfd;
- Elf_Internal_Shdr *hdr;
- asection *newsect;
+setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
{
unsigned int num_group = elf_tdata (abfd)->num_group;
}
bfd_boolean
-bfd_elf_discard_group (abfd, group)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *group;
+bfd_elf_discard_group (bfd *abfd ATTRIBUTE_UNUSED, asection *group)
{
asection *first = elf_next_in_group (group);
asection *s = first;
BFD section in the bfd_section field of the header. */
bfd_boolean
-_bfd_elf_make_section_from_shdr (abfd, hdr, name)
- bfd *abfd;
- Elf_Internal_Shdr *hdr;
- const char *name;
+_bfd_elf_make_section_from_shdr (bfd *abfd,
+ Elf_Internal_Shdr *hdr,
+ const char *name)
{
asection *newsect;
flagword flags;
*/
struct elf_internal_shdr *
-bfd_elf_find_section (abfd, name)
- bfd *abfd;
- char *name;
+bfd_elf_find_section (bfd *abfd, char *name)
{
Elf_Internal_Shdr **i_shdrp;
char *shstrtab;
relocatable output against an external symbol. */
bfd_reloc_status_type
-bfd_elf_generic_reloc (abfd,
- reloc_entry,
- symbol,
- data,
- input_section,
- output_bfd,
- error_message)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *reloc_entry;
- asymbol *symbol;
- PTR data ATTRIBUTE_UNUSED;
- asection *input_section;
- bfd *output_bfd;
- char **error_message ATTRIBUTE_UNUSED;
-{
- if (output_bfd != (bfd *) NULL
+bfd_elf_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ if (output_bfd != NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
&& (! reloc_entry->howto->partial_inplace
|| reloc_entry->addend == 0))
/* Make sure sec_info_type is cleared if sec_info is cleared too. */
static void
-merge_sections_remove_hook (abfd, sec)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
+merge_sections_remove_hook (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *sec)
{
BFD_ASSERT (sec->sec_info_type == ELF_INFO_TYPE_MERGE);
sec->sec_info_type = ELF_INFO_TYPE_NONE;
/* Finish SHF_MERGE section merging. */
bfd_boolean
-_bfd_elf_merge_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+_bfd_elf_merge_sections (bfd *abfd, struct bfd_link_info *info)
{
if (!is_elf_hash_table (info))
return FALSE;
}
void
-_bfd_elf_link_just_syms (sec, info)
- asection *sec;
- struct bfd_link_info *info;
+_bfd_elf_link_just_syms (asection *sec, struct bfd_link_info *info)
{
sec->output_section = bfd_abs_section_ptr;
sec->output_offset = sec->vma;
another. */
bfd_boolean
-_bfd_elf_copy_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+_bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
/* Print out the program headers. */
bfd_boolean
-_bfd_elf_print_private_bfd_data (abfd, farg)
- bfd *abfd;
- PTR farg;
+_bfd_elf_print_private_bfd_data (bfd *abfd, void *farg)
{
- FILE *f = (FILE *) farg;
+ FILE *f = farg;
Elf_Internal_Phdr *p;
asection *s;
bfd_byte *dynbuf = NULL;
unsigned long shlink;
bfd_byte *extdyn, *extdynend;
size_t extdynsize;
- void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
+ void (*swap_dyn_in) (bfd *, const void *, Elf_Internal_Dyn *);
fprintf (f, _("\nDynamic Section:\n"));
- dynbuf = (bfd_byte *) bfd_malloc (s->_raw_size);
+ dynbuf = bfd_malloc (s->_raw_size);
if (dynbuf == NULL)
goto error_return;
- if (! bfd_get_section_contents (abfd, s, (PTR) dynbuf, (file_ptr) 0,
- s->_raw_size))
+ if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size))
goto error_return;
elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
char ab[20];
bfd_boolean stringp;
- (*swap_dyn_in) (abfd, (PTR) extdyn, &dyn);
+ (*swap_dyn_in) (abfd, extdyn, &dyn);
if (dyn.d_tag == DT_NULL)
break;
/* Display ELF-specific fields of a symbol. */
void
-bfd_elf_print_symbol (abfd, filep, symbol, how)
- bfd *abfd;
- PTR filep;
- asymbol *symbol;
- bfd_print_symbol_type how;
+bfd_elf_print_symbol (bfd *abfd,
+ void *filep,
+ asymbol *symbol,
+ bfd_print_symbol_type how)
{
- FILE *file = (FILE *) filep;
+ FILE *file = filep;
switch (how)
{
case bfd_print_symbol_name:
if (name == NULL)
{
name = symbol->name;
- bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
+ bfd_print_symbol_vandf (abfd, file, symbol);
}
fprintf (file, " %s\t", section_name);
/* Create an entry in an ELF linker hash table. */
struct bfd_hash_entry *
-_bfd_elf_link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+_bfd_elf_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. */
old indirect symbol. Also used for copying flags to a weakdef. */
void
-_bfd_elf_link_hash_copy_indirect (bed, dir, ind)
- struct elf_backend_data *bed;
- struct elf_link_hash_entry *dir, *ind;
+_bfd_elf_link_hash_copy_indirect (struct elf_backend_data *bed,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
bfd_signed_vma tmp;
bfd_signed_vma lowest_valid = bed->can_refcount;
}
void
-_bfd_elf_link_hash_hide_symbol (info, h, force_local)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- bfd_boolean force_local;
+_bfd_elf_link_hash_hide_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ bfd_boolean force_local)
{
h->plt = elf_hash_table (info)->init_offset;
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
/* Initialize an ELF linker hash table. */
bfd_boolean
-_bfd_elf_link_hash_table_init (table, abfd, newfunc)
- struct elf_link_hash_table *table;
- bfd *abfd;
- struct bfd_hash_entry *(*newfunc)
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
- const char *));
+_bfd_elf_link_hash_table_init
+ (struct elf_link_hash_table *table,
+ bfd *abfd,
+ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *))
{
bfd_boolean ret;
/* Create an ELF linker hash table. */
struct bfd_link_hash_table *
-_bfd_elf_link_hash_table_create (abfd)
- bfd *abfd;
+_bfd_elf_link_hash_table_create (bfd *abfd)
{
struct elf_link_hash_table *ret;
bfd_size_type amt = sizeof (struct elf_link_hash_table);
- ret = (struct elf_link_hash_table *) bfd_malloc (amt);
- if (ret == (struct elf_link_hash_table *) NULL)
+ ret = bfd_malloc (amt);
+ if (ret == NULL)
return NULL;
if (! _bfd_elf_link_hash_table_init (ret, abfd, _bfd_elf_link_hash_newfunc))
empty string to indicate that no DT_NEEDED entry should be made. */
void
-bfd_elf_set_dt_needed_name (abfd, name)
- bfd *abfd;
- const char *name;
+bfd_elf_set_dt_needed_name (bfd *abfd, const char *name)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& bfd_get_format (abfd) == bfd_object)
}
void
-bfd_elf_set_dt_needed_soname (abfd, name)
- bfd *abfd;
- const char *name;
+bfd_elf_set_dt_needed_soname (bfd *abfd, const char *name)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& bfd_get_format (abfd) == bfd_object)
the linker ELF emulation code. */
struct bfd_link_needed_list *
-bfd_elf_get_needed_list (abfd, info)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+bfd_elf_get_needed_list (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
if (! is_elf_hash_table (info))
return NULL;
hook for the linker ELF emulation code. */
struct bfd_link_needed_list *
-bfd_elf_get_runpath_list (abfd, info)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+bfd_elf_get_runpath_list (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
if (! is_elf_hash_table (info))
return NULL;
passed to bfd_elf_set_dt_needed_name, or it is the filename. */
const char *
-bfd_elf_get_dt_soname (abfd)
- bfd *abfd;
+bfd_elf_get_dt_soname (bfd *abfd)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
&& bfd_get_format (abfd) == bfd_object)
the ELF linker emulation code. */
bfd_boolean
-bfd_elf_get_bfd_needed_list (abfd, pneeded)
- bfd *abfd;
- struct bfd_link_needed_list **pneeded;
+bfd_elf_get_bfd_needed_list (bfd *abfd,
+ struct bfd_link_needed_list **pneeded)
{
asection *s;
bfd_byte *dynbuf = NULL;
unsigned long shlink;
bfd_byte *extdyn, *extdynend;
size_t extdynsize;
- void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
+ void (*swap_dyn_in) (bfd *, const void *, Elf_Internal_Dyn *);
*pneeded = NULL;
if (s == NULL || s->_raw_size == 0)
return TRUE;
- dynbuf = (bfd_byte *) bfd_malloc (s->_raw_size);
+ dynbuf = bfd_malloc (s->_raw_size);
if (dynbuf == NULL)
goto error_return;
- if (! bfd_get_section_contents (abfd, s, (PTR) dynbuf, (file_ptr) 0,
- s->_raw_size))
+ if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size))
goto error_return;
elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
{
Elf_Internal_Dyn dyn;
- (*swap_dyn_in) (abfd, (PTR) extdyn, &dyn);
+ (*swap_dyn_in) (abfd, extdyn, &dyn);
if (dyn.d_tag == DT_NULL)
break;
goto error_return;
amt = sizeof *l;
- l = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt);
+ l = bfd_alloc (abfd, amt);
if (l == NULL)
goto error_return;
/* Allocate an ELF string table--force the first byte to be zero. */
struct bfd_strtab_hash *
-_bfd_elf_stringtab_init ()
+_bfd_elf_stringtab_init (void)
{
struct bfd_strtab_hash *ret;
/* Create a new bfd section from an ELF section header. */
bfd_boolean
-bfd_section_from_shdr (abfd, shindex)
- bfd *abfd;
- unsigned int shindex;
+bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
{
Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[shindex];
Elf_Internal_Ehdr *ehdr = elf_elfheader (abfd);
bfd_size_type amt;
BFD_ASSERT (elf_section_data (target_sect)->rel_hdr2 == NULL);
amt = sizeof (*hdr2);
- hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt);
+ hdr2 = bfd_alloc (abfd, amt);
elf_section_data (target_sect)->rel_hdr2 = hdr2;
}
*hdr2 = *hdr;
Return SEC for sections that have no elf section, and NULL on error. */
asection *
-bfd_section_from_r_symndx (abfd, cache, sec, r_symndx)
- bfd *abfd;
- struct sym_sec_cache *cache;
- asection *sec;
- unsigned long r_symndx;
+bfd_section_from_r_symndx (bfd *abfd,
+ struct sym_sec_cache *cache,
+ asection *sec,
+ unsigned long r_symndx)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned char esym[sizeof (Elf64_External_Sym)];
section. */
asection *
-bfd_section_from_elf_index (abfd, index)
- bfd *abfd;
- unsigned int index;
+bfd_section_from_elf_index (bfd *abfd, unsigned int index)
{
if (index >= elf_numsections (abfd))
return NULL;
}
bfd_boolean
-_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name,
- int *type, int *attr)
+_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name, int *type, int *attr)
{
bfd_boolean found = FALSE;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
}
bfd_boolean
-_bfd_elf_new_section_hook (abfd, sec)
- bfd *abfd;
- asection *sec;
+_bfd_elf_new_section_hook (bfd *abfd, asection *sec)
{
struct bfd_elf_section_data *sdata;
int type, attr;
sdata = (struct bfd_elf_section_data *) sec->used_by_bfd;
if (sdata == NULL)
{
- bfd_size_type amt = sizeof (*sdata);
- sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, amt);
+ sdata = bfd_zalloc (abfd, sizeof (*sdata));
if (sdata == NULL)
return FALSE;
- sec->used_by_bfd = (PTR) sdata;
+ sec->used_by_bfd = sdata;
}
elf_section_type (sec) = SHT_NULL;
*/
bfd_boolean
-_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename)
- bfd *abfd;
- Elf_Internal_Phdr *hdr;
- int index;
- const char *typename;
+_bfd_elf_make_section_from_phdr (bfd *abfd,
+ Elf_Internal_Phdr *hdr,
+ int index,
+ const char *typename)
{
asection *newsect;
char *name;
&& (hdr->p_memsz > hdr->p_filesz));
sprintf (namebuf, "%s%d%s", typename, index, split ? "a" : "");
len = strlen (namebuf) + 1;
- name = bfd_alloc (abfd, (bfd_size_type) len);
+ name = bfd_alloc (abfd, len);
if (!name)
return FALSE;
memcpy (name, namebuf, len);
{
sprintf (namebuf, "%s%db", typename, index);
len = strlen (namebuf) + 1;
- name = bfd_alloc (abfd, (bfd_size_type) len);
+ name = bfd_alloc (abfd, len);
if (!name)
return FALSE;
memcpy (name, namebuf, len);
}
bfd_boolean
-bfd_section_from_phdr (abfd, hdr, index)
- bfd *abfd;
- Elf_Internal_Phdr *hdr;
- int index;
+bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index)
{
struct elf_backend_data *bed;
case PT_NOTE:
if (! _bfd_elf_make_section_from_phdr (abfd, hdr, index, "note"))
return FALSE;
- if (! elfcore_read_notes (abfd, (file_ptr) hdr->p_offset, hdr->p_filesz))
+ if (! elfcore_read_notes (abfd, hdr->p_offset, hdr->p_filesz))
return FALSE;
return TRUE;
relocations; otherwise, we use REL relocations. */
bfd_boolean
-_bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p)
- bfd *abfd;
- Elf_Internal_Shdr *rel_hdr;
- asection *asect;
- bfd_boolean use_rela_p;
+_bfd_elf_init_reloc_shdr (bfd *abfd,
+ Elf_Internal_Shdr *rel_hdr,
+ asection *asect,
+ bfd_boolean use_rela_p)
{
char *name;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* Set up an ELF internal section header for a section. */
static void
-elf_fake_sections (abfd, asect, failedptrarg)
- bfd *abfd;
- asection *asect;
- PTR failedptrarg;
+elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg)
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- bfd_boolean *failedptr = (bfd_boolean *) failedptrarg;
+ bfd_boolean *failedptr = failedptrarg;
Elf_Internal_Shdr *this_hdr;
if (*failedptr)
/* Fill in the contents of a SHT_GROUP section. */
void
-bfd_elf_set_group_contents (abfd, sec, failedptrarg)
- bfd *abfd;
- asection *sec;
- PTR failedptrarg;
+bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
{
- bfd_boolean *failedptr = (bfd_boolean *) failedptrarg;
+ bfd_boolean *failedptr = failedptrarg;
unsigned long symindx;
asection *elt, *first;
unsigned char *loc;
in here too, while we're at it. */
static bfd_boolean
-assign_section_numbers (abfd)
- bfd *abfd;
+assign_section_numbers (bfd *abfd)
{
struct elf_obj_tdata *t = elf_tdata (abfd);
asection *sec;
/* Set up the list of section header pointers, in agreement with the
indices. */
amt = section_number * sizeof (Elf_Internal_Shdr *);
- i_shdrp = (Elf_Internal_Shdr **) bfd_zalloc (abfd, amt);
+ i_shdrp = bfd_zalloc (abfd, amt);
if (i_shdrp == NULL)
return FALSE;
amt = sizeof (Elf_Internal_Shdr);
- i_shdrp[0] = (Elf_Internal_Shdr *) bfd_zalloc (abfd, amt);
+ i_shdrp[0] = bfd_zalloc (abfd, amt);
if (i_shdrp[0] == NULL)
{
bfd_release (abfd, i_shdrp);
char *alc;
len = strlen (sec->name);
- alc = (char *) bfd_malloc ((bfd_size_type) (len - 2));
+ alc = bfd_malloc (len - 2);
if (alc == NULL)
return FALSE;
memcpy (alc, sec->name, len - 3);
all local symbols to be at the head of the list. */
static INLINE int
-sym_is_global (abfd, sym)
- bfd *abfd;
- asymbol *sym;
+sym_is_global (bfd *abfd, asymbol *sym)
{
/* If the backend has a special mapping, use it. */
- if (get_elf_backend_data (abfd)->elf_backend_sym_is_global)
- return ((*get_elf_backend_data (abfd)->elf_backend_sym_is_global)
- (abfd, sym));
+ struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ if (bed->elf_backend_sym_is_global)
+ return (*bed->elf_backend_sym_is_global) (abfd, sym);
return ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0
|| bfd_is_und_section (bfd_get_section (sym))
}
static bfd_boolean
-elf_map_symbols (abfd)
- bfd *abfd;
+elf_map_symbols (bfd *abfd)
{
unsigned int symcount = bfd_get_symcount (abfd);
asymbol **syms = bfd_get_outsymbols (abfd);
max_index++;
amt = max_index * sizeof (asymbol *);
- sect_syms = (asymbol **) bfd_zalloc (abfd, amt);
+ sect_syms = bfd_zalloc (abfd, amt);
if (sect_syms == NULL)
return FALSE;
elf_section_syms (abfd) = sect_syms;
/* Now sort the symbols so the local symbols are first. */
amt = (num_locals + num_globals) * sizeof (asymbol *);
- new_syms = (asymbol **) bfd_alloc (abfd, amt);
+ new_syms = bfd_alloc (abfd, amt);
if (new_syms == NULL)
return FALSE;
/* Align to the maximum file alignment that could be required for any
ELF data structure. */
-static INLINE file_ptr align_file_position
- PARAMS ((file_ptr, int));
static INLINE file_ptr
-align_file_position (off, align)
- file_ptr off;
- int align;
+align_file_position (file_ptr off, int align)
{
return (off + align - 1) & ~(align - 1);
}
/* Assign a file position to a section, optionally aligning to the
required section alignment. */
-INLINE file_ptr
-_bfd_elf_assign_file_position_for_section (i_shdrp, offset, align)
- Elf_Internal_Shdr *i_shdrp;
- file_ptr offset;
- bfd_boolean align;
+file_ptr
+_bfd_elf_assign_file_position_for_section (Elf_Internal_Shdr *i_shdrp,
+ file_ptr offset,
+ bfd_boolean align)
{
if (align)
{
is not NULL, this is being called by the ELF backend linker. */
bfd_boolean
-_bfd_elf_compute_section_file_positions (abfd, link_info)
- bfd *abfd;
- struct bfd_link_info *link_info;
+_bfd_elf_compute_section_file_positions (bfd *abfd,
+ struct bfd_link_info *link_info)
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_boolean failed;
/* Create a mapping from a set of sections to a program segment. */
-static INLINE struct elf_segment_map *
-make_mapping (abfd, sections, from, to, phdr)
- bfd *abfd;
- asection **sections;
- unsigned int from;
- unsigned int to;
- bfd_boolean phdr;
+static struct elf_segment_map *
+make_mapping (bfd *abfd,
+ asection **sections,
+ unsigned int from,
+ unsigned int to,
+ bfd_boolean phdr)
{
struct elf_segment_map *m;
unsigned int i;
amt = sizeof (struct elf_segment_map);
amt += (to - from - 1) * sizeof (asection *);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
return NULL;
m->next = NULL;
/* Set up a mapping from BFD sections to program segments. */
static bfd_boolean
-map_sections_to_segments (abfd)
- bfd *abfd;
+map_sections_to_segments (bfd *abfd)
{
asection **sections = NULL;
asection *s;
/* Select the allocated sections, and sort them. */
amt = bfd_count_sections (abfd) * sizeof (asection *);
- sections = (asection **) bfd_malloc (amt);
+ sections = bfd_malloc (amt);
if (sections == NULL)
goto error_return;
if (s != NULL && (s->flags & SEC_LOAD) != 0)
{
amt = sizeof (struct elf_segment_map);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
pm = &m->next;
amt = sizeof (struct elf_segment_map);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
if (dynsec != NULL)
{
amt = sizeof (struct elf_segment_map);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
&& strncmp (s->name, ".note", 5) == 0)
{
amt = sizeof (struct elf_segment_map);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
amt = sizeof (struct elf_segment_map);
amt += (tls_count - 1) * sizeof (asection *);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
&& (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0)
{
amt = sizeof (struct elf_segment_map);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
if (elf_tdata (abfd)->stack_flags)
{
amt = sizeof (struct elf_segment_map);
- m = (struct elf_segment_map *) bfd_zalloc (abfd, amt);
+ m = bfd_zalloc (abfd, amt);
if (m == NULL)
goto error_return;
m->next = NULL;
/* Sort sections by address. */
static int
-elf_sort_sections (arg1, arg2)
- const PTR arg1;
- const PTR arg2;
+elf_sort_sections (const void *arg1, const void *arg2)
{
const asection *sec1 = *(const asection **) arg1;
const asection *sec2 = *(const asection **) arg2;
the file header, and writes out the program headers. */
static bfd_boolean
-assign_file_positions_for_segments (abfd)
- bfd *abfd;
+assign_file_positions_for_segments (bfd *abfd)
{
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
unsigned int count;
alloc = count;
amt = alloc * sizeof (Elf_Internal_Phdr);
- phdrs = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
+ phdrs = bfd_alloc (abfd, amt);
if (phdrs == NULL)
return FALSE;
will be two segments. */
static bfd_size_type
-get_program_header_size (abfd)
- bfd *abfd;
+get_program_header_size (bfd *abfd)
{
size_t segs;
asection *s;
We also don't set the positions of the .symtab and .strtab here. */
static bfd_boolean
-assign_file_positions_except_relocs (abfd)
- bfd *abfd;
+assign_file_positions_except_relocs (bfd *abfd)
{
struct elf_obj_tdata * const tdata = elf_tdata (abfd);
Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd);
}
static bfd_boolean
-prep_headers (abfd)
- bfd *abfd;
+prep_headers (bfd *abfd)
{
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */
of the loadable file image. */
void
-_bfd_elf_assign_file_positions_for_relocs (abfd)
- bfd *abfd;
+_bfd_elf_assign_file_positions_for_relocs (bfd *abfd)
{
file_ptr off;
unsigned int i, num_sec;
}
bfd_boolean
-_bfd_elf_write_object_contents (abfd)
- bfd *abfd;
+_bfd_elf_write_object_contents (bfd *abfd)
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
Elf_Internal_Ehdr *i_ehdrp;
unsigned int count, num_sec;
if (! abfd->output_has_begun
- && ! _bfd_elf_compute_section_file_positions
- (abfd, (struct bfd_link_info *) NULL))
+ && ! _bfd_elf_compute_section_file_positions (abfd, NULL))
return FALSE;
i_shdrp = elf_elfsections (abfd);
}
bfd_boolean
-_bfd_elf_write_corefile_contents (abfd)
- bfd *abfd;
+_bfd_elf_write_corefile_contents (bfd *abfd)
{
/* Hopefully this can be done just like an object file. */
return _bfd_elf_write_object_contents (abfd);
/* Given a section, search the header to find them. */
int
-_bfd_elf_section_from_bfd_section (abfd, asect)
- bfd *abfd;
- struct sec *asect;
+_bfd_elf_section_from_bfd_section (bfd *abfd, struct sec *asect)
{
struct elf_backend_data *bed;
int index;
on error. */
int
-_bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr)
- bfd *abfd;
- asymbol **asym_ptr_ptr;
+_bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr)
{
asymbol *asym_ptr = *asym_ptr_ptr;
int idx;
/* Copy private BFD data. This copies any program header information. */
static bfd_boolean
-copy_private_bfd_data (ibfd, obfd)
- bfd *ibfd;
- bfd *obfd;
+copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
Elf_Internal_Ehdr *iehdr;
struct elf_segment_map *map;
all of the sections we have selected. */
amt = sizeof (struct elf_segment_map);
amt += ((bfd_size_type) section_count - 1) * sizeof (asection *);
- map = (struct elf_segment_map *) bfd_alloc (obfd, amt);
+ map = bfd_alloc (obfd, amt);
if (map == NULL)
return FALSE;
/* Gcc 2.96 miscompiles this code on mips. Don't do casting here
to work around this long long bug. */
amt = section_count * sizeof (asection *);
- sections = (asection **) bfd_malloc (amt);
+ sections = bfd_malloc (amt);
if (sections == NULL)
return FALSE;
and carry on looping. */
amt = sizeof (struct elf_segment_map);
amt += ((bfd_size_type) section_count - 1) * sizeof (asection *);
- map = (struct elf_segment_map *) bfd_alloc (obfd, amt);
+ map = bfd_alloc (obfd, amt);
if (map == NULL)
{
free (sections);
field, and sometimes the info field. */
bfd_boolean
-_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
- bfd *ibfd;
- asection *isec;
- bfd *obfd;
- asection *osec;
+_bfd_elf_copy_private_section_data (bfd *ibfd,
+ asection *isec,
+ bfd *obfd,
+ asection *osec)
{
Elf_Internal_Shdr *ihdr, *ohdr;
#define MAP_SYM_SHNDX (SHN_HIOS + 5)
bfd_boolean
-_bfd_elf_copy_private_symbol_data (ibfd, isymarg, obfd, osymarg)
- bfd *ibfd;
- asymbol *isymarg;
- bfd *obfd;
- asymbol *osymarg;
+_bfd_elf_copy_private_symbol_data (bfd *ibfd,
+ asymbol *isymarg,
+ bfd *obfd,
+ asymbol *osymarg)
{
elf_symbol_type *isym, *osym;
/* Swap out the symbols. */
static bfd_boolean
-swap_out_syms (abfd, sttp, relocatable_p)
- bfd *abfd;
- struct bfd_strtab_hash **sttp;
- int relocatable_p;
+swap_out_syms (bfd *abfd,
+ struct bfd_strtab_hash **sttp,
+ int relocatable_p)
{
struct elf_backend_data *bed;
int symcount;
_bfd_stringtab_free (stt);
return FALSE;
}
- symtab_hdr->contents = (PTR) outbound_syms;
+ symtab_hdr->contents = outbound_syms;
outbound_shndx = NULL;
symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
always has a dummy entry as symbol #0, so it ends up even. */
long
-_bfd_elf_get_symtab_upper_bound (abfd)
- bfd *abfd;
+_bfd_elf_get_symtab_upper_bound (bfd *abfd)
{
long symcount;
long symtab_size;
}
long
-_bfd_elf_get_dynamic_symtab_upper_bound (abfd)
- bfd *abfd;
+_bfd_elf_get_dynamic_symtab_upper_bound (bfd *abfd)
{
long symcount;
long symtab_size;
}
long
-_bfd_elf_get_reloc_upper_bound (abfd, asect)
- bfd *abfd ATTRIBUTE_UNUSED;
- sec_ptr asect;
+_bfd_elf_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED,
+ sec_ptr asect)
{
return (asect->reloc_count + 1) * sizeof (arelent *);
}
/* Canonicalize the relocs. */
long
-_bfd_elf_canonicalize_reloc (abfd, section, relptr, symbols)
- bfd *abfd;
- sec_ptr section;
- arelent **relptr;
- asymbol **symbols;
+_bfd_elf_canonicalize_reloc (bfd *abfd,
+ sec_ptr section,
+ arelent **relptr,
+ asymbol **symbols)
{
arelent *tblptr;
unsigned int i;
}
long
-_bfd_elf_get_symtab (abfd, alocation)
- bfd *abfd;
- asymbol **alocation;
+_bfd_elf_get_symtab (bfd *abfd, asymbol **allocation)
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- long symcount = bed->s->slurp_symbol_table (abfd, alocation, FALSE);
+ long symcount = bed->s->slurp_symbol_table (abfd, allocation, FALSE);
if (symcount >= 0)
bfd_get_symcount (abfd) = symcount;
}
long
-_bfd_elf_canonicalize_dynamic_symtab (abfd, alocation)
- bfd *abfd;
- asymbol **alocation;
+_bfd_elf_canonicalize_dynamic_symtab (bfd *abfd,
+ asymbol **allocation)
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- long symcount = bed->s->slurp_symbol_table (abfd, alocation, TRUE);
+ long symcount = bed->s->slurp_symbol_table (abfd, allocation, TRUE);
if (symcount >= 0)
bfd_get_dynamic_symcount (abfd) = symcount;
considered to be a dynamic reloc section. */
long
-_bfd_elf_get_dynamic_reloc_upper_bound (abfd)
- bfd *abfd;
+_bfd_elf_get_dynamic_reloc_upper_bound (bfd *abfd)
{
long ret;
asection *s;
section. */
long
-_bfd_elf_canonicalize_dynamic_reloc (abfd, storage, syms)
- bfd *abfd;
- arelent **storage;
- asymbol **syms;
+_bfd_elf_canonicalize_dynamic_reloc (bfd *abfd,
+ arelent **storage,
+ asymbol **syms)
{
- bfd_boolean (*slurp_relocs)
- PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
+ bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
asection *s;
long ret;
/* Read in the version information. */
bfd_boolean
-_bfd_elf_slurp_version_tables (abfd)
- bfd *abfd;
+_bfd_elf_slurp_version_tables (bfd *abfd)
{
bfd_byte *contents = NULL;
bfd_size_type amt;
hdr = &elf_tdata (abfd)->dynverdef_hdr;
- contents = (bfd_byte *) bfd_malloc (hdr->sh_size);
+ contents = bfd_malloc (hdr->sh_size);
if (contents == NULL)
goto error_return;
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) contents, hdr->sh_size, abfd) != hdr->sh_size)
+ || bfd_bread (contents, hdr->sh_size, abfd) != hdr->sh_size)
goto error_return;
/* We know the number of entries in the section but not the maximum
}
amt = (bfd_size_type) maxidx * sizeof (Elf_Internal_Verdef);
- elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt);
+ elf_tdata (abfd)->verdef = bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;
iverdef->vd_bfd = abfd;
amt = (bfd_size_type) iverdef->vd_cnt * sizeof (Elf_Internal_Verdaux);
- iverdef->vd_auxptr = (Elf_Internal_Verdaux *) bfd_alloc (abfd, amt);
+ iverdef->vd_auxptr = bfd_alloc (abfd, amt);
if (iverdef->vd_auxptr == NULL)
goto error_return;
hdr = &elf_tdata (abfd)->dynverref_hdr;
amt = (bfd_size_type) hdr->sh_info * sizeof (Elf_Internal_Verneed);
- elf_tdata (abfd)->verref =
- (Elf_Internal_Verneed *) bfd_zalloc (abfd, amt);
+ elf_tdata (abfd)->verref = bfd_zalloc (abfd, amt);
if (elf_tdata (abfd)->verref == NULL)
goto error_return;
elf_tdata (abfd)->cverrefs = hdr->sh_info;
- contents = (bfd_byte *) bfd_malloc (hdr->sh_size);
+ contents = bfd_malloc (hdr->sh_size);
if (contents == NULL)
goto error_return;
if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) contents, hdr->sh_size, abfd) != hdr->sh_size)
+ || bfd_bread (contents, hdr->sh_size, abfd) != hdr->sh_size)
goto error_return;
everneed = (Elf_External_Verneed *) contents;
amt = iverneed->vn_cnt;
amt *= sizeof (Elf_Internal_Vernaux);
- iverneed->vn_auxptr = (Elf_Internal_Vernaux *) bfd_alloc (abfd, amt);
+ iverneed->vn_auxptr = bfd_alloc (abfd, amt);
evernaux = ((Elf_External_Vernaux *)
((bfd_byte *) everneed + iverneed->vn_aux));
}
\f
asymbol *
-_bfd_elf_make_empty_symbol (abfd)
- bfd *abfd;
+_bfd_elf_make_empty_symbol (bfd *abfd)
{
elf_symbol_type *newsym;
bfd_size_type amt = sizeof (elf_symbol_type);
- newsym = (elf_symbol_type *) bfd_zalloc (abfd, amt);
+ newsym = bfd_zalloc (abfd, amt);
if (!newsym)
return NULL;
else
}
void
-_bfd_elf_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
- asymbol *symbol;
- symbol_info *ret;
+_bfd_elf_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED,
+ asymbol *symbol,
+ symbol_info *ret)
{
bfd_symbol_info (symbol, ret);
}
override it. */
bfd_boolean
-_bfd_elf_is_local_label_name (abfd, name)
- bfd *abfd ATTRIBUTE_UNUSED;
- const char *name;
+_bfd_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
+ const char *name)
{
/* Normal local symbols start with ``.L''. */
if (name[0] == '.' && name[1] == 'L')
}
alent *
-_bfd_elf_get_lineno (ignore_abfd, symbol)
- bfd *ignore_abfd ATTRIBUTE_UNUSED;
- asymbol *symbol ATTRIBUTE_UNUSED;
+_bfd_elf_get_lineno (bfd *abfd ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED)
{
abort ();
return NULL;
}
bfd_boolean
-_bfd_elf_set_arch_mach (abfd, arch, machine)
- bfd *abfd;
- enum bfd_architecture arch;
- unsigned long machine;
+_bfd_elf_set_arch_mach (bfd *abfd,
+ enum bfd_architecture arch,
+ unsigned long machine)
{
/* If this isn't the right architecture for this backend, and this
isn't the generic backend, fail. */
for error reporting. */
static bfd_boolean
-elf_find_function (abfd, section, symbols, offset,
- filename_ptr, functionname_ptr)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *section;
- asymbol **symbols;
- bfd_vma offset;
- const char **filename_ptr;
- const char **functionname_ptr;
+elf_find_function (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *section,
+ asymbol **symbols,
+ bfd_vma offset,
+ const char **filename_ptr,
+ const char **functionname_ptr)
{
const char *filename;
asymbol *func;
for error reporting. */
bfd_boolean
-_bfd_elf_find_nearest_line (abfd, section, symbols, offset,
- filename_ptr, functionname_ptr, line_ptr)
- bfd *abfd;
- asection *section;
- asymbol **symbols;
- bfd_vma offset;
- const char **filename_ptr;
- const char **functionname_ptr;
- unsigned int *line_ptr;
+_bfd_elf_find_nearest_line (bfd *abfd,
+ asection *section,
+ asymbol **symbols,
+ bfd_vma offset,
+ const char **filename_ptr,
+ const char **functionname_ptr,
+ unsigned int *line_ptr)
{
bfd_boolean found;
}
int
-_bfd_elf_sizeof_headers (abfd, reloc)
- bfd *abfd;
- bfd_boolean reloc;
+_bfd_elf_sizeof_headers (bfd *abfd, bfd_boolean reloc)
{
int ret;
}
bfd_boolean
-_bfd_elf_set_section_contents (abfd, section, location, offset, count)
- bfd *abfd;
- sec_ptr section;
- PTR location;
- file_ptr offset;
- bfd_size_type count;
+_bfd_elf_set_section_contents (bfd *abfd,
+ sec_ptr section,
+ void *location,
+ file_ptr offset,
+ bfd_size_type count)
{
Elf_Internal_Shdr *hdr;
bfd_signed_vma pos;
if (! abfd->output_has_begun
- && ! (_bfd_elf_compute_section_file_positions
- (abfd, (struct bfd_link_info *) NULL)))
+ && ! _bfd_elf_compute_section_file_positions (abfd, NULL))
return FALSE;
hdr = &elf_section_data (section)->this_hdr;
}
void
-_bfd_elf_no_info_to_howto (abfd, cache_ptr, dst)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *cache_ptr ATTRIBUTE_UNUSED;
- Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
+_bfd_elf_no_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *cache_ptr ATTRIBUTE_UNUSED,
+ Elf_Internal_Rela *dst ATTRIBUTE_UNUSED)
{
abort ();
}
/* Try to convert a non-ELF reloc into an ELF one. */
bfd_boolean
-_bfd_elf_validate_reloc (abfd, areloc)
- bfd *abfd;
- arelent *areloc;
+_bfd_elf_validate_reloc (bfd *abfd, arelent *areloc)
{
/* Check whether we really have an ELF howto. */
}
bfd_boolean
-_bfd_elf_close_and_cleanup (abfd)
- bfd *abfd;
+_bfd_elf_close_and_cleanup (bfd *abfd)
{
if (bfd_get_format (abfd) == bfd_object)
{
this reloc. */
bfd_reloc_status_type
-_bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *re ATTRIBUTE_UNUSED;
- struct symbol_cache_entry *symbol ATTRIBUTE_UNUSED;
- PTR data ATTRIBUTE_UNUSED;
- asection *is ATTRIBUTE_UNUSED;
- bfd *obfd ATTRIBUTE_UNUSED;
- char **errmsg ATTRIBUTE_UNUSED;
+_bfd_elf_rel_vtable_reloc_fn
+ (bfd *abfd ATTRIBUTE_UNUSED, arelent *re ATTRIBUTE_UNUSED,
+ struct symbol_cache_entry *symbol ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED, asection *is ATTRIBUTE_UNUSED,
+ bfd *obfd ATTRIBUTE_UNUSED, char **errmsg ATTRIBUTE_UNUSED)
{
return bfd_reloc_ok;
}
/* FIXME: this is kinda wrong, but it's what gdb wants. */
static int
-elfcore_make_pid (abfd)
- bfd *abfd;
+elfcore_make_pid (bfd *abfd)
{
return ((elf_tdata (abfd)->core_lwpid << 16)
+ (elf_tdata (abfd)->core_pid));
overwrite it. */
static bfd_boolean
-elfcore_maybe_make_sect (abfd, name, sect)
- bfd *abfd;
- char *name;
- asection *sect;
+elfcore_maybe_make_sect (bfd *abfd, char *name, asection *sect)
{
asection *sect2;
PID is elfcore_make_pid (abfd).
Both pseudosections have identical contents. */
bfd_boolean
-_bfd_elfcore_make_pseudosection (abfd, name, size, filepos)
- bfd *abfd;
- char *name;
- size_t size;
- ufile_ptr filepos;
+_bfd_elfcore_make_pseudosection (bfd *abfd,
+ char *name,
+ size_t size,
+ ufile_ptr filepos)
{
char buf[100];
char *threaded_name;
sprintf (buf, "%s/%d", name, elfcore_make_pid (abfd));
len = strlen (buf) + 1;
- threaded_name = bfd_alloc (abfd, (bfd_size_type) len);
+ threaded_name = bfd_alloc (abfd, len);
if (threaded_name == NULL)
return FALSE;
memcpy (threaded_name, buf, len);
*/
#if defined (HAVE_PRSTATUS_T)
-static bfd_boolean elfcore_grok_prstatus
- PARAMS ((bfd *, Elf_Internal_Note *));
static bfd_boolean
-elfcore_grok_prstatus (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
{
size_t raw_size;
int offset;
/* Create a pseudosection containing the exact contents of NOTE. */
static bfd_boolean
-elfcore_make_note_pseudosection (abfd, name, note)
- bfd *abfd;
- char *name;
- Elf_Internal_Note *note;
+elfcore_make_note_pseudosection (bfd *abfd,
+ char *name,
+ Elf_Internal_Note *note)
{
return _bfd_elfcore_make_pseudosection (abfd, name,
note->descsz, note->descpos);
data structure apart. */
static bfd_boolean
-elfcore_grok_prfpreg (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_prfpreg (bfd *abfd, Elf_Internal_Note *note)
{
return elfcore_make_note_pseudosection (abfd, ".reg2", note);
}
literally. */
static bfd_boolean
-elfcore_grok_prxfpreg (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_prxfpreg (bfd *abfd, Elf_Internal_Note *note)
{
return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note);
}
the copy will always have a terminating '\0'. */
char *
-_bfd_elfcore_strndup (abfd, start, max)
- bfd *abfd;
- char *start;
- size_t max;
+_bfd_elfcore_strndup (bfd *abfd, char *start, size_t max)
{
char *dups;
char *end = memchr (start, '\0', max);
else
len = end - start;
- dups = bfd_alloc (abfd, (bfd_size_type) len + 1);
+ dups = bfd_alloc (abfd, len + 1);
if (dups == NULL)
return NULL;
}
#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
-static bfd_boolean elfcore_grok_psinfo
- PARAMS ((bfd *, Elf_Internal_Note *));
-
static bfd_boolean
-elfcore_grok_psinfo (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
{
if (note->descsz == sizeof (elfcore_psinfo_t))
{
#endif /* defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) */
#if defined (HAVE_PSTATUS_T)
-static bfd_boolean elfcore_grok_pstatus
- PARAMS ((bfd *, Elf_Internal_Note *));
-
static bfd_boolean
-elfcore_grok_pstatus (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_pstatus (bfd *abfd, Elf_Internal_Note *note)
{
if (note->descsz == sizeof (pstatus_t)
#if defined (HAVE_PXSTATUS_T)
#endif /* defined (HAVE_PSTATUS_T) */
#if defined (HAVE_LWPSTATUS_T)
-static bfd_boolean elfcore_grok_lwpstatus
- PARAMS ((bfd *, Elf_Internal_Note *));
-
static bfd_boolean
-elfcore_grok_lwpstatus (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note)
{
lwpstatus_t lwpstat;
char buf[100];
sprintf (buf, ".reg/%d", elfcore_make_pid (abfd));
len = strlen (buf) + 1;
- name = bfd_alloc (abfd, (bfd_size_type) len);
+ name = bfd_alloc (abfd, len);
if (name == NULL)
return FALSE;
memcpy (name, buf, len);
sprintf (buf, ".reg2/%d", elfcore_make_pid (abfd));
len = strlen (buf) + 1;
- name = bfd_alloc (abfd, (bfd_size_type) len);
+ name = bfd_alloc (abfd, len);
if (name == NULL)
return FALSE;
memcpy (name, buf, len);
#if defined (HAVE_WIN32_PSTATUS_T)
static bfd_boolean
-elfcore_grok_win32pstatus (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note)
{
char buf[30];
char *name;
sprintf (buf, ".reg/%d", pstatus.data.thread_info.tid);
len = strlen (buf) + 1;
- name = bfd_alloc (abfd, (bfd_size_type) len);
+ name = bfd_alloc (abfd, len);
if (name == NULL)
return FALSE;
sprintf (buf, ".module/%08x", pstatus.data.module_info.base_address);
len = strlen (buf) + 1;
- name = bfd_alloc (abfd, (bfd_size_type) len);
+ name = bfd_alloc (abfd, len);
if (name == NULL)
return FALSE;
#endif /* HAVE_WIN32_PSTATUS_T */
static bfd_boolean
-elfcore_grok_note (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
{
struct elf_backend_data *bed = get_elf_backend_data (abfd);
}
static bfd_boolean
-elfcore_netbsd_get_lwpid (note, lwpidp)
- Elf_Internal_Note *note;
- int *lwpidp;
+elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp)
{
char *cp;
}
static bfd_boolean
-elfcore_grok_netbsd_procinfo (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note)
{
/* Signal number at offset 0x08. */
}
static bfd_boolean
-elfcore_grok_netbsd_note (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note)
{
int lwp;
}
static bfd_boolean
-elfcore_grok_nto_status (abfd, note, tid)
- bfd *abfd;
- Elf_Internal_Note *note;
- pid_t *tid;
+elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid)
{
void *ddata = note->descdata;
char buf[100];
/* Make a ".qnx_core_status/%d" section. */
sprintf (buf, ".qnx_core_status/%d", *tid);
- name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1);
+ name = bfd_alloc (abfd, strlen (buf) + 1);
if (name == NULL)
return FALSE;
strcpy (name, buf);
}
static bfd_boolean
-elfcore_grok_nto_gregs (abfd, note, tid)
- bfd *abfd;
- Elf_Internal_Note *note;
- pid_t tid;
+elfcore_grok_nto_gregs (bfd *abfd, Elf_Internal_Note *note, pid_t tid)
{
char buf[100];
char *name;
/* Make a ".reg/%d" section. */
sprintf (buf, ".reg/%d", tid);
- name = bfd_alloc (abfd, (bfd_size_type) strlen (buf) + 1);
+ name = bfd_alloc (abfd, strlen (buf) + 1);
if (name == NULL)
return FALSE;
strcpy (name, buf);
#define BFD_QNT_CORE_FPREG 10
static bfd_boolean
-elfcore_grok_nto_note (abfd, note)
- bfd *abfd;
- Elf_Internal_Note *note;
+elfcore_grok_nto_note (bfd *abfd, Elf_Internal_Note *note)
{
/* Every GREG section has a STATUS section before it. Store the
tid from the previous call to pass down to the next gregs
End of buffer containing note. */
char *
-elfcore_write_note (abfd, buf, bufsiz, name, type, input, size)
- bfd *abfd;
- char *buf;
- int *bufsiz;
- const char *name;
- int type;
- const PTR input;
- int size;
+elfcore_write_note (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const char *name,
+ int type,
+ const void *input,
+ int size)
{
Elf_External_Note *xnp;
size_t namesz;
#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
char *
-elfcore_write_prpsinfo (abfd, buf, bufsiz, fname, psargs)
- bfd *abfd;
- char *buf;
- int *bufsiz;
- const char *fname;
- const char *psargs;
+elfcore_write_prpsinfo (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const char *fname,
+ const char *psargs)
{
int note_type;
char *note_name = "CORE";
#if defined (HAVE_PRSTATUS_T)
char *
-elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs)
- bfd *abfd;
- char *buf;
- int *bufsiz;
- long pid;
- int cursig;
- const PTR gregs;
+elfcore_write_prstatus (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ long pid,
+ int cursig,
+ const void *gregs)
{
prstatus_t prstat;
char *note_name = "CORE";
#if defined (HAVE_LWPSTATUS_T)
char *
-elfcore_write_lwpstatus (abfd, buf, bufsiz, pid, cursig, gregs)
- bfd *abfd;
- char *buf;
- int *bufsiz;
- long pid;
- int cursig;
- const PTR gregs;
+elfcore_write_lwpstatus (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ long pid,
+ int cursig,
+ const void *gregs)
{
lwpstatus_t lwpstat;
char *note_name = "CORE";
#if defined (HAVE_PSTATUS_T)
char *
-elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs)
- bfd *abfd;
- char *buf;
- int *bufsiz;
- long pid;
- int cursig;
- const PTR gregs;
+elfcore_write_pstatus (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ long pid,
+ int cursig,
+ const void *gregs)
{
pstatus_t pstat;
char *note_name = "CORE";
#endif /* HAVE_PSTATUS_T */
char *
-elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size)
- bfd *abfd;
- char *buf;
- int *bufsiz;
- const PTR fpregs;
- int size;
+elfcore_write_prfpreg (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const void *fpregs,
+ int size)
{
char *note_name = "CORE";
return elfcore_write_note (abfd, buf, bufsiz,
}
char *
-elfcore_write_prxfpreg (abfd, buf, bufsiz, xfpregs, size)
- bfd *abfd;
- char *buf;
- int *bufsiz;
- const PTR xfpregs;
- int size;
+elfcore_write_prxfpreg (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const void *xfpregs,
+ int size)
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
}
static bfd_boolean
-elfcore_read_notes (abfd, offset, size)
- bfd *abfd;
- file_ptr offset;
- bfd_size_type size;
+elfcore_read_notes (bfd *abfd, file_ptr offset, bfd_size_type size)
{
char *buf;
char *p;
occurs; bfd_get_error will return an appropriate code. */
long
-bfd_get_elf_phdr_upper_bound (abfd)
- bfd *abfd;
+bfd_get_elf_phdr_upper_bound (bfd *abfd)
{
if (abfd->xvec->flavour != bfd_target_elf_flavour)
{
error occurs; bfd_get_error will return an appropriate code. */
int
-bfd_get_elf_phdrs (abfd, phdrs)
- bfd *abfd;
- void *phdrs;
+bfd_get_elf_phdrs (bfd *abfd, void *phdrs)
{
int num_phdrs;
}
void
-_bfd_elf_sprintf_vma (abfd, buf, value)
- bfd *abfd ATTRIBUTE_UNUSED;
- char *buf;
- bfd_vma value;
+_bfd_elf_sprintf_vma (bfd *abfd ATTRIBUTE_UNUSED, char *buf, bfd_vma value)
{
#ifdef BFD64
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
}
void
-_bfd_elf_fprintf_vma (abfd, stream, value)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR stream;
- bfd_vma value;
+_bfd_elf_fprintf_vma (bfd *abfd ATTRIBUTE_UNUSED, void *stream, bfd_vma value)
{
#ifdef BFD64
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */
}
enum elf_reloc_type_class
-_bfd_elf_reloc_type_class (rela)
- const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED;
+_bfd_elf_reloc_type_class (const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED)
{
return reloc_class_normal;
}
relocation against a local symbol. */
bfd_vma
-_bfd_elf_rela_local_sym (abfd, sym, sec, rel)
- bfd *abfd;
- Elf_Internal_Sym *sym;
- asection *sec;
- Elf_Internal_Rela *rel;
+_bfd_elf_rela_local_sym (bfd *abfd,
+ Elf_Internal_Sym *sym,
+ asection *sec,
+ Elf_Internal_Rela *rel)
{
bfd_vma relocation;
_bfd_merged_section_offset (abfd, &msec,
elf_section_data (sec)->sec_info,
sym->st_value + rel->r_addend,
- (bfd_vma) 0)
+ 0)
- relocation;
rel->r_addend += msec->output_section->vma + msec->output_offset;
}
}
bfd_vma
-_bfd_elf_rel_local_sym (abfd, sym, psec, addend)
- bfd *abfd;
- Elf_Internal_Sym *sym;
- asection **psec;
- bfd_vma addend;
+_bfd_elf_rel_local_sym (bfd *abfd,
+ Elf_Internal_Sym *sym,
+ asection **psec,
+ bfd_vma addend)
{
asection *sec = *psec;
return _bfd_merged_section_offset (abfd, psec,
elf_section_data (sec)->sec_info,
- sym->st_value + addend, (bfd_vma) 0);
+ sym->st_value + addend, 0);
}
bfd_vma
-_bfd_elf_section_offset (abfd, info, sec, offset)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- bfd_vma offset;
+_bfd_elf_section_offset (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ bfd_vma offset)
{
struct bfd_elf_section_data *sec_data;
the remote memory. */
bfd *
-bfd_elf_bfd_from_remote_memory (templ, ehdr_vma, loadbasep, target_read_memory)
- bfd *templ;
- bfd_vma ehdr_vma;
- bfd_vma *loadbasep;
- int (*target_read_memory) PARAMS ((bfd_vma vma, char *myaddr, int len));
+bfd_elf_bfd_from_remote_memory
+ (bfd *templ,
+ bfd_vma ehdr_vma,
+ bfd_vma *loadbasep,
+ int (*target_read_memory) (bfd_vma, char *, int))
{
return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory)
(templ, ehdr_vma, loadbasep, target_read_memory);