of _xcoff_swap_ld*.
* coff-rs6000.c (xcoff_swap_ldhdr_in): Modify type of external
param to agree with libxcoff.h.
(xcoff_swap_ldhdr_out): Likewise.
(xcoff_swap_ldsym_in): Likewise.
(xcoff_swap_ldsym_out): Likewise.
(xcoff_swap_ldrel_in): Likewise.
(xcoff_swap_ldrel_out): Likewise.
(xcoff_create_csect_from_smclas): Likewise.
* coff64-rs6000.c: Add missing prototypes.
(xcoff64_swap_ldhdr_in): Modify type of external param to agree
with libxcoff.h.
(xcoff64_swap_ldhdr_out): Likewise.
(xcoff64_swap_ldsym_in): Likewise.
(xcoff64_swap_ldsym_out): Likewise.
(xcoff64_swap_ldrel_in): Likewise.
(xcoff64_swap_ldrel_out): Likewise.
(xcoff64_ppc_relocate_section): Make static.
(xcoff64_slurp_armap): Likewise.
(xcoff64_archive_p): Likewise.
(xcoff64_openr_next_archived_file): Likewise.
(xcoff64_sizeof_headers): Likewise.
(xcoff64_is_lineno_count_overflow): Likewise.
(xcoff64_is_reloc_count_overflow): Likewise.
(xcoff64_loader_symbol_offset): Likewise.
(xcoff64_loader_reloc_offset): Likewise.
* elf64-gen.c: Add missing prototypes.
+2001-08-10 Alan Modra <amodra@bigpond.net.au>
+
+ * libxcoff.h (struct xcoff_backend_data_rec): Constify src param
+ of _xcoff_swap_ld*.
+ * coff-rs6000.c (xcoff_swap_ldhdr_in): Modify type of external
+ param to agree with libxcoff.h.
+ (xcoff_swap_ldhdr_out): Likewise.
+ (xcoff_swap_ldsym_in): Likewise.
+ (xcoff_swap_ldsym_out): Likewise.
+ (xcoff_swap_ldrel_in): Likewise.
+ (xcoff_swap_ldrel_out): Likewise.
+ (xcoff_create_csect_from_smclas): Likewise.
+ * coff64-rs6000.c: Add missing prototypes.
+ (xcoff64_swap_ldhdr_in): Modify type of external param to agree
+ with libxcoff.h.
+ (xcoff64_swap_ldhdr_out): Likewise.
+ (xcoff64_swap_ldsym_in): Likewise.
+ (xcoff64_swap_ldsym_out): Likewise.
+ (xcoff64_swap_ldrel_in): Likewise.
+ (xcoff64_swap_ldrel_out): Likewise.
+ (xcoff64_ppc_relocate_section): Make static.
+ (xcoff64_slurp_armap): Likewise.
+ (xcoff64_archive_p): Likewise.
+ (xcoff64_openr_next_archived_file): Likewise.
+ (xcoff64_sizeof_headers): Likewise.
+ (xcoff64_is_lineno_count_overflow): Likewise.
+ (xcoff64_is_reloc_count_overflow): Likewise.
+ (xcoff64_loader_symbol_offset): Likewise.
+ (xcoff64_loader_reloc_offset): Likewise.
+ * elf64-gen.c: Add missing prototypes.
+
2001-08-09 H.J. Lu <hjl@gnu.org>
* elf.c (bfd_elf_sprintf_vma): Check ELFCLASS64 only in BFD64.
static boolean xcoff_write_archive_contents_old PARAMS ((bfd *));
static boolean xcoff_write_archive_contents_big PARAMS ((bfd *));
static void xcoff_swap_ldhdr_in
- PARAMS ((bfd *, const struct external_ldhdr *, struct internal_ldhdr *));
+ PARAMS ((bfd *, const PTR, struct internal_ldhdr *));
static void xcoff_swap_ldhdr_out
- PARAMS ((bfd *, const struct internal_ldhdr *, struct external_ldhdr *));
+ PARAMS ((bfd *, const struct internal_ldhdr *, PTR));
static void xcoff_swap_ldsym_in
- PARAMS ((bfd *, const struct external_ldsym *, struct internal_ldsym *));
+ PARAMS ((bfd *, const PTR, struct internal_ldsym *));
static void xcoff_swap_ldsym_out
- PARAMS ((bfd *, const struct internal_ldsym *, struct external_ldsym *));
+ PARAMS ((bfd *, const struct internal_ldsym *, PTR));
static void xcoff_swap_ldrel_in
- PARAMS ((bfd *, const struct external_ldrel *, struct internal_ldrel *));
+ PARAMS ((bfd *, const PTR, struct internal_ldrel *));
static void xcoff_swap_ldrel_out
- PARAMS ((bfd *, const struct internal_ldrel *, struct external_ldrel *));
+ PARAMS ((bfd *, const struct internal_ldrel *, PTR));
static boolean xcoff_ppc_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **));
PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *,
const char *));
static asection *xcoff_create_csect_from_smclas
- PARAMS ((bfd *, union internal_auxent *, char *));
+ PARAMS ((bfd *, union internal_auxent *, const char *));
static boolean xcoff_is_lineno_count_overflow PARAMS ((bfd *, bfd_vma));
static boolean xcoff_is_reloc_count_overflow PARAMS ((bfd *, bfd_vma));
static bfd_vma xcoff_loader_symbol_offset
/* Swap in the ldhdr structure. */
static void
-xcoff_swap_ldhdr_in (abfd, src, dst)
+xcoff_swap_ldhdr_in (abfd, s, dst)
bfd *abfd;
- const struct external_ldhdr *src;
+ const PTR s;
struct internal_ldhdr *dst;
{
+ const struct external_ldhdr *src = (const struct external_ldhdr *) s;
+
dst->l_version = bfd_get_32 (abfd, src->l_version);
dst->l_nsyms = bfd_get_32 (abfd, src->l_nsyms);
dst->l_nreloc = bfd_get_32 (abfd, src->l_nreloc);
/* Swap out the ldhdr structure. */
static void
-xcoff_swap_ldhdr_out (abfd, src, dst)
+xcoff_swap_ldhdr_out (abfd, src, d)
bfd *abfd;
const struct internal_ldhdr *src;
- struct external_ldhdr *dst;
+ PTR d;
{
+ struct external_ldhdr *dst = (struct external_ldhdr *) d;
+
bfd_put_32 (abfd, src->l_version, dst->l_version);
bfd_put_32 (abfd, src->l_nsyms, dst->l_nsyms);
bfd_put_32 (abfd, src->l_nreloc, dst->l_nreloc);
/* Swap in the ldsym structure. */
static void
-xcoff_swap_ldsym_in (abfd, src, dst)
+xcoff_swap_ldsym_in (abfd, s, dst)
bfd *abfd;
- const struct external_ldsym *src;
+ const PTR s;
struct internal_ldsym *dst;
{
+ const struct external_ldsym *src = (const struct external_ldsym *) s;
+
if (bfd_get_32 (abfd, src->_l._l_l._l_zeroes) != 0) {
memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN);
} else {
/* Swap out the ldsym structure. */
static void
-xcoff_swap_ldsym_out (abfd, src, dst)
+xcoff_swap_ldsym_out (abfd, src, d)
bfd *abfd;
const struct internal_ldsym *src;
- struct external_ldsym *dst;
+ PTR d;
{
+ struct external_ldsym *dst = (struct external_ldsym *) d;
if (src->_l._l_l._l_zeroes != 0)
memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN);
/* Swap in the ldrel structure. */
static void
-xcoff_swap_ldrel_in (abfd, src, dst)
+xcoff_swap_ldrel_in (abfd, s, dst)
bfd *abfd;
- const struct external_ldrel *src;
+ const PTR s;
struct internal_ldrel *dst;
{
+ const struct external_ldrel *src = (const struct external_ldrel *) s;
+
dst->l_vaddr = bfd_get_32 (abfd, src->l_vaddr);
dst->l_symndx = bfd_get_32 (abfd, src->l_symndx);
dst->l_rtype = bfd_get_16 (abfd, src->l_rtype);
/* Swap out the ldrel structure. */
static void
-xcoff_swap_ldrel_out (abfd, src, dst)
+xcoff_swap_ldrel_out (abfd, src, d)
bfd *abfd;
const struct internal_ldrel *src;
- struct external_ldrel *dst;
+ PTR d;
{
+ struct external_ldrel *dst = (struct external_ldrel *) d;
+
bfd_put_32 (abfd, src->l_vaddr, dst->l_vaddr);
bfd_put_32 (abfd, src->l_symndx, dst->l_symndx);
bfd_put_16 (abfd, src->l_rtype, dst->l_rtype);
xcoff_create_csect_from_smclas (abfd, aux, symbol_name)
bfd *abfd;
union internal_auxent *aux;
- char *symbol_name;
+ const char *symbol_name;
{
asection *return_value = NULL;
#define GETBYTE bfd_h_get_8
+static void _bfd_xcoff64_swap_lineno_in PARAMS ((bfd *, PTR, PTR));
+static unsigned int _bfd_xcoff64_swap_lineno_out PARAMS ((bfd *, PTR, PTR));
+static boolean _bfd_xcoff64_put_ldsymbol_name
+ PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *,
+ const char *));
+
/* For XCOFF64, the effective width of symndx changes depending on
whether we are the first entry. Sigh. */
static void
moved to another file shared by the linker (which XCOFF calls the
``binder'') and the loader. */
+static void xcoff64_swap_ldhdr_in
+ PARAMS ((bfd *, const PTR, struct internal_ldhdr *));
+static void xcoff64_swap_ldhdr_out
+ PARAMS ((bfd *, const struct internal_ldhdr *, PTR d));
+static void xcoff64_swap_ldsym_in
+ PARAMS ((bfd *, const PTR, struct internal_ldsym *));
+static void xcoff64_swap_ldsym_out
+ PARAMS ((bfd *, const struct internal_ldsym *, PTR d));
+static void xcoff64_swap_ldrel_in
+ PARAMS ((bfd *, const PTR, struct internal_ldrel *));
+static void xcoff64_swap_ldrel_out
+ PARAMS ((bfd *, const struct internal_ldrel *, PTR d));
+static boolean xcoff64_write_object_contents PARAMS ((bfd *));
+static boolean xcoff64_ppc_relocate_section
+ PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+ struct internal_reloc *, struct internal_syment *,
+ asection **sections));
+static boolean xcoff64_slurp_armap PARAMS ((bfd *));
+static const bfd_target *xcoff64_archive_p PARAMS ((bfd *));
+static bfd *xcoff64_openr_next_archived_file PARAMS ((bfd *, bfd *));
+static int xcoff64_sizeof_headers PARAMS ((bfd *, boolean));
+static asection *xcoff64_create_csect_from_smclas
+ PARAMS ((bfd *, union internal_auxent *, const char *));
+static boolean xcoff64_is_lineno_count_overflow PARAMS ((bfd *, bfd_vma));
+static boolean xcoff64_is_reloc_count_overflow PARAMS ((bfd *, bfd_vma));
+static bfd_vma xcoff64_loader_symbol_offset
+ PARAMS ((bfd *, struct internal_ldhdr *));
+static bfd_vma xcoff64_loader_reloc_offset
+ PARAMS ((bfd *, struct internal_ldhdr *));
+
/* Swap in the ldhdr structure. */
static void
-xcoff64_swap_ldhdr_in (abfd, src, dst)
- bfd *abfd;
- const struct external_ldhdr *src;
- struct internal_ldhdr *dst;
- {
+xcoff64_swap_ldhdr_in (abfd, s, dst)
+ bfd *abfd;
+ const PTR s;
+ struct internal_ldhdr *dst;
+{
+ const struct external_ldhdr *src = (const struct external_ldhdr *) s;
+
dst->l_version = bfd_get_32 (abfd, src->l_version);
dst->l_nsyms = bfd_get_32 (abfd, src->l_nsyms);
dst->l_nreloc = bfd_get_32 (abfd, src->l_nreloc);
/* Swap out the ldhdr structure. */
static void
-xcoff64_swap_ldhdr_out (abfd, src, dst)
+xcoff64_swap_ldhdr_out (abfd, src, d)
bfd *abfd;
const struct internal_ldhdr *src;
- struct external_ldhdr *dst;
+ PTR d;
{
+ struct external_ldhdr *dst = (struct external_ldhdr *) d;
+
bfd_put_32 (abfd, src->l_version, dst->l_version);
bfd_put_32 (abfd, src->l_nsyms, dst->l_nsyms);
bfd_put_32 (abfd, src->l_nreloc, dst->l_nreloc);
/* Swap in the ldsym structure. */
static void
-xcoff64_swap_ldsym_in (abfd, src, dst)
+xcoff64_swap_ldsym_in (abfd, s, dst)
bfd *abfd;
- const struct external_ldsym *src;
+ const PTR s;
struct internal_ldsym *dst;
{
+ const struct external_ldsym *src = (const struct external_ldsym *) s;
/*
* XCOFF64 does not use l_zeroes like XCOFF32
* Set the internal l_zeroes to 0 so the common 32/64 code uses l_value
/* Swap out the ldsym structure. */
static void
-xcoff64_swap_ldsym_out (abfd, src, dst)
+xcoff64_swap_ldsym_out (abfd, src, d)
bfd *abfd;
const struct internal_ldsym *src;
- struct external_ldsym *dst;
+ PTR d;
{
+ struct external_ldsym *dst = (struct external_ldsym *) d;
+
bfd_put_64 (abfd, src->l_value, dst->l_value);
bfd_put_32 (abfd, src->_l._l_l._l_offset, dst->l_offset);
bfd_put_16 (abfd, src->l_scnum, dst->l_scnum);
/* Swap in the ldrel structure. */
static void
-xcoff64_swap_ldrel_in (abfd, src, dst)
+xcoff64_swap_ldrel_in (abfd, s, dst)
bfd *abfd;
- const struct external_ldrel *src;
+ const PTR s;
struct internal_ldrel *dst;
{
+ const struct external_ldrel *src = (const struct external_ldrel *) s;
+
dst->l_vaddr = bfd_get_64 (abfd, src->l_vaddr);
dst->l_symndx = bfd_get_32 (abfd, src->l_symndx);
dst->l_rtype = bfd_get_16 (abfd, src->l_rtype);
/* Swap out the ldrel structure. */
static void
-xcoff64_swap_ldrel_out (abfd, src, dst)
+xcoff64_swap_ldrel_out (abfd, src, d)
bfd *abfd;
const struct internal_ldrel *src;
- struct external_ldrel *dst;
+ PTR d;
{
+ struct external_ldrel *dst = (struct external_ldrel *) d;
+
bfd_put_64 (abfd, src->l_vaddr, dst->l_vaddr);
bfd_put_16 (abfd, src->l_rtype, dst->l_rtype);
bfd_put_16 (abfd, src->l_rsecnm, dst->l_rsecnm);
This is currently the only processor which uses XCOFF; I hope that
will never change. */
-boolean
+static boolean
xcoff64_ppc_relocate_section (output_bfd, info, input_bfd,
input_section, contents, relocs, syms,
sections)
/* Read in the armap of an XCOFF archive. */
-boolean
+static boolean
xcoff64_slurp_armap (abfd)
bfd *abfd;
{
/* See if this is an NEW XCOFF archive. */
-const bfd_target *
+static const bfd_target *
xcoff64_archive_p (abfd)
bfd *abfd;
{
/* Open the next element in an XCOFF archive. */
-bfd *
+static bfd *
xcoff64_openr_next_archived_file (archive, last_file)
bfd *archive;
bfd *last_file;
always uses an a.out header. */
/*ARGSUSED*/
-int
+static int
xcoff64_sizeof_headers (abfd, reloc)
bfd *abfd;
boolean reloc ATTRIBUTE_UNUSED;
return return_value;
}
-boolean
+static boolean
xcoff64_is_lineno_count_overflow (abfd, value)
bfd *abfd ATTRIBUTE_UNUSED;
bfd_vma value ATTRIBUTE_UNUSED;
return false;
}
-boolean
+static boolean
xcoff64_is_reloc_count_overflow (abfd, value)
bfd *abfd ATTRIBUTE_UNUSED;
bfd_vma value ATTRIBUTE_UNUSED;
return false;
}
-bfd_vma
+static bfd_vma
xcoff64_loader_symbol_offset (abfd, ldhdr)
bfd *abfd ATTRIBUTE_UNUSED;
struct internal_ldhdr *ldhdr;
return (ldhdr->l_symoff);
}
-bfd_vma
+static bfd_vma
xcoff64_loader_reloc_offset (abfd, ldhdr)
bfd *abfd ATTRIBUTE_UNUSED;
struct internal_ldhdr *ldhdr;
/* back end data */
(void *) &bfd_xcoff_backend_data,
};
-
-
0, /* dst_mask */
false); /* pcrel_offset */
+static void elf_generic_info_to_howto
+ PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *));
+static void elf_generic_info_to_howto_rel
+ PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *));
+static boolean elf64_generic_link_add_symbols
+ PARAMS ((bfd *, struct bfd_link_info *));
+
static void
elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED;
long _xcoff_machine;
/* function pointers to xcoff specific swap routines */
- void (* _xcoff_swap_ldhdr_in)(bfd *, PTR, struct internal_ldhdr *);
- void (* _xcoff_swap_ldhdr_out)(bfd *, struct internal_ldhdr *, PTR);
- void (* _xcoff_swap_ldsym_in)(bfd *, PTR, struct internal_ldsym *);
- void (* _xcoff_swap_ldsym_out)(bfd *, struct internal_ldsym *, PTR);
- void (* _xcoff_swap_ldrel_in)(bfd *, PTR, struct internal_ldrel *);
- void (* _xcoff_swap_ldrel_out)(bfd *, struct internal_ldrel *, PTR);
+ void (* _xcoff_swap_ldhdr_in)(bfd *, const PTR, struct internal_ldhdr *);
+ void (* _xcoff_swap_ldhdr_out)(bfd *, const struct internal_ldhdr *, PTR);
+ void (* _xcoff_swap_ldsym_in)(bfd *, const PTR, struct internal_ldsym *);
+ void (* _xcoff_swap_ldsym_out)(bfd *, const struct internal_ldsym *, PTR);
+ void (* _xcoff_swap_ldrel_in)(bfd *, const PTR, struct internal_ldrel *);
+ void (* _xcoff_swap_ldrel_out)(bfd *, const struct internal_ldrel *, PTR);
/* size of the the external struct */
unsigned int _xcoff_ldhdrsz;