Add AIX 64 shared library support and emulation layer for binutils

This commit is contained in:
Nick Clifton 2002-03-18 12:46:27 +00:00
parent a1c259a138
commit eb1e0e807a
49 changed files with 2388 additions and 1013 deletions

View File

@ -1,3 +1,37 @@
2002-03-18 Tom Rix <trix@redhat.com>
* aix5ppc.core.c : New file for AIX 5 64 bit core support.
* bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration.
* coff-rs6000 (do_pad) : New function for archive padding.
(do_copy) : New function for object file copying in archives.
(do_shared_object_padding) : New function for padding shared
objects to their text section alignment in archives.
(bfd_xcoff_ar_achive_set_magic) : Stub.
(xcoff_write_armap_big) : Use do_copy and do_pad.
(xcoff_write_archive_contents_big) : Use do_shared_object_padding,
do_copy and do_pad.
* coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use
bfd_xcoff_magic_number.
(xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook
fop.
(xcoff_backend_data_r) : Use xcoff64_bad_format_hook.
(bfd_xcoff_aix5_backend_data) : New Aix 5 backend data.
(aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000.
* rs6000-core.c : Update copyright date.
* xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL
csectpp.
* coffcode.h (coff_new_section_hook) : Use new accessor macros.
(coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #.
(coff_set_flags) : Use bfd_xcoff_magic_number.
* libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC.
* configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support.
* Makefile.am : Same.
* config.bfd : Same.
* targets.c : Same.
* configure : Regnerate.
* Makefile.in : Same.
* bfd-in2.h : Same.
2002-03-18 Nick Clifton <nickc@cambridge.redhat.com>
* po/fr.po: Updated version.

View File

@ -441,6 +441,7 @@ BFD32_BACKENDS_CFILES = \
# target_vector in targets.c if configured with --enable-targets=all
# and --enable-64-bit-bfd.
BFD64_BACKENDS = \
aix5ppc-core.lo \
aout64.lo \
coff-alpha.lo \
coff64-rs6000.lo \
@ -464,6 +465,7 @@ BFD64_BACKENDS = \
pepigen.lo
BFD64_BACKENDS_CFILES = \
aix5ppc-core.c \
aout64.c \
coff-alpha.c \
coff64-rs6000.c \
@ -1139,11 +1141,6 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
@ -1160,6 +1157,11 @@ elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
@ -1367,6 +1369,8 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \
libxcoff.h
aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/xcoff.h libcoff.h libxcoff.h
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h

View File

@ -571,6 +571,7 @@ BFD32_BACKENDS_CFILES = \
# target_vector in targets.c if configured with --enable-targets=all
# and --enable-64-bit-bfd.
BFD64_BACKENDS = \
aix5ppc-core.lo \
aout64.lo \
coff-alpha.lo \
coff64-rs6000.lo \
@ -595,6 +596,7 @@ BFD64_BACKENDS = \
BFD64_BACKENDS_CFILES = \
aix5ppc-core.c \
aout64.c \
coff-alpha.c \
coff64-rs6000.c \
@ -750,7 +752,7 @@ configure.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@ -1683,11 +1685,6 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
@ -1704,6 +1701,11 @@ elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
$(INCDIR)/elf/reloc-macros.h elf32-target.h
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
$(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
@ -1911,6 +1913,8 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \
libxcoff.h
aix5ppc-core.lo: aix5ppc-core.c $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/xcoff.h libcoff.h libxcoff.h
aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
$(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h

359
bfd/aix5ppc-core.c Normal file
View File

@ -0,0 +1,359 @@
/* IBM RS/6000 "XCOFF" back-end for BFD.
Copyright 2001, 2002
Free Software Foundation, Inc.
Written by Tom Rix
Contributed by Redhat.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#include "bfd.h"
#ifdef AIX_5_CORE
#include "sysdep.h"
#include "libbfd.h"
const bfd_target * xcoff64_core_p PARAMS ((bfd *));
boolean xcoff64_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
char * xcoff64_core_file_failing_command PARAMS ((bfd *));
int xcoff64_core_file_failing_signal PARAMS ((bfd *));
/* Aix 5.1 system include file. */
/* Need to define this macro so struct ld_info64 get included. */
#define __LDINFO_PTRACE64__
#include <sys/ldr.h>
#include <core.h>
#define core_hdr(abfd) ((struct core_dumpxx *) abfd->tdata.any)
#define CHECK_FILE_OFFSET(s, v) \
((bfd_signed_vma)(v) < 0 || (bfd_signed_vma)(v) > (bfd_signed_vma)(s).st_size)
const bfd_target *
xcoff64_core_p (abfd)
bfd *abfd;
{
struct core_dumpxx core, *new_core_hdr;
struct stat statbuf;
asection *sec;
struct __ld_info64 ldinfo;
bfd_vma ld_offset;
bfd_size_type i;
struct vm_infox vminfo;
bfd_target *return_value = NULL;
/* Get the header. */
if (bfd_seek (abfd, 0, SEEK_SET) != 0)
goto xcoff64_core_p_error;
if (sizeof (struct core_dumpxx)
!= bfd_read (&core, sizeof (struct core_dumpxx), 1, abfd))
goto xcoff64_core_p_error;
if (bfd_stat (abfd, &statbuf) < 0)
goto xcoff64_core_p_error;
/* Sanity checks
c_flag has CORE_VERSION_1, Aix 4+
c_entries = 0 for Aix 4.3+
IS_PROC64 is a macro defined in procinfo.h, test for 64 bit process.
We will still be confused if a Aix 4.3 64 bit core file is
copied over to a Aix 5 machine.
Check file header offsets
See rs6000-core.c for comment on size of core
If there isn't enough of a real core file, bail. */
if ((CORE_VERSION_1 != (core.c_flag & CORE_VERSION_1))
|| (0 != core.c_entries)
|| (! (IS_PROC64 (&core.c_u.U_proc)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_fdsinfox)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader + core.c_lsize)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_thr)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_segregion)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack + core.c_size)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data + core.c_datasize)))
|| (! (core.c_flag & UBLOCK_VALID))
|| (! (core.c_flag & LE_VALID)))
goto xcoff64_core_p_error;
/* Check for trucated stack or general truncating. */
if ((! (core.c_flag & USTACK_VALID))
|| (core.c_flag & CORE_TRUNC))
{
bfd_set_error (bfd_error_file_truncated);
return return_value;
}
new_core_hdr = (struct core_dumpxx *)
bfd_zalloc (abfd, sizeof (struct core_dumpxx));
if (NULL == new_core_hdr)
return return_value;
memcpy (new_core_hdr, &core, sizeof (struct core_dumpxx));
core_hdr(abfd) = (char *)new_core_hdr;
/* .stack section. */
sec = bfd_make_section_anyway (abfd, ".stack");
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
sec->_raw_size = core.c_size;
sec->vma = core.c_stackorg;
sec->filepos = core.c_stack;
/* .reg section for all registers. */
sec = bfd_make_section_anyway (abfd, ".reg");
if (NULL == sec)
return return_value;
sec->flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY;
sec->_raw_size = sizeof (struct __context64);
sec->vma = 0;
sec->filepos = 0;
sec->contents = (bfd_byte *)&new_core_hdr->c_flt.r64;
/* .ldinfo section.
To actually find out how long this section is in this particular
core dump would require going down the whole list of struct
ld_info's. See if we can just fake it. */
sec = bfd_make_section_anyway (abfd, ".ldinfo");
if (NULL == sec)
return return_value;
sec->flags = SEC_HAS_CONTENTS;
sec->_raw_size = core.c_lsize;
sec->vma = 0;
sec->filepos = core.c_loader;
/* AIX 4 adds data sections from loaded objects to the core file,
which can be found by examining ldinfo, and anonymously mmapped
regions. */
/* .data section from executable. */
sec = bfd_make_section_anyway (abfd, ".data");
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
sec->_raw_size = core.c_datasize;
sec->vma = core.c_dataorg;
sec->filepos = core.c_data;
/* .data sections from loaded objects. */
ld_offset = core.c_loader;
while (1)
{
if (bfd_seek (abfd, ld_offset, SEEK_SET) != 0)
return return_value;
if (sizeof (struct __ld_info64) !=
bfd_read (&ldinfo, sizeof (struct __ld_info64), 1, abfd))
return return_value;
if (ldinfo.ldinfo_core)
{
sec = bfd_make_section_anyway (abfd, ".data");
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
sec->_raw_size = ldinfo.ldinfo_datasize;
sec->vma = ldinfo.ldinfo_dataorg;
sec->filepos = ldinfo.ldinfo_core;
}
if (0 == ldinfo.ldinfo_next)
break;
ld_offset += ldinfo.ldinfo_next;
}
/* .vmdata sections from anonymously mmapped regions. */
if (core.c_vmregions)
{
if (bfd_seek (abfd, core.c_vmm, SEEK_SET) != 0)
return return_value;
for (i = 0; i < core.c_vmregions; i++)
if (sizeof (struct vm_infox) !=
bfd_read (&vminfo, sizeof (struct vm_infox), 1, abfd))
return return_value;
if (vminfo.vminfo_offset)
{
sec = bfd_make_section_anyway (abfd, ".vmdata");
if (NULL == sec)
return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
sec->_raw_size = vminfo.vminfo_size;
sec->vma = vminfo.vminfo_addr;
sec->filepos = vminfo.vminfo_offset;
}
}
return_value = abfd->xvec; /* This is garbage for now. */
xcoff64_core_p_error:
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
return return_value;
}
/* Return `true' if given core is from the given executable. */
boolean
xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
{
struct core_dumpxx core;
char *path, *s;
size_t alloc;
const char *str1, *str2;
boolean return_value = false;
/* Get the header. */
if (bfd_seek (core_bfd, 0, SEEK_SET) != 0)
return return_value;
if (sizeof (struct core_dumpxx) !=
bfd_read (&core, sizeof (struct core_dumpxx), 1, core_bfd))
return return_value;
if (bfd_seek (core_bfd, core.c_loader, SEEK_SET) != 0)
return return_value;
alloc = 100;
path = bfd_malloc (alloc);
if (path == NULL)
return return_value;
s = path;
while (1)
{
if (bfd_read (s, 1, 1, core_bfd) != 1)
goto xcoff64_core_file_matches_executable_p_end_1;
if (*s == '\0')
break;
++s;
if (s == path + alloc)
{
char *n;
alloc *= 2;
n = bfd_realloc (path, alloc);
if (n == NULL)
goto xcoff64_core_file_matches_executable_p_end_1;
s = n + (path - s);
path = n;
}
}
str1 = strrchr (path, '/');
str2 = strrchr (exec_bfd->filename, '/');
/* Step over character '/'. */
str1 = str1 != NULL ? str1 + 1 : path;
str2 = str2 != NULL ? str2 + 1 : exec_bfd->filename;
if (strcmp (str1, str2) == 0)
return_value = true;
xcoff64_core_file_matches_executable_p_end_1:
free (path);
return return_value;
}
char *
xcoff64_core_file_failing_command (abfd)
bfd *abfd;
{
struct core_dumpxx *c = core_hdr (abfd);
char *return_value = 0;
if (NULL != c)
return_value = c->c_u.U_proc.pi_comm;
return return_value;
}
int
xcoff64_core_file_failing_signal (abfd)
bfd *abfd;
{
struct core_dumpxx *c = core_hdr (abfd);
int return_value = 0;
if (NULL != c)
return_value = c->c_signo;
return return_value;
}
#else /* AIX_5_CORE */
const bfd_target * xcoff64_core_p PARAMS ((bfd *));
boolean xcoff64_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
char * xcoff64_core_file_failing_command PARAMS ((bfd *));
int xcoff64_core_file_failing_signal PARAMS ((bfd *));
const bfd_target *
xcoff64_core_p (abfd)
bfd *abfd;
{
bfd_set_error (bfd_error_wrong_format);
return 0;
}
boolean
xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
{
return false;
}
char *
xcoff64_core_file_failing_command (abfd)
bfd *abfd;
{
return 0;
}
int
xcoff64_core_file_failing_signal (abfd)
bfd *abfd;
{
return 0;
}
#endif /* AIX_5_CORE */

View File

@ -749,6 +749,9 @@ extern boolean bfd_xcoff_size_dynamic_sections
extern boolean bfd_xcoff_link_generate_rtinit
PARAMS ((bfd *, const char *, const char *, boolean));
/* XCOFF support routines for ar. */
extern boolean bfd_xcoff_ar_archive_set_magic PARAMS ((bfd *, char *));
/* Externally visible COFF routines. */
#if defined(__STDC__) || defined(ALMOST_STDC)

View File

