This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Make elf_swap_symbol_in available in elf_size_info
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Wed, 5 Jun 2002 23:00:00 +0930
- Subject: Make elf_swap_symbol_in available in elf_size_info
What a lot of bother, just to make elf_swap_symbol_in available via
the ELF backend data struct. I want to use elf_swap_symbol_in in
elf.c:group_signature as it's cleaner than doing it piecemeal.
bfd/ChangeLog
* elf-bfd.h (struct elf_size_info): Add swap_symbol_in field.
(bfd_elf32_swap_symbol_in): Update prototype.
(bfd_elf64_swap_symbol_in): Likewise.
* elfcode.h (elf_swap_symbol_in): Change input args to const PTR *.
(elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in.
* elflink.h (elf_link_is_defined_archive_symbol): Likewise.
(elf_link_add_object_symbols): Likewise.
(elf_link_record_local_dynamic_symbol): Likewise.
(elf_link_input_bfd): Likewise.
(elf_gc_mark): Likewise.
(elf_reloc_symbol_deleted_p): Likewise.
* elf-m10200.c (mn10200_elf_relax_section): Likewise.
(mn10200_elf_relax_delete_bytes): Likewise.
(mn10200_elf_symbol_address_p): Likewise.
(mn10200_elf_get_relocated_section_contents): Likewise.
* elf-m10300.c (mn10300_elf_relax_section): Likewise.
(mn10300_elf_relax_section): Likewise.
(mn10300_elf_relax_delete_bytes): Likewise.
(mn10300_elf_symbol_address_p): Likewise.
(mn10300_elf_get_relocated_section_contents): Likewise.
* elf32-h8300.c (elf32_h8_relax_section): Likewise.
(elf32_h8_relax_delete_bytes): Likewise.
(elf32_h8_symbol_address_p): Likewise.
(elf32_h8_get_relocated_section_contents): Likewise.
* elf32-hppa.c (get_local_syms): Likewise.
* elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise.
* elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise.
* elf32-sh.c (sh_elf_relax_section): Likewise.
(sh_elf_relax_delete_bytes): Likewise.
(sh_elf_get_relocated_section_contents): Likewise.
* elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise.
* elf64-alpha.c (elf64_alpha_relax_section): Likewise.
* elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
* elf64-mmix.c (mmix_elf_relax_section): Likewise.
* elf64-ppc.c (get_local_syms): Likewise.
* elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise.
* elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
* elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser.
* elf64-alpha.c (alpha_elf_size_info): Likewise.
* elf64-hppa.c (hppa64_elf_size_info): Likewise.
* elf64-mips.c (mips_elf64_size_info): Likewise.
* elf64-s390.c (s390_elf64_size_info): Likewise.
* elf64-sparc.c (sparc64_elf_size_info): Likewise.
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.76
diff -u -p -r1.76 elf-bfd.h
--- bfd/elf-bfd.h 5 Jun 2002 03:43:09 -0000 1.76
+++ bfd/elf-bfd.h 5 Jun 2002 13:15:01 -0000
@@ -353,6 +353,8 @@ struct elf_size_info {
PARAMS ((bfd *));
void (*write_relocs)
PARAMS ((bfd *, asection *, PTR));
+ void (*swap_symbol_in)
+ PARAMS ((bfd *, const PTR *, const PTR *, Elf_Internal_Sym *));
void (*swap_symbol_out)
PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
boolean (*slurp_reloc_table)
@@ -1441,8 +1443,7 @@ extern boolean bfd_elf32_bfd_final_link
PARAMS ((bfd *, struct bfd_link_info *));
extern void bfd_elf32_swap_symbol_in
- PARAMS ((bfd *, const Elf32_External_Sym *, const Elf_External_Sym_Shndx *,
- Elf_Internal_Sym *));
+ PARAMS ((bfd *, const PTR *, const PTR *, Elf_Internal_Sym *));
extern void bfd_elf32_swap_symbol_out
PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
extern void bfd_elf32_swap_reloc_in
@@ -1494,8 +1495,7 @@ extern boolean bfd_elf64_bfd_final_link
PARAMS ((bfd *, struct bfd_link_info *));
extern void bfd_elf64_swap_symbol_in
- PARAMS ((bfd *, const Elf64_External_Sym *, const Elf_External_Sym_Shndx *,
- Elf_Internal_Sym *));
+ PARAMS ((bfd *, const PTR *, const PTR *, Elf_Internal_Sym *));
extern void bfd_elf64_swap_symbol_out
PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
extern void bfd_elf64_swap_reloc_in
Index: bfd/elf-m10200.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10200.c,v
retrieving revision 1.14
diff -u -p -r1.14 elf-m10200.c
--- bfd/elf-m10200.c 7 May 2002 00:16:50 -0000 1.14
+++ bfd/elf-m10200.c 5 Jun 2002 13:15:02 -0000
@@ -630,7 +630,8 @@ mn10200_elf_relax_section (abfd, sec, li
esym = extsyms + ELF32_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx == SHN_UNDEF)
sym_sec = bfd_und_section_ptr;
@@ -1317,7 +1318,8 @@ mn10200_elf_relax_delete_bytes (abfd, se
Elf_Internal_Sym isym;
Elf_External_Sym_Shndx dummy;
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx,
+ &isym);
if (isym.st_shndx == sec_shndx
&& isym.st_value > addr
@@ -1378,7 +1380,8 @@ mn10200_elf_symbol_address_p (abfd, sec,
{
Elf_Internal_Sym isym;
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx,
+ &isym);
if (isym.st_shndx == sec_shndx
&& isym.st_value == addr)
@@ -1500,7 +1503,8 @@ mn10200_elf_get_relocated_section_conten
{
asection *isec;
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp);
+ bfd_elf32_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, isymp);
if (isymp->st_shndx == SHN_UNDEF)
isec = bfd_und_section_ptr;
Index: bfd/elf-m10300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10300.c,v
retrieving revision 1.24
diff -u -p -r1.24 elf-m10300.c
--- bfd/elf-m10300.c 7 May 2002 00:16:50 -0000 1.24
+++ bfd/elf-m10300.c 5 Jun 2002 13:15:05 -0000
@@ -937,7 +937,9 @@ mn10300_elf_relax_section (abfd, sec, li
esym = extsyms + r_index;
shndx = shndx_buf + (shndx_buf ? r_index : 0);
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx,
+ bfd_elf32_swap_symbol_in (input_bfd,
+ (const PTR *) esym,
+ (const PTR *) shndx,
&isym);
if (isym.st_shndx == SHN_UNDEF)
@@ -1028,7 +1030,8 @@ mn10300_elf_relax_section (abfd, sec, li
{
Elf_Internal_Sym isym;
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx == sec_shndx
&& ELF_ST_TYPE (isym.st_info) == STT_FUNC)
{
@@ -1254,7 +1257,8 @@ mn10300_elf_relax_section (abfd, sec, li
struct elf_link_hash_table *elftab;
bfd_size_type amt;
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx != sec_shndx)
continue;
@@ -1551,7 +1555,8 @@ mn10300_elf_relax_section (abfd, sec, li
/* A local symbol. */
esym = extsyms + ELF32_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx == SHN_UNDEF)
sym_sec = bfd_und_section_ptr;
@@ -2674,7 +2679,8 @@ mn10300_elf_relax_delete_bytes (abfd, se
Elf_Internal_Sym isym;
Elf_External_Sym_Shndx dummy;
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx,
+ &isym);
if (isym.st_shndx == sec_shndx
&& isym.st_value > addr
@@ -2735,7 +2741,8 @@ mn10300_elf_symbol_address_p (abfd, sec,
{
Elf_Internal_Sym isym;
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx,
+ &isym);
if (isym.st_shndx == sec_shndx
&& isym.st_value == addr)
@@ -2857,7 +2864,8 @@ mn10300_elf_get_relocated_section_conten
{
asection *isec;
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp);
+ bfd_elf32_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, isymp);
if (isymp->st_shndx == SHN_UNDEF)
isec = bfd_und_section_ptr;
Index: bfd/elf32-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-h8300.c,v
retrieving revision 1.10
diff -u -p -r1.10 elf32-h8300.c
--- bfd/elf32-h8300.c 17 Dec 2001 00:52:34 -0000 1.10
+++ bfd/elf32-h8300.c 5 Jun 2002 13:15:12 -0000
@@ -1,5 +1,6 @@
/* Generic support for 32-bit ELF
- Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc.
+ Copyright 1993, 1995, 1998, 1999, 2001, 2002
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -815,7 +816,8 @@ elf32_h8_relax_section (abfd, sec, link_
/* A local symbol. */
esym = extsyms + ELF32_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
sym_sec = bfd_section_from_elf_index (abfd, isym.st_shndx);
symval = (isym.st_value
@@ -911,7 +913,9 @@ elf32_h8_relax_section (abfd, sec, link_
shndx = shndx_buf;
if (shndx != NULL)
shndx += ELF32_R_SYM (last_reloc->r_info);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &last_symbol);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx,
+ &last_symbol);
last_sym_sec
= bfd_section_from_elf_index (abfd, last_symbol.st_shndx);
@@ -1338,7 +1342,8 @@ elf32_h8_relax_delete_bytes (abfd, sec,
Elf_Internal_Sym isym;
Elf_External_Sym_Shndx dummy;
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx,
+ &isym);
if (isym.st_shndx == sec_shndx
&& isym.st_value > addr
@@ -1399,7 +1404,8 @@ elf32_h8_symbol_address_p (abfd, sec, ad
{
Elf_Internal_Sym isym;
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx,
+ &isym);
if (isym.st_shndx == sec_shndx
&& isym.st_value == addr)
@@ -1521,7 +1527,8 @@ elf32_h8_get_relocated_section_contents
{
asection *isec;
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp);
+ bfd_elf32_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, isymp);
if (isymp->st_shndx == SHN_UNDEF)
isec = bfd_und_section_ptr;
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.82
diff -u -p -r1.82 elf32-hppa.c
--- bfd/elf32-hppa.c 3 Jun 2002 01:57:09 -0000 1.82
+++ bfd/elf32-hppa.c 5 Jun 2002 13:15:16 -0000
@@ -2827,7 +2827,8 @@ get_local_syms (output_bfd, input_bfd, i
isym = local_syms, shndx = shndx_buf;
esym < end_sy;
esym++, isym++, shndx = (shndx ? shndx + 1 : NULL))
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isym);
+ bfd_elf32_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, isym);
/* Now we can free the external symbols. */
free (shndx_buf);
Index: bfd/elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.41
diff -u -p -r1.41 elf32-m68k.c
--- bfd/elf32-m68k.c 25 May 2002 13:09:37 -0000 1.41
+++ bfd/elf32-m68k.c 5 Jun 2002 13:15:19 -0000
@@ -2211,7 +2211,8 @@ bfd_m68k_elf32_create_embedded_relocs (a
/* A local symbol. */
esym = extsyms + ELF32_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
targetsec = bfd_section_from_elf_index (abfd, isym.st_shndx);
}
Index: bfd/elf32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mips.c,v
retrieving revision 1.152
diff -u -p -r1.152 elf32-mips.c
--- bfd/elf32-mips.c 5 Jun 2002 10:31:46 -0000 1.152
+++ bfd/elf32-mips.c 5 Jun 2002 13:15:20 -0000
@@ -1886,7 +1886,8 @@ bfd_mips_elf32_create_embedded_relocs (a
/* A local symbol. */
esym = extsyms + ELF32_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
targetsec = bfd_section_from_elf_index (abfd, isym.st_shndx);
}
Index: bfd/elf32-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh.c,v
retrieving revision 1.47
diff -u -p -r1.47 elf32-sh.c
--- bfd/elf32-sh.c 4 Apr 2002 19:53:36 -0000 1.47
+++ bfd/elf32-sh.c 5 Jun 2002 13:15:24 -0000
@@ -2067,7 +2067,8 @@ sh_elf_relax_section (abfd, sec, link_in
esym = extsyms + ELF32_R_SYM (irelfn->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irelfn->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx
!= (unsigned int) _bfd_elf_section_from_bfd_section (abfd, sec))
@@ -2447,7 +2448,8 @@ sh_elf_relax_delete_bytes (abfd, sec, ad
{
esym = extsyms + ELF32_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irel->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &sym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &sym);
if (sym.st_shndx == sec_shndx
&& (sym.st_value <= addr
@@ -2710,7 +2712,8 @@ sh_elf_relax_delete_bytes (abfd, sec, ad
esym = extsyms + ELF32_R_SYM (irelscan->r_info);
shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (irelscan->r_info) : 0);
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &sym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &sym);
if (sym.st_shndx == sec_shndx
&& (sym.st_value <= addr
@@ -2757,7 +2760,8 @@ sh_elf_relax_delete_bytes (abfd, sec, ad
Elf_Internal_Sym isym;
Elf_External_Sym_Shndx dummy;
- bfd_elf32_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf32_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx,
+ &isym);
if (isym.st_shndx == sec_shndx
&& isym.st_value > addr
@@ -4924,7 +4928,8 @@ sh_elf_get_relocated_section_contents (o
{
asection *isec;
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isymp);
+ bfd_elf32_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, isymp);
if (isymp->st_shndx == SHN_UNDEF)
isec = bfd_und_section_ptr;
Index: bfd/elf32-xstormy16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xstormy16.c,v
retrieving revision 1.6
diff -u -p -r1.6 elf32-xstormy16.c
--- bfd/elf32-xstormy16.c 3 Jun 2002 01:57:09 -0000 1.6
+++ bfd/elf32-xstormy16.c 5 Jun 2002 13:15:25 -0000
@@ -654,7 +654,8 @@ xstormy16_elf_relax_section (dynobj, spl
shndx = shndx_buf;
if (shndx != NULL)
shndx += idx;
- bfd_elf32_swap_symbol_in (ibfd, extsyms + idx, shndx, &isym);
+ bfd_elf32_swap_symbol_in (ibfd, (const PTR *) (extsyms + idx),
+ (const PTR *) shndx, &isym);
if (isym.st_shndx == SHN_UNDEF)
continue;
else if (isym.st_shndx == SHN_ABS)
Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.72
diff -u -p -r1.72 elf64-alpha.c
--- bfd/elf64-alpha.c 4 Jun 2002 00:51:07 -0000 1.72
+++ bfd/elf64-alpha.c 5 Jun 2002 13:15:29 -0000
@@ -2172,7 +2172,8 @@ elf64_alpha_relax_section (abfd, sec, li
esym = extsyms + ELF64_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELF64_R_SYM (irel->r_info) : 0);
- bfd_elf64_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf64_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx == SHN_UNDEF)
continue;
else if (isym.st_shndx == SHN_ABS)
@@ -5528,6 +5529,7 @@ const struct elf_size_info alpha_elf_siz
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
bfd_elf64_write_relocs,
+ bfd_elf64_swap_symbol_in,
bfd_elf64_swap_symbol_out,
bfd_elf64_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.19
diff -u -p -r1.19 elf64-hppa.c
--- bfd/elf64-hppa.c 4 Jun 2002 00:51:07 -0000 1.19
+++ bfd/elf64-hppa.c 5 Jun 2002 13:15:31 -0000
@@ -682,7 +682,8 @@ elf64_hppa_check_relocs (abfd, info, sec
i < symtab_hdr->sh_info;
i++, esym++, isym++, shndx = (shndx != NULL ? shndx + 1 : NULL))
{
- bfd_elf64_swap_symbol_in (abfd, esym, shndx, isym);
+ bfd_elf64_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, isym);
if (isym->st_shndx > highest_shndx)
highest_shndx = isym->st_shndx;
}
@@ -2673,6 +2674,7 @@ const struct elf_size_info hppa64_elf_si
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
bfd_elf64_write_relocs,
+ bfd_elf64_swap_symbol_in,
bfd_elf64_swap_symbol_out,
bfd_elf64_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
Index: bfd/elf64-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mips.c,v
retrieving revision 1.31
diff -u -p -r1.31 elf64-mips.c
--- bfd/elf64-mips.c 5 Jun 2002 10:31:46 -0000 1.31
+++ bfd/elf64-mips.c 5 Jun 2002 13:15:33 -0000
@@ -2666,6 +2666,7 @@ const struct elf_size_info mips_elf64_si
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
mips_elf64_write_relocs,
+ bfd_elf64_swap_symbol_in,
bfd_elf64_swap_symbol_out,
mips_elf64_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.12
diff -u -p -r1.12 elf64-mmix.c
--- bfd/elf64-mmix.c 3 Jun 2002 01:57:09 -0000 1.12
+++ bfd/elf64-mmix.c 5 Jun 2002 13:15:35 -0000
@@ -2419,7 +2419,8 @@ mmix_elf_relax_section (abfd, sec, link_
esym = extsyms + ELF64_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf
? ELF64_R_SYM (irel->r_info) : 0);
- bfd_elf64_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elf64_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx == SHN_UNDEF)
sym_sec = bfd_und_section_ptr;
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.49
diff -u -p -r1.49 elf64-ppc.c
--- bfd/elf64-ppc.c 4 Jun 2002 00:51:07 -0000 1.49
+++ bfd/elf64-ppc.c 5 Jun 2002 13:15:39 -0000
@@ -4594,7 +4594,8 @@ get_local_syms (input_bfd, htab)
isym = local_syms, shndx = shndx_buf;
esym < end_sy;
esym++, isym++, shndx = (shndx ? shndx + 1 : NULL))
- bfd_elf64_swap_symbol_in (input_bfd, esym, shndx, isym);
+ bfd_elf64_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, isym);
/* Now we can free the external symbols. */
free (shndx_buf);
Index: bfd/elf64-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-s390.c,v
retrieving revision 1.25
diff -u -p -r1.25 elf64-s390.c
--- bfd/elf64-s390.c 3 Jun 2002 01:57:09 -0000 1.25
+++ bfd/elf64-s390.c 5 Jun 2002 13:15:41 -0000
@@ -2339,6 +2339,7 @@ const struct elf_size_info s390_elf64_si
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
bfd_elf64_write_relocs,
+ bfd_elf64_swap_symbol_in,
bfd_elf64_swap_symbol_out,
bfd_elf64_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
Index: bfd/elf64-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sh64.c,v
retrieving revision 1.9
diff -u -p -r1.9 elf64-sh64.c
--- bfd/elf64-sh64.c 4 Jun 2002 05:28:52 -0000 1.9
+++ bfd/elf64-sh64.c 5 Jun 2002 13:15:43 -0000
@@ -2234,7 +2234,8 @@ sh_elf64_get_relocated_section_contents
{
asection *isec;
- bfd_elf64_swap_symbol_in (input_bfd, esym, shndx, isymp);
+ bfd_elf64_swap_symbol_in (input_bfd, (const PTR *) esym,
+ (const PTR *) shndx, isymp);
if (isymp->st_shndx == SHN_UNDEF)
isec = bfd_und_section_ptr;
Index: bfd/elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.53
diff -u -p -r1.53 elf64-sparc.c
--- bfd/elf64-sparc.c 16 Apr 2002 04:58:12 -0000 1.53
+++ bfd/elf64-sparc.c 5 Jun 2002 13:15:47 -0000
@@ -3067,6 +3067,7 @@ const struct elf_size_info sparc64_elf_s
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
sparc64_elf_write_relocs,
+ bfd_elf64_swap_symbol_in,
bfd_elf64_swap_symbol_out,
sparc64_elf_slurp_reloc_table,
bfd_elf64_slurp_symbol_table,
Index: bfd/elfcode.h
===================================================================
RCS file: /cvs/src/src/bfd/elfcode.h,v
retrieving revision 1.28
diff -u -p -r1.28 elfcode.h
--- bfd/elfcode.h 19 Dec 2001 23:54:26 -0000 1.28
+++ bfd/elfcode.h 5 Jun 2002 13:15:48 -0000
@@ -1,6 +1,6 @@
/* ELF executable support for BFD.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001 Free Software Foundation, Inc.
+ 2001, 2002 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -203,12 +203,14 @@ static char *elf_symbol_flags PARAMS ((f
format. */
void
-elf_swap_symbol_in (abfd, src, shndx, dst)
+elf_swap_symbol_in (abfd, psrc, pshn, dst)
bfd *abfd;
- const Elf_External_Sym *src;
- const Elf_External_Sym_Shndx *shndx;
+ const PTR *psrc;
+ const PTR *pshn;
Elf_Internal_Sym *dst;
{
+ const Elf_External_Sym *src = (const Elf_External_Sym *) psrc;
+ const Elf_External_Sym_Shndx *shndx = (const Elf_External_Sym_Shndx *) pshn;
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
dst->st_name = H_GET_32 (abfd, src->st_name);
@@ -1242,8 +1244,9 @@ elf_slurp_symbol_table (abfd, symptrs, d
/* Skip first symbol, which is a null dummy. */
for (i = 1; i < symcount; i++)
{
- elf_swap_symbol_in (abfd, x_symp + i,
- x_shndx + (x_shndx != NULL ? i : 0), &i_sym);
+ elf_swap_symbol_in (abfd, (const PTR *) (x_symp + i),
+ (const PTR *) (x_shndx + (x_shndx ? i : 0)),
+ &i_sym);
memcpy (&sym->internal_elf_sym, &i_sym, sizeof (Elf_Internal_Sym));
#ifdef ELF_KEEP_EXTSYM
memcpy (&sym->native_elf_sym, x_symp + i, sizeof (Elf_External_Sym));
@@ -1695,6 +1698,7 @@ const struct elf_size_info NAME(_bfd_elf
elf_write_out_phdrs,
elf_write_shdrs_and_ehdr,
elf_write_relocs,
+ elf_swap_symbol_in,
elf_swap_symbol_out,
elf_slurp_reloc_table,
elf_slurp_symbol_table,
Index: bfd/elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.162
diff -u -p -r1.162 elflink.h
--- bfd/elflink.h 23 May 2002 13:12:46 -0000 1.162
+++ bfd/elflink.h 5 Jun 2002 13:15:56 -0000
@@ -237,7 +237,7 @@ elf_link_is_defined_archive_symbol (abfd
Elf_Internal_Sym sym;
const char * name;
- elf_swap_symbol_in (abfd, esym, shndx, &sym);
+ elf_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx, &sym);
name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, sym.st_name);
if (name == (const char *) NULL)
@@ -1666,7 +1666,7 @@ elf_link_add_object_symbols (abfd, info)
override = false;
- elf_swap_symbol_in (abfd, esym, shndx, &sym);
+ elf_swap_symbol_in (abfd, (const PTR *) esym, (const PTR *) shndx, &sym);
flags = BSF_NO_FLAGS;
sec = NULL;
@@ -2556,7 +2556,8 @@ elf_link_record_local_dynamic_symbol (in
|| bfd_bread ((PTR) shndx, amt, input_bfd) != amt)
return false;
}
- elf_swap_symbol_in (input_bfd, &esym, shndx, &entry->isym);
+ elf_swap_symbol_in (input_bfd, (const PTR *) &esym, (const PTR *) shndx,
+ &entry->isym);
name = (bfd_elf_string_from_elf_section
(input_bfd, elf_tdata (input_bfd)->symtab_hdr.sh_link,
@@ -6521,7 +6522,8 @@ elf_link_input_bfd (finfo, input_bfd)
const char *name;
Elf_Internal_Sym osym;
- elf_swap_symbol_in (input_bfd, esym, shndx, isym);
+ elf_swap_symbol_in (input_bfd, (const PTR *) esym, (const PTR *) shndx,
+ isym);
*pindex = -1;
if (elf_bad_symtab (input_bfd))
@@ -7660,6 +7662,7 @@ elf_gc_mark (info, sec, gc_mark_hook)
asection *rsec;
struct elf_link_hash_entry *h;
Elf_Internal_Sym s;
+ Elf_External_Sym_Shndx *locshndx;
r_symndx = ELF_R_SYM (rel->r_info);
if (r_symndx == 0)
@@ -7667,9 +7670,10 @@ elf_gc_mark (info, sec, gc_mark_hook)
if (elf_bad_symtab (sec->owner))
{
+ locshndx = locsym_shndx + (locsym_shndx ? r_symndx : 0);
elf_swap_symbol_in (input_bfd,
- locsyms + r_symndx,
- locsym_shndx + (locsym_shndx ? r_symndx : 0),
+ (const PTR *) (locsyms + r_symndx),
+ (const PTR *) locshndx,
&s);
if (ELF_ST_BIND (s.st_info) == STB_LOCAL)
rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s);
@@ -7686,9 +7690,10 @@ elf_gc_mark (info, sec, gc_mark_hook)
}
else
{
+ locshndx = locsym_shndx + (locsym_shndx ? r_symndx : 0);
elf_swap_symbol_in (input_bfd,
- locsyms + r_symndx,
- locsym_shndx + (locsym_shndx ? r_symndx : 0),
+ (const PTR *) (locsyms + r_symndx),
+ (const PTR *) locshndx,
&s);
rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s);
}
@@ -8282,7 +8287,8 @@ elf_reloc_symbol_deleted_p (offset, cook
lshndx = (Elf_External_Sym_Shndx *) rcookie->locsym_shndx;
if (lshndx != NULL)
lshndx += r_symndx;
- elf_swap_symbol_in (rcookie->abfd, lsym, lshndx, &isym);
+ elf_swap_symbol_in (rcookie->abfd, (const PTR *) lsym,
+ (const PTR *) lshndx, &isym);
}
if (r_symndx >= rcookie->locsymcount
Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.49
diff -u -p -r1.49 elfxx-ia64.c
--- bfd/elfxx-ia64.c 4 Jun 2002 00:51:07 -0000 1.49
+++ bfd/elfxx-ia64.c 5 Jun 2002 13:15:59 -0000
@@ -812,7 +812,8 @@ elfNN_ia64_relax_section (abfd, sec, lin
/* A local symbol. */
esym = extsyms + ELFNN_R_SYM (irel->r_info);
shndx = shndx_buf + (shndx_buf ? ELFNN_R_SYM (irel->r_info) : 0);
- bfd_elfNN_swap_symbol_in (abfd, esym, shndx, &isym);
+ bfd_elfNN_swap_symbol_in (abfd, (const PTR *) esym,
+ (const PTR *) shndx, &isym);
if (isym.st_shndx == SHN_UNDEF)
continue; /* We can't do anthing with undefined symbols. */
else if (isym.st_shndx == SHN_ABS)
--
Alan Modra
IBM OzLabs - Linux Technology Centre