@ -145,6 +145,9 @@ static bfd_vma xcoff_loader_reloc_offset
PARAMS ((bfd *, struct internal_ldhdr *));
static boolean xcoff_generate_rtinit
PARAMS((bfd *, const char *, const char *, boolean));
static boolean do_pad PARAMS((bfd *, unsigned int));
static boolean do_copy PARAMS((bfd *, bfd *));
static boolean do_shared_object_padding PARAMS ((bfd *, bfd *, ufile_ptr *, int));
/* We use our own tdata type. Its first field is the COFF tdata type,
so the COFF routines are compatible. */
@ -988,7 +991,17 @@ _bfd_xcoff_reloc_type_lookup (abfd, code)
/* XCOFF archives use this as a magic string. Note that both strings
have the same length. */
/* Set the magic for archive. */
boolean
bfd_xcoff_ar_archive_set_magic (abfd, magic)
bfd *abfd ATTRIBUTE_UNUSED;
char *magic ATTRIBUTE_UNUSED;
{
/* Not supported yet. */
return false;
/* bfd_xcoff_archive_set_magic (abfd, magic); */
}
/* Read in the armap of an XCOFF archive. */
@ -1572,6 +1585,85 @@ static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1];
memcpy (buff20, (d), 20), \
(v) = bfd_scan_vma (buff20, (const char **) NULL, 10)
static boolean
do_pad (abfd, number)
bfd *abfd;
unsigned int number;
{
bfd_byte b = 0;
/* Limit pad to <= 4096. */
if (number > 4096)
return false;
while (number--)
if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1)
return false;
return true;
}
static boolean
do_copy (out_bfd, in_bfd)
bfd *out_bfd;
bfd *in_bfd;
{
bfd_size_type remaining;
bfd_byte buffer[DEFAULT_BUFFERSIZE];
if (bfd_seek (in_bfd, (file_ptr) 0, SEEK_SET) != 0)
return false;
remaining = arelt_size (in_bfd);
while (remaining >= DEFAULT_BUFFERSIZE)
{
if (bfd_bread (buffer, DEFAULT_BUFFERSIZE, in_bfd) != DEFAULT_BUFFERSIZE
|| bfd_bwrite (buffer, DEFAULT_BUFFERSIZE, out_bfd) != DEFAULT_BUFFERSIZE)
return false;
remaining -= DEFAULT_BUFFERSIZE;
}
if (remaining)
{
if (bfd_bread (buffer, remaining, in_bfd) != remaining
|| bfd_bwrite (buffer, remaining, out_bfd) != remaining)
return false;
}
return true;
}
static boolean
do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size)
bfd *out_bfd;
bfd *in_bfd;
ufile_ptr *offset;
int ar_header_size;
{
if (bfd_check_format (in_bfd, bfd_object)
&& bfd_get_flavour (in_bfd) == bfd_target_xcoff_flavour
&& (in_bfd->flags & DYNAMIC) != 0)
{
bfd_size_type pad = 0;
int text_align_power;
text_align_power = bfd_xcoff_text_align_power (in_bfd);
BFD_ASSERT (2 < text_align_power);
pad = 1 << text_align_power;
pad -= (*offset + ar_header_size) & (pad - 1);
if (! do_pad (out_bfd, pad))
return false;
*offset += pad;
}
return true;
}
static boolean
xcoff_write_armap_big (abfd, elength, map, orl_count, stridx)
bfd *abfd;
@ -2001,28 +2093,12 @@ xcoff_write_archive_contents_old (abfd)
if (bfd_seek (sub, (file_ptr) 0, SEEK_SET) != 0)
return false;
while (remaining != 0)
{
bfd_size_type amt;
bfd_byte buffer[DEFAULT_BUFFERSIZE];
amt = sizeof buffer;
if (amt > remaining)
amt = remaining;
if (bfd_bread (buffer, amt, sub) != amt
|| bfd_bwrite (buffer, amt, abfd) != amt)
return false;
remaining -= amt;
}
if ((size & 1) != 0)
{
bfd_byte b;
b = '\0';
if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1)
return false;
}
if (! do_copy (abfd, sub))
return false;
if (! do_pad (abfd, size & 1))
return false;
}
sprintf (fhdr.lastmemoff, "%ld", (long) prevoff);
@ -2089,14 +2165,9 @@ xcoff_write_archive_contents_old (abfd)
if (bfd_bwrite ((PTR) name, namlen + 1, abfd) != namlen + 1)
return false;
}
if ((size & 1) != 0)
{
bfd_byte b;
b = '\0';
if (bfd_bwrite ((PTR) &b, (bfd_size_type) 1, abfd) != 1)
return false;
}
if (! do_pad (abfd, size & 1))
return false;
/* Write out the armap, if appropriate. */
if (! makemap || ! hasobjects)
@ -2143,15 +2214,26 @@ xcoff_write_archive_contents_big (abfd)
bfd_byte *member_table, *mt;
bfd_vma member_table_size;
memset (&fhdr, 0, SIZEOF_AR_FILE_HDR_BIG);
memcpy (fhdr.magic, XCOFFARMAGBIG, SXCOFFARMAG);
PRINT20 (fhdr.firstmemoff, SIZEOF_AR_FILE_HDR_BIG);
PRINT20 (fhdr.freeoff, 0);
/* Calculate count and total_namlen */
if (bfd_seek (abfd, (file_ptr) SIZEOF_AR_FILE_HDR_BIG, SEEK_SET) != 0)
return false;
/* Calculate count and total_namlen. */
makemap = bfd_has_map (abfd);
hasobjects = false;
for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0;
current_bfd != NULL;
current_bfd = current_bfd->next, count++)
total_namlen += strlen (normalize_filename (current_bfd)) + 1;
{
total_namlen += strlen (normalize_filename (current_bfd)) + 1;
if (makemap
&& ! hasobjects
&& bfd_check_format (current_bfd, bfd_object))
hasobjects = true;
}
offsets = NULL;
if (count)
@ -2160,11 +2242,7 @@ xcoff_write_archive_contents_big (abfd)
if (offsets == NULL)
return false;
}
if (bfd_seek (abfd, (file_ptr) SIZEOF_AR_FILE_HDR_BIG, SEEK_SET) != 0)
return false;
makemap = bfd_has_map (abfd);
hasobjects = false;
prevoff = 0;
nextoff = SIZEOF_AR_FILE_HDR_BIG;
for (current_bfd = abfd->archive_head, i = 0;
@ -2176,12 +2254,6 @@ xcoff_write_archive_contents_big (abfd)
struct xcoff_ar_hdr_big *ahdrp;
bfd_size_type remaining;
if (makemap && ! hasobjects)
{
if (bfd_check_format (current_bfd, bfd_object))
hasobjects = true;
}
name = normalize_filename (current_bfd);
namlen = strlen (name);
@ -2236,6 +2308,14 @@ xcoff_write_archive_contents_big (abfd)
BFD_ASSERT (nextoff == bfd_tell (abfd));
/* Check for xcoff shared objects.
Their text section needs to be aligned wrt the archive file position.
This requires extra padding before the archive header. */
if (! do_shared_object_padding (abfd, current_bfd, & nextoff,
SIZEOF_AR_HDR_BIG + namlen
+ SXCOFFARFMAG))
return false;
offsets[i] = nextoff;
prevoff = nextoff;
@ -2252,31 +2332,19 @@ xcoff_write_archive_contents_big (abfd)
if (bfd_seek (current_bfd, (file_ptr) 0, SEEK_SET) != 0)
return false;
while (remaining != 0)
{
bfd_size_type amt;
bfd_byte buffer[DEFAULT_BUFFERSIZE];
amt = sizeof buffer;
if (amt > remaining)
amt = remaining;
if (bfd_bread (buffer, amt, current_bfd) != amt
|| bfd_bwrite (buffer, amt, abfd) != amt)
return false;
remaining -= amt;
}
if ((size & 1) != 0)
{
bfd_byte b;
b = '\0';
if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1)
return false;
}
if (! do_copy (abfd, current_bfd))
return false;
if (! do_pad (abfd, size & 1))
return false;
}
PRINT20 (fhdr.lastmemoff, prevoff);
if (count)
{
PRINT20 (fhdr.firstmemoff, offsets[0]);
PRINT20 (fhdr.lastmemoff, prevoff);
}
/* Write out the member table.
Layout :
@ -3455,14 +3523,11 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
SMALL_AOUTSZ, /* _xcoff_small_aout_header_size */
/* Versions. */
1, /* _xcoff_ldhdr_version */
1, /* _xcoff_ldhdr_version */
/* Xcoff vs xcoff64 putting symbol names. */
_bfd_xcoff_put_symbol_name, /* _xcoff_put_symbol_name */
_bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */
& xcoff_dynamic_reloc, /* dynamic reloc howto */
_bfd_xcoff_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */
& xcoff_dynamic_reloc, /* dynamic reloc howto */
xcoff_create_csect_from_smclas, /* _xcoff_create_csect_from_smclas */
/* Lineno and reloc count overflow. */
@ -3481,7 +3546,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
xcoff_generate_rtinit, /* _xcoff_generate_rtinit */
};
/* The transfer vector that leads the outside world to all of the above. */
/* The transfer vector that leads the outside world to all of the above. */
const bfd_target rs6000coff_vec =
{
"aixcoff-rs6000",

View File

@ -4,21 +4,21 @@
Written Clinton Popetz.
Contributed by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@ -130,7 +130,7 @@ 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));
asection **));
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 *));
@ -144,9 +144,10 @@ static bfd_vma xcoff64_loader_symbol_offset
static bfd_vma xcoff64_loader_reloc_offset
PARAMS ((bfd *, struct internal_ldhdr *));
static boolean xcoff64_generate_rtinit
PARAMS((bfd *, const char *, const char *, boolean));
PARAMS ((bfd *, const char *, const char *, boolean));
static boolean xcoff64_bad_format_hook PARAMS ((bfd *, PTR ));
/* coffcode.h needs these to be defined */
/* coffcode.h needs these to be defined. */
/* Internalcoff.h and coffcode.h modify themselves based on these flags. */
#define XCOFF64
#define RS6000COFF_C 1
@ -453,9 +454,12 @@ _bfd_xcoff64_swap_aux_out (abfd, inp, type, class, indx, numaux, extp)
}
static boolean
_bfd_xcoff64_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab,
struct internal_syment *sym,
const char *name) {
_bfd_xcoff64_put_symbol_name (abfd, strtab, sym, name)
bfd *abfd;
struct bfd_strtab_hash *strtab;
struct internal_syment *sym;
const char *name;
{
boolean hash;
bfd_size_type indx;
@ -482,7 +486,6 @@ _bfd_xcoff64_put_ldsymbol_name (abfd, ldinfo, ldsym, name)
struct internal_ldsym *ldsym;
const char *name;
{
size_t len;
len = strlen (name);
@ -668,7 +671,7 @@ xcoff64_write_object_contents (abfd)
return false;
}
/* Work out the size of the reloc and linno areas */
/* Work out the size of the reloc and linno areas. */
reloc_base = obj_relocbase (abfd);
for (current = abfd->sections; current != NULL; current = current->next)
@ -677,12 +680,12 @@ xcoff64_write_object_contents (abfd)
lineno_base = reloc_base + reloc_size;
/* Make a pass through the symbol table to count line number entries and
put them into the correct asections */
put them into the correct asections. */
lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd);
sym_base = lineno_base + lnno_size;
/* Indicate in each section->line_filepos its actual file address */
/* Indicate in each section->line_filepos its actual file address. */
for (current = abfd->sections; current != NULL; current = current->next)
{
if (current->lineno_count)
@ -792,7 +795,7 @@ xcoff64_write_object_contents (abfd)
if (abfd->flags & EXEC_P)
internal_f.f_flags |= F_EXEC;
/* FIXME: this is wrong for PPC_PE! */
/* FIXME: this is wrong for PPC_PE! */
if (bfd_little_endian (abfd))
internal_f.f_flags |= F_AR32WR;
else
@ -805,11 +808,7 @@ xcoff64_write_object_contents (abfd)
memset (&internal_a, 0, sizeof internal_a);
/* This can only be called from the xcoff64 backend so the magic #
must be for xcoff64. */
internal_f.f_magic = 0757;
internal_f.f_magic = bfd_xcoff_magic_number (abfd);
internal_a.magic = (abfd->flags & D_PAGED) ? RS6K_AOUTHDR_ZMAGIC :
(abfd->flags & WP_TEXT) ? RS6K_AOUTHDR_NMAGIC :
RS6K_AOUTHDR_OMAGIC;
@ -817,7 +816,7 @@ xcoff64_write_object_contents (abfd)
/* FIXME: Does anybody ever set this to another value? */
internal_a.vstamp = 0;
/* Now should write relocs, strings, syms */
/* Now should write relocs, strings, syms. */
obj_sym_filepos (abfd) = sym_base;
internal_f.f_symptr = 0;
@ -1362,7 +1361,6 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd,
return true;
}
/* The XCOFF reloc table. Actually, XCOFF relocations specify the
bitsize and whether they are signed or not, along with a
@ -1370,7 +1368,6 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd,
different algorithms for putting in the reloc. Many of these
relocs need special_function entries, which I have not written. */
reloc_howto_type xcoff64_howto_table[] =
{
/* Standard 64 bit relocation. */
@ -1800,8 +1797,6 @@ xcoff64_reloc_type_lookup (abfd, code)
}
}
/* Read in the armap of an XCOFF archive. */
static boolean
@ -2114,6 +2109,23 @@ xcoff64_loader_reloc_offset (abfd, ldhdr)
return (ldhdr->l_rldoff);
}
static boolean
xcoff64_bad_format_hook (abfd, filehdr)
bfd * abfd;
PTR filehdr;
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
/* Check flavor first. */
if (bfd_get_flavour (abfd) != bfd_target_xcoff_flavour)
return false;
if (bfd_xcoff_magic_number (abfd) != internal_f->f_magic)
return false;
return true;
}
static boolean
xcoff64_generate_rtinit (abfd, init, fini, rtld)
bfd *abfd;
@ -2151,7 +2163,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
initsz = (init == NULL ? 0 : 1 + strlen (init));
finisz = (fini == NULL ? 0 : 1 + strlen (fini));
/* file header */
/* File header. */
memset (filehdr_ext, 0, FILHSZ);
memset (&filehdr, 0, sizeof (struct internal_filehdr));
filehdr.f_magic = bfd_xcoff_magic_number (abfd);
@ -2162,10 +2174,10 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
filehdr.f_opthdr = 0;
filehdr.f_flags = 0;
/* section headers */
/* Section headers. */
memset (scnhdr_ext, 0, 3 * SCNHSZ);
/* text */
/* Text. */
memset (&text_scnhdr, 0, sizeof (struct internal_scnhdr));
memcpy (text_scnhdr.s_name, text_name, strlen (text_name));
text_scnhdr.s_paddr = 0;
@ -2178,7 +2190,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
text_scnhdr.s_nlnno = 0;
text_scnhdr.s_flags = STYP_TEXT;
/* data */
/* Data. */
memset (&data_scnhdr, 0, sizeof (struct internal_scnhdr));
memcpy (data_scnhdr.s_name, data_name, strlen (data_name));
data_scnhdr.s_paddr = 0;
@ -2191,7 +2203,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
data_scnhdr.s_nlnno = 0;
data_scnhdr.s_flags = STYP_DATA;
/* bss */
/* Bss. */
memset (&bss_scnhdr, 0, sizeof (struct internal_scnhdr));
memcpy (bss_scnhdr.s_name, bss_name, strlen (bss_name));
bss_scnhdr.s_paddr = 0; /* set below */
@ -2262,7 +2274,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
data_scnhdr.s_size = data_buffer_size;
bss_scnhdr.s_paddr = bss_scnhdr.s_vaddr = data_scnhdr.s_size;
/* string table */
/* String table. */
string_table_size = 4;
string_table_size += strlen (data_name) + 1;
string_table_size += strlen (rtinit_name) + 1;
@ -2326,7 +2338,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
&syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]);
filehdr.f_nsyms += 2;
/* init */
/* Init. */
if (initsz)
{
memset (&syment, 0, sizeof (struct internal_syment));
@ -2343,7 +2355,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0,
syment.n_numaux,
&syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]);
/* reloc */
/* Reloc. */
memset (&reloc, 0, sizeof (struct internal_reloc));
reloc.r_vaddr = 0x0018;
reloc.r_symndx = filehdr.f_nsyms;
@ -2355,7 +2367,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
data_scnhdr.s_nreloc += 1;
}
/* finit */
/* Finit. */
if (finisz)
{
memset (&syment, 0, sizeof (struct internal_syment));
@ -2373,7 +2385,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
syment.n_numaux,
&syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]);
/* reloc */
/* Reloc. */
memset (&reloc, 0, sizeof (struct internal_reloc));
reloc.r_vaddr = 0x0038;
reloc.r_symndx = filehdr.f_nsyms;
@ -2403,7 +2415,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld)
syment.n_numaux,
&syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]);
/* reloc */
/* Reloc. */
memset (&reloc, 0, sizeof (struct internal_reloc));
reloc.r_vaddr = 0x0000;
reloc.r_symndx = filehdr.f_nsyms;
@ -2471,7 +2483,7 @@ static unsigned long xcoff64_glink_code[10] =
static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
{
{ /* COFF backend, defined in libcoff.h */
{ /* COFF backend, defined in libcoff.h. */
_bfd_xcoff64_swap_aux_in, /* _bfd_coff_swap_aux_in */
_bfd_xcoff64_swap_sym_in, /* _bfd_coff_swap_sym_in */
_bfd_xcoff64_swap_lineno_in, /* _bfd_coff_swap_lineno_in */
@ -2492,19 +2504,19 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
FILNMLEN, /* _bfd_filnmlen */
true, /* _bfd_coff_long_filenames */
false, /* _bfd_coff_long_section_names */
(3), /* _bfd_coff_default_section_alignment_power */
true, /* _bfd_coff_force_symnames_in_strings */
4, /* _bfd_coff_debug_string_prefix_length */
(3), /* _bfd_coff_default_section_alignment_power */
true, /* _bfd_coff_force_symnames_in_strings */
4, /* _bfd_coff_debug_string_prefix_length */
coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */
coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */
coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */
coff_swap_reloc_in, /* _bfd_reloc_in */
coff_bad_format_hook, /* _bfd_bad_format_hook */
xcoff64_bad_format_hook, /* _bfd_bad_format_hook */
coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */
coff_mkobject_hook, /* _bfd_mkobject_hook */
styp_to_sec_flags, /* _bfd_syp_to_sec_flags */
coff_set_alignment_hook, /* _bfd_set_alignment_hook */
coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */
coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */
symname_in_debug_hook, /* _coff_symname_in_debug_hook */
coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */
coff_print_aux, /* bfd_coff_print_aux */
@ -2514,7 +2526,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
/* _bfd_coff_compute_section_file_positions */
coff_compute_section_file_positions,
NULL , /* _bfd_coff_start_final_link */
xcoff64_ppc_relocate_section, /* _bfd_coff_relocate_section */
xcoff64_ppc_relocate_section, /* _bfd_coff_relocate_section */
coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */
NULL , /* _bfd_coff_addust_symndx */
_bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */
@ -2526,7 +2538,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
bfd_arch_powerpc, /* architecture */
bfd_mach_ppc_620, /* machine */
/* function pointers to xcoff specific swap routines */
/* Function pointers to xcoff specific swap routines. */
xcoff64_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */
xcoff64_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */
xcoff64_swap_ldsym_in, /* _xcoff_swap_ldsym_in */
@ -2534,41 +2546,42 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data =
xcoff64_swap_ldrel_in, /* _xcoff_swap_ldrel_in */
xcoff64_swap_ldrel_out, /* _xcoff_swap_ldrel_out */
/* sizes */
/* Sizes. */
LDHDRSZ, /* _xcoff_ldhdrsz */
LDSYMSZ, /* _xcoff_ldsymsz */
LDRELSZ, /* _xcoff_ldrelsz */
24, /* _xcoff_function_descriptor_size */
0, /* _xcoff_small_aout_header_size */
/* versions */
/* Versions. */
2, /* _xcoff_ldhdr_version */
/* xcoff vs xcoff64 putting symbol names */
/* xcoff vs xcoff64 putting symbol names. */
_bfd_xcoff64_put_symbol_name, /* _xcoff_put_symbol_name */
_bfd_xcoff64_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */
/* dynamic reloc howto */
/* Dynamic reloc howto. */
&xcoff64_dynamic_reloc,
xcoff64_create_csect_from_smclas,
/* lineno and reloc count overflow */
/* Lineno and reloc count overflow. */
xcoff64_is_lineno_count_overflow,
xcoff64_is_reloc_count_overflow,
xcoff64_loader_symbol_offset,
xcoff64_loader_reloc_offset,
/* glink */
/* glink. */
&xcoff64_glink_code[0],
40, /* _xcoff_glink_size */
/* rtinit */
/* rtinit. */
88, /* _xcoff_rtinit_size */
xcoff64_generate_rtinit, /* _xcoff_generate_rtinit */
};
/* The transfer vector that leads the outside world to all of the above. */
/* The transfer vector that leads the outside world to all of the above. */
const bfd_target rs6000coff64_vec =
{
"aixcoff64-rs6000",
@ -2718,3 +2731,256 @@ const bfd_target rs6000coff64_vec =
/* back end data */
(void *) &bfd_xcoff_backend_data,
};
extern const bfd_target * xcoff64_core_p PARAMS ((bfd *));
extern boolean xcoff64_core_file_matches_executable_p PARAMS((bfd *, bfd *));
extern char * xcoff64_core_file_failing_command PARAMS ((bfd *));
extern int xcoff64_core_file_failing_signal PARAMS ((bfd *));
/* AIX 5 */
static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data =
{
{ /* COFF backend, defined in libcoff.h. */
_bfd_xcoff64_swap_aux_in, /* _bfd_coff_swap_aux_in */
_bfd_xcoff64_swap_sym_in, /* _bfd_coff_swap_sym_in */
_bfd_xcoff64_swap_lineno_in, /* _bfd_coff_swap_lineno_in */
_bfd_xcoff64_swap_aux_out, /* _bfd_swap_aux_out */
_bfd_xcoff64_swap_sym_out, /* _bfd_swap_sym_out */
_bfd_xcoff64_swap_lineno_out, /* _bfd_swap_lineno_out */
coff_swap_reloc_out, /* _bfd_swap_reloc_out */
coff_swap_filehdr_out, /* _bfd_swap_filehdr_out */
coff_swap_aouthdr_out, /* _bfd_swap_aouthdr_out */
coff_swap_scnhdr_out, /* _bfd_swap_scnhdr_out */
FILHSZ, /* _bfd_filhsz */
AOUTSZ, /* _bfd_aoutsz */
SCNHSZ, /* _bfd_scnhsz */
SYMESZ, /* _bfd_symesz */
AUXESZ, /* _bfd_auxesz */
RELSZ, /* _bfd_relsz */
LINESZ, /* _bfd_linesz */
FILNMLEN, /* _bfd_filnmlen */
true, /* _bfd_coff_long_filenames */
false, /* _bfd_coff_long_section_names */
(3), /* _bfd_coff_default_section_alignment_power */
true, /* _bfd_coff_force_symnames_in_strings */
4, /* _bfd_coff_debug_string_prefix_length */
coff_swap_filehdr_in, /* _bfd_coff_swap_filehdr_in */
coff_swap_aouthdr_in, /* _bfd_swap_aouthdr_in */
coff_swap_scnhdr_in, /* _bfd_swap_scnhdr_in */
coff_swap_reloc_in, /* _bfd_reloc_in */
xcoff64_bad_format_hook, /* _bfd_bad_format_hook */
coff_set_arch_mach_hook, /* _bfd_set_arch_mach_hook */
coff_mkobject_hook, /* _bfd_mkobject_hook */
styp_to_sec_flags, /* _bfd_syp_to_sec_flags */
coff_set_alignment_hook, /* _bfd_set_alignment_hook */
coff_slurp_symbol_table, /* _bfd_coff_slurp_symbol_table */
symname_in_debug_hook, /* _coff_symname_in_debug_hook */
coff_pointerize_aux_hook, /* _bfd_coff_pointerize_aux_hook */
coff_print_aux, /* bfd_coff_print_aux */
dummy_reloc16_extra_cases, /* _bfd_coff_reloc16_extra_cases */
dummy_reloc16_estimate, /* _bfd_coff_reloc16_estimate */
NULL, /* bfd_coff_sym_is_global */
/* _bfd_coff_compute_section_file_positions */
coff_compute_section_file_positions,
NULL , /* _bfd_coff_start_final_link */
xcoff64_ppc_relocate_section, /* _bfd_coff_relocate_section */
coff_rtype_to_howto, /* _bfd_coff_rtype_to_howto */
NULL , /* _bfd_coff_addust_symndx */
_bfd_generic_link_add_one_symbol, /* _bfd_coff_add_one_symbol */
coff_link_output_has_begun, /* _bfd_coff_link_output_has_begun */
coff_final_link_postscript /* _bfd_coff_final_link_postscript */
},
U64_TOCMAGIC, /* magic number */
bfd_arch_powerpc, /* architecture */
bfd_mach_ppc_620, /* machine */
/* Function pointers to xcoff specific swap routines. */
xcoff64_swap_ldhdr_in, /* _xcoff_swap_ldhdr_in */
xcoff64_swap_ldhdr_out, /* _xcoff_swap_ldhdr_out */
xcoff64_swap_ldsym_in, /* _xcoff_swap_ldsym_in */
xcoff64_swap_ldsym_out, /* _xcoff_swap_ldsym_out */
xcoff64_swap_ldrel_in, /* _xcoff_swap_ldrel_in */
xcoff64_swap_ldrel_out, /* _xcoff_swap_ldrel_out */
/* Sizes. */
LDHDRSZ, /* _xcoff_ldhdrsz */
LDSYMSZ, /* _xcoff_ldsymsz */
LDRELSZ, /* _xcoff_ldrelsz */
24, /* _xcoff_function_descriptor_size */
0, /* _xcoff_small_aout_header_size */
/* Versions. */
2, /* _xcoff_ldhdr_version */
_bfd_xcoff64_put_symbol_name, /* _xcoff_put_symbol_name */
_bfd_xcoff64_put_ldsymbol_name, /* _xcoff_put_ldsymbol_name */
/* Dynamic reloc howto. */
&xcoff64_dynamic_reloc,
xcoff64_create_csect_from_smclas,
/* Lineno and reloc count overflow. */
xcoff64_is_lineno_count_overflow,
xcoff64_is_reloc_count_overflow,
xcoff64_loader_symbol_offset,
xcoff64_loader_reloc_offset,
/* glink. */
&xcoff64_glink_code[0],
40, /* _xcoff_glink_size */
/* rtinit. */
88, /* _xcoff_rtinit_size */
xcoff64_generate_rtinit, /* _xcoff_generate_rtinit */
};
/* The transfer vector that leads the outside world to all of the above. */
const bfd_target aix5coff64_vec =
{
"aix5coff64-rs6000",
bfd_target_xcoff_flavour,
BFD_ENDIAN_BIG, /* data byte order is big */
BFD_ENDIAN_BIG, /* header byte order is big */
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG | DYNAMIC |
HAS_SYMS | HAS_LOCALS | WP_TEXT),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
0, /* leading char */
'/', /* ar_pad_char */
15, /* ar_max_namelen??? FIXMEmgo */
/* data */
bfd_getb64, /* bfd_getx64 */
bfd_getb_signed_64, /* bfd_getx_signed_64 */
bfd_putb64, /* bfd_putx64 */
bfd_getb32, /* bfd_getx32 */
bfd_getb_signed_32, /* bfd_getx_signed_32 */
bfd_putb32, /* bfd_putx32 */
bfd_getb16, /* bfd_getx16 */
bfd_getb_signed_16, /* bfd_getx_signed_16 */
bfd_putb16, /* bfd_putx16 */
/* hdrs */
bfd_getb64, /* bfd_h_getx64 */
bfd_getb_signed_64, /* bfd_h_getx_signed_64 */
bfd_putb64, /* bfd_h_putx64 */
bfd_getb32, /* bfd_h_getx32 */
bfd_getb_signed_32, /* bfd_h_getx_signed_32 */
bfd_putb32, /* bfd_h_putx32 */
bfd_getb16, /* bfd_h_getx16 */
bfd_getb_signed_16, /* bfd_h_getx_signed_16 */
bfd_putb16, /* bfd_h_putx16 */
{ /* bfd_check_format */
_bfd_dummy_target,
coff_object_p,
xcoff64_archive_p,
xcoff64_core_p
},
{ /* bfd_set_format */
bfd_false,
coff_mkobject,
_bfd_generic_mkarchive,
bfd_false
},
{/* bfd_write_contents */
bfd_false,
xcoff64_write_object_contents,
_bfd_xcoff_write_archive_contents,
bfd_false
},
/* Generic */
bfd_true, /* _close_and_cleanup */
bfd_true, /* _bfd_free_cached_info */
coff_new_section_hook, /* _new_section_hook */
_bfd_generic_get_section_contents, /* _bfd_get_section_contents */
/* _bfd_get_section_contents_in_window */
_bfd_generic_get_section_contents_in_window,
/* Copy */
_bfd_xcoff_copy_private_bfd_data, /* _bfd_copy_private_bfd */
/* _bfd_merge_private_bfd_data */
((boolean (*) (bfd *, bfd *)) bfd_true),
/* _bfd_copy_pivate_section_data */
((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
/* _bfd_copy_private_symbol_data */
((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
((boolean (*) (bfd *, flagword)) bfd_true), /* _bfd_set_private_flags */
((boolean (*) (bfd *, void * )) bfd_true), /* _bfd_print_private_bfd_data */
/* Core */
xcoff64_core_file_failing_command, /* _core_file_failing_command */
xcoff64_core_file_failing_signal, /* _core_file_failing_signal */
xcoff64_core_file_matches_executable_p, /* _core_file_matches_executable_p */
/* Archive */
xcoff64_slurp_armap, /* _slurp_armap */
/* XCOFF archives do not have
anything which corresponds to
an extended name table. */
bfd_false, /* _slurp_extended_name_table */
/* _construct_extended_name_table */
((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false),
bfd_dont_truncate_arname, /* _truncate_arname */
_bfd_xcoff_write_armap, /* _write_armap */
_bfd_xcoff_read_ar_hdr, /* _read_ar_hdr */
xcoff64_openr_next_archived_file, /* _openr_next_archived_file */
_bfd_generic_get_elt_at_index, /* _get_elt_at_index */
_bfd_xcoff_generic_stat_arch_elt, /* _generic_dtat_arch_elt */
/* XCOFF archives do not have
a timestamp. */
bfd_true, /* _update_armap_timestamp */
/* Symbols */
coff_get_symtab_upper_bound, /* _get_symtab_upper_bound */
coff_get_symtab, /* _get_symtab */
coff_make_empty_symbol, /* _make_empty_symbol */
coff_print_symbol, /* _print_symbol */
coff_get_symbol_info, /* _get_symbol_info */
_bfd_xcoff_is_local_label_name, /* _bfd_is_local_label_name */
coff_get_lineno, /* _get_lineno */
coff_find_nearest_line, /* _find_nearest_line */
coff_bfd_make_debug_symbol, /* _bfd_make_debug_symbol */
_bfd_generic_read_minisymbols, /* _read_minisymbols */
_bfd_generic_minisymbol_to_symbol, /* _minsymbol_to_symbol */
/* Reloc */
coff_get_reloc_upper_bound, /* _get_reloc_upper_bound */
coff_canonicalize_reloc, /* _cononicalize_reloc */
xcoff64_reloc_type_lookup, /* _bfd_reloc_type_lookup */
/* Write */
coff_set_arch_mach, /* _set_arch_mach */
coff_set_section_contents, /* _set_section_contents */
/* Link */
xcoff64_sizeof_headers, /* _sizeof_headers */
/* _bfd_get_relocated_section_contents */
bfd_generic_get_relocated_section_contents,
bfd_generic_relax_section, /* _bfd_relax_section */
_bfd_xcoff_bfd_link_hash_table_create, /* _bfd_link_hash_table_create */
_bfd_xcoff_bfd_link_add_symbols, /* _bfd_link_add_symbols */
_bfd_xcoff_bfd_final_link, /* _bfd_filnal_link */
_bfd_generic_link_split_section, /* _bfd_link_split_section */
bfd_generic_gc_sections, /* _bfd_gc_sections */
bfd_generic_merge_sections, /* _bfd_merge_sections */
/* Dynamic */
/* _get_dynamic_symtab_upper_bound */
_bfd_xcoff_get_dynamic_symtab_upper_bound,
_bfd_xcoff_canonicalize_dynamic_symtab, /* _cononicalize_dynamic_symtab */
_bfd_xcoff_get_dynamic_reloc_upper_bound,/* _get_dynamic_reloc_upper_bound */
_bfd_xcoff_canonicalize_dynamic_reloc, /* _cononicalize_dynamic_reloc */
/* Opposite endian version, none exists. */
NULL,
/* back end data */
(void *) & bfd_xcoff_aix5_backend_data,
};

View File

@ -1493,12 +1493,12 @@ coff_new_section_hook (abfd, section)
section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
#ifdef RS6000COFF_C
if (xcoff_data (abfd)->text_align_power != 0
if (bfd_xcoff_text_align_power (abfd) != 0
&& strcmp (bfd_get_section_name (abfd, section), ".text") == 0)
section->alignment_power = xcoff_data (abfd)->text_align_power;
if (xcoff_data (abfd)->data_align_power != 0
section->alignment_power = bfd_xcoff_text_align_power (abfd);
if (bfd_xcoff_data_align_power (abfd) != 0
&& strcmp (bfd_get_section_name (abfd, section), ".data") == 0)
section->alignment_power = xcoff_data (abfd)->data_align_power;
section->alignment_power = bfd_xcoff_data_align_power (abfd);
#endif
/* Allocate aux records for section symbols, to store size and
@ -1964,6 +1964,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
#ifdef RS6000COFF_C
#ifdef XCOFF64
case U64_TOCMAGIC:
case U803XTOCMAGIC:
#else
case U802ROMAGIC:
@ -2768,14 +2769,8 @@ coff_set_flags (abfd, magicp, flagsp)
#ifndef PPCMAGIC
case bfd_arch_powerpc:
#endif
#ifdef XCOFF64
if (bfd_get_mach (abfd) == bfd_mach_ppc_620
&& !strncmp (abfd->xvec->name,"aix", 3))
*magicp = U803XTOCMAGIC;
else
#else
*magicp = U802TOCMAGIC;
#endif
BFD_ASSERT (bfd_get_flavour (abfd) == bfd_target_xcoff_flavour);
*magicp = bfd_xcoff_magic_number (abfd);
return true;
break;
#endif
@ -4447,7 +4442,7 @@ coff_slurp_symbol_table (abfd)
if (src->u.syment.n_sclass == C_SECTION
&& src->u.syment.n_scnum > 0)
dst->symbol.flags = BSF_LOCAL;
dst->symbol.flags = BSF_LOCAL;
#endif
if (src->u.syment.n_sclass == C_WEAKEXT)
dst->symbol.flags |= BSF_WEAK;

View File

@ -785,11 +785,22 @@ case "${targ}" in
targ_selvecs="bfd_elf32_pjl_vec bfd_elf32_pj_vec bfd_elf32_i386_vec"
;;
powerpc-*-aix5*)
targ_defvec=rs6000coff_vec
targ_selvecs="aix5coff64_vec"
want64=true
;;
powerpc64-*-aix5*)
targ_defvec=aix5coff64_vec
targ_selvecs="rs6000coff_vec"
want64=true
;;
powerpc-*-aix* | powerpc-*-beos* | rs6000-*-*)
targ_defvec=rs6000coff_vec
targ64_selvecs=rs6000coff64_vec
case "${targ}" in
*-*-aix4.[3456789]* | *-*-aix[56789]*)
*-*-aix4.[3456789]* | *-*-aix[56789]*)
want64=true;;
*)

166
bfd/configure vendored
View File

@ -5156,8 +5156,11 @@ if test "${target}" = "${host}"; then
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/m68kaux.h"'
;;
m88*-*-sysv4*) ;;
m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;;
m88*-*-sysv4*)
;;
m88*-motorola-sysv*)
COREFILE=ptrace-core.lo
;;
m88*-*-mach3*)
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/m88kmach3.h"'
@ -5169,7 +5172,13 @@ if test "${target}" = "${host}"; then
ns32k-*-netbsd* | ns32k-*-openbsd*)
COREFILE=netbsd-core.lo
;;
rs6000-*-lynx*) COREFILE=lynx-core.lo ;;
rs6000-*-lynx*)
COREFILE=lynx-core.lo
;;
rs6000-*-aix5.* | powerpc-*-aix5.*)
COREFILE=rs6000-core.lo
COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE"
;;
rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*)
COREFILE=rs6000-core.lo
COREFLAG="$COREFLAG -DAIX_CORE_DUMPX_CORE"
@ -5226,17 +5235,17 @@ if test "${target}" = "${host}"; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:5230: checking for $ac_hdr" >&5
echo "configure:5239: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5235 "configure"
#line 5244 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:5249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -5264,12 +5273,12 @@ done
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5268: checking for prstatus_t in sys/procfs.h" >&5
echo "configure:5277: checking for prstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5273 "configure"
#line 5282 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5278,7 +5287,7 @@ int main() {
prstatus_t avar
; return 0; }
EOF
if { (eval echo configure:5282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus_t=yes
else
@ -5300,12 +5309,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5304: checking for prstatus32_t in sys/procfs.h" >&5
echo "configure:5313: checking for prstatus32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5309 "configure"
#line 5318 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5314,7 +5323,7 @@ int main() {
prstatus32_t avar
; return 0; }
EOF
if { (eval echo configure:5318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus32_t=yes
else
@ -5336,12 +5345,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6
echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5340: checking for prstatus_t.pr_who in sys/procfs.h" >&5
echo "configure:5349: checking for prstatus_t.pr_who in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5345 "configure"
#line 5354 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5350,7 +5359,7 @@ int main() {
prstatus_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
if { (eval echo configure:5354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes
else
@ -5372,12 +5381,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5376: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
echo "configure:5385: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5381 "configure"
#line 5390 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5386,7 +5395,7 @@ int main() {
prstatus32_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
if { (eval echo configure:5390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes
else
@ -5408,12 +5417,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5412: checking for pstatus_t in sys/procfs.h" >&5
echo "configure:5421: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5417 "configure"
#line 5426 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5422,7 +5431,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
if { (eval echo configure:5426: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@ -5444,12 +5453,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5448: checking for pxstatus_t in sys/procfs.h" >&5
echo "configure:5457: checking for pxstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5453 "configure"
#line 5462 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5458,7 +5467,7 @@ int main() {
pxstatus_t avar
; return 0; }
EOF
if { (eval echo configure:5462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pxstatus_t=yes
else
@ -5480,12 +5489,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6
echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5484: checking for pstatus32_t in sys/procfs.h" >&5
echo "configure:5493: checking for pstatus32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5489 "configure"
#line 5498 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5494,7 +5503,7 @@ int main() {
pstatus32_t avar
; return 0; }
EOF
if { (eval echo configure:5498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus32_t=yes
else
@ -5516,12 +5525,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6
echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5520: checking for prpsinfo_t in sys/procfs.h" >&5
echo "configure:5529: checking for prpsinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5525 "configure"
#line 5534 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5530,7 +5539,7 @@ int main() {
prpsinfo_t avar
; return 0; }
EOF
if { (eval echo configure:5534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
else
@ -5552,12 +5561,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5556: checking for prpsinfo32_t in sys/procfs.h" >&5
echo "configure:5565: checking for prpsinfo32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5561 "configure"
#line 5570 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5566,7 +5575,7 @@ int main() {
prpsinfo32_t avar
; return 0; }
EOF
if { (eval echo configure:5570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes
else
@ -5588,12 +5597,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6
echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5592: checking for psinfo_t in sys/procfs.h" >&5
echo "configure:5601: checking for psinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5597 "configure"
#line 5606 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5602,7 +5611,7 @@ int main() {
psinfo_t avar
; return 0; }
EOF
if { (eval echo configure:5606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo_t=yes
else
@ -5624,12 +5633,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5628: checking for psinfo32_t in sys/procfs.h" >&5
echo "configure:5637: checking for psinfo32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5633 "configure"
#line 5642 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5638,7 +5647,7 @@ int main() {
psinfo32_t avar
; return 0; }
EOF
if { (eval echo configure:5642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo32_t=yes
else
@ -5660,12 +5669,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6
echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5664: checking for lwpstatus_t in sys/procfs.h" >&5
echo "configure:5673: checking for lwpstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5669 "configure"
#line 5678 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5674,7 +5683,7 @@ int main() {
lwpstatus_t avar
; return 0; }
EOF
if { (eval echo configure:5678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
else
@ -5696,12 +5705,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5700: checking for lwpxstatus_t in sys/procfs.h" >&5
echo "configure:5709: checking for lwpxstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5705 "configure"
#line 5714 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5710,7 +5719,7 @@ int main() {
lwpxstatus_t avar
; return 0; }
EOF
if { (eval echo configure:5714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes
else
@ -5732,12 +5741,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6
echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5736: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
echo "configure:5745: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5741 "configure"
#line 5750 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5746,7 +5755,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_context
; return 0; }
EOF
if { (eval echo configure:5750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes
else
@ -5768,12 +5777,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6
echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5772: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
echo "configure:5781: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5777 "configure"
#line 5786 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5782,7 +5791,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
; return 0; }
EOF
if { (eval echo configure:5786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes
else
@ -5804,12 +5813,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6
echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6
echo "configure:5808: checking for win32_pstatus_t in sys/procfs.h" >&5
echo "configure:5817: checking for win32_pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 5813 "configure"
#line 5822 "configure"
#include "confdefs.h"
#define _SYSCALL32
@ -5818,7 +5827,7 @@ int main() {
win32_pstatus_t avar
; return 0; }
EOF
if { (eval echo configure:5822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:5831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
else
@ -5959,17 +5968,6 @@ do
# This list is alphabetized to make it easy to compare
# with the two vector lists in targets.c. For the same reason,
# use one entry per line, even though this leads to long lines.
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# which needs it but does not list it. Should be fixed in right place.
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo"
target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo"
target_size=64 ;;
bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf"
target_size=64 ;;
bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf"
target_size=64 ;;
a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
@ -6040,6 +6038,13 @@ do
bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# which needs it but does not list it. Should be fixed in right place.
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
@ -6132,7 +6137,8 @@ do
pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo"; target_size=64 ;;
rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
@ -6235,10 +6241,10 @@ case ${host64}-${target64}-${want64} in
if test -n "$GCC" ; then
bad_64bit_gcc=no;
echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6
echo "configure:6239: checking for gcc version with buggy 64-bit support" >&5
echo "configure:6245: checking for gcc version with buggy 64-bit support" >&5
# Add more tests for gcc versions with non-working 64-bit support here.
cat > conftest.$ac_ext <<EOF
#line 6242 "configure"
#line 6248 "configure"
#include "confdefs.h"
:__GNUC__:__GNUC_MINOR__:__i386__:
EOF
@ -6283,17 +6289,17 @@ for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6287: checking for $ac_hdr" >&5
echo "configure:6293: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6292 "configure"
#line 6298 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:6303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -6322,12 +6328,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6326: checking for $ac_func" >&5
echo "configure:6332: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6331 "configure"
#line 6337 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -6350,7 +6356,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:6354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:6360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -6375,7 +6381,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
echo "configure:6379: checking for working mmap" >&5
echo "configure:6385: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -6383,7 +6389,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
#line 6387 "configure"
#line 6393 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@ -6536,7 +6542,7 @@ main()
}
EOF
if { (eval echo configure:6540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:6546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@ -6561,12 +6567,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6565: checking for $ac_func" >&5
echo "configure:6571: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6570 "configure"
#line 6576 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -6589,7 +6595,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:6593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:6599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else

View File

@ -308,8 +308,11 @@ changequote([,])dnl
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/m68kaux.h"'
;;
m88*-*-sysv4*) ;;
m88*-motorola-sysv*) COREFILE=ptrace-core.lo ;;
m88*-*-sysv4*)
;;
m88*-motorola-sysv*)
COREFILE=ptrace-core.lo
;;
m88*-*-mach3*)
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/m88kmach3.h"'
@ -321,7 +324,13 @@ changequote([,])dnl
ns32k-*-netbsd* | ns32k-*-openbsd*)
COREFILE=netbsd-core.lo
;;
rs6000-*-lynx*) COREFILE=lynx-core.lo ;;
rs6000-*-lynx*)
COREFILE=lynx-core.lo
;;
rs6000-*-aix5.* | powerpc-*-aix5.*)
COREFILE=rs6000-core.lo
COREFLAG="$COREFLAG -DAIX_5_CORE -DAIX_CORE_DUMPX_CORE"
;;
changequote(,)dnl
rs6000-*-aix4.[3-9]* | powerpc-*-aix4.[3-9]*)
changequote([,])dnl
@ -514,17 +523,6 @@ do
# This list is alphabetized to make it easy to compare
# with the two vector lists in targets.c. For the same reason,
# use one entry per line, even though this leads to long lines.
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# which needs it but does not list it. Should be fixed in right place.
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo"
target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo"
target_size=64 ;;
bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf"
target_size=64 ;;
bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf"
target_size=64 ;;
a29kcoff_big_vec) tb="$tb coff-a29k.lo cofflink.lo" ;;
a_out_adobe_vec) tb="$tb aout-adobe.lo aout32.lo" ;;
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
@ -595,6 +593,13 @@ do
bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
# FIXME: We include cofflink.lo not because it's needed for
# bfd_elf32_sh64[l]_vec, but because we include bfd_elf32_sh[l]_vec
# which needs it but does not list it. Should be fixed in right place.
bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;;
bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elf32.lo $elf ecofflink.lo" ;;
@ -687,7 +692,8 @@ do
pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo"; target_size=64 ;;
rs6000coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
aix5coff64_vec) tb="$tb coff64-rs6000.lo xcofflink.lo aix5ppc-core.lo"; target_size=64 ;;
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
shcoff_small_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;

View File

@ -242,7 +242,7 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:

View File

@ -1,22 +1,22 @@
/* BFD XCOFF object file private structure.
Copyright (C) 2001 Free Software Foundation, Inc.
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
Written by Tom Rix, Redhat.
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef LIBXCOFF_H
#define LIBXCOFF_H
@ -31,14 +31,14 @@ struct xcoff_backend_data_rec
/* COFF backend information. */
bfd_coff_backend_data coff;
/* Magic number */
/* Magic number. */
unsigned short _xcoff_magic_number;
/* Architecture and machine for coff_set_arch_mach_hook */
/* Architecture and machine for coff_set_arch_mach_hook. */
enum bfd_architecture _xcoff_architecture;
long _xcoff_machine;
/* function pointers to xcoff specific swap routines */
/* Function pointers to xcoff specific swap routines. */
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 *);
@ -46,33 +46,34 @@ struct xcoff_backend_data_rec
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 external struct */
/* Size of the external struct. */
unsigned int _xcoff_ldhdrsz;
unsigned int _xcoff_ldsymsz;
unsigned int _xcoff_ldrelsz;
/* size an entry in a descriptor section */
/* Size an entry in a descriptor section. */
unsigned int _xcoff_function_descriptor_size;
/* size of the small aout file header */
/* Size of the small aout file header. */
unsigned int _xcoff_small_aout_header_size;
/* Loader version
1 : XCOFF32
2 : XCOFF64 */
2 : XCOFF64. */
unsigned long _xcoff_ldhdr_version;
boolean (* _xcoff_put_symbol_name)(bfd *, struct bfd_strtab_hash *,
struct internal_syment *,
const char *);
boolean (* _xcoff_put_symbol_name)
PARAMS ((bfd *, struct bfd_strtab_hash *, struct internal_syment *,
const char *));
boolean (* _xcoff_put_ldsymbol_name)(bfd *, struct xcoff_loader_info *,
struct internal_ldsym *,
const char *);
boolean (* _xcoff_put_ldsymbol_name)
PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *,
const char *));
reloc_howto_type *_xcoff_dynamic_reloc;
asection * (* _xcoff_create_csect_from_smclas) (bfd *, union internal_auxent *, const char *);
asection * (* _xcoff_create_csect_from_smclas)
PARAMS ((bfd *, union internal_auxent *, const char *));
/* Line number and relocation overflow.
XCOFF32 overflows to another section when the line number or the
@ -82,7 +83,7 @@ struct xcoff_backend_data_rec
/* Loader section symbol and relocation table offset
XCOFF32 is after the .loader header
XCOFF64 is offset in .loader header */
XCOFF64 is offset in .loader header. */
bfd_vma (*_xcoff_loader_symbol_offset)(bfd *, struct internal_ldhdr *);
bfd_vma (*_xcoff_loader_reloc_offset)(bfd *, struct internal_ldhdr *);
@ -93,21 +94,19 @@ struct xcoff_backend_data_rec
/* Size of the global link code in bytes of the xcoff_glink_code table. */
unsigned long _xcoff_glink_size;
/* rtinit */
/* rtinit. */
unsigned int _xcoff_rtinit_size;
boolean (*_xcoff_generate_rtinit)(bfd *, const char *, const char *,
boolean);
};
/* Look up an entry in an XCOFF link hash table. */
#define xcoff_link_hash_lookup(table, string, create, copy, follow) \
((struct xcoff_link_hash_entry *) \
bfd_link_hash_lookup (&(table)->root, (string), (create), (copy),\
(follow)))
/* Traverse an XCOFF link hash table. */
#define xcoff_link_hash_traverse(table, func, info) \
(bfd_link_hash_traverse \
(&(table)->root, \
@ -116,7 +115,6 @@ struct xcoff_backend_data_rec
/* Get the XCOFF link hash table from the info structure. This is
just a cast. */
#define xcoff_hash_table(p) ((struct xcoff_link_hash_table *) ((p)->hash))
@ -186,8 +184,11 @@ struct xcoff_backend_data_rec
#define bfd_xcoff_glink_code(a, b) ((xcoff_backend(a)->_xcoff_glink_code[(b)]))
#define bfd_xcoff_glink_code_size(a) ((xcoff_backend(a)->_xcoff_glink_size))
/* Check for the magic number U803XTOCMAGIC for 64 bit targets. */
#define bfd_xcoff_is_xcoff64(a) (0x01EF == (bfd_xcoff_magic_number(a)))
/* Check for the magic number U803XTOCMAGIC or U64_TOCMAGIC for 64 bit
targets. */
#define bfd_xcoff_is_xcoff64(a) \
( (0x01EF == (bfd_xcoff_magic_number(a))) \
|| (0x01F7 == (bfd_xcoff_magic_number(a))))
/* Check for the magic number U802TOMAGIC for 32 bit targets. */
#define bfd_xcoff_is_xcoff32(a) (0x01DF == (bfd_xcoff_magic_number(a)))
@ -195,4 +196,8 @@ struct xcoff_backend_data_rec
#define bfd_xcoff_rtinit_size(a) ((xcoff_backend(a)->_xcoff_rtinit_size))
#define bfd_xcoff_generate_rtinit(a, b, c, d) ((xcoff_backend(a)->_xcoff_generate_rtinit ((a), (b), (c), (d))))
/* Accessor macros for tdata. */
#define bfd_xcoff_text_align_power(a) ((xcoff_data (a)->text_align_power))
#define bfd_xcoff_data_align_power(a) ((xcoff_data (a)->data_align_power))
#endif /* LIBXCOFF_H */

View File

@ -2051,106 +2051,6 @@ ENUMX
BFD_RELOC_MIPS_JALR
COMMENT
COMMENT
ENUMX
BFD_RELOC_SH_GOT_LOW16
ENUMX
BFD_RELOC_SH_GOT_MEDLOW16
ENUMX
BFD_RELOC_SH_GOT_MEDHI16
ENUMX
BFD_RELOC_SH_GOT_HI16
ENUMX
BFD_RELOC_SH_GOTPLT_LOW16
ENUMX
BFD_RELOC_SH_GOTPLT_MEDLOW16
ENUMX
BFD_RELOC_SH_GOTPLT_MEDHI16
ENUMX
BFD_RELOC_SH_GOTPLT_HI16
ENUMX
BFD_RELOC_SH_PLT_LOW16
ENUMX
BFD_RELOC_SH_PLT_MEDLOW16
ENUMX
BFD_RELOC_SH_PLT_MEDHI16
ENUMX
BFD_RELOC_SH_PLT_HI16
ENUMX
BFD_RELOC_SH_GOTOFF_LOW16
ENUMX
BFD_RELOC_SH_GOTOFF_MEDLOW16
ENUMX
BFD_RELOC_SH_GOTOFF_MEDHI16
ENUMX
BFD_RELOC_SH_GOTOFF_HI16
ENUMX
BFD_RELOC_SH_GOTPC_LOW16
ENUMX
BFD_RELOC_SH_GOTPC_MEDLOW16
ENUMX
BFD_RELOC_SH_GOTPC_MEDHI16
ENUMX
BFD_RELOC_SH_GOTPC_HI16
ENUMX
BFD_RELOC_SH_COPY64
ENUMX
BFD_RELOC_SH_GLOB_DAT64
ENUMX
BFD_RELOC_SH_JMP_SLOT64
ENUMX
BFD_RELOC_SH_RELATIVE64
ENUMX
BFD_RELOC_SH_GOT10BY4
ENUMX
BFD_RELOC_SH_GOT10BY8
ENUMX
BFD_RELOC_SH_GOTPLT10BY4
ENUMX
BFD_RELOC_SH_GOTPLT10BY8
ENUMX
BFD_RELOC_SH_GOTPLT32
COMMENT
ENUMX
BFD_RELOC_SH_SHMEDIA_CODE
ENUMX
BFD_RELOC_SH_IMMU5
ENUMX
BFD_RELOC_SH_IMMS6
ENUMX
BFD_RELOC_SH_IMMS6BY32
ENUMX
BFD_RELOC_SH_IMMU6
ENUMX
BFD_RELOC_SH_IMMS10
ENUMX
BFD_RELOC_SH_IMMS10BY2
ENUMX
BFD_RELOC_SH_IMMS10BY4
ENUMX
BFD_RELOC_SH_IMMS10BY8
ENUMX
BFD_RELOC_SH_IMMS16
ENUMX
BFD_RELOC_SH_IMMU16
ENUMX
BFD_RELOC_SH_IMM_LOW16
ENUMX
BFD_RELOC_SH_IMM_LOW16_PCREL
ENUMX
BFD_RELOC_SH_IMM_MEDLOW16
ENUMX
BFD_RELOC_SH_IMM_MEDLOW16_PCREL
ENUMX
BFD_RELOC_SH_IMM_MEDHI16
ENUMX
BFD_RELOC_SH_IMM_MEDHI16_PCREL
ENUMX
BFD_RELOC_SH_IMM_HI16
ENUMX
BFD_RELOC_SH_IMM_HI16_PCREL
ENUMX
BFD_RELOC_SH_PT_16
COMMENT
ENUMDOC
MIPS ELF relocations.
@ -2487,6 +2387,104 @@ ENUMX
BFD_RELOC_SH_RELATIVE
ENUMX
BFD_RELOC_SH_GOTPC
ENUMX
BFD_RELOC_SH_GOT_LOW16
ENUMX
BFD_RELOC_SH_GOT_MEDLOW16
ENUMX
BFD_RELOC_SH_GOT_MEDHI16
ENUMX
BFD_RELOC_SH_GOT_HI16
ENUMX
BFD_RELOC_SH_GOTPLT_LOW16
ENUMX
BFD_RELOC_SH_GOTPLT_MEDLOW16
ENUMX
BFD_RELOC_SH_GOTPLT_MEDHI16
ENUMX
BFD_RELOC_SH_GOTPLT_HI16
ENUMX
BFD_RELOC_SH_PLT_LOW16
ENUMX
BFD_RELOC_SH_PLT_MEDLOW16
ENUMX
BFD_RELOC_SH_PLT_MEDHI16
ENUMX
BFD_RELOC_SH_PLT_HI16
ENUMX
BFD_RELOC_SH_GOTOFF_LOW16
ENUMX
BFD_RELOC_SH_GOTOFF_MEDLOW16
ENUMX
BFD_RELOC_SH_GOTOFF_MEDHI16
ENUMX
BFD_RELOC_SH_GOTOFF_HI16
ENUMX
BFD_RELOC_SH_GOTPC_LOW16
ENUMX
BFD_RELOC_SH_GOTPC_MEDLOW16
ENUMX
BFD_RELOC_SH_GOTPC_MEDHI16
ENUMX
BFD_RELOC_SH_GOTPC_HI16
ENUMX
BFD_RELOC_SH_COPY64
ENUMX
BFD_RELOC_SH_GLOB_DAT64
ENUMX
BFD_RELOC_SH_JMP_SLOT64
ENUMX
BFD_RELOC_SH_RELATIVE64
ENUMX
BFD_RELOC_SH_GOT10BY4
ENUMX
BFD_RELOC_SH_GOT10BY8
ENUMX
BFD_RELOC_SH_GOTPLT10BY4
ENUMX
BFD_RELOC_SH_GOTPLT10BY8
ENUMX
BFD_RELOC_SH_GOTPLT32
ENUMX
BFD_RELOC_SH_SHMEDIA_CODE
ENUMX
BFD_RELOC_SH_IMMU5
ENUMX
BFD_RELOC_SH_IMMS6
ENUMX
BFD_RELOC_SH_IMMS6BY32
ENUMX
BFD_RELOC_SH_IMMU6
ENUMX
BFD_RELOC_SH_IMMS10
ENUMX
BFD_RELOC_SH_IMMS10BY2
ENUMX
BFD_RELOC_SH_IMMS10BY4
ENUMX
BFD_RELOC_SH_IMMS10BY8
ENUMX
BFD_RELOC_SH_IMMS16
ENUMX
BFD_RELOC_SH_IMMU16
ENUMX
BFD_RELOC_SH_IMM_LOW16
ENUMX
BFD_RELOC_SH_IMM_LOW16_PCREL
ENUMX
BFD_RELOC_SH_IMM_MEDLOW16
ENUMX
BFD_RELOC_SH_IMM_MEDLOW16_PCREL
ENUMX
BFD_RELOC_SH_IMM_MEDHI16
ENUMX
BFD_RELOC_SH_IMM_MEDHI16_PCREL
ENUMX
BFD_RELOC_SH_IMM_HI16
ENUMX
BFD_RELOC_SH_IMM_HI16_PCREL
ENUMX
BFD_RELOC_SH_PT_16
ENUMDOC
Hitachi SH relocs. Not all of these appear in object files.

View File

@ -11,21 +11,21 @@
Archive support from Damon A. Permezel.
Contributed by IBM Corporation and Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This port currently only handles reading object files, except when
compiled on an RS/6000 host. -- no archive support, no core files.

View File

@ -631,6 +631,7 @@ extern const bfd_target ppcboot_vec;
extern const bfd_target riscix_vec;
extern const bfd_target rs6000coff64_vec;
extern const bfd_target rs6000coff_vec;
extern const bfd_target aix5coff64_vec;
extern const bfd_target shcoff_small_vec;
extern const bfd_target shcoff_vec;
extern const bfd_target shlcoff_small_vec;

View File

@ -3,21 +3,21 @@
Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
@ -3141,37 +3141,42 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry,
csectpp = xcoff_data (sub)->csects;
symesz = bfd_coff_symesz (sub);
esym = (bfd_byte *) obj_coff_external_syms (sub);
esymend = esym + symcount * symesz;
while (esym < esymend)
/* Dynamic object do not have csectpp's. */
if (NULL != csectpp)
{
struct internal_syment sym;
symesz = bfd_coff_symesz (sub);
esym = (bfd_byte *) obj_coff_external_syms (sub);
esymend = esym + symcount * symesz;
bfd_coff_swap_sym_in (sub, (PTR) esym, (PTR) &sym);
*debug_index = (unsigned long) -1;
if (sym._n._n_n._n_zeroes == 0
&& *csectpp != NULL
&& (! gc
|| ((*csectpp)->flags & SEC_MARK) != 0
|| *csectpp == bfd_abs_section_ptr)
&& bfd_coff_symname_in_debug (sub, &sym))
while (esym < esymend)
{
char *name;
bfd_size_type indx;
struct internal_syment sym;
name = (char *) debug_contents + sym._n._n_n._n_offset;
indx = _bfd_stringtab_add (debug_strtab, name, true, true);
if (indx == (bfd_size_type) -1)
goto error_return;
*debug_index = indx;
bfd_coff_swap_sym_in (sub, (PTR) esym, (PTR) &sym);
*debug_index = (unsigned long) -1;
if (sym._n._n_n._n_zeroes == 0
&& *csectpp != NULL
&& (! gc
|| ((*csectpp)->flags & SEC_MARK) != 0
|| *csectpp == bfd_abs_section_ptr)
&& bfd_coff_symname_in_debug (sub, &sym))
{
char *name;
bfd_size_type indx;
name = (char *) debug_contents + sym._n._n_n._n_offset;
indx = _bfd_stringtab_add (debug_strtab, name, true, true);
if (indx == (bfd_size_type) -1)
goto error_return;
*debug_index = indx;
}
esym += (sym.n_numaux + 1) * symesz;
csectpp += sym.n_numaux + 1;
debug_index += sym.n_numaux + 1;
}
esym += (sym.n_numaux + 1) * symesz;
csectpp += sym.n_numaux + 1;
debug_index += sym.n_numaux + 1;
}
free (debug_contents);

View File

@ -1,3 +1,19 @@
2002-03-18 Tom Rix <trix@redhat.com>
* Makefile.am: Add binutils emulation support.
* configure.in: Same.
* configure.tgt: New file. Same.
* ar.c (main): Use ar_emul_parse_arg.
(usage): Use ar_emul_usage.
(replace_members): Use ar_emul_replace, ar_emul_append.
* binemul.c: New file. Define the binutils emulation
layer. Define default methods.
* binemul.h: New file. Binutils emulation layer header file.
* emul_aix.c: New file. AIX binutils emulation.
* emul_vanilla.c: New file. Default binutils emulation.
* Makefile.in: Regenerate.
* configure: Same.
2002-03-18 Nick Clifton <nickc@cambridge.redhat.com>
* po/fr.po: Updated version.

View File

@ -62,7 +62,7 @@ noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG)
# Stuff that goes in tooldir/ if appropriate
# Stuff that goes in tooldir/ if appropriate.
TOOL_PROGS = nm-new strip-new ar ranlib dlltool
BASEDIR = $(srcdir)/..
@ -71,10 +71,15 @@ INCDIR = $(BASEDIR)/include
MKDEP = gcc -MM
INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\""
INCLUDES = -D_GNU_SOURCE \
-I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
@HDEFINES@ \
-I$(srcdir)/../intl -I../intl \
-DLOCALEDIR="\"$(prefix)/share/locale\"" \
-Dbin_dummy_emulation=$(EMULATION_VECTOR)
HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \
windres.h winduni.h
windres.h winduni.h binemul.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h
@ -84,7 +89,7 @@ CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \
objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \
stabs.c strings.c sysdump.c version.c wrstabs.c \
windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \
resres.c dllwrap.c rename.c
resres.c dllwrap.c rename.c binemul.c emul_$(EMULATION).c
GENERATED_CFILES = \
underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
@ -183,10 +188,12 @@ cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h Makefile
cxxfilt_SOURCES =
cxxfilt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY) $(INTLLIBS)
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c $(BULIBS)
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \
emul_$(EMULATION).c $(BULIBS)
ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c $(BULIBS)
ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \
binemul.c emul_$(EMULATION).c $(BULIBS)
ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
addr2line_SOURCES = addr2line.c $(BULIBS)

View File

@ -80,6 +80,8 @@ DATADIRNAME = @DATADIRNAME@
DEMANGLER_NAME = @DEMANGLER_NAME@
DLLTOOL = @DLLTOOL@
DLLTOOL_DEFS = @DLLTOOL_DEFS@
EMULATION = @EMULATION@
EMULATION_VECTOR = @EMULATION_VECTOR@
EXEEXT = @EXEEXT@
GCJ = @GCJ@
GCJFLAGS = @GCJFLAGS@
@ -169,7 +171,7 @@ noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG)
# Stuff that goes in tooldir/ if appropriate
# Stuff that goes in tooldir/ if appropriate.
TOOL_PROGS = nm-new strip-new ar ranlib dlltool
BASEDIR = $(srcdir)/..
@ -178,10 +180,16 @@ INCDIR = $(BASEDIR)/include
MKDEP = gcc -MM
INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\""
INCLUDES = -D_GNU_SOURCE \
-I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
@HDEFINES@ \
-I$(srcdir)/../intl -I../intl \
-DLOCALEDIR="\"$(prefix)/share/locale\"" \
-Dbin_dummy_emulation=$(EMULATION_VECTOR)
HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \
windres.h winduni.h
windres.h winduni.h binemul.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h
@ -192,7 +200,7 @@ CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \
objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \
stabs.c strings.c sysdump.c version.c wrstabs.c \
windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \
resres.c dllwrap.c rename.c
resres.c dllwrap.c rename.c binemul.c emul_$(EMULATION).c
GENERATED_CFILES = \
@ -260,10 +268,14 @@ objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
cxxfilt_SOURCES =
cxxfilt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY) $(INTLLIBS)
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c $(BULIBS)
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \
emul_$(EMULATION).c $(BULIBS)
ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c $(BULIBS)
ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c \
binemul.c emul_$(EMULATION).c $(BULIBS)
ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
addr2line_SOURCES = addr2line.c $(BULIBS)
@ -360,8 +372,9 @@ objdump_DEPENDENCIES = ../opcodes/libopcodes.la ../bfd/libbfd.la \
../libiberty/libiberty.a
objdump_LDFLAGS =
ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \
not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) bucomm.$(OBJEXT) \
version.$(OBJEXT) filemode.$(OBJEXT)
not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) binemul.$(OBJEXT) \
emul_$(EMULATION).$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \
filemode.$(OBJEXT)
ar_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
ar_LDFLAGS =
strings_OBJECTS = strings.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \
@ -370,8 +383,9 @@ strings_LDADD = $(LDADD)
strings_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
strings_LDFLAGS =
ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \
arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) bucomm.$(OBJEXT) \
version.$(OBJEXT) filemode.$(OBJEXT)
arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) binemul.$(OBJEXT) \
emul_$(EMULATION).$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \
filemode.$(OBJEXT)
ranlib_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
ranlib_LDFLAGS =
objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \
@ -421,7 +435,7 @@ configure.in deflex.c defparse.c nlmheader.c rclex.c rcparse.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(dllwrap_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(readelf_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES) $(cxxfilt_SOURCES)
OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(dllwrap_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(readelf_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS) $(cxxfilt_OBJECTS)

View File

@ -3,29 +3,29 @@
2001, 2002
Free Software Foundation, Inc.
This file is part of GNU Binutils.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
Bugs: should use getopt the way tar does (complete w/optional -) and
should have long options too. GNU ar used to check file against filesystem
in quick_update and replace operations (would check mtime). Doesn't warn
when name truncated. No way to specify pos_end. Error messages should be
more consistant.
*/
more consistant. */
#include "bfd.h"
#include "libiberty.h"
#include "progress.h"
@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "arsup.h"
#include "filenames.h"
#include "binemul.h"
#include <sys/stat.h>
#ifdef __GO32___
@ -251,7 +252,7 @@ usage (help)
if (! is_ranlib)
{
/* xgettext:c-format */
fprintf (s, _("Usage: %s [-X32_64] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n"),
fprintf (s, _("Usage: %s [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n"),
program_name);
/* xgettext:c-format */
fprintf (s, _(" %s -M [<mri-script]\n"), program_name);
@ -277,7 +278,8 @@ usage (help)
fprintf (s, _(" [S] - do not build a symbol table\n"));
fprintf (s, _(" [v] - be verbose\n"));
fprintf (s, _(" [V] - display the version number\n"));
fprintf (s, _(" [-X32_64] - (ignored)\n"));
ar_emul_usage (s);
}
else
{
@ -383,6 +385,7 @@ main (argc, argv)
int file_count;
char *inarch_filename;
int show_version;
int i;
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
setlocale (LC_MESSAGES, "");
@ -444,17 +447,12 @@ main (argc, argv)
xatexit (remove_output);
/* Ignored for (partial) AIX compatibility. On AIX,
the -X option can be used to ignore certain kinds
of object files in the archive (the 64-bit objects
or the 32-bit objects). GNU ar always looks at all
kinds of objects in an archive. */
while (argc > 1 && strcmp (argv[1], "-X32_64") == 0)
{
argv++;
argc--;
}
for (i = 1; i < argc; i++)
if (! ar_emul_parse_arg (argv[i]))
break;
argv += (i - 1);
argc -= (i - 1);
if (is_ranlib)
{
boolean touch = false;
@ -1341,24 +1339,13 @@ replace_members (arch, files_to_move, quick)
after_bfd = get_pos_bfd (&arch->next, pos_after,
current->filename);
temp = *after_bfd;
*after_bfd = bfd_openr (*files_to_move, NULL);
if (*after_bfd == (bfd *) NULL)
if (ar_emul_replace (after_bfd, *files_to_move,
verbose))
{
bfd_fatal (*files_to_move);
/* Snip out this entry from the chain. */
*current_ptr = (*current_ptr)->next;
changed = true;
}
(*after_bfd)->next = temp;
/* snip out this entry from the chain */
*current_ptr = (*current_ptr)->next;
if (verbose)
{
printf ("r - %s\n", *files_to_move);
}
changed = true;
goto next_file;
}
@ -1367,22 +1354,9 @@ replace_members (arch, files_to_move, quick)
}
/* Add to the end of the archive. */
after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
temp = *after_bfd;
*after_bfd = bfd_openr (*files_to_move, NULL);
if (*after_bfd == (bfd *) NULL)
{
bfd_fatal (*files_to_move);
}
if (verbose)
{
printf ("a - %s\n", *files_to_move);
}
(*after_bfd)->next = temp;
changed = true;
if (ar_emul_append (after_bfd, *files_to_move, verbose))
changed = true;
next_file:;

165
binutils/binemul.c Normal file
View File

@ -0,0 +1,165 @@
/* Binutils emulation layer.
Copyright (C) 2002 Free Software Foundation, Inc.
Written by Tom Rix, Redhat.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "binemul.h"
extern bin_emulation_xfer_type bin_dummy_emulation;
void
ar_emul_usage (fp)
FILE *fp;
{
if (bin_dummy_emulation.ar_usage)
bin_dummy_emulation.ar_usage (fp);
}
void
ar_emul_default_usage (fp)
FILE *fp;
{
AR_EMUL_USAGE_PRINT_OPTION_HEADER (fp);
/* xgettext:c-format */
fprintf (fp, _(" No emulation specific options\n"));
}
boolean
ar_emul_append (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
if (bin_dummy_emulation.ar_append)
return bin_dummy_emulation.ar_append (after_bfd, file_name, verbose);
return false;
}
boolean
ar_emul_default_append (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
bfd *temp;
temp = *after_bfd;
*after_bfd = bfd_openr (file_name, NULL);
AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
AR_EMUL_APPEND_PRINT_VERBOSE (verbose, file_name);
(*after_bfd)->next = temp;
return true;
}
boolean
ar_emul_replace (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
if (bin_dummy_emulation.ar_replace)
return bin_dummy_emulation.ar_replace (after_bfd, file_name, verbose);
return false;
}
boolean
ar_emul_default_replace (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
bfd *temp;
temp = *after_bfd;
*after_bfd = bfd_openr (file_name, NULL);
AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name);
(*after_bfd)->next = temp;
return true;
}
boolean
ar_emul_create (abfd_out, archive_file_name, file_name)
bfd **abfd_out;
char *archive_file_name;
char *file_name;
{
if (bin_dummy_emulation.ar_create)
return bin_dummy_emulation.ar_create (abfd_out, archive_file_name,
file_name);
return false;
}
boolean
ar_emul_default_create (abfd_out, archive_file_name, file_name)
bfd **abfd_out;
char *archive_file_name;
char *file_name;
{
char *target = NULL;
/* Try to figure out the target to use for the archive from the
first object on the list. */
if (file_name != NULL)
{
bfd *obj;
obj = bfd_openr (file_name, NULL);
if (obj != NULL)
{
if (bfd_check_format (obj, bfd_object))
target = bfd_get_target (obj);
(void) bfd_close (obj);
}
}
/* Create an empty archive. */
*abfd_out = bfd_openw (archive_file_name, target);
if (*abfd_out == NULL
|| ! bfd_set_format (*abfd_out, bfd_archive)
|| ! bfd_close (*abfd_out))
bfd_fatal (archive_file_name);
return true;
}
boolean
ar_emul_parse_arg (arg)
char *arg;
{
if (bin_dummy_emulation.ar_parse_arg)
return bin_dummy_emulation.ar_parse_arg (arg);
return false;
}
boolean
ar_emul_default_parse_arg (arg)
char *arg;
{
return false;
}

64
binutils/binemul.h Normal file
View File

@ -0,0 +1,64 @@
/* Binutils emulation layer.
Copyright (C) 2002 Free Software Foundation, Inc.
Written by Tom Rix, Redhat.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef BINEMUL_H
#define BINEMUL_H
#include "bfd.h"
#include "bucomm.h"
extern void ar_emul_usage PARAMS ((FILE *));
extern void ar_emul_default_usage PARAMS ((FILE *));
extern boolean ar_emul_append PARAMS ((bfd **, char *, boolean));
extern boolean ar_emul_default_append PARAMS ((bfd **, char *, boolean));
extern boolean ar_emul_replace PARAMS ((bfd **, char *, boolean));
extern boolean ar_emul_default_replace PARAMS ((bfd **, char *, boolean));
extern boolean ar_emul_create PARAMS ((bfd **, char *, char *));
extern boolean ar_emul_default_create PARAMS ((bfd **, char *, char *));
extern boolean ar_emul_parse_arg PARAMS ((char *));
extern boolean ar_emul_default_parse_arg PARAMS ((char *));
/* Macros for common output. */
#define AR_EMUL_USAGE_PRINT_OPTION_HEADER(fp) \
/* xgettext:c-format */ \
fprintf (fp, _(" emulation options: \n"))
#define AR_EMUL_ELEMENT_CHECK(abfd, file_name) \
do { if ((abfd) == (bfd *) NULL) bfd_fatal (file_name); } while (0)
#define AR_EMUL_APPEND_PRINT_VERBOSE(verbose, file_name) \
do { if (verbose) printf ("a - %s\n", file_name); } while (0)
#define AR_EMUL_REPLACE_PRINT_VERBOSE(verbose, file_name) \
do { if (verbose) printf ("r - %s\n", file_name); } while (0)
typedef struct bin_emulation_xfer_struct
{
/* Print out the extra options. */
void (* ar_usage) PARAMS ((FILE *fp));
boolean (* ar_append) PARAMS ((bfd **, char *, boolean));
boolean (* ar_replace) PARAMS ((bfd **, char *, boolean));
boolean (* ar_create) PARAMS ((bfd **, char *, char *));
boolean (* ar_parse_arg) PARAMS ((char *));
}
bin_emulation_xfer_type;
#endif

22
binutils/configure vendored
View File

@ -5596,6 +5596,26 @@ else
fi
# Emulation
for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
do
# Canonicalize the secondary target names.
result=`$ac_config_sub $targ_alias 2>/dev/null`
if test -n "$result"; then
targ=$result
else
targ=$targ_alias
fi
. ${srcdir}/configure.tgt
EMULATION=$targ_emul
EMULATION_VECTOR=$targ_emul_vector
done
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@ -5807,6 +5827,8 @@ s%@BUILD_DLLWRAP@%$BUILD_DLLWRAP%g
s%@BUILD_MISC@%$BUILD_MISC%g
s%@OBJDUMP_DEFS@%$OBJDUMP_DEFS%g
s%@UNDERSCORE@%$UNDERSCORE%g
s%@EMULATION@%$EMULATION%g
s%@EMULATION_VECTOR@%$EMULATION_VECTOR%g
CEOF
EOF

View File

@ -313,6 +313,26 @@ else
fi
AC_SUBST(UNDERSCORE)
# Emulation
for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
do
# Canonicalize the secondary target names.
result=`$ac_config_sub $targ_alias 2>/dev/null`
if test -n "$result"; then
targ=$result
else
targ=$targ_alias
fi
. ${srcdir}/configure.tgt
EMULATION=$targ_emul
EMULATION_VECTOR=$targ_emul_vector
done
AC_SUBST(EMULATION)
AC_SUBST(EMULATION_VECTOR)
AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in,
[
case "x$CONFIG_FILES" in

26
binutils/configure.tgt Normal file
View File

@ -0,0 +1,26 @@
# This is the binutils target specific file. This is invoked by the
# autoconf generated configure script. Putting it in a separate shell
# file lets us skip running autoconf when modifying target specific
# information.
# This file switches on the shell variable ${targ}, and sets the
# following shell variables:
# targ_emul name of emulation to use
# targ_emul_vector name of vector to use
case "${targ}" in
powerpc-*-aix5* | rs6000-*-aix5*)
targ_emul=aix
targ_emul_vector=bin_aix5_emulation
;;
powerpc-*-aix4.3* | rs6000-*-aix4.3*)
targ_emul=aix
targ_emul_vector=bin_aix_emulation
;;
*)
targ_emul=vanilla
targ_emul_vector=bin_vanilla_emulation
;;
esac

View File

@ -81,6 +81,8 @@ DATADIRNAME = @DATADIRNAME@
DEMANGLER_NAME = @DEMANGLER_NAME@
DLLTOOL = @DLLTOOL@
DLLTOOL_DEFS = @DLLTOOL_DEFS@
EMULATION = @EMULATION@
EMULATION_VECTOR = @EMULATION_VECTOR@
EXEEXT = @EXEEXT@
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
GCJ = @GCJ@
@ -175,7 +177,7 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:

212
binutils/emul_aix.c Normal file
View File

@ -0,0 +1,212 @@
/* Binutils emulation layer.
Copyright (C) 2002 Free Software Foundation, Inc.
Written by Tom Rix, Redhat.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "binemul.h"
#include "bfdlink.h"
#include "coff/internal.h"
#include "coff/xcoff.h"
#include "libcoff.h"
#include "libxcoff.h"
/* Default to <bigaf>. */
static boolean big_archive = true;
/* Whether to include 32 bit objects. */
static boolean X32 = true;
/* Whether to include 64 bit objects. */
static boolean X64 = false;
static void ar_emul_aix_usage PARAMS ((FILE *));
static boolean ar_emul_aix_append PARAMS ((bfd **, char *, boolean));
static boolean ar_emul_aix5_append PARAMS ((bfd **, char *, boolean));
static boolean ar_emul_aix_replace PARAMS ((bfd **, char *, boolean));
static boolean ar_emul_aix5_replace PARAMS ((bfd **, char *, boolean));
static boolean ar_emul_aix_parse_arg PARAMS ((char *));
static boolean ar_emul_aix_internal PARAMS ((bfd **, char *, boolean,
const char *, boolean));
static void
ar_emul_aix_usage (fp)
FILE *fp;
{
AR_EMUL_USAGE_PRINT_OPTION_HEADER (fp);
/* xgettext:c-format */
fprintf (fp, _(" [-g] - 32 bit small archive\n"));
fprintf (fp, _(" [-X32] - ignores 64 bit objects\n"));
fprintf (fp, _(" [-X64] - ignores 32 bit objects\n"));
fprintf (fp, _(" [-X32_64] - accepts 32 and 64 bit objects\n"));
}
static boolean
ar_emul_aix_internal (after_bfd, file_name, verbose, target_name, is_append)
bfd **after_bfd;
char *file_name;
boolean verbose;
const char * target_name;
boolean is_append;
{
bfd *temp;
bfd *try_bfd;
temp = *after_bfd;
/* Try 64 bit. */
try_bfd = bfd_openr (file_name, target_name);
/* Failed or the object is possibly 32 bit. */
if (NULL == try_bfd || ! bfd_check_format (try_bfd, bfd_object))
try_bfd = bfd_openr (file_name, "aixcoff-rs6000");
AR_EMUL_ELEMENT_CHECK (try_bfd, file_name);
if (bfd_xcoff_is_xcoff64 (try_bfd) && (! X64))
return false;
if (bfd_xcoff_is_xcoff32 (try_bfd)
&& bfd_check_format (try_bfd, bfd_object) && (! X32))
return false;
if (is_append)
{
AR_EMUL_APPEND_PRINT_VERBOSE (verbose, file_name);
}
else
{
AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name);
}
*after_bfd = try_bfd;
(*after_bfd)->next = temp;
return true;
}
static boolean
ar_emul_aix_append (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
return ar_emul_aix_internal (after_bfd, file_name, verbose,
"aixcoff64-rs6000", true);
}
static boolean
ar_emul_aix5_append (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
return ar_emul_aix_internal (after_bfd, file_name, verbose,
"aix5coff64-rs6000", true);
}
static boolean
ar_emul_aix_replace (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
return ar_emul_aix_internal (after_bfd, file_name, verbose,
"aixcoff64-rs6000", false);
}
static boolean
ar_emul_aix5_replace (after_bfd, file_name, verbose)
bfd **after_bfd;
char *file_name;
boolean verbose;
{
return ar_emul_aix_internal (after_bfd, file_name, verbose,
"aix5coff64-rs6000", false);
}
boolean
ar_emul_aix_create (abfd_out, archive_file_name, file_name)
bfd **abfd_out;
char *archive_file_name;
char *file_name ATTRIBUTE_UNUSED;
{
char *target = "aixcoff-rs6000";
/* Create an empty archive. */
*abfd_out = bfd_openw (archive_file_name, target);
if (*abfd_out == NULL)
bfd_fatal (archive_file_name);
/* set to small or big format. */
/* not done. */
return true;
}
static boolean
ar_emul_aix_parse_arg (arg)
char *arg;
{
if (strncmp (arg, "-X32_64", 6) == 0)
{
big_archive = true;
X32 = true;
X64 = true;
}
else if (strncmp (arg, "-X32", 3) == 0)
{
big_archive = true;
X32 = true;
X64 = false;
}
else if (strncmp (arg, "-X64", 3) == 0)
{
big_archive = true;
X32 = false;
X64 = true;
}
else if (strncmp (arg, "-g", 2) == 0)
{
big_archive = false;
X32 = true;
X64 = false;
}
else
return false;
return true;
}
struct bin_emulation_xfer_struct bin_aix_emulation =
{
ar_emul_aix_usage,
ar_emul_aix_append,
ar_emul_aix_replace,
ar_emul_default_create,
ar_emul_aix_parse_arg,
};
struct bin_emulation_xfer_struct bin_aix5_emulation =
{
ar_emul_aix_usage,
ar_emul_aix5_append,
ar_emul_aix5_replace,
ar_emul_default_create,
ar_emul_aix_parse_arg,
};

30
binutils/emul_vanilla.c Normal file
View File

@ -0,0 +1,30 @@
/* Binutils emulation layer.
Copyright (C) 2002 Free Software Foundation, Inc.
Written by Tom Rix, Redhat.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "binemul.h"
struct bin_emulation_xfer_struct bin_vanilla_emulation =
{
ar_emul_default_usage,
ar_emul_default_append,
ar_emul_default_replace,
ar_emul_default_create,
ar_emul_default_parse_arg,
};

View File

@ -1,3 +1,10 @@
2002-03-18 Tom Rix <trix@redhat.com>
* configure.in: Add AIX 5 support.
* config/tc-ppc.c (ppc_target_format): Add AIX 5 64 bit target.
* config/te-aix5.h: New file. AIX 5 support.
* configure: Regenerate.
2002-03-18 Nick Clifton <nickc@cambridge.redhat.com>
* po/fr.po: Updated version.

View File

@ -71,6 +71,7 @@ CPU_TYPES = \
ppc \
s390 \
sh \
sh64 \
sparc \
tahoe \
tic30 \
@ -79,7 +80,6 @@ CPU_TYPES = \
vax \
w65 \
v850 \
sh64 \
xstormy16 \
z8k
@ -1796,6 +1796,17 @@ DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
$(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
@ -1884,17 +1895,6 @@ DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
@ -2141,6 +2141,14 @@ DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \
DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h
DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
@ -2199,14 +2207,6 @@ DEP_v850_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-v850.h \
DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h
DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h

View File

@ -182,6 +182,7 @@ CPU_TYPES = \
ppc \
s390 \
sh \
sh64 \
sparc \
tahoe \
tic30 \
@ -190,7 +191,6 @@ CPU_TYPES = \
vax \
w65 \
v850 \
sh64 \
xstormy16 \
z8k
@ -1687,6 +1687,19 @@ DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
$(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h
@ -1796,19 +1809,6 @@ DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \
$(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \
$(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h
DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
$(INCDIR)/aout/aout64.h
DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
$(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
@ -2138,6 +2138,16 @@ DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h
DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
@ -2217,16 +2227,6 @@ DEP_v850_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h
DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \
$(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h \
$(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
$(INCDIR)/bfdlink.h

View File

@ -1137,7 +1137,11 @@ ppc_target_format ()
#elif TE_POWERMAC
return "xcoff-powermac";
#else
return ppc_xcoff64 ? "aixcoff64-rs6000" : "aixcoff-rs6000";
# ifdef TE_AIX5
return (ppc_xcoff64 ? "aix5coff64-rs6000" : "aixcoff-rs6000");
# else
return (ppc_xcoff64 ? "aixcoff64-rs6000" : "aixcoff-rs6000");
# endif
#endif
#endif
#ifdef OBJ_ELF

3
gas/config/te-aix5.h Normal file
View File

@ -0,0 +1,3 @@
#define TE_AIX5
x#include "obj-format.h"

339
gas/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -384,6 +384,7 @@ changequote([,])dnl
pj*) fmt=elf ;;
ppc-*-pe | ppc-*-cygwin* | ppc-*-winnt*)
fmt=coff em=pe ;;
ppc-*-aix5*) fmt=coff em=aix5 ;;
ppc-*-aix*) fmt=coff ;;
ppc-*-beos*) fmt=coff ;;
ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)

View File

@ -1,3 +1,7 @@
2002-03-18 Tom Rix <trix@redhat.com>
* rs6k64.h: Add U64_TOCMAGIC, AIX 5 64 bit magic number.
2002-02-01 Tom Rix <trix@redhat.com>
* xcoff.h: Conditionally support <aiaff> for pre AIX 4.3.

View File

@ -1,5 +1,5 @@
/* IBM RS/6000 "XCOFF64" file definitions for BFD.
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -13,40 +13,39 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/********************** FILE HEADER **********************/
struct external_filehdr {
char f_magic[2]; /* magic number */
char f_nscns[2]; /* number of sections */
char f_timdat[4]; /* time & date stamp */
char f_symptr[8];/* file pointer to symtab */
char f_opthdr[2]; /* sizeof(optional hdr) */
char f_flags[2]; /* flags */
char f_nsyms[4]; /* number of symtab entries */
struct external_filehdr
{
char f_magic[2]; /* magic number */
char f_nscns[2]; /* number of sections */
char f_timdat[4]; /* time & date stamp */
char f_symptr[8]; /* file pointer to symtab */
char f_opthdr[2]; /* sizeof(optional hdr) */
char f_flags[2]; /* flags */
char f_nsyms[4]; /* number of symtab entries */
};
/* IBM RS/6000 */
#define U803XTOCMAGIC 0757 /* readonly text segments and TOC, XCOFF64 */
#define BADMAG(x) ((x).f_magic != U803XTOCMAGIC)
/* IBM RS/6000. */
#define U803XTOCMAGIC 0757 /* Aix 4.3 64-bit XCOFF */
#define U64_TOCMAGIC 0767 /* AIX 5+ 64-bit XCOFF */
#define BADMAG(x) ((x).f_magic != U803XTOCMAGIC && (x).f_magic != U64_TOCMAGIC)
#define FILHDR struct external_filehdr
#define FILHSZ 24
/********************** AOUT "OPTIONAL HEADER" **********************/
typedef struct
{
unsigned char magic[2]; /* type of file */
unsigned char vstamp[2]; /* version stamp */
unsigned char o_debugger[4]; /* reserved */
unsigned char text_start[8]; /* base of text used for this file */
unsigned char data_start[8]; /* base of data used for this file */
unsigned char o_toc[8]; /* address of TOC */
unsigned char text_start[8]; /* base of text used for this file */
unsigned char data_start[8]; /* base of data used for this file */
unsigned char o_toc[8]; /* address of TOC */
unsigned char o_snentry[2]; /* section number of entry point */
unsigned char o_sntext[2]; /* section number of .text section */
unsigned char o_sndata[2]; /* section number of .data section */
@ -62,8 +61,8 @@ typedef struct
unsigned char dsize[8]; /* initialized data " " */
unsigned char bsize[8]; /* uninitialized data " " */
unsigned char entry[8]; /* entry pt. */
unsigned char o_maxstack[8]; /* max stack size (??) */
unsigned char o_maxdata[8]; /* max data size (??) */
unsigned char o_maxstack[8]; /* max stack size (??) */
unsigned char o_maxdata[8]; /* max data size (??) */
unsigned char o_resv3[16]; /* reserved */
}
AOUTHDR;
@ -74,22 +73,21 @@ AOUTHDR;
/********************** SECTION HEADER **********************/
struct external_scnhdr {
char s_name[8]; /* section name */
char s_paddr[8]; /* physical address, aliased s_nlib */
char s_vaddr[8]; /* virtual address */
char s_size[8]; /* section size */
char s_scnptr[8]; /* file ptr to raw data for section */
char s_relptr[8]; /* file ptr to relocation */
char s_lnnoptr[8]; /* file ptr to line numbers */
char s_nreloc[4]; /* number of relocation entries */
char s_nlnno[4]; /* number of line number entries*/
char s_flags[4]; /* flags */
char s_pad[4]; /* padding */
struct external_scnhdr
{
char s_name[8]; /* section name */
char s_paddr[8]; /* physical address, aliased s_nlib */
char s_vaddr[8]; /* virtual address */
char s_size[8]; /* section size */
char s_scnptr[8]; /* file ptr to raw data for section */
char s_relptr[8]; /* file ptr to relocation */
char s_lnnoptr[8]; /* file ptr to line numbers */
char s_nreloc[4]; /* number of relocation entries */
char s_nlnno[4]; /* number of line number entries*/
char s_flags[4]; /* flags */
char s_pad[4]; /* padding */
};
#define SCNHDR struct external_scnhdr
#define SCNHSZ 72
@ -97,24 +95,25 @@ struct external_scnhdr {
/********************** LINE NUMBERS **********************/
/* 1 line number entry for every "breakpointable" source line in a section.
* Line numbers are grouped on a per function basis; first entry in a function
* grouping will have l_lnno = 0 and in place of physical address will be the
* symbol table index of the function name.
*/
struct external_lineno {
union {
char l_symndx[4];/* function name symbol index, iff l_lnno == 0*/
char l_paddr[8]; /* (physical) address of line number */
} l_addr;
char l_lnno[4]; /* line number */
};
Line numbers are grouped on a per function basis; first entry in a function
grouping will have l_lnno = 0 and in place of physical address will be the
symbol table index of the function name. */
struct external_lineno
{
union
{
char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/
char l_paddr[8]; /* (physical) address of line number */
} l_addr;
char l_lnno[4]; /* line number */
};
#define LINENO struct external_lineno
#define LINESZ 12
/********************** SYMBOLS **********************/
#define E_SYMNMLEN 8 /* # characters in a symbol name */
@ -131,16 +130,13 @@ struct external_syment
char e_numaux[1];
};
#define N_BTMASK (017)
#define N_TMASK (060)
#define N_BTSHFT (4)
#define N_TSHIFT (2)
union external_auxent {
union external_auxent
{
struct {
union {
struct {
@ -196,26 +192,23 @@ union external_auxent {
#define DBXMASK 0x80 /* for dbx storage mask */
#define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK)
/* Values for auxtype field in XCOFF64, taken from AIX 4.3 sym.h */
/* Values for auxtype field in XCOFF64, taken from AIX 4.3 sym.h. */
#define _AUX_EXCEPT 255
#define _AUX_FCN 254
#define _AUX_SYM 253
#define _AUX_FILE 252
#define _AUX_CSECT 251
/********************** RELOCATION DIRECTIVES **********************/
struct external_reloc {
struct external_reloc
{
char r_vaddr[8];
char r_symndx[4];
char r_size[1];
char r_type[1];
};
#define RELOC struct external_reloc
#define RELSZ 14

View File

@ -1,3 +1,17 @@
2002-03-18 Tom Rix <trix@redhat.com>
* Makefile.am : Add eaix5ppc and eaix5rs6, AIX 5 support.
* configure.tgt : Same.
* emulparms/aix5ppc.sh : New file. For eaix5ppc.
* emulparms/aix5rs6.sh : New file. For eaix5rs6.
* emulparms/aixppc.sh : OUPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT
emulation parameters for better -b32, -b64 support.
* emulparms/aixrs6.sh : Same.
* emulparms/ppcmacos.sh : Same.
* emultempl/aix.em (choose_target) : Use new emulation parameters
OUTPUT_FORMAT_32BIT and OUTPUT_FORMAT_64BIT.
* Makefile.in : Regenerate.
2002-03-18 Nick Clifton <nickc@cambridge.redhat.com>
* po/fr.po: Updated version.

View File

@ -353,6 +353,12 @@ GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
ea29k.c: $(srcdir)/emulparams/a29k.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
${GENSCRIPTS} a29k "$(tdir_a29k)"
eaix5ppc.c: $(srcdir)/emulparams/aix5ppc.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aix5ppc "$(tdir_aixppc)"
eaix5rs6.c: $(srcdir)/emulparams/aix5rs6.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aix5rs6 "$(tdir_aixrs6)"
eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aixppc "$(tdir_aixppc)"

View File

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -507,7 +507,7 @@ deffilep.c ldgram.c ldlex.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
TAR = gtar
GZIP_ENV = --best
SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
OBJECTS = $(ld_new_OBJECTS)
@ -695,7 +695,7 @@ uninstall-info:
else ii=; fi; \
list='$(INFO_DEPS)'; \
for file in $$list; do \
test -z "$ii" \
test -z "$$ii" \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
@$(NORMAL_UNINSTALL)
@ -808,7 +808,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
test "$$subdir" != "." || dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@ -1074,6 +1074,12 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
ea29k.c: $(srcdir)/emulparams/a29k.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
${GENSCRIPTS} a29k "$(tdir_a29k)"
eaix5ppc.c: $(srcdir)/emulparams/aix5ppc.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aix5ppc "$(tdir_aixppc)"
eaix5rs6.c: $(srcdir)/emulparams/aix5rs6.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aix5rs6 "$(tdir_aixrs6)"
eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
$(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
${GENSCRIPTS} aixppc "$(tdir_aixppc)"

446
ld/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -420,8 +420,10 @@ powerpc-*-netware*) targ_emul=ppcnw ;;
powerpcle-*-pe) targ_emul=ppcpe ;;
powerpcle-*-winnt*) targ_emul=ppcpe ;;
powerpcle-*-cygwin*) targ_emul=ppcpe ;;
powerpc-*-aix5*) targ_emul=aix5ppc ;;
powerpc-*-aix*) targ_emul=aixppc ;;
powerpc-*-beos*) targ_emul=aixppc ;;
rs6000-*-aix5*) targ_emul=aix5rs6 ;;
rs6000-*-aix*) targ_emul=aixrs6 ;;
tic30-*-*aout*) targ_emul=tic30aout ;;
tic30-*-*coff*) targ_emul=tic30coff ;;

6
ld/emulparams/aix5ppc.sh Normal file
View File

@ -0,0 +1,6 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="aixcoff-rs6000"
OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
OUTPUT_FORMAT_64BIT="aix5coff64-rs6000"
ARCH=powerpc

6
ld/emulparams/aix5rs6.sh Normal file
View File

@ -0,0 +1,6 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="aixcoff-rs6000"
OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
OUTPUT_FORMAT_64BIT="aix5coff64-rs6000"
ARCH=rs6000

View File

@ -1,5 +1,7 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="aixcoff-rs6000"
OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
OUTPUT_FORMAT_64BIT="aixcoff64-rs6000"
ARCH=powerpc

View File

@ -1,5 +1,7 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="aixcoff-rs6000"
OUTPUT_FORMAT_32BIT="aixcoff-rs6000"
OUTPUT_FORMAT_64BIT="aixcoff64-rs6000"
ARCH=rs6000

View File

@ -1,4 +1,6 @@
TEMPLATE_NAME=aix
SCRIPT_NAME=aix
OUTPUT_FORMAT="xcoff-powermac"
OUTPUT_FORMAT_32BIT="xcoff-powermac"
OUTPUT_FORMAT_64BIT="xcoff-powermac"
ARCH=powerpc

View File

@ -797,8 +797,8 @@ choose_target (argc, argv)
static char *from_inside;
static char *argv_to_target[][2] = {
{NULL, "${OUTPUT_FORMAT}"},
{"-b32", "aixcoff-rs6000"},
{"-b64", "aixcoff64-rs6000"},
{"-b32", "${OUTPUT_FORMAT_32BIT}"},
{"-b64", "${OUTPUT_FORMAT_64BIT}"},
};
jmax = 3;