s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. Simplify

comparisons of bfd_boolean vars with TRUE/FALSE.  Formatting.
This commit is contained in:
Alan Modra 2002-11-30 08:39:46 +00:00
parent 583d52d728
commit b34976b65a
431 changed files with 27178 additions and 25605 deletions

View file

@ -1,3 +1,64 @@
2002-11-30 Alan Modra <amodra@bigpond.net.au>
* bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete.
(enum bfd_boolean, boolean): Delete.
(bfd_boolean): Typedef to an int.
(FALSE, TRUE): Define.
* aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c,
aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h,
aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c,
binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c,
coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c,
coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c,
coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c,
coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c,
coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c,
coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c,
corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c,
cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c,
cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c,
cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.c, cpu-m10200.c,
cpu-m10300.c, cpu-m32r.c, cpu-m68hc11.c, cpu-m68hc12.c, cpu-m68k.c,
cpu-m88k.c, cpu-mcore.c, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c,
cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c,
cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c,
cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c,
cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c,
dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c,
elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c,
elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c,
elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c,
elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h,
elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c,
elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c,
elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c,
elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h,
elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h,
elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c,
hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c,
i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c,
libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h,
libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c,
m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c,
mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c,
nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c,
pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c,
pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c,
pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c,
reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c,
som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c,
syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c,
vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h,
xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with
bfd_boolean, true with TRUE, false with FALSE. Simplify comparisons
of bfd_boolean vars with TRUE/FALSE. Formatting.
* bfd-in2.h, libbfd.h, libcoff.h: Regenerate
2002-11-28 Alan Modra <amodra@bigpond.net.au> 2002-11-28 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h: Replace occurrences of Elf32_Internal_* and * elf-bfd.h: Replace occurrences of Elf32_Internal_* and

View file

@ -204,13 +204,13 @@ aix386_core_file_failing_signal (abfd)
return core_hdr (abfd)->cd_cursig; return core_hdr (abfd)->cd_cursig;
} }
static boolean static bfd_boolean
aix386_core_file_matches_executable_p (core_bfd, exec_bfd) aix386_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd; bfd *core_bfd;
bfd *exec_bfd; bfd *exec_bfd;
{ {
/* FIXME: We have no way of telling at this point. */ /* FIXME: We have no way of telling at this point. */
return true; return TRUE;
} }
/* If somebody calls any byte-swapping routines, shoot them. */ /* If somebody calls any byte-swapping routines, shoot them. */

View file

@ -28,10 +28,14 @@
#include "sysdep.h" #include "sysdep.h"
#include "libbfd.h" #include "libbfd.h"
const bfd_target * xcoff64_core_p PARAMS ((bfd *)); const bfd_target *xcoff64_core_p
boolean xcoff64_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); PARAMS ((bfd *));
char * xcoff64_core_file_failing_command PARAMS ((bfd *)); bfd_boolean xcoff64_core_file_matches_executable_p
int xcoff64_core_file_failing_signal PARAMS ((bfd *)); 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. */ /* Aix 5.1 system include file. */
@ -62,11 +66,11 @@ xcoff64_core_p (abfd)
if (bfd_seek (abfd, 0, SEEK_SET) != 0) if (bfd_seek (abfd, 0, SEEK_SET) != 0)
goto xcoff64_core_p_error; goto xcoff64_core_p_error;
if (sizeof (struct core_dumpxx) if (sizeof (struct core_dumpxx)
!= bfd_bread (&core, sizeof (struct core_dumpxx), abfd)) != bfd_bread (&core, sizeof (struct core_dumpxx), abfd))
goto xcoff64_core_p_error; goto xcoff64_core_p_error;
if (bfd_stat (abfd, &statbuf) < 0) if (bfd_stat (abfd, &statbuf) < 0)
goto xcoff64_core_p_error; goto xcoff64_core_p_error;
/* Sanity checks /* Sanity checks
@ -82,24 +86,24 @@ xcoff64_core_p (abfd)
See rs6000-core.c for comment on size of core See rs6000-core.c for comment on size of core
If there isn't enough of a real core file, bail. */ If there isn't enough of a real core file, bail. */
if ((CORE_VERSION_1 != (core.c_flag & CORE_VERSION_1)) if ((CORE_VERSION_1 != (core.c_flag & CORE_VERSION_1))
|| (0 != core.c_entries) || (0 != core.c_entries)
|| (! (IS_PROC64 (&core.c_u.U_proc))) || (! (IS_PROC64 (&core.c_u.U_proc)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_fdsinfox))) || ((CHECK_FILE_OFFSET (statbuf, core.c_fdsinfox)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader))) || ((CHECK_FILE_OFFSET (statbuf, core.c_loader)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_loader + core.c_lsize))) || ((CHECK_FILE_OFFSET (statbuf, core.c_loader + core.c_lsize)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_thr))) || ((CHECK_FILE_OFFSET (statbuf, core.c_thr)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_segregion))) || ((CHECK_FILE_OFFSET (statbuf, core.c_segregion)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack))) || ((CHECK_FILE_OFFSET (statbuf, core.c_stack)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_stack + core.c_size))) || ((CHECK_FILE_OFFSET (statbuf, core.c_stack + core.c_size)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data))) || ((CHECK_FILE_OFFSET (statbuf, core.c_data)))
|| ((CHECK_FILE_OFFSET (statbuf, core.c_data + core.c_datasize))) || ((CHECK_FILE_OFFSET (statbuf, core.c_data + core.c_datasize)))
|| (! (core.c_flag & UBLOCK_VALID)) || (! (core.c_flag & UBLOCK_VALID))
|| (! (core.c_flag & LE_VALID))) || (! (core.c_flag & LE_VALID)))
goto xcoff64_core_p_error; goto xcoff64_core_p_error;
/* Check for trucated stack or general truncating. */ /* Check for trucated stack or general truncating. */
if ((! (core.c_flag & USTACK_VALID)) if ((! (core.c_flag & USTACK_VALID))
|| (core.c_flag & CORE_TRUNC)) || (core.c_flag & CORE_TRUNC))
{ {
bfd_set_error (bfd_error_file_truncated); bfd_set_error (bfd_error_file_truncated);
@ -109,7 +113,7 @@ xcoff64_core_p (abfd)
new_core_hdr = (struct core_dumpxx *) new_core_hdr = (struct core_dumpxx *)
bfd_zalloc (abfd, sizeof (struct core_dumpxx)); bfd_zalloc (abfd, sizeof (struct core_dumpxx));
if (NULL == new_core_hdr) if (NULL == new_core_hdr)
return return_value; return return_value;
memcpy (new_core_hdr, &core, sizeof (struct core_dumpxx)); memcpy (new_core_hdr, &core, sizeof (struct core_dumpxx));
@ -117,7 +121,7 @@ xcoff64_core_p (abfd)
/* .stack section. */ /* .stack section. */
sec = bfd_make_section_anyway (abfd, ".stack"); sec = bfd_make_section_anyway (abfd, ".stack");
if (NULL == sec) if (NULL == sec)
return return_value; return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
@ -127,7 +131,7 @@ xcoff64_core_p (abfd)
/* .reg section for all registers. */ /* .reg section for all registers. */
sec = bfd_make_section_anyway (abfd, ".reg"); sec = bfd_make_section_anyway (abfd, ".reg");
if (NULL == sec) if (NULL == sec)
return return_value; return return_value;
sec->flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY; sec->flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY;
@ -138,7 +142,7 @@ xcoff64_core_p (abfd)
/* .ldinfo section. /* .ldinfo section.
To actually find out how long this section is in this particular To actually find out how long this section is in this particular
core dump would require going down the whole list of struct core dump would require going down the whole list of struct
ld_info's. See if we can just fake it. */ ld_info's. See if we can just fake it. */
sec = bfd_make_section_anyway (abfd, ".ldinfo"); sec = bfd_make_section_anyway (abfd, ".ldinfo");
if (NULL == sec) if (NULL == sec)
@ -152,10 +156,10 @@ xcoff64_core_p (abfd)
/* AIX 4 adds data sections from loaded objects to the core file, /* AIX 4 adds data sections from loaded objects to the core file,
which can be found by examining ldinfo, and anonymously mmapped which can be found by examining ldinfo, and anonymously mmapped
regions. */ regions. */
/* .data section from executable. */ /* .data section from executable. */
sec = bfd_make_section_anyway (abfd, ".data"); sec = bfd_make_section_anyway (abfd, ".data");
if (NULL == sec) if (NULL == sec)
return return_value; return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
@ -165,20 +169,20 @@ xcoff64_core_p (abfd)
/* .data sections from loaded objects. */ /* .data sections from loaded objects. */
ld_offset = core.c_loader; ld_offset = core.c_loader;
while (1) while (1)
{ {
if (bfd_seek (abfd, ld_offset, SEEK_SET) != 0) if (bfd_seek (abfd, ld_offset, SEEK_SET) != 0)
return return_value; return return_value;
if (sizeof (struct __ld_info64) != if (sizeof (struct __ld_info64) !=
bfd_bread (&ldinfo, sizeof (struct __ld_info64), abfd)) bfd_bread (&ldinfo, sizeof (struct __ld_info64), abfd))
return return_value; return return_value;
if (ldinfo.ldinfo_core) if (ldinfo.ldinfo_core)
{ {
sec = bfd_make_section_anyway (abfd, ".data"); sec = bfd_make_section_anyway (abfd, ".data");
if (NULL == sec) if (NULL == sec)
return return_value; return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
@ -193,20 +197,20 @@ xcoff64_core_p (abfd)
} }
/* .vmdata sections from anonymously mmapped regions. */ /* .vmdata sections from anonymously mmapped regions. */
if (core.c_vmregions) if (core.c_vmregions)
{ {
if (bfd_seek (abfd, core.c_vmm, SEEK_SET) != 0) if (bfd_seek (abfd, core.c_vmm, SEEK_SET) != 0)
return return_value; return return_value;
for (i = 0; i < core.c_vmregions; i++) for (i = 0; i < core.c_vmregions; i++)
if (sizeof (struct vm_infox) != if (sizeof (struct vm_infox) !=
bfd_bread (&vminfo, sizeof (struct vm_infox), abfd)) bfd_bread (&vminfo, sizeof (struct vm_infox), abfd))
return return_value; return return_value;
if (vminfo.vminfo_offset) if (vminfo.vminfo_offset)
{ {
sec = bfd_make_section_anyway (abfd, ".vmdata"); sec = bfd_make_section_anyway (abfd, ".vmdata");
if (NULL == sec) if (NULL == sec)
return return_value; return return_value;
sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
@ -217,17 +221,17 @@ xcoff64_core_p (abfd)
} }
return_value = abfd->xvec; /* This is garbage for now. */ return_value = abfd->xvec; /* This is garbage for now. */
xcoff64_core_p_error: xcoff64_core_p_error:
if (bfd_get_error () != bfd_error_system_call) if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return return_value; return return_value;
} }
/* Return `true' if given core is from the given executable. */ /* Return `TRUE' if given core is from the given executable. */
boolean bfd_boolean
xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd) xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd; bfd *core_bfd;
bfd *exec_bfd; bfd *exec_bfd;
@ -236,22 +240,22 @@ xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
char *path, *s; char *path, *s;
size_t alloc; size_t alloc;
const char *str1, *str2; const char *str1, *str2;
boolean return_value = false; bfd_boolean return_value = FALSE;
/* Get the header. */ /* Get the header. */
if (bfd_seek (core_bfd, 0, SEEK_SET) != 0) if (bfd_seek (core_bfd, 0, SEEK_SET) != 0)
return return_value;
if (sizeof (struct core_dumpxx) !=
bfd_bread (&core, sizeof (struct core_dumpxx), core_bfd))
return return_value; return return_value;
if (bfd_seek (core_bfd, core.c_loader, SEEK_SET) != 0) if (sizeof (struct core_dumpxx) !=
bfd_bread (&core, sizeof (struct core_dumpxx), core_bfd))
return return_value;
if (bfd_seek (core_bfd, core.c_loader, SEEK_SET) != 0)
return return_value; return return_value;
alloc = 100; alloc = 100;
path = bfd_malloc (alloc); path = bfd_malloc (alloc);
if (path == NULL) if (path == NULL)
return return_value; return return_value;
s = path; s = path;
@ -264,13 +268,13 @@ xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
if (*s == '\0') if (*s == '\0')
break; break;
++s; ++s;
if (s == path + alloc) if (s == path + alloc)
{ {
char *n; char *n;
alloc *= 2; alloc *= 2;
n = bfd_realloc (path, alloc); n = bfd_realloc (path, alloc);
if (n == NULL) if (n == NULL)
goto xcoff64_core_file_matches_executable_p_end_1; goto xcoff64_core_file_matches_executable_p_end_1;
s = n + (path - s); s = n + (path - s);
@ -285,8 +289,8 @@ xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
str1 = str1 != NULL ? str1 + 1 : path; str1 = str1 != NULL ? str1 + 1 : path;
str2 = str2 != NULL ? str2 + 1 : exec_bfd->filename; str2 = str2 != NULL ? str2 + 1 : exec_bfd->filename;
if (strcmp (str1, str2) == 0) if (strcmp (str1, str2) == 0)
return_value = true; return_value = TRUE;
xcoff64_core_file_matches_executable_p_end_1: xcoff64_core_file_matches_executable_p_end_1:
free (path); free (path);
@ -300,7 +304,7 @@ xcoff64_core_file_failing_command (abfd)
struct core_dumpxx *c = core_hdr (abfd); struct core_dumpxx *c = core_hdr (abfd);
char *return_value = 0; char *return_value = 0;
if (NULL != c) if (NULL != c)
return_value = c->c_u.U_proc.pi_comm; return_value = c->c_u.U_proc.pi_comm;
return return_value; return return_value;
@ -313,7 +317,7 @@ xcoff64_core_file_failing_signal (abfd)
struct core_dumpxx *c = core_hdr (abfd); struct core_dumpxx *c = core_hdr (abfd);
int return_value = 0; int return_value = 0;
if (NULL != c) if (NULL != c)
return_value = c->c_signo; return_value = c->c_signo;
return return_value; return return_value;
@ -321,10 +325,14 @@ xcoff64_core_file_failing_signal (abfd)
#else /* AIX_5_CORE */ #else /* AIX_5_CORE */
const bfd_target * xcoff64_core_p PARAMS ((bfd *)); const bfd_target *xcoff64_core_p
boolean xcoff64_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); PARAMS ((bfd *));
char * xcoff64_core_file_failing_command PARAMS ((bfd *)); bfd_boolean xcoff64_core_file_matches_executable_p
int xcoff64_core_file_failing_signal PARAMS ((bfd *)); PARAMS ((bfd *, bfd *));
char *xcoff64_core_file_failing_command
PARAMS ((bfd *));
int xcoff64_core_file_failing_signal
PARAMS ((bfd *));
const bfd_target * const bfd_target *
xcoff64_core_p (abfd) xcoff64_core_p (abfd)
@ -334,12 +342,12 @@ xcoff64_core_p (abfd)
return 0; return 0;
} }
boolean bfd_boolean
xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd) xcoff64_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd ATTRIBUTE_UNUSED; bfd *core_bfd ATTRIBUTE_UNUSED;
bfd *exec_bfd ATTRIBUTE_UNUSED; bfd *exec_bfd ATTRIBUTE_UNUSED;
{ {
return false; return FALSE;
} }
char * char *

View file

@ -32,19 +32,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Forward decl. */ /* Forward decl. */
extern const bfd_target a_out_adobe_vec; extern const bfd_target a_out_adobe_vec;
static const bfd_target *aout_adobe_callback PARAMS ((bfd *)); static const bfd_target *aout_adobe_callback
PARAMS ((bfd *));
extern boolean aout_32_slurp_symbol_table PARAMS ((bfd *abfd)); extern bfd_boolean aout_32_slurp_symbol_table
extern boolean aout_32_write_syms PARAMS ((bfd *)); PARAMS ((bfd *abfd));
static void aout_adobe_write_section PARAMS ((bfd *abfd, sec_ptr sect)); extern bfd_boolean aout_32_write_syms
static const bfd_target * aout_adobe_object_p PARAMS ((bfd *)); PARAMS ((bfd *));
static boolean aout_adobe_mkobject PARAMS ((bfd *)); static void aout_adobe_write_section
static boolean aout_adobe_write_object_contents PARAMS ((bfd *)); PARAMS ((bfd *abfd, sec_ptr sect));
static boolean aout_adobe_set_section_contents static const bfd_target * aout_adobe_object_p
PARAMS ((bfd *));
static bfd_boolean aout_adobe_mkobject
PARAMS ((bfd *));
static bfd_boolean aout_adobe_write_object_contents
PARAMS ((bfd *));
static bfd_boolean aout_adobe_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
static boolean aout_adobe_set_arch_mach static bfd_boolean aout_adobe_set_arch_mach
PARAMS ((bfd *, enum bfd_architecture, unsigned long)); PARAMS ((bfd *, enum bfd_architecture, unsigned long));
static int aout_adobe_sizeof_headers PARAMS ((bfd *, boolean)); static int aout_adobe_sizeof_headers
PARAMS ((bfd *, bfd_boolean));
/* Swaps the information in an executable header taken from a raw byte /* Swaps the information in an executable header taken from a raw byte
stream memory image, into the internal exec_header structure. */ stream memory image, into the internal exec_header structure. */
@ -271,7 +278,7 @@ struct bout_data_struct
struct internal_exec e; struct internal_exec e;
}; };
static boolean static bfd_boolean
aout_adobe_mkobject (abfd) aout_adobe_mkobject (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -280,7 +287,7 @@ aout_adobe_mkobject (abfd)
rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, amt); rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, amt);
if (rawptr == NULL) if (rawptr == NULL)
return false; return FALSE;
abfd->tdata.bout_data = rawptr; abfd->tdata.bout_data = rawptr;
exec_hdr (abfd) = &rawptr->e; exec_hdr (abfd) = &rawptr->e;
@ -291,10 +298,10 @@ aout_adobe_mkobject (abfd)
adata (abfd).segment_size = 1; /* Not applicable. */ adata (abfd).segment_size = 1; /* Not applicable. */
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true; return TRUE;
} }
static boolean static bfd_boolean
aout_adobe_write_object_contents (abfd) aout_adobe_write_object_contents (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -342,7 +349,7 @@ aout_adobe_write_object_contents (abfd)
amt = EXEC_BYTES_SIZE; amt = EXEC_BYTES_SIZE;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|| bfd_bwrite ((PTR) &swapped_hdr, amt, abfd) != amt) || bfd_bwrite ((PTR) &swapped_hdr, amt, abfd) != amt)
return false; return FALSE;
/* Now write out the section information. Text first, data next, rest /* Now write out the section information. Text first, data next, rest
afterward. */ afterward. */
@ -362,38 +369,38 @@ aout_adobe_write_object_contents (abfd)
/* Write final `sentinel` section header (with type of 0). */ /* Write final `sentinel` section header (with type of 0). */
amt = sizeof (*sentinel); amt = sizeof (*sentinel);
if (bfd_bwrite ((PTR) sentinel, amt, abfd) != amt) if (bfd_bwrite ((PTR) sentinel, amt, abfd) != amt)
return false; return FALSE;
/* Now write out reloc info, followed by syms and strings. */ /* Now write out reloc info, followed by syms and strings. */
if (bfd_get_symcount (abfd) != 0) if (bfd_get_symcount (abfd) != 0)
{ {
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*exec_hdr (abfd))), SEEK_SET) if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*exec_hdr (abfd))), SEEK_SET)
!= 0) != 0)
return false; return FALSE;
if (! aout_32_write_syms (abfd)) if (! aout_32_write_syms (abfd))
return false; return FALSE;
if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*exec_hdr (abfd))), SEEK_SET) if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*exec_hdr (abfd))), SEEK_SET)
!= 0) != 0)
return false; return FALSE;
for (sect = abfd->sections; sect; sect = sect->next) for (sect = abfd->sections; sect; sect = sect->next)
if (sect->flags & SEC_CODE) if (sect->flags & SEC_CODE)
if (!aout_32_squirt_out_relocs (abfd, sect)) if (!aout_32_squirt_out_relocs (abfd, sect))
return false; return FALSE;
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*exec_hdr (abfd))), SEEK_SET) if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*exec_hdr (abfd))), SEEK_SET)
!= 0) != 0)
return false; return FALSE;
for (sect = abfd->sections; sect; sect = sect->next) for (sect = abfd->sections; sect; sect = sect->next)
if (sect->flags & SEC_DATA) if (sect->flags & SEC_DATA)
if (!aout_32_squirt_out_relocs (abfd, sect)) if (!aout_32_squirt_out_relocs (abfd, sect))
return false; return FALSE;
} }
return true; return TRUE;
} }
static void static void
@ -404,7 +411,7 @@ aout_adobe_write_section (abfd, sect)
/* FIXME XXX */ /* FIXME XXX */
} }
static boolean static bfd_boolean
aout_adobe_set_section_contents (abfd, section, location, offset, count) aout_adobe_set_section_contents (abfd, section, location, offset, count)
bfd *abfd; bfd *abfd;
asection *section; asection *section;
@ -457,34 +464,34 @@ aout_adobe_set_section_contents (abfd, section, location, offset, count)
/* Regardless, once we know what we're doing, we might as well get /* Regardless, once we know what we're doing, we might as well get
going. */ going. */
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0)
return false; return FALSE;
if (count == 0) if (count == 0)
return true; return TRUE;
return bfd_bwrite ((PTR) location, count, abfd) == count; return bfd_bwrite ((PTR) location, count, abfd) == count;
} }
static boolean static bfd_boolean
aout_adobe_set_arch_mach (abfd, arch, machine) aout_adobe_set_arch_mach (abfd, arch, machine)
bfd *abfd; bfd *abfd;
enum bfd_architecture arch; enum bfd_architecture arch;
unsigned long machine; unsigned long machine;
{ {
if (! bfd_default_set_arch_mach (abfd, arch, machine)) if (! bfd_default_set_arch_mach (abfd, arch, machine))
return false; return FALSE;
if (arch == bfd_arch_unknown if (arch == bfd_arch_unknown
|| arch == bfd_arch_m68k) || arch == bfd_arch_m68k)
return true; return TRUE;
return false; return FALSE;
} }
static int static int
aout_adobe_sizeof_headers (ignore_abfd, ignore) aout_adobe_sizeof_headers (ignore_abfd, ignore)
bfd *ignore_abfd ATTRIBUTE_UNUSED; bfd *ignore_abfd ATTRIBUTE_UNUSED;
boolean ignore ATTRIBUTE_UNUSED; bfd_boolean ignore ATTRIBUTE_UNUSED;
{ {
return sizeof (struct internal_exec); return sizeof (struct internal_exec);
} }

View file

@ -1,5 +1,5 @@
/* BFD back-end for raw ARM a.out binaries. /* BFD back-end for raw ARM a.out binaries.
Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001 Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libaout.h" #include "libaout.h"
#include "aout/aout64.h" #include "aout/aout64.h"
static boolean MY(write_object_contents) static bfd_boolean MY(write_object_contents)
PARAMS ((bfd *)); PARAMS ((bfd *));
static bfd_reloc_status_type MY(fix_pcrel_26_done) static bfd_reloc_status_type MY(fix_pcrel_26_done)
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
@ -80,28 +80,28 @@ reloc_howto_type MY(howto_table)[] =
{ {
/* Type rs size bsz pcrel bitpos ovrf sf name part_inpl /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl
readmask setmask pcdone. */ readmask setmask pcdone. */
HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, HOWTO (0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE,
0x000000ff, 0x000000ff, false), 0x000000ff, 0x000000ff, FALSE),
HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, HOWTO (1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE,
0x0000ffff, 0x0000ffff, false), 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, HOWTO (2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE,
0xffffffff, 0xffffffff, false), 0xffffffff, 0xffffffff, FALSE),
HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26), HOWTO (3, 2, 2, 26, TRUE, 0, complain_overflow_signed, MY(fix_pcrel_26),
"ARM26", true, 0x00ffffff, 0x00ffffff, true), "ARM26", TRUE, 0x00ffffff, 0x00ffffff, TRUE),
HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, HOWTO (4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE,
0x000000ff, 0x000000ff, true), 0x000000ff, 0x000000ff, TRUE),
HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, HOWTO (5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE,
0x0000ffff, 0x0000ffff, true), 0x0000ffff, 0x0000ffff, TRUE),
HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, HOWTO (6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE,
0xffffffff, 0xffffffff, true), 0xffffffff, 0xffffffff, TRUE),
HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed, HOWTO (7, 2, 2, 26, FALSE, 0, complain_overflow_signed,
MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0, MY(fix_pcrel_26_done), "ARM26D", TRUE, 0x0, 0x0,
false), FALSE),
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true, HOWTO (9, 0, -1, 16, FALSE, 0, complain_overflow_bitfield, 0, "NEG16", TRUE,
0x0000ffff, 0x0000ffff, false), 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true, HOWTO (10, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, 0, "NEG32", TRUE,
0xffffffff, 0xffffffff, false) 0xffffffff, 0xffffffff, FALSE)
}; };
#define RELOC_ARM_BITS_NEG_BIG ((unsigned int) 0x08) #define RELOC_ARM_BITS_NEG_BIG ((unsigned int) 0x08)

View file

@ -1,5 +1,5 @@
/* BFD backend for CRIS a.out binaries. /* BFD backend for CRIS a.out binaries.
Copyright 2000, 2001 Free Software Foundation, Inc. Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Axis Communications AB. Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson. Written by Hans-Peter Nilsson.
@ -76,7 +76,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define MY_exec_hdr_flags 1 #define MY_exec_hdr_flags 1
#define MY_write_object_contents MY(write_object_contents) #define MY_write_object_contents MY(write_object_contents)
static boolean MY(write_object_contents) PARAMS ((bfd *)); static bfd_boolean MY(write_object_contents) PARAMS ((bfd *));
/* Forward this, so we can use a pointer to it in PARAMS. */ /* Forward this, so we can use a pointer to it in PARAMS. */
struct reloc_ext_external; struct reloc_ext_external;
@ -92,7 +92,7 @@ static void MY(swap_ext_reloc_in) PARAMS ((bfd *, struct
bfd_size_type)); bfd_size_type));
#define MY_set_sizes MY(set_sizes) #define MY_set_sizes MY(set_sizes)
static boolean MY(set_sizes) PARAMS ((bfd *)); static bfd_boolean MY(set_sizes) PARAMS ((bfd *));
/* To set back reloc_size to ext, we make MY(set_sizes) be called /* To set back reloc_size to ext, we make MY(set_sizes) be called
through this construct. Note that MY_set_arch_mach is only called through this construct. Note that MY_set_arch_mach is only called
@ -121,7 +121,7 @@ static boolean MY(set_sizes) PARAMS ((bfd *));
/* We need our own version to set header flags. */ /* We need our own version to set header flags. */
static boolean static bfd_boolean
MY(write_object_contents) (abfd) MY(write_object_contents) (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -143,7 +143,7 @@ MY(write_object_contents) (abfd)
WRITE_HEADERS (abfd, execp); WRITE_HEADERS (abfd, execp);
return true; return TRUE;
} }
/* We need our own for these reasons: /* We need our own for these reasons:
@ -279,7 +279,7 @@ MY(swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount)
"obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;", to avoid changing "obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;", to avoid changing
NAME (aout, set_arch_mach) in aoutx. */ NAME (aout, set_arch_mach) in aoutx. */
static boolean static bfd_boolean
MY(set_sizes) (abfd) MY(set_sizes) (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -297,7 +297,7 @@ MY(set_sizes) (abfd)
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
return true; return TRUE;
} }
/* /*

View file

@ -1,5 +1,5 @@
/* BFD back-end for a.out files encapsulated with COFF headers. /* BFD back-end for a.out files encapsulated with COFF headers.
Copyright 1990, 1991, 1994, 1995, 2000, 2001 Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -123,7 +123,7 @@ encap_real_callback (abfd)
Section contents have already been written. We write the Section contents have already been written. We write the
file header, symbols, and relocation. */ file header, symbols, and relocation. */
boolean bfd_boolean
encap_write_object_contents (abfd) encap_write_object_contents (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -230,7 +230,7 @@ encap_write_object_contents (abfd)
text_size -= N_TXTOFF (outheader); text_size -= N_TXTOFF (outheader);
WRITE_HEADERS(abfd, execp); WRITE_HEADERS(abfd, execp);
return true; return TRUE;
} }
#define MY_write_object_content encap_write_object_contents #define MY_write_object_content encap_write_object_contents

View file

@ -35,7 +35,7 @@ MYNS(bfd_reloc_type_lookup)
PARAMS((bfd *abfd AND PARAMS((bfd *abfd AND
bfd_reloc_code_real_type code)); bfd_reloc_code_real_type code));
boolean bfd_boolean
MYNS(write_object_contents) MYNS(write_object_contents)
PARAMS((bfd *abfd)); PARAMS((bfd *abfd));
@ -100,58 +100,58 @@ reloc_howto_type MY(howto_table)[] =
{ {
/* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
/* ns32k immediate operands. */ /* ns32k immediate operands. */
HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, FALSE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_imm, "NS32K_IMM_8", _bfd_ns32k_reloc_imm, "NS32K_IMM_8",
true, 0x000000ff,0x000000ff, false), TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, false, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, FALSE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_imm, "NS32K_IMM_16", _bfd_ns32k_reloc_imm, "NS32K_IMM_16",
true, 0x0000ffff,0x0000ffff, false), TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, false, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, FALSE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_imm, "NS32K_IMM_32", _bfd_ns32k_reloc_imm, "NS32K_IMM_32",
true, 0xffffffff,0xffffffff, false), TRUE, 0xffffffff,0xffffffff, FALSE),
HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, true, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, TRUE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_8", _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_8",
true, 0x000000ff, 0x000000ff, false), TRUE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, true, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, TRUE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_16", _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_16",
true, 0x0000ffff,0x0000ffff, false), TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, true, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, TRUE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_32", _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_32",
true, 0xffffffff,0xffffffff, false), TRUE, 0xffffffff,0xffffffff, FALSE),
/* ns32k displacements. */ /* ns32k displacements. */
HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 7, false, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 7, FALSE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_disp, "NS32K_DISP_8", _bfd_ns32k_reloc_disp, "NS32K_DISP_8",
true, 0x000000ff,0x000000ff, false), TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 14, false, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 14, FALSE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_disp, "NS32K_DISP_16", _bfd_ns32k_reloc_disp, "NS32K_DISP_16",
true, 0x0000ffff, 0x0000ffff, false), TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 30, false, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 30, FALSE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_disp, "NS32K_DISP_32", _bfd_ns32k_reloc_disp, "NS32K_DISP_32",
true, 0xffffffff, 0xffffffff, false), TRUE, 0xffffffff, 0xffffffff, FALSE),
HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 7, true, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 7, TRUE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_8", _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_8",
true, 0x000000ff,0x000000ff, false), TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 14, true, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 14, TRUE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_16", _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_16",
true, 0x0000ffff,0x0000ffff, false), TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 30, true, 0, complain_overflow_signed, HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 30, TRUE, 0, complain_overflow_signed,
_bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_32", _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_32",
true, 0xffffffff,0xffffffff, false), TRUE, 0xffffffff,0xffffffff, FALSE),
/* Normal 2's complement. */ /* Normal 2's complement. */
HOWTO (BFD_RELOC_8, 0, 0, 8, false, 0, complain_overflow_bitfield,0, HOWTO (BFD_RELOC_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,
"8", true, 0x000000ff,0x000000ff, false), "8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (BFD_RELOC_16, 0, 1, 16, false, 0, complain_overflow_bitfield,0, HOWTO (BFD_RELOC_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,
"16", true, 0x0000ffff,0x0000ffff, false), "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (BFD_RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield,0, HOWTO (BFD_RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,
"32", true, 0xffffffff,0xffffffff, false), "32", TRUE, 0xffffffff,0xffffffff, FALSE),
HOWTO (BFD_RELOC_8_PCREL, 0, 0, 8, true, 0, complain_overflow_signed, 0, HOWTO (BFD_RELOC_8_PCREL, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,
"PCREL_8", true, 0x000000ff,0x000000ff, false), "PCREL_8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (BFD_RELOC_16_PCREL, 0, 1, 16, true, 0, complain_overflow_signed, 0, HOWTO (BFD_RELOC_16_PCREL, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0,
"PCREL_16", true, 0x0000ffff,0x0000ffff, false), "PCREL_16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (BFD_RELOC_32_PCREL, 0, 2, 32, true, 0, complain_overflow_signed, 0, HOWTO (BFD_RELOC_32_PCREL, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0,
"PCREL_32", true, 0xffffffff,0xffffffff, false), "PCREL_32", TRUE, 0xffffffff,0xffffffff, FALSE),
}; };
#define CTOR_TABLE_RELOC_HOWTO(BFD) (MY(howto_table) + 14) #define CTOR_TABLE_RELOC_HOWTO(BFD) (MY(howto_table) + 14)

View file

@ -201,21 +201,21 @@ MY(object_p) (abfd)
#ifndef MY_mkobject #ifndef MY_mkobject
static boolean MY(mkobject) PARAMS ((bfd *)); static bfd_boolean MY(mkobject) PARAMS ((bfd *));
static boolean static bfd_boolean
MY(mkobject) (abfd) MY(mkobject) (abfd)
bfd *abfd; bfd *abfd;
{ {
if (! NAME(aout,mkobject) (abfd)) if (! NAME(aout,mkobject) (abfd))
return false; return FALSE;
#if 0 /* Sizes get set in set_sizes callback, later, after we know #if 0 /* Sizes get set in set_sizes callback, later, after we know
the architecture and machine. */ the architecture and machine. */
adata(abfd).page_size = TARGET_PAGE_SIZE; adata(abfd).page_size = TARGET_PAGE_SIZE;
adata(abfd).segment_size = SEGMENT_SIZE; adata(abfd).segment_size = SEGMENT_SIZE;
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
#endif #endif
return true; return TRUE;
} }
#define MY_mkobject MY(mkobject) #define MY_mkobject MY(mkobject)
#endif #endif
@ -228,10 +228,10 @@ MY(mkobject) (abfd)
section contents, and copy_private_bfd_data is not called until section contents, and copy_private_bfd_data is not called until
after the section contents have been set. */ after the section contents have been set. */
static boolean MY_bfd_copy_private_section_data static bfd_boolean MY_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *)); PARAMS ((bfd *, asection *, bfd *, asection *));
static boolean static bfd_boolean
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
bfd *ibfd; bfd *ibfd;
asection *isec ATTRIBUTE_UNUSED; asection *isec ATTRIBUTE_UNUSED;
@ -241,7 +241,7 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour
&& bfd_get_flavour (obfd) == bfd_target_aout_flavour) && bfd_get_flavour (obfd) == bfd_target_aout_flavour)
obj_aout_subformat (obfd) = obj_aout_subformat (ibfd); obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
return true; return TRUE;
} }
#endif #endif
@ -251,9 +251,9 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
file header, symbols, and relocation. */ file header, symbols, and relocation. */
#ifndef MY_write_object_contents #ifndef MY_write_object_contents
static boolean MY(write_object_contents) PARAMS ((bfd *)); static bfd_boolean MY(write_object_contents) PARAMS ((bfd *));
static boolean static bfd_boolean
MY(write_object_contents) (abfd) MY(write_object_contents) (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -264,16 +264,16 @@ MY(write_object_contents) (abfd)
WRITE_HEADERS(abfd, execp); WRITE_HEADERS(abfd, execp);
return true; return TRUE;
} }
#define MY_write_object_contents MY(write_object_contents) #define MY_write_object_contents MY(write_object_contents)
#endif #endif
#ifndef MY_set_sizes #ifndef MY_set_sizes
static boolean MY(set_sizes) PARAMS ((bfd *)); static bfd_boolean MY(set_sizes) PARAMS ((bfd *));
static boolean static bfd_boolean
MY(set_sizes) (abfd) MY(set_sizes) (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -287,7 +287,7 @@ MY(set_sizes) (abfd)
#endif #endif
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true; return TRUE;
} }
#define MY_set_sizes MY(set_sizes) #define MY_set_sizes MY(set_sizes)
#endif #endif
@ -375,9 +375,9 @@ MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff)
/* Final link routine. We need to use a call back to get the correct /* Final link routine. We need to use a call back to get the correct
offsets in the output file. */ offsets in the output file. */
static boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *));
static boolean static bfd_boolean
MY_bfd_final_link (abfd, info) MY_bfd_final_link (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;

View file

@ -56,18 +56,23 @@ static bfd_reloc_status_type tic30_aout_relocate_contents
static bfd_reloc_status_type tic30_aout_final_link_relocate static bfd_reloc_status_type tic30_aout_final_link_relocate
PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma, PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma,
bfd_vma, bfd_vma)); bfd_vma, bfd_vma));
static const bfd_target *tic30_aout_object_p PARAMS ((bfd *)); static const bfd_target *tic30_aout_object_p
static boolean tic30_aout_write_object_contents PARAMS ((bfd *)); PARAMS ((bfd *));
static boolean tic30_aout_set_sizes PARAMS ((bfd *)); static bfd_boolean tic30_aout_write_object_contents
static const bfd_target * tic30_aout_callback PARAMS ((bfd *)); PARAMS ((bfd *));
static boolean MY_bfd_copy_private_section_data static bfd_boolean tic30_aout_set_sizes
PARAMS ((bfd *));
static const bfd_target * tic30_aout_callback
PARAMS ((bfd *));
static bfd_boolean MY_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *)); PARAMS ((bfd *, asection *, bfd *, asection *));
static boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); static bfd_boolean MY_bfd_final_link
PARAMS ((bfd *, struct bfd_link_info *));
reloc_howto_type * tic30_aout_reloc_type_lookup reloc_howto_type * tic30_aout_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
enum machine_type tic30_aout_machine_type enum machine_type tic30_aout_machine_type
PARAMS ((enum bfd_architecture, unsigned long, boolean *)); PARAMS ((enum bfd_architecture, unsigned long, bfd_boolean *));
boolean tic30_aout_set_arch_mach bfd_boolean tic30_aout_set_arch_mach
PARAMS ((bfd *, enum bfd_architecture, unsigned long)); PARAMS ((bfd *, enum bfd_architecture, unsigned long));
#define MY_reloc_howto(BFD, REL, IN, EX, PC) \ #define MY_reloc_howto(BFD, REL, IN, EX, PC) \
@ -146,16 +151,16 @@ static const struct aout_backend_data tic30_aout_backend_data =
reloc_howto_type tic30_aout_howto_table[] = reloc_howto_type tic30_aout_howto_table[] =
{ {
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
HOWTO (1, 2, 1, 16, false, 0, 0, tic30_aout_fix_16, HOWTO (1, 2, 1, 16, FALSE, 0, 0, tic30_aout_fix_16,
"16", false, 0x0000FFFF, 0x0000FFFF, false), "16", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
HOWTO (2, 2, 2, 24, false, 0, complain_overflow_bitfield, NULL, HOWTO (2, 2, 2, 24, FALSE, 0, complain_overflow_bitfield, NULL,
"24", false, 0x00FFFFFF, 0x00FFFFFF, false), "24", FALSE, 0x00FFFFFF, 0x00FFFFFF, FALSE),
HOWTO (3, 18, 3, 24, false, 0, complain_overflow_bitfield, NULL, HOWTO (3, 18, 3, 24, FALSE, 0, complain_overflow_bitfield, NULL,
"LDP", false, 0x00FF0000, 0x000000FF, false), "LDP", FALSE, 0x00FF0000, 0x000000FF, FALSE),
HOWTO (4, 2, 4, 32, false, 0, complain_overflow_bitfield, tic30_aout_fix_32, HOWTO (4, 2, 4, 32, FALSE, 0, complain_overflow_bitfield, tic30_aout_fix_32,
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false), "32", FALSE, 0xFFFFFFFF, 0xFFFFFFFF, FALSE),
HOWTO (5, 2, 1, 16, true, 0, complain_overflow_signed, HOWTO (5, 2, 1, 16, TRUE, 0, complain_overflow_signed,
tic30_aout_fix_pcrel_16, "PCREL", true, 0x0000FFFF, 0x0000FFFF, true), tic30_aout_fix_pcrel_16, "PCREL", TRUE, 0x0000FFFF, 0x0000FFFF, TRUE),
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
@ -164,7 +169,7 @@ reloc_howto_type tic30_aout_howto_table[] =
}; };
extern reloc_howto_type *NAME (aout, reloc_type_lookup) extern reloc_howto_type *NAME (aout, reloc_type_lookup)
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
reloc_howto_type * reloc_howto_type *
tic30_aout_reloc_type_lookup (abfd, code) tic30_aout_reloc_type_lookup (abfd, code)
@ -420,7 +425,7 @@ tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
bfd_byte *location; bfd_byte *location;
{ {
bfd_vma x; bfd_vma x;
boolean overflow; bfd_boolean overflow;
if (howto->size < 0) if (howto->size < 0)
relocation = -relocation; relocation = -relocation;
@ -445,7 +450,7 @@ tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
break; break;
} }
overflow = false; overflow = FALSE;
if (howto->complain_on_overflow != complain_overflow_dont) if (howto->complain_on_overflow != complain_overflow_dont)
{ {
@ -491,14 +496,14 @@ tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
bfd_signed_vma reloc_signed_min = ~reloc_signed_max; bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
overflow = true; overflow = TRUE;
} }
break; break;
case complain_overflow_unsigned: case complain_overflow_unsigned:
{ {
bfd_vma reloc_unsigned_max = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1; bfd_vma reloc_unsigned_max = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
if (check > reloc_unsigned_max) if (check > reloc_unsigned_max)
overflow = true; overflow = TRUE;
} }
break; break;
case complain_overflow_bitfield: case complain_overflow_bitfield:
@ -507,7 +512,7 @@ tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
if ((check & ~reloc_bits) != 0 if ((check & ~reloc_bits) != 0
&& (((bfd_vma) signed_check & ~reloc_bits) && (((bfd_vma) signed_check & ~reloc_bits)
!= ((bfd_vma) -1 & ~reloc_bits))) != ((bfd_vma) -1 & ~reloc_bits)))
overflow = true; overflow = TRUE;
} }
break; break;
default: default:
@ -607,7 +612,7 @@ tic30_aout_object_p (abfd)
section contents, and copy_private_bfd_data is not called until section contents, and copy_private_bfd_data is not called until
after the section contents have been set. */ after the section contents have been set. */
static boolean static bfd_boolean
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
bfd *ibfd; bfd *ibfd;
asection *isec ATTRIBUTE_UNUSED; asection *isec ATTRIBUTE_UNUSED;
@ -616,14 +621,14 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
{ {
if (bfd_get_flavour (obfd) == bfd_target_aout_flavour) if (bfd_get_flavour (obfd) == bfd_target_aout_flavour)
obj_aout_subformat (obfd) = obj_aout_subformat (ibfd); obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
return true; return TRUE;
} }
/* Write an object file. /* Write an object file.
Section contents have already been written. We write the Section contents have already been written. We write the
file header, symbols, and relocation. */ file header, symbols, and relocation. */
static boolean static bfd_boolean
tic30_aout_write_object_contents (abfd) tic30_aout_write_object_contents (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -650,10 +655,10 @@ tic30_aout_write_object_contents (abfd)
{ {
bfd_size_type amt; bfd_size_type amt;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
return false; return FALSE;
amt = adata (abfd).exec_bytes_size; amt = adata (abfd).exec_bytes_size;
if (bfd_bwrite ((PTR) &exec_bytes, amt, abfd) != amt) if (bfd_bwrite ((PTR) &exec_bytes, amt, abfd) != amt)
return false; return FALSE;
} }
/* Now write out reloc info, followed by syms and strings. */ /* Now write out reloc info, followed by syms and strings. */
@ -661,27 +666,27 @@ tic30_aout_write_object_contents (abfd)
&& bfd_get_symcount (abfd) != 0) && bfd_get_symcount (abfd) != 0)
{ {
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0) if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0)
return false; return FALSE;
if (!NAME (aout, write_syms) (abfd)) if (!NAME (aout, write_syms) (abfd))
return false; return FALSE;
} }
if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0) if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0)
return false; return FALSE;
if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd)))
return false; return FALSE;
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0) if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0)
return false; return FALSE;
if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
return false; return FALSE;
} }
return true; return TRUE;
} }
static boolean static bfd_boolean
tic30_aout_set_sizes (abfd) tic30_aout_set_sizes (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -701,7 +706,7 @@ tic30_aout_set_sizes (abfd)
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true; return TRUE;
} }
#ifndef MY_final_link_callback #ifndef MY_final_link_callback
@ -732,7 +737,7 @@ MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff)
/* Final link routine. We need to use a call back to get the correct /* Final link routine. We need to use a call back to get the correct
offsets in the output file. */ offsets in the output file. */
static boolean static bfd_boolean
MY_bfd_final_link (abfd, info) MY_bfd_final_link (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -800,40 +805,40 @@ enum machine_type
tic30_aout_machine_type (arch, machine, unknown) tic30_aout_machine_type (arch, machine, unknown)
enum bfd_architecture arch; enum bfd_architecture arch;
unsigned long machine ATTRIBUTE_UNUSED; unsigned long machine ATTRIBUTE_UNUSED;
boolean *unknown; bfd_boolean *unknown;
{ {
enum machine_type arch_flags; enum machine_type arch_flags;
arch_flags = M_UNKNOWN; arch_flags = M_UNKNOWN;
*unknown = true; *unknown = TRUE;
switch (arch) switch (arch)
{ {
case bfd_arch_tic30: case bfd_arch_tic30:
*unknown = false; *unknown = FALSE;
break; break;
default: default:
arch_flags = M_UNKNOWN; arch_flags = M_UNKNOWN;
} }
if (arch_flags != M_UNKNOWN) if (arch_flags != M_UNKNOWN)
*unknown = false; *unknown = FALSE;
return arch_flags; return arch_flags;
} }
boolean bfd_boolean
tic30_aout_set_arch_mach (abfd, arch, machine) tic30_aout_set_arch_mach (abfd, arch, machine)
bfd *abfd; bfd *abfd;
enum bfd_architecture arch; enum bfd_architecture arch;
unsigned long machine; unsigned long machine;
{ {
if (!bfd_default_set_arch_mach (abfd, arch, machine)) if (!bfd_default_set_arch_mach (abfd, arch, machine))
return false; return FALSE;
if (arch != bfd_arch_unknown) if (arch != bfd_arch_unknown)
{ {
boolean unknown; bfd_boolean unknown;
tic30_aout_machine_type (arch, machine, &unknown); tic30_aout_machine_type (arch, machine, &unknown);
if (unknown) if (unknown)
return false; return FALSE;
} }
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
return (*aout_backend_info (abfd)->set_sizes) (abfd); return (*aout_backend_info (abfd)->set_sizes) (abfd);

View file

@ -75,15 +75,24 @@ The name put into the target vector.
#define sunos_write_object_contents aout_32_sunos4_write_object_contents #define sunos_write_object_contents aout_32_sunos4_write_object_contents
#endif #endif
static boolean sunos_merge_private_bfd_data PARAMS ((bfd *, bfd *)); static bfd_boolean sunos_merge_private_bfd_data
static void sunos_set_arch_mach PARAMS ((bfd *, enum machine_type)); PARAMS ((bfd *, bfd *));
static void choose_reloc_size PARAMS ((bfd *)); static void sunos_set_arch_mach
static boolean sunos_write_object_contents PARAMS ((bfd *)); PARAMS ((bfd *, enum machine_type));
static const bfd_target *sunos4_core_file_p PARAMS ((bfd *)); static void choose_reloc_size
static char *sunos4_core_file_failing_command PARAMS ((bfd *)); PARAMS ((bfd *));
static int sunos4_core_file_failing_signal PARAMS ((bfd *)); static bfd_boolean sunos_write_object_contents
static boolean sunos4_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); PARAMS ((bfd *));
static boolean sunos4_set_sizes PARAMS ((bfd *)); static const bfd_target *sunos4_core_file_p
PARAMS ((bfd *));
static char *sunos4_core_file_failing_command
PARAMS ((bfd *));
static int sunos4_core_file_failing_signal
PARAMS ((bfd *));
static bfd_boolean sunos4_core_file_matches_executable_p
PARAMS ((bfd *, bfd *));
static bfd_boolean sunos4_set_sizes
PARAMS ((bfd *));
/* Merge backend data into the output file. /* Merge backend data into the output file.
This is necessary on sparclet-aout where we want the resultant machine This is necessary on sparclet-aout where we want the resultant machine
@ -91,13 +100,13 @@ static boolean sunos4_set_sizes PARAMS ((bfd *));
#define MY_bfd_merge_private_bfd_data sunos_merge_private_bfd_data #define MY_bfd_merge_private_bfd_data sunos_merge_private_bfd_data
static boolean static bfd_boolean
sunos_merge_private_bfd_data (ibfd, obfd) sunos_merge_private_bfd_data (ibfd, obfd)
bfd *ibfd, *obfd; bfd *ibfd, *obfd;
{ {
if (bfd_get_flavour (ibfd) != bfd_target_aout_flavour if (bfd_get_flavour (ibfd) != bfd_target_aout_flavour
|| bfd_get_flavour (obfd) != bfd_target_aout_flavour) || bfd_get_flavour (obfd) != bfd_target_aout_flavour)
return true; return TRUE;
if (bfd_get_arch (obfd) == bfd_arch_sparc) if (bfd_get_arch (obfd) == bfd_arch_sparc)
{ {
@ -105,7 +114,7 @@ sunos_merge_private_bfd_data (ibfd, obfd)
bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd)); bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd));
} }
return true; return TRUE;
} }
/* This is either sunos_32_set_arch_mach or sunos_64_set_arch_mach, /* This is either sunos_32_set_arch_mach or sunos_64_set_arch_mach,
@ -207,7 +216,7 @@ choose_reloc_size (abfd)
aout_64_sunos4_write_object_contents or aout_64_sunos4_write_object_contents or
aout_32_sunos4_write_object_contents, depending upon ARCH_SIZE. */ aout_32_sunos4_write_object_contents, depending upon ARCH_SIZE. */
static boolean static bfd_boolean
sunos_write_object_contents (abfd) sunos_write_object_contents (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -264,7 +273,7 @@ sunos_write_object_contents (abfd)
WRITE_HEADERS (abfd, execp); WRITE_HEADERS (abfd, execp);
return true; return TRUE;
} }
/* core files */ /* core files */
@ -731,7 +740,7 @@ sunos4_core_file_failing_signal (abfd)
return core_hdr (abfd)->hdr->c_signo; return core_hdr (abfd)->hdr->c_signo;
} }
static boolean static bfd_boolean
sunos4_core_file_matches_executable_p (core_bfd, exec_bfd) sunos4_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd; bfd *core_bfd;
bfd *exec_bfd; bfd *exec_bfd;
@ -739,12 +748,12 @@ sunos4_core_file_matches_executable_p (core_bfd, exec_bfd)
if (core_bfd->xvec != exec_bfd->xvec) if (core_bfd->xvec != exec_bfd->xvec)
{ {
bfd_set_error (bfd_error_system_call); bfd_set_error (bfd_error_system_call);
return false; return FALSE;
} }
/* Solaris core files do not include an aouthdr. */ /* Solaris core files do not include an aouthdr. */
if ((core_hdr (core_bfd)->hdr)->c_len == SOLARIS_BCP_CORE_LEN) if ((core_hdr (core_bfd)->hdr)->c_len == SOLARIS_BCP_CORE_LEN)
return true; return TRUE;
return (memcmp ((char *) &((core_hdr (core_bfd)->hdr)->c_aouthdr), return (memcmp ((char *) &((core_hdr (core_bfd)->hdr)->c_aouthdr),
(char *) exec_hdr (exec_bfd), (char *) exec_hdr (exec_bfd),
@ -752,24 +761,24 @@ sunos4_core_file_matches_executable_p (core_bfd, exec_bfd)
} }
#define MY_set_sizes sunos4_set_sizes #define MY_set_sizes sunos4_set_sizes
static boolean static bfd_boolean
sunos4_set_sizes (abfd) sunos4_set_sizes (abfd)
bfd *abfd; bfd *abfd;
{ {
switch (bfd_get_arch (abfd)) switch (bfd_get_arch (abfd))
{ {
default: default:
return false; return FALSE;
case bfd_arch_sparc: case bfd_arch_sparc:
adata (abfd).page_size = 0x2000; adata (abfd).page_size = 0x2000;
adata (abfd).segment_size = 0x2000; adata (abfd).segment_size = 0x2000;
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true; return TRUE;
case bfd_arch_m68k: case bfd_arch_m68k:
adata (abfd).page_size = 0x2000; adata (abfd).page_size = 0x2000;
adata (abfd).segment_size = 0x20000; adata (abfd).segment_size = 0x20000;
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true; return TRUE;
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -160,17 +160,20 @@ struct ar_cache {
#define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data)) #define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data))
#define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header) #define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header)
static char *get_extended_arelt_filename PARAMS ((bfd *arch, static char *get_extended_arelt_filename
const char *name)); PARAMS ((bfd *arch, const char *name));
static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd)); static bfd_boolean do_slurp_bsd_armap
static boolean do_slurp_coff_armap PARAMS ((bfd *abfd)); PARAMS ((bfd *abfd));
boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *abfd)); static bfd_boolean do_slurp_coff_armap
static const char *normalize PARAMS ((bfd *, const char *file)); PARAMS ((bfd *abfd));
static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd, bfd_boolean bfd_elf64_archive_slurp_armap
const char *, PARAMS ((bfd *abfd));
bfd *member)); static const char *normalize
PARAMS ((bfd *, const char *file));
static struct areltdata *bfd_ar_hdr_from_filesystem
PARAMS ((bfd *abfd, const char *, bfd *member));
boolean bfd_boolean
_bfd_generic_mkarchive (abfd) _bfd_generic_mkarchive (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -178,7 +181,7 @@ _bfd_generic_mkarchive (abfd)
abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt);
if (bfd_ardata (abfd) == NULL) if (bfd_ardata (abfd) == NULL)
return false; return FALSE;
bfd_ardata (abfd)->cache = NULL; bfd_ardata (abfd)->cache = NULL;
bfd_ardata (abfd)->archive_head = NULL; bfd_ardata (abfd)->archive_head = NULL;
@ -186,7 +189,7 @@ _bfd_generic_mkarchive (abfd)
bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->extended_names = NULL;
bfd_ardata (abfd)->tdata = NULL; bfd_ardata (abfd)->tdata = NULL;
return true; return TRUE;
} }
/* /*
@ -247,21 +250,21 @@ FUNCTION
bfd_set_archive_head bfd_set_archive_head
SYNOPSIS SYNOPSIS
boolean bfd_set_archive_head(bfd *output, bfd *new_head); bfd_boolean bfd_set_archive_head(bfd *output, bfd *new_head);
DESCRIPTION DESCRIPTION
Set the head of the chain of Set the head of the chain of
BFDs contained in the archive @var{output} to @var{new_head}. BFDs contained in the archive @var{output} to @var{new_head}.
*/ */
boolean bfd_boolean
bfd_set_archive_head (output_archive, new_head) bfd_set_archive_head (output_archive, new_head)
bfd *output_archive; bfd *output_archive;
bfd *new_head; bfd *new_head;
{ {
output_archive->archive_head = new_head; output_archive->archive_head = new_head;
return true; return TRUE;
} }
bfd * bfd *
@ -280,7 +283,7 @@ _bfd_look_for_bfd_in_cache (arch_bfd, filepos)
} }
/* Kind of stupid to call cons for each one, but we don't do too many */ /* Kind of stupid to call cons for each one, but we don't do too many */
boolean bfd_boolean
_bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt) _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt)
bfd *arch_bfd, *new_elt; bfd *arch_bfd, *new_elt;
file_ptr filepos; file_ptr filepos;
@ -289,7 +292,7 @@ _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt)
struct ar_cache *new_cache = (struct ar_cache *) bfd_zalloc (arch_bfd, amt); struct ar_cache *new_cache = (struct ar_cache *) bfd_zalloc (arch_bfd, amt);
if (new_cache == NULL) if (new_cache == NULL)
return false; return FALSE;
new_cache->ptr = filepos; new_cache->ptr = filepos;
new_cache->arelt = new_elt; new_cache->arelt = new_elt;
@ -305,7 +308,7 @@ _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt)
current->next = new_cache; current->next = new_cache;
} }
return true; return TRUE;
} }
/* The name begins with space. Hence the rest of the name is an index into /* The name begins with space. Hence the rest of the name is an index into
@ -664,10 +667,10 @@ bfd_generic_archive_p (abfd)
first = bfd_openr_next_archived_file (abfd, (bfd *) NULL); first = bfd_openr_next_archived_file (abfd, (bfd *) NULL);
if (first != NULL) if (first != NULL)
{ {
boolean fail; bfd_boolean fail;
first->target_defaulted = false; first->target_defaulted = FALSE;
fail = false; fail = FALSE;
if (bfd_check_format (first, bfd_object) if (bfd_check_format (first, bfd_object)
&& first->xvec != abfd->xvec) && first->xvec != abfd->xvec)
{ {
@ -707,9 +710,9 @@ bfd_generic_archive_p (abfd)
/* The size of the string count. */ /* The size of the string count. */
#define BSD_STRING_COUNT_SIZE 4 #define BSD_STRING_COUNT_SIZE 4
/* Returns false on error, true otherwise */ /* Returns FALSE on error, TRUE otherwise */
static boolean static bfd_boolean
do_slurp_bsd_armap (abfd) do_slurp_bsd_armap (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -723,13 +726,13 @@ do_slurp_bsd_armap (abfd)
mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
if (mapdata == NULL) if (mapdata == NULL)
return false; return FALSE;
parsed_size = mapdata->parsed_size; parsed_size = mapdata->parsed_size;
bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */
raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size); raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size);
if (raw_armap == (bfd_byte *) NULL) if (raw_armap == (bfd_byte *) NULL)
return false; return FALSE;
if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size) if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size)
{ {
@ -737,7 +740,7 @@ do_slurp_bsd_armap (abfd)
bfd_set_error (bfd_error_malformed_archive); bfd_set_error (bfd_error_malformed_archive);
byebye: byebye:
bfd_release (abfd, (PTR) raw_armap); bfd_release (abfd, (PTR) raw_armap);
return false; return FALSE;
} }
ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE; ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE;
@ -758,7 +761,7 @@ do_slurp_bsd_armap (abfd)
amt = (bfd_size_type) ardata->symdef_count * sizeof (carsym); amt = (bfd_size_type) ardata->symdef_count * sizeof (carsym);
ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); ardata->symdefs = (carsym *) bfd_alloc (abfd, amt);
if (!ardata->symdefs) if (!ardata->symdefs)
return false; return FALSE;
for (counter = 0, set = ardata->symdefs; for (counter = 0, set = ardata->symdefs;
counter < ardata->symdef_count; counter < ardata->symdef_count;
@ -774,13 +777,13 @@ do_slurp_bsd_armap (abfd)
/* FIXME, we should provide some way to free raw_ardata when /* FIXME, we should provide some way to free raw_ardata when
we are done using the strings from it. For now, it seems we are done using the strings from it. For now, it seems
to be allocated on an objalloc anyway... */ to be allocated on an objalloc anyway... */
bfd_has_map (abfd) = true; bfd_has_map (abfd) = TRUE;
return true; return TRUE;
} }
/* Returns false on error, true otherwise. */ /* Returns FALSE on error, TRUE otherwise. */
static boolean static bfd_boolean
do_slurp_coff_armap (abfd) do_slurp_coff_armap (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -799,7 +802,7 @@ do_slurp_coff_armap (abfd)
mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
if (mapdata == NULL) if (mapdata == NULL)
return false; return FALSE;
parsed_size = mapdata->parsed_size; parsed_size = mapdata->parsed_size;
bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */
@ -807,7 +810,7 @@ do_slurp_coff_armap (abfd)
{ {
if (bfd_get_error () != bfd_error_system_call) if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_malformed_archive); bfd_set_error (bfd_error_malformed_archive);
return false; return FALSE;
} }
/* It seems that all numeric information in a coff archive is always /* It seems that all numeric information in a coff archive is always
in big endian format, nomatter the host or target. */ in big endian format, nomatter the host or target. */
@ -840,7 +843,7 @@ do_slurp_coff_armap (abfd)
ardata->symdefs = (carsym *) bfd_zalloc (abfd, carsym_size + stringsize + 1); ardata->symdefs = (carsym *) bfd_zalloc (abfd, carsym_size + stringsize + 1);
if (ardata->symdefs == NULL) if (ardata->symdefs == NULL)
return false; return FALSE;
carsyms = ardata->symdefs; carsyms = ardata->symdefs;
stringbase = ((char *) ardata->symdefs) + carsym_size; stringbase = ((char *) ardata->symdefs) + carsym_size;
@ -872,7 +875,7 @@ do_slurp_coff_armap (abfd)
/* Pad to an even boundary if you have to. */ /* Pad to an even boundary if you have to. */
ardata->first_file_filepos += (ardata->first_file_filepos) % 2; ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
bfd_has_map (abfd) = true; bfd_has_map (abfd) = TRUE;
bfd_release (abfd, (PTR) raw_armap); bfd_release (abfd, (PTR) raw_armap);
/* Check for a second archive header (as used by PE). */ /* Check for a second archive header (as used by PE). */
@ -893,19 +896,19 @@ do_slurp_coff_armap (abfd)
} }
} }
return true; return TRUE;
release_raw_armap: release_raw_armap:
bfd_release (abfd, (PTR) raw_armap); bfd_release (abfd, (PTR) raw_armap);
release_symdefs: release_symdefs:
bfd_release (abfd, (PTR) (ardata)->symdefs); bfd_release (abfd, (PTR) (ardata)->symdefs);
return false; return FALSE;
} }
/* This routine can handle either coff-style or bsd-style armaps. /* This routine can handle either coff-style or bsd-style armaps.
Returns false on error, true otherwise */ Returns FALSE on error, TRUE otherwise */
boolean bfd_boolean
bfd_slurp_armap (abfd) bfd_slurp_armap (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -913,12 +916,12 @@ bfd_slurp_armap (abfd)
int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
if (i == 0) if (i == 0)
return true; return TRUE;
if (i != 16) if (i != 16)
return false; return FALSE;
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
return false; return FALSE;
if (!strncmp (nextname, "__.SYMDEF ", 16) if (!strncmp (nextname, "__.SYMDEF ", 16)
|| !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */
@ -932,22 +935,22 @@ bfd_slurp_armap (abfd)
return bfd_elf64_archive_slurp_armap (abfd); return bfd_elf64_archive_slurp_armap (abfd);
#else #else
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return false; return FALSE;
#endif #endif
} }
bfd_has_map (abfd) = false; bfd_has_map (abfd) = FALSE;
return true; return TRUE;
} }
/* Returns false on error, true otherwise */ /* Returns FALSE on error, TRUE otherwise */
/* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the /* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the
header is in a slightly different order and the map name is '/'. header is in a slightly different order and the map name is '/'.
This flavour is used by hp300hpux. */ This flavour is used by hp300hpux. */
#define HPUX_SYMDEF_COUNT_SIZE 2 #define HPUX_SYMDEF_COUNT_SIZE 2
boolean bfd_boolean
bfd_slurp_bsd_armap_f2 (abfd) bfd_slurp_bsd_armap_f2 (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -963,13 +966,13 @@ bfd_slurp_bsd_armap_f2 (abfd)
int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
if (i == 0) if (i == 0)
return true; return TRUE;
if (i != 16) if (i != 16)
return false; return FALSE;
/* The archive has at least 16 bytes in it. */ /* The archive has at least 16 bytes in it. */
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
return false; return FALSE;
if (!strncmp (nextname, "__.SYMDEF ", 16) if (!strncmp (nextname, "__.SYMDEF ", 16)
|| !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */
@ -977,13 +980,13 @@ bfd_slurp_bsd_armap_f2 (abfd)
if (strncmp (nextname, "/ ", 16)) if (strncmp (nextname, "/ ", 16))
{ {
bfd_has_map (abfd) = false; bfd_has_map (abfd) = FALSE;
return true; return TRUE;
} }
mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
if (mapdata == NULL) if (mapdata == NULL)
return false; return FALSE;
amt = mapdata->parsed_size; amt = mapdata->parsed_size;
raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt); raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt);
@ -991,7 +994,7 @@ bfd_slurp_bsd_armap_f2 (abfd)
{ {
byebye: byebye:
bfd_release (abfd, (PTR) mapdata); bfd_release (abfd, (PTR) mapdata);
return false; return FALSE;
} }
if (bfd_bread ((PTR) raw_armap, amt, abfd) != amt) if (bfd_bread ((PTR) raw_armap, amt, abfd) != amt)
@ -1024,7 +1027,7 @@ bfd_slurp_bsd_armap_f2 (abfd)
amt = (bfd_size_type) ardata->symdef_count * BSD_SYMDEF_SIZE; amt = (bfd_size_type) ardata->symdef_count * BSD_SYMDEF_SIZE;
ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); ardata->symdefs = (carsym *) bfd_alloc (abfd, amt);
if (!ardata->symdefs) if (!ardata->symdefs)
return false; return FALSE;
for (counter = 0, set = ardata->symdefs; for (counter = 0, set = ardata->symdefs;
counter < ardata->symdef_count; counter < ardata->symdef_count;
@ -1040,8 +1043,8 @@ bfd_slurp_bsd_armap_f2 (abfd)
/* FIXME, we should provide some way to free raw_ardata when /* FIXME, we should provide some way to free raw_ardata when
we are done using the strings from it. For now, it seems we are done using the strings from it. For now, it seems
to be allocated on an objalloc anyway... */ to be allocated on an objalloc anyway... */
bfd_has_map (abfd) = true; bfd_has_map (abfd) = TRUE;
return true; return TRUE;
} }
/** Extended name table. /** Extended name table.
@ -1054,9 +1057,9 @@ bfd_slurp_bsd_armap_f2 (abfd)
element>. Index is the P.R. of an int (decimal). Data General have element>. Index is the P.R. of an int (decimal). Data General have
extended the format by using the prefix // for the special element. */ extended the format by using the prefix // for the special element. */
/* Returns false on error, true otherwise. */ /* Returns FALSE on error, TRUE otherwise. */
boolean bfd_boolean
_bfd_slurp_extended_name_table (abfd) _bfd_slurp_extended_name_table (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -1065,23 +1068,23 @@ _bfd_slurp_extended_name_table (abfd)
bfd_size_type amt; bfd_size_type amt;
/* FIXME: Formatting sucks here, and in case of failure of BFD_READ, /* FIXME: Formatting sucks here, and in case of failure of BFD_READ,
we probably don't want to return true. */ we probably don't want to return TRUE. */
bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET); bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET);
if (bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd) == 16) if (bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd) == 16)
{ {
if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
return false; return FALSE;
if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 && if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 &&
strncmp (nextname, "// ", 16) != 0) strncmp (nextname, "// ", 16) != 0)
{ {
bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->extended_names = NULL;
return true; return TRUE;
} }
namedata = (struct areltdata *) _bfd_read_ar_hdr (abfd); namedata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
if (namedata == NULL) if (namedata == NULL)
return false; return FALSE;
amt = namedata->parsed_size; amt = namedata->parsed_size;
bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt); bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt);
@ -1089,7 +1092,7 @@ _bfd_slurp_extended_name_table (abfd)
{ {
byebye: byebye:
bfd_release (abfd, (PTR) namedata); bfd_release (abfd, (PTR) namedata);
return false; return FALSE;
} }
if (bfd_bread ((PTR) bfd_ardata (abfd)->extended_names, amt, abfd) != amt) if (bfd_bread ((PTR) bfd_ardata (abfd)->extended_names, amt, abfd) != amt)
@ -1129,7 +1132,7 @@ _bfd_slurp_extended_name_table (abfd)
bfd_release (abfd, namedata); bfd_release (abfd, namedata);
#endif #endif
} }
return true; return TRUE;
} }
#ifdef VMS #ifdef VMS
@ -1199,7 +1202,7 @@ normalize (abfd, file)
/* Build a BFD style extended name table. */ /* Build a BFD style extended name table. */
boolean bfd_boolean
_bfd_archive_bsd_construct_extended_name_table (abfd, tabloc, tablen, name) _bfd_archive_bsd_construct_extended_name_table (abfd, tabloc, tablen, name)
bfd *abfd; bfd *abfd;
char **tabloc; char **tabloc;
@ -1207,12 +1210,12 @@ _bfd_archive_bsd_construct_extended_name_table (abfd, tabloc, tablen, name)
const char **name; const char **name;
{ {
*name = "ARFILENAMES/"; *name = "ARFILENAMES/";
return _bfd_construct_extended_name_table (abfd, false, tabloc, tablen); return _bfd_construct_extended_name_table (abfd, FALSE, tabloc, tablen);
} }
/* Build an SVR4 style extended name table. */ /* Build an SVR4 style extended name table. */
boolean bfd_boolean
_bfd_archive_coff_construct_extended_name_table (abfd, tabloc, tablen, name) _bfd_archive_coff_construct_extended_name_table (abfd, tabloc, tablen, name)
bfd *abfd; bfd *abfd;
char **tabloc; char **tabloc;
@ -1220,21 +1223,21 @@ _bfd_archive_coff_construct_extended_name_table (abfd, tabloc, tablen, name)
const char **name; const char **name;
{ {
*name = "//"; *name = "//";
return _bfd_construct_extended_name_table (abfd, true, tabloc, tablen); return _bfd_construct_extended_name_table (abfd, TRUE, tabloc, tablen);
} }
/* Follows archive_head and produces an extended name table if /* Follows archive_head and produces an extended name table if
necessary. Returns (in tabloc) a pointer to an extended name necessary. Returns (in tabloc) a pointer to an extended name
table, and in tablen the length of the table. If it makes an entry table, and in tablen the length of the table. If it makes an entry
it clobbers the filename so that the element may be written without it clobbers the filename so that the element may be written without
further massage. Returns true if it ran successfully, false if further massage. Returns TRUE if it ran successfully, FALSE if
something went wrong. A successful return may still involve a something went wrong. A successful return may still involve a
zero-length tablen! */ zero-length tablen! */
boolean bfd_boolean
_bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
bfd *abfd; bfd *abfd;
boolean trailing_slash; bfd_boolean trailing_slash;
char **tabloc; char **tabloc;
bfd_size_type *tablen; bfd_size_type *tablen;
{ {
@ -1253,7 +1256,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
normal = normalize (current, current->filename); normal = normalize (current, current->filename);
if (normal == NULL) if (normal == NULL)
return false; return FALSE;
thislen = strlen (normal); thislen = strlen (normal);
@ -1289,11 +1292,11 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
} }
if (total_namelen == 0) if (total_namelen == 0)
return true; return TRUE;
*tabloc = bfd_zalloc (abfd, total_namelen); *tabloc = bfd_zalloc (abfd, total_namelen);
if (*tabloc == NULL) if (*tabloc == NULL)
return false; return FALSE;
*tablen = total_namelen; *tablen = total_namelen;
strptr = *tabloc; strptr = *tabloc;
@ -1306,7 +1309,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
normal = normalize (current, current->filename); normal = normalize (current, current->filename);
if (normal == NULL) if (normal == NULL)
return false; return FALSE;
thislen = strlen (normal); thislen = strlen (normal);
if (thislen > maxname) if (thislen > maxname)
@ -1341,7 +1344,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
} }
} }
return true; return TRUE;
} }
/** A couple of functions for creating ar_hdrs */ /** A couple of functions for creating ar_hdrs */
@ -1458,7 +1461,8 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member)
a strong stomach to write this, and it does, but it takes even a a strong stomach to write this, and it does, but it takes even a
stronger stomach to try to code around such a thing! */ stronger stomach to try to code around such a thing! */
struct ar_hdr *bfd_special_undocumented_glue PARAMS ((bfd *, const char *)); struct ar_hdr *bfd_special_undocumented_glue
PARAMS ((bfd *, const char *));
struct ar_hdr * struct ar_hdr *
bfd_special_undocumented_glue (abfd, filename) bfd_special_undocumented_glue (abfd, filename)
@ -1669,7 +1673,7 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr)
/* The BFD is open for write and has its format set to bfd_archive. */ /* The BFD is open for write and has its format set to bfd_archive. */
boolean bfd_boolean
_bfd_write_archive_contents (arch) _bfd_write_archive_contents (arch)
bfd *arch; bfd *arch;
{ {
@ -1677,8 +1681,9 @@ _bfd_write_archive_contents (arch)
char *etable = NULL; char *etable = NULL;
bfd_size_type elength = 0; bfd_size_type elength = 0;
const char *ename = NULL; const char *ename = NULL;
boolean makemap = bfd_has_map (arch); bfd_boolean makemap = bfd_has_map (arch);
boolean hasobjects = false; /* If no .o's, don't bother to make a map. */ /* If no .o's, don't bother to make a map. */
bfd_boolean hasobjects = FALSE;
bfd_size_type wrote; bfd_size_type wrote;
unsigned int i; unsigned int i;
int tries; int tries;
@ -1696,14 +1701,14 @@ _bfd_write_archive_contents (arch)
if (bfd_write_p (current)) if (bfd_write_p (current))
{ {
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return false; return FALSE;
} }
if (!current->arelt_data) if (!current->arelt_data)
{ {
current->arelt_data = current->arelt_data =
(PTR) bfd_ar_hdr_from_filesystem (arch, current->filename, current); (PTR) bfd_ar_hdr_from_filesystem (arch, current->filename, current);
if (!current->arelt_data) if (!current->arelt_data)
return false; return FALSE;
/* Put in the file name. */ /* Put in the file name. */
BFD_SEND (arch, _bfd_truncate_arname, (arch, BFD_SEND (arch, _bfd_truncate_arname, (arch,
@ -1718,28 +1723,28 @@ _bfd_write_archive_contents (arch)
&& ((bfd_get_file_flags (current) & HAS_SYMS)) && ((bfd_get_file_flags (current) & HAS_SYMS))
#endif #endif
) )
hasobjects = true; hasobjects = TRUE;
} }
} }
if (!BFD_SEND (arch, _bfd_construct_extended_name_table, if (!BFD_SEND (arch, _bfd_construct_extended_name_table,
(arch, &etable, &elength, &ename))) (arch, &etable, &elength, &ename)))
return false; return FALSE;
if (bfd_seek (arch, (file_ptr) 0, SEEK_SET) != 0) if (bfd_seek (arch, (file_ptr) 0, SEEK_SET) != 0)
return false; return FALSE;
#ifdef GNU960 #ifdef GNU960
wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), (bfd_size_type) SARMAG, arch); wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), (bfd_size_type) SARMAG, arch);
#else #else
wrote = bfd_bwrite (ARMAG, (bfd_size_type) SARMAG, arch); wrote = bfd_bwrite (ARMAG, (bfd_size_type) SARMAG, arch);
#endif #endif
if (wrote != SARMAG) if (wrote != SARMAG)
return false; return FALSE;
if (makemap && hasobjects) if (makemap && hasobjects)
{ {
if (! _bfd_compute_and_write_armap (arch, (unsigned int) elength)) if (! _bfd_compute_and_write_armap (arch, (unsigned int) elength))
return false; return FALSE;
} }
if (elength != 0) if (elength != 0)
@ -1758,11 +1763,11 @@ _bfd_write_archive_contents (arch)
if ((bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) if ((bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
!= sizeof (struct ar_hdr)) != sizeof (struct ar_hdr))
|| bfd_bwrite (etable, elength, arch) != elength) || bfd_bwrite (etable, elength, arch) != elength)
return false; return FALSE;
if ((elength % 2) == 1) if ((elength % 2) == 1)
{ {
if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1)
return false; return FALSE;
} }
} }
@ -1775,9 +1780,9 @@ _bfd_write_archive_contents (arch)
/* Write ar header. */ /* Write ar header. */
if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch) if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch)
!= sizeof (*hdr)) != sizeof (*hdr))
return false; return FALSE;
if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0)
return false; return FALSE;
while (remaining) while (remaining)
{ {
unsigned int amt = DEFAULT_BUFFERSIZE; unsigned int amt = DEFAULT_BUFFERSIZE;
@ -1788,16 +1793,16 @@ _bfd_write_archive_contents (arch)
{ {
if (bfd_get_error () != bfd_error_system_call) if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_malformed_archive); bfd_set_error (bfd_error_malformed_archive);
return false; return FALSE;
} }
if (bfd_bwrite (buffer, (bfd_size_type) amt, arch) != amt) if (bfd_bwrite (buffer, (bfd_size_type) amt, arch) != amt)
return false; return FALSE;
remaining -= amt; remaining -= amt;
} }
if ((arelt_size (current) % 2) == 1) if ((arelt_size (current) % 2) == 1)
{ {
if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1)
return false; return FALSE;
} }
} }
@ -1820,12 +1825,12 @@ _bfd_write_archive_contents (arch)
while (++tries < 6); while (++tries < 6);
} }
return true; return TRUE;
} }
/* Note that the namidx for the first symbol is 0. */ /* Note that the namidx for the first symbol is 0. */
boolean bfd_boolean
_bfd_compute_and_write_armap (arch, elength) _bfd_compute_and_write_armap (arch, elength)
bfd *arch; bfd *arch;
unsigned int elength; unsigned int elength;
@ -1839,7 +1844,7 @@ _bfd_compute_and_write_armap (arch, elength)
int stridx = 0; /* string index */ int stridx = 0; /* string index */
asymbol **syms = NULL; asymbol **syms = NULL;
long syms_max = 0; long syms_max = 0;
boolean ret; bfd_boolean ret;
bfd_size_type amt; bfd_size_type amt;
/* Dunno if this is the best place for this info... */ /* Dunno if this is the best place for this info... */
@ -1968,10 +1973,10 @@ _bfd_compute_and_write_armap (arch, elength)
if (first_name != NULL) if (first_name != NULL)
bfd_release (arch, first_name); bfd_release (arch, first_name);
return false; return FALSE;
} }
boolean bfd_boolean
bsd_write_armap (arch, elength, map, orl_count, stridx) bsd_write_armap (arch, elength, map, orl_count, stridx)
bfd *arch; bfd *arch;
unsigned int elength; unsigned int elength;
@ -2012,10 +2017,10 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
(((char *) (&hdr))[i]) = ' '; (((char *) (&hdr))[i]) = ' ';
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
!= sizeof (struct ar_hdr)) != sizeof (struct ar_hdr))
return false; return FALSE;
H_PUT_32 (arch, ranlibsize, temp); H_PUT_32 (arch, ranlibsize, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp))
return false; return FALSE;
for (count = 0; count < orl_count; count++) for (count = 0; count < orl_count; count++)
{ {
@ -2037,19 +2042,19 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
H_PUT_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE); H_PUT_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE);
if (bfd_bwrite (buf, (bfd_size_type) BSD_SYMDEF_SIZE, arch) if (bfd_bwrite (buf, (bfd_size_type) BSD_SYMDEF_SIZE, arch)
!= BSD_SYMDEF_SIZE) != BSD_SYMDEF_SIZE)
return false; return FALSE;
} }
/* Now write the strings themselves. */ /* Now write the strings themselves. */
H_PUT_32 (arch, stringsize, temp); H_PUT_32 (arch, stringsize, temp);
if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp))
return false; return FALSE;
for (count = 0; count < orl_count; count++) for (count = 0; count < orl_count; count++)
{ {
size_t len = strlen (*map[count].name) + 1; size_t len = strlen (*map[count].name) + 1;
if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
return false; return FALSE;
} }
/* The spec sez this should be a newline. But in order to be /* The spec sez this should be a newline. But in order to be
@ -2057,19 +2062,19 @@ bsd_write_armap (arch, elength, map, orl_count, stridx)
if (padit) if (padit)
{ {
if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
return false; return FALSE;
} }
return true; return TRUE;
} }
/* At the end of archive file handling, update the timestamp in the /* At the end of archive file handling, update the timestamp in the
file, so the linker will accept it. file, so the linker will accept it.
Return true if the timestamp was OK, or an unusual problem happened. Return TRUE if the timestamp was OK, or an unusual problem happened.
Return false if we updated the timestamp. */ Return FALSE if we updated the timestamp. */
boolean bfd_boolean
_bfd_archive_bsd_update_armap_timestamp (arch) _bfd_archive_bsd_update_armap_timestamp (arch)
bfd *arch; bfd *arch;
{ {
@ -2085,11 +2090,11 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
bfd_perror (_("Reading archive file mod timestamp")); bfd_perror (_("Reading archive file mod timestamp"));
/* Can't read mod time for some reason. */ /* Can't read mod time for some reason. */
return true; return TRUE;
} }
if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp) if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp)
/* OK by the linker's rules. */ /* OK by the linker's rules. */
return true; return TRUE;
/* Update the timestamp. */ /* Update the timestamp. */
bfd_ardata (arch)->armap_timestamp = archstat.st_mtime + ARMAP_TIME_OFFSET; bfd_ardata (arch)->armap_timestamp = archstat.st_mtime + ARMAP_TIME_OFFSET;
@ -2111,11 +2116,11 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
bfd_perror (_("Writing updated armap timestamp")); bfd_perror (_("Writing updated armap timestamp"));
/* Some error while writing. */ /* Some error while writing. */
return true; return TRUE;
} }
/* We updated the timestamp successfully. */ /* We updated the timestamp successfully. */
return false; return FALSE;
} }
/* A coff armap looks like : /* A coff armap looks like :
@ -2132,7 +2137,7 @@ _bfd_archive_bsd_update_armap_timestamp (arch)
symbol name n-1 symbol name n-1
*/ */
boolean bfd_boolean
coff_write_armap (arch, elength, map, symbol_count, stridx) coff_write_armap (arch, elength, map, symbol_count, stridx)
bfd *arch; bfd *arch;
unsigned int elength; unsigned int elength;
@ -2179,10 +2184,10 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
!= sizeof (struct ar_hdr)) != sizeof (struct ar_hdr))
return false; return FALSE;
if (!bfd_write_bigendian_4byte_int (arch, symbol_count)) if (!bfd_write_bigendian_4byte_int (arch, symbol_count))
return false; return FALSE;
/* Two passes, first write the file offsets for each symbol - /* Two passes, first write the file offsets for each symbol -
remembering that each offset is on a two byte boundary. */ remembering that each offset is on a two byte boundary. */
@ -2200,7 +2205,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
while (count < symbol_count && map[count].u.abfd == current) while (count < symbol_count && map[count].u.abfd == current)
{ {
if (!bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr)) if (!bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr))
return false; return FALSE;
count++; count++;
} }
/* Add size of this archive entry. */ /* Add size of this archive entry. */
@ -2217,7 +2222,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
size_t len = strlen (*map[count].name) + 1; size_t len = strlen (*map[count].name) + 1;
if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
return false; return FALSE;
} }
/* The spec sez this should be a newline. But in order to be /* The spec sez this should be a newline. But in order to be
@ -2225,8 +2230,8 @@ coff_write_armap (arch, elength, map, symbol_count, stridx)
if (padit) if (padit)
{ {
if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
return false; return FALSE;
} }
return true; return TRUE;
} }

View file

@ -1,5 +1,5 @@
/* MIPS-specific support for 64-bit ELF /* MIPS-specific support for 64-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support Ian Lance Taylor, Cygnus Support
Linker support added by Mark Mitchell, CodeSourcery, LLC. Linker support added by Mark Mitchell, CodeSourcery, LLC.
@ -31,13 +31,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Irix 6 defines a 64bit archive map format, so that they can /* Irix 6 defines a 64bit archive map format, so that they can
have archives more than 4 GB in size. */ have archives more than 4 GB in size. */
boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *)); bfd_boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *));
boolean bfd_elf64_archive_write_armap bfd_boolean bfd_elf64_archive_write_armap
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
/* Read an Irix 6 armap. */ /* Read an Irix 6 armap. */
boolean bfd_boolean
bfd_elf64_archive_slurp_armap (abfd) bfd_elf64_archive_slurp_armap (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -58,12 +58,12 @@ bfd_elf64_archive_slurp_armap (abfd)
arhdrpos = bfd_tell (abfd); arhdrpos = bfd_tell (abfd);
i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
if (i == 0) if (i == 0)
return true; return TRUE;
if (i != 16) if (i != 16)
return false; return FALSE;
if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0) if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0)
return false; return FALSE;
/* Archives with traditional armaps are still permitted. */ /* Archives with traditional armaps are still permitted. */
if (strncmp (nextname, "/ ", 16) == 0) if (strncmp (nextname, "/ ", 16) == 0)
@ -71,13 +71,13 @@ bfd_elf64_archive_slurp_armap (abfd)
if (strncmp (nextname, "/SYM64/ ", 16) != 0) if (strncmp (nextname, "/SYM64/ ", 16) != 0)
{ {
bfd_has_map (abfd) = false; bfd_has_map (abfd) = FALSE;
return true; return TRUE;
} }
mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
if (mapdata == NULL) if (mapdata == NULL)
return false; return FALSE;
parsed_size = mapdata->parsed_size; parsed_size = mapdata->parsed_size;
bfd_release (abfd, (PTR) mapdata); bfd_release (abfd, (PTR) mapdata);
@ -85,7 +85,7 @@ bfd_elf64_archive_slurp_armap (abfd)
{ {
if (bfd_get_error () != bfd_error_system_call) if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_malformed_archive); bfd_set_error (bfd_error_malformed_archive);
return false; return FALSE;
} }
nsymz = bfd_getb64 (int_buf); nsymz = bfd_getb64 (int_buf);
@ -97,7 +97,7 @@ bfd_elf64_archive_slurp_armap (abfd)
amt = carsym_size + stringsize + 1; amt = carsym_size + stringsize + 1;
ardata->symdefs = (carsym *) bfd_zalloc (abfd, amt); ardata->symdefs = (carsym *) bfd_zalloc (abfd, amt);
if (ardata->symdefs == NULL) if (ardata->symdefs == NULL)
return false; return FALSE;
carsyms = ardata->symdefs; carsyms = ardata->symdefs;
stringbase = ((char *) ardata->symdefs) + carsym_size; stringbase = ((char *) ardata->symdefs) + carsym_size;
@ -127,23 +127,23 @@ bfd_elf64_archive_slurp_armap (abfd)
/* Pad to an even boundary if you have to. */ /* Pad to an even boundary if you have to. */
ardata->first_file_filepos += (ardata->first_file_filepos) % 2; ardata->first_file_filepos += (ardata->first_file_filepos) % 2;
bfd_has_map (abfd) = true; bfd_has_map (abfd) = TRUE;
bfd_release (abfd, raw_armap); bfd_release (abfd, raw_armap);
return true; return TRUE;
release_raw_armap: release_raw_armap:
bfd_release (abfd, raw_armap); bfd_release (abfd, raw_armap);
release_symdefs: release_symdefs:
bfd_release (abfd, ardata->symdefs); bfd_release (abfd, ardata->symdefs);
return false; return FALSE;
} }
/* Write out an Irix 6 armap. The Irix 6 tools are supposed to be /* Write out an Irix 6 armap. The Irix 6 tools are supposed to be
able to handle ordinary ELF armaps, but at least on Irix 6.2 the able to handle ordinary ELF armaps, but at least on Irix 6.2 the
linker crashes. */ linker crashes. */
boolean bfd_boolean
bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
bfd *arch; bfd *arch;
unsigned int elength; unsigned int elength;
@ -189,11 +189,11 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
!= sizeof (struct ar_hdr)) != sizeof (struct ar_hdr))
return false; return FALSE;
bfd_putb64 ((bfd_vma) symbol_count, buf); bfd_putb64 ((bfd_vma) symbol_count, buf);
if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8) if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8)
return false; return FALSE;
/* Two passes, first write the file offsets for each symbol - /* Two passes, first write the file offsets for each symbol -
remembering that each offset is on a two byte boundary. */ remembering that each offset is on a two byte boundary. */
@ -212,7 +212,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
{ {
bfd_putb64 ((bfd_vma) archive_member_file_ptr, buf); bfd_putb64 ((bfd_vma) archive_member_file_ptr, buf);
if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8) if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8)
return false; return FALSE;
count++; count++;
} }
/* Add size of this archive entry */ /* Add size of this archive entry */
@ -229,7 +229,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
size_t len = strlen (*map[count].name) + 1; size_t len = strlen (*map[count].name) + 1;
if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
return false; return FALSE;
} }
/* The spec says that this should be padded to an 8 byte boundary. /* The spec says that this should be padded to an 8 byte boundary.
@ -237,9 +237,9 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
while (padding != 0) while (padding != 0)
{ {
if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
return false; return FALSE;
--padding; --padding;
} }
return true; return TRUE;
} }

View file

@ -306,15 +306,15 @@ DESCRIPTION
. const char *arch_name; . const char *arch_name;
. const char *printable_name; . const char *printable_name;
. unsigned int section_align_power; . unsigned int section_align_power;
. {* True if this is the default machine for the architecture. . {* TRUE if this is the default machine for the architecture.
. The default arch should be the first entry for an arch so that . The default arch should be the first entry for an arch so that
. all the entries for that arch can be accessed via <<next>>. *} . all the entries for that arch can be accessed via <<next>>. *}
. boolean the_default; . bfd_boolean the_default;
. const struct bfd_arch_info * (*compatible) . const struct bfd_arch_info * (*compatible)
. PARAMS ((const struct bfd_arch_info *a, . PARAMS ((const struct bfd_arch_info *a,
. const struct bfd_arch_info *b)); . const struct bfd_arch_info *b));
. .
. boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); . bfd_boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
. .
. const struct bfd_arch_info *next; . const struct bfd_arch_info *next;
.} .}
@ -585,7 +585,7 @@ DESCRIPTION
*/ */
const bfd_arch_info_type bfd_default_arch_struct = { const bfd_arch_info_type bfd_default_arch_struct = {
32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, true, 32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,
@ -615,7 +615,7 @@ INTERNAL_FUNCTION
bfd_default_set_arch_mach bfd_default_set_arch_mach
SYNOPSIS SYNOPSIS
boolean bfd_default_set_arch_mach(bfd *abfd, bfd_boolean bfd_default_set_arch_mach(bfd *abfd,
enum bfd_architecture arch, enum bfd_architecture arch,
unsigned long mach); unsigned long mach);
@ -626,7 +626,7 @@ DESCRIPTION
pointer. pointer.
*/ */
boolean bfd_boolean
bfd_default_set_arch_mach (abfd, arch, mach) bfd_default_set_arch_mach (abfd, arch, mach)
bfd *abfd; bfd *abfd;
enum bfd_architecture arch; enum bfd_architecture arch;
@ -634,11 +634,11 @@ bfd_default_set_arch_mach (abfd, arch, mach)
{ {
abfd->arch_info = bfd_lookup_arch (arch, mach); abfd->arch_info = bfd_lookup_arch (arch, mach);
if (abfd->arch_info != NULL) if (abfd->arch_info != NULL)
return true; return TRUE;
abfd->arch_info = &bfd_default_arch_struct; abfd->arch_info = &bfd_default_arch_struct;
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
/* /*
@ -755,14 +755,14 @@ INTERNAL_FUNCTION
bfd_default_scan bfd_default_scan
SYNOPSIS SYNOPSIS
boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string); bfd_boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string);
DESCRIPTION DESCRIPTION
The default function for working out whether this is an The default function for working out whether this is an
architecture hit and a machine hit. architecture hit and a machine hit.
*/ */
boolean bfd_boolean
bfd_default_scan (info, string) bfd_default_scan (info, string)
const bfd_arch_info_type *info; const bfd_arch_info_type *info;
const char *string; const char *string;
@ -777,11 +777,11 @@ bfd_default_scan (info, string)
default architecture? */ default architecture? */
if (strcasecmp (string, info->arch_name) == 0 if (strcasecmp (string, info->arch_name) == 0
&& info->the_default) && info->the_default)
return true; return TRUE;
/* Exact match of the machine name (PRINTABLE_NAME)? */ /* Exact match of the machine name (PRINTABLE_NAME)? */
if (strcasecmp (string, info->printable_name) == 0) if (strcasecmp (string, info->printable_name) == 0)
return true; return TRUE;
/* Given that printable_name contains no colon, attempt to match: /* Given that printable_name contains no colon, attempt to match:
ARCH_NAME [ ":" ] PRINTABLE_NAME? */ ARCH_NAME [ ":" ] PRINTABLE_NAME? */
@ -795,13 +795,13 @@ bfd_default_scan (info, string)
{ {
if (strcasecmp (string + strlen_arch_name + 1, if (strcasecmp (string + strlen_arch_name + 1,
info->printable_name) == 0) info->printable_name) == 0)
return true; return TRUE;
} }
else else
{ {
if (strcasecmp (string + strlen_arch_name, if (strcasecmp (string + strlen_arch_name,
info->printable_name) == 0) info->printable_name) == 0)
return true; return TRUE;
} }
} }
} }
@ -814,7 +814,7 @@ bfd_default_scan (info, string)
if (strncasecmp (string, info->printable_name, colon_index) == 0 if (strncasecmp (string, info->printable_name, colon_index) == 0
&& strcasecmp (string + colon_index, && strcasecmp (string + colon_index,
info->printable_name + colon_index + 1) == 0) info->printable_name + colon_index + 1) == 0)
return true; return TRUE;
} }
/* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>; Do not /* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>; Do not
@ -957,16 +957,16 @@ bfd_default_scan (info, string)
break; break;
default: default:
return false; return FALSE;
} }
if (arch != info->arch) if (arch != info->arch)
return false; return FALSE;
if (number != info->mach) if (number != info->mach)
return false; return FALSE;
return true; return TRUE;
} }
/* /*

View file

@ -70,42 +70,27 @@ extern "C" {
/* Forward declaration. */ /* Forward declaration. */
typedef struct _bfd bfd; typedef struct _bfd bfd;
/* To squelch erroneous compiler warnings ("illegal pointer /* Boolean type used in bfd. Too many systems define their own
combination") from the SVR3 compiler, we would like to typedef versions of "boolean" for us to safely typedef a "boolean" of
boolean to int (it doesn't like functions which return boolean. our own. Using an enum for "bfd_boolean" has it's own set of
Making sure they are never implicitly declared to return int problems, with strange looking casts required to avoid warnings
doesn't seem to help). But this file is not configured based on on some older compilers. Thus we just use an int.
the host. */
/* General rules: functions which are boolean return true on success General rule: functions which are bfd_boolean return TRUE on
and false on failure (unless they're a predicate). -- bfd.doc */ success and FALSE on failure (unless they're a predicate). */
/* I'm sure this is going to break something and someone is going to
force me to change it. */ typedef int bfd_boolean;
/* typedef enum boolean {false, true} boolean; */ #undef FALSE
/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */ #undef TRUE
/* It gets worse if the host also defines a true/false enum... -sts */ #define FALSE 0
/* And even worse if your compiler has built-in boolean types... -law */ #define TRUE 1
/* And even worse if your compiler provides a stdbool.h that conflicts
with these definitions... gcc 2.95 and later do. If so, it must #if 0
be included first. -drow */ /* Poison. */
#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) #undef false
#define TRUE_FALSE_ALREADY_DEFINED #undef true
#else #define false dont_use_false_in_bfd
#if defined (__bool_true_false_are_defined) #define true dont_use_true_in_bfd
/* We have <stdbool.h>. */
#define TRUE_FALSE_ALREADY_DEFINED
#endif
#endif
#ifdef MPW
/* Pre-emptive strike - get the file with the enum. */
#include <Types.h>
#define TRUE_FALSE_ALREADY_DEFINED
#endif /* MPW */
#ifndef TRUE_FALSE_ALREADY_DEFINED
typedef enum bfd_boolean {false, true} boolean;
#define BFD_TRUE_FALSE
#else
/* Use enum names that will appear nowhere else. */
typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean;
#endif #endif
/* Support for different sizes of target format ints and addresses. /* Support for different sizes of target format ints and addresses.
@ -186,8 +171,10 @@ typedef unsigned long bfd_size_type;
typedef bfd_signed_vma file_ptr; typedef bfd_signed_vma file_ptr;
typedef bfd_vma ufile_ptr; typedef bfd_vma ufile_ptr;
extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); extern void bfd_sprintf_vma
extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); PARAMS ((bfd *, char *, bfd_vma));
extern void bfd_fprintf_vma
PARAMS ((bfd *, PTR, bfd_vma));
#define printf_vma(x) fprintf_vma(stdout,x) #define printf_vma(x) fprintf_vma(stdout,x)
#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
@ -263,7 +250,7 @@ bfd_format;
/* This flag indicates that the BFD contents are actually cached in /* This flag indicates that the BFD contents are actually cached in
memory. If this is set, iostream points to a bfd_in_memory struct. */ memory. If this is set, iostream points to a bfd_in_memory struct. */
#define BFD_IN_MEMORY 0x800 #define BFD_IN_MEMORY 0x800
/* The sections in this BFD specify a memory page. */ /* The sections in this BFD specify a memory page. */
#define HAS_LOAD_PAGE 0x1000 #define HAS_LOAD_PAGE 0x1000
@ -345,9 +332,9 @@ typedef struct sec *sec_ptr;
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (unsigned int)true), true) #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true) #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true) #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
typedef struct stat stat_type; typedef struct stat stat_type;
@ -373,7 +360,8 @@ typedef struct _symbol_info
/* Get the name of a stabs type code. */ /* Get the name of a stabs type code. */
extern const char *bfd_get_stab_name PARAMS ((int)); extern const char *bfd_get_stab_name
PARAMS ((int));
/* Hash table routines. There is no way to free up a hash table. */ /* Hash table routines. There is no way to free up a hash table. */
@ -406,23 +394,22 @@ struct bfd_hash_table
built each of which calls the function in the superclass. Thus built each of which calls the function in the superclass. Thus
each function should be written to allocate a new block of memory each function should be written to allocate a new block of memory
only if the argument is NULL. */ only if the argument is NULL. */
struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, struct bfd_hash_entry *(*newfunc)
struct bfd_hash_table *, PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
const char *));
/* An objalloc for this hash table. This is a struct objalloc *, /* An objalloc for this hash table. This is a struct objalloc *,
but we use PTR to avoid requiring the inclusion of objalloc.h. */ but we use PTR to avoid requiring the inclusion of objalloc.h. */
PTR memory; PTR memory;
}; };
/* Initialize a hash table. */ /* Initialize a hash table. */
extern boolean bfd_hash_table_init extern bfd_boolean bfd_hash_table_init
PARAMS ((struct bfd_hash_table *, PARAMS ((struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *, struct bfd_hash_table *,
const char *))); const char *)));
/* Initialize a hash table specifying a size. */ /* Initialize a hash table specifying a size. */
extern boolean bfd_hash_table_init_n extern bfd_boolean bfd_hash_table_init_n
PARAMS ((struct bfd_hash_table *, PARAMS ((struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *, struct bfd_hash_table *,
@ -430,15 +417,16 @@ extern boolean bfd_hash_table_init_n
unsigned int size)); unsigned int size));
/* Free up a hash table. */ /* Free up a hash table. */
extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *)); extern void bfd_hash_table_free
PARAMS ((struct bfd_hash_table *));
/* Look up a string in a hash table. If CREATE is true, a new entry /* Look up a string in a hash table. If CREATE is TRUE, a new entry
will be created for this string if one does not already exist. The will be created for this string if one does not already exist. The
COPY argument must be true if this routine should copy the string COPY argument must be TRUE if this routine should copy the string
into newly allocated memory when adding an entry. */ into newly allocated memory when adding an entry. */
extern struct bfd_hash_entry *bfd_hash_lookup extern struct bfd_hash_entry *bfd_hash_lookup
PARAMS ((struct bfd_hash_table *, const char *, boolean create, PARAMS ((struct bfd_hash_table *, const char *, bfd_boolean create,
boolean copy)); bfd_boolean copy));
/* Replace an entry in a hash table. */ /* Replace an entry in a hash table. */
extern void bfd_hash_replace extern void bfd_hash_replace
@ -451,16 +439,16 @@ extern struct bfd_hash_entry *bfd_hash_newfunc
const char *)); const char *));
/* Grab some space for a hash table entry. */ /* Grab some space for a hash table entry. */
extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *, extern PTR bfd_hash_allocate
unsigned int)); PARAMS ((struct bfd_hash_table *, unsigned int));
/* Traverse a hash table in a random order, calling a function on each /* Traverse a hash table in a random order, calling a function on each
element. If the function returns false, the traversal stops. The element. If the function returns FALSE, the traversal stops. The
INFO argument is passed to the function. */ INFO argument is passed to the function. */
extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, extern void bfd_hash_traverse
boolean (*) (struct bfd_hash_entry *, PARAMS ((struct bfd_hash_table *,
PTR), bfd_boolean (*) (struct bfd_hash_entry *, PTR),
PTR info)); PTR info));
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table #define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
@ -469,12 +457,18 @@ extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *,
/* Direct I/O routines, for programs which know more about the object /* Direct I/O routines, for programs which know more about the object
file than BFD does. Use higher level routines if possible. */ file than BFD does. Use higher level routines if possible. */
extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *)); extern bfd_size_type bfd_bread
extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *)); PARAMS ((PTR, bfd_size_type, bfd *));
extern int bfd_seek PARAMS ((bfd *, file_ptr, int)); extern bfd_size_type bfd_bwrite
extern ufile_ptr bfd_tell PARAMS ((bfd *)); PARAMS ((const PTR, bfd_size_type, bfd *));
extern int bfd_flush PARAMS ((bfd *)); extern int bfd_seek
extern int bfd_stat PARAMS ((bfd *, struct stat *)); PARAMS ((bfd *, file_ptr, int));
extern ufile_ptr bfd_tell
PARAMS ((bfd *));
extern int bfd_flush
PARAMS ((bfd *));
extern int bfd_stat
PARAMS ((bfd *, struct stat *));
/* Deprecated old routines. */ /* Deprecated old routines. */
#if __GNUC__ #if __GNUC__
@ -529,40 +523,61 @@ extern void warn_deprecated
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
extern boolean bfd_cache_close PARAMS ((bfd *abfd)); extern bfd_boolean bfd_cache_close
PARAMS ((bfd *abfd));
/* NB: This declaration should match the autogenerated one in libbfd.h. */ /* NB: This declaration should match the autogenerated one in libbfd.h. */
extern boolean bfd_record_phdr extern bfd_boolean bfd_record_phdr
PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, PARAMS ((bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
boolean, boolean, unsigned int, struct sec **)); bfd_boolean, bfd_boolean, unsigned int, struct sec **));
/* Byte swapping routines. */ /* Byte swapping routines. */
bfd_vma bfd_getb64 PARAMS ((const unsigned char *)); bfd_vma bfd_getb64
bfd_vma bfd_getl64 PARAMS ((const unsigned char *)); PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *)); bfd_vma bfd_getl64
bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *)); PARAMS ((const unsigned char *));
bfd_vma bfd_getb32 PARAMS ((const unsigned char *)); bfd_signed_vma bfd_getb_signed_64
bfd_vma bfd_getl32 PARAMS ((const unsigned char *)); PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *)); bfd_signed_vma bfd_getl_signed_64
bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *)); PARAMS ((const unsigned char *));
bfd_vma bfd_getb16 PARAMS ((const unsigned char *)); bfd_vma bfd_getb32
bfd_vma bfd_getl16 PARAMS ((const unsigned char *)); PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *)); bfd_vma bfd_getl32
bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *)); PARAMS ((const unsigned char *));
void bfd_putb64 PARAMS ((bfd_vma, unsigned char *)); bfd_signed_vma bfd_getb_signed_32
void bfd_putl64 PARAMS ((bfd_vma, unsigned char *)); PARAMS ((const unsigned char *));
void bfd_putb32 PARAMS ((bfd_vma, unsigned char *)); bfd_signed_vma bfd_getl_signed_32
void bfd_putl32 PARAMS ((bfd_vma, unsigned char *)); PARAMS ((const unsigned char *));
void bfd_putb16 PARAMS ((bfd_vma, unsigned char *)); bfd_vma bfd_getb16
void bfd_putl16 PARAMS ((bfd_vma, unsigned char *)); PARAMS ((const unsigned char *));
bfd_vma bfd_getl16
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_16
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getl_signed_16
PARAMS ((const unsigned char *));
void bfd_putb64
PARAMS ((bfd_vma, unsigned char *));
void bfd_putl64
PARAMS ((bfd_vma, unsigned char *));
void bfd_putb32
PARAMS ((bfd_vma, unsigned char *));
void bfd_putl32
PARAMS ((bfd_vma, unsigned char *));
void bfd_putb16
PARAMS ((bfd_vma, unsigned char *));
void bfd_putl16
PARAMS ((bfd_vma, unsigned char *));
/* Byte swapping routines which take size and endiannes as arguments. */ /* Byte swapping routines which take size and endiannes as arguments. */
bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean)); bfd_vma bfd_get_bits
void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); PARAMS ((bfd_byte *, int, bfd_boolean));
void bfd_put_bits
PARAMS ((bfd_vma, bfd_byte *, int, bfd_boolean));
/* Externally visible ECOFF routines. */ /* Externally visible ECOFF routines. */
@ -575,9 +590,11 @@ struct bfd_link_info;
struct bfd_link_hash_entry; struct bfd_link_hash_entry;
struct bfd_elf_version_tree; struct bfd_elf_version_tree;
#endif #endif
extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd)); extern bfd_vma bfd_ecoff_get_gp_value
extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value)); PARAMS ((bfd * abfd));
extern boolean bfd_ecoff_set_regmasks extern bfd_boolean bfd_ecoff_set_gp_value
PARAMS ((bfd *abfd, bfd_vma gp_value));
extern bfd_boolean bfd_ecoff_set_regmasks
PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask, PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask,
unsigned long *cprmask)); unsigned long *cprmask));
extern PTR bfd_ecoff_debug_init extern PTR bfd_ecoff_debug_init
@ -588,39 +605,39 @@ extern void bfd_ecoff_debug_free
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, const struct ecoff_debug_swap *output_swap,
struct bfd_link_info *)); struct bfd_link_info *));
extern boolean bfd_ecoff_debug_accumulate extern bfd_boolean bfd_ecoff_debug_accumulate
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, const struct ecoff_debug_swap *output_swap,
bfd *input_bfd, struct ecoff_debug_info *input_debug, bfd *input_bfd, struct ecoff_debug_info *input_debug,
const struct ecoff_debug_swap *input_swap, const struct ecoff_debug_swap *input_swap,
struct bfd_link_info *)); struct bfd_link_info *));
extern boolean bfd_ecoff_debug_accumulate_other extern bfd_boolean bfd_ecoff_debug_accumulate_other
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, bfd *input_bfd, const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
struct bfd_link_info *)); struct bfd_link_info *));
extern boolean bfd_ecoff_debug_externals extern bfd_boolean bfd_ecoff_debug_externals
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, const struct ecoff_debug_swap *swap,
boolean relocateable, bfd_boolean relocateable,
boolean (*get_extr) (struct symbol_cache_entry *, bfd_boolean (*get_extr) (struct symbol_cache_entry *,
struct ecoff_extr *), struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *, void (*set_index) (struct symbol_cache_entry *,
bfd_size_type))); bfd_size_type)));
extern boolean bfd_ecoff_debug_one_external extern bfd_boolean bfd_ecoff_debug_one_external
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, const struct ecoff_debug_swap *swap,
const char *name, struct ecoff_extr *esym)); const char *name, struct ecoff_extr *esym));
extern bfd_size_type bfd_ecoff_debug_size extern bfd_size_type bfd_ecoff_debug_size
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap)); const struct ecoff_debug_swap *swap));
extern boolean bfd_ecoff_write_debug extern bfd_boolean bfd_ecoff_write_debug
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, file_ptr where)); const struct ecoff_debug_swap *swap, file_ptr where));
extern boolean bfd_ecoff_write_accumulated_debug extern bfd_boolean bfd_ecoff_write_accumulated_debug
PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug, PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, const struct ecoff_debug_swap *swap,
struct bfd_link_info *info, file_ptr where)); struct bfd_link_info *info, file_ptr where));
extern boolean bfd_mips_ecoff_create_embedded_relocs extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **)); char **));
@ -633,36 +650,40 @@ struct bfd_link_needed_list
const char *name; const char *name;
}; };
extern boolean bfd_elf32_record_link_assignment extern bfd_boolean bfd_elf32_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
extern boolean bfd_elf64_record_link_assignment extern bfd_boolean bfd_elf64_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
extern struct bfd_link_needed_list *bfd_elf_get_needed_list extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_elf_get_bfd_needed_list extern bfd_boolean bfd_elf_get_bfd_needed_list
PARAMS ((bfd *, struct bfd_link_needed_list **)); PARAMS ((bfd *, struct bfd_link_needed_list **));
extern boolean bfd_elf32_size_dynamic_sections extern bfd_boolean bfd_elf32_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, const char *, PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **, const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *)); struct bfd_elf_version_tree *));
extern boolean bfd_elf64_size_dynamic_sections extern bfd_boolean bfd_elf64_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, const char *, PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **, const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *)); struct bfd_elf_version_tree *));
extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); extern void bfd_elf_set_dt_needed_name
extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); PARAMS ((bfd *, const char *));
extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); extern void bfd_elf_set_dt_needed_soname
PARAMS ((bfd *, const char *));
extern const char *bfd_elf_get_dt_soname
PARAMS ((bfd *));
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_elf32_discard_info extern bfd_boolean bfd_elf32_discard_info
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_elf64_discard_info extern bfd_boolean bfd_elf64_discard_info
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
/* Return an upper bound on the number of bytes required to store a /* Return an upper bound on the number of bytes required to store a
copy of ABFD's program header table entries. Return -1 if an error copy of ABFD's program header table entries. Return -1 if an error
occurs; bfd_get_error will return an appropriate code. */ occurs; bfd_get_error will return an appropriate code. */
extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); extern long bfd_get_elf_phdr_upper_bound
PARAMS ((bfd *abfd));
/* Copy ABFD's program header table entries to *PHDRS. The entries /* Copy ABFD's program header table entries to *PHDRS. The entries
will be stored as an array of Elf_Internal_Phdr structures, as will be stored as an array of Elf_Internal_Phdr structures, as
@ -671,18 +692,21 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd));
Return the number of program header table entries read, or -1 if an Return the number of program header table entries read, or -1 if an
error occurs; bfd_get_error will return an appropriate code. */ error occurs; bfd_get_error will return an appropriate code. */
extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); extern int bfd_get_elf_phdrs
PARAMS ((bfd *abfd, void *phdrs));
/* Return the arch_size field of an elf bfd, or -1 if not elf. */ /* Return the arch_size field of an elf bfd, or -1 if not elf. */
extern int bfd_get_arch_size PARAMS ((bfd *)); extern int bfd_get_arch_size
PARAMS ((bfd *));
/* Return true if address "naturally" sign extends, or -1 if not elf. */ /* Return TRUE if address "naturally" sign extends, or -1 if not elf. */
extern int bfd_get_sign_extend_vma PARAMS ((bfd *)); extern int bfd_get_sign_extend_vma
PARAMS ((bfd *));
extern boolean bfd_m68k_elf32_create_embedded_relocs extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **)); char **));
extern boolean bfd_mips_elf32_create_embedded_relocs extern bfd_boolean bfd_mips_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **)); char **));
@ -690,19 +714,19 @@ extern boolean bfd_mips_elf32_create_embedded_relocs
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_sunos_record_link_assignment extern bfd_boolean bfd_sunos_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *)); PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_sunos_size_dynamic_sections extern bfd_boolean bfd_sunos_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **, PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **,
struct sec **)); struct sec **));
/* Linux shared library support routines for the linker. */ /* Linux shared library support routines for the linker. */
extern boolean bfd_i386linux_size_dynamic_sections extern bfd_boolean bfd_i386linux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_m68klinux_size_dynamic_sections extern bfd_boolean bfd_m68klinux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_sparclinux_size_dynamic_sections extern bfd_boolean bfd_sparclinux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
/* mmap hacks */ /* mmap hacks */
@ -725,34 +749,37 @@ typedef struct _bfd_window
} }
bfd_window; bfd_window;
extern void bfd_init_window PARAMS ((bfd_window *)); extern void bfd_init_window
extern void bfd_free_window PARAMS ((bfd_window *)); PARAMS ((bfd_window *));
extern boolean bfd_get_file_window extern void bfd_free_window
PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean)); PARAMS ((bfd_window *));
extern bfd_boolean bfd_get_file_window
PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean));
/* XCOFF support routines for the linker. */ /* XCOFF support routines for the linker. */
extern boolean bfd_xcoff_link_record_set extern bfd_boolean bfd_xcoff_link_record_set
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
bfd_size_type)); bfd_size_type));
extern boolean bfd_xcoff_import_symbol extern bfd_boolean bfd_xcoff_import_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
bfd_vma, const char *, const char *, const char *, unsigned int)); bfd_vma, const char *, const char *, const char *, unsigned int));
extern boolean bfd_xcoff_export_symbol extern bfd_boolean bfd_xcoff_export_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
extern boolean bfd_xcoff_link_count_reloc extern bfd_boolean bfd_xcoff_link_count_reloc
PARAMS ((bfd *, struct bfd_link_info *, const char *)); PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_xcoff_record_link_assignment extern bfd_boolean bfd_xcoff_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *)); PARAMS ((bfd *, struct bfd_link_info *, const char *));
extern boolean bfd_xcoff_size_dynamic_sections extern bfd_boolean bfd_xcoff_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
unsigned long, unsigned long, unsigned long, boolean, unsigned long, unsigned long, unsigned long, bfd_boolean,
int, boolean, boolean, struct sec **, boolean)); int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean));
extern boolean bfd_xcoff_link_generate_rtinit extern bfd_boolean bfd_xcoff_link_generate_rtinit
PARAMS ((bfd *, const char *, const char *, boolean)); PARAMS ((bfd *, const char *, const char *, bfd_boolean));
/* XCOFF support routines for ar. */ /* XCOFF support routines for ar. */
extern boolean bfd_xcoff_ar_archive_set_magic PARAMS ((bfd *, char *)); extern bfd_boolean bfd_xcoff_ar_archive_set_magic
PARAMS ((bfd *, char *));
/* Externally visible COFF routines. */ /* Externally visible COFF routines. */
@ -761,50 +788,50 @@ struct internal_syment;
union internal_auxent; union internal_auxent;
#endif #endif
extern boolean bfd_coff_get_syment extern bfd_boolean bfd_coff_get_syment
PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *)); PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
extern boolean bfd_coff_get_auxent extern bfd_boolean bfd_coff_get_auxent
PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *)); PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
extern boolean bfd_coff_set_symbol_class extern bfd_boolean bfd_coff_set_symbol_class
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
extern boolean bfd_m68k_coff_create_embedded_relocs extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **)); char **));
/* ARM Interworking support. Called from linker. */ /* ARM Interworking support. Called from linker. */
extern boolean bfd_arm_allocate_interworking_sections extern bfd_boolean bfd_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *)); PARAMS ((struct bfd_link_info *));
extern boolean bfd_arm_process_before_allocation extern bfd_boolean bfd_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int)); PARAMS ((bfd *, struct bfd_link_info *, int));
extern boolean bfd_arm_get_bfd_for_interworking extern bfd_boolean bfd_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
/* PE ARM Interworking support. Called from linker. */ /* PE ARM Interworking support. Called from linker. */
extern boolean bfd_arm_pe_allocate_interworking_sections extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
PARAMS ((struct bfd_link_info *)); PARAMS ((struct bfd_link_info *));
extern boolean bfd_arm_pe_process_before_allocation extern bfd_boolean bfd_arm_pe_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int)); PARAMS ((bfd *, struct bfd_link_info *, int));
extern boolean bfd_arm_pe_get_bfd_for_interworking extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
/* ELF ARM Interworking support. Called from linker. */ /* ELF ARM Interworking support. Called from linker. */
extern boolean bfd_elf32_arm_allocate_interworking_sections extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *)); PARAMS ((struct bfd_link_info *));
extern boolean bfd_elf32_arm_process_before_allocation extern bfd_boolean bfd_elf32_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int)); PARAMS ((bfd *, struct bfd_link_info *, int));
extern boolean bfd_elf32_arm_get_bfd_for_interworking extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern boolean bfd_elf32_arm_add_glue_sections_to_bfd extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
/* TI COFF load page support. */ /* TI COFF load page support. */

File diff suppressed because it is too large Load diff

View file

@ -53,12 +53,12 @@ CODE_FRAGMENT
. .
. {* Is the file descriptor being cached? That is, can it be closed as . {* Is the file descriptor being cached? That is, can it be closed as
. needed, and re-opened when accessed later? *} . needed, and re-opened when accessed later? *}
. boolean cacheable; . bfd_boolean cacheable;
. .
. {* Marks whether there was a default target specified when the . {* Marks whether there was a default target specified when the
. BFD was opened. This is used to select which matching algorithm . BFD was opened. This is used to select which matching algorithm
. to use to choose the back end. *} . to use to choose the back end. *}
. boolean target_defaulted; . bfd_boolean target_defaulted;
. .
. {* The caching routines use these to maintain a . {* The caching routines use these to maintain a
. least-recently-used list of BFDs. *} . least-recently-used list of BFDs. *}
@ -69,13 +69,13 @@ CODE_FRAGMENT
. ufile_ptr where; . ufile_ptr where;
. .
. {* ... and here: (``once'' means at least once). *} . {* ... and here: (``once'' means at least once). *}
. boolean opened_once; . bfd_boolean opened_once;
. .
. {* Set if we have a locally maintained mtime value, rather than . {* Set if we have a locally maintained mtime value, rather than
. getting it from the file each time. *} . getting it from the file each time. *}
. boolean mtime_set; . bfd_boolean mtime_set;
. .
. {* File modified time, if mtime_set is true. *} . {* File modified time, if mtime_set is TRUE. *}
. long mtime; . long mtime;
. .
. {* Reserved for an unimplemented file locking extension. *} . {* Reserved for an unimplemented file locking extension. *}
@ -104,7 +104,7 @@ CODE_FRAGMENT
. .
. {* Remember when output has begun, to stop strange things . {* Remember when output has begun, to stop strange things
. from happening. *} . from happening. *}
. boolean output_has_begun; . bfd_boolean output_has_begun;
. .
. {* A hash table for section names. *} . {* A hash table for section names. *}
. struct bfd_hash_table section_htab; . struct bfd_hash_table section_htab;
@ -139,7 +139,7 @@ CODE_FRAGMENT
. struct _bfd *my_archive; {* The containing archive BFD. *} . struct _bfd *my_archive; {* The containing archive BFD. *}
. struct _bfd *next; {* The next BFD in the archive. *} . struct _bfd *next; {* The next BFD in the archive. *}
. struct _bfd *archive_head; {* The first BFD in the archive. *} . struct _bfd *archive_head; {* The first BFD in the archive. *}
. boolean has_armap; . bfd_boolean has_armap;
. .
. {* A chain of BFD structures involved in a link. *} . {* A chain of BFD structures involved in a link. *}
. struct _bfd *link_next; . struct _bfd *link_next;
@ -659,7 +659,7 @@ FUNCTION
bfd_set_file_flags bfd_set_file_flags
SYNOPSIS SYNOPSIS
boolean bfd_set_file_flags(bfd *abfd, flagword flags); bfd_boolean bfd_set_file_flags(bfd *abfd, flagword flags);
DESCRIPTION DESCRIPTION
Set the flag word in the BFD @var{abfd} to the value @var{flags}. Set the flag word in the BFD @var{abfd} to the value @var{flags}.
@ -674,7 +674,7 @@ DESCRIPTION
*/ */
boolean bfd_boolean
bfd_set_file_flags (abfd, flags) bfd_set_file_flags (abfd, flags)
bfd *abfd; bfd *abfd;
flagword flags; flagword flags;
@ -682,23 +682,23 @@ bfd_set_file_flags (abfd, flags)
if (abfd->format != bfd_object) if (abfd->format != bfd_object)
{ {
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return false; return FALSE;
} }
if (bfd_read_p (abfd)) if (bfd_read_p (abfd))
{ {
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return false; return FALSE;
} }
bfd_get_file_flags (abfd) = flags; bfd_get_file_flags (abfd) = flags;
if ((flags & bfd_applicable_file_flags (abfd)) != flags) if ((flags & bfd_applicable_file_flags (abfd)) != flags)
{ {
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return false; return FALSE;
} }
return true; return TRUE;
} }
void void
@ -810,22 +810,22 @@ FUNCTION
bfd_set_start_address bfd_set_start_address
SYNOPSIS SYNOPSIS
boolean bfd_set_start_address(bfd *abfd, bfd_vma vma); bfd_boolean bfd_set_start_address(bfd *abfd, bfd_vma vma);
DESCRIPTION DESCRIPTION
Make @var{vma} the entry point of output BFD @var{abfd}. Make @var{vma} the entry point of output BFD @var{abfd}.
RETURNS RETURNS
Returns <<true>> on success, <<false>> otherwise. Returns <<TRUE>> on success, <<FALSE>> otherwise.
*/ */
boolean bfd_boolean
bfd_set_start_address (abfd, vma) bfd_set_start_address (abfd, vma)
bfd *abfd; bfd *abfd;
bfd_vma vma; bfd_vma vma;
{ {
abfd->start_address = vma; abfd->start_address = vma;
return true; return TRUE;
} }
/* /*
@ -1013,11 +1013,11 @@ FUNCTION
bfd_copy_private_bfd_data bfd_copy_private_bfd_data
SYNOPSIS SYNOPSIS
boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); bfd_boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd);
DESCRIPTION DESCRIPTION
Copy private BFD information from the BFD @var{ibfd} to the Copy private BFD information from the BFD @var{ibfd} to the
the BFD @var{obfd}. Return <<true>> on success, <<false>> on error. the BFD @var{obfd}. Return <<TRUE>> on success, <<FALSE>> on error.
Possible error returns are: Possible error returns are:
o <<bfd_error_no_memory>> - o <<bfd_error_no_memory>> -
@ -1034,12 +1034,12 @@ FUNCTION
bfd_merge_private_bfd_data bfd_merge_private_bfd_data
SYNOPSIS SYNOPSIS
boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); bfd_boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd);
DESCRIPTION DESCRIPTION
Merge private BFD information from the BFD @var{ibfd} to the Merge private BFD information from the BFD @var{ibfd} to the
the output file BFD @var{obfd} when linking. Return <<true>> the output file BFD @var{obfd} when linking. Return <<TRUE>>
on success, <<false>> on error. Possible error returns are: on success, <<FALSE>> on error. Possible error returns are:
o <<bfd_error_no_memory>> - o <<bfd_error_no_memory>> -
Not enough memory exists to create private data for @var{obfd}. Not enough memory exists to create private data for @var{obfd}.
@ -1055,11 +1055,11 @@ FUNCTION
bfd_set_private_flags bfd_set_private_flags
SYNOPSIS SYNOPSIS
boolean bfd_set_private_flags(bfd *abfd, flagword flags); bfd_boolean bfd_set_private_flags(bfd *abfd, flagword flags);
DESCRIPTION DESCRIPTION
Set private BFD flag information in the BFD @var{abfd}. Set private BFD flag information in the BFD @var{abfd}.
Return <<true>> on success, <<false>> on error. Possible error Return <<TRUE>> on success, <<FALSE>> on error. Possible error
returns are: returns are:
o <<bfd_error_no_memory>> - o <<bfd_error_no_memory>> -
@ -1152,7 +1152,7 @@ DESCRIPTION
.extern bfd_byte *bfd_get_relocated_section_contents .extern bfd_byte *bfd_get_relocated_section_contents
. PARAMS ((bfd *, struct bfd_link_info *, . PARAMS ((bfd *, struct bfd_link_info *,
. struct bfd_link_order *, bfd_byte *, . struct bfd_link_order *, bfd_byte *,
. boolean, asymbol **)); . bfd_boolean, asymbol **));
. .
*/ */
@ -1164,12 +1164,12 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
struct bfd_link_info *link_info; struct bfd_link_info *link_info;
struct bfd_link_order *link_order; struct bfd_link_order *link_order;
bfd_byte *data; bfd_byte *data;
boolean relocateable; bfd_boolean relocateable;
asymbol **symbols; asymbol **symbols;
{ {
bfd *abfd2; bfd *abfd2;
bfd_byte *(*fn) PARAMS ((bfd *, struct bfd_link_info *, bfd_byte *(*fn) PARAMS ((bfd *, struct bfd_link_info *,
struct bfd_link_order *, bfd_byte *, boolean, struct bfd_link_order *, bfd_byte *, bfd_boolean,
asymbol **)); asymbol **));
if (link_order->type == bfd_indirect_link_order) if (link_order->type == bfd_indirect_link_order)
@ -1188,17 +1188,17 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
/* Record information about an ELF program header. */ /* Record information about an ELF program header. */
boolean bfd_boolean
bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at, bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
includes_filehdr, includes_phdrs, count, secs) includes_filehdr, includes_phdrs, count, secs)
bfd *abfd; bfd *abfd;
unsigned long type; unsigned long type;
boolean flags_valid; bfd_boolean flags_valid;
flagword flags; flagword flags;
boolean at_valid; bfd_boolean at_valid;
bfd_vma at; bfd_vma at;
boolean includes_filehdr; bfd_boolean includes_filehdr;
boolean includes_phdrs; bfd_boolean includes_phdrs;
unsigned int count; unsigned int count;
asection **secs; asection **secs;
{ {
@ -1206,13 +1206,13 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
bfd_size_type amt; bfd_size_type amt;
if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
return true; return TRUE;
amt = sizeof (struct elf_segment_map); amt = sizeof (struct elf_segment_map);
amt += ((bfd_size_type) count - 1) * sizeof (asection *); amt += ((bfd_size_type) count - 1) * sizeof (asection *);
m = (struct elf_segment_map *) bfd_alloc (abfd, amt); m = (struct elf_segment_map *) bfd_alloc (abfd, amt);
if (m == NULL) if (m == NULL)
return false; return FALSE;
m->next = NULL; m->next = NULL;
m->p_type = type; m->p_type = type;
@ -1230,7 +1230,7 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
; ;
*pm = m; *pm = m;
return true; return TRUE;
} }
void void
@ -1262,7 +1262,7 @@ FUNCTION
bfd_alt_mach_code bfd_alt_mach_code
SYNOPSIS SYNOPSIS
boolean bfd_alt_mach_code(bfd *abfd, int alternative); bfd_boolean bfd_alt_mach_code(bfd *abfd, int alternative);
DESCRIPTION DESCRIPTION
@ -1273,7 +1273,7 @@ DESCRIPTION
machine codes. machine codes.
*/ */
boolean bfd_boolean
bfd_alt_mach_code (abfd, alternative) bfd_alt_mach_code (abfd, alternative)
bfd *abfd; bfd *abfd;
int alternative; int alternative;
@ -1291,25 +1291,25 @@ bfd_alt_mach_code (abfd, alternative)
case 1: case 1:
code = get_elf_backend_data (abfd)->elf_machine_alt1; code = get_elf_backend_data (abfd)->elf_machine_alt1;
if (code == 0) if (code == 0)
return false; return FALSE;
break; break;
case 2: case 2:
code = get_elf_backend_data (abfd)->elf_machine_alt2; code = get_elf_backend_data (abfd)->elf_machine_alt2;
if (code == 0) if (code == 0)
return false; return FALSE;
break; break;
default: default:
return false; return FALSE;
} }
elf_elfheader (abfd)->e_machine = code; elf_elfheader (abfd)->e_machine = code;
return true; return TRUE;
} }
return false; return FALSE;
} }
/* /*
@ -1334,7 +1334,7 @@ FUNCTION
bfd_preserve_save bfd_preserve_save
SYNOPSIS SYNOPSIS
boolean bfd_preserve_save (bfd *, struct bfd_preserve *); bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
DESCRIPTION DESCRIPTION
When testing an object for compatibility with a particular When testing an object for compatibility with a particular
@ -1349,7 +1349,7 @@ DESCRIPTION
*/ */
boolean bfd_boolean
bfd_preserve_save (abfd, preserve) bfd_preserve_save (abfd, preserve)
bfd *abfd; bfd *abfd;
struct bfd_preserve *preserve; struct bfd_preserve *preserve;
@ -1363,7 +1363,7 @@ bfd_preserve_save (abfd, preserve)
preserve->section_htab = abfd->section_htab; preserve->section_htab = abfd->section_htab;
if (! bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) if (! bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc))
return false; return FALSE;
abfd->tdata.any = NULL; abfd->tdata.any = NULL;
abfd->arch_info = &bfd_default_arch_struct; abfd->arch_info = &bfd_default_arch_struct;
@ -1372,7 +1372,7 @@ bfd_preserve_save (abfd, preserve)
abfd->section_tail = &abfd->sections; abfd->section_tail = &abfd->sections;
abfd->section_count = 0; abfd->section_count = 0;
return true; return TRUE;
} }
/* /*

View file

@ -107,13 +107,13 @@ bfd_free_window (windowp)
static int ok_to_map = 1; static int ok_to_map = 1;
boolean bfd_boolean
bfd_get_file_window (abfd, offset, size, windowp, writable) bfd_get_file_window (abfd, offset, size, windowp, writable)
bfd *abfd; bfd *abfd;
file_ptr offset; file_ptr offset;
bfd_size_type size; bfd_size_type size;
bfd_window *windowp; bfd_window *windowp;
boolean writable; bfd_boolean writable;
{ {
static size_t pagesize; static size_t pagesize;
bfd_window_internal *i = windowp->i; bfd_window_internal *i = windowp->i;
@ -137,7 +137,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal))); bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal)));
windowp->i = i; windowp->i = i;
if (i == 0) if (i == 0)
return false; return FALSE;
i->data = 0; i->data = 0;
} }
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
@ -189,7 +189,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
windowp->data = 0; windowp->data = 0;
if (debug_windows) if (debug_windows)
fprintf (stderr, "\t\tmmap failed!\n"); fprintf (stderr, "\t\tmmap failed!\n");
return false; return FALSE;
} }
if (debug_windows) if (debug_windows)
fprintf (stderr, "\n\tmapped %ld at %p, offset is %ld\n", fprintf (stderr, "\n\tmapped %ld at %p, offset is %ld\n",
@ -198,7 +198,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
windowp->data = (PTR) ((bfd_byte *) i->data + offset2); windowp->data = (PTR) ((bfd_byte *) i->data + offset2);
windowp->size = size; windowp->size = size;
i->mapped = 1; i->mapped = 1;
return true; return TRUE;
} }
else if (debug_windows) else if (debug_windows)
{ {
@ -229,14 +229,14 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
if (i->data == NULL) if (i->data == NULL)
{ {
if (size_to_alloc == 0) if (size_to_alloc == 0)
return true; return TRUE;
return false; return FALSE;
} }
if (bfd_seek (abfd, offset, SEEK_SET) != 0) if (bfd_seek (abfd, offset, SEEK_SET) != 0)
return false; return FALSE;
i->size = bfd_bread (i->data, size, abfd); i->size = bfd_bread (i->data, size, abfd);
if (i->size != size) if (i->size != size)
return false; return FALSE;
i->mapped = 0; i->mapped = 0;
#ifdef HAVE_MPROTECT #ifdef HAVE_MPROTECT
if (!writable) if (!writable)
@ -249,7 +249,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
#endif #endif
windowp->data = i->data; windowp->data = i->data;
windowp->size = i->size; windowp->size = i->size;
return true; return TRUE;
} }
#endif /* USE_MMAP */ #endif /* USE_MMAP */

View file

@ -41,17 +41,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
a start symbol, an end symbol, and an absolute length symbol. */ a start symbol, an end symbol, and an absolute length symbol. */
#define BIN_SYMS 3 #define BIN_SYMS 3
static boolean binary_mkobject PARAMS ((bfd *)); static bfd_boolean binary_mkobject PARAMS ((bfd *));
static const bfd_target *binary_object_p PARAMS ((bfd *)); static const bfd_target *binary_object_p PARAMS ((bfd *));
static boolean binary_get_section_contents static bfd_boolean binary_get_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
static long binary_get_symtab_upper_bound PARAMS ((bfd *)); static long binary_get_symtab_upper_bound PARAMS ((bfd *));
static char *mangle_name PARAMS ((bfd *, char *)); static char *mangle_name PARAMS ((bfd *, char *));
static long binary_get_symtab PARAMS ((bfd *, asymbol **)); static long binary_get_symtab PARAMS ((bfd *, asymbol **));
static void binary_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static void binary_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
static boolean binary_set_section_contents static bfd_boolean binary_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
static int binary_sizeof_headers PARAMS ((bfd *, boolean)); static int binary_sizeof_headers PARAMS ((bfd *, bfd_boolean));
/* Set by external programs - specifies the BFD architecture /* Set by external programs - specifies the BFD architecture
to use when creating binary BFDs. */ to use when creating binary BFDs. */
@ -59,11 +59,11 @@ enum bfd_architecture bfd_external_binary_architecture = bfd_arch_unknown;
/* Create a binary object. Invoked via bfd_set_format. */ /* Create a binary object. Invoked via bfd_set_format. */
static boolean static bfd_boolean
binary_mkobject (abfd) binary_mkobject (abfd)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
{ {
return true; return TRUE;
} }
/* Any file may be considered to be a binary file, provided the target /* Any file may be considered to be a binary file, provided the target
@ -119,7 +119,7 @@ binary_object_p (abfd)
/* Get contents of the only section. */ /* Get contents of the only section. */
static boolean static bfd_boolean
binary_get_section_contents (abfd, section, location, offset, count) binary_get_section_contents (abfd, section, location, offset, count)
bfd *abfd; bfd *abfd;
asection *section ATTRIBUTE_UNUSED; asection *section ATTRIBUTE_UNUSED;
@ -129,8 +129,8 @@ binary_get_section_contents (abfd, section, location, offset, count)
{ {
if (bfd_seek (abfd, offset, SEEK_SET) != 0 if (bfd_seek (abfd, offset, SEEK_SET) != 0
|| bfd_bread (location, count, abfd) != count) || bfd_bread (location, count, abfd) != count)
return false; return FALSE;
return true; return TRUE;
} }
/* Return the amount of memory needed to read the symbol table. */ /* Return the amount of memory needed to read the symbol table. */
@ -185,7 +185,7 @@ binary_get_symtab (abfd, alocation)
syms = (asymbol *) bfd_alloc (abfd, amt); syms = (asymbol *) bfd_alloc (abfd, amt);
if (syms == NULL) if (syms == NULL)
return (long) false; return 0;
/* Start symbol. */ /* Start symbol. */
syms[0].the_bfd = abfd; syms[0].the_bfd = abfd;
@ -250,7 +250,7 @@ binary_get_symbol_info (ignore_abfd, symbol, ret)
/* Write section contents of a binary file. */ /* Write section contents of a binary file. */
static boolean static bfd_boolean
binary_set_section_contents (abfd, sec, data, offset, size) binary_set_section_contents (abfd, sec, data, offset, size)
bfd *abfd; bfd *abfd;
asection *sec; asection *sec;
@ -259,18 +259,18 @@ binary_set_section_contents (abfd, sec, data, offset, size)
bfd_size_type size; bfd_size_type size;
{ {
if (size == 0) if (size == 0)
return true; return TRUE;
if (! abfd->output_has_begun) if (! abfd->output_has_begun)
{ {
boolean found_low; bfd_boolean found_low;
bfd_vma low; bfd_vma low;
asection *s; asection *s;
/* The lowest section LMA sets the virtual address of the start /* The lowest section LMA sets the virtual address of the start
of the file. We use this to set the file position of all the of the file. We use this to set the file position of all the
sections. */ sections. */
found_low = false; found_low = FALSE;
low = 0; low = 0;
for (s = abfd->sections; s != NULL; s = s->next) for (s = abfd->sections; s != NULL; s = s->next)
if (((s->flags if (((s->flags
@ -280,7 +280,7 @@ binary_set_section_contents (abfd, sec, data, offset, size)
&& (! found_low || s->lma < low)) && (! found_low || s->lma < low))
{ {
low = s->lma; low = s->lma;
found_low = true; found_low = TRUE;
} }
for (s = abfd->sections; s != NULL; s = s->next) for (s = abfd->sections; s != NULL; s = s->next)
@ -308,16 +308,16 @@ binary_set_section_contents (abfd, sec, data, offset, size)
(unsigned long) s->filepos); (unsigned long) s->filepos);
} }
abfd->output_has_begun = true; abfd->output_has_begun = TRUE;
} }
/* We don't want to output anything for a section that is neither /* We don't want to output anything for a section that is neither
loaded nor allocated. The contents of such a section are not loaded nor allocated. The contents of such a section are not
meaningful in the binary format. */ meaningful in the binary format. */
if ((sec->flags & (SEC_LOAD | SEC_ALLOC)) == 0) if ((sec->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
return true; return TRUE;
if ((sec->flags & SEC_NEVER_LOAD) != 0) if ((sec->flags & SEC_NEVER_LOAD) != 0)
return true; return TRUE;
return _bfd_generic_set_section_contents (abfd, sec, data, offset, size); return _bfd_generic_set_section_contents (abfd, sec, data, offset, size);
} }
@ -327,7 +327,7 @@ binary_set_section_contents (abfd, sec, data, offset, size)
static int static int
binary_sizeof_headers (abfd, exec) binary_sizeof_headers (abfd, exec)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
boolean exec ATTRIBUTE_UNUSED; bfd_boolean exec ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }

View file

@ -30,30 +30,59 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "aout/stab_gnu.h" #include "aout/stab_gnu.h"
#include "libaout.h" /* BFD a.out internal data structures. */ #include "libaout.h" /* BFD a.out internal data structures. */
static int aligncode PARAMS ((bfd *abfd, asection *input_section, arelent *r, unsigned int shrink)); static int aligncode
static void perform_slip PARAMS ((bfd *abfd, unsigned int slip, asection *input_section, bfd_vma value)); PARAMS ((bfd *abfd, asection *input_section, arelent *r,
static boolean b_out_squirt_out_relocs PARAMS ((bfd *abfd, asection *section)); unsigned int shrink));
static const bfd_target * b_out_callback PARAMS ((bfd *)); static void perform_slip
static bfd_reloc_status_type calljx_callback PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR src, PTR dst, asection *)); PARAMS ((bfd *abfd, unsigned int slip, asection *input_section,
static bfd_reloc_status_type callj_callback PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR data, unsigned int srcidx, unsigned int dstidx, asection *, boolean)); bfd_vma value));
static bfd_vma get_value PARAMS ((arelent *, struct bfd_link_info *, asection *)); static bfd_boolean b_out_squirt_out_relocs
static int abs32code PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *)); PARAMS ((bfd *abfd, asection *section));
static boolean b_out_bfd_relax_section PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static const bfd_target *b_out_callback
static bfd_byte * b_out_bfd_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, boolean, asymbol **)); PARAMS ((bfd *));
static int b_out_sizeof_headers PARAMS ((bfd *, boolean)); static bfd_reloc_status_type calljx_callback
static boolean b_out_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR src, PTR dst,
static boolean b_out_set_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); asection *));
static long b_out_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); static bfd_reloc_status_type callj_callback
static long b_out_canonicalize_reloc PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR data,
static boolean b_out_slurp_reloc_table PARAMS ((bfd *, sec_ptr, asymbol **)); unsigned int srcidx, unsigned int dstidx, asection *, bfd_boolean));
static reloc_howto_type * b_out_bfd_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static bfd_vma get_value
static boolean b_out_write_object_contents PARAMS ((bfd *)); PARAMS ((arelent *, struct bfd_link_info *, asection *));
static int b_out_symbol_cmp PARAMS ((const void *, const void *)); static int abs32code
static boolean b_out_mkobject PARAMS ((bfd *)); PARAMS ((bfd *, asection *, arelent *, unsigned int,
static const bfd_target * b_out_object_p PARAMS ((bfd *)); struct bfd_link_info *));
static bfd_boolean b_out_bfd_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
static bfd_byte *b_out_bfd_get_relocated_section_contents
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
bfd_boolean, asymbol **));
static int b_out_sizeof_headers
PARAMS ((bfd *, bfd_boolean));
static bfd_boolean b_out_set_arch_mach
PARAMS ((bfd *, enum bfd_architecture, unsigned long));
static bfd_boolean b_out_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
static long b_out_get_reloc_upper_bound
PARAMS ((bfd *, sec_ptr));
static long b_out_canonicalize_reloc
PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
static bfd_boolean b_out_slurp_reloc_table
PARAMS ((bfd *, sec_ptr, asymbol **));
static reloc_howto_type *b_out_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static bfd_boolean b_out_write_object_contents
PARAMS ((bfd *));
static int b_out_symbol_cmp
PARAMS ((const void *, const void *));
static bfd_boolean b_out_mkobject
PARAMS ((bfd *));
static const bfd_target *b_out_object_p
PARAMS ((bfd *));
void bout_swap_exec_header_in PARAMS ((bfd *, struct external_exec *, struct internal_exec *)); void bout_swap_exec_header_in
void bout_swap_exec_header_out PARAMS ((bfd *, struct internal_exec *, struct external_exec *)); PARAMS ((bfd *, struct external_exec *, struct internal_exec *));
void bout_swap_exec_header_out
PARAMS ((bfd *, struct internal_exec *, struct external_exec *));
/* Swaps the information in an executable header taken from a raw byte /* Swaps the information in an executable header taken from a raw byte
stream memory image, into the internal exec_header structure. */ stream memory image, into the internal exec_header structure. */
@ -201,7 +230,7 @@ struct bout_data_struct
struct internal_exec e; struct internal_exec e;
}; };
static boolean static bfd_boolean
b_out_mkobject (abfd) b_out_mkobject (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -210,7 +239,7 @@ b_out_mkobject (abfd)
rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, amt); rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, amt);
if (rawptr == NULL) if (rawptr == NULL)
return false; return FALSE;
abfd->tdata.bout_data = rawptr; abfd->tdata.bout_data = rawptr;
exec_hdr (abfd) = &rawptr->e; exec_hdr (abfd) = &rawptr->e;
@ -219,7 +248,7 @@ b_out_mkobject (abfd)
obj_datasec (abfd) = (asection *) NULL; obj_datasec (abfd) = (asection *) NULL;
obj_bsssec (abfd) = (asection *) NULL; obj_bsssec (abfd) = (asection *) NULL;
return true; return TRUE;
} }
static int static int
@ -253,7 +282,7 @@ b_out_symbol_cmp (a_ptr, b_ptr)
return 0; return 0;
} }
static boolean static bfd_boolean
b_out_write_object_contents (abfd) b_out_write_object_contents (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -261,7 +290,7 @@ b_out_write_object_contents (abfd)
bfd_size_type amt; bfd_size_type amt;
if (! aout_32_make_sections (abfd)) if (! aout_32_make_sections (abfd))
return false; return FALSE;
exec_hdr (abfd)->a_info = BMAGIC; exec_hdr (abfd)->a_info = BMAGIC;
@ -287,7 +316,7 @@ b_out_write_object_contents (abfd)
amt = EXEC_BYTES_SIZE; amt = EXEC_BYTES_SIZE;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|| bfd_bwrite ((PTR) &swapped_hdr, amt, abfd) != amt) || bfd_bwrite ((PTR) &swapped_hdr, amt, abfd) != amt)
return false; return FALSE;
/* Now write out reloc info, followed by syms and strings */ /* Now write out reloc info, followed by syms and strings */
if (bfd_get_symcount (abfd) != 0) if (bfd_get_symcount (abfd) != 0)
@ -319,23 +348,25 @@ b_out_write_object_contents (abfd)
/* Back to your regularly scheduled program. */ /* Back to your regularly scheduled program. */
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*exec_hdr(abfd))), SEEK_SET) if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*exec_hdr(abfd))), SEEK_SET)
!= 0) != 0)
return false; return FALSE;
if (! aout_32_write_syms (abfd)) if (! aout_32_write_syms (abfd))
return false; return FALSE;
if (bfd_seek (abfd, (file_ptr) (N_TROFF(*exec_hdr(abfd))), SEEK_SET) if (bfd_seek (abfd, (file_ptr) (N_TROFF(*exec_hdr(abfd))), SEEK_SET)
!= 0) != 0)
return false; return FALSE;
if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd))) return false; if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd)))
return FALSE;
if (bfd_seek (abfd, (file_ptr) (N_DROFF(*exec_hdr(abfd))), SEEK_SET) if (bfd_seek (abfd, (file_ptr) (N_DROFF(*exec_hdr(abfd))), SEEK_SET)
!= 0) != 0)
return false; return FALSE;
if (!b_out_squirt_out_relocs (abfd, obj_datasec (abfd))) return false; if (!b_out_squirt_out_relocs (abfd, obj_datasec (abfd)))
return FALSE;
} }
return true; return TRUE;
} }
/* Some reloc hackery. */ /* Some reloc hackery. */
@ -400,7 +431,7 @@ callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx,
unsigned int srcidx; unsigned int srcidx;
unsigned int dstidx; unsigned int dstidx;
asection *input_section; asection *input_section;
boolean shrinking; bfd_boolean shrinking;
{ {
int word = bfd_get_32 (abfd, (bfd_byte *) data + srcidx); int word = bfd_get_32 (abfd, (bfd_byte *) data + srcidx);
asymbol *symbol_in = *(reloc_entry->sym_ptr_ptr); asymbol *symbol_in = *(reloc_entry->sym_ptr_ptr);
@ -467,33 +498,33 @@ callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx,
#define ALIGNER 10 #define ALIGNER 10
#define ALIGNDONE 11 #define ALIGNDONE 11
static reloc_howto_type howto_reloc_callj = static reloc_howto_type howto_reloc_callj =
HOWTO(CALLJ, 0, 2, 24, true, 0, complain_overflow_signed, 0,"callj", true, 0x00ffffff, 0x00ffffff,false); HOWTO(CALLJ, 0, 2, 24, TRUE, 0, complain_overflow_signed, 0,"callj", TRUE, 0x00ffffff, 0x00ffffff,FALSE);
static reloc_howto_type howto_reloc_abs32 = static reloc_howto_type howto_reloc_abs32 =
HOWTO(ABS32, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"abs32", true, 0xffffffff,0xffffffff,false); HOWTO(ABS32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"abs32", TRUE, 0xffffffff,0xffffffff,FALSE);
static reloc_howto_type howto_reloc_pcrel24 = static reloc_howto_type howto_reloc_pcrel24 =
HOWTO(PCREL24, 0, 2, 24, true, 0, complain_overflow_signed,0,"pcrel24", true, 0x00ffffff,0x00ffffff,false); HOWTO(PCREL24, 0, 2, 24, TRUE, 0, complain_overflow_signed,0,"pcrel24", TRUE, 0x00ffffff,0x00ffffff,FALSE);
static reloc_howto_type howto_reloc_pcrel13 = static reloc_howto_type howto_reloc_pcrel13 =
HOWTO(PCREL13, 0, 2, 13, true, 0, complain_overflow_signed,0,"pcrel13", true, 0x00001fff,0x00001fff,false); HOWTO(PCREL13, 0, 2, 13, TRUE, 0, complain_overflow_signed,0,"pcrel13", TRUE, 0x00001fff,0x00001fff,FALSE);
static reloc_howto_type howto_reloc_abs32codeshrunk = static reloc_howto_type howto_reloc_abs32codeshrunk =
HOWTO(ABS32CODE_SHRUNK, 0, 2, 24, true, 0, complain_overflow_signed, 0,"callx->callj", true, 0x00ffffff, 0x00ffffff,false); HOWTO(ABS32CODE_SHRUNK, 0, 2, 24, TRUE, 0, complain_overflow_signed, 0,"callx->callj", TRUE, 0x00ffffff, 0x00ffffff,FALSE);
static reloc_howto_type howto_reloc_abs32code = static reloc_howto_type howto_reloc_abs32code =
HOWTO(ABS32CODE, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"callx", true, 0xffffffff,0xffffffff,false); HOWTO(ABS32CODE, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"callx", TRUE, 0xffffffff,0xffffffff,FALSE);
static reloc_howto_type howto_align_table[] = { static reloc_howto_type howto_align_table[] = {
HOWTO (ALIGNER, 0, 0x1, 0, false, 0, complain_overflow_dont, 0, "align16", false, 0, 0, false), HOWTO (ALIGNER, 0, 0x1, 0, FALSE, 0, complain_overflow_dont, 0, "align16", FALSE, 0, 0, FALSE),
HOWTO (ALIGNER, 0, 0x3, 0, false, 0, complain_overflow_dont, 0, "align32", false, 0, 0, false), HOWTO (ALIGNER, 0, 0x3, 0, FALSE, 0, complain_overflow_dont, 0, "align32", FALSE, 0, 0, FALSE),
HOWTO (ALIGNER, 0, 0x7, 0, false, 0, complain_overflow_dont, 0, "align64", false, 0, 0, false), HOWTO (ALIGNER, 0, 0x7, 0, FALSE, 0, complain_overflow_dont, 0, "align64", FALSE, 0, 0, FALSE),
HOWTO (ALIGNER, 0, 0xf, 0, false, 0, complain_overflow_dont, 0, "align128", false, 0, 0, false), HOWTO (ALIGNER, 0, 0xf, 0, FALSE, 0, complain_overflow_dont, 0, "align128", FALSE, 0, 0, FALSE),
}; };
static reloc_howto_type howto_done_align_table[] = { static reloc_howto_type howto_done_align_table[] = {
HOWTO (ALIGNDONE, 0x1, 0x1, 0, false, 0, complain_overflow_dont, 0, "donealign16", false, 0, 0, false), HOWTO (ALIGNDONE, 0x1, 0x1, 0, FALSE, 0, complain_overflow_dont, 0, "donealign16", FALSE, 0, 0, FALSE),
HOWTO (ALIGNDONE, 0x3, 0x3, 0, false, 0, complain_overflow_dont, 0, "donealign32", false, 0, 0, false), HOWTO (ALIGNDONE, 0x3, 0x3, 0, FALSE, 0, complain_overflow_dont, 0, "donealign32", FALSE, 0, 0, FALSE),
HOWTO (ALIGNDONE, 0x7, 0x7, 0, false, 0, complain_overflow_dont, 0, "donealign64", false, 0, 0, false), HOWTO (ALIGNDONE, 0x7, 0x7, 0, FALSE, 0, complain_overflow_dont, 0, "donealign64", FALSE, 0, 0, FALSE),
HOWTO (ALIGNDONE, 0xf, 0xf, 0, false, 0, complain_overflow_dont, 0, "donealign128", false, 0, 0, false), HOWTO (ALIGNDONE, 0xf, 0xf, 0, FALSE, 0, complain_overflow_dont, 0, "donealign128", FALSE, 0, 0, FALSE),
}; };
static reloc_howto_type * static reloc_howto_type *
@ -517,7 +548,7 @@ b_out_bfd_reloc_type_lookup (abfd, code)
/* Allocate enough room for all the reloc entries, plus pointers to them all. */ /* Allocate enough room for all the reloc entries, plus pointers to them all. */
static boolean static bfd_boolean
b_out_slurp_reloc_table (abfd, asect, symbols) b_out_slurp_reloc_table (abfd, asect, symbols)
bfd *abfd; bfd *abfd;
sec_ptr asect; sec_ptr asect;
@ -536,10 +567,10 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
arelent *reloc_cache; arelent *reloc_cache;
if (asect->relocation) if (asect->relocation)
return true; return TRUE;
if (!aout_32_slurp_symbol_table (abfd)) if (!aout_32_slurp_symbol_table (abfd))
return false; return FALSE;
if (asect == obj_datasec (abfd)) if (asect == obj_datasec (abfd))
{ {
@ -560,16 +591,16 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
} }
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return false; return FALSE;
doit: doit:
if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0) if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0)
return false; return FALSE;
count = reloc_size / sizeof (struct relocation_info); count = reloc_size / sizeof (struct relocation_info);
relocs = (struct relocation_info *) bfd_malloc (reloc_size); relocs = (struct relocation_info *) bfd_malloc (reloc_size);
if (!relocs && reloc_size != 0) if (!relocs && reloc_size != 0)
return false; return FALSE;
amt = ((bfd_size_type) count + 1) * sizeof (arelent); amt = ((bfd_size_type) count + 1) * sizeof (arelent);
reloc_cache = (arelent *) bfd_malloc (amt); reloc_cache = (arelent *) bfd_malloc (amt);
@ -577,7 +608,7 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
{ {
if (relocs != NULL) if (relocs != NULL)
free (relocs); free (relocs);
return false; return FALSE;
} }
if (bfd_bread ((PTR) relocs, reloc_size, abfd) != reloc_size) if (bfd_bread ((PTR) relocs, reloc_size, abfd) != reloc_size)
@ -585,7 +616,7 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
free (reloc_cache); free (reloc_cache);
if (relocs != NULL) if (relocs != NULL)
free (relocs); free (relocs);
return false; return FALSE;
} }
if (bfd_header_big_endian (abfd)) if (bfd_header_big_endian (abfd))
@ -740,10 +771,10 @@ b_out_slurp_reloc_table (abfd, asect, symbols)
asect->relocation = reloc_cache; asect->relocation = reloc_cache;
asect->reloc_count = count; asect->reloc_count = count;
return true; return TRUE;
} }
static boolean static bfd_boolean
b_out_squirt_out_relocs (abfd, section) b_out_squirt_out_relocs (abfd, section)
bfd *abfd; bfd *abfd;
asection *section; asection *section;
@ -759,13 +790,13 @@ b_out_squirt_out_relocs (abfd, section)
int extern_mask, pcrel_mask, len_2, callj_mask; int extern_mask, pcrel_mask, len_2, callj_mask;
if (count == 0) if (count == 0)
return true; return TRUE;
generic = section->orelocation; generic = section->orelocation;
natsize = (bfd_size_type) count * sizeof (struct relocation_info); natsize = (bfd_size_type) count * sizeof (struct relocation_info);
native = ((struct relocation_info *) bfd_malloc (natsize)); native = ((struct relocation_info *) bfd_malloc (natsize));
if (!native && natsize != 0) if (!native && natsize != 0)
return false; return FALSE;
if (bfd_header_big_endian (abfd)) if (bfd_header_big_endian (abfd))
{ {
@ -870,12 +901,12 @@ b_out_squirt_out_relocs (abfd, section)
if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize) if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize)
{ {
free ((PTR)native); free ((PTR)native);
return false; return FALSE;
} }
free ((PTR)native); free ((PTR)native);
return true; return TRUE;
} }
/* This is stupid. This function should be a boolean predicate. */ /* This is stupid. This function should be a boolean predicate. */
@ -948,7 +979,7 @@ b_out_get_reloc_upper_bound (abfd, asect)
} }
static boolean static bfd_boolean
b_out_set_section_contents (abfd, section, location, offset, count) b_out_set_section_contents (abfd, section, location, offset, count)
bfd *abfd; bfd *abfd;
asection *section; asection *section;
@ -960,7 +991,7 @@ b_out_set_section_contents (abfd, section, location, offset, count)
{ {
/* Set by bfd.c handler. */ /* Set by bfd.c handler. */
if (! aout_32_make_sections (abfd)) if (! aout_32_make_sections (abfd))
return false; return FALSE;
obj_textsec (abfd)->filepos = sizeof (struct internal_exec); obj_textsec (abfd)->filepos = sizeof (struct internal_exec);
obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos
@ -969,15 +1000,15 @@ b_out_set_section_contents (abfd, section, location, offset, count)
/* Regardless, once we know what we're doing, we might as well get going. */ /* Regardless, once we know what we're doing, we might as well get going. */
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0)
return false; return FALSE;
if (count == 0) if (count == 0)
return true; return TRUE;
return bfd_bwrite ((PTR) location, count, abfd) == count; return bfd_bwrite ((PTR) location, count, abfd) == count;
} }
static boolean static bfd_boolean
b_out_set_arch_mach (abfd, arch, machine) b_out_set_arch_mach (abfd, arch, machine)
bfd *abfd; bfd *abfd;
enum bfd_architecture arch; enum bfd_architecture arch;
@ -986,7 +1017,7 @@ b_out_set_arch_mach (abfd, arch, machine)
bfd_default_set_arch_mach(abfd, arch, machine); bfd_default_set_arch_mach(abfd, arch, machine);
if (arch == bfd_arch_unknown) /* Unknown machine arch is OK. */ if (arch == bfd_arch_unknown) /* Unknown machine arch is OK. */
return true; return TRUE;
if (arch == bfd_arch_i960) /* i960 default is OK. */ if (arch == bfd_arch_i960) /* i960 default is OK. */
switch (machine) switch (machine)
@ -1000,18 +1031,18 @@ b_out_set_arch_mach (abfd, arch, machine)
case bfd_mach_i960_jx: case bfd_mach_i960_jx:
case bfd_mach_i960_hx: case bfd_mach_i960_hx:
case 0: case 0:
return true; return TRUE;
default: default:
return false; return FALSE;
} }
return false; return FALSE;
} }
static int static int
b_out_sizeof_headers (ignore_abfd, ignore) b_out_sizeof_headers (ignore_abfd, ignore)
bfd *ignore_abfd ATTRIBUTE_UNUSED; bfd *ignore_abfd ATTRIBUTE_UNUSED;
boolean ignore ATTRIBUTE_UNUSED; bfd_boolean ignore ATTRIBUTE_UNUSED;
{ {
return sizeof (struct internal_exec); return sizeof (struct internal_exec);
} }
@ -1040,7 +1071,7 @@ get_value (reloc, link_info, input_section)
generic symbols. */ generic symbols. */
h = bfd_wrapped_link_hash_lookup (input_section->owner, link_info, h = bfd_wrapped_link_hash_lookup (input_section->owner, link_info,
bfd_asymbol_name (symbol), bfd_asymbol_name (symbol),
false, false, true); FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry *) NULL if (h != (struct bfd_link_hash_entry *) NULL
&& (h->type == bfd_link_hash_defined && (h->type == bfd_link_hash_defined
|| h->type == bfd_link_hash_defweak)) || h->type == bfd_link_hash_defweak))
@ -1053,7 +1084,7 @@ get_value (reloc, link_info, input_section)
if (! ((*link_info->callbacks->undefined_symbol) if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol), (link_info, bfd_asymbol_name (symbol),
input_section->owner, input_section, reloc->address, input_section->owner, input_section, reloc->address,
true))) TRUE)))
abort (); abort ();
value = 0; value = 0;
} }
@ -1192,12 +1223,12 @@ aligncode (abfd, input_section, r, shrink)
return shrink; return shrink;
} }
static boolean static bfd_boolean
b_out_bfd_relax_section (abfd, i, link_info, again) b_out_bfd_relax_section (abfd, i, link_info, again)
bfd *abfd; bfd *abfd;
asection *i; asection *i;
struct bfd_link_info *link_info; struct bfd_link_info *link_info;
boolean *again; bfd_boolean *again;
{ {
/* Get enough memory to hold the stuff. */ /* Get enough memory to hold the stuff. */
bfd *input_bfd = i->owner; bfd *input_bfd = i->owner;
@ -1208,11 +1239,11 @@ b_out_bfd_relax_section (abfd, i, link_info, again)
input_section); input_section);
if (reloc_size < 0) if (reloc_size < 0)
return false; return FALSE;
/* We only run this relaxation once. It might work to run it /* We only run this relaxation once. It might work to run it
multiple times, but it hasn't been tested. */ multiple times, but it hasn't been tested. */
*again = false; *again = FALSE;
if (reloc_size) if (reloc_size)
{ {
@ -1258,11 +1289,11 @@ b_out_bfd_relax_section (abfd, i, link_info, again)
if (reloc_vector != NULL) if (reloc_vector != NULL)
free (reloc_vector); free (reloc_vector);
return true; return TRUE;
error_return: error_return:
if (reloc_vector != NULL) if (reloc_vector != NULL)
free (reloc_vector); free (reloc_vector);
return false; return FALSE;
} }
static bfd_byte * static bfd_byte *
@ -1272,7 +1303,7 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order,
struct bfd_link_info *link_info; struct bfd_link_info *link_info;
struct bfd_link_order *link_order; struct bfd_link_order *link_order;
bfd_byte *data; bfd_byte *data;
boolean relocateable; bfd_boolean relocateable;
asymbol **symbols; asymbol **symbols;
{ {
/* Get enough memory to hold the stuff. */ /* Get enough memory to hold the stuff. */
@ -1300,11 +1331,11 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order,
input_section->reloc_done = 1; input_section->reloc_done = 1;
/* Read in the section. */ /* Read in the section. */
BFD_ASSERT (true == bfd_get_section_contents (input_bfd, BFD_ASSERT (bfd_get_section_contents (input_bfd,
input_section, input_section,
data, data,
(bfd_vma) 0, (bfd_vma) 0,
input_section->_raw_size)); input_section->_raw_size));
reloc_count = bfd_canonicalize_reloc (input_bfd, reloc_count = bfd_canonicalize_reloc (input_bfd,
input_section, input_section,
@ -1366,7 +1397,7 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order,
case CALLJ: case CALLJ:
callj_callback (input_bfd, link_info, reloc, data, callj_callback (input_bfd, link_info, reloc, data,
src_address, dst_address, input_section, src_address, dst_address, input_section,
false); FALSE);
src_address += 4; src_address += 4;
dst_address += 4; dst_address += 4;
break; break;
@ -1383,7 +1414,7 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order,
callj will reach, so do the right thing. */ callj will reach, so do the right thing. */
callj_callback (input_bfd, link_info, reloc, data, callj_callback (input_bfd, link_info, reloc, data,
src_address + 4, dst_address, input_section, src_address + 4, dst_address, input_section,
true); TRUE);
dst_address += 4; dst_address += 4;
src_address += 8; src_address += 8;
break; break;

View file

@ -42,8 +42,8 @@ SECTION
static void insert PARAMS ((bfd *)); static void insert PARAMS ((bfd *));
static void snip PARAMS ((bfd *)); static void snip PARAMS ((bfd *));
static boolean close_one PARAMS ((void)); static bfd_boolean close_one PARAMS ((void));
static boolean bfd_cache_delete PARAMS ((bfd *)); static bfd_boolean bfd_cache_delete PARAMS ((bfd *));
/* /*
INTERNAL_FUNCTION INTERNAL_FUNCTION
@ -133,7 +133,7 @@ snip (abfd)
/* We need to open a new file, and the cache is full. Find the least /* We need to open a new file, and the cache is full. Find the least
recently used cacheable BFD and close it. */ recently used cacheable BFD and close it. */
static boolean static bfd_boolean
close_one () close_one ()
{ {
register bfd *kill; register bfd *kill;
@ -157,7 +157,7 @@ close_one ()
if (kill == NULL) if (kill == NULL)
{ {
/* There are no open cacheable BFD's. */ /* There are no open cacheable BFD's. */
return true; return TRUE;
} }
kill->where = ftell ((FILE *) kill->iostream); kill->where = ftell ((FILE *) kill->iostream);
@ -167,17 +167,17 @@ close_one ()
/* Close a BFD and remove it from the cache. */ /* Close a BFD and remove it from the cache. */
static boolean static bfd_boolean
bfd_cache_delete (abfd) bfd_cache_delete (abfd)
bfd *abfd; bfd *abfd;
{ {
boolean ret; bfd_boolean ret;
if (fclose ((FILE *) abfd->iostream) == 0) if (fclose ((FILE *) abfd->iostream) == 0)
ret = true; ret = TRUE;
else else
{ {
ret = false; ret = FALSE;
bfd_set_error (bfd_error_system_call); bfd_set_error (bfd_error_system_call);
} }
@ -194,13 +194,13 @@ INTERNAL_FUNCTION
bfd_cache_init bfd_cache_init
SYNOPSIS SYNOPSIS
boolean bfd_cache_init (bfd *abfd); bfd_boolean bfd_cache_init (bfd *abfd);
DESCRIPTION DESCRIPTION
Add a newly opened BFD to the cache. Add a newly opened BFD to the cache.
*/ */
boolean bfd_boolean
bfd_cache_init (abfd) bfd_cache_init (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -208,11 +208,11 @@ bfd_cache_init (abfd)
if (open_files >= BFD_CACHE_MAX_OPEN) if (open_files >= BFD_CACHE_MAX_OPEN)
{ {
if (! close_one ()) if (! close_one ())
return false; return FALSE;
} }
insert (abfd); insert (abfd);
++open_files; ++open_files;
return true; return TRUE;
} }
/* /*
@ -220,24 +220,24 @@ INTERNAL_FUNCTION
bfd_cache_close bfd_cache_close
SYNOPSIS SYNOPSIS
boolean bfd_cache_close (bfd *abfd); bfd_boolean bfd_cache_close (bfd *abfd);
DESCRIPTION DESCRIPTION
Remove the BFD @var{abfd} from the cache. If the attached file is open, Remove the BFD @var{abfd} from the cache. If the attached file is open,
then close it too. then close it too.
RETURNS RETURNS
<<false>> is returned if closing the file fails, <<true>> is <<FALSE>> is returned if closing the file fails, <<TRUE>> is
returned if all is well. returned if all is well.
*/ */
boolean bfd_boolean
bfd_cache_close (abfd) bfd_cache_close (abfd)
bfd *abfd; bfd *abfd;
{ {
if (abfd->iostream == NULL if (abfd->iostream == NULL
|| (abfd->flags & BFD_IN_MEMORY) != 0) || (abfd->flags & BFD_IN_MEMORY) != 0)
return true; return TRUE;
return bfd_cache_delete (abfd); return bfd_cache_delete (abfd);
} }
@ -261,7 +261,7 @@ FILE *
bfd_open_file (abfd) bfd_open_file (abfd)
bfd *abfd; bfd *abfd;
{ {
abfd->cacheable = true; /* Allow it to be closed later. */ abfd->cacheable = TRUE; /* Allow it to be closed later. */
if (open_files >= BFD_CACHE_MAX_OPEN) if (open_files >= BFD_CACHE_MAX_OPEN)
{ {
@ -312,7 +312,7 @@ bfd_open_file (abfd)
unlink (abfd->filename); unlink (abfd->filename);
#endif #endif
abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB); abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB);
abfd->opened_once = true; abfd->opened_once = TRUE;
} }
break; break;
} }

View file

@ -75,7 +75,7 @@ static const bfd_target *cisco_core_file_validate PARAMS ((bfd *, int));
static const bfd_target *cisco_core_file_p PARAMS ((bfd *)); static const bfd_target *cisco_core_file_p PARAMS ((bfd *));
char *cisco_core_file_failing_command PARAMS ((bfd *)); char *cisco_core_file_failing_command PARAMS ((bfd *));
int cisco_core_file_failing_signal PARAMS ((bfd *)); int cisco_core_file_failing_signal PARAMS ((bfd *));
boolean cisco_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); bfd_boolean cisco_core_file_matches_executable_p PARAMS ((bfd *, bfd *));
/* Examine the file for a crash info struct at the offset given by /* Examine the file for a crash info struct at the offset given by
CRASH_INFO_LOC. */ CRASH_INFO_LOC. */
@ -318,12 +318,12 @@ cisco_core_file_failing_signal (abfd)
return abfd->tdata.cisco_core_data->sig; return abfd->tdata.cisco_core_data->sig;
} }
boolean bfd_boolean
cisco_core_file_matches_executable_p (core_bfd, exec_bfd) cisco_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd ATTRIBUTE_UNUSED; bfd *core_bfd ATTRIBUTE_UNUSED;
bfd *exec_bfd ATTRIBUTE_UNUSED; bfd *exec_bfd ATTRIBUTE_UNUSED;
{ {
return true; return TRUE;
} }
extern const bfd_target cisco_core_little_vec; extern const bfd_target cisco_core_little_vec;

View file

@ -31,12 +31,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static long get_symbol_value PARAMS ((asymbol *)); static long get_symbol_value PARAMS ((asymbol *));
static bfd_reloc_status_type a29k_reloc static bfd_reloc_status_type a29k_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static boolean coff_a29k_relocate_section static bfd_boolean coff_a29k_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **)); struct internal_reloc *, struct internal_syment *, asection **));
static boolean coff_a29k_adjust_symndx static bfd_boolean coff_a29k_adjust_symndx
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
struct internal_reloc *, boolean *)); struct internal_reloc *, bfd_boolean *));
static void reloc_processing static void reloc_processing
PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
@ -82,7 +82,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
{ {
/* The consth relocation comes in two parts, we have to remember /* The consth relocation comes in two parts, we have to remember
the state between calls, in these variables. */ the state between calls, in these variables. */
static boolean part1_consth_active = false; static bfd_boolean part1_consth_active = FALSE;
static unsigned long part1_consth_value; static unsigned long part1_consth_value;
unsigned long insn; unsigned long insn;
unsigned long sym_value; unsigned long sym_value;
@ -107,7 +107,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
/* Keep the state machine happy in case we're called again. */ /* Keep the state machine happy in case we're called again. */
if (r_type == R_IHIHALF) if (r_type == R_IHIHALF)
{ {
part1_consth_active = true; part1_consth_active = TRUE;
part1_consth_value = 0; part1_consth_value = 0;
} }
return bfd_reloc_undefined; return bfd_reloc_undefined;
@ -115,7 +115,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
if ((part1_consth_active) && (r_type != R_IHCONST)) if ((part1_consth_active) && (r_type != R_IHCONST))
{ {
part1_consth_active = false; part1_consth_active = FALSE;
*error_message = (char *) _("Missing IHCONST"); *error_message = (char *) _("Missing IHCONST");
return bfd_reloc_dangerous; return bfd_reloc_dangerous;
@ -167,7 +167,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
insn = bfd_get_32 (abfd, hit_data); insn = bfd_get_32 (abfd, hit_data);
/* consth, part 1 /* consth, part 1
Just get the symbol value that is referenced. */ Just get the symbol value that is referenced. */
part1_consth_active = true; part1_consth_active = TRUE;
part1_consth_value = sym_value + reloc_entry->addend; part1_consth_value = sym_value + reloc_entry->addend;
/* Don't modify insn until R_IHCONST. */ /* Don't modify insn until R_IHCONST. */
break; break;
@ -186,7 +186,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
unsigned_value += part1_consth_value; unsigned_value += part1_consth_value;
unsigned_value = unsigned_value >> 16; unsigned_value = unsigned_value >> 16;
insn = INSERT_HWORD(insn, unsigned_value); insn = INSERT_HWORD(insn, unsigned_value);
part1_consth_active = false; part1_consth_active = FALSE;
bfd_put_32 (abfd, (bfd_vma) insn, hit_data); bfd_put_32 (abfd, (bfd_vma) insn, hit_data);
break; break;
case R_BYTE: case R_BYTE:
@ -219,7 +219,7 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
/*FIXME: I'm not real sure about this table. */ /*FIXME: I'm not real sure about this table. */
static reloc_howto_type howto_table[] = static reloc_howto_type howto_table[] =
{ {
{R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS", true, 0xffffffff,0xffffffff, false}, {R_ABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield,a29k_reloc,"ABS", TRUE, 0xffffffff,0xffffffff, FALSE},
EMPTY_HOWTO (1), EMPTY_HOWTO (1),
EMPTY_HOWTO (2), EMPTY_HOWTO (2),
EMPTY_HOWTO (3), EMPTY_HOWTO (3),
@ -243,14 +243,14 @@ static reloc_howto_type howto_table[] =
EMPTY_HOWTO (21), EMPTY_HOWTO (21),
EMPTY_HOWTO (22), EMPTY_HOWTO (22),
EMPTY_HOWTO (23), EMPTY_HOWTO (23),
{R_IREL, 0, 3, 32, true, 0, complain_overflow_signed,a29k_reloc,"IREL", true, 0xffffffff,0xffffffff, false}, {R_IREL, 0, 3, 32, TRUE, 0, complain_overflow_signed,a29k_reloc,"IREL", TRUE, 0xffffffff,0xffffffff, FALSE},
{R_IABS, 0, 3, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"IABS", true, 0xffffffff,0xffffffff, false}, {R_IABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield, a29k_reloc,"IABS", TRUE, 0xffffffff,0xffffffff, FALSE},
{R_ILOHALF, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"ILOHALF", true, 0x0000ffff,0x0000ffff, false}, {R_ILOHALF, 0, 3, 16, TRUE, 0, complain_overflow_signed, a29k_reloc,"ILOHALF", TRUE, 0x0000ffff,0x0000ffff, FALSE},
{R_IHIHALF, 0, 3, 16, true, 16, complain_overflow_signed, a29k_reloc,"IHIHALF", true, 0xffff0000,0xffff0000, false}, {R_IHIHALF, 0, 3, 16, TRUE, 16, complain_overflow_signed, a29k_reloc,"IHIHALF", TRUE, 0xffff0000,0xffff0000, FALSE},
{R_IHCONST, 0, 3, 16, true, 0, complain_overflow_signed, a29k_reloc,"IHCONST", true, 0xffff0000,0xffff0000, false}, {R_IHCONST, 0, 3, 16, TRUE, 0, complain_overflow_signed, a29k_reloc,"IHCONST", TRUE, 0xffff0000,0xffff0000, FALSE},
{R_BYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, a29k_reloc,"BYTE", true, 0x000000ff,0x000000ff, false}, {R_BYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, a29k_reloc,"BYTE", TRUE, 0x000000ff,0x000000ff, FALSE},
{R_HWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, a29k_reloc,"HWORD", true, 0x0000ffff,0x0000ffff, false}, {R_HWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, a29k_reloc,"HWORD", TRUE, 0x0000ffff,0x0000ffff, FALSE},
{R_WORD, 0, 2, 32, false, 0, complain_overflow_bitfield, a29k_reloc,"WORD", true, 0xffffffff,0xffffffff, false}, {R_WORD, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, a29k_reloc,"WORD", TRUE, 0xffffffff,0xffffffff, FALSE},
}; };
#define BADMAG(x) A29KBADMAG(x) #define BADMAG(x) A29KBADMAG(x)
@ -310,7 +310,7 @@ reloc_processing (relent,reloc, symbols, abfd, section)
/* The reloc processing routine for the optimized COFF linker. */ /* The reloc processing routine for the optimized COFF linker. */
static boolean static bfd_boolean
coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section, coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, syms, sections) contents, relocs, syms, sections)
bfd *output_bfd ATTRIBUTE_UNUSED; bfd *output_bfd ATTRIBUTE_UNUSED;
@ -324,16 +324,16 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
struct internal_reloc *rel; struct internal_reloc *rel;
struct internal_reloc *relend; struct internal_reloc *relend;
boolean hihalf; bfd_boolean hihalf;
bfd_vma hihalf_val; bfd_vma hihalf_val;
/* If we are performing a relocateable link, we don't need to do a /* If we are performing a relocateable link, we don't need to do a
thing. The caller will take care of adjusting the reloc thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */ addresses and symbol indices. */
if (info->relocateable) if (info->relocateable)
return true; return TRUE;
hihalf = false; hihalf = FALSE;
hihalf_val = 0; hihalf_val = 0;
rel = relocs; rel = relocs;
@ -346,7 +346,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
struct internal_syment *sym; struct internal_syment *sym;
asection *sec; asection *sec;
bfd_vma val; bfd_vma val;
boolean overflow; bfd_boolean overflow;
unsigned long insn; unsigned long insn;
long signed_value; long signed_value;
unsigned long unsigned_value; unsigned long unsigned_value;
@ -397,8 +397,8 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true))) rel->r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
} }
} }
@ -407,18 +407,18 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->reloc_dangerous) if (! ((*info->callbacks->reloc_dangerous)
(info, _("missing IHCONST reloc"), input_bfd, (info, _("missing IHCONST reloc"), input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
hihalf = false; hihalf = FALSE;
} }
} }
overflow = false; overflow = FALSE;
switch (rel->r_type) switch (rel->r_type)
{ {
default: default:
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
case R_IREL: case R_IREL:
insn = bfd_get_32 (input_bfd, loc); insn = bfd_get_32 (input_bfd, loc);
@ -465,7 +465,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
+ (rel->r_vaddr - input_section->vma)); + (rel->r_vaddr - input_section->vma));
if (signed_value > 0x1ffff || signed_value < - 0x20000) if (signed_value > 0x1ffff || signed_value < - 0x20000)
{ {
overflow = true; overflow = TRUE;
signed_value = 0; signed_value = 0;
} }
} }
@ -487,7 +487,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
case R_IHIHALF: case R_IHIHALF:
/* Save the value for the R_IHCONST reloc. */ /* Save the value for the R_IHCONST reloc. */
hihalf = true; hihalf = TRUE;
hihalf_val = val; hihalf_val = val;
break; break;
@ -497,7 +497,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->reloc_dangerous) if (! ((*info->callbacks->reloc_dangerous)
(info, _("missing IHIHALF reloc"), input_bfd, (info, _("missing IHIHALF reloc"), input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
hihalf_val = 0; hihalf_val = 0;
} }
@ -507,7 +507,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
insn = INSERT_HWORD (insn, unsigned_value); insn = INSERT_HWORD (insn, unsigned_value);
bfd_put_32 (input_bfd, (bfd_vma) insn, loc); bfd_put_32 (input_bfd, (bfd_vma) insn, loc);
hihalf = false; hihalf = FALSE;
break; break;
@ -517,7 +517,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
rstat = _bfd_relocate_contents (howto_table + rel->r_type, rstat = _bfd_relocate_contents (howto_table + rel->r_type,
input_bfd, val, loc); input_bfd, val, loc);
if (rstat == bfd_reloc_overflow) if (rstat == bfd_reloc_overflow)
overflow = true; overflow = TRUE;
else if (rstat != bfd_reloc_ok) else if (rstat != bfd_reloc_ok)
abort (); abort ();
break; break;
@ -548,11 +548,11 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
(info, name, howto_table[rel->r_type].name, (bfd_vma) 0, (info, name, howto_table[rel->r_type].name, (bfd_vma) 0,
input_bfd, input_section, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma)))
return false; return FALSE;
} }
} }
return true; return TRUE;
} }
#define coff_relocate_section coff_a29k_relocate_section #define coff_relocate_section coff_a29k_relocate_section
@ -560,20 +560,20 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
/* We don't want to change the symndx of a R_IHCONST reloc, since it /* We don't want to change the symndx of a R_IHCONST reloc, since it
is actually an addend, not a symbol index at all. */ is actually an addend, not a symbol index at all. */
static boolean static bfd_boolean
coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
bfd *obfd ATTRIBUTE_UNUSED; bfd *obfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED;
bfd *ibfd ATTRIBUTE_UNUSED; bfd *ibfd ATTRIBUTE_UNUSED;
asection *sec ATTRIBUTE_UNUSED; asection *sec ATTRIBUTE_UNUSED;
struct internal_reloc *irel; struct internal_reloc *irel;
boolean *adjustedp; bfd_boolean *adjustedp;
{ {
if (irel->r_type == R_IHCONST) if (irel->r_type == R_IHCONST)
*adjustedp = true; *adjustedp = TRUE;
else else
*adjustedp = false; *adjustedp = FALSE;
return true; return TRUE;
} }
#define coff_adjust_symndx coff_a29k_adjust_symndx #define coff_adjust_symndx coff_a29k_adjust_symndx

View file

@ -35,36 +35,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Prototypes for static functions. */ /* Prototypes for static functions. */
static const bfd_target *alpha_ecoff_object_p PARAMS ((bfd *)); static const bfd_target *alpha_ecoff_object_p
static boolean alpha_ecoff_bad_format_hook PARAMS ((bfd *abfd, PTR filehdr)); PARAMS ((bfd *));
static PTR alpha_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr)); static bfd_boolean alpha_ecoff_bad_format_hook
static void alpha_ecoff_swap_reloc_in PARAMS ((bfd *, PTR, PARAMS ((bfd *abfd, PTR filehdr));
struct internal_reloc *)); static PTR alpha_ecoff_mkobject_hook
static void alpha_ecoff_swap_reloc_out PARAMS ((bfd *, PARAMS ((bfd *, PTR filehdr, PTR aouthdr));
const struct internal_reloc *, static void alpha_ecoff_swap_reloc_in
PTR)); PARAMS ((bfd *, PTR, struct internal_reloc *));
static void alpha_adjust_reloc_in PARAMS ((bfd *, static void alpha_ecoff_swap_reloc_out
const struct internal_reloc *, PARAMS ((bfd *, const struct internal_reloc *, PTR));
arelent *)); static void alpha_adjust_reloc_in
static void alpha_adjust_reloc_out PARAMS ((bfd *, const arelent *, PARAMS ((bfd *, const struct internal_reloc *, arelent *));
struct internal_reloc *)); static void alpha_adjust_reloc_out
PARAMS ((bfd *, const arelent *, struct internal_reloc *));
static reloc_howto_type *alpha_bfd_reloc_type_lookup static reloc_howto_type *alpha_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static bfd_byte *alpha_ecoff_get_relocated_section_contents static bfd_byte *alpha_ecoff_get_relocated_section_contents
PARAMS ((bfd *abfd, struct bfd_link_info *, struct bfd_link_order *, PARAMS ((bfd *abfd, struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *data, boolean relocateable, asymbol **symbols)); bfd_byte *data, bfd_boolean relocateable, asymbol **symbols));
static bfd_vma alpha_convert_external_reloc static bfd_vma alpha_convert_external_reloc
PARAMS ((bfd *, struct bfd_link_info *, bfd *, struct external_reloc *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, struct external_reloc *,
struct ecoff_link_hash_entry *)); struct ecoff_link_hash_entry *));
static boolean alpha_relocate_section PARAMS ((bfd *, struct bfd_link_info *, static bfd_boolean alpha_relocate_section
bfd *, asection *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR));
bfd_byte *, PTR)); static bfd_boolean alpha_adjust_headers
static boolean alpha_adjust_headers
PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *)); PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *));
static PTR alpha_ecoff_read_ar_hdr PARAMS ((bfd *)); static PTR alpha_ecoff_read_ar_hdr
static bfd *alpha_ecoff_get_elt_at_filepos PARAMS ((bfd *, file_ptr)); PARAMS ((bfd *));
static bfd *alpha_ecoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); static bfd *alpha_ecoff_get_elt_at_filepos
static bfd *alpha_ecoff_get_elt_at_index PARAMS ((bfd *, symindex)); PARAMS ((bfd *, file_ptr));
static bfd *alpha_ecoff_openr_next_archived_file
PARAMS ((bfd *, bfd *));
static bfd *alpha_ecoff_get_elt_at_index
PARAMS ((bfd *, symindex));
/* ECOFF has COFF sections, but the debugging information is stored in /* ECOFF has COFF sections, but the debugging information is stored in
a completely different format. ECOFF targets use some of the a completely different format. ECOFF targets use some of the
@ -122,9 +126,8 @@ static bfd *alpha_ecoff_get_elt_at_index PARAMS ((bfd *, symindex));
/* How to process the various reloc types. */ /* How to process the various reloc types. */
static bfd_reloc_status_type static bfd_reloc_status_type reloc_nil
reloc_nil PARAMS ((bfd *, arelent *, asymbol *, PTR, PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
asection *, bfd *, char **));
static bfd_reloc_status_type static bfd_reloc_status_type
reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message) reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message)
@ -152,45 +155,45 @@ static reloc_howto_type alpha_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */ 8, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
reloc_nil, /* special_function */ reloc_nil, /* special_function */
"IGNORE", /* name */ "IGNORE", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* A 32 bit reference to a symbol. */ /* A 32 bit reference to a symbol. */
HOWTO (ALPHA_R_REFLONG, /* type */ HOWTO (ALPHA_R_REFLONG, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"REFLONG", /* name */ "REFLONG", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A 64 bit reference to a symbol. */ /* A 64 bit reference to a symbol. */
HOWTO (ALPHA_R_REFQUAD, /* type */ HOWTO (ALPHA_R_REFQUAD, /* type */
0, /* rightshift */ 0, /* rightshift */
4, /* size (0 = byte, 1 = short, 2 = long) */ 4, /* size (0 = byte, 1 = short, 2 = long) */
64, /* bitsize */ 64, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"REFQUAD", /* name */ "REFQUAD", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
MINUS_ONE, /* src_mask */ MINUS_ONE, /* src_mask */
MINUS_ONE, /* dst_mask */ MINUS_ONE, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A 32 bit GP relative offset. This is just like REFLONG except /* A 32 bit GP relative offset. This is just like REFLONG except
that when the value is used the value of the gp register will be that when the value is used the value of the gp register will be
@ -199,15 +202,15 @@ static reloc_howto_type alpha_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"GPREL32", /* name */ "GPREL32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* Used for an instruction that refers to memory off the GP /* Used for an instruction that refers to memory off the GP
register. The offset is 16 bits of the 32 bit instruction. This register. The offset is 16 bits of the 32 bit instruction. This
@ -216,15 +219,15 @@ static reloc_howto_type alpha_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"LITERAL", /* name */ "LITERAL", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* This reloc only appears immediately following a LITERAL reloc. /* This reloc only appears immediately following a LITERAL reloc.
It identifies a use of the literal. It seems that the linker can It identifies a use of the literal. It seems that the linker can
@ -239,15 +242,15 @@ static reloc_howto_type alpha_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
reloc_nil, /* special_function */ reloc_nil, /* special_function */
"LITUSE", /* name */ "LITUSE", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* Load the gp register. This is always used for a ldah instruction /* Load the gp register. This is always used for a ldah instruction
which loads the upper 16 bits of the gp register. The next reloc which loads the upper 16 bits of the gp register. The next reloc
@ -264,15 +267,15 @@ static reloc_howto_type alpha_howto_table[] =
16, /* rightshift */ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
reloc_nil, /* special_function */ reloc_nil, /* special_function */
"GPDISP", /* name */ "GPDISP", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* A 21 bit branch. The native assembler generates these for /* A 21 bit branch. The native assembler generates these for
branches within the text segment, and also fills in the PC branches within the text segment, and also fills in the PC
@ -281,90 +284,90 @@ static reloc_howto_type alpha_howto_table[] =
2, /* rightshift */ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
21, /* bitsize */ 21, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"BRADDR", /* name */ "BRADDR", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x1fffff, /* src_mask */ 0x1fffff, /* src_mask */
0x1fffff, /* dst_mask */ 0x1fffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A hint for a jump to a register. */ /* A hint for a jump to a register. */
HOWTO (ALPHA_R_HINT, /* type */ HOWTO (ALPHA_R_HINT, /* type */
2, /* rightshift */ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
14, /* bitsize */ 14, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"HINT", /* name */ "HINT", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x3fff, /* src_mask */ 0x3fff, /* src_mask */
0x3fff, /* dst_mask */ 0x3fff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* 16 bit PC relative offset. */ /* 16 bit PC relative offset. */
HOWTO (ALPHA_R_SREL16, /* type */ HOWTO (ALPHA_R_SREL16, /* type */
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"SREL16", /* name */ "SREL16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* 32 bit PC relative offset. */ /* 32 bit PC relative offset. */
HOWTO (ALPHA_R_SREL32, /* type */ HOWTO (ALPHA_R_SREL32, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"SREL32", /* name */ "SREL32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A 64 bit PC relative offset. */ /* A 64 bit PC relative offset. */
HOWTO (ALPHA_R_SREL64, /* type */ HOWTO (ALPHA_R_SREL64, /* type */
0, /* rightshift */ 0, /* rightshift */
4, /* size (0 = byte, 1 = short, 2 = long) */ 4, /* size (0 = byte, 1 = short, 2 = long) */
64, /* bitsize */ 64, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"SREL64", /* name */ "SREL64", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
MINUS_ONE, /* src_mask */ MINUS_ONE, /* src_mask */
MINUS_ONE, /* dst_mask */ MINUS_ONE, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* Push a value on the reloc evaluation stack. */ /* Push a value on the reloc evaluation stack. */
HOWTO (ALPHA_R_OP_PUSH, /* type */ HOWTO (ALPHA_R_OP_PUSH, /* type */
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */ 0, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"OP_PUSH", /* name */ "OP_PUSH", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* Store the value from the stack at the given address. Store it in /* Store the value from the stack at the given address. Store it in
a bitfield of size r_size starting at bit position r_offset. */ a bitfield of size r_size starting at bit position r_offset. */
@ -372,15 +375,15 @@ static reloc_howto_type alpha_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
4, /* size (0 = byte, 1 = short, 2 = long) */ 4, /* size (0 = byte, 1 = short, 2 = long) */
64, /* bitsize */ 64, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"OP_STORE", /* name */ "OP_STORE", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
MINUS_ONE, /* dst_mask */ MINUS_ONE, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* Subtract the reloc address from the value on the top of the /* Subtract the reloc address from the value on the top of the
relocation stack. */ relocation stack. */
@ -388,15 +391,15 @@ static reloc_howto_type alpha_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */ 0, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"OP_PSUB", /* name */ "OP_PSUB", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* Shift the value on the top of the relocation stack right by the /* Shift the value on the top of the relocation stack right by the
given value. */ given value. */
@ -404,30 +407,30 @@ static reloc_howto_type alpha_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */ 0, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"OP_PRSHIFT", /* name */ "OP_PRSHIFT", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* Adjust the GP value for a new range in the object file. */ /* Adjust the GP value for a new range in the object file. */
HOWTO (ALPHA_R_GPVALUE, /* type */ HOWTO (ALPHA_R_GPVALUE, /* type */
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */ 0, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"GPVALUE", /* name */ "GPVALUE", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
false) /* pcrel_offset */ FALSE) /* pcrel_offset */
}; };
/* Recognize an Alpha ECOFF file. */ /* Recognize an Alpha ECOFF file. */
@ -471,7 +474,7 @@ alpha_ecoff_object_p (abfd)
/* See whether the magic number matches. */ /* See whether the magic number matches. */
static boolean static bfd_boolean
alpha_ecoff_bad_format_hook (abfd, filehdr) alpha_ecoff_bad_format_hook (abfd, filehdr)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
PTR filehdr; PTR filehdr;
@ -479,9 +482,9 @@ alpha_ecoff_bad_format_hook (abfd, filehdr)
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
if (ALPHA_ECOFF_BADMAG (*internal_f)) if (ALPHA_ECOFF_BADMAG (*internal_f))
return false; return FALSE;
return true; return TRUE;
} }
/* This is a hook called by coff_real_object_p to create any backend /* This is a hook called by coff_real_object_p to create any backend
@ -755,7 +758,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
struct bfd_link_info *link_info; struct bfd_link_info *link_info;
struct bfd_link_order *link_order; struct bfd_link_order *link_order;
bfd_byte *data; bfd_byte *data;
boolean relocateable; bfd_boolean relocateable;
asymbol **symbols; asymbol **symbols;
{ {
bfd *input_bfd = link_order->u.indirect.section->owner; bfd *input_bfd = link_order->u.indirect.section->owner;
@ -765,7 +768,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
long reloc_count; long reloc_count;
bfd *output_bfd = relocateable ? abfd : (bfd *) NULL; bfd *output_bfd = relocateable ? abfd : (bfd *) NULL;
bfd_vma gp; bfd_vma gp;
boolean gp_undefined; bfd_boolean gp_undefined;
bfd_vma stack[RELOC_STACKSIZE]; bfd_vma stack[RELOC_STACKSIZE];
int tos = 0; int tos = 0;
@ -781,7 +784,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
/* The section size is not going to change. */ /* The section size is not going to change. */
input_section->_cooked_size = input_section->_raw_size; input_section->_cooked_size = input_section->_raw_size;
input_section->reloc_done = true; input_section->reloc_done = TRUE;
reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
reloc_vector, symbols); reloc_vector, symbols);
@ -791,7 +794,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
goto successful_return; goto successful_return;
/* Get the GP value for the output BFD. */ /* Get the GP value for the output BFD. */
gp_undefined = false; gp_undefined = FALSE;
gp = _bfd_get_gp_value (abfd); gp = _bfd_get_gp_value (abfd);
if (gp == 0) if (gp == 0)
{ {
@ -819,11 +822,11 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
{ {
struct bfd_link_hash_entry *h; struct bfd_link_hash_entry *h;
h = bfd_link_hash_lookup (link_info->hash, "_gp", false, false, h = bfd_link_hash_lookup (link_info->hash, "_gp", FALSE, FALSE,
true); TRUE);
if (h == (struct bfd_link_hash_entry *) NULL if (h == (struct bfd_link_hash_entry *) NULL
|| h->type != bfd_link_hash_defined) || h->type != bfd_link_hash_defined)
gp_undefined = true; gp_undefined = TRUE;
else else
{ {
gp = (h->u.def.value gp = (h->u.def.value
@ -1111,7 +1114,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
case ALPHA_R_GPVALUE: case ALPHA_R_GPVALUE:
/* I really don't know if this does the right thing. */ /* I really don't know if this does the right thing. */
gp = rel->addend; gp = rel->addend;
gp_undefined = false; gp_undefined = FALSE;
break; break;
default: default:
@ -1134,7 +1137,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
case bfd_reloc_undefined: case bfd_reloc_undefined:
if (! ((*link_info->callbacks->undefined_symbol) if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*rel->sym_ptr_ptr), (link_info, bfd_asymbol_name (*rel->sym_ptr_ptr),
input_bfd, input_section, rel->address, true))) input_bfd, input_section, rel->address, TRUE)))
goto error_return; goto error_return;
break; break;
case bfd_reloc_dangerous: case bfd_reloc_dangerous:
@ -1365,7 +1368,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h)
quite similar to get_relocated_section_contents. Perhaps they quite similar to get_relocated_section_contents. Perhaps they
could be combined somehow. */ could be combined somehow. */
static boolean static bfd_boolean
alpha_relocate_section (output_bfd, info, input_bfd, input_section, alpha_relocate_section (output_bfd, info, input_bfd, input_section,
contents, external_relocs) contents, external_relocs)
bfd *output_bfd; bfd *output_bfd;
@ -1378,7 +1381,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
asection **symndx_to_section, *lita_sec; asection **symndx_to_section, *lita_sec;
struct ecoff_link_hash_entry **sym_hashes; struct ecoff_link_hash_entry **sym_hashes;
bfd_vma gp; bfd_vma gp;
boolean gp_undefined; bfd_boolean gp_undefined;
bfd_vma stack[RELOC_STACKSIZE]; bfd_vma stack[RELOC_STACKSIZE];
int tos = 0; int tos = 0;
struct external_reloc *ext_rel; struct external_reloc *ext_rel;
@ -1394,7 +1397,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
amt = NUM_RELOC_SECTIONS * sizeof (asection *); amt = NUM_RELOC_SECTIONS * sizeof (asection *);
symndx_to_section = (asection **) bfd_alloc (input_bfd, amt); symndx_to_section = (asection **) bfd_alloc (input_bfd, amt);
if (!symndx_to_section) if (!symndx_to_section)
return false; return FALSE;
symndx_to_section[RELOC_SECTION_NONE] = NULL; symndx_to_section[RELOC_SECTION_NONE] = NULL;
symndx_to_section[RELOC_SECTION_TEXT] = symndx_to_section[RELOC_SECTION_TEXT] =
@ -1485,7 +1488,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
_("using multiple gp values"), _("using multiple gp values"),
(char *) NULL, output_bfd, (char *) NULL, output_bfd,
(asection *) NULL, (bfd_vma) 0); (asection *) NULL, (bfd_vma) 0);
ecoff_data (output_bfd)->issued_multiple_gp_warning = true; ecoff_data (output_bfd)->issued_multiple_gp_warning = TRUE;
} }
if (lita_vma < gp - 0x8000) if (lita_vma < gp - 0x8000)
gp = lita_vma + lita_size - 0x8000; gp = lita_vma + lita_size - 0x8000;
@ -1515,9 +1518,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
int r_extern; int r_extern;
int r_offset; int r_offset;
int r_size; int r_size;
boolean relocatep; bfd_boolean relocatep;
boolean adjust_addrp; bfd_boolean adjust_addrp;
boolean gp_usedp; bfd_boolean gp_usedp;
bfd_vma addend; bfd_vma addend;
r_vaddr = H_GET_64 (input_bfd, ext_rel->r_vaddr); r_vaddr = H_GET_64 (input_bfd, ext_rel->r_vaddr);
@ -1532,9 +1535,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
r_size = ((ext_rel->r_bits[3] & RELOC_BITS3_SIZE_LITTLE) r_size = ((ext_rel->r_bits[3] & RELOC_BITS3_SIZE_LITTLE)
>> RELOC_BITS3_SIZE_SH_LITTLE); >> RELOC_BITS3_SIZE_SH_LITTLE);
relocatep = false; relocatep = FALSE;
adjust_addrp = true; adjust_addrp = TRUE;
gp_usedp = false; gp_usedp = FALSE;
addend = 0; addend = 0;
switch (r_type) switch (r_type)
@ -1552,13 +1555,13 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->relocateable) if (info->relocateable)
H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr, H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr,
ext_rel->r_vaddr); ext_rel->r_vaddr);
adjust_addrp = false; adjust_addrp = FALSE;
break; break;
case ALPHA_R_REFLONG: case ALPHA_R_REFLONG:
case ALPHA_R_REFQUAD: case ALPHA_R_REFQUAD:
case ALPHA_R_HINT: case ALPHA_R_HINT:
relocatep = true; relocatep = TRUE;
break; break;
case ALPHA_R_BRADDR: case ALPHA_R_BRADDR:
@ -1567,7 +1570,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
case ALPHA_R_SREL64: case ALPHA_R_SREL64:
if (r_extern) if (r_extern)
addend += - (r_vaddr + 4); addend += - (r_vaddr + 4);
relocatep = true; relocatep = TRUE;
break; break;
case ALPHA_R_GPREL32: case ALPHA_R_GPREL32:
@ -1575,9 +1578,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
bit offset from the current GP value. We must adjust it bit offset from the current GP value. We must adjust it
by the different between the original GP value and the by the different between the original GP value and the
current GP value. */ current GP value. */
relocatep = true; relocatep = TRUE;
addend = ecoff_data (input_bfd)->gp - gp; addend = ecoff_data (input_bfd)->gp - gp;
gp_usedp = true; gp_usedp = TRUE;
break; break;
case ALPHA_R_LITERAL: case ALPHA_R_LITERAL:
@ -1608,9 +1611,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
|| ((insn >> 26) & 0x3f) == 0x28); || ((insn >> 26) & 0x3f) == 0x28);
} }
relocatep = true; relocatep = TRUE;
addend = ecoff_data (input_bfd)->gp - gp; addend = ecoff_data (input_bfd)->gp - gp;
gp_usedp = true; gp_usedp = TRUE;
break; break;
case ALPHA_R_LITUSE: case ALPHA_R_LITUSE:
@ -1674,7 +1677,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_put_32 (input_bfd, (bfd_vma) insn2, bfd_put_32 (input_bfd, (bfd_vma) insn2,
contents + r_vaddr - input_section->vma + r_symndx); contents + r_vaddr - input_section->vma + r_symndx);
gp_usedp = true; gp_usedp = TRUE;
} }
break; break;
@ -1717,8 +1720,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
relocated. */ relocated. */
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, (bfd_vma) 0, true))) input_section, (bfd_vma) 0, TRUE)))
return false; return FALSE;
addend = 0; addend = 0;
} }
} }
@ -1734,7 +1737,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->unattached_reloc) if (! ((*info->callbacks->unattached_reloc)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, (bfd_vma) 0))) input_section, (bfd_vma) 0)))
return false; return FALSE;
} }
addend = alpha_convert_external_reloc (output_bfd, info, addend = alpha_convert_external_reloc (output_bfd, info,
@ -1774,7 +1777,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
adjust_addrp = false; adjust_addrp = FALSE;
break; break;
case ALPHA_R_OP_STORE: case ALPHA_R_OP_STORE:
@ -1811,7 +1814,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
case ALPHA_R_GPVALUE: case ALPHA_R_GPVALUE:
/* I really don't know if this does the right thing. */ /* I really don't know if this does the right thing. */
gp = ecoff_data (input_bfd)->gp + r_symndx; gp = ecoff_data (input_bfd)->gp + r_symndx;
gp_undefined = false; gp_undefined = FALSE;
break; break;
} }
@ -1861,7 +1864,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->unattached_reloc) if (! ((*info->callbacks->unattached_reloc)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, r_vaddr - input_section->vma))) input_section, r_vaddr - input_section->vma)))
return false; return FALSE;
} }
relocation = alpha_convert_external_reloc (output_bfd, relocation = alpha_convert_external_reloc (output_bfd,
@ -1918,8 +1921,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, input_section,
r_vaddr - input_section->vma, true))) r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
relocation = 0; relocation = 0;
} }
} }
@ -1965,7 +1968,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
(info, name, alpha_howto_table[r_type].name, (info, name, alpha_howto_table[r_type].name,
(bfd_vma) 0, input_bfd, input_section, (bfd_vma) 0, input_bfd, input_section,
r_vaddr - input_section->vma))) r_vaddr - input_section->vma)))
return false; return FALSE;
} }
break; break;
} }
@ -1988,24 +1991,24 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->reloc_dangerous) if (! ((*info->callbacks->reloc_dangerous)
(info, _("GP relative relocation used when GP not defined"), (info, _("GP relative relocation used when GP not defined"),
input_bfd, input_section, r_vaddr - input_section->vma))) input_bfd, input_section, r_vaddr - input_section->vma)))
return false; return FALSE;
/* Only give the error once per link. */ /* Only give the error once per link. */
gp = 4; gp = 4;
_bfd_set_gp_value (output_bfd, gp); _bfd_set_gp_value (output_bfd, gp);
gp_undefined = false; gp_undefined = FALSE;
} }
} }
if (tos != 0) if (tos != 0)
abort (); abort ();
return true; return TRUE;
} }
/* Do final adjustments to the filehdr and the aouthdr. This routine /* Do final adjustments to the filehdr and the aouthdr. This routine
sets the dynamic bits in the file header. */ sets the dynamic bits in the file header. */
static boolean static bfd_boolean
alpha_adjust_headers (abfd, fhdr, ahdr) alpha_adjust_headers (abfd, fhdr, ahdr)
bfd *abfd; bfd *abfd;
struct internal_filehdr *fhdr; struct internal_filehdr *fhdr;
@ -2015,7 +2018,7 @@ alpha_adjust_headers (abfd, fhdr, ahdr)
fhdr->f_flags |= F_ALPHA_CALL_SHARED; fhdr->f_flags |= F_ALPHA_CALL_SHARED;
else if ((abfd->flags & DYNAMIC) != 0) else if ((abfd->flags & DYNAMIC) != 0)
fhdr->f_flags |= F_ALPHA_SHARABLE; fhdr->f_flags |= F_ALPHA_SHARABLE;
return true; return TRUE;
} }
/* Archive handling. In OSF/1 (or Digital Unix) v3.2, Digital /* Archive handling. In OSF/1 (or Digital Unix) v3.2, Digital
@ -2185,7 +2188,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos)
bim->size = size; bim->size = size;
bim->buffer = buf; bim->buffer = buf;
nbfd->mtime_set = true; nbfd->mtime_set = TRUE;
nbfd->mtime = strtol (hdr->ar_date, (char **) NULL, 10); nbfd->mtime = strtol (hdr->ar_date, (char **) NULL, 10);
nbfd->flags |= BFD_IN_MEMORY; nbfd->flags |= BFD_IN_MEMORY;
@ -2262,7 +2265,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
(unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */
alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out, alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
alpha_ecoff_swap_scnhdr_out, alpha_ecoff_swap_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, FALSE, 4, FALSE, 2,
alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in, alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in,
alpha_ecoff_swap_scnhdr_in, NULL, alpha_ecoff_swap_scnhdr_in, NULL,
alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
@ -2278,10 +2281,10 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
/* The page boundary used to align sections in a demand-paged /* The page boundary used to align sections in a demand-paged
executable file. E.g., 0x1000. */ executable file. E.g., 0x1000. */
0x2000, 0x2000,
/* True if the .rdata section is part of the text segment, as on the /* TRUE if the .rdata section is part of the text segment, as on the
Alpha. False if .rdata is part of the data segment, as on the Alpha. FALSE if .rdata is part of the data segment, as on the
MIPS. */ MIPS. */
true, TRUE,
/* Bitsize of constructor entries. */ /* Bitsize of constructor entries. */
64, 64,
/* Reloc to use for constructor entries. */ /* Reloc to use for constructor entries. */

View file

@ -1,5 +1,5 @@
/* BFD back-end for Apollo 68000 COFF binaries. /* BFD back-end for Apollo 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001 Copyright 1990, 1991, 1992, 1993, 1994, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
By Troy Rollo (troy@cbme.unsw.edu.au) By Troy Rollo (troy@cbme.unsw.edu.au)
Based on m68k standard COFF version Written by Cygnus Support. Based on m68k standard COFF version Written by Cygnus Support.
@ -34,13 +34,13 @@ extern reloc_howto_type apollocoff_howto_table[];
#else #else
reloc_howto_type apollocoff_howto_table[] = reloc_howto_type apollocoff_howto_table[] =
{ {
HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
HOWTO (R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
HOWTO (R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "-32", true, 0xffffffff,0xffffffff, false), HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, 0, "-32", TRUE, 0xffffffff,0xffffffff, FALSE),
}; };
#endif /* not ONLY_DECLARE_RELOCS */ #endif /* not ONLY_DECLARE_RELOCS */

View file

@ -80,7 +80,7 @@ typedef unsigned long int insn32;
typedef unsigned short int insn16; typedef unsigned short int insn16;
/* Forward declarations for stupid compilers. */ /* Forward declarations for stupid compilers. */
static boolean coff_arm_relocate_section static bfd_boolean coff_arm_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **)); struct internal_reloc *, struct internal_syment *, asection **));
static bfd_reloc_status_type aoutarm_fix_pcrel_26_done static bfd_reloc_status_type aoutarm_fix_pcrel_26_done
@ -99,9 +99,9 @@ static bfd_reloc_status_type coff_thumb_pcrel_12
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type coff_arm_reloc static bfd_reloc_status_type coff_arm_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static boolean coff_arm_adjust_symndx static bfd_boolean coff_arm_adjust_symndx
PARAMS ((bfd *, struct bfd_link_info *, bfd *, PARAMS ((bfd *, struct bfd_link_info *, bfd *,
asection *, struct internal_reloc *, boolean *)); asection *, struct internal_reloc *, bfd_boolean *));
static reloc_howto_type * coff_arm_rtype_to_howto static reloc_howto_type * coff_arm_rtype_to_howto
PARAMS ((bfd *, asection *, struct internal_reloc *, PARAMS ((bfd *, asection *, struct internal_reloc *,
struct coff_link_hash_entry *, struct internal_syment *, struct coff_link_hash_entry *, struct internal_syment *,
@ -125,19 +125,19 @@ static void record_thumb_to_arm_glue
PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *)); PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *));
#endif #endif
#endif #endif
static boolean coff_arm_merge_private_bfd_data static bfd_boolean coff_arm_merge_private_bfd_data
PARAMS ((bfd *, bfd *)); PARAMS ((bfd *, bfd *));
static boolean coff_arm_print_private_bfd_data static bfd_boolean coff_arm_print_private_bfd_data
PARAMS ((bfd *, PTR)); PARAMS ((bfd *, PTR));
static boolean _bfd_coff_arm_set_private_flags static bfd_boolean _bfd_coff_arm_set_private_flags
PARAMS ((bfd *, flagword)); PARAMS ((bfd *, flagword));
static boolean coff_arm_copy_private_bfd_data static bfd_boolean coff_arm_copy_private_bfd_data
PARAMS ((bfd *, bfd *)); PARAMS ((bfd *, bfd *));
static boolean coff_arm_is_local_label_name static bfd_boolean coff_arm_is_local_label_name
PARAMS ((bfd *, const char *)); PARAMS ((bfd *, const char *));
static boolean coff_arm_link_output_has_begun static bfd_boolean coff_arm_link_output_has_begun
PARAMS ((bfd *, struct coff_final_link_info *)); PARAMS ((bfd *, struct coff_final_link_info *));
static boolean coff_arm_final_link_postscript static bfd_boolean coff_arm_final_link_postscript
PARAMS ((bfd *, struct coff_final_link_info *)); PARAMS ((bfd *, struct coff_final_link_info *));
static void arm_emit_base_file_entry static void arm_emit_base_file_entry
PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma)); PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma));
@ -224,7 +224,7 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
#endif #endif
#ifndef PCRELOFFSET #ifndef PCRELOFFSET
#define PCRELOFFSET true #define PCRELOFFSET TRUE
#endif #endif
/* These most certainly belong somewhere else. Just had to get rid of /* These most certainly belong somewhere else. Just had to get rid of
@ -269,12 +269,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
0, 0,
2, 2,
32, 32,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_32", "ARM_32",
true, TRUE,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
PCRELOFFSET), PCRELOFFSET),
@ -282,12 +282,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
0, 0,
2, 2,
32, 32,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_RVA32", "ARM_RVA32",
true, TRUE,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
PCRELOFFSET), PCRELOFFSET),
@ -295,12 +295,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
2, 2,
2, 2,
24, 24,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
aoutarm_fix_pcrel_26 , aoutarm_fix_pcrel_26 ,
"ARM_26", "ARM_26",
false, FALSE,
0x00ffffff, 0x00ffffff,
0x00ffffff, 0x00ffffff,
PCRELOFFSET), PCRELOFFSET),
@ -308,12 +308,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
1, 1,
1, 1,
11, 11,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
coff_thumb_pcrel_12 , coff_thumb_pcrel_12 ,
"ARM_THUMB12", "ARM_THUMB12",
false, FALSE,
0x000007ff, 0x000007ff,
0x000007ff, 0x000007ff,
PCRELOFFSET), PCRELOFFSET),
@ -321,15 +321,15 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
2, 2,
2, 2,
24, 24,
false, FALSE,
0, 0,
complain_overflow_dont, complain_overflow_dont,
aoutarm_fix_pcrel_26_done, aoutarm_fix_pcrel_26_done,
"ARM_26D", "ARM_26D",
true, TRUE,
0x00ffffff, 0x00ffffff,
0x0, 0x0,
false), FALSE),
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
@ -342,12 +342,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
0, 0,
1, 1,
16, 16,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_16", "ARM_16",
true, TRUE,
0x0000ffff, 0x0000ffff,
0x0000ffff, 0x0000ffff,
PCRELOFFSET), PCRELOFFSET),
@ -355,26 +355,26 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
0, 0,
2, 2,
32, 32,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_32", "ARM_32",
true, TRUE,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
PCRELOFFSET), PCRELOFFSET),
#else /* not ARM_WINCE */ #else /* not ARM_WINCE */
HOWTO (ARM_8, /* type */ HOWTO (ARM_8, /* type */
0, /* rightshift */ 0, /* rightshift */
0, /* size */ 0, /* size */
8, /* bitsize */ 8, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_arm_reloc, /* special_function */ coff_arm_reloc, /* special_function */
"ARM_8", /* name */ "ARM_8", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x000000ff, /* src_mask */ 0x000000ff, /* src_mask */
0x000000ff, /* dst_mask */ 0x000000ff, /* dst_mask */
PCRELOFFSET /* pcrel_offset */), PCRELOFFSET /* pcrel_offset */),
@ -382,12 +382,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
0, 0,
1, 1,
16, 16,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_16", "ARM_16",
true, TRUE,
0x0000ffff, 0x0000ffff,
0x0000ffff, 0x0000ffff,
PCRELOFFSET), PCRELOFFSET),
@ -395,12 +395,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
0, 0,
2, 2,
32, 32,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_32", "ARM_32",
true, TRUE,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
PCRELOFFSET), PCRELOFFSET),
@ -408,12 +408,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
2, 2,
2, 2,
24, 24,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
aoutarm_fix_pcrel_26 , aoutarm_fix_pcrel_26 ,
"ARM_26", "ARM_26",
false, FALSE,
0x00ffffff, 0x00ffffff,
0x00ffffff, 0x00ffffff,
PCRELOFFSET), PCRELOFFSET),
@ -421,92 +421,92 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
0, 0,
0, 0,
8, 8,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
coff_arm_reloc, coff_arm_reloc,
"ARM_DISP8", "ARM_DISP8",
true, TRUE,
0x000000ff, 0x000000ff,
0x000000ff, 0x000000ff,
true), TRUE),
HOWTO (ARM_DISP16, HOWTO (ARM_DISP16,
0, 0,
1, 1,
16, 16,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
coff_arm_reloc, coff_arm_reloc,
"ARM_DISP16", "ARM_DISP16",
true, TRUE,
0x0000ffff, 0x0000ffff,
0x0000ffff, 0x0000ffff,
true), TRUE),
HOWTO (ARM_DISP32, HOWTO (ARM_DISP32,
0, 0,
2, 2,
32, 32,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
coff_arm_reloc, coff_arm_reloc,
"ARM_DISP32", "ARM_DISP32",
true, TRUE,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
true), TRUE),
HOWTO (ARM_26D, HOWTO (ARM_26D,
2, 2,
2, 2,
24, 24,
false, FALSE,
0, 0,
complain_overflow_dont, complain_overflow_dont,
aoutarm_fix_pcrel_26_done, aoutarm_fix_pcrel_26_done,
"ARM_26D", "ARM_26D",
true, TRUE,
0x00ffffff, 0x00ffffff,
0x0, 0x0,
false), FALSE),
/* 8 is unused */ /* 8 is unused */
EMPTY_HOWTO (-1), EMPTY_HOWTO (-1),
HOWTO (ARM_NEG16, HOWTO (ARM_NEG16,
0, 0,
-1, -1,
16, 16,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_NEG16", "ARM_NEG16",
true, TRUE,
0x0000ffff, 0x0000ffff,
0x0000ffff, 0x0000ffff,
false), FALSE),
HOWTO (ARM_NEG32, HOWTO (ARM_NEG32,
0, 0,
-2, -2,
32, 32,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_NEG32", "ARM_NEG32",
true, TRUE,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
false), FALSE),
HOWTO (ARM_RVA32, HOWTO (ARM_RVA32,
0, 0,
2, 2,
32, 32,
false, FALSE,
0, 0,
complain_overflow_bitfield, complain_overflow_bitfield,
coff_arm_reloc, coff_arm_reloc,
"ARM_RVA32", "ARM_RVA32",
true, TRUE,
0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff,
PCRELOFFSET), PCRELOFFSET),
@ -514,12 +514,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
1, 1,
1, 1,
8, 8,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
coff_thumb_pcrel_9 , coff_thumb_pcrel_9 ,
"ARM_THUMB9", "ARM_THUMB9",
false, FALSE,
0x000000ff, 0x000000ff,
0x000000ff, 0x000000ff,
PCRELOFFSET), PCRELOFFSET),
@ -527,12 +527,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
1, 1,
1, 1,
11, 11,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
coff_thumb_pcrel_12 , coff_thumb_pcrel_12 ,
"ARM_THUMB12", "ARM_THUMB12",
false, FALSE,
0x000007ff, 0x000007ff,
0x000007ff, 0x000007ff,
PCRELOFFSET), PCRELOFFSET),
@ -540,12 +540,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
1, 1,
2, 2,
22, 22,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
coff_thumb_pcrel_23 , coff_thumb_pcrel_23 ,
"ARM_THUMB23", "ARM_THUMB23",
false, FALSE,
0x07ff07ff, 0x07ff07ff,
0x07ff07ff, 0x07ff07ff,
PCRELOFFSET) PCRELOFFSET)
@ -555,11 +555,11 @@ static reloc_howto_type aoutarm_std_reloc_howto[] =
#define NUM_RELOCS NUM_ELEM (aoutarm_std_reloc_howto) #define NUM_RELOCS NUM_ELEM (aoutarm_std_reloc_howto)
#ifdef COFF_WITH_PE #ifdef COFF_WITH_PE
static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
/* Return true if this relocation should /* Return TRUE if this relocation should
appear in the output .reloc section. */ appear in the output .reloc section. */
static boolean static bfd_boolean
in_reloc_p (abfd, howto) in_reloc_p (abfd, howto)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
reloc_howto_type * howto; reloc_howto_type * howto;
@ -1059,7 +1059,7 @@ find_thumb_glue (info, name, input_bfd)
sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name);
myh = coff_link_hash_lookup myh = coff_link_hash_lookup
(coff_hash_table (info), tmp_name, false, false, true); (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE);
if (myh == NULL) if (myh == NULL)
/* xgettext:c-format */ /* xgettext:c-format */
@ -1089,7 +1089,7 @@ find_arm_glue (info, name, input_bfd)
sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name);
myh = coff_link_hash_lookup myh = coff_link_hash_lookup
(coff_hash_table (info), tmp_name, false, false, true); (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE);
if (myh == NULL) if (myh == NULL)
/* xgettext:c-format */ /* xgettext:c-format */
@ -1188,7 +1188,7 @@ static const insn32 t2a6_bx_insn = 0xe12fff1e;
ARM/Thumb builds. It is only the code marked THUMBEXTENSION that ARM/Thumb builds. It is only the code marked THUMBEXTENSION that
is different from the original. */ is different from the original. */
static boolean static bfd_boolean
coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, syms, sections) contents, relocs, syms, sections)
bfd *output_bfd; bfd *output_bfd;
@ -1244,7 +1244,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
howto = coff_rtype_to_howto (input_bfd, input_section, rel, h, howto = coff_rtype_to_howto (input_bfd, input_section, rel, h,
sym, &addend); sym, &addend);
if (howto == NULL) if (howto == NULL)
return false; return FALSE;
/* The relocation_section function will skip pcrel_offset relocs /* The relocation_section function will skip pcrel_offset relocs
when doing a relocateable link. However, we want to convert when doing a relocateable link. However, we want to convert
@ -1264,15 +1264,15 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
2, 2,
2, 2,
24, 24,
true, TRUE,
0, 0,
complain_overflow_signed, complain_overflow_signed,
aoutarm_fix_pcrel_26 , aoutarm_fix_pcrel_26 ,
"ARM_26", "ARM_26",
false, FALSE,
0x00ffffff, 0x00ffffff,
0x00ffffff, 0x00ffffff,
false); FALSE);
addend -= rel->r_vaddr - input_section->vma; addend -= rel->r_vaddr - input_section->vma;
howto = &fake_arm26_reloc; howto = &fake_arm26_reloc;
@ -1365,7 +1365,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
myh = find_arm_glue (info, name, input_bfd); myh = find_arm_glue (info, name, input_bfd);
if (myh == NULL) if (myh == NULL)
return false; return FALSE;
globals = coff_arm_hash_table (info); globals = coff_arm_hash_table (info);
@ -1458,7 +1458,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
myh = find_thumb_glue (info, name, input_bfd); myh = find_thumb_glue (info, name, input_bfd);
if (myh == NULL) if (myh == NULL)
return false; return FALSE;
globals = coff_arm_hash_table (info); globals = coff_arm_hash_table (info);
@ -1596,8 +1596,8 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true))) rel->r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
} }
} }
@ -1631,18 +1631,18 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
rstat = bfd_reloc_outofrange; rstat = bfd_reloc_outofrange;
else else
{ {
bfd_vma relocation = val + addend; bfd_vma relocation = val + addend;
int size = bfd_get_reloc_size (howto); int size = bfd_get_reloc_size (howto);
boolean overflow = false; bfd_boolean overflow = FALSE;
bfd_byte * location = contents + address; bfd_byte *location = contents + address;
bfd_vma x = bfd_get_32 (input_bfd, location); bfd_vma x = bfd_get_32 (input_bfd, location);
bfd_vma src_mask = 0x007FFFFE; bfd_vma src_mask = 0x007FFFFE;
bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
bfd_signed_vma reloc_signed_min = ~reloc_signed_max; bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
bfd_vma check; bfd_vma check;
bfd_signed_vma signed_check; bfd_signed_vma signed_check;
bfd_vma add; bfd_vma add;
bfd_signed_vma signed_add; bfd_signed_vma signed_add;
BFD_ASSERT (size == 4); BFD_ASSERT (size == 4);
@ -1699,7 +1699,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
/* Assumes two's complement. */ /* Assumes two's complement. */
if ( signed_check > reloc_signed_max if ( signed_check > reloc_signed_max
|| signed_check < reloc_signed_min) || signed_check < reloc_signed_min)
overflow = true; overflow = TRUE;
/* Put the relocation into the correct bits. /* Put the relocation into the correct bits.
For a BLX instruction, make sure that the relocation is rounded up For a BLX instruction, make sure that the relocation is rounded up
@ -1746,13 +1746,13 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
/* Determine if we need to set the bottom bit of a relocated address /* Determine if we need to set the bottom bit of a relocated address
because the address is the address of a Thumb code symbol. */ because the address is the address of a Thumb code symbol. */
int patchit = false; int patchit = FALSE;
if (h != NULL if (h != NULL
&& ( h->class == C_THUMBSTATFUNC && ( h->class == C_THUMBSTATFUNC
|| h->class == C_THUMBEXTFUNC)) || h->class == C_THUMBEXTFUNC))
{ {
patchit = true; patchit = TRUE;
} }
else if (sym != NULL else if (sym != NULL
&& sym->n_scnum > N_UNDEF) && sym->n_scnum > N_UNDEF)
@ -1761,7 +1761,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
if ( sym->n_sclass == C_THUMBSTATFUNC if ( sym->n_sclass == C_THUMBSTATFUNC
|| sym->n_sclass == C_THUMBEXTFUNC) || sym->n_sclass == C_THUMBEXTFUNC)
patchit = true; patchit = TRUE;
} }
if (patchit) if (patchit)
@ -1786,7 +1786,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_archive_filename (input_bfd), bfd_archive_filename (input_bfd),
(unsigned long) rel->r_vaddr, (unsigned long) rel->r_vaddr,
bfd_get_section_name (input_bfd, input_section)); bfd_get_section_name (input_bfd, input_section));
return false; return FALSE;
case bfd_reloc_overflow: case bfd_reloc_overflow:
{ {
const char *name; const char *name;
@ -1800,23 +1800,23 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
if (name == NULL) if (name == NULL)
return false; return FALSE;
} }
if (! ((*info->callbacks->reloc_overflow) if (! ((*info->callbacks->reloc_overflow)
(info, name, howto->name, (bfd_vma) 0, input_bfd, (info, name, howto->name, (bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
} }
} }
} }
return true; return TRUE;
} }
#ifndef COFF_IMAGE_WITH_PE #ifndef COFF_IMAGE_WITH_PE
boolean bfd_boolean
bfd_arm_allocate_interworking_sections (info) bfd_arm_allocate_interworking_sections (info)
struct bfd_link_info * info; struct bfd_link_info * info;
{ {
@ -1869,7 +1869,7 @@ bfd_arm_allocate_interworking_sections (info)
s->contents = foo; s->contents = foo;
} }
return true; return TRUE;
} }
static void static void
@ -1904,7 +1904,7 @@ record_arm_to_thumb_glue (info, h)
sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name);
myh = coff_link_hash_lookup myh = coff_link_hash_lookup
(coff_hash_table (info), tmp_name, false, false, true); (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE);
if (myh != NULL) if (myh != NULL)
{ {
@ -1919,7 +1919,7 @@ record_arm_to_thumb_glue (info, h)
bh = NULL; bh = NULL;
val = globals->arm_glue_size + 1; val = globals->arm_glue_size + 1;
bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
BSF_GLOBAL, s, val, NULL, true, false, &bh); BSF_GLOBAL, s, val, NULL, TRUE, FALSE, &bh);
free (tmp_name); free (tmp_name);
@ -1961,7 +1961,7 @@ record_thumb_to_arm_glue (info, h)
sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name);
myh = coff_link_hash_lookup myh = coff_link_hash_lookup
(coff_hash_table (info), tmp_name, false, false, true); (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE);
if (myh != NULL) if (myh != NULL)
{ {
@ -1972,7 +1972,7 @@ record_thumb_to_arm_glue (info, h)
bh = NULL; bh = NULL;
val = globals->thumb_glue_size + 1; val = globals->thumb_glue_size + 1;
bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
BSF_GLOBAL, s, val, NULL, true, false, &bh); BSF_GLOBAL, s, val, NULL, TRUE, FALSE, &bh);
/* If we mark it 'thumb', the disassembler will do a better job. */ /* If we mark it 'thumb', the disassembler will do a better job. */
myh = (struct coff_link_hash_entry *) bh; myh = (struct coff_link_hash_entry *) bh;
@ -1995,7 +1995,7 @@ record_thumb_to_arm_glue (info, h)
bh = NULL; bh = NULL;
val = globals->thumb_glue_size + (globals->support_old_code ? 8 : 4); val = globals->thumb_glue_size + (globals->support_old_code ? 8 : 4);
bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
BSF_LOCAL, s, val, NULL, true, false, &bh); BSF_LOCAL, s, val, NULL, TRUE, FALSE, &bh);
free (tmp_name); free (tmp_name);
@ -2009,7 +2009,7 @@ record_thumb_to_arm_glue (info, h)
This function is called from the linker scripts in ld/emultempl/ This function is called from the linker scripts in ld/emultempl/
{armcoff/pe}.em */ {armcoff/pe}.em */
boolean bfd_boolean
bfd_arm_get_bfd_for_interworking (abfd, info) bfd_arm_get_bfd_for_interworking (abfd, info)
bfd * abfd; bfd * abfd;
struct bfd_link_info * info; struct bfd_link_info * info;
@ -2021,14 +2021,14 @@ bfd_arm_get_bfd_for_interworking (abfd, info)
/* If we are only performing a partial link do not bother /* If we are only performing a partial link do not bother
getting a bfd to hold the glue. */ getting a bfd to hold the glue. */
if (info->relocateable) if (info->relocateable)
return true; return TRUE;
globals = coff_arm_hash_table (info); globals = coff_arm_hash_table (info);
BFD_ASSERT (globals != NULL); BFD_ASSERT (globals != NULL);
if (globals->bfd_of_glue_owner != NULL) if (globals->bfd_of_glue_owner != NULL)
return true; return TRUE;
sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME); sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME);
@ -2041,7 +2041,7 @@ bfd_arm_get_bfd_for_interworking (abfd, info)
if (sec == NULL if (sec == NULL
|| ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_flags (abfd, sec, flags)
|| ! bfd_set_section_alignment (abfd, sec, 2)) || ! bfd_set_section_alignment (abfd, sec, 2))
return false; return FALSE;
} }
sec = bfd_get_section_by_name (abfd, THUMB2ARM_GLUE_SECTION_NAME); sec = bfd_get_section_by_name (abfd, THUMB2ARM_GLUE_SECTION_NAME);
@ -2055,16 +2055,16 @@ bfd_arm_get_bfd_for_interworking (abfd, info)
if (sec == NULL if (sec == NULL
|| ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_flags (abfd, sec, flags)
|| ! bfd_set_section_alignment (abfd, sec, 2)) || ! bfd_set_section_alignment (abfd, sec, 2))
return false; return FALSE;
} }
/* Save the bfd for later use. */ /* Save the bfd for later use. */
globals->bfd_of_glue_owner = abfd; globals->bfd_of_glue_owner = abfd;
return true; return TRUE;
} }
boolean bfd_boolean
bfd_arm_process_before_allocation (abfd, info, support_old_code) bfd_arm_process_before_allocation (abfd, info, support_old_code)
bfd * abfd; bfd * abfd;
struct bfd_link_info * info; struct bfd_link_info * info;
@ -2076,7 +2076,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code)
/* If we are only performing a partial link do not bother /* If we are only performing a partial link do not bother
to construct any glue. */ to construct any glue. */
if (info->relocateable) if (info->relocateable)
return true; return TRUE;
/* Here we have a bfd that is to be included on the link. We have a hook /* Here we have a bfd that is to be included on the link. We have a hook
to do reloc rummaging, before section sizes are nailed down. */ to do reloc rummaging, before section sizes are nailed down. */
@ -2094,7 +2094,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code)
sec = abfd->sections; sec = abfd->sections;
if (sec == NULL) if (sec == NULL)
return true; return TRUE;
for (; sec != NULL; sec = sec->next) for (; sec != NULL; sec = sec->next)
{ {
@ -2178,7 +2178,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code)
} }
} }
return true; return TRUE;
} }
#endif /* ! defined (COFF_IMAGE_WITH_PE) */ #endif /* ! defined (COFF_IMAGE_WITH_PE) */
@ -2198,14 +2198,14 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code)
/* When doing a relocateable link, we want to convert ARM26 relocs /* When doing a relocateable link, we want to convert ARM26 relocs
into ARM26D relocs. */ into ARM26D relocs. */
static boolean static bfd_boolean
coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
bfd *obfd ATTRIBUTE_UNUSED; bfd *obfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED;
bfd *ibfd; bfd *ibfd;
asection *sec; asection *sec;
struct internal_reloc *irel; struct internal_reloc *irel;
boolean *adjustedp; bfd_boolean *adjustedp;
{ {
if (irel->r_type == 3) if (irel->r_type == 3)
{ {
@ -2218,8 +2218,8 @@ coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
&& h->root.u.def.section->output_section == sec->output_section) && h->root.u.def.section->output_section == sec->output_section)
irel->r_type = 7; irel->r_type = 7;
} }
*adjustedp = false; *adjustedp = FALSE;
return true; return TRUE;
} }
/* Called when merging the private data areas of two BFDs. /* Called when merging the private data areas of two BFDs.
@ -2227,7 +2227,7 @@ coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
attempting to merge binaries compiled for different ARM attempting to merge binaries compiled for different ARM
targets, eg different CPUs or differents APCS's. */ targets, eg different CPUs or differents APCS's. */
static boolean static bfd_boolean
coff_arm_merge_private_bfd_data (ibfd, obfd) coff_arm_merge_private_bfd_data (ibfd, obfd)
bfd * ibfd; bfd * ibfd;
bfd * obfd; bfd * obfd;
@ -2235,14 +2235,14 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
BFD_ASSERT (ibfd != NULL && obfd != NULL); BFD_ASSERT (ibfd != NULL && obfd != NULL);
if (ibfd == obfd) if (ibfd == obfd)
return true; return TRUE;
/* If the two formats are different we cannot merge anything. /* If the two formats are different we cannot merge anything.
This is not an error, since it is permissable to change the This is not an error, since it is permissable to change the
input and output formats. */ input and output formats. */
if ( ibfd->xvec->flavour != bfd_target_coff_flavour if ( ibfd->xvec->flavour != bfd_target_coff_flavour
|| obfd->xvec->flavour != bfd_target_coff_flavour) || obfd->xvec->flavour != bfd_target_coff_flavour)
return true; return TRUE;
/* Verify that the APCS is the same for the two BFDs */ /* Verify that the APCS is the same for the two BFDs */
if (APCS_SET (ibfd)) if (APCS_SET (ibfd))
@ -2260,7 +2260,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
); );
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return false; return FALSE;
} }
if (APCS_FLOAT_FLAG (obfd) != APCS_FLOAT_FLAG (ibfd)) if (APCS_FLOAT_FLAG (obfd) != APCS_FLOAT_FLAG (ibfd))
@ -2278,7 +2278,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
bfd_get_filename (obfd)); bfd_get_filename (obfd));
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return false; return FALSE;
} }
if (PIC_FLAG (obfd) != PIC_FLAG (ibfd)) if (PIC_FLAG (obfd) != PIC_FLAG (ibfd))
@ -2295,7 +2295,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
bfd_get_filename (obfd)); bfd_get_filename (obfd));
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return false; return FALSE;
} }
} }
else else
@ -2334,12 +2334,12 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
} }
} }
return true; return TRUE;
} }
/* Display the flags field. */ /* Display the flags field. */
static boolean static bfd_boolean
coff_arm_print_private_bfd_data (abfd, ptr) coff_arm_print_private_bfd_data (abfd, ptr)
bfd * abfd; bfd * abfd;
PTR ptr; PTR ptr;
@ -2376,7 +2376,7 @@ coff_arm_print_private_bfd_data (abfd, ptr)
fputc ('\n', file); fputc ('\n', file);
return true; return TRUE;
} }
/* Copies the given flags into the coff_tdata.flags field. /* Copies the given flags into the coff_tdata.flags field.
@ -2386,7 +2386,7 @@ coff_arm_print_private_bfd_data (abfd, ptr)
Note: Although this function is static, it is explicitly Note: Although this function is static, it is explicitly
called from both coffcode.h and peicode.h. */ called from both coffcode.h and peicode.h. */
static boolean static bfd_boolean
_bfd_coff_arm_set_private_flags (abfd, flags) _bfd_coff_arm_set_private_flags (abfd, flags)
bfd * abfd; bfd * abfd;
flagword flags; flagword flags;
@ -2404,7 +2404,7 @@ _bfd_coff_arm_set_private_flags (abfd, flags)
|| (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT)) || (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT))
|| (PIC_FLAG (abfd) != (flags & F_PIC)) || (PIC_FLAG (abfd) != (flags & F_PIC))
)) ))
return false; return FALSE;
flag |= (flags & (F_APCS_FLOAT | F_PIC)); flag |= (flags & (F_APCS_FLOAT | F_PIC));
@ -2431,13 +2431,13 @@ _bfd_coff_arm_set_private_flags (abfd, flags)
SET_INTERWORK_FLAG (abfd, flag); SET_INTERWORK_FLAG (abfd, flag);
return true; return TRUE;
} }
/* Copy the important parts of the target specific data /* Copy the important parts of the target specific data
from one instance of a BFD to another. */ from one instance of a BFD to another. */
static boolean static bfd_boolean
coff_arm_copy_private_bfd_data (src, dest) coff_arm_copy_private_bfd_data (src, dest)
bfd * src; bfd * src;
bfd * dest; bfd * dest;
@ -2445,12 +2445,12 @@ coff_arm_copy_private_bfd_data (src, dest)
BFD_ASSERT (src != NULL && dest != NULL); BFD_ASSERT (src != NULL && dest != NULL);
if (src == dest) if (src == dest)
return true; return TRUE;
/* If the destination is not in the same format as the source, do not do /* If the destination is not in the same format as the source, do not do
the copy. */ the copy. */
if (src->xvec != dest->xvec) if (src->xvec != dest->xvec)
return true; return TRUE;
/* copy the flags field */ /* copy the flags field */
if (APCS_SET (src)) if (APCS_SET (src))
@ -2459,13 +2459,13 @@ coff_arm_copy_private_bfd_data (src, dest)
{ {
/* If the src and dest have different APCS flag bits set, fail. */ /* If the src and dest have different APCS flag bits set, fail. */
if (APCS_26_FLAG (dest) != APCS_26_FLAG (src)) if (APCS_26_FLAG (dest) != APCS_26_FLAG (src))
return false; return FALSE;
if (APCS_FLOAT_FLAG (dest) != APCS_FLOAT_FLAG (src)) if (APCS_FLOAT_FLAG (dest) != APCS_FLOAT_FLAG (src))
return false; return FALSE;
if (PIC_FLAG (dest) != PIC_FLAG (src)) if (PIC_FLAG (dest) != PIC_FLAG (src))
return false; return FALSE;
} }
else else
SET_APCS_FLAGS (dest, APCS_26_FLAG (src) | APCS_FLOAT_FLAG (src) SET_APCS_FLAGS (dest, APCS_26_FLAG (src) | APCS_FLOAT_FLAG (src)
@ -2498,7 +2498,7 @@ Warning: Clearing the interworking flag of %s because non-interworking code in %
} }
} }
return true; return TRUE;
} }
/* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX /* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX
@ -2513,7 +2513,7 @@ Warning: Clearing the interworking flag of %s because non-interworking code in %
non-local. non-local.
b) Allow other prefixes than ".", e.g. an empty prefix would cause all b) Allow other prefixes than ".", e.g. an empty prefix would cause all
labels of the form Lxxx to be stripped. */ labels of the form Lxxx to be stripped. */
static boolean static bfd_boolean
coff_arm_is_local_label_name (abfd, name) coff_arm_is_local_label_name (abfd, name)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
const char * name; const char * name;
@ -2522,7 +2522,7 @@ coff_arm_is_local_label_name (abfd, name)
if (USER_LABEL_PREFIX[0] != 0) if (USER_LABEL_PREFIX[0] != 0)
{ {
if (strncmp (name, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX)) == 0) if (strncmp (name, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX)) == 0)
return false; return FALSE;
} }
#endif #endif
@ -2535,7 +2535,7 @@ coff_arm_is_local_label_name (abfd, name)
size_t len = strlen (LOCAL_LABEL_PREFIX); size_t len = strlen (LOCAL_LABEL_PREFIX);
if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0) if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0)
return false; return FALSE;
/* Perform the checks below for the rest of the name. */ /* Perform the checks below for the rest of the name. */
name += len; name += len;
@ -2553,7 +2553,7 @@ coff_arm_is_local_label_name (abfd, name)
krk@cygnus.com */ krk@cygnus.com */
static boolean static bfd_boolean
coff_arm_link_output_has_begun (sub, info) coff_arm_link_output_has_begun (sub, info)
bfd * sub; bfd * sub;
struct coff_final_link_info * info; struct coff_final_link_info * info;
@ -2562,7 +2562,7 @@ coff_arm_link_output_has_begun (sub, info)
|| sub == coff_arm_hash_table (info->info)->bfd_of_glue_owner); || sub == coff_arm_hash_table (info->info)->bfd_of_glue_owner);
} }
static boolean static bfd_boolean
coff_arm_final_link_postscript (abfd, pfinfo) coff_arm_final_link_postscript (abfd, pfinfo)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
struct coff_final_link_info * pfinfo; struct coff_final_link_info * pfinfo;
@ -2576,12 +2576,12 @@ coff_arm_final_link_postscript (abfd, pfinfo)
if (globals->bfd_of_glue_owner != NULL) if (globals->bfd_of_glue_owner != NULL)
{ {
if (! _bfd_coff_link_input_bfd (pfinfo, globals->bfd_of_glue_owner)) if (! _bfd_coff_link_input_bfd (pfinfo, globals->bfd_of_glue_owner))
return false; return FALSE;
globals->bfd_of_glue_owner->output_has_begun = true; globals->bfd_of_glue_owner->output_has_begun = TRUE;
} }
return true; return TRUE;
} }
#include "coffcode.h" #include "coffcode.h"

View file

@ -1,5 +1,5 @@
/* BFD back-end for Apple M68K COFF A/UX 3.x files. /* BFD back-end for Apple M68K COFF A/UX 3.x files.
Copyright 1996, 1997, 2000 Free Software Foundation, Inc. Copyright 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
Written by Richard Henderson <rth@tamu.edu>. Written by Richard Henderson <rth@tamu.edu>.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -40,9 +40,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h" #include "bfd.h"
#include "sysdep.h" #include "sysdep.h"
static boolean coff_m68k_aux_link_add_one_symbol static bfd_boolean coff_m68k_aux_link_add_one_symbol
PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword,
asection *, bfd_vma, const char *, boolean, boolean, asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
struct bfd_link_hash_entry **)); struct bfd_link_hash_entry **));
#define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol #define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol
@ -56,7 +56,7 @@ static boolean coff_m68k_aux_link_add_one_symbol
shared libraries work here, but can work if you are careful with shared libraries work here, but can work if you are careful with
what you include in the shared object. */ what you include in the shared object. */
static boolean static bfd_boolean
coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value,
string, copy, collect, hashp) string, copy, collect, hashp)
struct bfd_link_info *info; struct bfd_link_info *info;
@ -66,8 +66,8 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value,
asection *section; asection *section;
bfd_vma value; bfd_vma value;
const char *string; const char *string;
boolean copy; bfd_boolean copy;
boolean collect; bfd_boolean collect;
struct bfd_link_hash_entry **hashp; struct bfd_link_hash_entry **hashp;
{ {
struct bfd_link_hash_entry *h; struct bfd_link_hash_entry *h;
@ -86,21 +86,21 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value,
} }
else else
{ {
h = bfd_link_hash_lookup (info->hash, name, true, copy, false); h = bfd_link_hash_lookup (info->hash, name, TRUE, copy, FALSE);
if (h == NULL) if (h == NULL)
{ {
if (hashp != NULL) if (hashp != NULL)
*hashp = NULL; *hashp = NULL;
return false; return FALSE;
} }
} }
if (info->notice_hash != (struct bfd_hash_table *) NULL if (info->notice_hash != (struct bfd_hash_table *) NULL
&& (bfd_hash_lookup (info->notice_hash, name, false, false) && (bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE)
!= (struct bfd_hash_entry *) NULL)) != (struct bfd_hash_entry *) NULL))
{ {
if (! (*info->callbacks->notice) (info, name, abfd, section, value)) if (! (*info->callbacks->notice) (info, name, abfd, section, value))
return false; return FALSE;
} }
if (hashp != (struct bfd_link_hash_entry **) NULL) if (hashp != (struct bfd_link_hash_entry **) NULL)
@ -121,10 +121,10 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value,
{ {
h->u.def.section = section; h->u.def.section = section;
h->u.def.value = value; h->u.def.value = value;
return true; return TRUE;
} }
else if (bfd_is_abs_section (section) && !bfd_is_abs_section (msec)) else if (bfd_is_abs_section (section) && !bfd_is_abs_section (msec))
return true; return TRUE;
} }
} }

View file

@ -62,21 +62,31 @@ static struct bfd_hash_entry *
funcvec_hash_newfunc funcvec_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
static boolean static bfd_boolean
funcvec_hash_table_init funcvec_hash_table_init
PARAMS ((struct funcvec_hash_table *, bfd *, PARAMS ((struct funcvec_hash_table *, bfd *,
struct bfd_hash_entry *(*) PARAMS ((struct bfd_hash_entry *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *, struct bfd_hash_table *,
const char *)))); const char *)));
static bfd_reloc_status_type special PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type special
static int select_reloc PARAMS ((reloc_howto_type *)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); static int select_reloc
static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); PARAMS ((reloc_howto_type *));
static boolean h8300_symbol_address_p PARAMS ((bfd *, asection *, bfd_vma)); static void rtype2howto
static int h8300_reloc16_estimate PARAMS ((bfd *, asection *, arelent *, unsigned int, struct bfd_link_info *)); PARAMS ((arelent *, struct internal_reloc *));
static void h8300_reloc16_extra_cases PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, bfd_byte *, unsigned int *, unsigned int *)); static void reloc_processing
static boolean h8300_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
static bfd_boolean h8300_symbol_address_p
PARAMS ((bfd *, asection *, bfd_vma));
static int h8300_reloc16_estimate
PARAMS ((bfd *, asection *, arelent *, unsigned int,
struct bfd_link_info *));
static void h8300_reloc16_extra_cases
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
bfd_byte *, unsigned int *, unsigned int *));
static bfd_boolean h8300_bfd_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
/* To lookup a value in the function vector hash table. */ /* To lookup a value in the function vector hash table. */
#define funcvec_hash_lookup(table, string, create, copy) \ #define funcvec_hash_lookup(table, string, create, copy) \
@ -159,13 +169,13 @@ funcvec_hash_newfunc (entry, gen_table, string)
/* Initialize the function vector hash table. */ /* Initialize the function vector hash table. */
static boolean static bfd_boolean
funcvec_hash_table_init (table, abfd, newfunc) funcvec_hash_table_init (table, abfd, newfunc)
struct funcvec_hash_table *table; struct funcvec_hash_table *table;
bfd *abfd; bfd *abfd;
struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, struct bfd_hash_entry *(*newfunc)
struct bfd_hash_table *, PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
const char *)); const char *));
{ {
/* Initialize our local fields, then call the generic initialization /* Initialize our local fields, then call the generic initialization
routine. */ routine. */
@ -232,37 +242,37 @@ special (abfd, reloc_entry, symbol, data, input_section, output_bfd,
} }
static reloc_howto_type howto_table[] = { static reloc_howto_type howto_table[] = {
HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, special, "8", false, 0x000000ff, 0x000000ff, false), HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, special, "8", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, special, "16", false, 0x0000ffff, 0x0000ffff, false), HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, special, "16", FALSE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, special, "32", false, 0xffffffff, 0xffffffff, false), HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, special, "32", FALSE, 0xffffffff, 0xffffffff, FALSE),
HOWTO (R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, special, "DISP8", false, 0x000000ff, 0x000000ff, true), HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, special, "DISP8", FALSE, 0x000000ff, 0x000000ff, TRUE),
HOWTO (R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, special, "DISP16", false, 0x0000ffff, 0x0000ffff, true), HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, special, "DISP16", FALSE, 0x0000ffff, 0x0000ffff, TRUE),
HOWTO (R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, special, "DISP32", false, 0xffffffff, 0xffffffff, true), HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, special, "DISP32", FALSE, 0xffffffff, 0xffffffff, TRUE),
HOWTO (R_MOV16B1, 0, 1, 16, false, 0, complain_overflow_bitfield, special, "relaxable mov.b:16", false, 0x0000ffff, 0x0000ffff, false), HOWTO (R_MOV16B1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, special, "relaxable mov.b:16", FALSE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_MOV16B2, 0, 1, 8, false, 0, complain_overflow_bitfield, special, "relaxed mov.b:16", false, 0x000000ff, 0x000000ff, false), HOWTO (R_MOV16B2, 0, 1, 8, FALSE, 0, complain_overflow_bitfield, special, "relaxed mov.b:16", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_JMP1, 0, 1, 16, false, 0, complain_overflow_bitfield, special, "16/pcrel", false, 0x0000ffff, 0x0000ffff, false), HOWTO (R_JMP1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, special, "16/pcrel", FALSE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_JMP2, 0, 0, 8, false, 0, complain_overflow_bitfield, special, "pcrecl/16", false, 0x000000ff, 0x000000ff, false), HOWTO (R_JMP2, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, special, "pcrecl/16", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_JMPL1, 0, 2, 32, false, 0, complain_overflow_bitfield, special, "24/pcrell", false, 0x00ffffff, 0x00ffffff, false), HOWTO (R_JMPL1, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, special, "24/pcrell", FALSE, 0x00ffffff, 0x00ffffff, FALSE),
HOWTO (R_JMPL2, 0, 0, 8, false, 0, complain_overflow_bitfield, special, "pc8/24", false, 0x000000ff, 0x000000ff, false), HOWTO (R_JMPL2, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, special, "pc8/24", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_MOV24B1, 0, 1, 32, false, 0, complain_overflow_bitfield, special, "relaxable mov.b:24", false, 0xffffffff, 0xffffffff, false), HOWTO (R_MOV24B1, 0, 1, 32, FALSE, 0, complain_overflow_bitfield, special, "relaxable mov.b:24", FALSE, 0xffffffff, 0xffffffff, FALSE),
HOWTO (R_MOV24B2, 0, 1, 8, false, 0, complain_overflow_bitfield, special, "relaxed mov.b:24", false, 0x0000ffff, 0x0000ffff, false), HOWTO (R_MOV24B2, 0, 1, 8, FALSE, 0, complain_overflow_bitfield, special, "relaxed mov.b:24", FALSE, 0x0000ffff, 0x0000ffff, FALSE),
/* An indirect reference to a function. This causes the function's address /* An indirect reference to a function. This causes the function's address
to be added to the function vector in lo-mem and puts the address of to be added to the function vector in lo-mem and puts the address of
the function vector's entry in the jsr instruction. */ the function vector's entry in the jsr instruction. */
HOWTO (R_MEM_INDIRECT, 0, 0, 8, false, 0, complain_overflow_bitfield, special, "8/indirect", false, 0x000000ff, 0x000000ff, false), HOWTO (R_MEM_INDIRECT, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, special, "8/indirect", FALSE, 0x000000ff, 0x000000ff, FALSE),
/* Internal reloc for relaxing. This is created when a 16bit pc-relative /* Internal reloc for relaxing. This is created when a 16bit pc-relative
branch is turned into an 8bit pc-relative branch. */ branch is turned into an 8bit pc-relative branch. */
HOWTO (R_PCRWORD_B, 0, 0, 8, true, 0, complain_overflow_bitfield, special, "relaxed bCC:16", false, 0x000000ff, 0x000000ff, false), HOWTO (R_PCRWORD_B, 0, 0, 8, TRUE, 0, complain_overflow_bitfield, special, "relaxed bCC:16", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_MOVL1, 0, 2, 32, false, 0, complain_overflow_bitfield,special, "32/24 relaxable move", false, 0xffffffff, 0xffffffff, false), HOWTO (R_MOVL1, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,special, "32/24 relaxable move", FALSE, 0xffffffff, 0xffffffff, FALSE),
HOWTO (R_MOVL2, 0, 1, 16, false, 0, complain_overflow_bitfield, special, "32/24 relaxed move", false, 0x0000ffff, 0x0000ffff, false), HOWTO (R_MOVL2, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, special, "32/24 relaxed move", FALSE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_BCC_INV, 0, 0, 8, true, 0, complain_overflow_signed, special, "DISP8 inverted", false, 0x000000ff, 0x000000ff, true), HOWTO (R_BCC_INV, 0, 0, 8, TRUE, 0, complain_overflow_signed, special, "DISP8 inverted", FALSE, 0x000000ff, 0x000000ff, TRUE),
HOWTO (R_JMP_DEL, 0, 0, 8, true, 0, complain_overflow_signed, special, "Deleted jump", false, 0x000000ff, 0x000000ff, true), HOWTO (R_JMP_DEL, 0, 0, 8, TRUE, 0, complain_overflow_signed, special, "Deleted jump", FALSE, 0x000000ff, 0x000000ff, TRUE),
}; };
/* Turn a howto into a reloc number. */ /* Turn a howto into a reloc number. */
@ -401,7 +411,7 @@ reloc_processing (relent, reloc, symbols, abfd, section)
#endif #endif
} }
static boolean static bfd_boolean
h8300_symbol_address_p (abfd, input_section, address) h8300_symbol_address_p (abfd, input_section, address)
bfd *abfd; bfd *abfd;
asection *input_section; asection *input_section;
@ -421,10 +431,10 @@ h8300_symbol_address_p (abfd, input_section, address)
&& (input_section->output_section->vma && (input_section->output_section->vma
+ input_section->output_offset + input_section->output_offset
+ p->value) == address) + p->value) == address)
return true; return TRUE;
s++; s++;
} }
return false; return FALSE;
} }
/* If RELOC represents a relaxable instruction/reloc, change it into /* If RELOC represents a relaxable instruction/reloc, change it into
@ -505,7 +515,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
Only perform this optimisation for jumps (code 0x5a) not Only perform this optimisation for jumps (code 0x5a) not
subroutine calls, as otherwise it could transform: subroutine calls, as otherwise it could transform:
mov.w r0,r0 mov.w r0,r0
beq .L1 beq .L1
jsr @_bar jsr @_bar
@ -516,7 +526,7 @@ h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info)
bne _bar bne _bar
rts rts
_bar: rts _bar: rts
which changes the call (jsr) into a branch (bne). */ which changes the call (jsr) into a branch (bne). */
if (code == 0x5a if (code == 0x5a
&& gap <= 126 && gap <= 126
@ -1131,7 +1141,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
} }
ftab = h8300_coff_hash_table (link_info)->funcvec_hash_table; ftab = h8300_coff_hash_table (link_info)->funcvec_hash_table;
h = funcvec_hash_lookup (ftab, name, false, false); h = funcvec_hash_lookup (ftab, name, FALSE, FALSE);
/* This shouldn't ever happen. If it does that means we've got /* This shouldn't ever happen. If it does that means we've got
data corruption of some kind. Aborting seems like a reasonable data corruption of some kind. Aborting seems like a reasonable
@ -1196,7 +1206,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr,
from this BFD to the bfd linker hash table. It may add a few from this BFD to the bfd linker hash table. It may add a few
selected static symbols to the bfd linker hash table. */ selected static symbols to the bfd linker hash table. */
static boolean static bfd_boolean
h8300_bfd_link_add_symbols (abfd, info) h8300_bfd_link_add_symbols (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -1222,21 +1232,21 @@ h8300_bfd_link_add_symbols (abfd, info)
|| ! bfd_set_section_flags (abfd, || ! bfd_set_section_flags (abfd,
h8300_coff_hash_table(info)->vectors_sec, h8300_coff_hash_table(info)->vectors_sec,
flags)) flags))
return false; return FALSE;
/* Also create the vector hash table. */ /* Also create the vector hash table. */
amt = sizeof (struct funcvec_hash_table); amt = sizeof (struct funcvec_hash_table);
funcvec_hash_table = (struct funcvec_hash_table *) bfd_alloc (abfd, amt); funcvec_hash_table = (struct funcvec_hash_table *) bfd_alloc (abfd, amt);
if (!funcvec_hash_table) if (!funcvec_hash_table)
return false; return FALSE;
/* And initialize the funcvec hash table. */ /* And initialize the funcvec hash table. */
if (!funcvec_hash_table_init (funcvec_hash_table, abfd, if (!funcvec_hash_table_init (funcvec_hash_table, abfd,
funcvec_hash_newfunc)) funcvec_hash_newfunc))
{ {
bfd_release (abfd, funcvec_hash_table); bfd_release (abfd, funcvec_hash_table);
return false; return FALSE;
} }
/* Store away a pointer to the funcvec hash table. */ /* Store away a pointer to the funcvec hash table. */
@ -1264,7 +1274,7 @@ h8300_bfd_link_add_symbols (abfd, info)
relocs = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); relocs = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
if (!relocs) if (!relocs)
return false; return FALSE;
/* The symbols should have been read in by _bfd_generic link_add_symbols /* The symbols should have been read in by _bfd_generic link_add_symbols
call abovec, so we can cheat and use the pointer to them that was call abovec, so we can cheat and use the pointer to them that was
@ -1313,17 +1323,17 @@ h8300_bfd_link_add_symbols (abfd, info)
/* Look this symbol up in the function vector hash table. */ /* Look this symbol up in the function vector hash table. */
ftab = h8300_coff_hash_table (info)->funcvec_hash_table; ftab = h8300_coff_hash_table (info)->funcvec_hash_table;
h = funcvec_hash_lookup (ftab, name, false, false); h = funcvec_hash_lookup (ftab, name, FALSE, FALSE);
/* If this symbol isn't already in the hash table, add /* If this symbol isn't already in the hash table, add
it and bump up the size of the hash table. */ it and bump up the size of the hash table. */
if (h == NULL) if (h == NULL)
{ {
h = funcvec_hash_lookup (ftab, name, true, true); h = funcvec_hash_lookup (ftab, name, TRUE, TRUE);
if (h == NULL) if (h == NULL)
{ {
free (relocs); free (relocs);
return false; return FALSE;
} }
/* Bump the size of the vectors section. Each vector /* Bump the size of the vectors section. Each vector
@ -1354,7 +1364,7 @@ h8300_bfd_link_add_symbols (abfd, info)
sec->contents = bfd_malloc (sec->_raw_size); sec->contents = bfd_malloc (sec->_raw_size);
} }
return true; return TRUE;
} }
#define coff_reloc16_extra_cases h8300_reloc16_extra_cases #define coff_reloc16_extra_cases h8300_reloc16_extra_cases

View file

@ -1,5 +1,5 @@
/* BFD back-end for Hitachi H8/500 COFF binaries. /* BFD back-end for Hitachi H8/500 COFF binaries.
Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001 Copyright 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Cygnus Support. Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>. Written by Steve Chamberlain, <sac@cygnus.com>.
@ -36,38 +36,38 @@ static void extra_case PARAMS ((bfd *, struct bfd_link_info *, struct bfd_
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
static reloc_howto_type r_imm8 = static reloc_howto_type r_imm8 =
HOWTO (R_H8500_IMM8, 0, 1, 8, false, 0, HOWTO (R_H8500_IMM8, 0, 1, 8, FALSE, 0,
complain_overflow_bitfield, 0, "r_imm8", true, 0x000000ff, 0x000000ff, false); complain_overflow_bitfield, 0, "r_imm8", TRUE, 0x000000ff, 0x000000ff, FALSE);
static reloc_howto_type r_imm16 = static reloc_howto_type r_imm16 =
HOWTO (R_H8500_IMM16, 0, 1, 16, false, 0, HOWTO (R_H8500_IMM16, 0, 1, 16, FALSE, 0,
complain_overflow_bitfield, 0, "r_imm16", true, 0x0000ffff, 0x0000ffff, false); complain_overflow_bitfield, 0, "r_imm16", TRUE, 0x0000ffff, 0x0000ffff, FALSE);
static reloc_howto_type r_imm24 = static reloc_howto_type r_imm24 =
HOWTO (R_H8500_IMM24, 0, 1, 24, false, 0, HOWTO (R_H8500_IMM24, 0, 1, 24, FALSE, 0,
complain_overflow_bitfield, 0, "r_imm24", true, 0x00ffffff, 0x00ffffff, false); complain_overflow_bitfield, 0, "r_imm24", TRUE, 0x00ffffff, 0x00ffffff, FALSE);
static reloc_howto_type r_imm32 = static reloc_howto_type r_imm32 =
HOWTO (R_H8500_IMM32, 0, 1, 32, false, 0, HOWTO (R_H8500_IMM32, 0, 1, 32, FALSE, 0,
complain_overflow_bitfield, 0, "r_imm32", true, 0xffffffff, 0xffffffff, false); complain_overflow_bitfield, 0, "r_imm32", TRUE, 0xffffffff, 0xffffffff, FALSE);
static reloc_howto_type r_high8 = static reloc_howto_type r_high8 =
HOWTO (R_H8500_HIGH8, 0, 1, 8, false, 0, HOWTO (R_H8500_HIGH8, 0, 1, 8, FALSE, 0,
complain_overflow_dont, 0, "r_high8", true, 0x000000ff, 0x000000ff, false); complain_overflow_dont, 0, "r_high8", TRUE, 0x000000ff, 0x000000ff, FALSE);
static reloc_howto_type r_low16 = static reloc_howto_type r_low16 =
HOWTO (R_H8500_LOW16, 0, 1, 16, false, 0, HOWTO (R_H8500_LOW16, 0, 1, 16, FALSE, 0,
complain_overflow_dont, 0, "r_low16", true, 0x0000ffff, 0x0000ffff, false); complain_overflow_dont, 0, "r_low16", TRUE, 0x0000ffff, 0x0000ffff, FALSE);
static reloc_howto_type r_pcrel8 = static reloc_howto_type r_pcrel8 =
HOWTO (R_H8500_PCREL8, 0, 1, 8, true, 0, complain_overflow_signed, 0, "r_pcrel8", true, 0, 0, true); HOWTO (R_H8500_PCREL8, 0, 1, 8, TRUE, 0, complain_overflow_signed, 0, "r_pcrel8", TRUE, 0, 0, TRUE);
static reloc_howto_type r_pcrel16 = static reloc_howto_type r_pcrel16 =
HOWTO (R_H8500_PCREL16, 0, 1, 16, true, 0, complain_overflow_signed, 0, "r_pcrel16", true, 0, 0, true); HOWTO (R_H8500_PCREL16, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "r_pcrel16", TRUE, 0, 0, TRUE);
static reloc_howto_type r_high16 = static reloc_howto_type r_high16 =
HOWTO (R_H8500_HIGH16, 0, 1, 8, false, 0, HOWTO (R_H8500_HIGH16, 0, 1, 8, FALSE, 0,
complain_overflow_dont, 0, "r_high16", true, 0x000ffff, 0x0000ffff, false); complain_overflow_dont, 0, "r_high16", TRUE, 0x000ffff, 0x0000ffff, FALSE);
/* Turn a howto into a reloc number. */ /* Turn a howto into a reloc number. */

View file

@ -179,12 +179,12 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
} }
#ifdef COFF_WITH_PE #ifdef COFF_WITH_PE
/* Return true if this relocation should appear in the output .reloc /* Return TRUE if this relocation should appear in the output .reloc
section. */ section. */
static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
static boolean in_reloc_p (abfd, howto) static bfd_boolean in_reloc_p (abfd, howto)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
reloc_howto_type *howto; reloc_howto_type *howto;
{ {
@ -193,7 +193,7 @@ static boolean in_reloc_p (abfd, howto)
#endif /* COFF_WITH_PE */ #endif /* COFF_WITH_PE */
#ifndef PCRELOFFSET #ifndef PCRELOFFSET
#define PCRELOFFSET false #define PCRELOFFSET FALSE
#endif #endif
static reloc_howto_type howto_table[] = static reloc_howto_type howto_table[] =
@ -208,29 +208,29 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"dir32", /* name */ "dir32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* PE IMAGE_REL_I386_DIR32NB relocation (7). */ /* PE IMAGE_REL_I386_DIR32NB relocation (7). */
HOWTO (R_IMAGEBASE, /* type */ HOWTO (R_IMAGEBASE, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"rva32", /* name */ "rva32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
EMPTY_HOWTO (010), EMPTY_HOWTO (010),
EMPTY_HOWTO (011), EMPTY_HOWTO (011),
EMPTY_HOWTO (012), EMPTY_HOWTO (012),
@ -243,12 +243,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */ 8, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"8", /* name */ "8", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x000000ff, /* src_mask */ 0x000000ff, /* src_mask */
0x000000ff, /* dst_mask */ 0x000000ff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -257,12 +257,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"16", /* name */ "16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -271,12 +271,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"32", /* name */ "32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -285,12 +285,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */ 8, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"DISP8", /* name */ "DISP8", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x000000ff, /* src_mask */ 0x000000ff, /* src_mask */
0x000000ff, /* dst_mask */ 0x000000ff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -299,12 +299,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"DISP16", /* name */ "DISP16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -313,12 +313,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
coff_i386_reloc, /* special_function */ coff_i386_reloc, /* special_function */
"DISP32", /* name */ "DISP32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
PCRELOFFSET) /* pcrel_offset */ PCRELOFFSET) /* pcrel_offset */
@ -388,11 +388,11 @@ static reloc_howto_type howto_table[] =
and the regular routine is that we don't want to do anything for a and the regular routine is that we don't want to do anything for a
relocateable link. */ relocateable link. */
static boolean coff_pe_i386_relocate_section static bfd_boolean coff_pe_i386_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **)); struct internal_reloc *, struct internal_syment *, asection **));
static boolean static bfd_boolean
coff_pe_i386_relocate_section (output_bfd, info, input_bfd, coff_pe_i386_relocate_section (output_bfd, info, input_bfd,
input_section, contents, relocs, syms, input_section, contents, relocs, syms,
sections) sections)
@ -406,7 +406,7 @@ coff_pe_i386_relocate_section (output_bfd, info, input_bfd,
asection **sections; asection **sections;
{ {
if (info->relocateable) if (info->relocateable)
return true; return TRUE;
return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
input_section, contents, input_section, contents,
@ -539,15 +539,16 @@ coff_i386_reloc_type_lookup (abfd, code)
a leading dot for local labels, so if TARGET_UNDERSCORE is defined a leading dot for local labels, so if TARGET_UNDERSCORE is defined
we treat all symbols starting with L as local. */ we treat all symbols starting with L as local. */
static boolean coff_i386_is_local_label_name PARAMS ((bfd *, const char *)); static bfd_boolean coff_i386_is_local_label_name
PARAMS ((bfd *, const char *));
static boolean static bfd_boolean
coff_i386_is_local_label_name (abfd, name) coff_i386_is_local_label_name (abfd, name)
bfd *abfd; bfd *abfd;
const char *name; const char *name;
{ {
if (name[0] == 'L') if (name[0] == 'L')
return true; return TRUE;
return _bfd_coff_is_local_label_name (abfd, name); return _bfd_coff_is_local_label_name (abfd, name);
} }

View file

@ -1,5 +1,5 @@
/* BFD back-end for Intel 860 COFF files. /* BFD back-end for Intel 860 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c Created mostly by substituting "860" for "386" in coff-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995 Harry Dolan <dolan@ssd.intel.com>, October 1995
@ -136,7 +136,7 @@ coff_i860_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
} }
#ifndef PCRELOFFSET #ifndef PCRELOFFSET
#define PCRELOFFSET false #define PCRELOFFSET FALSE
#endif #endif
static reloc_howto_type howto_table[] = static reloc_howto_type howto_table[] =
@ -151,29 +151,29 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"dir32", /* name */ "dir32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* {7}, */ /* {7}, */
HOWTO (R_IMAGEBASE, /* type */ HOWTO (R_IMAGEBASE, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"rva32", /* name */ "rva32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
EMPTY_HOWTO (010), EMPTY_HOWTO (010),
EMPTY_HOWTO (011), EMPTY_HOWTO (011),
EMPTY_HOWTO (012), EMPTY_HOWTO (012),
@ -185,12 +185,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */ 8, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"8", /* name */ "8", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x000000ff, /* src_mask */ 0x000000ff, /* src_mask */
0x000000ff, /* dst_mask */ 0x000000ff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -198,12 +198,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"16", /* name */ "16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -211,12 +211,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"32", /* name */ "32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -224,12 +224,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */ 8, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"DISP8", /* name */ "DISP8", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x000000ff, /* src_mask */ 0x000000ff, /* src_mask */
0x000000ff, /* dst_mask */ 0x000000ff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -237,12 +237,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"DISP16", /* name */ "DISP16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
PCRELOFFSET), /* pcrel_offset */ PCRELOFFSET), /* pcrel_offset */
@ -250,12 +250,12 @@ static reloc_howto_type howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
coff_i860_reloc, /* special_function */ coff_i860_reloc, /* special_function */
"DISP32", /* name */ "DISP32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
PCRELOFFSET) /* pcrel_offset */ PCRELOFFSET) /* pcrel_offset */

View file

@ -1,6 +1,6 @@
/* BFD back-end for Intel 960 COFF files. /* BFD back-end for Intel 960 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
Free Software Foundation, Inc. 2002 Free Software Foundation, Inc.
Written by Cygnus Support. Written 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.
@ -29,21 +29,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "coff/internal.h" #include "coff/internal.h"
#include "libcoff.h" /* to allow easier abstraction-breaking */ #include "libcoff.h" /* to allow easier abstraction-breaking */
static boolean coff_i960_is_local_label_name PARAMS ((bfd *, const char *)); static bfd_boolean coff_i960_is_local_label_name
PARAMS ((bfd *, const char *));
static bfd_reloc_status_type optcall_callback static bfd_reloc_status_type optcall_callback
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type coff_i960_relocate static bfd_reloc_status_type coff_i960_relocate
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static reloc_howto_type *coff_i960_reloc_type_lookup static reloc_howto_type *coff_i960_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static boolean coff_i960_start_final_link static bfd_boolean coff_i960_start_final_link
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
static boolean coff_i960_relocate_section static bfd_boolean coff_i960_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **)); struct internal_reloc *, struct internal_syment *, asection **));
static boolean coff_i960_adjust_symndx static bfd_boolean coff_i960_adjust_symndx
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
struct internal_reloc *, boolean *)); struct internal_reloc *, bfd_boolean *));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3) #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
#define COFF_ALIGN_IN_SECTION_HEADER 1 #define COFF_ALIGN_IN_SECTION_HEADER 1
@ -59,7 +60,7 @@ static boolean coff_i960_adjust_symndx
/* This set of local label names is taken from gas. */ /* This set of local label names is taken from gas. */
static boolean static bfd_boolean
coff_i960_is_local_label_name (abfd, name) coff_i960_is_local_label_name (abfd, name)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
const char *name; const char *name;
@ -266,15 +267,15 @@ coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section,
} }
static reloc_howto_type howto_rellong = static reloc_howto_type howto_rellong =
HOWTO ((unsigned int) R_RELLONG, 0, 2, 32,false, 0, HOWTO ((unsigned int) R_RELLONG, 0, 2, 32,FALSE, 0,
complain_overflow_bitfield, coff_i960_relocate,"rellong", true, complain_overflow_bitfield, coff_i960_relocate,"rellong", TRUE,
0xffffffff, 0xffffffff, 0); 0xffffffff, 0xffffffff, 0);
static reloc_howto_type howto_iprmed = static reloc_howto_type howto_iprmed =
HOWTO (R_IPRMED, 0, 2, 24,true,0, complain_overflow_signed, HOWTO (R_IPRMED, 0, 2, 24,TRUE,0, complain_overflow_signed,
coff_i960_relocate, "iprmed ", true, 0x00ffffff, 0x00ffffff, 0); coff_i960_relocate, "iprmed ", TRUE, 0x00ffffff, 0x00ffffff, 0);
static reloc_howto_type howto_optcall = static reloc_howto_type howto_optcall =
HOWTO (R_OPTCALL, 0,2,24,true,0, complain_overflow_signed, HOWTO (R_OPTCALL, 0,2,24,TRUE,0, complain_overflow_signed,
optcall_callback, "optcall", true, 0x00ffffff, 0x00ffffff, 0); optcall_callback, "optcall", TRUE, 0x00ffffff, 0x00ffffff, 0);
static reloc_howto_type * static reloc_howto_type *
coff_i960_reloc_type_lookup (abfd, code) coff_i960_reloc_type_lookup (abfd, code)
@ -318,7 +319,7 @@ coff_i960_reloc_type_lookup (abfd, code)
called at the start of the linking process, and it creates the called at the start of the linking process, and it creates the
necessary symbols. */ necessary symbols. */
static boolean static bfd_boolean
coff_i960_start_final_link (abfd, info) coff_i960_start_final_link (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -328,14 +329,14 @@ coff_i960_start_final_link (abfd, info)
bfd_byte *esym; bfd_byte *esym;
if (! info->relocateable) if (! info->relocateable)
return true; return TRUE;
esym = (bfd_byte *) bfd_malloc (symesz); esym = (bfd_byte *) bfd_malloc (symesz);
if (esym == NULL) if (esym == NULL)
return false; return FALSE;
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0) if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0)
return false; return FALSE;
for (o = abfd->sections; o != NULL; o = o->next) for (o = abfd->sections; o != NULL; o = o->next)
{ {
@ -353,7 +354,7 @@ coff_i960_start_final_link (abfd, info)
if (bfd_bwrite (esym, symesz, abfd) != symesz) if (bfd_bwrite (esym, symesz, abfd) != symesz)
{ {
free (esym); free (esym);
return false; return FALSE;
} }
obj_raw_syment_count (abfd) += 1; obj_raw_syment_count (abfd) += 1;
@ -361,12 +362,12 @@ coff_i960_start_final_link (abfd, info)
free (esym); free (esym);
return true; return TRUE;
} }
/* The reloc processing routine for the optimized COFF linker. */ /* The reloc processing routine for the optimized COFF linker. */
static boolean static bfd_boolean
coff_i960_relocate_section (output_bfd, info, input_bfd, input_section, coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, syms, sections) contents, relocs, syms, sections)
bfd *output_bfd ATTRIBUTE_UNUSED; bfd *output_bfd ATTRIBUTE_UNUSED;
@ -392,7 +393,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_vma val; bfd_vma val;
reloc_howto_type *howto; reloc_howto_type *howto;
bfd_reloc_status_type rstat = bfd_reloc_ok; bfd_reloc_status_type rstat = bfd_reloc_ok;
boolean done; bfd_boolean done;
symndx = rel->r_symndx; symndx = rel->r_symndx;
@ -419,7 +420,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
case 27: howto = &howto_optcall; break; case 27: howto = &howto_optcall; break;
default: default:
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
val = 0; val = 0;
@ -458,12 +459,12 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true))) rel->r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
} }
} }
done = false; done = FALSE;
if (howto->type == R_OPTCALL && ! info->relocateable && symndx != -1) if (howto->type == R_OPTCALL && ! info->relocateable && symndx != -1)
{ {
@ -485,7 +486,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
_("uncertain calling convention for non-COFF symbol"), _("uncertain calling convention for non-COFF symbol"),
input_bfd, input_section, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma)))
return false; return FALSE;
break; break;
case C_LEAFSTAT: case C_LEAFSTAT:
case C_LEAFEXT: case C_LEAFEXT:
@ -521,7 +522,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_put_32 (input_bfd, bfd_put_32 (input_bfd,
(bfd_vma) word, (bfd_vma) word,
contents + (rel->r_vaddr - input_section->vma)); contents + (rel->r_vaddr - input_section->vma));
done = true; done = TRUE;
} }
break; break;
case C_SCALL: case C_SCALL:
@ -559,47 +560,47 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
if (name == NULL) if (name == NULL)
return false; return FALSE;
} }
if (! ((*info->callbacks->reloc_overflow) if (! ((*info->callbacks->reloc_overflow)
(info, name, howto->name, (bfd_vma) 0, input_bfd, (info, name, howto->name, (bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
} }
} }
} }
return true; return TRUE;
} }
/* Adjust the symbol index of any reloc against a global symbol to /* Adjust the symbol index of any reloc against a global symbol to
instead be a reloc against the internal symbol we created specially instead be a reloc against the internal symbol we created specially
for the section. */ for the section. */
static boolean static bfd_boolean
coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
bfd *obfd ATTRIBUTE_UNUSED; bfd *obfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED;
bfd *ibfd; bfd *ibfd;
asection *sec ATTRIBUTE_UNUSED; asection *sec ATTRIBUTE_UNUSED;
struct internal_reloc *irel; struct internal_reloc *irel;
boolean *adjustedp; bfd_boolean *adjustedp;
{ {
struct coff_link_hash_entry *h; struct coff_link_hash_entry *h;
*adjustedp = false; *adjustedp = FALSE;
h = obj_coff_sym_hashes (ibfd)[irel->r_symndx]; h = obj_coff_sym_hashes (ibfd)[irel->r_symndx];
if (h == NULL if (h == NULL
|| (h->root.type != bfd_link_hash_defined || (h->root.type != bfd_link_hash_defined
&& h->root.type != bfd_link_hash_defweak)) && h->root.type != bfd_link_hash_defweak))
return true; return TRUE;
irel->r_symndx = h->root.u.def.section->output_section->target_index - 1; irel->r_symndx = h->root.u.def.section->output_section->target_index - 1;
*adjustedp = true; *adjustedp = TRUE;
return true; return TRUE;
} }
#define coff_bfd_is_local_label_name coff_i960_is_local_label_name #define coff_bfd_is_local_label_name coff_i960_is_local_label_name

View file

@ -1,5 +1,5 @@
/* BFD back-end for HP/Intel IA-64 COFF files. /* BFD back-end for HP/Intel IA-64 COFF files.
Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger <davidm@hpl.hp.com> Contributed by David Mosberger <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -49,17 +49,17 @@ static reloc_howto_type howto_table[] =
(cache_ptr)->howto = howto_table + (dst)->r_type; (cache_ptr)->howto = howto_table + (dst)->r_type;
#ifdef COFF_WITH_PE #ifdef COFF_WITH_PE
/* Return true if this relocation should /* Return TRUE if this relocation should
appear in the output .reloc section. */ appear in the output .reloc section. */
static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
static boolean static bfd_boolean
in_reloc_p(abfd, howto) in_reloc_p(abfd, howto)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
reloc_howto_type *howto ATTRIBUTE_UNUSED; reloc_howto_type *howto ATTRIBUTE_UNUSED;
{ {
return 0; /* We don't do relocs for now... */ return FALSE; /* We don't do relocs for now... */
} }
#endif #endif

View file

@ -1,6 +1,6 @@
/* BFD back-end for Motorola 68000 COFF binaries. /* BFD back-end for Motorola 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
2000, 2001 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Cygnus Support. Written by Cygnus Support.
@ -67,19 +67,20 @@ static reloc_howto_type *m68kcoff_common_addend_rtype_to_howto
#define RELOC_SPECIAL_FN m68kcoff_common_addend_special_fn #define RELOC_SPECIAL_FN m68kcoff_common_addend_special_fn
#endif #endif
static boolean m68k_coff_is_local_label_name PARAMS ((bfd *, const char *)); static bfd_boolean m68k_coff_is_local_label_name
PARAMS ((bfd *, const char *));
/* On the delta, a symbol starting with L% is local. We won't see /* On the delta, a symbol starting with L% is local. We won't see
such a symbol on other platforms, so it should be safe to always such a symbol on other platforms, so it should be safe to always
consider it local here. */ consider it local here. */
static boolean static bfd_boolean
m68k_coff_is_local_label_name (abfd, name) m68k_coff_is_local_label_name (abfd, name)
bfd *abfd; bfd *abfd;
const char *name; const char *name;
{ {
if (name[0] == 'L' && name[1] == '%') if (name[0] == 'L' && name[1] == '%')
return true; return TRUE;
return _bfd_coff_is_local_label_name (abfd, name); return _bfd_coff_is_local_label_name (abfd, name);
} }
@ -100,13 +101,13 @@ static
#endif #endif
reloc_howto_type m68kcoff_howto_table[] = reloc_howto_type m68kcoff_howto_table[] =
{ {
HOWTO (R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", true, 0x000000ff,0x000000ff, false), HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", true, 0x0000ffff,0x0000ffff, false), HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", true, 0xffffffff,0xffffffff, false), HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
HOWTO (R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", true, 0x000000ff,0x000000ff, false), HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO (R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", true, 0x0000ffff,0x0000ffff, false), HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO (R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", true, 0xffffffff,0xffffffff, false), HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
HOWTO (R_RELLONG_NEG, 0, -2, 32, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", true, 0xffffffff,0xffffffff, false), HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", TRUE, 0xffffffff,0xffffffff, FALSE),
}; };
#endif /* not ONLY_DECLARE_RELOCS */ #endif /* not ONLY_DECLARE_RELOCS */
@ -430,7 +431,7 @@ m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
after the add_symbols entry point has been called for all the after the add_symbols entry point has been called for all the
objects, and before the final_link entry point is called. */ objects, and before the final_link entry point is called. */
boolean bfd_boolean
bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -449,19 +450,19 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
*errmsg = NULL; *errmsg = NULL;
if (datasec->reloc_count == 0) if (datasec->reloc_count == 0)
return true; return TRUE;
extsyms = obj_coff_external_syms (abfd); extsyms = obj_coff_external_syms (abfd);
symesz = bfd_coff_symesz (abfd); symesz = bfd_coff_symesz (abfd);
irel = _bfd_coff_read_internal_relocs (abfd, datasec, true, NULL, false, irel = _bfd_coff_read_internal_relocs (abfd, datasec, TRUE, NULL, FALSE,
NULL); NULL);
irelend = irel + datasec->reloc_count; irelend = irel + datasec->reloc_count;
amt = (bfd_size_type) datasec->reloc_count * 12; amt = (bfd_size_type) datasec->reloc_count * 12;
relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt); relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt);
if (relsec->contents == NULL) if (relsec->contents == NULL)
return false; return FALSE;
p = relsec->contents; p = relsec->contents;
@ -480,7 +481,7 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
{ {
*errmsg = _("unsupported reloc type"); *errmsg = _("unsupported reloc type");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
if (irel->r_symndx == -1) if (irel->r_symndx == -1)
@ -512,7 +513,7 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
strncpy (p + 4, targetsec->output_section->name, 8); strncpy (p + 4, targetsec->output_section->name, 8);
} }
return true; return TRUE;
} }
#endif /* neither ONLY_DECLARE_RELOCS not STATIC_RELOCS */ #endif /* neither ONLY_DECLARE_RELOCS not STATIC_RELOCS */

View file

@ -1,6 +1,6 @@
/* BFD back-end for Motorola 88000 COFF "Binary Compatability Standard" files. /* BFD back-end for Motorola 88000 COFF "Binary Compatability Standard" files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
2001 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Cygnus Support. Written by Cygnus Support.
@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "coff/internal.h" #include "coff/internal.h"
#include "libcoff.h" #include "libcoff.h"
static boolean m88k_is_local_label_name PARAMS ((bfd *, const char *)); static bfd_boolean m88k_is_local_label_name PARAMS ((bfd *, const char *));
static bfd_reloc_status_type m88k_special_reloc static bfd_reloc_status_type m88k_special_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
@ -44,7 +44,7 @@ static void reloc_processing
#define coff_bfd_is_local_label_name m88k_is_local_label_name #define coff_bfd_is_local_label_name m88k_is_local_label_name
static boolean static bfd_boolean
m88k_is_local_label_name (abfd, name) m88k_is_local_label_name (abfd, name)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
const char *name; const char *name;
@ -152,85 +152,85 @@ static reloc_howto_type howto_table[] =
02, /* rightshift */ 02, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
m88k_special_reloc, /* special_function */ m88k_special_reloc, /* special_function */
"PCR16L", /* name */ "PCR16L", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
HOWTO (R_PCR26L, /* type */ HOWTO (R_PCR26L, /* type */
02, /* rightshift */ 02, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */ 26, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
m88k_special_reloc, /* special_function */ m88k_special_reloc, /* special_function */
"PCR26L", /* name */ "PCR26L", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x03ffffff, /* src_mask */ 0x03ffffff, /* src_mask */
0x03ffffff, /* dst_mask */ 0x03ffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
HOWTO (R_VRT16, /* type */ HOWTO (R_VRT16, /* type */
00, /* rightshift */ 00, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
m88k_special_reloc, /* special_function */ m88k_special_reloc, /* special_function */
"VRT16", /* name */ "VRT16", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
HOWTO (R_HVRT16, /* type */ HOWTO (R_HVRT16, /* type */
16, /* rightshift */ 16, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
m88k_special_reloc, /* special_function */ m88k_special_reloc, /* special_function */
"HVRT16", /* name */ "HVRT16", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
HOWTO (R_LVRT16, /* type */ HOWTO (R_LVRT16, /* type */
00, /* rightshift */ 00, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
m88k_special_reloc, /* special_function */ m88k_special_reloc, /* special_function */
"LVRT16", /* name */ "LVRT16", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x0000ffff, /* src_mask */ 0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */ 0x0000ffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
HOWTO (R_VRT32, /* type */ HOWTO (R_VRT32, /* type */
00, /* rightshift */ 00, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
m88k_special_reloc, /* special_function */ m88k_special_reloc, /* special_function */
"VRT32", /* name */ "VRT32", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
}; };
/* Code to turn an external r_type into a pointer to an entry in the /* Code to turn an external r_type into a pointer to an entry in the

View file

@ -37,25 +37,26 @@ Boston, MA 02111-1307, USA. */
/* This file is compiled more than once, but we only compile the /* This file is compiled more than once, but we only compile the
final_link routine once. */ final_link routine once. */
extern boolean mcore_bfd_coff_final_link extern bfd_boolean mcore_bfd_coff_final_link
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
#if 0 #if 0
static struct bfd_link_hash_table * coff_mcore_link_hash_table_create static struct bfd_link_hash_table *coff_mcore_link_hash_table_create
PARAMS ((bfd *)); PARAMS ((bfd *));
#endif #endif
static bfd_reloc_status_type mcore_coff_unsupported_reloc static bfd_reloc_status_type mcore_coff_unsupported_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static boolean coff_mcore_relocate_section static bfd_boolean coff_mcore_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **)); struct internal_reloc *, struct internal_syment *, asection **));
static reloc_howto_type * mcore_coff_reloc_type_lookup static reloc_howto_type *mcore_coff_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static reloc_howto_type * coff_mcore_rtype_to_howto static reloc_howto_type *coff_mcore_rtype_to_howto
PARAMS ((bfd *, asection *, struct internal_reloc *, PARAMS ((bfd *, asection *, struct internal_reloc *,
struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); struct coff_link_hash_entry *, struct internal_syment *,
bfd_vma *));
static void mcore_emit_base_file_entry static void mcore_emit_base_file_entry
PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma)); PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma));
static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
/* The NT loader points the toc register to &toc + 32768, in order to /* The NT loader points the toc register to &toc + 32768, in order to
use the complete range of a 16-bit displacement. We have to adjust use the complete range of a 16-bit displacement. We have to adjust
@ -77,29 +78,29 @@ static reloc_howto_type mcore_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */ 0, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* dont complain_on_overflow */ complain_overflow_dont, /* dont complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"ABSOLUTE", /* name */ "ABSOLUTE", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x00, /* src_mask */ 0x00, /* src_mask */
0x00, /* dst_mask */ 0x00, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (IMAGE_REL_MCORE_ADDR32,/* type */ HOWTO (IMAGE_REL_MCORE_ADDR32,/* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"ADDR32", /* name */ "ADDR32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions. /* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions.
Should not appear in object files. */ Should not appear in object files. */
@ -107,15 +108,15 @@ static reloc_howto_type mcore_coff_howto_table[] =
2, /* rightshift */ 2, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */ 8, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
mcore_coff_unsupported_reloc, /* special_function */ mcore_coff_unsupported_reloc, /* special_function */
"IMM8BY4", /* name */ "IMM8BY4", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* bsr/bt/bf/br instructions; 11 bits + 1 zero bit /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit
Span 2k instructions == 4k bytes. Span 2k instructions == 4k bytes.
@ -124,45 +125,45 @@ static reloc_howto_type mcore_coff_howto_table[] =
1, /* rightshift */ 1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
11, /* bitsize */ 11, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"IMM11BY2", /* name */ "IMM11BY2", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x0, /* src_mask */ 0x0, /* src_mask */
0x7ff, /* dst_mask */ 0x7ff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */ /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */
HOWTO (IMAGE_REL_MCORE_PCREL_IMM4BY2, /* type */ HOWTO (IMAGE_REL_MCORE_PCREL_IMM4BY2, /* type */
1, /* rightshift */ 1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
4, /* bitsize */ 4, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
mcore_coff_unsupported_reloc, /* special_function */ mcore_coff_unsupported_reloc, /* special_function */
"IMM4BY2", /* name */ "IMM4BY2", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* 32-bit pc-relative. Eventually this will help support PIC code. */ /* 32-bit pc-relative. Eventually this will help support PIC code. */
HOWTO (IMAGE_REL_MCORE_PCREL_32,/* type */ HOWTO (IMAGE_REL_MCORE_PCREL_32,/* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"PCREL_32", /* name */ "PCREL_32", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x0, /* src_mask */ 0x0, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* Like PCREL_IMM11BY2, this relocation indicates that there is a /* Like PCREL_IMM11BY2, this relocation indicates that there is a
'jsri' at the specified address. There is a separate relocation 'jsri' at the specified address. There is a separate relocation
@ -175,29 +176,29 @@ static reloc_howto_type mcore_coff_howto_table[] =
1, /* rightshift */ 1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
11, /* bitsize */ 11, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"JSR_IMM11BY2", /* name */ "JSR_IMM11BY2", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x0, /* src_mask */ 0x0, /* src_mask */
0x7ff, /* dst_mask */ 0x7ff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
HOWTO (IMAGE_REL_MCORE_RVA, /* type */ HOWTO (IMAGE_REL_MCORE_RVA, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"MCORE_RVA", /* name */ "MCORE_RVA", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true) /* pcrel_offset */ TRUE) /* pcrel_offset */
}; };
/* Extend the coff_link_hash_table structure with a few M*Core specific fields. /* Extend the coff_link_hash_table structure with a few M*Core specific fields.
@ -358,10 +359,10 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
return howto; return howto;
} }
/* Return true if this relocation should appear in the output .reloc section. /* Return TRUE if this relocation should appear in the output .reloc section.
This function is referenced in pe_mkobject in peicode.h. */ This function is referenced in pe_mkobject in peicode.h. */
static boolean static bfd_boolean
in_reloc_p (abfd, howto) in_reloc_p (abfd, howto)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
reloc_howto_type * howto; reloc_howto_type * howto;
@ -370,7 +371,7 @@ in_reloc_p (abfd, howto)
} }
/* The reloc processing routine for the optimized COFF linker. */ /* The reloc processing routine for the optimized COFF linker. */
static boolean static bfd_boolean
coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, syms, sections) contents, relocs, syms, sections)
bfd * output_bfd; bfd * output_bfd;
@ -384,14 +385,14 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
struct internal_reloc * rel; struct internal_reloc * rel;
struct internal_reloc * relend; struct internal_reloc * relend;
boolean hihalf; bfd_boolean hihalf;
bfd_vma hihalf_val; bfd_vma hihalf_val;
/* If we are performing a relocateable link, we don't need to do a /* If we are performing a relocateable link, we don't need to do a
thing. The caller will take care of adjusting the reloc thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */ addresses and symbol indices. */
if (info->relocateable) if (info->relocateable)
return true; return TRUE;
/* Check if we have the same endianess */ /* Check if we have the same endianess */
if ( input_bfd->xvec->byteorder != output_bfd->xvec->byteorder if ( input_bfd->xvec->byteorder != output_bfd->xvec->byteorder
@ -404,10 +405,10 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_big_endian (output_bfd) ? _("big endian") : _("little endian")); bfd_big_endian (output_bfd) ? _("big endian") : _("little endian"));
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return false; return FALSE;
} }
hihalf = false; hihalf = FALSE;
hihalf_val = 0; hihalf_val = 0;
rel = relocs; rel = relocs;
@ -446,7 +447,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
sym, & addend); sym, & addend);
if (howto == NULL) if (howto == NULL)
return false; return FALSE;
val = 0; val = 0;
@ -492,8 +493,8 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true))) rel->r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
} }
my_name = h->root.root.string; my_name = h->root.root.string;
@ -508,7 +509,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
_bfd_error_handler (_("%s: unsupported relocation type 0x%02x"), _bfd_error_handler (_("%s: unsupported relocation type 0x%02x"),
bfd_archive_filename (input_bfd), r_type); bfd_archive_filename (input_bfd), r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
case IMAGE_REL_MCORE_ABSOLUTE: case IMAGE_REL_MCORE_ABSOLUTE:
fprintf (stderr, fprintf (stderr,
@ -560,11 +561,11 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
(info, my_name, howto->name, (info, my_name, howto->name,
(bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
} }
} }
return true; return TRUE;
} }
/* Tailor coffcode.h -- macro heaven. */ /* Tailor coffcode.h -- macro heaven. */

View file

@ -35,85 +35,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Prototypes for static functions. */ /* Prototypes for static functions. */
static boolean mips_ecoff_bad_format_hook PARAMS ((bfd *abfd, PTR filehdr)); static bfd_boolean mips_ecoff_bad_format_hook
static void mips_ecoff_swap_reloc_in PARAMS ((bfd *, PTR, PARAMS ((bfd *abfd, PTR filehdr));
struct internal_reloc *)); static void mips_ecoff_swap_reloc_in
static void mips_ecoff_swap_reloc_out PARAMS ((bfd *, PARAMS ((bfd *, PTR, struct internal_reloc *));
const struct internal_reloc *, static void mips_ecoff_swap_reloc_out
PTR)); PARAMS ((bfd *, const struct internal_reloc *, PTR));
static void mips_adjust_reloc_in PARAMS ((bfd *, static void mips_adjust_reloc_in
const struct internal_reloc *, PARAMS ((bfd *, const struct internal_reloc *, arelent *));
arelent *)); static void mips_adjust_reloc_out
static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *, PARAMS ((bfd *, const arelent *, struct internal_reloc *));
struct internal_reloc *)); static bfd_reloc_status_type mips_generic_reloc
static bfd_reloc_status_type mips_generic_reloc PARAMS ((bfd *abfd, PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
arelent *reloc, asection *section, bfd *output_bfd, char **error));
asymbol *symbol, static bfd_reloc_status_type mips_refhi_reloc
PTR data, PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
asection *section, asection *section, bfd *output_bfd, char **error));
bfd *output_bfd, static bfd_reloc_status_type mips_reflo_reloc
char **error)); PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
static bfd_reloc_status_type mips_refhi_reloc PARAMS ((bfd *abfd, asection *section, bfd *output_bfd, char **error));
arelent *reloc, static bfd_reloc_status_type mips_gprel_reloc
asymbol *symbol, PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
PTR data, asection *section, bfd *output_bfd, char **error));
asection *section, static bfd_reloc_status_type mips_relhi_reloc
bfd *output_bfd, PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
char **error)); asection *section, bfd *output_bfd, char **error));
static bfd_reloc_status_type mips_reflo_reloc PARAMS ((bfd *abfd, static bfd_reloc_status_type mips_rello_reloc
arelent *reloc, PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
asymbol *symbol, asection *section, bfd *output_bfd, char **error));
PTR data, static bfd_reloc_status_type mips_switch_reloc
asection *section, PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
bfd *output_bfd, asection *section, bfd *output_bfd, char **error));
char **error)); static void mips_relocate_hi
static bfd_reloc_status_type mips_gprel_reloc PARAMS ((bfd *abfd, PARAMS ((struct internal_reloc *refhi, struct internal_reloc *reflo,
arelent *reloc, bfd *input_bfd, asection *input_section, bfd_byte *contents,
asymbol *symbol, size_t adjust, bfd_vma relocation, bfd_boolean pcrel));
PTR data, static bfd_boolean mips_relocate_section
asection *section, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR));
bfd *output_bfd, static bfd_boolean mips_read_relocs
char **error)); PARAMS ((bfd *, asection *));
static bfd_reloc_status_type mips_relhi_reloc PARAMS ((bfd *abfd, static bfd_boolean mips_relax_section
arelent *reloc, PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
asymbol *symbol, static bfd_boolean mips_relax_pcrel16
PTR data, PARAMS ((struct bfd_link_info *, bfd *, asection *,
asection *section, struct ecoff_link_hash_entry *, bfd_byte *, bfd_vma));
bfd *output_bfd,
char **error));
static bfd_reloc_status_type mips_rello_reloc PARAMS ((bfd *abfd,
arelent *reloc,
asymbol *symbol,
PTR data,
asection *section,
bfd *output_bfd,
char **error));
static bfd_reloc_status_type mips_switch_reloc PARAMS ((bfd *abfd,
arelent *reloc,
asymbol *symbol,
PTR data,
asection *section,
bfd *output_bfd,
char **error));
static void mips_relocate_hi PARAMS ((struct internal_reloc *refhi,
struct internal_reloc *reflo,
bfd *input_bfd,
asection *input_section,
bfd_byte *contents,
size_t adjust,
bfd_vma relocation,
boolean pcrel));
static boolean mips_relocate_section PARAMS ((bfd *, struct bfd_link_info *,
bfd *, asection *,
bfd_byte *, PTR));
static boolean mips_read_relocs PARAMS ((bfd *, asection *));
static boolean mips_relax_section PARAMS ((bfd *, asection *,
struct bfd_link_info *,
boolean *));
static boolean mips_relax_pcrel16 PARAMS ((struct bfd_link_info *, bfd *,
asection *,
struct ecoff_link_hash_entry *,
bfd_byte *, bfd_vma));
static reloc_howto_type *mips_bfd_reloc_type_lookup static reloc_howto_type *mips_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
@ -152,52 +117,52 @@ static reloc_howto_type mips_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */ 8, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"IGNORE", /* name */ "IGNORE", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0, /* src_mask */ 0, /* src_mask */
0, /* dst_mask */ 0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A 16 bit reference to a symbol, normally from a data section. */ /* A 16 bit reference to a symbol, normally from a data section. */
HOWTO (MIPS_R_REFHALF, /* type */ HOWTO (MIPS_R_REFHALF, /* type */
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
mips_generic_reloc, /* special_function */ mips_generic_reloc, /* special_function */
"REFHALF", /* name */ "REFHALF", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A 32 bit reference to a symbol, normally from a data section. */ /* A 32 bit reference to a symbol, normally from a data section. */
HOWTO (MIPS_R_REFWORD, /* type */ HOWTO (MIPS_R_REFWORD, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
mips_generic_reloc, /* special_function */ mips_generic_reloc, /* special_function */
"REFWORD", /* name */ "REFWORD", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A 26 bit absolute jump address. */ /* A 26 bit absolute jump address. */
HOWTO (MIPS_R_JMPADDR, /* type */ HOWTO (MIPS_R_JMPADDR, /* type */
2, /* rightshift */ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */ 26, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
/* This needs complex overflow /* This needs complex overflow
@ -205,10 +170,10 @@ static reloc_howto_type mips_howto_table[] =
bits must match the PC. */ bits must match the PC. */
mips_generic_reloc, /* special_function */ mips_generic_reloc, /* special_function */
"JMPADDR", /* name */ "JMPADDR", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x3ffffff, /* src_mask */ 0x3ffffff, /* src_mask */
0x3ffffff, /* dst_mask */ 0x3ffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* The high 16 bits of a symbol value. Handled by the function /* The high 16 bits of a symbol value. Handled by the function
mips_refhi_reloc. */ mips_refhi_reloc. */
@ -216,30 +181,30 @@ static reloc_howto_type mips_howto_table[] =
16, /* rightshift */ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
mips_refhi_reloc, /* special_function */ mips_refhi_reloc, /* special_function */
"REFHI", /* name */ "REFHI", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* The low 16 bits of a symbol value. */ /* The low 16 bits of a symbol value. */
HOWTO (MIPS_R_REFLO, /* type */ HOWTO (MIPS_R_REFLO, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
mips_reflo_reloc, /* special_function */ mips_reflo_reloc, /* special_function */
"REFLO", /* name */ "REFLO", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A reference to an offset from the gp register. Handled by the /* A reference to an offset from the gp register. Handled by the
function mips_gprel_reloc. */ function mips_gprel_reloc. */
@ -247,15 +212,15 @@ static reloc_howto_type mips_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
mips_gprel_reloc, /* special_function */ mips_gprel_reloc, /* special_function */
"GPREL", /* name */ "GPREL", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* A reference to a literal using an offset from the gp register. /* A reference to a literal using an offset from the gp register.
Handled by the function mips_gprel_reloc. */ Handled by the function mips_gprel_reloc. */
@ -263,15 +228,15 @@ static reloc_howto_type mips_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
mips_gprel_reloc, /* special_function */ mips_gprel_reloc, /* special_function */
"LITERAL", /* name */ "LITERAL", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
EMPTY_HOWTO (8), EMPTY_HOWTO (8),
EMPTY_HOWTO (9), EMPTY_HOWTO (9),
@ -286,15 +251,15 @@ static reloc_howto_type mips_howto_table[] =
2, /* rightshift */ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
mips_generic_reloc, /* special_function */ mips_generic_reloc, /* special_function */
"PCREL16", /* name */ "PCREL16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* This reloc is a Cygnus extension used when generating position /* This reloc is a Cygnus extension used when generating position
independent code for embedded systems. It represents the high 16 independent code for embedded systems. It represents the high 16
@ -307,15 +272,15 @@ static reloc_howto_type mips_howto_table[] =
16, /* rightshift */ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
mips_relhi_reloc, /* special_function */ mips_relhi_reloc, /* special_function */
"RELHI", /* name */ "RELHI", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* This reloc is a Cygnus extension used when generating position /* This reloc is a Cygnus extension used when generating position
independent code for embedded systems. It represents the low 16 independent code for embedded systems. It represents the low 16
@ -324,15 +289,15 @@ static reloc_howto_type mips_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
mips_rello_reloc, /* special_function */ mips_rello_reloc, /* special_function */
"RELLO", /* name */ "RELLO", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
EMPTY_HOWTO (15), EMPTY_HOWTO (15),
EMPTY_HOWTO (16), EMPTY_HOWTO (16),
@ -352,15 +317,15 @@ static reloc_howto_type mips_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
mips_switch_reloc, /* special_function */ mips_switch_reloc, /* special_function */
"SWITCH", /* name */ "SWITCH", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true) /* pcrel_offset */ TRUE) /* pcrel_offset */
}; };
#define MIPS_HOWTO_COUNT \ #define MIPS_HOWTO_COUNT \
@ -384,7 +349,7 @@ static reloc_howto_type mips_howto_table[] =
/* See whether the magic number matches. */ /* See whether the magic number matches. */
static boolean static bfd_boolean
mips_ecoff_bad_format_hook (abfd, filehdr) mips_ecoff_bad_format_hook (abfd, filehdr)
bfd *abfd; bfd *abfd;
PTR filehdr; PTR filehdr;
@ -395,7 +360,7 @@ mips_ecoff_bad_format_hook (abfd, filehdr)
{ {
case MIPS_MAGIC_1: case MIPS_MAGIC_1:
/* I don't know what endianness this implies. */ /* I don't know what endianness this implies. */
return true; return TRUE;
case MIPS_MAGIC_BIG: case MIPS_MAGIC_BIG:
case MIPS_MAGIC_BIG2: case MIPS_MAGIC_BIG2:
@ -408,7 +373,7 @@ mips_ecoff_bad_format_hook (abfd, filehdr)
return bfd_little_endian (abfd); return bfd_little_endian (abfd);
default: default:
return false; return FALSE;
} }
} }
@ -793,7 +758,7 @@ mips_gprel_reloc (abfd,
bfd *output_bfd; bfd *output_bfd;
char **error_message; char **error_message;
{ {
boolean relocateable; bfd_boolean relocateable;
bfd_vma gp; bfd_vma gp;
bfd_vma relocation; bfd_vma relocation;
unsigned long val; unsigned long val;
@ -812,10 +777,10 @@ mips_gprel_reloc (abfd,
} }
if (output_bfd != (bfd *) NULL) if (output_bfd != (bfd *) NULL)
relocateable = true; relocateable = TRUE;
else else
{ {
relocateable = false; relocateable = FALSE;
output_bfd = symbol->section->output_section->owner; output_bfd = symbol->section->output_section->owner;
} }
@ -1185,7 +1150,7 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust,
bfd_byte *contents; bfd_byte *contents;
size_t adjust; size_t adjust;
bfd_vma relocation; bfd_vma relocation;
boolean pcrel; bfd_boolean pcrel;
{ {
unsigned long insn; unsigned long insn;
unsigned long val; unsigned long val;
@ -1229,7 +1194,7 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust,
/* Relocate a section while linking a MIPS ECOFF file. */ /* Relocate a section while linking a MIPS ECOFF file. */
static boolean static bfd_boolean
mips_relocate_section (output_bfd, info, input_bfd, input_section, mips_relocate_section (output_bfd, info, input_bfd, input_section,
contents, external_relocs) contents, external_relocs)
bfd *output_bfd; bfd *output_bfd;
@ -1242,13 +1207,13 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
asection **symndx_to_section; asection **symndx_to_section;
struct ecoff_link_hash_entry **sym_hashes; struct ecoff_link_hash_entry **sym_hashes;
bfd_vma gp; bfd_vma gp;
boolean gp_undefined; bfd_boolean gp_undefined;
size_t adjust; size_t adjust;
long *offsets; long *offsets;
struct external_reloc *ext_rel; struct external_reloc *ext_rel;
struct external_reloc *ext_rel_end; struct external_reloc *ext_rel_end;
unsigned int i; unsigned int i;
boolean got_lo; bfd_boolean got_lo;
struct internal_reloc lo_int_rel; struct internal_reloc lo_int_rel;
bfd_size_type amt; bfd_size_type amt;
@ -1264,7 +1229,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
amt = NUM_RELOC_SECTIONS * sizeof (asection *); amt = NUM_RELOC_SECTIONS * sizeof (asection *);
symndx_to_section = (asection **) bfd_alloc (input_bfd, amt); symndx_to_section = (asection **) bfd_alloc (input_bfd, amt);
if (!symndx_to_section) if (!symndx_to_section)
return false; return FALSE;
symndx_to_section[RELOC_SECTION_NONE] = NULL; symndx_to_section[RELOC_SECTION_NONE] = NULL;
symndx_to_section[RELOC_SECTION_TEXT] = symndx_to_section[RELOC_SECTION_TEXT] =
@ -1299,11 +1264,11 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
gp = _bfd_get_gp_value (output_bfd); gp = _bfd_get_gp_value (output_bfd);
if (gp == 0) if (gp == 0)
gp_undefined = true; gp_undefined = TRUE;
else else
gp_undefined = false; gp_undefined = FALSE;
got_lo = false; got_lo = FALSE;
adjust = 0; adjust = 0;
@ -1317,7 +1282,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
for (i = 0; ext_rel < ext_rel_end; ext_rel++, i++) for (i = 0; ext_rel < ext_rel_end; ext_rel++, i++)
{ {
struct internal_reloc int_rel; struct internal_reloc int_rel;
boolean use_lo = false; bfd_boolean use_lo = FALSE;
bfd_vma addend; bfd_vma addend;
reloc_howto_type *howto; reloc_howto_type *howto;
struct ecoff_link_hash_entry *h = NULL; struct ecoff_link_hash_entry *h = NULL;
@ -1330,7 +1295,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
int_rel = lo_int_rel; int_rel = lo_int_rel;
got_lo = false; got_lo = FALSE;
} }
BFD_ASSERT (int_rel.r_type BFD_ASSERT (int_rel.r_type
@ -1365,9 +1330,9 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
&& int_rel.r_extern == lo_int_rel.r_extern && int_rel.r_extern == lo_int_rel.r_extern
&& int_rel.r_symndx == lo_int_rel.r_symndx) && int_rel.r_symndx == lo_int_rel.r_symndx)
{ {
use_lo = true; use_lo = TRUE;
if (lo_ext_rel == ext_rel + 1) if (lo_ext_rel == ext_rel + 1)
got_lo = true; got_lo = TRUE;
} }
} }
@ -1432,11 +1397,11 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
(info, _("GP relative relocation used when GP not defined"), (info, _("GP relative relocation used when GP not defined"),
input_bfd, input_section, input_bfd, input_section,
int_rel.r_vaddr - input_section->vma))) int_rel.r_vaddr - input_section->vma)))
return false; return FALSE;
/* Only give the error once per link. */ /* Only give the error once per link. */
gp = 4; gp = 4;
_bfd_set_gp_value (output_bfd, gp); _bfd_set_gp_value (output_bfd, gp);
gp_undefined = false; gp_undefined = FALSE;
} }
if (! int_rel.r_extern) if (! int_rel.r_extern)
{ {
@ -1511,7 +1476,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
+ (int_rel.r_vaddr + (int_rel.r_vaddr
- input_section->vma) - input_section->vma)
+ adjust))) + adjust)))
return false; return FALSE;
/* We must adjust everything else up a notch. */ /* We must adjust everything else up a notch. */
adjust += PCREL16_EXPANSION_ADJUSTMENT; adjust += PCREL16_EXPANSION_ADJUSTMENT;
@ -1694,7 +1659,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, input_section,
int_rel.r_vaddr - input_section->vma))) int_rel.r_vaddr - input_section->vma)))
return false; return FALSE;
int_rel.r_symndx = 0; int_rel.r_symndx = 0;
} }
relocation = 0; relocation = 0;
@ -1778,8 +1743,8 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, input_section,
int_rel.r_vaddr - input_section->vma, true))) int_rel.r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
relocation = 0; relocation = 0;
} }
} }
@ -1860,19 +1825,19 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
(info, name, howto->name, (bfd_vma) 0, (info, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, input_bfd, input_section,
int_rel.r_vaddr - input_section->vma))) int_rel.r_vaddr - input_section->vma)))
return false; return FALSE;
} }
break; break;
} }
} }
} }
return true; return TRUE;
} }
/* Read in the relocs for a section. */ /* Read in the relocs for a section. */
static boolean static bfd_boolean
mips_read_relocs (abfd, sec) mips_read_relocs (abfd, sec)
bfd *abfd; bfd *abfd;
asection *sec; asection *sec;
@ -1886,7 +1851,7 @@ mips_read_relocs (abfd, sec)
amt = sizeof (struct ecoff_section_tdata); amt = sizeof (struct ecoff_section_tdata);
sec->used_by_bfd = (PTR) bfd_alloc (abfd, amt); sec->used_by_bfd = (PTR) bfd_alloc (abfd, amt);
if (sec->used_by_bfd == NULL) if (sec->used_by_bfd == NULL)
return false; return FALSE;
section_tdata = ecoff_section_data (abfd, sec); section_tdata = ecoff_section_data (abfd, sec);
section_tdata->external_relocs = NULL; section_tdata->external_relocs = NULL;
@ -1900,14 +1865,14 @@ mips_read_relocs (abfd, sec)
amt *= sec->reloc_count; amt *= sec->reloc_count;
section_tdata->external_relocs = (PTR) bfd_alloc (abfd, amt); section_tdata->external_relocs = (PTR) bfd_alloc (abfd, amt);
if (section_tdata->external_relocs == NULL && amt != 0) if (section_tdata->external_relocs == NULL && amt != 0)
return false; return FALSE;
if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0 if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0
|| bfd_bread (section_tdata->external_relocs, amt, abfd) != amt) || bfd_bread (section_tdata->external_relocs, amt, abfd) != amt)
return false; return FALSE;
} }
return true; return TRUE;
} }
/* Relax a section when linking a MIPS ECOFF file. This is used for /* Relax a section when linking a MIPS ECOFF file. This is used for
@ -1934,12 +1899,12 @@ mips_read_relocs (abfd, sec)
routine and the mips_relocate_section routine is the table of routine and the mips_relocate_section routine is the table of
offsets. */ offsets. */
static boolean static bfd_boolean
mips_relax_section (abfd, sec, info, again) mips_relax_section (abfd, sec, info, again)
bfd *abfd; bfd *abfd;
asection *sec; asection *sec;
struct bfd_link_info *info; struct bfd_link_info *info;
boolean *again; bfd_boolean *again;
{ {
struct ecoff_section_tdata *section_tdata; struct ecoff_section_tdata *section_tdata;
bfd_byte *contents = NULL; bfd_byte *contents = NULL;
@ -1949,21 +1914,21 @@ mips_relax_section (abfd, sec, info, again)
unsigned int i; unsigned int i;
/* Assume we are not going to need another pass. */ /* Assume we are not going to need another pass. */
*again = false; *again = FALSE;
/* If we are not generating an ECOFF file, this is much too /* If we are not generating an ECOFF file, this is much too
confusing to deal with. */ confusing to deal with. */
if (info->hash->creator->flavour != bfd_get_flavour (abfd)) if (info->hash->creator->flavour != bfd_get_flavour (abfd))
return true; return TRUE;
/* If there are no relocs, there is nothing to do. */ /* If there are no relocs, there is nothing to do. */
if (sec->reloc_count == 0) if (sec->reloc_count == 0)
return true; return TRUE;
/* We are only interested in PC relative relocs, and why would there /* We are only interested in PC relative relocs, and why would there
ever be one from anything but the .text section? */ ever be one from anything but the .text section? */
if (strcmp (bfd_get_section_name (abfd, sec), ".text") != 0) if (strcmp (bfd_get_section_name (abfd, sec), ".text") != 0)
return true; return TRUE;
/* Read in the relocs, if we haven't already got them. */ /* Read in the relocs, if we haven't already got them. */
section_tdata = ecoff_section_data (abfd, sec); section_tdata = ecoff_section_data (abfd, sec);
@ -2108,7 +2073,7 @@ mips_relax_section (abfd, sec, info, again)
symbols in the object file following this location. */ symbols in the object file following this location. */
sec->_cooked_size += PCREL16_EXPANSION_ADJUSTMENT; sec->_cooked_size += PCREL16_EXPANSION_ADJUSTMENT;
*again = true; *again = TRUE;
if (offsets == (long *) NULL) if (offsets == (long *) NULL)
{ {
@ -2306,12 +2271,12 @@ mips_relax_section (abfd, sec, info, again)
if (contents != (bfd_byte *) NULL && ! info->keep_memory) if (contents != (bfd_byte *) NULL && ! info->keep_memory)
free (contents); free (contents);
return true; return TRUE;
error_return: error_return:
if (contents != (bfd_byte *) NULL && ! info->keep_memory) if (contents != (bfd_byte *) NULL && ! info->keep_memory)
free (contents); free (contents);
return false; return FALSE;
} }
/* This routine is called from mips_relocate_section when a PC /* This routine is called from mips_relocate_section when a PC
@ -2319,7 +2284,7 @@ mips_relax_section (abfd, sec, info, again)
It handles all the details of the expansion, including resolving It handles all the details of the expansion, including resolving
the reloc. */ the reloc. */
static boolean static bfd_boolean
mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address) mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED;
bfd *input_bfd; bfd *input_bfd;
@ -2356,7 +2321,7 @@ mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
bfd_put_32 (input_bfd, bfd_put_32 (input_bfd,
(bfd_vma) 0x0020f809, location + 16); /* jalr $at */ (bfd_vma) 0x0020f809, location + 16); /* jalr $at */
return true; return TRUE;
} }
/* Given a .sdata section and a .rel.sdata in-memory section, store /* Given a .sdata section and a .rel.sdata in-memory section, store
@ -2368,7 +2333,7 @@ mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
function presumes that the object was compiled using function presumes that the object was compiled using
-membedded-pic. */ -membedded-pic. */
boolean bfd_boolean
bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -2388,17 +2353,17 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
*errmsg = NULL; *errmsg = NULL;
if (datasec->reloc_count == 0) if (datasec->reloc_count == 0)
return true; return TRUE;
sym_hashes = ecoff_data (abfd)->sym_hashes; sym_hashes = ecoff_data (abfd)->sym_hashes;
if (! mips_read_relocs (abfd, datasec)) if (! mips_read_relocs (abfd, datasec))
return false; return FALSE;
amt = (bfd_size_type) datasec->reloc_count * 4; amt = (bfd_size_type) datasec->reloc_count * 4;
relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt); relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt);
if (relsec->contents == NULL) if (relsec->contents == NULL)
return false; return FALSE;
p = relsec->contents; p = relsec->contents;
@ -2408,7 +2373,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
for (; ext_rel < ext_rel_end; ext_rel++, p += 4) for (; ext_rel < ext_rel_end; ext_rel++, p += 4)
{ {
struct internal_reloc int_rel; struct internal_reloc int_rel;
boolean text_relative; bfd_boolean text_relative;
mips_ecoff_swap_reloc_in (abfd, (PTR) ext_rel, &int_rel); mips_ecoff_swap_reloc_in (abfd, (PTR) ext_rel, &int_rel);
@ -2428,7 +2393,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
{ {
*errmsg = _("unsupported reloc type"); *errmsg = _("unsupported reloc type");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
if (int_rel.r_extern) if (int_rel.r_extern)
@ -2444,28 +2409,28 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
if ((h->root.type == bfd_link_hash_defined if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak) || h->root.type == bfd_link_hash_defweak)
&& (h->root.u.def.section->flags & SEC_CODE) != 0) && (h->root.u.def.section->flags & SEC_CODE) != 0)
text_relative = true; text_relative = TRUE;
else else
text_relative = false; text_relative = FALSE;
} }
else else
{ {
switch (int_rel.r_symndx) switch (int_rel.r_symndx)
{ {
case RELOC_SECTION_TEXT: case RELOC_SECTION_TEXT:
text_relative = true; text_relative = TRUE;
break; break;
case RELOC_SECTION_SDATA: case RELOC_SECTION_SDATA:
case RELOC_SECTION_SBSS: case RELOC_SECTION_SBSS:
case RELOC_SECTION_LIT8: case RELOC_SECTION_LIT8:
text_relative = false; text_relative = FALSE;
break; break;
default: default:
/* No other sections should appear in -membedded-pic /* No other sections should appear in -membedded-pic
code. */ code. */
*errmsg = _("reloc against unsupported section"); *errmsg = _("reloc against unsupported section");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
} }
@ -2473,7 +2438,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
{ {
*errmsg = _("reloc not properly aligned"); *errmsg = _("reloc not properly aligned");
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
bfd_put_32 (abfd, bfd_put_32 (abfd,
@ -2482,7 +2447,7 @@ bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
p); p);
} }
return true; return TRUE;
} }
/* This is the ECOFF backend structure. The backend field of the /* This is the ECOFF backend structure. The backend field of the
@ -2501,7 +2466,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
(unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */
mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out, mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
mips_ecoff_swap_scnhdr_out, mips_ecoff_swap_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, FALSE, 4, FALSE, 2,
mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in, mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in,
mips_ecoff_swap_scnhdr_in, NULL, mips_ecoff_swap_scnhdr_in, NULL,
mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
@ -2517,10 +2482,10 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
/* The page boundary used to align sections in a demand-paged /* The page boundary used to align sections in a demand-paged
executable file. E.g., 0x1000. */ executable file. E.g., 0x1000. */
0x1000, 0x1000,
/* True if the .rdata section is part of the text segment, as on the /* TRUE if the .rdata section is part of the text segment, as on the
Alpha. False if .rdata is part of the data segment, as on the Alpha. FALSE if .rdata is part of the data segment, as on the
MIPS. */ MIPS. */
false, FALSE,
/* Bitsize of constructor entries. */ /* Bitsize of constructor entries. */
32, 32,
/* Reloc to use for constructor entries. */ /* Reloc to use for constructor entries. */

View file

@ -27,11 +27,18 @@
#include "coff/internal.h" #include "coff/internal.h"
#include "libcoff.h" #include "libcoff.h"
static long get_symbol_value PARAMS ((asymbol *)); static long get_symbol_value
static bfd_reloc_status_type or32_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((asymbol *));
static boolean coff_or32_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); static bfd_reloc_status_type or32_reloc
static boolean coff_or32_adjust_symndx PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, struct internal_reloc *, boolean *)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); static bfd_boolean coff_or32_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **));
static bfd_boolean coff_or32_adjust_symndx
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
struct internal_reloc *, bfd_boolean *));
static void reloc_processing
PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
@ -52,14 +59,14 @@ static void reloc_processing PARAMS ((arelent *, str
/* Provided the symbol, returns the value reffed. */ /* Provided the symbol, returns the value reffed. */
static long static long
get_symbol_value (symbol) get_symbol_value (symbol)
asymbol *symbol; asymbol *symbol;
{ {
long relocation = 0; long relocation = 0;
if (bfd_is_com_section (symbol->section)) if (bfd_is_com_section (symbol->section))
relocation = 0; relocation = 0;
else else
relocation = symbol->value + relocation = symbol->value +
symbol->section->output_section->vma + symbol->section->output_section->vma +
symbol->section->output_offset; symbol->section->output_offset;
@ -82,7 +89,7 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
{ {
/* The consth relocation comes in two parts, we have to remember /* The consth relocation comes in two parts, we have to remember
the state between calls, in these variables. */ the state between calls, in these variables. */
static boolean part1_consth_active = false; static bfd_boolean part1_consth_active = FALSE;
static unsigned long part1_consth_value; static unsigned long part1_consth_value;
unsigned long insn; unsigned long insn;
@ -93,10 +100,10 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/ unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/
bfd_byte *hit_data =addr + (bfd_byte *)(data); bfd_byte *hit_data =addr + (bfd_byte *)(data);
r_type = reloc_entry->howto->type; r_type = reloc_entry->howto->type;
if (output_bfd) if (output_bfd)
{ {
/* Partial linking - do nothing. */ /* Partial linking - do nothing. */
reloc_entry->address += input_section->output_offset; reloc_entry->address += input_section->output_offset;
@ -107,18 +114,18 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
&& bfd_is_und_section (symbol_in->section)) && bfd_is_und_section (symbol_in->section))
{ {
/* Keep the state machine happy in case we're called again. */ /* Keep the state machine happy in case we're called again. */
if (r_type == R_IHIHALF) if (r_type == R_IHIHALF)
{ {
part1_consth_active = true; part1_consth_active = TRUE;
part1_consth_value = 0; part1_consth_value = 0;
} }
return bfd_reloc_undefined; return bfd_reloc_undefined;
} }
if ((part1_consth_active) && (r_type != R_IHCONST)) if ((part1_consth_active) && (r_type != R_IHCONST))
{ {
part1_consth_active = false; part1_consth_active = FALSE;
*error_message = (char *) "Missing IHCONST"; *error_message = (char *) "Missing IHCONST";
return bfd_reloc_dangerous; return bfd_reloc_dangerous;
@ -126,10 +133,10 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
sym_value = get_symbol_value (symbol_in); sym_value = get_symbol_value (symbol_in);
switch (r_type) switch (r_type)
{ {
case R_IREL: case R_IREL:
insn = bfd_get_32(abfd, hit_data); insn = bfd_get_32(abfd, hit_data);
/* Take the value in the field and sign extend it. */ /* Take the value in the field and sign extend it. */
signed_value = EXTRACT_JUMPTARG (insn); signed_value = EXTRACT_JUMPTARG (insn);
@ -146,8 +153,8 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
{ /* Absolute jmp/call. */ { /* Absolute jmp/call. */
insn |= (1<<24); /* Make it absolute. */ insn |= (1<<24); /* Make it absolute. */
/* FIXME: Should we change r_type to R_IABS. */ /* FIXME: Should we change r_type to R_IABS. */
} }
else else
#endif #endif
{ {
/* Relative jmp/call, so subtract from the value the /* Relative jmp/call, so subtract from the value the
@ -155,39 +162,39 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
signed_value -= (reloc_entry->address signed_value -= (reloc_entry->address
+ input_section->output_section->vma + input_section->output_section->vma
+ input_section->output_offset); + input_section->output_offset);
if (signed_value > 0x7ffffff || signed_value < -0x8000000) if (signed_value > 0x7ffffff || signed_value < -0x8000000)
return bfd_reloc_overflow; return bfd_reloc_overflow;
} }
signed_value >>= 2; signed_value >>= 2;
insn = INSERT_JUMPTARG (insn, signed_value); insn = INSERT_JUMPTARG (insn, signed_value);
bfd_put_32 (abfd, insn, hit_data); bfd_put_32 (abfd, insn, hit_data);
break; break;
case R_ILOHALF: case R_ILOHALF:
insn = bfd_get_32 (abfd, hit_data); insn = bfd_get_32 (abfd, hit_data);
unsigned_value = EXTRACT_HWORD (insn); unsigned_value = EXTRACT_HWORD (insn);
unsigned_value += sym_value + reloc_entry->addend; unsigned_value += sym_value + reloc_entry->addend;
insn = INSERT_HWORD (insn, unsigned_value); insn = INSERT_HWORD (insn, unsigned_value);
bfd_put_32 (abfd, insn, hit_data); bfd_put_32 (abfd, insn, hit_data);
break; break;
case R_IHIHALF: case R_IHIHALF:
insn = bfd_get_32 (abfd, hit_data); insn = bfd_get_32 (abfd, hit_data);
/* consth, part 1 /* consth, part 1
Just get the symbol value that is referenced. */ Just get the symbol value that is referenced. */
part1_consth_active = true; part1_consth_active = TRUE;
part1_consth_value = sym_value + reloc_entry->addend; part1_consth_value = sym_value + reloc_entry->addend;
/* Don't modify insn until R_IHCONST. */ /* Don't modify insn until R_IHCONST. */
break; break;
case R_IHCONST: case R_IHCONST:
insn = bfd_get_32 (abfd, hit_data); insn = bfd_get_32 (abfd, hit_data);
/* consth, part 2 /* consth, part 2
Now relocate the reference. */ Now relocate the reference. */
if (! part1_consth_active) if (! part1_consth_active)
{ {
*error_message = (char *) "Missing IHIHALF"; *error_message = (char *) "Missing IHIHALF";
return bfd_reloc_dangerous; return bfd_reloc_dangerous;
@ -199,29 +206,29 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
unsigned_value += part1_consth_value; unsigned_value += part1_consth_value;
unsigned_value = unsigned_value >> 16; unsigned_value = unsigned_value >> 16;
insn = INSERT_HWORD (insn, unsigned_value); insn = INSERT_HWORD (insn, unsigned_value);
part1_consth_active = false; part1_consth_active = FALSE;
bfd_put_32 (abfd, insn, hit_data); bfd_put_32 (abfd, insn, hit_data);
break; break;
case R_BYTE: case R_BYTE:
insn = bfd_get_8 (abfd, hit_data); insn = bfd_get_8 (abfd, hit_data);
unsigned_value = insn + sym_value + reloc_entry->addend; unsigned_value = insn + sym_value + reloc_entry->addend;
if (unsigned_value & 0xffffff00) if (unsigned_value & 0xffffff00)
return bfd_reloc_overflow; return bfd_reloc_overflow;
bfd_put_8 (abfd, unsigned_value, hit_data); bfd_put_8 (abfd, unsigned_value, hit_data);
break; break;
case R_HWORD: case R_HWORD:
insn = bfd_get_16 (abfd, hit_data); insn = bfd_get_16 (abfd, hit_data);
unsigned_value = insn + sym_value + reloc_entry->addend; unsigned_value = insn + sym_value + reloc_entry->addend;
if (unsigned_value & 0xffff0000) if (unsigned_value & 0xffff0000)
return bfd_reloc_overflow; return bfd_reloc_overflow;
bfd_put_16 (abfd, insn, hit_data); bfd_put_16 (abfd, insn, hit_data);
break; break;
case R_WORD: case R_WORD:
insn = bfd_get_32 (abfd, hit_data); insn = bfd_get_32 (abfd, hit_data);
insn += sym_value + reloc_entry->addend; insn += sym_value + reloc_entry->addend;
bfd_put_32 (abfd, insn, hit_data); bfd_put_32 (abfd, insn, hit_data);
break; break;
@ -242,14 +249,14 @@ or32_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
complain_on_overflow complain_on_overflow
special_function special_function
relocation name relocation name
partial_inplace partial_inplace
src_mask src_mask
*/ */
/* FIXME: I'm not real sure about this table. */ /* FIXME: I'm not real sure about this table. */
static reloc_howto_type howto_table[] = static reloc_howto_type howto_table[] =
{ {
{ R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield, or32_reloc, "ABS", true, 0xffffffff,0xffffffff, false }, { R_ABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "ABS", TRUE, 0xffffffff,0xffffffff, FALSE },
EMPTY_HOWTO (1), EMPTY_HOWTO (1),
EMPTY_HOWTO (2), EMPTY_HOWTO (2),
EMPTY_HOWTO (3), EMPTY_HOWTO (3),
@ -273,14 +280,14 @@ static reloc_howto_type howto_table[] =
EMPTY_HOWTO (21), EMPTY_HOWTO (21),
EMPTY_HOWTO (22), EMPTY_HOWTO (22),
EMPTY_HOWTO (23), EMPTY_HOWTO (23),
{ R_IREL, 0, 3, 32, true, 0, complain_overflow_signed, or32_reloc, "IREL", true, 0xffffffff,0xffffffff, false }, { R_IREL, 0, 3, 32, TRUE, 0, complain_overflow_signed, or32_reloc, "IREL", TRUE, 0xffffffff,0xffffffff, FALSE },
{ R_IABS, 0, 3, 32, false, 0, complain_overflow_bitfield, or32_reloc, "IABS", true, 0xffffffff,0xffffffff, false }, { R_IABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "IABS", TRUE, 0xffffffff,0xffffffff, FALSE },
{ R_ILOHALF, 0, 3, 16, true, 0, complain_overflow_signed, or32_reloc, "ILOHALF", true, 0x0000ffff,0x0000ffff, false }, { R_ILOHALF, 0, 3, 16, TRUE, 0, complain_overflow_signed, or32_reloc, "ILOHALF", TRUE, 0x0000ffff,0x0000ffff, FALSE },
{ R_IHIHALF, 0, 3, 16, true, 16,complain_overflow_signed, or32_reloc, "IHIHALF", true, 0xffff0000,0xffff0000, false }, { R_IHIHALF, 0, 3, 16, TRUE, 16,complain_overflow_signed, or32_reloc, "IHIHALF", TRUE, 0xffff0000,0xffff0000, FALSE },
{ R_IHCONST, 0, 3, 16, true, 0, complain_overflow_signed, or32_reloc, "IHCONST", true, 0xffff0000,0xffff0000, false }, { R_IHCONST, 0, 3, 16, TRUE, 0, complain_overflow_signed, or32_reloc, "IHCONST", TRUE, 0xffff0000,0xffff0000, FALSE },
{ R_BYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, or32_reloc, "BYTE", true, 0x000000ff,0x000000ff, false }, { R_BYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, or32_reloc, "BYTE", TRUE, 0x000000ff,0x000000ff, FALSE },
{ R_HWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, or32_reloc, "HWORD", true, 0x0000ffff,0x0000ffff, false }, { R_HWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, or32_reloc, "HWORD", TRUE, 0x0000ffff,0x0000ffff, FALSE },
{ R_WORD, 0, 2, 32, false, 0, complain_overflow_bitfield, or32_reloc, "WORD", true, 0xffffffff,0xffffffff, false }, { R_WORD, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "WORD", TRUE, 0xffffffff,0xffffffff, FALSE },
}; };
#define BADMAG(x) OR32BADMAG (x) #define BADMAG(x) OR32BADMAG (x)
@ -298,11 +305,11 @@ reloc_processing (relent,reloc, symbols, abfd, section)
{ {
static bfd_vma ihihalf_vaddr = (bfd_vma) -1; static bfd_vma ihihalf_vaddr = (bfd_vma) -1;
relent->address = reloc->r_vaddr; relent->address = reloc->r_vaddr;
relent->howto = howto_table + reloc->r_type; relent->howto = howto_table + reloc->r_type;
if (reloc->r_type == R_IHCONST) if (reloc->r_type == R_IHCONST)
{ {
/* The address of an R_IHCONST should always be the address of /* The address of an R_IHCONST should always be the address of
the immediately preceding R_IHIHALF. relocs generated by gas the immediately preceding R_IHIHALF. relocs generated by gas
are correct, but relocs generated by High C are different (I are correct, but relocs generated by High C are different (I
@ -336,7 +343,7 @@ reloc_processing (relent,reloc, symbols, abfd, section)
/* The reloc processing routine for the optimized COFF linker. */ /* The reloc processing routine for the optimized COFF linker. */
static boolean static bfd_boolean
coff_or32_relocate_section (output_bfd, info, input_bfd, input_section, coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, syms, sections) contents, relocs, syms, sections)
bfd *output_bfd ATTRIBUTE_UNUSED; bfd *output_bfd ATTRIBUTE_UNUSED;
@ -350,16 +357,16 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
struct internal_reloc *rel; struct internal_reloc *rel;
struct internal_reloc *relend; struct internal_reloc *relend;
boolean hihalf; bfd_boolean hihalf;
bfd_vma hihalf_val; bfd_vma hihalf_val;
/* If we are performing a relocateable link, we don't need to do a /* If we are performing a relocateable link, we don't need to do a
thing. The caller will take care of adjusting the reloc thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */ addresses and symbol indices. */
if (info->relocateable) if (info->relocateable)
return true; return TRUE;
hihalf = false; hihalf = FALSE;
hihalf_val = 0; hihalf_val = 0;
rel = relocs; rel = relocs;
@ -373,7 +380,7 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
struct internal_syment *sym; struct internal_syment *sym;
asection *sec; asection *sec;
bfd_vma val; bfd_vma val;
boolean overflow; bfd_boolean overflow;
unsigned long insn; unsigned long insn;
long signed_value; long signed_value;
unsigned long unsigned_value; unsigned long unsigned_value;
@ -424,8 +431,8 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true))) rel->r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
} }
} }
@ -434,18 +441,18 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->reloc_dangerous) if (! ((*info->callbacks->reloc_dangerous)
(info, "missing IHCONST reloc", input_bfd, (info, "missing IHCONST reloc", input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
hihalf = false; hihalf = FALSE;
} }
} }
overflow = false; overflow = FALSE;
switch (rel->r_type) switch (rel->r_type)
{ {
default: default:
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
case R_IREL: case R_IREL:
insn = bfd_get_32 (input_bfd, loc); insn = bfd_get_32 (input_bfd, loc);
@ -473,7 +480,7 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
+ (rel->r_vaddr - input_section->vma)); + (rel->r_vaddr - input_section->vma));
if (signed_value > 0x7ffffff || signed_value < - 0x8000000) if (signed_value > 0x7ffffff || signed_value < - 0x8000000)
{ {
overflow = true; overflow = TRUE;
signed_value = 0; signed_value = 0;
} }
} }
@ -495,7 +502,7 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
case R_IHIHALF: case R_IHIHALF:
/* Save the value for the R_IHCONST reloc. */ /* Save the value for the R_IHCONST reloc. */
hihalf = true; hihalf = TRUE;
hihalf_val = val; hihalf_val = val;
break; break;
@ -505,7 +512,7 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
if (! ((*info->callbacks->reloc_dangerous) if (! ((*info->callbacks->reloc_dangerous)
(info, "missing IHIHALF reloc", input_bfd, (info, "missing IHIHALF reloc", input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
hihalf_val = 0; hihalf_val = 0;
} }
@ -515,7 +522,7 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
insn = INSERT_HWORD (insn, unsigned_value); insn = INSERT_HWORD (insn, unsigned_value);
bfd_put_32 (input_bfd, (bfd_vma) insn, loc); bfd_put_32 (input_bfd, (bfd_vma) insn, loc);
hihalf = false; hihalf = FALSE;
break; break;
case R_BYTE: case R_BYTE:
@ -524,7 +531,7 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
rstat = _bfd_relocate_contents (howto_table + rel->r_type, rstat = _bfd_relocate_contents (howto_table + rel->r_type,
input_bfd, val, loc); input_bfd, val, loc);
if (rstat == bfd_reloc_overflow) if (rstat == bfd_reloc_overflow)
overflow = true; overflow = TRUE;
else if (rstat != bfd_reloc_ok) else if (rstat != bfd_reloc_ok)
abort (); abort ();
break; break;
@ -555,11 +562,11 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
(info, name, howto_table[rel->r_type].name, (bfd_vma) 0, (info, name, howto_table[rel->r_type].name, (bfd_vma) 0,
input_bfd, input_section, input_bfd, input_section,
rel->r_vaddr - input_section->vma))) rel->r_vaddr - input_section->vma)))
return false; return FALSE;
} }
} }
return true; return TRUE;
} }
#define coff_relocate_section coff_or32_relocate_section #define coff_relocate_section coff_or32_relocate_section
@ -567,20 +574,20 @@ coff_or32_relocate_section (output_bfd, info, input_bfd, input_section,
/* We don't want to change the symndx of a R_IHCONST reloc, since it /* We don't want to change the symndx of a R_IHCONST reloc, since it
is actually an addend, not a symbol index at all. */ is actually an addend, not a symbol index at all. */
static boolean static bfd_boolean
coff_or32_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) coff_or32_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
bfd *obfd ATTRIBUTE_UNUSED; bfd *obfd ATTRIBUTE_UNUSED;
struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED;
bfd *ibfd ATTRIBUTE_UNUSED; bfd *ibfd ATTRIBUTE_UNUSED;
asection *sec ATTRIBUTE_UNUSED; asection *sec ATTRIBUTE_UNUSED;
struct internal_reloc *irel; struct internal_reloc *irel;
boolean *adjustedp; bfd_boolean *adjustedp;
{ {
if (irel->r_type == R_IHCONST) if (irel->r_type == R_IHCONST)
*adjustedp = true; *adjustedp = TRUE;
else else
*adjustedp = false; *adjustedp = FALSE;
return true; return TRUE;
} }
#define coff_adjust_symndx coff_or32_adjust_symndx #define coff_adjust_symndx coff_or32_adjust_symndx
@ -599,7 +606,7 @@ const bfd_target or32coff_big_vec =
HAS_SYMS | HAS_LOCALS | WP_TEXT), HAS_SYMS | HAS_LOCALS | WP_TEXT),
(SEC_HAS_CONTENTS | SEC_ALLOC | /* Section flags. */ (SEC_HAS_CONTENTS | SEC_ALLOC | /* Section flags. */
SEC_LOAD | SEC_RELOC | SEC_LOAD | SEC_RELOC |
SEC_READONLY ), SEC_READONLY ),
'_', /* Leading underscore. */ '_', /* Leading underscore. */
'/', /* ar_pad_char. */ '/', /* ar_pad_char. */
@ -615,7 +622,7 @@ const bfd_target or32coff_big_vec =
bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, bfd_getb16, bfd_getb_signed_16, bfd_putb16,
{ {
_bfd_dummy_target, _bfd_dummy_target,
coff_object_p, coff_object_p,
bfd_generic_archive_p, bfd_generic_archive_p,
@ -643,7 +650,7 @@ const bfd_target or32coff_big_vec =
BFD_JUMP_TABLE_WRITE (coff), BFD_JUMP_TABLE_WRITE (coff),
BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_LINK (coff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
/* Alternative_target. */ /* Alternative_target. */
#ifdef TARGET_LITTLE_SYM #ifdef TARGET_LITTLE_SYM
& TARGET_LITTLE_SYM, & TARGET_LITTLE_SYM,

View file

@ -54,7 +54,7 @@ Boston, MA 02111-1307, USA. */
/* This file is compiled more than once, but we only compile the /* This file is compiled more than once, but we only compile the
final_link routine once. */ final_link routine once. */
extern boolean ppc_bfd_coff_final_link extern bfd_boolean ppc_bfd_coff_final_link
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
extern void dump_toc PARAMS ((PTR)); extern void dump_toc PARAMS ((PTR));
@ -128,14 +128,14 @@ struct ppc_coff_link_hash_table
static struct bfd_hash_entry *ppc_coff_link_hash_newfunc static struct bfd_hash_entry *ppc_coff_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
const char *)); const char *));
static boolean ppc_coff_link_hash_table_init static bfd_boolean ppc_coff_link_hash_table_init
PARAMS ((struct ppc_coff_link_hash_table *, bfd *, PARAMS ((struct ppc_coff_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *, struct bfd_hash_table *,
const char *))); const char *)));
static struct bfd_link_hash_table *ppc_coff_link_hash_table_create static struct bfd_link_hash_table *ppc_coff_link_hash_table_create
PARAMS ((bfd *)); PARAMS ((bfd *));
static boolean coff_ppc_relocate_section static bfd_boolean coff_ppc_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **)); struct internal_reloc *, struct internal_syment *, asection **));
static reloc_howto_type *coff_ppc_rtype_to_howto static reloc_howto_type *coff_ppc_rtype_to_howto
@ -184,7 +184,7 @@ ppc_coff_link_hash_newfunc (entry, table, string)
/* Initialize a PE linker hash table. */ /* Initialize a PE linker hash table. */
static boolean static bfd_boolean
ppc_coff_link_hash_table_init (table, abfd, newfunc) ppc_coff_link_hash_table_init (table, abfd, newfunc)
struct ppc_coff_link_hash_table *table; struct ppc_coff_link_hash_table *table;
bfd *abfd; bfd *abfd;
@ -385,7 +385,7 @@ static bfd_reloc_status_type ppc_imglue_reloc PARAMS ((bfd *abfd,
bfd *output_bfd, bfd *output_bfd,
char **error)); char **error));
static boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto)); static bfd_boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto));
/* FIXME: It'll take a while to get through all of these. I only need a few to /* FIXME: It'll take a while to get through all of these. I only need a few to
get us started, so those I'll make sure work. Those marked FIXME are either get us started, so those I'll make sure work. Those marked FIXME are either
@ -433,15 +433,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */ 0, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* dont complain_on_overflow */ complain_overflow_dont, /* dont complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ABSOLUTE", /* name */ "ABSOLUTE", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0x00, /* src_mask */ 0x00, /* src_mask */
0x00, /* dst_mask */ 0x00, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR64 0x0001 64-bit address */ /* IMAGE_REL_PPC_ADDR64 0x0001 64-bit address */
/* Unused: */ /* Unused: */
@ -449,15 +449,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
3, /* size (0 = byte, 1 = short, 2 = long) */ 3, /* size (0 = byte, 1 = short, 2 = long) */
64, /* bitsize */ 64, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ADDR64", /* name */ "ADDR64", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
MINUS_ONE, /* src_mask */ MINUS_ONE, /* src_mask */
MINUS_ONE, /* dst_mask */ MINUS_ONE, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR32 0x0002 32-bit address */ /* IMAGE_REL_PPC_ADDR32 0x0002 32-bit address */
/* Used: */ /* Used: */
@ -465,15 +465,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ADDR32", /* name */ "ADDR32", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR24 0x0003 26-bit address, shifted left 2 (branch absolute) */ /* IMAGE_REL_PPC_ADDR24 0x0003 26-bit address, shifted left 2 (branch absolute) */
/* the LI field is in bit 6 through bit 29 is 24 bits, + 2 for the shift */ /* the LI field is in bit 6 through bit 29 is 24 bits, + 2 for the shift */
@ -484,15 +484,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */ 26, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ADDR24", /* name */ "ADDR24", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x07fffffc, /* src_mask */ 0x07fffffc, /* src_mask */
0x07fffffc, /* dst_mask */ 0x07fffffc, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR16 0x0004 16-bit address */ /* IMAGE_REL_PPC_ADDR16 0x0004 16-bit address */
/* Used: */ /* Used: */
@ -500,15 +500,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ADDR16", /* name */ "ADDR16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR14 0x0005 */ /* IMAGE_REL_PPC_ADDR14 0x0005 */
/* 16-bit address, shifted left 2 (load doubleword) */ /* 16-bit address, shifted left 2 (load doubleword) */
@ -518,15 +518,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
1, /* rightshift */ 1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ADDR16", /* name */ "ADDR16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_REL24 0x0006 */ /* IMAGE_REL_PPC_REL24 0x0006 */
/* 26-bit PC-relative offset, shifted left 2 (branch relative) */ /* 26-bit PC-relative offset, shifted left 2 (branch relative) */
@ -535,15 +535,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */ 26, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"REL24", /* name */ "REL24", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x3fffffc, /* src_mask */ 0x3fffffc, /* src_mask */
0x3fffffc, /* dst_mask */ 0x3fffffc, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_REL14 0x0007 */ /* IMAGE_REL_PPC_REL14 0x0007 */
/* 16-bit PC-relative offset, shifted left 2 (br cond relative) */ /* 16-bit PC-relative offset, shifted left 2 (br cond relative) */
@ -554,15 +554,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
1, /* rightshift */ 1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ADDR16", /* name */ "ADDR16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* IMAGE_REL_PPC_TOCREL16 0x0008 */ /* IMAGE_REL_PPC_TOCREL16 0x0008 */
/* 16-bit offset from TOC base */ /* 16-bit offset from TOC base */
@ -571,15 +571,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
ppc_toc16_reloc, /* special_function */ ppc_toc16_reloc, /* special_function */
"TOCREL16", /* name */ "TOCREL16", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_TOCREL14 0x0009 */ /* IMAGE_REL_PPC_TOCREL14 0x0009 */
/* 16-bit offset from TOC base, shifted left 2 (load doubleword) */ /* 16-bit offset from TOC base, shifted left 2 (load doubleword) */
@ -588,15 +588,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
1, /* rightshift */ 1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"TOCREL14", /* name */ "TOCREL14", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR32NB 0x000A */ /* IMAGE_REL_PPC_ADDR32NB 0x000A */
/* 32-bit addr w/ image base */ /* 32-bit addr w/ image base */
@ -605,15 +605,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"ADDR32NB", /* name */ "ADDR32NB", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_SECREL 0x000B */ /* IMAGE_REL_PPC_SECREL 0x000B */
/* va of containing section (as in an image sectionhdr) */ /* va of containing section (as in an image sectionhdr) */
@ -622,15 +622,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
ppc_secrel_reloc, /* special_function */ ppc_secrel_reloc, /* special_function */
"SECREL", /* name */ "SECREL", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* IMAGE_REL_PPC_SECTION 0x000C */ /* IMAGE_REL_PPC_SECTION 0x000C */
/* sectionheader number */ /* sectionheader number */
@ -639,15 +639,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
ppc_section_reloc, /* special_function */ ppc_section_reloc, /* special_function */
"SECTION", /* name */ "SECTION", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* IMAGE_REL_PPC_IFGLUE 0x000D */ /* IMAGE_REL_PPC_IFGLUE 0x000D */
/* substitute TOC restore instruction iff symbol is glue code */ /* substitute TOC restore instruction iff symbol is glue code */
@ -656,15 +656,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"IFGLUE", /* name */ "IFGLUE", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_IMGLUE 0x000E */ /* IMAGE_REL_PPC_IMGLUE 0x000E */
/* symbol is glue code; virtual address is TOC restore instruction */ /* symbol is glue code; virtual address is TOC restore instruction */
@ -673,15 +673,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
ppc_imglue_reloc, /* special_function */ ppc_imglue_reloc, /* special_function */
"IMGLUE", /* name */ "IMGLUE", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_SECREL16 0x000F */ /* IMAGE_REL_PPC_SECREL16 0x000F */
/* va of containing section (limited to 16 bits) */ /* va of containing section (limited to 16 bits) */
@ -690,15 +690,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"SECREL16", /* name */ "SECREL16", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
/* IMAGE_REL_PPC_REFHI 0x0010 */ /* IMAGE_REL_PPC_REFHI 0x0010 */
/* Unused: */ /* Unused: */
@ -706,15 +706,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
ppc_refhi_reloc, /* special_function */ ppc_refhi_reloc, /* special_function */
"REFHI", /* name */ "REFHI", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_REFLO 0x0011 */ /* IMAGE_REL_PPC_REFLO 0x0011 */
/* Unused: */ /* Unused: */
@ -722,15 +722,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
ppc_refhi_reloc, /* special_function */ ppc_refhi_reloc, /* special_function */
"REFLO", /* name */ "REFLO", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_PAIR 0x0012 */ /* IMAGE_REL_PPC_PAIR 0x0012 */
/* Unused: */ /* Unused: */
@ -738,15 +738,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
ppc_pair_reloc, /* special_function */ ppc_pair_reloc, /* special_function */
"PAIR", /* name */ "PAIR", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 */ /* IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 */
/* 16-bit offset from TOC base, without causing a definition */ /* 16-bit offset from TOC base, without causing a definition */
@ -755,15 +755,15 @@ static reloc_howto_type ppc_coff_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */ 0, /* special_function */
"TOCREL16, TOCDEFN", /* name */ "TOCREL16, TOCDEFN", /* name */
false, /* partial_inplace */ FALSE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
}; };
@ -884,13 +884,13 @@ record_toc (toc_section, our_toc_offset, cat, name)
#ifdef COFF_IMAGE_WITH_PE #ifdef COFF_IMAGE_WITH_PE
static boolean ppc_record_toc_entry static bfd_boolean ppc_record_toc_entry
PARAMS ((bfd *, struct bfd_link_info *, asection *, int, enum toc_type)); PARAMS ((bfd *, struct bfd_link_info *, asection *, int, enum toc_type));
static void ppc_mark_symbol_as_glue static void ppc_mark_symbol_as_glue
PARAMS ((bfd *, int, struct internal_reloc *)); PARAMS ((bfd *, int, struct internal_reloc *));
/* record a toc offset against a symbol */ /* record a toc offset against a symbol */
static boolean static bfd_boolean
ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED;
@ -922,7 +922,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
amt = (bfd_size_type) obj_raw_syment_count (abfd) * sizeof (int); amt = (bfd_size_type) obj_raw_syment_count (abfd) * sizeof (int);
local_syms = (int *) bfd_zalloc (abfd, amt); local_syms = (int *) bfd_zalloc (abfd, amt);
if (local_syms == 0) if (local_syms == 0)
return false; return FALSE;
obj_coff_local_toc_table (abfd) = local_syms; obj_coff_local_toc_table (abfd) = local_syms;
for (i = 0; i < obj_raw_syment_count (abfd); ++i) for (i = 0; i < obj_raw_syment_count (abfd); ++i)
{ {
@ -940,7 +940,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
{ {
(*_bfd_error_handler) (_("TOC overflow")); (*_bfd_error_handler) (_("TOC overflow"));
bfd_set_error (bfd_error_file_too_big); bfd_set_error (bfd_error_file_too_big);
return false; return FALSE;
} }
} }
} }
@ -960,12 +960,12 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind)
{ {
(*_bfd_error_handler) (_("TOC overflow")); (*_bfd_error_handler) (_("TOC overflow"));
bfd_set_error (bfd_error_file_too_big); bfd_set_error (bfd_error_file_too_big);
return false; return FALSE;
} }
} }
} }
return true; return TRUE;
} }
/* record a toc offset against a symbol */ /* record a toc offset against a symbol */
@ -989,10 +989,10 @@ ppc_mark_symbol_as_glue(abfd, sym, rel)
#endif /* COFF_IMAGE_WITH_PE */ #endif /* COFF_IMAGE_WITH_PE */
/* Return true if this relocation should /* Return TRUE if this relocation should
appear in the output .reloc section. */ appear in the output .reloc section. */
static boolean in_reloc_p(abfd, howto) static bfd_boolean in_reloc_p(abfd, howto)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
reloc_howto_type *howto; reloc_howto_type *howto;
{ {
@ -1030,7 +1030,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
{ {
/* the consth relocation comes in two parts, we have to remember /* the consth relocation comes in two parts, we have to remember
the state between calls, in these variables */ the state between calls, in these variables */
static boolean part1_consth_active = false; static bfd_boolean part1_consth_active = FALSE;
static unsigned long part1_consth_value; static unsigned long part1_consth_value;
unsigned long sym_value; unsigned long sym_value;
@ -1052,7 +1052,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
/* Keep the state machine happy in case we're called again */ /* Keep the state machine happy in case we're called again */
if (r_type == IMAGE_REL_PPC_REFHI) if (r_type == IMAGE_REL_PPC_REFHI)
{ {
part1_consth_active = true; part1_consth_active = TRUE;
part1_consth_value = 0; part1_consth_value = 0;
} }
return(bfd_reloc_undefined); return(bfd_reloc_undefined);
@ -1060,7 +1060,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR)) if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR))
{ {
part1_consth_active = false; part1_consth_active = FALSE;
*error_message = (char *) _("Missing PAIR"); *error_message = (char *) _("Missing PAIR");
return(bfd_reloc_dangerous); return(bfd_reloc_dangerous);
} }
@ -1074,7 +1074,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd,
/* The reloc processing routine for the optimized COFF linker. */ /* The reloc processing routine for the optimized COFF linker. */
static boolean static bfd_boolean
coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
contents, relocs, syms, sections) contents, relocs, syms, sections)
bfd *output_bfd; bfd *output_bfd;
@ -1088,7 +1088,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
struct internal_reloc *rel; struct internal_reloc *rel;
struct internal_reloc *relend; struct internal_reloc *relend;
boolean hihalf; bfd_boolean hihalf;
bfd_vma hihalf_val; bfd_vma hihalf_val;
asection *toc_section = 0; asection *toc_section = 0;
bfd_vma relocation; bfd_vma relocation;
@ -1098,9 +1098,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
thing. The caller will take care of adjusting the reloc thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */ addresses and symbol indices. */
if (info->relocateable) if (info->relocateable)
return true; return TRUE;
hihalf = false; hihalf = FALSE;
hihalf_val = 0; hihalf_val = 0;
rel = relocs; rel = relocs;
@ -1182,8 +1182,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd, input_section, (info, h->root.root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true))) rel->r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
} }
} }
@ -1197,7 +1197,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
(_("%s: unsupported relocation type 0x%02x"), (_("%s: unsupported relocation type 0x%02x"),
bfd_archive_filename (input_bfd), r_type); bfd_archive_filename (input_bfd), r_type);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
case IMAGE_REL_PPC_TOCREL16: case IMAGE_REL_PPC_TOCREL16:
{ {
bfd_signed_vma our_toc_offset; bfd_signed_vma our_toc_offset;
@ -1224,7 +1224,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
* the 1 bit to tell us if we've written this particular toc * the 1 bit to tell us if we've written this particular toc
* entry out. * entry out.
*/ */
fixit = false; fixit = FALSE;
if (h == 0) if (h == 0)
{ /* it is a file local symbol */ { /* it is a file local symbol */
int *local_toc_table; int *local_toc_table;
@ -1254,7 +1254,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
toc_section->contents + our_toc_offset); toc_section->contents + our_toc_offset);
MARK_AS_WRITTEN(local_toc_table[symndx]); MARK_AS_WRITTEN(local_toc_table[symndx]);
fixit = true; fixit = TRUE;
} }
} }
else else
@ -1291,7 +1291,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_archive_filename (input_bfd), name, bfd_archive_filename (input_bfd), name,
(unsigned long) our_toc_offset); (unsigned long) our_toc_offset);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
record_toc (toc_section, our_toc_offset, pub, record_toc (toc_section, our_toc_offset, pub,
@ -1317,7 +1317,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
MARK_AS_WRITTEN(h->toc_offset); MARK_AS_WRITTEN(h->toc_offset);
/* The tricky part is that this is the address that */ /* The tricky part is that this is the address that */
/* needs a .reloc entry for it */ /* needs a .reloc entry for it */
fixit = true; fixit = TRUE;
} }
} }
@ -1348,7 +1348,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_archive_filename (input_bfd), bfd_archive_filename (input_bfd),
(unsigned long) toc_section->_raw_size); (unsigned long) toc_section->_raw_size);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
/* Now we know the relocation for this toc reference */ /* Now we know the relocation for this toc reference */
@ -1423,7 +1423,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
(_("%s: Out of order IMGLUE reloc for %s"), (_("%s: Out of order IMGLUE reloc for %s"),
bfd_archive_filename (input_bfd), my_name); bfd_archive_filename (input_bfd), my_name);
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
return false; return FALSE;
} }
case IMAGE_REL_PPC_ADDR32NB: case IMAGE_REL_PPC_ADDR32NB:
@ -1438,7 +1438,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
struct coff_link_hash_entry *myh; struct coff_link_hash_entry *myh;
myh = coff_link_hash_lookup (coff_hash_table (info), myh = coff_link_hash_lookup (coff_hash_table (info),
"__idata5_magic__", "__idata5_magic__",
false, false, true); FALSE, FALSE, TRUE);
first_thunk_address = myh->root.u.def.value + first_thunk_address = myh->root.u.def.value +
sec->output_section->vma + sec->output_section->vma +
sec->output_offset - sec->output_offset -
@ -1447,12 +1447,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
idata5offset = myh->root.u.def.value; idata5offset = myh->root.u.def.value;
myh = coff_link_hash_lookup (coff_hash_table (info), myh = coff_link_hash_lookup (coff_hash_table (info),
"__idata6_magic__", "__idata6_magic__",
false, false, true); FALSE, FALSE, TRUE);
thunk_size = myh->root.u.def.value - idata5offset; thunk_size = myh->root.u.def.value - idata5offset;
myh = coff_link_hash_lookup (coff_hash_table (info), myh = coff_link_hash_lookup (coff_hash_table (info),
"__idata4_magic__", "__idata4_magic__",
false, false, true); FALSE, FALSE, TRUE);
import_table_size = myh->root.u.def.value; import_table_size = myh->root.u.def.value;
} }
@ -1479,7 +1479,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
myh = coff_link_hash_lookup (coff_hash_table (info), myh = coff_link_hash_lookup (coff_hash_table (info),
target, target,
false, false, true); FALSE, FALSE, TRUE);
if (myh == 0) if (myh == 0)
{ {
/* Missing magic cookies. Something is very wrong. */ /* Missing magic cookies. Something is very wrong. */
@ -1493,7 +1493,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
int idata5offset; int idata5offset;
myh = coff_link_hash_lookup (coff_hash_table (info), myh = coff_link_hash_lookup (coff_hash_table (info),
"__idata5_magic__", "__idata5_magic__",
false, false, true); FALSE, FALSE, TRUE);
first_thunk_address = myh->root.u.def.value + first_thunk_address = myh->root.u.def.value +
sec->output_section->vma + sec->output_section->vma +
sec->output_offset - sec->output_offset -
@ -1502,12 +1502,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
idata5offset = myh->root.u.def.value; idata5offset = myh->root.u.def.value;
myh = coff_link_hash_lookup (coff_hash_table (info), myh = coff_link_hash_lookup (coff_hash_table (info),
"__idata6_magic__", "__idata6_magic__",
false, false, true); FALSE, FALSE, TRUE);
thunk_size = myh->root.u.def.value - idata5offset; thunk_size = myh->root.u.def.value - idata5offset;
myh = coff_link_hash_lookup (coff_hash_table (info), myh = coff_link_hash_lookup (coff_hash_table (info),
"__idata4_magic__", "__idata4_magic__",
false, false, true); FALSE, FALSE, TRUE);
import_table_size = myh->root.u.def.value; import_table_size = myh->root.u.def.value;
} }
} }
@ -1596,14 +1596,14 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
(bfd_vma) 0, input_bfd, (bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
{ {
return false; return FALSE;
} }
} }
} }
} }
return true; return TRUE;
} }
#ifdef COFF_IMAGE_WITH_PE #ifdef COFF_IMAGE_WITH_PE
@ -1677,7 +1677,7 @@ dump_toc (vfile)
fprintf (file, "\n"); fprintf (file, "\n");
} }
boolean bfd_boolean
ppc_allocate_toc_section (info) ppc_allocate_toc_section (info)
struct bfd_link_info *info ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED;
{ {
@ -1687,7 +1687,7 @@ ppc_allocate_toc_section (info)
static char test_char = '1'; static char test_char = '1';
if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */ if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */
return true; return TRUE;
if (bfd_of_toc_owner == 0) if (bfd_of_toc_owner == 0)
{ {
@ -1709,10 +1709,10 @@ ppc_allocate_toc_section (info)
s->_raw_size = s->_cooked_size = global_toc_size; s->_raw_size = s->_cooked_size = global_toc_size;
s->contents = foo; s->contents = foo;
return true; return TRUE;
} }
boolean bfd_boolean
ppc_process_before_allocation (abfd, info) ppc_process_before_allocation (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
@ -1730,7 +1730,7 @@ ppc_process_before_allocation (abfd, info)
if (sec == 0) if (sec == 0)
{ {
return true; return TRUE;
} }
for (; sec != 0; sec = sec->next) for (; sec != 0; sec = sec->next)
@ -1749,7 +1749,7 @@ ppc_process_before_allocation (abfd, info)
{ {
unsigned short r_type = EXTRACT_TYPE (rel->r_type); unsigned short r_type = EXTRACT_TYPE (rel->r_type);
unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); unsigned short r_flags = EXTRACT_FLAGS(rel->r_type);
boolean ok = true; bfd_boolean ok = TRUE;
DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel); DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel);
@ -1762,7 +1762,7 @@ ppc_process_before_allocation (abfd, info)
ok = ppc_record_toc_entry(abfd, info, sec, ok = ppc_record_toc_entry(abfd, info, sec,
rel->r_symndx, default_toc); rel->r_symndx, default_toc);
if (!ok) if (!ok)
return false; return FALSE;
break; break;
case IMAGE_REL_PPC_IMGLUE: case IMAGE_REL_PPC_IMGLUE:
ppc_mark_symbol_as_glue(abfd, rel->r_symndx, rel); ppc_mark_symbol_as_glue(abfd, rel->r_symndx, rel);
@ -1773,7 +1773,7 @@ ppc_process_before_allocation (abfd, info)
} }
} }
return true; return TRUE;
} }
#endif #endif
@ -2278,17 +2278,17 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1)
#ifndef COFF_IMAGE_WITH_PE #ifndef COFF_IMAGE_WITH_PE
static boolean ppc_do_last PARAMS ((bfd *)); static bfd_boolean ppc_do_last PARAMS ((bfd *));
static bfd *ppc_get_last PARAMS ((void)); static bfd *ppc_get_last PARAMS ((void));
static boolean static bfd_boolean
ppc_do_last (abfd) ppc_do_last (abfd)
bfd *abfd; bfd *abfd;
{ {
if (abfd == bfd_of_toc_owner) if (abfd == bfd_of_toc_owner)
return true; return TRUE;
else else
return false; return FALSE;
} }
static bfd * static bfd *
@ -2311,14 +2311,14 @@ ppc_get_last()
/* Do the final link step. */ /* Do the final link step. */
boolean bfd_boolean
ppc_bfd_coff_final_link (abfd, info) ppc_bfd_coff_final_link (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info; struct bfd_link_info *info;
{ {
bfd_size_type symesz; bfd_size_type symesz;
struct coff_final_link_info finfo; struct coff_final_link_info finfo;
boolean debug_merge_allocated; bfd_boolean debug_merge_allocated;
asection *o; asection *o;
struct bfd_link_order *p; struct bfd_link_order *p;
bfd_size_type max_sym_count; bfd_size_type max_sym_count;
@ -2351,7 +2351,7 @@ ppc_bfd_coff_final_link (abfd, info)
finfo.contents = NULL; finfo.contents = NULL;
finfo.external_relocs = NULL; finfo.external_relocs = NULL;
finfo.internal_relocs = NULL; finfo.internal_relocs = NULL;
debug_merge_allocated = false; debug_merge_allocated = FALSE;
coff_data (abfd)->link_info = info; coff_data (abfd)->link_info = info;
@ -2361,13 +2361,13 @@ ppc_bfd_coff_final_link (abfd, info)
if (! coff_debug_merge_hash_table_init (&finfo.debug_merge)) if (! coff_debug_merge_hash_table_init (&finfo.debug_merge))
goto error_return; goto error_return;
debug_merge_allocated = true; debug_merge_allocated = TRUE;
/* Compute the file positions for all the sections. */ /* Compute the file positions for all the sections. */
if (! abfd->output_has_begun) if (! abfd->output_has_begun)
{ {
if (! bfd_coff_compute_section_file_positions (abfd)) if (! bfd_coff_compute_section_file_positions (abfd))
return false; return FALSE;
} }
/* Count the line numbers and relocation entries required for the /* Count the line numbers and relocation entries required for the
@ -2395,7 +2395,7 @@ ppc_bfd_coff_final_link (abfd, info)
link. This will normally be every section. We need link. This will normally be every section. We need
to do this so that we can identify any sections which to do this so that we can identify any sections which
the linker has decided to not include. */ the linker has decided to not include. */
sec->linker_mark = true; sec->linker_mark = TRUE;
if (info->strip == strip_none if (info->strip == strip_none
|| info->strip == strip_some) || info->strip == strip_some)
@ -2509,7 +2509,7 @@ ppc_bfd_coff_final_link (abfd, info)
{ {
bfd_size_type sz; bfd_size_type sz;
sub->output_has_begun = false; sub->output_has_begun = FALSE;
sz = obj_raw_syment_count (sub); sz = obj_raw_syment_count (sub);
if (sz > max_sym_count) if (sz > max_sym_count)
max_sym_count = sz; max_sym_count = sz;
@ -2575,7 +2575,7 @@ ppc_bfd_coff_final_link (abfd, info)
{ {
if (! _bfd_coff_link_input_bfd (&finfo, sub)) if (! _bfd_coff_link_input_bfd (&finfo, sub))
goto error_return; goto error_return;
sub->output_has_begun = true; sub->output_has_begun = TRUE;
} }
} }
else if (p->type == bfd_section_reloc_link_order else if (p->type == bfd_section_reloc_link_order
@ -2600,14 +2600,14 @@ ppc_bfd_coff_final_link (abfd, info)
if (! _bfd_coff_link_input_bfd (&finfo, last_one)) if (! _bfd_coff_link_input_bfd (&finfo, last_one))
goto error_return; goto error_return;
} }
last_one->output_has_begun = true; last_one->output_has_begun = TRUE;
} }
#endif #endif
/* Free up the buffers used by _bfd_coff_link_input_bfd. */ /* Free up the buffers used by _bfd_coff_link_input_bfd. */
coff_debug_merge_hash_table_free (&finfo.debug_merge); coff_debug_merge_hash_table_free (&finfo.debug_merge);
debug_merge_allocated = false; debug_merge_allocated = FALSE;
if (finfo.internal_syms != NULL) if (finfo.internal_syms != NULL)
{ {
@ -2659,11 +2659,11 @@ ppc_bfd_coff_final_link (abfd, info)
pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz; pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz;
if (bfd_seek (abfd, pos, SEEK_SET) != 0 if (bfd_seek (abfd, pos, SEEK_SET) != 0
|| bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz) || bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz)
return false; return FALSE;
} }
/* Write out the global symbols. */ /* Write out the global symbols. */
finfo.failed = false; finfo.failed = FALSE;
coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym, coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym,
(PTR) &finfo); (PTR) &finfo);
if (finfo.failed) if (finfo.failed)
@ -2740,7 +2740,7 @@ ppc_bfd_coff_final_link (abfd, info)
if (coff_hash_table (info)->stab_info != NULL) if (coff_hash_table (info)->stab_info != NULL)
{ {
if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info)) if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info))
return false; return FALSE;
} }
/* Write out the string table. */ /* Write out the string table. */
@ -2750,7 +2750,7 @@ ppc_bfd_coff_final_link (abfd, info)
pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz; pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz;
if (bfd_seek (abfd, pos, SEEK_SET) != 0) if (bfd_seek (abfd, pos, SEEK_SET) != 0)
return false; return FALSE;
#if STRING_SIZE_SIZE == 4 #if STRING_SIZE_SIZE == 4
H_PUT_32 (abfd, H_PUT_32 (abfd,
@ -2762,10 +2762,10 @@ ppc_bfd_coff_final_link (abfd, info)
if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd) if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd)
!= STRING_SIZE_SIZE) != STRING_SIZE_SIZE)
return false; return FALSE;
if (! _bfd_stringtab_emit (abfd, finfo.strtab)) if (! _bfd_stringtab_emit (abfd, finfo.strtab))
return false; return FALSE;
} }
_bfd_stringtab_free (finfo.strtab); _bfd_stringtab_free (finfo.strtab);
@ -2774,7 +2774,7 @@ ppc_bfd_coff_final_link (abfd, info)
not try to write out the symbols. */ not try to write out the symbols. */
bfd_get_symcount (abfd) = 0; bfd_get_symcount (abfd) = 0;
return true; return TRUE;
error_return: error_return:
if (debug_merge_allocated) if (debug_merge_allocated)
@ -2812,7 +2812,7 @@ ppc_bfd_coff_final_link (abfd, info)
free (finfo.internal_relocs); free (finfo.internal_relocs);
if (external_relocs != NULL) if (external_relocs != NULL)
free (external_relocs); free (external_relocs);
return false; return FALSE;
} }
#endif #endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
/* BFD back-end for Sparc COFF files. /* BFD back-end for Sparc COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Cygnus Support. Written by Cygnus Support.
@ -103,30 +103,30 @@ bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section,
static reloc_howto_type coff_sparc_howto_table[] = static reloc_howto_type coff_sparc_howto_table[] =
{ {
HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", false,0,0x000000ff,true), HOWTO(R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", FALSE,0,0x000000ff,TRUE),
HOWTO(R_SPARC_16, 0,1,16,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16", false,0,0x0000ffff,true), HOWTO(R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16", FALSE,0,0x0000ffff,TRUE),
HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32", false,0,0xffffffff,true), HOWTO(R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32", FALSE,0,0xffffffff,TRUE),
HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP8", false,0,0x000000ff,true), HOWTO(R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE),
HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP16", false,0,0x0000ffff,true), HOWTO(R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE),
HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP32", false,0,0x00ffffff,true), HOWTO(R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP32", FALSE,0,0x00ffffff,TRUE),
HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP30", false,0,0x3fffffff,true), HOWTO(R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE),
HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP22", false,0,0x003fffff,true), HOWTO(R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_HI22", false,0,0x003fffff,true), HOWTO(R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_HI22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_22, 0,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_22", false,0,0x003fffff,true), HOWTO(R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_13, 0,2,13,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_13", false,0,0x00001fff,true), HOWTO(R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_13", FALSE,0,0x00001fff,TRUE),
HOWTO(R_SPARC_LO10, 0,2,10,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_LO10", false,0,0x000003ff,true), HOWTO(R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_LO10", FALSE,0,0x000003ff,TRUE),
HOWTO(R_SPARC_GOT10, 0,2,10,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT10", false,0,0x000003ff,true), HOWTO(R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE),
HOWTO(R_SPARC_GOT13, 0,2,13,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT13", false,0,0x00001fff,true), HOWTO(R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE),
HOWTO(R_SPARC_GOT22, 10,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT22", false,0,0x003fffff,true), HOWTO(R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_PC10, 0,2,10,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC10", false,0,0x000003ff,true), HOWTO(R_SPARC_PC10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC10", FALSE,0,0x000003ff,TRUE),
HOWTO(R_SPARC_PC22, 0,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC22", false,0,0x003fffff,true), HOWTO(R_SPARC_PC22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_WPLT30, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_WPLT30", false,0,0x00000000,true), HOWTO(R_SPARC_WPLT30, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_WPLT30", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_COPY, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_COPY", false,0,0x00000000,true), HOWTO(R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_COPY", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_GLOB_DAT,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_GLOB_DAT",false,0,0x00000000,true), HOWTO(R_SPARC_GLOB_DAT,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_JMP_SLOT,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_JMP_SLOT",false,0,0x00000000,true), HOWTO(R_SPARC_JMP_SLOT,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_RELATIVE,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_RELATIVE",false,0,0x00000000,true), HOWTO(R_SPARC_RELATIVE,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_UA32, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_UA32", false,0,0x00000000,true), HOWTO(R_SPARC_UA32, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_UA32", FALSE,0,0x00000000,TRUE),
}; };
struct coff_reloc_map { struct coff_reloc_map {

View file

@ -1,5 +1,5 @@
/* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub). /* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub).
Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Robert Hoehne. Written by Robert Hoehne.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -93,7 +93,7 @@ create_go32_stub PARAMS ((bfd *));
#define COFF_ADJUST_AUX_OUT_PRE adjust_aux_out_pre #define COFF_ADJUST_AUX_OUT_PRE adjust_aux_out_pre
#define COFF_ADJUST_AUX_OUT_POST adjust_aux_out_post #define COFF_ADJUST_AUX_OUT_POST adjust_aux_out_post
static boolean static bfd_boolean
go32_stubbed_coff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); go32_stubbed_coff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *));
#define coff_bfd_copy_private_bfd_data go32_stubbed_coff_bfd_copy_private_bfd_data #define coff_bfd_copy_private_bfd_data go32_stubbed_coff_bfd_copy_private_bfd_data
@ -392,22 +392,22 @@ stub_end:
/* If ibfd was a stubbed coff image, copy the stub from that bfd /* If ibfd was a stubbed coff image, copy the stub from that bfd
to the new obfd. */ to the new obfd. */
static boolean static bfd_boolean
go32_stubbed_coff_bfd_copy_private_bfd_data (ibfd, obfd) go32_stubbed_coff_bfd_copy_private_bfd_data (ibfd, obfd)
bfd *ibfd; bfd *ibfd;
bfd *obfd; bfd *obfd;
{ {
/* Check if both are the same targets. */ /* Check if both are the same targets. */
if (ibfd->xvec != obfd->xvec) if (ibfd->xvec != obfd->xvec)
return true; return TRUE;
/* Check if both have a valid stub. */ /* Check if both have a valid stub. */
if (bfd_coff_go32stub (ibfd) == NULL if (bfd_coff_go32stub (ibfd) == NULL
|| bfd_coff_go32stub (obfd) == NULL) || bfd_coff_go32stub (obfd) == NULL)
return true; return TRUE;
/* Now copy the stub. */ /* Now copy the stub. */
memcpy (bfd_coff_go32stub (obfd), bfd_coff_go32stub (ibfd), STUBSIZE); memcpy (bfd_coff_go32stub (obfd), bfd_coff_go32stub (ibfd), STUBSIZE);
return true; return TRUE;
} }

View file

@ -1,5 +1,5 @@
/* BFD back-end for TMS320C30 coff binaries. /* BFD back-end for TMS320C30 coff binaries.
Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -37,16 +37,16 @@ reloc_howto_type * tic30_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_r
reloc_howto_type tic30_coff_howto_table[] = reloc_howto_type tic30_coff_howto_table[] =
{ {
HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL, HOWTO (R_TIC30_ABS16, 2, 1, 16, FALSE, 0, 0, NULL,
"16", false, 0x0000FFFF, 0x0000FFFF, false), "16", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL, HOWTO (R_TIC30_ABS24, 2, 2, 24, FALSE, 8, complain_overflow_bitfield, NULL,
"24", false, 0xFFFFFF00, 0xFFFFFF00, false), "24", FALSE, 0xFFFFFF00, 0xFFFFFF00, FALSE),
HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL, HOWTO (R_TIC30_LDP, 18, 0, 24, FALSE, 0, complain_overflow_bitfield, NULL,
"LDP", false, 0x00FF0000, 0x000000FF, false), "LDP", FALSE, 0x00FF0000, 0x000000FF, FALSE),
HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL, HOWTO (R_TIC30_ABS32, 2, 2, 32, FALSE, 0, complain_overflow_bitfield, NULL,
"32", false, 0xFFFFFFFF, 0xFFFFFFFF, false), "32", FALSE, 0xFFFFFFFF, 0xFFFFFFFF, FALSE),
HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL, HOWTO (R_TIC30_PC16, 2, 1, 16, TRUE, 0, complain_overflow_signed, NULL,
"PCREL", false, 0x0000FFFF, 0x0000FFFF, false), "PCREL", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
EMPTY_HOWTO (-1) EMPTY_HOWTO (-1)
}; };

View file

@ -31,11 +31,11 @@
#undef F_LSYMS #undef F_LSYMS
#define F_LSYMS F_LSYMS_TICOFF #define F_LSYMS F_LSYMS_TICOFF
static boolean ticoff0_bad_format_hook static bfd_boolean ticoff0_bad_format_hook
PARAMS ((bfd *, PTR )); PARAMS ((bfd *, PTR ));
static boolean ticoff1_bad_format_hook static bfd_boolean ticoff1_bad_format_hook
PARAMS ((bfd *, PTR )); PARAMS ((bfd *, PTR ));
static boolean ticoff_bfd_is_local_label_name static bfd_boolean ticoff_bfd_is_local_label_name
PARAMS ((bfd *, const char *)); PARAMS ((bfd *, const char *));
static bfd_reloc_status_type tic4x_relocation static bfd_reloc_status_type tic4x_relocation
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char ** )); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char ** ));
@ -49,7 +49,7 @@ static void tic4x_reloc_processing
PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection * )); PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection * ));
static boolean static bfd_boolean
ticoff0_bad_format_hook (abfd, filehdr) ticoff0_bad_format_hook (abfd, filehdr)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
PTR filehdr; PTR filehdr;
@ -57,12 +57,12 @@ ticoff0_bad_format_hook (abfd, filehdr)
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
if (COFF0_BADMAG (*internal_f)) if (COFF0_BADMAG (*internal_f))
return false; return FALSE;
return true; return TRUE;
} }
static boolean static bfd_boolean
ticoff1_bad_format_hook (abfd, filehdr) ticoff1_bad_format_hook (abfd, filehdr)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
PTR filehdr; PTR filehdr;
@ -70,21 +70,21 @@ ticoff1_bad_format_hook (abfd, filehdr)
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
if (COFF1_BADMAG (*internal_f)) if (COFF1_BADMAG (*internal_f))
return false; return FALSE;
return true; return TRUE;
} }
/* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local /* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
labels. */ labels. */
static boolean static bfd_boolean
ticoff_bfd_is_local_label_name (abfd, name) ticoff_bfd_is_local_label_name (abfd, name)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
const char *name; const char *name;
{ {
if (TICOFF_LOCAL_LABEL_P(name)) if (TICOFF_LOCAL_LABEL_P(name))
return true; return TRUE;
return false; return FALSE;
} }
#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
@ -100,7 +100,7 @@ ticoff_bfd_is_local_label_name (abfd, name)
#include "coffcode.h" #include "coffcode.h"
static bfd_reloc_status_type static bfd_reloc_status_type
tic4x_relocation (abfd, reloc_entry, symbol, data, input_section, tic4x_relocation (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message) output_bfd, error_message)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc_entry; arelent *reloc_entry;
@ -109,7 +109,7 @@ tic4x_relocation (abfd, reloc_entry, symbol, data, input_section,
asection *input_section; asection *input_section;
bfd *output_bfd; bfd *output_bfd;
char **error_message ATTRIBUTE_UNUSED; char **error_message ATTRIBUTE_UNUSED;
{ {
if (output_bfd != (bfd *) NULL) if (output_bfd != (bfd *) NULL)
{ {
/* This is a partial relocation, and we want to apply the /* This is a partial relocation, and we want to apply the
@ -121,22 +121,22 @@ tic4x_relocation (abfd, reloc_entry, symbol, data, input_section,
return bfd_reloc_continue; return bfd_reloc_continue;
} }
reloc_howto_type tic4x_howto_table[] = reloc_howto_type tic4x_howto_table[] =
{ {
HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "RELWORD", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_RELWORD, 0, 2, 16, FALSE, 0, complain_overflow_signed, tic4x_relocation, "RELWORD", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_bitfield, tic4x_relocation, "REL24", true, 0x00ffffff, 0x00ffffff, false), HOWTO(R_REL24, 0, 2, 24, FALSE, 0, complain_overflow_bitfield, tic4x_relocation, "REL24", TRUE, 0x00ffffff, 0x00ffffff, FALSE),
HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_dont, tic4x_relocation, "RELLONG", true, 0xffffffff, 0xffffffff, false), HOWTO(R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_dont, tic4x_relocation, "RELLONG", TRUE, 0xffffffff, 0xffffffff, FALSE),
HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "PCRWORD", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_PCRWORD, 0, 2, 16, TRUE, 0, complain_overflow_signed, tic4x_relocation, "PCRWORD", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "PCR24", true, 0x00ffffff, 0x00ffffff, false), HOWTO(R_PCR24, 0, 2, 24, TRUE, 0, complain_overflow_signed, tic4x_relocation, "PCR24", TRUE, 0x00ffffff, 0x00ffffff, FALSE),
HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTLS16", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_PARTLS16, 0, 2, 16, FALSE, 0, complain_overflow_dont, tic4x_relocation, "PARTLS16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "PARTMS8", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_PARTMS8, 16, 2, 16, FALSE, 0, complain_overflow_dont, tic4x_relocation, "PARTMS8", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO(R_RELWORD, 0, 2, 16, false, 0, complain_overflow_signed, tic4x_relocation, "ARELWORD", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_RELWORD, 0, 2, 16, FALSE, 0, complain_overflow_signed, tic4x_relocation, "ARELWORD", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO(R_REL24, 0, 2, 24, false, 0, complain_overflow_signed, tic4x_relocation, "AREL24", true, 0x00ffffff, 0x00ffffff, false), HOWTO(R_REL24, 0, 2, 24, FALSE, 0, complain_overflow_signed, tic4x_relocation, "AREL24", TRUE, 0x00ffffff, 0x00ffffff, FALSE),
HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_signed, tic4x_relocation, "ARELLONG", true, 0xffffffff, 0xffffffff, false), HOWTO(R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_signed, tic4x_relocation, "ARELLONG", TRUE, 0xffffffff, 0xffffffff, FALSE),
HOWTO(R_PCRWORD, 0, 2, 16, true, 0, complain_overflow_signed, tic4x_relocation, "APCRWORD", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_PCRWORD, 0, 2, 16, TRUE, 0, complain_overflow_signed, tic4x_relocation, "APCRWORD", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO(R_PCR24, 0, 2, 24, true, 0, complain_overflow_signed, tic4x_relocation, "APCR24", true, 0x00ffffff, 0x00ffffff, false), HOWTO(R_PCR24, 0, 2, 24, TRUE, 0, complain_overflow_signed, tic4x_relocation, "APCR24", TRUE, 0x00ffffff, 0x00ffffff, FALSE),
HOWTO(R_PARTLS16, 0, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTLS16", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_PARTLS16, 0, 2, 16, FALSE, 0, complain_overflow_dont, tic4x_relocation, "APARTLS16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO(R_PARTMS8, 16, 2, 16, false, 0, complain_overflow_dont, tic4x_relocation, "APARTMS8", true, 0x0000ffff, 0x0000ffff, false), HOWTO(R_PARTMS8, 16, 2, 16, FALSE, 0, complain_overflow_dont, tic4x_relocation, "APARTMS8", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
}; };
#define HOWTO_SIZE (sizeof(tic4x_howto_table) / sizeof(tic4x_howto_table[0])) #define HOWTO_SIZE (sizeof(tic4x_howto_table) / sizeof(tic4x_howto_table[0]))
@ -153,7 +153,7 @@ tic4x_coff_reloc_type_lookup (abfd, code)
{ {
unsigned int type; unsigned int type;
unsigned int i; unsigned int i;
switch (code) switch (code)
{ {
case BFD_RELOC_32: type = R_RELLONG; break; case BFD_RELOC_32: type = R_RELLONG; break;
@ -166,7 +166,7 @@ tic4x_coff_reloc_type_lookup (abfd, code)
default: default:
return NULL; return NULL;
} }
for (i = 0; i < HOWTO_SIZE; i++) for (i = 0; i < HOWTO_SIZE; i++)
{ {
if (tic4x_howto_table[i].type == type) if (tic4x_howto_table[i].type == type)
@ -238,7 +238,7 @@ tic4x_reloc_processing (relent, reloc, symbols, abfd, section)
asymbol *ptr; asymbol *ptr;
relent->address = reloc->r_vaddr; relent->address = reloc->r_vaddr;
if (reloc->r_symndx != -1) if (reloc->r_symndx != -1)
{ {
if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd)) if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
@ -261,26 +261,26 @@ tic4x_reloc_processing (relent, reloc, symbols, abfd, section)
relent->sym_ptr_ptr = section->symbol_ptr_ptr; relent->sym_ptr_ptr = section->symbol_ptr_ptr;
ptr = *(relent->sym_ptr_ptr); ptr = *(relent->sym_ptr_ptr);
} }
/* The symbols definitions that we have read in have been relocated /* The symbols definitions that we have read in have been relocated
as if their sections started at 0. But the offsets refering to as if their sections started at 0. But the offsets refering to
the symbols in the raw data have not been modified, so we have to the symbols in the raw data have not been modified, so we have to
have a negative addend to compensate. have a negative addend to compensate.
Note that symbols which used to be common must be left alone. */ Note that symbols which used to be common must be left alone. */
/* Calculate any reloc addend by looking at the symbol. */ /* Calculate any reloc addend by looking at the symbol. */
CALC_ADDEND (abfd, ptr, *reloc, relent); CALC_ADDEND (abfd, ptr, *reloc, relent);
relent->address -= section->vma; relent->address -= section->vma;
/* !! relent->section = (asection *) NULL; */ /* !! relent->section = (asection *) NULL; */
/* Fill in the relent->howto field from reloc->r_type. */ /* Fill in the relent->howto field from reloc->r_type. */
tic4x_lookup_howto (relent, reloc); tic4x_lookup_howto (relent, reloc);
} }
static const bfd_coff_backend_data ticoff0_swap_table = static const bfd_coff_backend_data ticoff0_swap_table =
{ {
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
coff_SWAP_aux_out, coff_SWAP_sym_out, coff_SWAP_aux_out, coff_SWAP_sym_out,
@ -289,19 +289,19 @@ static const bfd_coff_backend_data ticoff0_swap_table =
coff_SWAP_scnhdr_out, coff_SWAP_scnhdr_out,
FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN,
#ifdef COFF_LONG_FILENAMES #ifdef COFF_LONG_FILENAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_LONG_SECTION_NAMES #ifdef COFF_LONG_SECTION_NAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_DEBUG_STRING_WIDE_PREFIX #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
4, 4,
@ -321,7 +321,7 @@ static const bfd_coff_backend_data ticoff0_swap_table =
}; };
/* COFF1 differs in section header size. */ /* COFF1 differs in section header size. */
static const bfd_coff_backend_data ticoff1_swap_table = static const bfd_coff_backend_data ticoff1_swap_table =
{ {
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
coff_SWAP_aux_out, coff_SWAP_sym_out, coff_SWAP_aux_out, coff_SWAP_sym_out,
@ -330,19 +330,19 @@ static const bfd_coff_backend_data ticoff1_swap_table =
coff_SWAP_scnhdr_out, coff_SWAP_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
#ifdef COFF_LONG_FILENAMES #ifdef COFF_LONG_FILENAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_LONG_SECTION_NAMES #ifdef COFF_LONG_SECTION_NAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_DEBUG_STRING_WIDE_PREFIX #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
4, 4,

View file

@ -1,5 +1,5 @@
/* BFD back-end for TMS320C54X coff binaries. /* BFD back-end for TMS320C54X coff binaries.
Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Timothy Wall (twall@cygnus.com) Contributed by Timothy Wall (twall@cygnus.com)
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -30,19 +30,32 @@
#undef F_LSYMS #undef F_LSYMS
#define F_LSYMS F_LSYMS_TICOFF #define F_LSYMS F_LSYMS_TICOFF
static void tic54x_reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *)); static void tic54x_reloc_processing
static bfd_reloc_status_type tic54x_relocation PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
static boolean tic54x_set_section_contents PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); static bfd_reloc_status_type tic54x_relocation
static reloc_howto_type * coff_tic54x_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_vma tic54x_getl32 PARAMS ((const bfd_byte *)); static bfd_boolean tic54x_set_section_contents
static void tic54x_putl32 PARAMS ((bfd_vma, bfd_byte *)); PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
static bfd_signed_vma tic54x_getl_signed_32 PARAMS ((const bfd_byte *)); static reloc_howto_type *coff_tic54x_rtype_to_howto
static boolean tic54x_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
static reloc_howto_type * tic54x_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static bfd_vma tic54x_getl32
static void tic54x_lookup_howto PARAMS ((arelent *, struct internal_reloc *)); PARAMS ((const bfd_byte *));
static boolean ticoff0_bad_format_hook PARAMS ((bfd *, PTR)); static void tic54x_putl32
static boolean ticoff1_bad_format_hook PARAMS ((bfd *, PTR)); PARAMS ((bfd_vma, bfd_byte *));
static boolean ticoff_bfd_is_local_label_name PARAMS ((bfd *, const char *)); static bfd_signed_vma tic54x_getl_signed_32
PARAMS ((const bfd_byte *));
static bfd_boolean tic54x_set_arch_mach
PARAMS ((bfd *, enum bfd_architecture, unsigned long));
static reloc_howto_type * tic54x_coff_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void tic54x_lookup_howto
PARAMS ((arelent *, struct internal_reloc *));
static bfd_boolean ticoff0_bad_format_hook
PARAMS ((bfd *, PTR));
static bfd_boolean ticoff1_bad_format_hook
PARAMS ((bfd *, PTR));
static bfd_boolean ticoff_bfd_is_local_label_name
PARAMS ((bfd *, const char *));
/* 32-bit operations /* 32-bit operations
The octet order is screwy. words are LSB first (LS octet, actually), but The octet order is screwy. words are LSB first (LS octet, actually), but
@ -125,7 +138,7 @@ bfd_ticoff_get_section_load_page (sect)
/* Set the architecture appropriately. Allow unkown architectures /* Set the architecture appropriately. Allow unkown architectures
(e.g. binary). */ (e.g. binary). */
static boolean static bfd_boolean
tic54x_set_arch_mach (abfd, arch, machine) tic54x_set_arch_mach (abfd, arch, machine)
bfd *abfd; bfd *abfd;
enum bfd_architecture arch; enum bfd_architecture arch;
@ -135,7 +148,7 @@ tic54x_set_arch_mach (abfd, arch, machine)
arch = bfd_arch_tic54x; arch = bfd_arch_tic54x;
else if (arch != bfd_arch_tic54x) else if (arch != bfd_arch_tic54x)
return false; return FALSE;
return bfd_default_set_arch_mach (abfd, arch, machine); return bfd_default_set_arch_mach (abfd, arch, machine);
} }
@ -170,59 +183,59 @@ reloc_howto_type tic54x_howto_table[] =
/* NORMAL BANK */ /* NORMAL BANK */
/* 16-bit direct reference to symbol's address. */ /* 16-bit direct reference to symbol's address. */
HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, HOWTO (R_RELWORD,0,1,16,FALSE,0,complain_overflow_dont,
tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false), tic54x_relocation,"REL16",FALSE,0xFFFF,0xFFFF,FALSE),
/* 7 LSBs of an address */ /* 7 LSBs of an address */
HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, HOWTO (R_PARTLS7,0,1,7,FALSE,0,complain_overflow_dont,
tic54x_relocation,"LS7",false,0x007F,0x007F,false), tic54x_relocation,"LS7",FALSE,0x007F,0x007F,FALSE),
/* 9 MSBs of an address */ /* 9 MSBs of an address */
/* TI assembler doesn't shift its encoding, and is thus incompatible */ /* TI assembler doesn't shift its encoding, and is thus incompatible */
HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, HOWTO (R_PARTMS9,7,1,9,FALSE,0,complain_overflow_dont,
tic54x_relocation,"MS9",false,0x01FF,0x01FF,false), tic54x_relocation,"MS9",FALSE,0x01FF,0x01FF,FALSE),
/* 23-bit relocation */ /* 23-bit relocation */
HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, HOWTO (R_EXTWORD,0,2,23,FALSE,0,complain_overflow_dont,
tic54x_relocation,"RELEXT",false,0x7FFFFF,0x7FFFFF,false), tic54x_relocation,"RELEXT",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
/* 16 bits of 23-bit extended address */ /* 16 bits of 23-bit extended address */
HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, HOWTO (R_EXTWORD16,0,1,16,FALSE,0,complain_overflow_dont,
tic54x_relocation,"RELEXT16",false,0x7FFFFF,0x7FFFFF,false), tic54x_relocation,"RELEXT16",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
/* upper 7 bits of 23-bit extended address */ /* upper 7 bits of 23-bit extended address */
HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, HOWTO (R_EXTWORDMS7,16,1,7,FALSE,0,complain_overflow_dont,
tic54x_relocation,"RELEXTMS7",false,0x7F,0x7F,false), tic54x_relocation,"RELEXTMS7",FALSE,0x7F,0x7F,FALSE),
/* ABSOLUTE BANK */ /* ABSOLUTE BANK */
/* 16-bit direct reference to symbol's address, absolute */ /* 16-bit direct reference to symbol's address, absolute */
HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, HOWTO (R_RELWORD,0,1,16,FALSE,0,complain_overflow_dont,
tic54x_relocation,"AREL16",false,0xFFFF,0xFFFF,false), tic54x_relocation,"AREL16",FALSE,0xFFFF,0xFFFF,FALSE),
/* 7 LSBs of an address, absolute */ /* 7 LSBs of an address, absolute */
HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, HOWTO (R_PARTLS7,0,1,7,FALSE,0,complain_overflow_dont,
tic54x_relocation,"ALS7",false,0x007F,0x007F,false), tic54x_relocation,"ALS7",FALSE,0x007F,0x007F,FALSE),
/* 9 MSBs of an address, absolute */ /* 9 MSBs of an address, absolute */
/* TI assembler doesn't shift its encoding, and is thus incompatible */ /* TI assembler doesn't shift its encoding, and is thus incompatible */
HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, HOWTO (R_PARTMS9,7,1,9,FALSE,0,complain_overflow_dont,
tic54x_relocation,"AMS9",false,0x01FF,0x01FF,false), tic54x_relocation,"AMS9",FALSE,0x01FF,0x01FF,FALSE),
/* 23-bit direct reference, absolute */ /* 23-bit direct reference, absolute */
HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, HOWTO (R_EXTWORD,0,2,23,FALSE,0,complain_overflow_dont,
tic54x_relocation,"ARELEXT",false,0x7FFFFF,0x7FFFFF,false), tic54x_relocation,"ARELEXT",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
/* 16 bits of 23-bit extended address, absolute */ /* 16 bits of 23-bit extended address, absolute */
HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, HOWTO (R_EXTWORD16,0,1,16,FALSE,0,complain_overflow_dont,
tic54x_relocation,"ARELEXT16",false,0x7FFFFF,0x7FFFFF,false), tic54x_relocation,"ARELEXT16",FALSE,0x7FFFFF,0x7FFFFF,FALSE),
/* upper 7 bits of 23-bit extended address, absolute */ /* upper 7 bits of 23-bit extended address, absolute */
HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, HOWTO (R_EXTWORDMS7,16,1,7,FALSE,0,complain_overflow_dont,
tic54x_relocation,"ARELEXTMS7",false,0x7F,0x7F,false), tic54x_relocation,"ARELEXTMS7",FALSE,0x7F,0x7F,FALSE),
/* 32-bit relocation exclusively for stabs */ /* 32-bit relocation exclusively for stabs */
HOWTO (R_RELLONG,0,2,32,false,0,complain_overflow_dont, HOWTO (R_RELLONG,0,2,32,FALSE,0,complain_overflow_dont,
tic54x_relocation,"STAB",false,0xFFFFFFFF,0xFFFFFFFF,false), tic54x_relocation,"STAB",FALSE,0xFFFFFFFF,0xFFFFFFFF,FALSE),
}; };
#define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup #define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
@ -310,7 +323,7 @@ coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
return genrel.howto; return genrel.howto;
} }
static boolean static bfd_boolean
ticoff0_bad_format_hook (abfd, filehdr) ticoff0_bad_format_hook (abfd, filehdr)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
PTR filehdr; PTR filehdr;
@ -318,12 +331,12 @@ ticoff0_bad_format_hook (abfd, filehdr)
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
if (COFF0_BADMAG (*internal_f)) if (COFF0_BADMAG (*internal_f))
return false; return FALSE;
return true; return TRUE;
} }
static boolean static bfd_boolean
ticoff1_bad_format_hook (abfd, filehdr) ticoff1_bad_format_hook (abfd, filehdr)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
PTR filehdr; PTR filehdr;
@ -331,22 +344,22 @@ ticoff1_bad_format_hook (abfd, filehdr)
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
if (COFF1_BADMAG (*internal_f)) if (COFF1_BADMAG (*internal_f))
return false; return FALSE;
return true; return TRUE;
} }
/* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local /* Replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local
labels. */ labels. */
static boolean static bfd_boolean
ticoff_bfd_is_local_label_name (abfd, name) ticoff_bfd_is_local_label_name (abfd, name)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
const char *name; const char *name;
{ {
if (TICOFF_LOCAL_LABEL_P(name)) if (TICOFF_LOCAL_LABEL_P(name))
return true; return TRUE;
return false; return FALSE;
} }
#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name #define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name
@ -358,7 +371,7 @@ ticoff_bfd_is_local_label_name (abfd, name)
#define BADMAG(x) COFF2_BADMAG(x) #define BADMAG(x) COFF2_BADMAG(x)
#include "coffcode.h" #include "coffcode.h"
static boolean static bfd_boolean
tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do) tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do)
bfd *abfd; bfd *abfd;
sec_ptr section; sec_ptr section;
@ -432,19 +445,19 @@ static const bfd_coff_backend_data ticoff0_swap_table =
coff_SWAP_scnhdr_out, coff_SWAP_scnhdr_out,
FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN,
#ifdef COFF_LONG_FILENAMES #ifdef COFF_LONG_FILENAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_LONG_SECTION_NAMES #ifdef COFF_LONG_SECTION_NAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_DEBUG_STRING_WIDE_PREFIX #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
4, 4,
@ -473,20 +486,20 @@ static const bfd_coff_backend_data ticoff1_swap_table =
coff_SWAP_scnhdr_out, coff_SWAP_scnhdr_out,
FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
#ifdef COFF_LONG_FILENAMES #ifdef COFF_LONG_FILENAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_LONG_SECTION_NAMES #ifdef COFF_LONG_SECTION_NAMES
true, TRUE,
#else #else
false, FALSE,
#endif #endif
COFF_DEFAULT_SECTION_ALIGNMENT_POWER, COFF_DEFAULT_SECTION_ALIGNMENT_POWER,
#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
true, TRUE,
#else #else
false, FALSE,
#endif #endif
#ifdef COFF_DEBUG_STRING_WIDE_PREFIX #ifdef COFF_DEBUG_STRING_WIDE_PREFIX
4, 4,

View file

@ -1,5 +1,5 @@
/* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP). /* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com) Written by Fred Fish (fnf@cygnus.com)
@ -48,7 +48,7 @@ static bfd_reloc_status_type glob16_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type local16_reloc static bfd_reloc_status_type local16_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static boolean coff_tic80_relocate_section static bfd_boolean coff_tic80_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **)); struct internal_reloc *, struct internal_syment *, asection **));
static reloc_howto_type * coff_tic80_rtype_to_howto static reloc_howto_type * coff_tic80_rtype_to_howto
@ -63,295 +63,295 @@ static reloc_howto_type tic80_howto_table[] =
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"RELLONG", /* name */ "RELLONG", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_MPPCR, /* type */ HOWTO (R_MPPCR, /* type */
2, /* rightshift */ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
true, /* pc_relative */ TRUE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */ complain_overflow_signed, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"MPPCR", /* name */ "MPPCR", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
true), /* pcrel_offset */ TRUE), /* pcrel_offset */
HOWTO (R_ABS, /* type */ HOWTO (R_ABS, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */ complain_overflow_bitfield, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"ABS", /* name */ "ABS", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPBASE, /* type */ HOWTO (R_PPBASE, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
ppbase_reloc, /* special_function */ ppbase_reloc, /* special_function */
"PPBASE", /* name */ "PPBASE", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPLBASE, /* type */ HOWTO (R_PPLBASE, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */ 32, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
ppbase_reloc, /* special_function */ ppbase_reloc, /* special_function */
"PPLBASE", /* name */ "PPLBASE", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffffffff, /* src_mask */ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PP15, /* type */ HOWTO (R_PP15, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob15_reloc, /* special_function */ glob15_reloc, /* special_function */
"PP15", /* name */ "PP15", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x1ffc0, /* src_mask */ 0x1ffc0, /* src_mask */
0x1ffc0, /* dst_mask */ 0x1ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PP15W, /* type */ HOWTO (R_PP15W, /* type */
2, /* rightshift */ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob15_reloc, /* special_function */ glob15_reloc, /* special_function */
"PP15W", /* name */ "PP15W", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x1ffc0, /* src_mask */ 0x1ffc0, /* src_mask */
0x1ffc0, /* dst_mask */ 0x1ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PP15H, /* type */ HOWTO (R_PP15H, /* type */
1, /* rightshift */ 1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob15_reloc, /* special_function */ glob15_reloc, /* special_function */
"PP15H", /* name */ "PP15H", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x1ffc0, /* src_mask */ 0x1ffc0, /* src_mask */
0x1ffc0, /* dst_mask */ 0x1ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PP16B, /* type */ HOWTO (R_PP16B, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob16_reloc, /* special_function */ glob16_reloc, /* special_function */
"PP16B", /* name */ "PP16B", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x3ffc0, /* src_mask */ 0x3ffc0, /* src_mask */
0x3ffc0, /* dst_mask */ 0x3ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPL15, /* type */ HOWTO (R_PPL15, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"PPL15", /* name */ "PPL15", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x7fff, /* src_mask */ 0x7fff, /* src_mask */
0x7fff, /* dst_mask */ 0x7fff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPL15W, /* type */ HOWTO (R_PPL15W, /* type */
2, /* rightshift */ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"PPL15W", /* name */ "PPL15W", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x7fff, /* src_mask */ 0x7fff, /* src_mask */
0x7fff, /* dst_mask */ 0x7fff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPL15H, /* type */ HOWTO (R_PPL15H, /* type */
1, /* rightshift */ 1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"PPL15H", /* name */ "PPL15H", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x7fff, /* src_mask */ 0x7fff, /* src_mask */
0x7fff, /* dst_mask */ 0x7fff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPL16B, /* type */ HOWTO (R_PPL16B, /* type */
0, /* rightshift */ 0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */ 2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
local16_reloc, /* special_function */ local16_reloc, /* special_function */
"PPL16B", /* name */ "PPL16B", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPN15, /* type */ HOWTO (R_PPN15, /* type */
0, /* rightshift */ 0, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob15_reloc, /* special_function */ glob15_reloc, /* special_function */
"PPN15", /* name */ "PPN15", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x1ffc0, /* src_mask */ 0x1ffc0, /* src_mask */
0x1ffc0, /* dst_mask */ 0x1ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPN15W, /* type */ HOWTO (R_PPN15W, /* type */
2, /* rightshift */ 2, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob15_reloc, /* special_function */ glob15_reloc, /* special_function */
"PPN15W", /* name */ "PPN15W", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x1ffc0, /* src_mask */ 0x1ffc0, /* src_mask */
0x1ffc0, /* dst_mask */ 0x1ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPN15H, /* type */ HOWTO (R_PPN15H, /* type */
1, /* rightshift */ 1, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob15_reloc, /* special_function */ glob15_reloc, /* special_function */
"PPN15H", /* name */ "PPN15H", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x1ffc0, /* src_mask */ 0x1ffc0, /* src_mask */
0x1ffc0, /* dst_mask */ 0x1ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPN16B, /* type */ HOWTO (R_PPN16B, /* type */
0, /* rightshift */ 0, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */ 16, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
6, /* bitpos */ 6, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
glob16_reloc, /* special_function */ glob16_reloc, /* special_function */
"PPN16B", /* name */ "PPN16B", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x3ffc0, /* src_mask */ 0x3ffc0, /* src_mask */
0x3ffc0, /* dst_mask */ 0x3ffc0, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPLN15, /* type */ HOWTO (R_PPLN15, /* type */
0, /* rightshift */ 0, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"PPLN15", /* name */ "PPLN15", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x7fff, /* src_mask */ 0x7fff, /* src_mask */
0x7fff, /* dst_mask */ 0x7fff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPLN15W, /* type */ HOWTO (R_PPLN15W, /* type */
2, /* rightshift */ 2, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"PPLN15W", /* name */ "PPLN15W", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x7fff, /* src_mask */ 0x7fff, /* src_mask */
0x7fff, /* dst_mask */ 0x7fff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPLN15H, /* type */ HOWTO (R_PPLN15H, /* type */
1, /* rightshift */ 1, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */ NULL, /* special_function */
"PPLN15H", /* name */ "PPLN15H", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0x7fff, /* src_mask */ 0x7fff, /* src_mask */
0x7fff, /* dst_mask */ 0x7fff, /* dst_mask */
false), /* pcrel_offset */ FALSE), /* pcrel_offset */
HOWTO (R_PPLN16B, /* type */ HOWTO (R_PPLN16B, /* type */
0, /* rightshift */ 0, /* rightshift */
-2, /* size (0 = byte, 1 = short, 2 = long) */ -2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */ 15, /* bitsize */
false, /* pc_relative */ FALSE, /* pc_relative */
0, /* bitpos */ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */ complain_overflow_dont, /* complain_on_overflow */
local16_reloc, /* special_function */ local16_reloc, /* special_function */
"PPLN16B", /* name */ "PPLN16B", /* name */
true, /* partial_inplace */ TRUE, /* partial_inplace */
0xffff, /* src_mask */ 0xffff, /* src_mask */
0xffff, /* dst_mask */ 0xffff, /* dst_mask */
false) /* pcrel_offset */ FALSE) /* pcrel_offset */
}; };
/* Special relocation functions, used when the output file is not /* Special relocation functions, used when the output file is not
@ -485,7 +485,7 @@ coff_tic80_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
/* We need a special relocation routine to handle the PP relocs. Most /* We need a special relocation routine to handle the PP relocs. Most
of this is a copy of _bfd_coff_generic_relocate_section. */ of this is a copy of _bfd_coff_generic_relocate_section. */
static boolean static bfd_boolean
coff_tic80_relocate_section (output_bfd, info, input_bfd, coff_tic80_relocate_section (output_bfd, info, input_bfd,
input_section, contents, relocs, syms, input_section, contents, relocs, syms,
sections) sections)
@ -540,7 +540,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h,
sym, &addend); sym, &addend);
if (howto == NULL) if (howto == NULL)
return false; return FALSE;
val = 0; val = 0;
@ -580,8 +580,8 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section, (info, h->root.root.string, input_bfd, input_section,
rel->r_vaddr - input_section->vma, true))) rel->r_vaddr - input_section->vma, TRUE)))
return false; return FALSE;
} }
} }
@ -687,7 +687,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
bfd_archive_filename (input_bfd), bfd_archive_filename (input_bfd),
(unsigned long) rel->r_vaddr, (unsigned long) rel->r_vaddr,
bfd_get_section_name (input_bfd, input_section)); bfd_get_section_name (input_bfd, input_section));
return false; return FALSE;
case bfd_reloc_overflow: case bfd_reloc_overflow:
{ {
const char *name; const char *name;
@ -701,17 +701,17 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd,
{ {
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
if (name == NULL) if (name == NULL)
return false; return FALSE;
} }
if (! ((*info->callbacks->reloc_overflow) if (! ((*info->callbacks->reloc_overflow)
(info, name, howto->name, (bfd_vma) 0, input_bfd, (info, name, howto->name, (bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma))) input_section, rel->r_vaddr - input_section->vma)))
return false; return FALSE;
} }
} }
} }
return true; return TRUE;
} }
#define TIC80COFF 1 /* Customize coffcode.h */ #define TIC80COFF 1 /* Customize coffcode.h */

View file

@ -1,5 +1,6 @@
/* BFD back-end for WDC 65816 COFF binaries. /* BFD back-end for WDC 65816 COFF binaries.
Copyright 1995, 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Steve Chamberlain, <sac@cygnus.com>. Written by Steve Chamberlain, <sac@cygnus.com>.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -35,16 +36,16 @@ static void w65_reloc16_extra_cases PARAMS ((bfd *,struct bfd_link_info *, struc
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
static reloc_howto_type howto_table[] = static reloc_howto_type howto_table[] =
{ {
HOWTO (R_W65_ABS8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "abs8", true, 0x000000ff, 0x000000ff, false), HOWTO (R_W65_ABS8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "abs8", TRUE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_W65_ABS16, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, "abs16", true, 0x0000ffff, 0x0000ffff, false), HOWTO (R_W65_ABS16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_W65_ABS24, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "abs24", true, 0x00ffffff, 0x00ffffff, false), HOWTO (R_W65_ABS24, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "abs24", TRUE, 0x00ffffff, 0x00ffffff, FALSE),
HOWTO (R_W65_ABS8S8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, ">abs8", true, 0x000000ff, 0x000000ff, false), HOWTO (R_W65_ABS8S8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, ">abs8", TRUE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_W65_ABS8S16, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "^abs8", true, 0x000000ff, 0x000000ff, false), HOWTO (R_W65_ABS8S16, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "^abs8", TRUE, 0x000000ff, 0x000000ff, FALSE),
HOWTO (R_W65_ABS16S8, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, ">abs16", true, 0x0000ffff, 0x0000ffff, false), HOWTO (R_W65_ABS16S8, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, ">abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_W65_ABS16S16,1, 0, 16, false, 0, complain_overflow_bitfield, 0, "^abs16", true, 0x0000ffff, 0x0000ffff, false), HOWTO (R_W65_ABS16S16,1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "^abs16", TRUE, 0x0000ffff, 0x0000ffff, FALSE),
HOWTO (R_W65_PCR8, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "pcrel8", true, 0x000000ff, 0x000000ff, true), HOWTO (R_W65_PCR8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "pcrel8", TRUE, 0x000000ff, 0x000000ff, TRUE),
HOWTO (R_W65_PCR16, 1, 0, 16, false, 0, complain_overflow_bitfield, 0, "pcrel16", true, 0x0000ffff, 0x0000ffff, true), HOWTO (R_W65_PCR16, 1, 0, 16, FALSE, 0, complain_overflow_bitfield, 0, "pcrel16", TRUE, 0x0000ffff, 0x0000ffff, TRUE),
HOWTO (R_W65_DP, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "dp", true, 0x000000ff, 0x000000ff, false), HOWTO (R_W65_DP, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "dp", TRUE, 0x000000ff, 0x000000ff, FALSE),
}; };
/* Turn a howto into a reloc number. */ /* Turn a howto into a reloc number. */

View file

@ -1,5 +1,6 @@
/* BFD back-end for we32k COFF files. /* BFD back-end for we32k COFF files.
Copyright 1992, 1993, 1994, 1999, 2000 Free Software Foundation, Inc. Copyright 1992, 1993, 1994, 1999, 2000, 2002
Free Software Foundation, Inc.
Contributed by Brendan Kehoe (brendan@cs.widener.edu). Contributed by Brendan Kehoe (brendan@cs.widener.edu).
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -35,7 +36,7 @@ static reloc_howto_type howto_table[] =
EMPTY_HOWTO (3), EMPTY_HOWTO (3),
EMPTY_HOWTO (4), EMPTY_HOWTO (4),
EMPTY_HOWTO (5), EMPTY_HOWTO (5),
HOWTO(R_DIR32, 0, 2, 32, false, 0,complain_overflow_bitfield, 0, "dir32", true, 0xffffffff,0xffffffff, false), HOWTO(R_DIR32, 0, 2, 32, FALSE, 0,complain_overflow_bitfield, 0, "dir32", TRUE, 0xffffffff,0xffffffff, FALSE),
EMPTY_HOWTO (7), EMPTY_HOWTO (7),
EMPTY_HOWTO (010), EMPTY_HOWTO (010),
EMPTY_HOWTO (011), EMPTY_HOWTO (011),
@ -44,12 +45,12 @@ static reloc_howto_type howto_table[] =
EMPTY_HOWTO (014), EMPTY_HOWTO (014),
EMPTY_HOWTO (015), EMPTY_HOWTO (015),
EMPTY_HOWTO (016), EMPTY_HOWTO (016),
HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), HOWTO(R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), HOWTO(R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO(R_RELLONG, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, 0xffffffff,0xffffffff, false), HOWTO(R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
HOWTO(R_PCRBYTE, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, 0x000000ff,0x000000ff, false), HOWTO(R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
HOWTO(R_PCRWORD, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, 0x0000ffff,0x0000ffff, false), HOWTO(R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO(R_PCRLONG, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, 0xffffffff,0xffffffff, false), HOWTO(R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
}; };
/* Turn a howto into a reloc nunmber */ /* Turn a howto into a reloc nunmber */

View file

@ -1,5 +1,5 @@
/* BFD back-end for Zilog Z800n COFF binaries. /* BFD back-end for Zilog Z800n COFF binaries.
Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001 Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Cygnus Support. Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>. Written by Steve Chamberlain, <sac@cygnus.com>.
@ -36,40 +36,40 @@ static int coff_z8k_select_reloc PARAMS ((reloc_howto_type *));
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
static reloc_howto_type r_imm32 = static reloc_howto_type r_imm32 =
HOWTO (R_IMM32, 0, 2, 32, false, 0, HOWTO (R_IMM32, 0, 2, 32, FALSE, 0,
complain_overflow_bitfield, 0, "r_imm32", true, 0xffffffff, complain_overflow_bitfield, 0, "r_imm32", TRUE, 0xffffffff,
0xffffffff, false); 0xffffffff, FALSE);
static reloc_howto_type r_imm4l = static reloc_howto_type r_imm4l =
HOWTO (R_IMM4L, 0, 0, 4, false, 0, HOWTO (R_IMM4L, 0, 0, 4, FALSE, 0,
complain_overflow_bitfield, 0, "r_imm4l", true, 0xf, 0xf, false); complain_overflow_bitfield, 0, "r_imm4l", TRUE, 0xf, 0xf, FALSE);
static reloc_howto_type r_da = static reloc_howto_type r_da =
HOWTO (R_IMM16, 0, 1, 16, false, 0, HOWTO (R_IMM16, 0, 1, 16, FALSE, 0,
complain_overflow_bitfield, 0, "r_da", true, 0x0000ffff, 0x0000ffff, complain_overflow_bitfield, 0, "r_da", TRUE, 0x0000ffff, 0x0000ffff,
false); FALSE);
static reloc_howto_type r_imm8 = static reloc_howto_type r_imm8 =
HOWTO (R_IMM8, 0, 0, 8, false, 0, HOWTO (R_IMM8, 0, 0, 8, FALSE, 0,
complain_overflow_bitfield, 0, "r_imm8", true, 0x000000ff, 0x000000ff, complain_overflow_bitfield, 0, "r_imm8", TRUE, 0x000000ff, 0x000000ff,
false); FALSE);
static reloc_howto_type r_rel16 = static reloc_howto_type r_rel16 =
HOWTO (R_REL16, 0, 1, 16, false, 0, HOWTO (R_REL16, 0, 1, 16, FALSE, 0,
complain_overflow_bitfield, 0, "r_rel16", true, 0x0000ffff, 0x0000ffff, complain_overflow_bitfield, 0, "r_rel16", TRUE, 0x0000ffff, 0x0000ffff,
true); TRUE);
static reloc_howto_type r_jr = static reloc_howto_type r_jr =
HOWTO (R_JR, 0, 0, 8, true, 0, complain_overflow_signed, 0, HOWTO (R_JR, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,
"r_jr", true, 0, 0, true); "r_jr", TRUE, 0, 0, TRUE);
static reloc_howto_type r_disp7 = static reloc_howto_type r_disp7 =
HOWTO (R_DISP7, 0, 0, 7, true, 0, complain_overflow_bitfield, 0, HOWTO (R_DISP7, 0, 0, 7, TRUE, 0, complain_overflow_bitfield, 0,
"r_disp7", true, 0, 0, true); "r_disp7", TRUE, 0, 0, TRUE);
static reloc_howto_type r_callr = static reloc_howto_type r_callr =
HOWTO (R_CALLR, 0, 1, 12, true, 0, complain_overflow_signed, 0, HOWTO (R_CALLR, 0, 1, 12, TRUE, 0, complain_overflow_signed, 0,
"r_callr", true, 0xfff, 0xfff, true); "r_callr", TRUE, 0xfff, 0xfff, TRUE);
/* Turn a howto into a reloc number */ /* Turn a howto into a reloc number */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -46,19 +46,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static void coff_fix_symbol_name static void coff_fix_symbol_name
PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *, PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *,
asection **, bfd_size_type *)); asection **, bfd_size_type *));
static boolean coff_write_symbol static bfd_boolean coff_write_symbol
PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_vma *, PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_vma *,
bfd_size_type *, asection **, bfd_size_type *)); bfd_size_type *, asection **, bfd_size_type *));
static boolean coff_write_alien_symbol static bfd_boolean coff_write_alien_symbol
PARAMS ((bfd *, asymbol *, bfd_vma *, bfd_size_type *, PARAMS ((bfd *, asymbol *, bfd_vma *, bfd_size_type *,
asection **, bfd_size_type *)); asection **, bfd_size_type *));
static boolean coff_write_native_symbol static bfd_boolean coff_write_native_symbol
PARAMS ((bfd *, coff_symbol_type *, bfd_vma *, bfd_size_type *, PARAMS ((bfd *, coff_symbol_type *, bfd_vma *, bfd_size_type *,
asection **, bfd_size_type *)); asection **, bfd_size_type *));
static void coff_pointerize_aux static void coff_pointerize_aux
PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
unsigned int, combined_entry_type *)); unsigned int, combined_entry_type *));
static boolean make_a_section_from_file static bfd_boolean make_a_section_from_file
PARAMS ((bfd *, struct internal_scnhdr *, unsigned int)); PARAMS ((bfd *, struct internal_scnhdr *, unsigned int));
static const bfd_target *coff_real_object_p static const bfd_target *coff_real_object_p
PARAMS ((bfd *, unsigned, struct internal_filehdr *, PARAMS ((bfd *, unsigned, struct internal_filehdr *,
@ -74,7 +74,7 @@ static char *copy_name
/* Take a section header read from a coff file (in HOST byte order), /* Take a section header read from a coff file (in HOST byte order),
and make a BFD "section" out of it. This is used by ECOFF. */ and make a BFD "section" out of it. This is used by ECOFF. */
static boolean static bfd_boolean
make_a_section_from_file (abfd, hdr, target_index) make_a_section_from_file (abfd, hdr, target_index)
bfd *abfd; bfd *abfd;
struct internal_scnhdr *hdr; struct internal_scnhdr *hdr;
@ -82,7 +82,7 @@ make_a_section_from_file (abfd, hdr, target_index)
{ {
asection *return_section; asection *return_section;
char *name; char *name;
boolean result = true; bfd_boolean result = TRUE;
flagword flags; flagword flags;
name = NULL; name = NULL;
@ -103,14 +103,14 @@ make_a_section_from_file (abfd, hdr, target_index)
{ {
strings = _bfd_coff_read_string_table (abfd); strings = _bfd_coff_read_string_table (abfd);
if (strings == NULL) if (strings == NULL)
return false; return FALSE;
/* FIXME: For extra safety, we should make sure that /* FIXME: For extra safety, we should make sure that
strindex does not run us past the end, but right now we strindex does not run us past the end, but right now we
don't know the length of the string table. */ don't know the length of the string table. */
strings += strindex; strings += strindex;
name = bfd_alloc (abfd, (bfd_size_type) strlen (strings) + 1); name = bfd_alloc (abfd, (bfd_size_type) strlen (strings) + 1);
if (name == NULL) if (name == NULL)
return false; return FALSE;
strcpy (name, strings); strcpy (name, strings);
} }
} }
@ -120,14 +120,14 @@ make_a_section_from_file (abfd, hdr, target_index)
/* Assorted wastage to null-terminate the name, thanks AT&T! */ /* Assorted wastage to null-terminate the name, thanks AT&T! */
name = bfd_alloc (abfd, (bfd_size_type) sizeof (hdr->s_name) + 1); name = bfd_alloc (abfd, (bfd_size_type) sizeof (hdr->s_name) + 1);
if (name == NULL) if (name == NULL)
return false; return FALSE;
strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name)); strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name));
name[sizeof (hdr->s_name)] = 0; name[sizeof (hdr->s_name)] = 0;
} }
return_section = bfd_make_section_anyway (abfd, name); return_section = bfd_make_section_anyway (abfd, name);
if (return_section == NULL) if (return_section == NULL)
return false; return FALSE;
return_section->vma = hdr->s_vaddr; return_section->vma = hdr->s_vaddr;
return_section->lma = hdr->s_paddr; return_section->lma = hdr->s_paddr;
@ -147,7 +147,7 @@ make_a_section_from_file (abfd, hdr, target_index)
if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section, if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section,
& flags)) & flags))
result = false; result = FALSE;
return_section->flags = flags; return_section->flags = flags;
@ -423,12 +423,12 @@ _bfd_coff_internal_syment_name (abfd, sym, buf)
} }
/* Read in and swap the relocs. This returns a buffer holding the /* Read in and swap the relocs. This returns a buffer holding the
relocs for section SEC in file ABFD. If CACHE is true and relocs for section SEC in file ABFD. If CACHE is TRUE and
INTERNAL_RELOCS is NULL, the relocs read in will be saved in case INTERNAL_RELOCS is NULL, the relocs read in will be saved in case
the function is called again. If EXTERNAL_RELOCS is not NULL, it the function is called again. If EXTERNAL_RELOCS is not NULL, it
is a buffer large enough to hold the unswapped relocs. If is a buffer large enough to hold the unswapped relocs. If
INTERNAL_RELOCS is not NULL, it is a buffer large enough to hold INTERNAL_RELOCS is not NULL, it is a buffer large enough to hold
the swapped relocs. If REQUIRE_INTERNAL is true, then the return the swapped relocs. If REQUIRE_INTERNAL is TRUE, then the return
value must be INTERNAL_RELOCS. The function returns NULL on error. */ value must be INTERNAL_RELOCS. The function returns NULL on error. */
struct internal_reloc * struct internal_reloc *
@ -436,9 +436,9 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs,
require_internal, internal_relocs) require_internal, internal_relocs)
bfd *abfd; bfd *abfd;
asection *sec; asection *sec;
boolean cache; bfd_boolean cache;
bfd_byte *external_relocs; bfd_byte *external_relocs;
boolean require_internal; bfd_boolean require_internal;
struct internal_reloc *internal_relocs; struct internal_reloc *internal_relocs;
{ {
bfd_size_type relsz; bfd_size_type relsz;
@ -565,7 +565,7 @@ coff_count_linenumbers (abfd)
do do
{ {
asection * sec = q->symbol.section->output_section; asection * sec = q->symbol.section->output_section;
/* Do not try to update fields in read-only sections. */ /* Do not try to update fields in read-only sections. */
if (! bfd_is_const_section (sec)) if (! bfd_is_const_section (sec))
sec->lineno_count ++; sec->lineno_count ++;
@ -656,7 +656,7 @@ fixup_symbol_value (abfd, coff_symbol_ptr, syment)
chain, and that the last one points to the first external symbol. We chain, and that the last one points to the first external symbol. We
do that here too. */ do that here too. */
boolean bfd_boolean
coff_renumber_symbols (bfd_ptr, first_undef) coff_renumber_symbols (bfd_ptr, first_undef)
bfd *bfd_ptr; bfd *bfd_ptr;
int *first_undef; int *first_undef;
@ -685,7 +685,7 @@ coff_renumber_symbols (bfd_ptr, first_undef)
amt = sizeof (asymbol *) * ((bfd_size_type) symbol_count + 1); amt = sizeof (asymbol *) * ((bfd_size_type) symbol_count + 1);
newsyms = (asymbol **) bfd_alloc (bfd_ptr, amt); newsyms = (asymbol **) bfd_alloc (bfd_ptr, amt);
if (!newsyms) if (!newsyms)
return false; return FALSE;
bfd_ptr->outsymbols = newsyms; bfd_ptr->outsymbols = newsyms;
for (i = 0; i < symbol_count; i++) for (i = 0; i < symbol_count; i++)
if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0 if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0
@ -748,7 +748,7 @@ coff_renumber_symbols (bfd_ptr, first_undef)
} }
obj_conv_table_size (bfd_ptr) = native_index; obj_conv_table_size (bfd_ptr) = native_index;
return true; return TRUE;
} }
/* Run thorough the symbol table again, and fix it so that all /* Run thorough the symbol table again, and fix it so that all
@ -943,7 +943,7 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p,
/* Write a symbol out to a COFF file. */ /* Write a symbol out to a COFF file. */
static boolean static bfd_boolean
coff_write_symbol (abfd, symbol, native, written, string_size_p, coff_write_symbol (abfd, symbol, native, written, string_size_p,
debug_string_section_p, debug_string_size_p) debug_string_section_p, debug_string_size_p)
bfd *abfd; bfd *abfd;
@ -988,10 +988,10 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p,
symesz = bfd_coff_symesz (abfd); symesz = bfd_coff_symesz (abfd);
buf = bfd_alloc (abfd, symesz); buf = bfd_alloc (abfd, symesz);
if (!buf) if (!buf)
return false; return FALSE;
bfd_coff_swap_sym_out (abfd, &native->u.syment, buf); bfd_coff_swap_sym_out (abfd, &native->u.syment, buf);
if (bfd_bwrite (buf, symesz, abfd) != symesz) if (bfd_bwrite (buf, symesz, abfd) != symesz)
return false; return FALSE;
bfd_release (abfd, buf); bfd_release (abfd, buf);
if (native->u.syment.n_numaux > 0) if (native->u.syment.n_numaux > 0)
@ -1002,7 +1002,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p,
auxesz = bfd_coff_auxesz (abfd); auxesz = bfd_coff_auxesz (abfd);
buf = bfd_alloc (abfd, auxesz); buf = bfd_alloc (abfd, auxesz);
if (!buf) if (!buf)
return false; return FALSE;
for (j = 0; j < native->u.syment.n_numaux; j++) for (j = 0; j < native->u.syment.n_numaux; j++)
{ {
bfd_coff_swap_aux_out (abfd, bfd_coff_swap_aux_out (abfd,
@ -1013,7 +1013,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p,
native->u.syment.n_numaux, native->u.syment.n_numaux,
buf); buf);
if (bfd_bwrite (buf, auxesz, abfd) != auxesz) if (bfd_bwrite (buf, auxesz, abfd) != auxesz)
return false; return FALSE;
} }
bfd_release (abfd, buf); bfd_release (abfd, buf);
} }
@ -1022,14 +1022,14 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p,
set_index (symbol, *written); set_index (symbol, *written);
*written += numaux + 1; *written += numaux + 1;
return true; return TRUE;
} }
/* Write out a symbol to a COFF file that does not come from a COFF /* Write out a symbol to a COFF file that does not come from a COFF
file originally. This symbol may have been created by the linker, file originally. This symbol may have been created by the linker,
or we may be linking a non COFF file to a COFF file. */ or we may be linking a non COFF file to a COFF file. */
static boolean static bfd_boolean
coff_write_alien_symbol (abfd, symbol, written, string_size_p, coff_write_alien_symbol (abfd, symbol, written, string_size_p,
debug_string_section_p, debug_string_size_p) debug_string_section_p, debug_string_size_p)
bfd *abfd; bfd *abfd;
@ -1062,7 +1062,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p,
format. So, we just ignore them. We must clobber the symbol format. So, we just ignore them. We must clobber the symbol
name to keep it from being put in the string table. */ name to keep it from being put in the string table. */
symbol->name = ""; symbol->name = "";
return true; return TRUE;
} }
else else
{ {
@ -1097,7 +1097,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p,
/* Write a native symbol to a COFF file. */ /* Write a native symbol to a COFF file. */
static boolean static bfd_boolean
coff_write_native_symbol (abfd, symbol, written, string_size_p, coff_write_native_symbol (abfd, symbol, written, string_size_p,
debug_string_section_p, debug_string_size_p) debug_string_section_p, debug_string_size_p)
bfd *abfd; bfd *abfd;
@ -1153,7 +1153,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p,
#endif #endif
count++; count++;
} }
symbol->done_lineno = true; symbol->done_lineno = TRUE;
if (! bfd_is_const_section (symbol->symbol.section->output_section)) if (! bfd_is_const_section (symbol->symbol.section->output_section))
symbol->symbol.section->output_section->moving_line_filepos += symbol->symbol.section->output_section->moving_line_filepos +=
@ -1167,7 +1167,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p,
/* Write out the COFF symbols. */ /* Write out the COFF symbols. */
boolean bfd_boolean
coff_write_symbols (abfd) coff_write_symbols (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -1203,7 +1203,7 @@ coff_write_symbols (abfd)
/* Seek to the right place */ /* Seek to the right place */
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0) if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0)
return false; return FALSE;
/* Output all the symbols we have */ /* Output all the symbols we have */
@ -1219,14 +1219,14 @@ coff_write_symbols (abfd)
if (!coff_write_alien_symbol (abfd, symbol, &written, &string_size, if (!coff_write_alien_symbol (abfd, symbol, &written, &string_size,
&debug_string_section, &debug_string_section,
&debug_string_size)) &debug_string_size))
return false; return FALSE;
} }
else else
{ {
if (!coff_write_native_symbol (abfd, c_symbol, &written, if (!coff_write_native_symbol (abfd, c_symbol, &written,
&string_size, &debug_string_section, &string_size, &debug_string_section,
&debug_string_size)) &debug_string_size))
return false; return FALSE;
} }
} }
@ -1246,7 +1246,7 @@ coff_write_symbols (abfd)
#endif #endif
if (bfd_bwrite ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd) if (bfd_bwrite ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd)
!= sizeof (buffer)) != sizeof (buffer))
return false; return FALSE;
/* Handle long section names. This code must handle section /* Handle long section names. This code must handle section
names just as they are handled in coff_write_object_contents. */ names just as they are handled in coff_write_object_contents. */
@ -1263,7 +1263,7 @@ coff_write_symbols (abfd)
{ {
if (bfd_bwrite (o->name, (bfd_size_type) (len + 1), abfd) if (bfd_bwrite (o->name, (bfd_size_type) (len + 1), abfd)
!= len + 1) != len + 1)
return false; return FALSE;
} }
} }
} }
@ -1304,7 +1304,7 @@ coff_write_symbols (abfd)
if (bfd_coff_force_symnames_in_strings (abfd)) if (bfd_coff_force_symnames_in_strings (abfd))
{ {
if (bfd_bwrite (".file", (bfd_size_type) 6, abfd) != 6) if (bfd_bwrite (".file", (bfd_size_type) 6, abfd) != 6)
return false; return FALSE;
} }
maxlen = bfd_coff_filnmlen (abfd); maxlen = bfd_coff_filnmlen (abfd);
} }
@ -1315,7 +1315,7 @@ coff_write_symbols (abfd)
{ {
if (bfd_bwrite ((PTR) (q->name), (bfd_size_type) name_length + 1, if (bfd_bwrite ((PTR) (q->name), (bfd_size_type) name_length + 1,
abfd) != name_length + 1) abfd) != name_length + 1)
return false; return FALSE;
} }
} }
} }
@ -1334,7 +1334,7 @@ coff_write_symbols (abfd)
#endif #endif
if (bfd_bwrite ((PTR) buffer, (bfd_size_type) STRING_SIZE_SIZE, abfd) if (bfd_bwrite ((PTR) buffer, (bfd_size_type) STRING_SIZE_SIZE, abfd)
!= STRING_SIZE_SIZE) != STRING_SIZE_SIZE)
return false; return FALSE;
} }
/* Make sure the .debug section was created to be the correct size. /* Make sure the .debug section was created to be the correct size.
@ -1348,10 +1348,10 @@ coff_write_symbols (abfd)
1 << debug_string_section->alignment_power) 1 << debug_string_section->alignment_power)
== bfd_section_size (abfd, debug_string_section)))); == bfd_section_size (abfd, debug_string_section))));
return true; return TRUE;
} }
boolean bfd_boolean
coff_write_linenumbers (abfd) coff_write_linenumbers (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -1362,14 +1362,14 @@ coff_write_linenumbers (abfd)
linesz = bfd_coff_linesz (abfd); linesz = bfd_coff_linesz (abfd);
buff = bfd_alloc (abfd, linesz); buff = bfd_alloc (abfd, linesz);
if (!buff) if (!buff)
return false; return FALSE;
for (s = abfd->sections; s != (asection *) NULL; s = s->next) for (s = abfd->sections; s != (asection *) NULL; s = s->next)
{ {
if (s->lineno_count) if (s->lineno_count)
{ {
asymbol **q = abfd->outsymbols; asymbol **q = abfd->outsymbols;
if (bfd_seek (abfd, s->line_filepos, SEEK_SET) != 0) if (bfd_seek (abfd, s->line_filepos, SEEK_SET) != 0)
return false; return FALSE;
/* Find all the linenumbers in this section */ /* Find all the linenumbers in this section */
while (*q) while (*q)
{ {
@ -1389,7 +1389,7 @@ coff_write_linenumbers (abfd)
bfd_coff_swap_lineno_out (abfd, &out, buff); bfd_coff_swap_lineno_out (abfd, &out, buff);
if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd)
!= linesz) != linesz)
return false; return FALSE;
l++; l++;
while (l->line_number) while (l->line_number)
{ {
@ -1398,7 +1398,7 @@ coff_write_linenumbers (abfd)
bfd_coff_swap_lineno_out (abfd, &out, buff); bfd_coff_swap_lineno_out (abfd, &out, buff);
if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd)
!= linesz) != linesz)
return false; return FALSE;
l++; l++;
} }
} }
@ -1408,7 +1408,7 @@ coff_write_linenumbers (abfd)
} }
} }
bfd_release (abfd, buff); bfd_release (abfd, buff);
return true; return TRUE;
} }
alent * alent *
@ -1585,7 +1585,7 @@ copy_name (abfd, name, maxlen)
/* Read in the external symbols. */ /* Read in the external symbols. */
boolean bfd_boolean
_bfd_coff_get_external_symbols (abfd) _bfd_coff_get_external_symbols (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -1594,7 +1594,7 @@ _bfd_coff_get_external_symbols (abfd)
PTR syms; PTR syms;
if (obj_coff_external_syms (abfd) != NULL) if (obj_coff_external_syms (abfd) != NULL)
return true; return TRUE;
symesz = bfd_coff_symesz (abfd); symesz = bfd_coff_symesz (abfd);
@ -1602,19 +1602,19 @@ _bfd_coff_get_external_symbols (abfd)
syms = (PTR) bfd_malloc (size); syms = (PTR) bfd_malloc (size);
if (syms == NULL && size != 0) if (syms == NULL && size != 0)
return false; return FALSE;
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
|| bfd_bread (syms, size, abfd) != size) || bfd_bread (syms, size, abfd) != size)
{ {
if (syms != NULL) if (syms != NULL)
free (syms); free (syms);
return false; return FALSE;
} }
obj_coff_external_syms (abfd) = syms; obj_coff_external_syms (abfd) = syms;
return true; return TRUE;
} }
/* Read in the external strings. The strings are not loaded until /* Read in the external strings. The strings are not loaded until
@ -1689,7 +1689,7 @@ _bfd_coff_read_string_table (abfd)
/* Free up the external symbols and strings read from a COFF file. */ /* Free up the external symbols and strings read from a COFF file. */
boolean bfd_boolean
_bfd_coff_free_symbols (abfd) _bfd_coff_free_symbols (abfd)
bfd *abfd; bfd *abfd;
{ {
@ -1705,7 +1705,7 @@ _bfd_coff_free_symbols (abfd)
free (obj_coff_strings (abfd)); free (obj_coff_strings (abfd));
obj_coff_strings (abfd) = NULL; obj_coff_strings (abfd) = NULL;
} }
return true; return TRUE;
} }
/* Read a symbol table into freshly bfd_allocated memory, swap it, and /* Read a symbol table into freshly bfd_allocated memory, swap it, and
@ -1777,7 +1777,7 @@ coff_get_normalized_symtab (abfd)
} }
/* Free the raw symbols, but not the strings (if we have them). */ /* Free the raw symbols, but not the strings (if we have them). */
obj_coff_keep_strings (abfd) = true; obj_coff_keep_strings (abfd) = TRUE;
if (! _bfd_coff_free_symbols (abfd)) if (! _bfd_coff_free_symbols (abfd))
return NULL; return NULL;
@ -1909,7 +1909,7 @@ coff_make_empty_symbol (abfd)
new->symbol.section = 0; new->symbol.section = 0;
new->native = 0; new->native = 0;
new->lineno = (alent *) NULL; new->lineno = (alent *) NULL;
new->done_lineno = false; new->done_lineno = FALSE;
new->symbol.the_bfd = abfd; new->symbol.the_bfd = abfd;
return &new->symbol; return &new->symbol;
} }
@ -1935,7 +1935,7 @@ coff_bfd_make_debug_symbol (abfd, ptr, sz)
new->symbol.section = bfd_abs_section_ptr; new->symbol.section = bfd_abs_section_ptr;
new->symbol.flags = BSF_DEBUGGING; new->symbol.flags = BSF_DEBUGGING;
new->lineno = (alent *) NULL; new->lineno = (alent *) NULL;
new->done_lineno = false; new->done_lineno = FALSE;
new->symbol.the_bfd = abfd; new->symbol.the_bfd = abfd;
return &new->symbol; return &new->symbol;
} }
@ -1957,7 +1957,7 @@ coff_get_symbol_info (abfd, symbol, ret)
/* Return the COFF syment for a symbol. */ /* Return the COFF syment for a symbol. */
boolean bfd_boolean
bfd_coff_get_syment (abfd, symbol, psyment) bfd_coff_get_syment (abfd, symbol, psyment)
bfd *abfd; bfd *abfd;
asymbol *symbol; asymbol *symbol;
@ -1969,7 +1969,7 @@ bfd_coff_get_syment (abfd, symbol, psyment)
if (csym == NULL || csym->native == NULL) if (csym == NULL || csym->native == NULL)
{ {
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return false; return FALSE;
} }
*psyment = csym->native->u.syment; *psyment = csym->native->u.syment;
@ -1980,12 +1980,12 @@ bfd_coff_get_syment (abfd, symbol, psyment)
/* FIXME: We should handle fix_line here. */ /* FIXME: We should handle fix_line here. */
return true; return TRUE;
} }
/* Return the COFF auxent for a symbol. */ /* Return the COFF auxent for a symbol. */
boolean bfd_boolean
bfd_coff_get_auxent (abfd, symbol, indx, pauxent) bfd_coff_get_auxent (abfd, symbol, indx, pauxent)
bfd *abfd; bfd *abfd;
asymbol *symbol; asymbol *symbol;
@ -2002,7 +2002,7 @@ bfd_coff_get_auxent (abfd, symbol, indx, pauxent)
|| indx >= csym->native->u.syment.n_numaux) || indx >= csym->native->u.syment.n_numaux)
{ {
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return false; return FALSE;
} }
ent = csym->native + indx + 1; ent = csym->native + indx + 1;
@ -2024,7 +2024,7 @@ bfd_coff_get_auxent (abfd, symbol, indx, pauxent)
((combined_entry_type *) pauxent->x_csect.x_scnlen.p ((combined_entry_type *) pauxent->x_csect.x_scnlen.p
- obj_raw_syments (abfd)); - obj_raw_syments (abfd));
return true; return TRUE;
} }
/* Print out information about COFF symbol. */ /* Print out information about COFF symbol. */
@ -2191,19 +2191,19 @@ coff_print_symbol (abfd, filep, symbol, how)
function for the is_local_label_name entry point, but some may function for the is_local_label_name entry point, but some may
override it. */ override it. */
boolean bfd_boolean
_bfd_coff_is_local_label_name (abfd, name) _bfd_coff_is_local_label_name (abfd, name)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
const char *name; const char *name;
{ {
return (boolean) (name[0] == '.' && name[1] == 'L'); return name[0] == '.' && name[1] == 'L';
} }
/* Provided a BFD, a section and an offset (in bytes, not octets) into the /* Provided a BFD, a section and an offset (in bytes, not octets) into the
section, calculate and return the name of the source file and the line section, calculate and return the name of the source file and the line
nearest to the wanted location. */ nearest to the wanted location. */
boolean bfd_boolean
coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
functionname_ptr, line_ptr) functionname_ptr, line_ptr)
bfd *abfd; bfd *abfd;
@ -2214,7 +2214,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
const char **functionname_ptr; const char **functionname_ptr;
unsigned int *line_ptr; unsigned int *line_ptr;
{ {
boolean found; bfd_boolean found;
unsigned int i; unsigned int i;
unsigned int line_base; unsigned int line_base;
coff_data_type *cof = coff_data (abfd); coff_data_type *cof = coff_data (abfd);
@ -2231,17 +2231,17 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
&found, filename_ptr, &found, filename_ptr,
functionname_ptr, line_ptr, functionname_ptr, line_ptr,
&coff_data(abfd)->line_info)) &coff_data(abfd)->line_info))
return false; return FALSE;
if (found) if (found)
return true; return TRUE;
/* Also try examining DWARF2 debugging information. */ /* Also try examining DWARF2 debugging information. */
if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset,
filename_ptr, functionname_ptr, filename_ptr, functionname_ptr,
line_ptr, 0, line_ptr, 0,
&coff_data(abfd)->dwarf2_find_line_info)) &coff_data(abfd)->dwarf2_find_line_info))
return true; return TRUE;
*filename_ptr = 0; *filename_ptr = 0;
*functionname_ptr = 0; *functionname_ptr = 0;
@ -2249,15 +2249,15 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
/* Don't try and find line numbers in a non coff file */ /* Don't try and find line numbers in a non coff file */
if (!bfd_family_coff (abfd)) if (!bfd_family_coff (abfd))
return false; return FALSE;
if (cof == NULL) if (cof == NULL)
return false; return FALSE;
/* Find the first C_FILE symbol. */ /* Find the first C_FILE symbol. */
p = cof->raw_syments; p = cof->raw_syments;
if (!p) if (!p)
return false; return FALSE;
pend = p + cof->raw_syment_count; pend = p + cof->raw_syment_count;
while (p < pend) while (p < pend)
@ -2410,13 +2410,13 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
sec_data->line_base = line_base; sec_data->line_base = line_base;
} }
return true; return TRUE;
} }
int int
coff_sizeof_headers (abfd, reloc) coff_sizeof_headers (abfd, reloc)
bfd *abfd; bfd *abfd;
boolean reloc; bfd_boolean reloc;
{ {
size_t size; size_t size;
@ -2434,7 +2434,7 @@ coff_sizeof_headers (abfd, reloc)
} }
/* Change the class of a coff symbol held by BFD. */ /* Change the class of a coff symbol held by BFD. */
boolean bfd_boolean
bfd_coff_set_symbol_class (abfd, symbol, class) bfd_coff_set_symbol_class (abfd, symbol, class)
bfd * abfd; bfd * abfd;
asymbol * symbol; asymbol * symbol;
@ -2446,7 +2446,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class)
if (csym == NULL) if (csym == NULL)
{ {
bfd_set_error (bfd_error_invalid_operation); bfd_set_error (bfd_error_invalid_operation);
return false; return FALSE;
} }
else if (csym->native == NULL) else if (csym->native == NULL)
{ {
@ -2460,7 +2460,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class)
native = (combined_entry_type *) bfd_zalloc (abfd, amt); native = (combined_entry_type *) bfd_zalloc (abfd, amt);
if (native == NULL) if (native == NULL)
return false; return FALSE;
native->u.syment.n_type = T_NULL; native->u.syment.n_type = T_NULL;
native->u.syment.n_sclass = class; native->u.syment.n_sclass = class;
@ -2496,5 +2496,5 @@ bfd_coff_set_symbol_class (abfd, symbol, class)
csym->native->u.syment.n_sclass = class; csym->native->u.syment.n_sclass = class;
} }
return true; return TRUE;
} }

File diff suppressed because it is too large Load diff

View file

@ -83,21 +83,21 @@ FUNCTION
core_file_matches_executable_p core_file_matches_executable_p
SYNOPSIS SYNOPSIS
boolean core_file_matches_executable_p bfd_boolean core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd); (bfd *core_bfd, bfd *exec_bfd);
DESCRIPTION DESCRIPTION
Return <<true>> if the core file attached to @var{core_bfd} Return <<TRUE>> if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached to was generated by a run of the executable file attached to
@var{exec_bfd}, <<false>> otherwise. @var{exec_bfd}, <<FALSE>> otherwise.
*/ */
boolean bfd_boolean
core_file_matches_executable_p (core_bfd, exec_bfd) core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd, *exec_bfd; bfd *core_bfd, *exec_bfd;
{ {
if ((core_bfd->format != bfd_core) || (exec_bfd->format != bfd_object)) { if ((core_bfd->format != bfd_core) || (exec_bfd->format != bfd_object)) {
bfd_set_error (bfd_error_wrong_format); bfd_set_error (bfd_error_wrong_format);
return false; return FALSE;
} }
return BFD_SEND (core_bfd, _core_file_matches_executable_p, return BFD_SEND (core_bfd, _core_file_matches_executable_p,

View file

@ -1,5 +1,5 @@
/* BFD support for the AMD 29000 architecture. /* BFD support for the AMD 29000 architecture.
Copyright 1992, 2000 Free Software Foundation, Inc. Copyright 1992, 2000, 2002 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support. Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_a29k_arch =
"a29k", "a29k",
"a29k", "a29k",
4, 4,
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,

View file

@ -1,5 +1,5 @@
/* BFD support for the Alpha architecture. /* BFD support for the Alpha architecture.
Copyright 1992, 1993, 1998, 2000 Free Software Foundation, Inc. Copyright 1992, 1993, 1998, 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -42,10 +42,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* These exist only so that we can resonably disassemble PALcode. */ /* These exist only so that we can resonably disassemble PALcode. */
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
N (64, 64, bfd_mach_alpha_ev4, "alpha:ev4", false, NN(1)), N (64, 64, bfd_mach_alpha_ev4, "alpha:ev4", FALSE, NN(1)),
N (64, 64, bfd_mach_alpha_ev5, "alpha:ev5", false, NN(2)), N (64, 64, bfd_mach_alpha_ev5, "alpha:ev5", FALSE, NN(2)),
N (64, 64, bfd_mach_alpha_ev6, "alpha:ev6", false, 0), N (64, 64, bfd_mach_alpha_ev6, "alpha:ev6", FALSE, 0),
}; };
const bfd_arch_info_type bfd_alpha_arch = const bfd_arch_info_type bfd_alpha_arch =
N (64, 64, 0, "alpha", true, NN(0)); N (64, 64, 0, "alpha", TRUE, NN(0));

View file

@ -1,5 +1,5 @@
/* BFD support for the ARC processor /* BFD support for the ARC processor
Copyright 1994, 1995, 1997, 2001 Free Software Foundation, Inc. Copyright 1994, 1995, 1997, 2001, 2002 Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com). Contributed by Doug Evans (dje@cygnus.com).
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -40,15 +40,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
ARC ( bfd_mach_arc_5, "arc5", false, &arch_info_struct[1] ), ARC ( bfd_mach_arc_5, "arc5", FALSE, &arch_info_struct[1] ),
ARC ( bfd_mach_arc_5, "base", false, &arch_info_struct[2] ), ARC ( bfd_mach_arc_5, "base", FALSE, &arch_info_struct[2] ),
ARC ( bfd_mach_arc_6, "arc6", false, &arch_info_struct[3] ), ARC ( bfd_mach_arc_6, "arc6", FALSE, &arch_info_struct[3] ),
ARC ( bfd_mach_arc_7, "arc7", false, &arch_info_struct[4] ), ARC ( bfd_mach_arc_7, "arc7", FALSE, &arch_info_struct[4] ),
ARC ( bfd_mach_arc_8, "arc8", false, NULL ), ARC ( bfd_mach_arc_8, "arc8", FALSE, NULL ),
}; };
const bfd_arch_info_type bfd_arc_arch = const bfd_arch_info_type bfd_arc_arch =
ARC ( bfd_mach_arc_6, "arc", true, &arch_info_struct[0] ); ARC ( bfd_mach_arc_6, "arc", TRUE, &arch_info_struct[0] );
/* Utility routines. */ /* Utility routines. */

View file

@ -24,7 +24,7 @@
static const bfd_arch_info_type * compatible static const bfd_arch_info_type * compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
static boolean scan static bfd_boolean scan
PARAMS ((const struct bfd_arch_info *, const char *)); PARAMS ((const struct bfd_arch_info *, const char *));
/* This routine is provided two arch_infos and works out which ARM /* This routine is provided two arch_infos and works out which ARM
@ -98,7 +98,7 @@ processors[] =
{ bfd_mach_arm_XScale, "xscale" } { bfd_mach_arm_XScale, "xscale" }
}; };
static boolean static bfd_boolean
scan (info, string) scan (info, string)
const struct bfd_arch_info * info; const struct bfd_arch_info * info;
const char * string; const char * string;
@ -107,7 +107,7 @@ scan (info, string)
/* First test for an exact match. */ /* First test for an exact match. */
if (strcasecmp (string, info->printable_name) == 0) if (strcasecmp (string, info->printable_name) == 0)
return true; return TRUE;
/* Next check for a processor name instead of an Architecture name. */ /* Next check for a processor name instead of an Architecture name. */
for (i = sizeof (processors) / sizeof (processors[0]); i--;) for (i = sizeof (processors) / sizeof (processors[0]); i--;)
@ -117,13 +117,13 @@ scan (info, string)
} }
if (i != -1 && info->mach == processors [i].mach) if (i != -1 && info->mach == processors [i].mach)
return true; return TRUE;
/* Finally check for the default architecture. */ /* Finally check for the default architecture. */
if (strcasecmp (string, "arm") == 0) if (strcasecmp (string, "arm") == 0)
return info->the_default; return info->the_default;
return false; return FALSE;
} }
#define N(number, print, default, next) \ #define N(number, print, default, next) \
@ -131,17 +131,17 @@ scan (info, string)
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
N (bfd_mach_arm_2, "armv2", false, & arch_info_struct[1]), N (bfd_mach_arm_2, "armv2", FALSE, & arch_info_struct[1]),
N (bfd_mach_arm_2a, "armv2a", false, & arch_info_struct[2]), N (bfd_mach_arm_2a, "armv2a", FALSE, & arch_info_struct[2]),
N (bfd_mach_arm_3, "armv3", false, & arch_info_struct[3]), N (bfd_mach_arm_3, "armv3", FALSE, & arch_info_struct[3]),
N (bfd_mach_arm_3M, "armv3m", false, & arch_info_struct[4]), N (bfd_mach_arm_3M, "armv3m", FALSE, & arch_info_struct[4]),
N (bfd_mach_arm_4, "armv4", false, & arch_info_struct[5]), N (bfd_mach_arm_4, "armv4", FALSE, & arch_info_struct[5]),
N (bfd_mach_arm_4T, "armv4t", false, & arch_info_struct[6]), N (bfd_mach_arm_4T, "armv4t", FALSE, & arch_info_struct[6]),
N (bfd_mach_arm_5, "armv5", false, & arch_info_struct[7]), N (bfd_mach_arm_5, "armv5", FALSE, & arch_info_struct[7]),
N (bfd_mach_arm_5T, "armv5t", false, & arch_info_struct[8]), N (bfd_mach_arm_5T, "armv5t", FALSE, & arch_info_struct[8]),
N (bfd_mach_arm_5TE, "armv5te", false, & arch_info_struct[9]), N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]),
N (bfd_mach_arm_XScale, "xscale", false, NULL) N (bfd_mach_arm_XScale, "xscale", FALSE, NULL)
}; };
const bfd_arch_info_type bfd_arm_arch = const bfd_arch_info_type bfd_arm_arch =
N (0, "arm", true, & arch_info_struct[0]); N (0, "arm", TRUE, & arch_info_struct[0]);

View file

@ -1,5 +1,5 @@
/* BFD library support routines for the AVR architecture. /* BFD library support routines for the AVR architecture.
Copyright 1999, 2000 Free Software Foundation, Inc. Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru> Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -44,23 +44,23 @@ static const bfd_arch_info_type *compatible
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
/* AT90S1200, ATtiny1x, ATtiny28 */ /* AT90S1200, ATtiny1x, ATtiny28 */
N (16, bfd_mach_avr1, "avr:1", false, & arch_info_struct[1]), N (16, bfd_mach_avr1, "avr:1", FALSE, & arch_info_struct[1]),
/* AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22 */ /* AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22 */
N (16, bfd_mach_avr2, "avr:2", false, & arch_info_struct[2]), N (16, bfd_mach_avr2, "avr:2", FALSE, & arch_info_struct[2]),
/* ATmega103, ATmega603 */ /* ATmega103, ATmega603 */
N (22, bfd_mach_avr3, "avr:3", false, & arch_info_struct[3]), N (22, bfd_mach_avr3, "avr:3", FALSE, & arch_info_struct[3]),
/* ATmega83, ATmega85 */ /* ATmega83, ATmega85 */
N (16, bfd_mach_avr4, "avr:4", false, & arch_info_struct[4]), N (16, bfd_mach_avr4, "avr:4", FALSE, & arch_info_struct[4]),
/* ATmega161, ATmega163, ATmega32, AT94K */ /* ATmega161, ATmega163, ATmega32, AT94K */
N (22, bfd_mach_avr5, "avr:5", false, NULL) N (22, bfd_mach_avr5, "avr:5", FALSE, NULL)
}; };
const bfd_arch_info_type bfd_avr_arch = const bfd_arch_info_type bfd_avr_arch =
N (16, bfd_mach_avr2, "avr", true, & arch_info_struct[0]); N (16, bfd_mach_avr2, "avr", TRUE, & arch_info_struct[0]);
/* This routine is provided two arch_infos and works out which AVR /* This routine is provided two arch_infos and works out which AVR
machine which would be compatible with both and returns a pointer machine which would be compatible with both and returns a pointer

View file

@ -1,5 +1,5 @@
/* BFD support for the Axis CRIS architecture. /* BFD support for the Axis CRIS architecture.
Copyright 2000 Free Software Foundation, Inc. Copyright 2000, 2002 Free Software Foundation, Inc.
Contributed by Axis Communications AB. Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson. Written by Hans-Peter Nilsson.
@ -38,7 +38,7 @@ bfd_cris_arch =
"cris", /* The printable name is the same. */ "cris", /* The printable name is the same. */
1, /* Section alignment power; each section 1, /* Section alignment power; each section
is aligned to (only) 2^1 bytes. */ is aligned to (only) 2^1 bytes. */
true, /* This is the default "machine", since TRUE, /* This is the default "machine", since
there's only one. */ there's only one. */
bfd_default_compatible, /* A default function for testing bfd_default_compatible, /* A default function for testing
"machine" compatibility of two "machine" compatibility of two

View file

@ -1,5 +1,5 @@
/* BFD support for the D10V processor /* BFD support for the D10V processor
Copyright 1996, 1999, 2000 Free Software Foundation, Inc. Copyright 1996, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com). Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ static const bfd_arch_info_type d10v_ts3_info =
"d10v", "d10v",
"d10v:ts3", "d10v:ts3",
4, /* section alignment power */ 4, /* section alignment power */
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,
@ -48,7 +48,7 @@ static const bfd_arch_info_type d10v_ts2_info =
"d10v", "d10v",
"d10v:ts2", "d10v:ts2",
4, /* section alignment power */ 4, /* section alignment power */
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&d10v_ts3_info, &d10v_ts3_info,
@ -64,7 +64,7 @@ const bfd_arch_info_type bfd_d10v_arch =
"d10v", "d10v",
"d10v", "d10v",
4, /* section alignment power */ 4, /* section alignment power */
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&d10v_ts2_info, &d10v_ts2_info,

View file

@ -1,5 +1,5 @@
/* BFD support for the Mitsubishi D30V processor /* BFD support for the Mitsubishi D30V processor
Copyright 1997 Free Software Foundation, Inc. Copyright 1997, 2002 Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com). Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_d30v_arch =
"d30v", "d30v",
"d30v", "d30v",
4, /* section alignment power */ 4, /* section alignment power */
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,

View file

@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_dlx_arch =
"dlx", "dlx",
"dlx", "dlx",
4, 4,
true, /* The one and only. */ TRUE, /* The one and only. */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,

View file

@ -1,5 +1,5 @@
/* BFD support for the FR30 processor. /* BFD support for the FR30 processor.
Copyright 1998 Free Software Foundation, Inc. Copyright 1998, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_fr30_arch =
"fr30", /* architecture name */ "fr30", /* architecture name */
"fr30", /* printable name */ "fr30", /* printable name */
4, /* section align power */ 4, /* section align power */
true, /* the default ? */ TRUE, /* the default ? */
bfd_default_compatible, /* architecture comparison fn */ bfd_default_compatible, /* architecture comparison fn */
bfd_default_scan, /* string to architecture convert fn */ bfd_default_scan, /* string to architecture convert fn */
NULL /* next in list */ NULL /* next in list */

View file

@ -1,5 +1,5 @@
/* BFD support for the FRV processor. /* BFD support for the FRV processor.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -45,20 +45,20 @@ enum {
} }
static const bfd_arch_info_type arch_info_300 static const bfd_arch_info_type arch_info_300
= FRV_ARCH (bfd_mach_fr300, "fr300", false, (bfd_arch_info_type *)0); = FRV_ARCH (bfd_mach_fr300, "fr300", FALSE, (bfd_arch_info_type *)0);
static const bfd_arch_info_type arch_info_400 static const bfd_arch_info_type arch_info_400
= FRV_ARCH (bfd_mach_fr400, "fr400", false, &arch_info_300); = FRV_ARCH (bfd_mach_fr400, "fr400", FALSE, &arch_info_300);
static const bfd_arch_info_type arch_info_500 static const bfd_arch_info_type arch_info_500
= FRV_ARCH (bfd_mach_fr500, "fr500", false, &arch_info_400); = FRV_ARCH (bfd_mach_fr500, "fr500", FALSE, &arch_info_400);
static const bfd_arch_info_type arch_info_simple static const bfd_arch_info_type arch_info_simple
= FRV_ARCH (bfd_mach_frvsimple, "simple", false, &arch_info_500); = FRV_ARCH (bfd_mach_frvsimple, "simple", FALSE, &arch_info_500);
static const bfd_arch_info_type arch_info_tomcat static const bfd_arch_info_type arch_info_tomcat
= FRV_ARCH (bfd_mach_frvtomcat, "tomcat", false, &arch_info_simple); = FRV_ARCH (bfd_mach_frvtomcat, "tomcat", FALSE, &arch_info_simple);
const bfd_arch_info_type bfd_frv_arch const bfd_arch_info_type bfd_frv_arch
= FRV_ARCH (bfd_mach_frv, "frv", true, &arch_info_tomcat); = FRV_ARCH (bfd_mach_frv, "frv", TRUE, &arch_info_tomcat);

View file

@ -23,35 +23,35 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h" #include "sysdep.h"
#include "libbfd.h" #include "libbfd.h"
static boolean h8300_scan static bfd_boolean h8300_scan
PARAMS ((const struct bfd_arch_info *, const char *)); PARAMS ((const struct bfd_arch_info *, const char *));
static const bfd_arch_info_type * compatible static const bfd_arch_info_type * compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
static boolean static bfd_boolean
h8300_scan (info, string) h8300_scan (info, string)
const struct bfd_arch_info *info; const struct bfd_arch_info *info;
const char *string; const char *string;
{ {
if (*string != 'h' && *string != 'H') if (*string != 'h' && *string != 'H')
return false; return FALSE;
string++; string++;
if (*string != '8') if (*string != '8')
return false; return FALSE;
string++; string++;
if (*string == '/') if (*string == '/')
string++; string++;
if (*string != '3') if (*string != '3')
return false; return FALSE;
string++; string++;
if (*string != '0') if (*string != '0')
return false; return FALSE;
string++; string++;
if (*string != '0') if (*string != '0')
return false; return FALSE;
string++; string++;
if (*string == '-') if (*string == '-')
string++; string++;
@ -107,7 +107,7 @@ static const bfd_arch_info_type h8300s_info_struct =
"h8300s", /* arch_name */ "h8300s", /* arch_name */
"h8300s", /* printable name */ "h8300s", /* printable name */
1, 1,
false, /* the default machine */ FALSE, /* the default machine */
compatible, compatible,
h8300_scan, h8300_scan,
0 0
@ -123,7 +123,7 @@ static const bfd_arch_info_type h8300h_info_struct =
"h8300h", /* arch_name */ "h8300h", /* arch_name */
"h8300h", /* printable name */ "h8300h", /* printable name */
1, 1,
false, /* the default machine */ FALSE, /* the default machine */
compatible, compatible,
h8300_scan, h8300_scan,
&h8300s_info_struct &h8300s_info_struct
@ -139,7 +139,7 @@ const bfd_arch_info_type bfd_h8300_arch =
"h8300", /* arch_name */ "h8300", /* arch_name */
"h8300", /* printable name */ "h8300", /* printable name */
1, 1,
true, /* the default machine */ TRUE, /* the default machine */
compatible, compatible,
h8300_scan, h8300_scan,
&h8300h_info_struct &h8300h_info_struct

View file

@ -1,5 +1,5 @@
/* BFD library support routines for the H8/500 architecture. /* BFD library support routines for the H8/500 architecture.
Copyright 1993, 1995, 2000, 2001 Free Software Foundation, Inc. Copyright 1993, 1995, 2000, 2001, 2002 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support. Hacked by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -22,7 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h" #include "sysdep.h"
#include "libbfd.h" #include "libbfd.h"
static boolean scan_mach PARAMS ((const struct bfd_arch_info *, const char *)); static bfd_boolean scan_mach
PARAMS ((const struct bfd_arch_info *, const char *));
#if 0 #if 0
/* /*
@ -119,15 +120,15 @@ howto8_pcrel_callback (abfd, reloc_entry, symbol_in, data,
} }
static reloc_howto_type howto_16 static reloc_howto_type howto_16
= NEWHOWTO(howto16_callback,"abs16",1,false,false); = NEWHOWTO (howto16_callback, "abs16", 1, FALSE, FALSE);
static reloc_howto_type howto_8 static reloc_howto_type howto_8
= NEWHOWTO(howto8_callback,"abs8",0,false,false); = NEWHOWTO (howto8_callback, "abs8", 0, FALSE, FALSE);
static reloc_howto_type howto_8_FFnn static reloc_howto_type howto_8_FFnn
= NEWHOWTO(howto8_FFnn_callback,"ff00+abs8",0,false,false); = NEWHOWTO (howto8_FFnn_callback, "ff00+abs8", 0, FALSE, FALSE);
static reloc_howto_type howto_8_pcrel static reloc_howto_type howto_8_pcrel
= NEWHOWTO(howto8_pcrel_callback,"pcrel8",0,false,true); = NEWHOWTO (howto8_pcrel_callback, "pcrel8", 0, FALSE, TRUE);
static reloc_howto_type * static reloc_howto_type *
local_bfd_reloc_type_lookup (arch, code) local_bfd_reloc_type_lookup (arch, code)
@ -148,16 +149,20 @@ local_bfd_reloc_type_lookup (arch, code)
} }
#endif #endif
static boolean static bfd_boolean
scan_mach (info, string) scan_mach (info, string)
const struct bfd_arch_info *info ATTRIBUTE_UNUSED; const struct bfd_arch_info *info ATTRIBUTE_UNUSED;
const char *string; const char *string;
{ {
if (strcmp(string,"h8/500") == 0) return true; if (strcmp (string,"h8/500") == 0)
if (strcmp(string,"H8/500") == 0) return true; return TRUE;
if (strcmp(string,"h8500") == 0) return true; if (strcmp (string,"H8/500") == 0)
if (strcmp(string,"H8500") == 0) return true; return TRUE;
return false; if (strcmp (string,"h8500") == 0)
return TRUE;
if (strcmp (string,"H8500") == 0)
return TRUE;
return FALSE;
} }
#if 0 /* not used currently */ #if 0 /* not used currently */
@ -185,7 +190,7 @@ const bfd_arch_info_type bfd_h8500_arch =
"h8500", /* arch_name */ "h8500", /* arch_name */
"h8500", /* printable name */ "h8500", /* printable name */
1, 1,
true, /* the default machine */ TRUE, /* the default machine */
bfd_default_compatible, bfd_default_compatible,
scan_mach, scan_mach,
0, 0,

View file

@ -1,5 +1,6 @@
/* BFD support for the HP Precision Architecture architecture. /* BFD support for the HP Precision Architecture architecture.
Copyright 1992, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. Copyright 1992, 1995, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +32,7 @@ static const bfd_arch_info_type bfd_hppa10_arch =
"hppa", "hppa",
"hppa1.0", "hppa1.0",
3, 3,
true, /* Unless we use 1.1 specific features */ TRUE, /* Unless we use 1.1 specific features */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,
@ -48,7 +49,7 @@ static const bfd_arch_info_type bfd_hppa20_arch =
"hppa", "hppa",
"hppa2.0", "hppa2.0",
3, 3,
false, /* Unless we use 1.1 specific features */ FALSE, /* Unless we use 1.1 specific features */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&bfd_hppa10_arch, &bfd_hppa10_arch,
@ -65,7 +66,7 @@ static const bfd_arch_info_type bfd_hppa20w_arch =
"hppa", "hppa",
"hppa2.0w", "hppa2.0w",
3, 3,
false, /* Unless we use 1.1 specific features */ FALSE, /* Unless we use 1.1 specific features */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&bfd_hppa20_arch, &bfd_hppa20_arch,
@ -81,7 +82,7 @@ const bfd_arch_info_type bfd_hppa_arch =
"hppa", "hppa",
"hppa1.1", "hppa1.1",
3, 3,
false, /* 1.1 specific features used */ FALSE, /* 1.1 specific features used */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&bfd_hppa20w_arch, &bfd_hppa20w_arch,

View file

@ -36,7 +36,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"i370", "i370",
"i370:360", "i370:360",
3, 3,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[1] &arch_info_struct[1]
@ -50,7 +50,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"i370", "i370",
"i370:370", "i370:370",
3, 3,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0 0
@ -67,7 +67,7 @@ const bfd_arch_info_type bfd_i370_arch =
"i370", "i370",
"i370:common", "i370:common",
3, 3,
true, /* the default */ TRUE, /* the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[0] &arch_info_struct[0]

View file

@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_i386_arch_intel_syntax =
"i386:intel", "i386:intel",
"i386:intel", "i386:intel",
3, 3,
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,
@ -47,7 +47,7 @@ const bfd_arch_info_type bfd_x86_64_arch_intel_syntax =
"i386:intel", "i386:intel",
"i386:x86-64:intel", "i386:x86-64:intel",
3, 3,
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&bfd_i386_arch_intel_syntax, &bfd_i386_arch_intel_syntax,
@ -62,7 +62,7 @@ static const bfd_arch_info_type i8086_arch =
"i8086", "i8086",
"i8086", "i8086",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&bfd_x86_64_arch_intel_syntax, &bfd_x86_64_arch_intel_syntax,
@ -78,7 +78,7 @@ const bfd_arch_info_type bfd_x86_64_arch =
"i386", "i386",
"i386:x86-64", "i386:x86-64",
3, 3,
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&i8086_arch, &i8086_arch,
@ -94,7 +94,7 @@ const bfd_arch_info_type bfd_i386_arch =
"i386", "i386",
"i386", "i386",
3, 3,
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&bfd_x86_64_arch &bfd_x86_64_arch

View file

@ -1,5 +1,5 @@
/* BFD support for the Intel 860 architecture. /* BFD support for the Intel 860 architecture.
Copyright 1992, 1995, 2000 Free Software Foundation, Inc. Copyright 1992, 1995, 2000, 2002 Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in cpu-i386.c Created mostly by substituting "860" for "386" in cpu-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995 Harry Dolan <dolan@ssd.intel.com>, October 1995
@ -33,7 +33,7 @@ const bfd_arch_info_type bfd_i860_arch =
"i860", /* Architecture name */ "i860", /* Architecture name */
"i860", /* Printable name */ "i860", /* Printable name */
3, /* Section alignment exponent */ 3, /* Section alignment exponent */
true, /* Is this the default architecture? */ TRUE, /* Is this the default architecture? */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, /* Next in list */ 0, /* Next in list */

View file

@ -1,5 +1,5 @@
/* BFD library support routines for the i960 architecture. /* BFD library support routines for the i960 architecture.
Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000, 2001 Copyright 1990, 1991, 1993, 1994, 1996, 1999, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support. Hacked by Steve Chamberlain of Cygnus Support.
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h" #include "sysdep.h"
#include "libbfd.h" #include "libbfd.h"
static boolean scan_960_mach static bfd_boolean scan_960_mach
PARAMS ((const bfd_arch_info_type *, const char *)); PARAMS ((const bfd_arch_info_type *, const char *));
static const bfd_arch_info_type *compatible static const bfd_arch_info_type *compatible
PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
@ -32,13 +32,13 @@ static const bfd_arch_info_type *compatible
could possibly refer to the i960 machine pointed at in the could possibly refer to the i960 machine pointed at in the
info_struct pointer */ info_struct pointer */
static boolean static bfd_boolean
scan_960_mach (ap, string) scan_960_mach (ap, string)
const bfd_arch_info_type *ap; const bfd_arch_info_type *ap;
const char *string; const char *string;
{ {
unsigned long machine; unsigned long machine;
int fail_because_not_80960 = false; int fail_because_not_80960 = FALSE;
/* Look for the string i960 at the front of the string. */ /* Look for the string i960 at the front of the string. */
if (strncasecmp ("i960", string, 4) == 0) if (strncasecmp ("i960", string, 4) == 0)
@ -51,7 +51,7 @@ scan_960_mach (ap, string)
/* "i960:*" is valid, anything else is not. */ /* "i960:*" is valid, anything else is not. */
if (* string != ':') if (* string != ':')
return false; return FALSE;
string ++; string ++;
} }
@ -61,16 +61,16 @@ scan_960_mach (ap, string)
{ {
string += 5; string += 5;
/* Sett his to true here. If a correct matching postfix /* Set this to TRUE here. If a correct matching postfix
is detected below it will be reset to false. */ is detected below it will be reset to FALSE. */
fail_because_not_80960 = true; fail_because_not_80960 = TRUE;
} }
/* No match, can't be us. */ /* No match, can't be us. */
else else
return false; return FALSE;
if (* string == '\0') if (* string == '\0')
return false; return FALSE;
if (string[0] == 'c' && string[1] == 'o' && string[2] == 'r' && if (string[0] == 'c' && string[1] == 'o' && string[2] == 'r' &&
string[3] == 'e' && string[4] == '\0') string[3] == 'e' && string[4] == '\0')
@ -80,19 +80,19 @@ scan_960_mach (ap, string)
else if (strcasecmp (string, "kb_sb") == 0) else if (strcasecmp (string, "kb_sb") == 0)
machine = bfd_mach_i960_kb_sb; machine = bfd_mach_i960_kb_sb;
else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char. */ else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char. */
return false; return FALSE;
else if (string[0] == 'k' && string[1] == 'b') else if (string[0] == 'k' && string[1] == 'b')
{ machine = bfd_mach_i960_kb_sb; fail_because_not_80960 = false; } { machine = bfd_mach_i960_kb_sb; fail_because_not_80960 = FALSE; }
else if (string[0] == 's' && string[1] == 'b') else if (string[0] == 's' && string[1] == 'b')
machine = bfd_mach_i960_kb_sb; machine = bfd_mach_i960_kb_sb;
else if (string[0] == 'm' && string[1] == 'c') else if (string[0] == 'm' && string[1] == 'c')
{ machine = bfd_mach_i960_mc; fail_because_not_80960 = false; } { machine = bfd_mach_i960_mc; fail_because_not_80960 = FALSE; }
else if (string[0] == 'x' && string[1] == 'a') else if (string[0] == 'x' && string[1] == 'a')
machine = bfd_mach_i960_xa; machine = bfd_mach_i960_xa;
else if (string[0] == 'c' && string[1] == 'a') else if (string[0] == 'c' && string[1] == 'a')
{ machine = bfd_mach_i960_ca; fail_because_not_80960 = false; } { machine = bfd_mach_i960_ca; fail_because_not_80960 = FALSE; }
else if (string[0] == 'k' && string[1] == 'a') else if (string[0] == 'k' && string[1] == 'a')
{ machine = bfd_mach_i960_ka_sa; fail_because_not_80960 = false; } { machine = bfd_mach_i960_ka_sa; fail_because_not_80960 = FALSE; }
else if (string[0] == 's' && string[1] == 'a') else if (string[0] == 's' && string[1] == 'a')
machine = bfd_mach_i960_ka_sa; machine = bfd_mach_i960_ka_sa;
else if (string[0] == 'j' && string[1] == 'x') else if (string[0] == 'j' && string[1] == 'x')
@ -100,15 +100,15 @@ scan_960_mach (ap, string)
else if (string[0] == 'h' && string[1] == 'x') else if (string[0] == 'h' && string[1] == 'x')
machine = bfd_mach_i960_hx; machine = bfd_mach_i960_hx;
else else
return false; return FALSE;
if (fail_because_not_80960) if (fail_because_not_80960)
return false; return FALSE;
if (machine == ap->mach) if (machine == ap->mach)
return true; return TRUE;
return false; return FALSE;
} }
/* This routine is provided two arch_infos and works out the i960 /* This routine is provided two arch_infos and works out the i960
@ -169,14 +169,14 @@ compatible (a,b)
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
N(bfd_mach_i960_ka_sa,"i960:ka_sa",false, &arch_info_struct[1]), N(bfd_mach_i960_ka_sa,"i960:ka_sa",FALSE, &arch_info_struct[1]),
N(bfd_mach_i960_kb_sb,"i960:kb_sb",false, &arch_info_struct[2]), N(bfd_mach_i960_kb_sb,"i960:kb_sb",FALSE, &arch_info_struct[2]),
N(bfd_mach_i960_mc, "i960:mc", false, &arch_info_struct[3]), N(bfd_mach_i960_mc, "i960:mc", FALSE, &arch_info_struct[3]),
N(bfd_mach_i960_xa, "i960:xa", false, &arch_info_struct[4]), N(bfd_mach_i960_xa, "i960:xa", FALSE, &arch_info_struct[4]),
N(bfd_mach_i960_ca, "i960:ca", false, &arch_info_struct[5]), N(bfd_mach_i960_ca, "i960:ca", FALSE, &arch_info_struct[5]),
N(bfd_mach_i960_jx, "i960:jx", false, &arch_info_struct[6]), N(bfd_mach_i960_jx, "i960:jx", FALSE, &arch_info_struct[6]),
N(bfd_mach_i960_hx, "i960:hx", false, 0), N(bfd_mach_i960_hx, "i960:hx", FALSE, 0),
}; };
const bfd_arch_info_type bfd_i960_arch = const bfd_arch_info_type bfd_i960_arch =
N(bfd_mach_i960_core, "i960:core", true, &arch_info_struct[0]); N(bfd_mach_i960_core, "i960:core", TRUE, &arch_info_struct[0]);

View file

@ -1,5 +1,5 @@
/* BFD support for the ia64 architecture. /* BFD support for the ia64 architecture.
Copyright 1998, 1999, 2000 Free Software Foundation, Inc. Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com> Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_ia64_elf32_arch =
"ia64", "ia64",
"ia64-elf32", "ia64-elf32",
3, /* log2 of section alignment */ 3, /* log2 of section alignment */
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,
@ -48,7 +48,7 @@ const bfd_arch_info_type bfd_ia64_arch =
"ia64", "ia64",
"ia64-elf64", "ia64-elf64",
3, /* log2 of section alignment */ 3, /* log2 of section alignment */
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
&bfd_ia64_elf32_arch, &bfd_ia64_elf32_arch,

View file

@ -1,5 +1,5 @@
/* BFD support for the Scenix IP2xxx processor. /* BFD support for the Scenix IP2xxx processor.
Copyright (C) 2000, 2002 Free Software Foundation, Inc. Copyright 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_ip2k_nonext_arch =
"ip2k", /* Architecture name. */ "ip2k", /* Architecture name. */
"ip2022", /* Machine name. */ "ip2022", /* Machine name. */
1, /* Section align power. */ 1, /* Section align power. */
false, /* The default ? */ FALSE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */ bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */ bfd_default_scan, /* String to architecture convert fn. */
NULL /* Next in list. */ NULL /* Next in list. */
@ -47,7 +47,7 @@ const bfd_arch_info_type bfd_ip2k_arch =
"ip2k", /* Architecture name. */ "ip2k", /* Architecture name. */
"ip2022ext", /* Machine name. */ "ip2022ext", /* Machine name. */
1, /* Section align power. */ 1, /* Section align power. */
true, /* The default ? */ TRUE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */ bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */ bfd_default_scan, /* String to architecture convert fn. */
& bfd_ip2k_nonext_arch /* Next in list. */ & bfd_ip2k_nonext_arch /* Next in list. */

View file

@ -1,5 +1,5 @@
/* BFD support for the Matsushita 10200 processor /* BFD support for the Matsushita 10200 processor
Copyright 1996, 1997 Free Software Foundation, Inc. Copyright 1996, 1997, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_mn10200_arch =
"mn10200", "mn10200",
"mn10200", "mn10200",
2, 2,
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,

View file

@ -1,5 +1,5 @@
/* BFD support for the Matsushita 10300 processor /* BFD support for the Matsushita 10300 processor
Copyright 1996, 1997, 1999 Free Software Foundation, Inc. Copyright 1996, 1997, 1999, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_am33_arch =
"am33", "am33",
"am33", "am33",
2, 2,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,
@ -47,7 +47,7 @@ const bfd_arch_info_type bfd_mn10300_arch =
"mn10300", "mn10300",
"mn10300", "mn10300",
2, 2,
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_am33_arch, &bfd_am33_arch,

View file

@ -1,5 +1,5 @@
/* BFD support for the M32R processor. /* BFD support for the M32R processor.
Copyright 1996, 1999, 2000 Free Software Foundation, Inc. Copyright 1996, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -29,11 +29,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
N (bfd_mach_m32rx, "m32rx", false, NULL) N (bfd_mach_m32rx, "m32rx", FALSE, NULL)
}; };
#undef NEXT #undef NEXT
#define NEXT &arch_info_struct[0] #define NEXT &arch_info_struct[0]
const bfd_arch_info_type bfd_m32r_arch = const bfd_arch_info_type bfd_m32r_arch =
N (bfd_mach_m32r, "m32r", true, NEXT); N (bfd_mach_m32r, "m32r", TRUE, NEXT);

View file

@ -1,5 +1,5 @@
/* BFD support for the Motorola 68HC11 processor /* BFD support for the Motorola 68HC11 processor
Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_m68hc11_arch =
"m68hc11", "m68hc11",
"m68hc11", "m68hc11",
4, /* section alignment power */ 4, /* section alignment power */
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,

View file

@ -1,5 +1,5 @@
/* BFD support for the Motorola 68HC12 processor /* BFD support for the Motorola 68HC12 processor
Copyright 1999, 2000 Free Software Foundation, Inc. Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_m68hc12_arch =
"m68hc12", "m68hc12",
"m68hc12", "m68hc12",
4, /* section alignment power */ 4, /* section alignment power */
true, TRUE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,

View file

@ -1,5 +1,5 @@
/* BFD library support routines for architectures. /* BFD library support routines for architectures.
Copyright 1990, 1991, 1992, 1993, 1994, 1997, 1998, 2000, 2001 Copyright 1990, 1991, 1992, 1993, 1994, 1997, 1998, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support. Hacked by Steve Chamberlain of Cygnus Support.
@ -28,19 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
N(bfd_mach_m68000, "m68k:68000", false, &arch_info_struct[1]), N(bfd_mach_m68000, "m68k:68000", FALSE, &arch_info_struct[1]),
N(bfd_mach_m68008, "m68k:68008", false, &arch_info_struct[2]), N(bfd_mach_m68008, "m68k:68008", FALSE, &arch_info_struct[2]),
N(bfd_mach_m68010, "m68k:68010", false, &arch_info_struct[3]), N(bfd_mach_m68010, "m68k:68010", FALSE, &arch_info_struct[3]),
N(bfd_mach_m68020, "m68k:68020", false, &arch_info_struct[4]), N(bfd_mach_m68020, "m68k:68020", FALSE, &arch_info_struct[4]),
N(bfd_mach_m68030, "m68k:68030", false, &arch_info_struct[5]), N(bfd_mach_m68030, "m68k:68030", FALSE, &arch_info_struct[5]),
N(bfd_mach_m68040, "m68k:68040", false, &arch_info_struct[6]), N(bfd_mach_m68040, "m68k:68040", FALSE, &arch_info_struct[6]),
N(bfd_mach_cpu32, "m68k:cpu32", false, &arch_info_struct[7]), N(bfd_mach_cpu32, "m68k:cpu32", FALSE, &arch_info_struct[7]),
N(bfd_mach_mcf5200,"m68k:5200", false, &arch_info_struct[8]), N(bfd_mach_mcf5200,"m68k:5200", FALSE, &arch_info_struct[8]),
N(bfd_mach_mcf5206e,"m68k:5206e",false, &arch_info_struct[9]), N(bfd_mach_mcf5206e,"m68k:5206e",FALSE, &arch_info_struct[9]),
N(bfd_mach_mcf5307, "m68k:5307", false, &arch_info_struct[10]), N(bfd_mach_mcf5307, "m68k:5307", FALSE, &arch_info_struct[10]),
N(bfd_mach_mcf5407, "m68k:5407", false, &arch_info_struct[11]), N(bfd_mach_mcf5407, "m68k:5407", FALSE, &arch_info_struct[11]),
N(bfd_mach_m68060, "m68k:68060", false, 0), N(bfd_mach_m68060, "m68k:68060", FALSE, 0),
}; };
const bfd_arch_info_type bfd_m68k_arch = const bfd_arch_info_type bfd_m68k_arch =
N(0, "m68k", true, &arch_info_struct[0]); N(0, "m68k", TRUE, &arch_info_struct[0]);

View file

@ -1,5 +1,5 @@
/* bfd back-end for m88k support /* bfd back-end for m88k support
Copyright 1990, 1991, 1994, 2000 Free Software Foundation, Inc. Copyright 1990, 1991, 1994, 2000, 2002 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support. Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_m88k_arch =
"m88k", "m88k",
"m88k:88100", "m88k:88100",
3, 3,
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,

View file

@ -1,5 +1,5 @@
/* BFD library support routines for Motorola's MCore architecture /* BFD library support routines for Motorola's MCore architecture
Copyright 1993, 1999 Free Software Foundation, Inc. Copyright 1993, 1999, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_mcore_arch =
"MCore", /* Architecture name */ "MCore", /* Architecture name */
"MCore", /* Printable name */ "MCore", /* Printable name */
3, /* Section align power */ 3, /* Section align power */
true, /* Is this the default architecture ? */ TRUE, /* Is this the default architecture ? */
bfd_default_compatible, /* Architecture comparison function */ bfd_default_compatible, /* Architecture comparison function */
bfd_default_scan, /* String to architecture conversion */ bfd_default_scan, /* String to architecture conversion */
NULL /* Next in list */ NULL /* Next in list */

View file

@ -90,29 +90,29 @@ enum
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
N (32, 32, bfd_mach_mips3000, "mips:3000", false, NN(I_mips3000)), N (32, 32, bfd_mach_mips3000, "mips:3000", FALSE, NN(I_mips3000)),
N (32, 32, bfd_mach_mips3900, "mips:3900", false, NN(I_mips3900)), N (32, 32, bfd_mach_mips3900, "mips:3900", FALSE, NN(I_mips3900)),
N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)), N (64, 64, bfd_mach_mips4000, "mips:4000", FALSE, NN(I_mips4000)),
N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)), N (64, 64, bfd_mach_mips4010, "mips:4010", FALSE, NN(I_mips4010)),
N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)), N (64, 64, bfd_mach_mips4100, "mips:4100", FALSE, NN(I_mips4100)),
N (64, 64, bfd_mach_mips4111, "mips:4111", false, NN(I_mips4111)), N (64, 64, bfd_mach_mips4111, "mips:4111", FALSE, NN(I_mips4111)),
N (64, 64, bfd_mach_mips4120, "mips:4120", false, NN(I_mips4120)), N (64, 64, bfd_mach_mips4120, "mips:4120", FALSE, NN(I_mips4120)),
N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)), N (64, 64, bfd_mach_mips4300, "mips:4300", FALSE, NN(I_mips4300)),
N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)), N (64, 64, bfd_mach_mips4400, "mips:4400", FALSE, NN(I_mips4400)),
N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)), N (64, 64, bfd_mach_mips4600, "mips:4600", FALSE, NN(I_mips4600)),
N (64, 64, bfd_mach_mips4650, "mips:4650", false, NN(I_mips4650)), N (64, 64, bfd_mach_mips4650, "mips:4650", FALSE, NN(I_mips4650)),
N (64, 64, bfd_mach_mips5000, "mips:5000", false, NN(I_mips5000)), N (64, 64, bfd_mach_mips5000, "mips:5000", FALSE, NN(I_mips5000)),
N (64, 64, bfd_mach_mips5400, "mips:5400", false, NN(I_mips5400)), N (64, 64, bfd_mach_mips5400, "mips:5400", FALSE, NN(I_mips5400)),
N (64, 64, bfd_mach_mips5500, "mips:5500", false, NN(I_mips5500)), N (64, 64, bfd_mach_mips5500, "mips:5500", FALSE, NN(I_mips5500)),
N (32, 32, bfd_mach_mips6000, "mips:6000", false, NN(I_mips6000)), N (32, 32, bfd_mach_mips6000, "mips:6000", FALSE, NN(I_mips6000)),
N (64, 64, bfd_mach_mips8000, "mips:8000", false, NN(I_mips8000)), N (64, 64, bfd_mach_mips8000, "mips:8000", FALSE, NN(I_mips8000)),
N (64, 64, bfd_mach_mips10000,"mips:10000", false, NN(I_mips10000)), N (64, 64, bfd_mach_mips10000,"mips:10000", FALSE, NN(I_mips10000)),
N (64, 64, bfd_mach_mips12000,"mips:12000", false, NN(I_mips12000)), N (64, 64, bfd_mach_mips12000,"mips:12000", FALSE, NN(I_mips12000)),
N (64, 64, bfd_mach_mips16, "mips:16", false, NN(I_mips16)), N (64, 64, bfd_mach_mips16, "mips:16", FALSE, NN(I_mips16)),
N (64, 64, bfd_mach_mips5, "mips:mips5", false, NN(I_mips5)), N (64, 64, bfd_mach_mips5, "mips:mips5", FALSE, NN(I_mips5)),
N (32, 32, bfd_mach_mipsisa32, "mips:isa32", false, NN(I_mipsisa32)), N (32, 32, bfd_mach_mipsisa32, "mips:isa32", FALSE, NN(I_mipsisa32)),
N (64, 64, bfd_mach_mipsisa64, "mips:isa64", false, NN(I_mipsisa64)), N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)),
N (64, 64, bfd_mach_mips_sb1, "mips:sb1", false, 0), N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, 0),
}; };
/* The default architecture is mips:3000, but with a machine number of /* The default architecture is mips:3000, but with a machine number of
@ -120,4 +120,4 @@ static const bfd_arch_info_type arch_info_struct[] =
of mips, and an explicit setting of mips:3000. */ of mips, and an explicit setting of mips:3000. */
const bfd_arch_info_type bfd_mips_arch = const bfd_arch_info_type bfd_mips_arch =
N (32, 32, 0, "mips", true, &arch_info_struct[0]); N (32, 32, 0, "mips", TRUE, &arch_info_struct[0]);

View file

@ -1,5 +1,5 @@
/* BFD library support routines for MMIX. /* BFD library support routines for MMIX.
Copyright (C) 2001 Free Software Foundation, Inc. Copyright 2001, 2002 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson (hp@bitrange.com) Contributed by Hans-Peter Nilsson (hp@bitrange.com)
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -34,7 +34,7 @@ bfd_mmix_arch =
"mmix", /* Architecture name. */ "mmix", /* Architecture name. */
"mmix", /* Printable name. */ "mmix", /* Printable name. */
3, /* Section align power. */ 3, /* Section align power. */
true, /* This is the default architecture. */ TRUE, /* This is the default architecture. */
bfd_default_compatible, /* Architecture comparison function. */ bfd_default_compatible, /* Architecture comparison function. */
bfd_default_scan, /* String to architecture conversion. */ bfd_default_scan, /* String to architecture conversion. */
NULL /* Next in list. */ NULL /* Next in list. */

View file

@ -30,11 +30,11 @@
static const bfd_arch_info_type arch_info_struct[] = static const bfd_arch_info_type arch_info_struct[] =
{ {
N(32532,"ns32k:32532",true, 0), /* The word ns32k will match this too. */ N(32532,"ns32k:32532",TRUE, 0), /* The word ns32k will match this too. */
}; };
const bfd_arch_info_type bfd_ns32k_arch = const bfd_arch_info_type bfd_ns32k_arch =
N(32032,"ns32k:32032",false, &arch_info_struct[0]); N(32032,"ns32k:32032",FALSE, &arch_info_struct[0]);
static bfd_reloc_status_type do_ns32k_reloc static bfd_reloc_status_type do_ns32k_reloc
PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
@ -232,16 +232,16 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd,
of the location within the section. Some targets arrange for of the location within the section. Some targets arrange for
the addend to be the negative of the position of the location the addend to be the negative of the position of the location
within the section; for example, i386-aout does this. For within the section; for example, i386-aout does this. For
i386-aout, pcrel_offset is false. Some other targets do not i386-aout, pcrel_offset is FALSE. Some other targets do not
include the position of the location; for example, m88kbcs, include the position of the location; for example, m88kbcs,
or ELF. For those targets, pcrel_offset is true. or ELF. For those targets, pcrel_offset is TRUE.
If we are producing relocateable output, then we must ensure If we are producing relocateable output, then we must ensure
that this reloc will be correctly computed when the final that this reloc will be correctly computed when the final
relocation is done. If pcrel_offset is false we want to wind relocation is done. If pcrel_offset is FALSE we want to wind
up with the negative of the location within the section, up with the negative of the location within the section,
which means we must adjust the existing addend by the change which means we must adjust the existing addend by the change
in the location within the section. If pcrel_offset is true in the location within the section. If pcrel_offset is TRUE
we do not want to adjust the existing addend at all. we do not want to adjust the existing addend at all.
FIXME: This seems logical to me, but for the case of FIXME: This seems logical to me, but for the case of
@ -594,7 +594,7 @@ _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location,
{ {
int size; int size;
bfd_vma x; bfd_vma x;
boolean overflow; bfd_boolean overflow;
/* If the size is negative, negate RELOCATION. This isn't very /* If the size is negative, negate RELOCATION. This isn't very
general. */ general. */
@ -622,7 +622,7 @@ _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location,
which we don't check for. We must either check at every single which we don't check for. We must either check at every single
operation, which would be tedious, or we must do the computations operation, which would be tedious, or we must do the computations
in a type larger than bfd_vma, which would be inefficient. */ in a type larger than bfd_vma, which would be inefficient. */
overflow = false; overflow = FALSE;
if (howto->complain_on_overflow != complain_overflow_dont) if (howto->complain_on_overflow != complain_overflow_dont)
{ {
bfd_vma check; bfd_vma check;
@ -697,7 +697,7 @@ _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location,
if (signed_check > reloc_signed_max if (signed_check > reloc_signed_max
|| signed_check < reloc_signed_min) || signed_check < reloc_signed_min)
overflow = true; overflow = TRUE;
} }
break; break;
case complain_overflow_unsigned: case complain_overflow_unsigned:
@ -709,7 +709,7 @@ _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location,
(((1 << (howto->bitsize - 1)) - 1) << 1) | 1; (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
if (check > reloc_unsigned_max) if (check > reloc_unsigned_max)
overflow = true; overflow = TRUE;
} }
break; break;
case complain_overflow_bitfield: case complain_overflow_bitfield:
@ -722,7 +722,7 @@ _bfd_do_ns32k_reloc_contents (howto, input_bfd, relocation, location,
if ((check & ~reloc_bits) != 0 if ((check & ~reloc_bits) != 0
&& (((bfd_vma) signed_check & ~reloc_bits) && (((bfd_vma) signed_check & ~reloc_bits)
!= (-(bfd_vma) 1 & ~reloc_bits))) != (-(bfd_vma) 1 & ~reloc_bits)))
overflow = true; overflow = TRUE;
} }
break; break;
default: default:
@ -818,9 +818,9 @@ _bfd_ns32k_final_link_relocate (howto, input_bfd, input_section, contents,
location we are relocating. Some targets (e.g., i386-aout) location we are relocating. Some targets (e.g., i386-aout)
arrange for the contents of the section to be the negative of the arrange for the contents of the section to be the negative of the
offset of the location within the section; for such targets offset of the location within the section; for such targets
pcrel_offset is false. Other targets (e.g., m88kbcs or ELF) pcrel_offset is FALSE. Other targets (e.g., m88kbcs or ELF)
simply leave the contents of the section as zero; for such simply leave the contents of the section as zero; for such
targets pcrel_offset is true. If pcrel_offset is false we do not targets pcrel_offset is TRUE. If pcrel_offset is FALSE we do not
need to subtract out the offset of the location within the need to subtract out the offset of the location within the
section (which is just ADDRESS). */ section (which is just ADDRESS). */
if (howto->pc_relative) if (howto->pc_relative)

View file

@ -1,5 +1,5 @@
/* BFD support for the OpenRISC architecture. /* BFD support for the OpenRISC architecture.
Copyright (C) 2001 Free Software Foundation, Inc. Copyright 2001, 2002 Free Software Foundation, Inc.
Contributed by Johan Rydberg, jrydberg@opencores.org Contributed by Johan Rydberg, jrydberg@opencores.org
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -39,4 +39,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
} }
const bfd_arch_info_type bfd_openrisc_arch = const bfd_arch_info_type bfd_openrisc_arch =
N (32, 32, 0, "openrisc", true, 0); N (32, 32, 0, "openrisc", TRUE, 0);

View file

@ -32,8 +32,8 @@ const bfd_arch_info_type bfd_or32_arch =
"or32", "or32",
"or32", "or32",
4, 4,
true, /* The one and only. */ TRUE, /* The one and only. */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,
}; };

View file

@ -1,5 +1,5 @@
/* BFD back-end for PDP-11 support. /* BFD back-end for PDP-11 support.
Copyright 2001 Free Software Foundation, Inc. Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -31,7 +31,7 @@ const bfd_arch_info_type bfd_pdp11_arch =
"pdp11", "pdp11",
"pdp11", "pdp11",
1, /* aligment = 16 bit */ 1, /* aligment = 16 bit */
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
0, 0,

View file

@ -1,5 +1,5 @@
/* BFD library support routines for the Pico Java architecture. /* BFD library support routines for the Pico Java architecture.
Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Transmeta. sac@pobox.com Hacked by Steve Chamberlain of Transmeta. sac@pobox.com
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_pj_arch =
"pj", /* arch_name */ "pj", /* arch_name */
"pj", /* printable name */ "pj", /* printable name */
1, 1,
true, /* the default machine */ TRUE, /* the default machine */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0 0

View file

@ -61,7 +61,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:common64", "powerpc:common64",
3, 3,
true, /* default for 64 bit target */ TRUE, /* default for 64 bit target */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[1] &bfd_powerpc_archs[1]
@ -77,7 +77,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:common", "powerpc:common",
3, 3,
false, FALSE,
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[2], &bfd_powerpc_archs[2],
@ -93,7 +93,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:common", "powerpc:common",
3, 3,
true, /* default for 32 bit target */ TRUE, /* default for 32 bit target */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[1], &bfd_powerpc_archs[1],
@ -109,7 +109,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:common64", "powerpc:common64",
3, 3,
false, FALSE,
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[2] &bfd_powerpc_archs[2]
@ -124,7 +124,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:603", "powerpc:603",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[3] &bfd_powerpc_archs[3]
@ -138,7 +138,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:EC603e", "powerpc:EC603e",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[4] &bfd_powerpc_archs[4]
@ -152,7 +152,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:604", "powerpc:604",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[5] &bfd_powerpc_archs[5]
@ -166,7 +166,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:403", "powerpc:403",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[6] &bfd_powerpc_archs[6]
@ -180,7 +180,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:601", "powerpc:601",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[7] &bfd_powerpc_archs[7]
@ -194,7 +194,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:620", "powerpc:620",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[8] &bfd_powerpc_archs[8]
@ -208,7 +208,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:630", "powerpc:630",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[9] &bfd_powerpc_archs[9]
@ -222,7 +222,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:a35", "powerpc:a35",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[10] &bfd_powerpc_archs[10]
@ -236,7 +236,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:rs64ii", "powerpc:rs64ii",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[11] &bfd_powerpc_archs[11]
@ -250,7 +250,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:rs64iii", "powerpc:rs64iii",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[12] &bfd_powerpc_archs[12]
@ -264,7 +264,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:7400", "powerpc:7400",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[13] &bfd_powerpc_archs[13]
@ -278,7 +278,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:e500", "powerpc:e500",
3, 3,
false, FALSE,
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_powerpc_archs[14] &bfd_powerpc_archs[14]
@ -292,7 +292,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] =
"powerpc", "powerpc",
"powerpc:MPC8XX", "powerpc:MPC8XX",
3, 3,
false, /* not the default */ FALSE, /* not the default */
powerpc_compatible, powerpc_compatible,
bfd_default_scan, bfd_default_scan,
0 0

View file

@ -1,5 +1,6 @@
/* BFD back-end for rs6000 support /* BFD back-end for rs6000 support
Copyright 1990, 1991, 1993, 1995, 2000 Free Software Foundation, Inc. Copyright 1990, 1991, 1993, 1995, 2000, 2002
Free Software Foundation, Inc.
FIXME: Can someone provide a transliteration of this name into ASCII? FIXME: Can someone provide a transliteration of this name into ASCII?
Using the following chars caused a compiler warning on HIUX (so I replaced Using the following chars caused a compiler warning on HIUX (so I replaced
them with octal escapes), and isn't useful without an understanding of what them with octal escapes), and isn't useful without an understanding of what
@ -64,7 +65,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"rs6000", "rs6000",
"rs6000:rs1", "rs6000:rs1",
3, 3,
false, /* not the default */ FALSE, /* not the default */
rs6000_compatible, rs6000_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[1] &arch_info_struct[1]
@ -78,7 +79,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"rs6000", "rs6000",
"rs6000:rsc", "rs6000:rsc",
3, 3,
false, /* not the default */ FALSE, /* not the default */
rs6000_compatible, rs6000_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[2] &arch_info_struct[2]
@ -92,7 +93,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"rs6000", "rs6000",
"rs6000:rs2", "rs6000:rs2",
3, 3,
false, /* not the default */ FALSE, /* not the default */
rs6000_compatible, rs6000_compatible,
bfd_default_scan, bfd_default_scan,
0 0
@ -109,7 +110,7 @@ const bfd_arch_info_type bfd_rs6000_arch =
"rs6000", "rs6000",
"rs6000:6000", "rs6000:6000",
3, 3,
true, /* the default */ TRUE, /* the default */
rs6000_compatible, rs6000_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[0] &arch_info_struct[0]

View file

@ -33,7 +33,7 @@ const bfd_arch_info_type bfd_s390_64_arch =
"s390", "s390",
"s390:64-bit", "s390:64-bit",
3, /* section alignment power */ 3, /* section alignment power */
true, /* the default */ TRUE, /* the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
NULL NULL
@ -49,7 +49,7 @@ const bfd_arch_info_type bfd_s390_arch =
"s390", "s390",
"s390:31-bit", "s390:31-bit",
3, /* section alignment power */ 3, /* section alignment power */
true, /* the default */ TRUE, /* the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&bfd_s390_64_arch &bfd_s390_64_arch

View file

@ -1,5 +1,5 @@
/* BFD library support routines for the Hitachi-SH architecture. /* BFD library support routines for the Hitachi-SH architecture.
Copyright 1993, 1994, 1997, 1998, 2000, 2001 Copyright 1993, 1994, 1997, 1998, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support. Hacked by Steve Chamberlain of Cygnus Support.
@ -60,7 +60,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sh", /* arch_name */ "sh", /* arch_name */
"sh2", /* printable name */ "sh2", /* printable name */
1, 1,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH2_NEXT SH2_NEXT
@ -74,7 +74,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sh", /* arch_name */ "sh", /* arch_name */
"sh-dsp", /* printable name */ "sh-dsp", /* printable name */
1, 1,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH_DSP_NEXT SH_DSP_NEXT
@ -88,7 +88,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sh", /* arch_name */ "sh", /* arch_name */
"sh3", /* printable name */ "sh3", /* printable name */
1, 1,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH3_NEXT SH3_NEXT
@ -102,7 +102,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sh", /* arch_name */ "sh", /* arch_name */
"sh3-dsp", /* printable name */ "sh3-dsp", /* printable name */
1, 1,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH3_DSP_NEXT SH3_DSP_NEXT
@ -116,7 +116,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sh", /* arch_name */ "sh", /* arch_name */
"sh3e", /* printable name */ "sh3e", /* printable name */
1, 1,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH3E_NEXT SH3E_NEXT
@ -130,7 +130,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sh", /* arch_name */ "sh", /* arch_name */
"sh4", /* printable name */ "sh4", /* printable name */
1, 1,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH4_NEXT SH4_NEXT
@ -144,7 +144,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sh", /* arch_name */ "sh", /* arch_name */
"sh5", /* printable name */ "sh5", /* printable name */
1, 1,
false, /* not the default */ FALSE, /* not the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH64_NEXT SH64_NEXT
@ -161,7 +161,7 @@ const bfd_arch_info_type bfd_sh_arch =
"sh", /* arch_name */ "sh", /* arch_name */
"sh", /* printable name */ "sh", /* printable name */
1, 1,
true, /* the default machine */ TRUE, /* the default machine */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
SH_NEXT SH_NEXT

View file

@ -33,7 +33,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:sparclet", "sparc:sparclet",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[1], &arch_info_struct[1],
@ -47,7 +47,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:sparclite", "sparc:sparclite",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[2], &arch_info_struct[2],
@ -61,7 +61,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:v8plus", "sparc:v8plus",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[3], &arch_info_struct[3],
@ -75,7 +75,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:v8plusa", "sparc:v8plusa",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[4], &arch_info_struct[4],
@ -89,7 +89,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:sparclite_le", "sparc:sparclite_le",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[5], &arch_info_struct[5],
@ -103,7 +103,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:v9", "sparc:v9",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[6], &arch_info_struct[6],
@ -117,7 +117,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:v9a", "sparc:v9a",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[7], &arch_info_struct[7],
@ -131,7 +131,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:v8plusb", "sparc:v8plusb",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[8], &arch_info_struct[8],
@ -145,7 +145,7 @@ static const bfd_arch_info_type arch_info_struct[] =
"sparc", "sparc",
"sparc:v9b", "sparc:v9b",
3, 3,
false, FALSE,
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,
@ -162,7 +162,7 @@ const bfd_arch_info_type bfd_sparc_arch =
"sparc", "sparc",
"sparc", "sparc",
3, 3,
true, /* the default */ TRUE, /* the default */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
&arch_info_struct[0], &arch_info_struct[0],

View file

@ -1,5 +1,5 @@
/* BFD support for the Texas Instruments TMS320C30 architecture. /* BFD support for the Texas Instruments TMS320C30 architecture.
Copyright 1998 Free Software Foundation, Inc. Copyright 1998, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_tic30_arch =
"tic30", "tic30",
"tms320c30", "tms320c30",
2, 2,
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,

View file

@ -1,5 +1,5 @@
/* bfd back-end for TMS320C[34]x support /* bfd back-end for TMS320C[34]x support
Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. Copyright 1996, 1997, 2002 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
@ -23,11 +23,11 @@
#include "sysdep.h" #include "sysdep.h"
#include "libbfd.h" #include "libbfd.h"
static boolean c4x_scan static bfd_boolean c4x_scan
PARAMS ((const struct bfd_arch_info *, const char * )); PARAMS ((const struct bfd_arch_info *, const char * ));
static boolean static bfd_boolean
c4x_scan (info, string) c4x_scan (info, string)
const struct bfd_arch_info *info; const struct bfd_arch_info *info;
const char *string; const char *string;
@ -39,14 +39,14 @@ c4x_scan (info, string)
if (*string == 'C' || *string == 'c') if (*string == 'C' || *string == 'c')
string++; string++;
if (string[1] < '0' && string[1] > '9') if (string[1] < '0' && string[1] > '9')
return false; return FALSE;
if (*string == '3') if (*string == '3')
return (info->mach == bfd_mach_c3x); return (info->mach == bfd_mach_c3x);
else if (*string == '4') else if (*string == '4')
return info->mach == bfd_mach_c4x; return info->mach == bfd_mach_c4x;
return false; return FALSE;
} }
@ -60,8 +60,8 @@ const bfd_arch_info_type bfd_tic3x_arch =
"c3x", /* Architecture name. */ "c3x", /* Architecture name. */
"tms320c3x", /* Printable name. */ "tms320c3x", /* Printable name. */
0, /* Alignment power. */ 0, /* Alignment power. */
false, /* Not the default architecture. */ FALSE, /* Not the default architecture. */
bfd_default_compatible, bfd_default_compatible,
c4x_scan, c4x_scan,
0 0
}; };
@ -76,8 +76,8 @@ const bfd_arch_info_type bfd_tic4x_arch =
"c4x", /* Architecture name. */ "c4x", /* Architecture name. */
"tms320c4x", /* Printable name. */ "tms320c4x", /* Printable name. */
0, /* Alignment power. */ 0, /* Alignment power. */
true, /* The default architecture. */ TRUE, /* The default architecture. */
bfd_default_compatible, bfd_default_compatible,
c4x_scan, c4x_scan,
&bfd_tic3x_arch, &bfd_tic3x_arch,
}; };

View file

@ -1,5 +1,5 @@
/* BFD support for the Texas Instruments TMS320C54X architecture. /* BFD support for the Texas Instruments TMS320C54X architecture.
Copyright 1999, 2000 Free Software Foundation, Inc. Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_tic54x_arch =
"tic54x", "tic54x",
"tms320c54x", "tms320c54x",
1, 1,
true, /* the one and only */ TRUE, /* the one and only */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan, bfd_default_scan,
0, 0,

View file

@ -1,5 +1,5 @@
/* bfd back-end for TI TMS320C80 (MVP) support /* bfd back-end for TI TMS320C80 (MVP) support
Copyright 1996 Free Software Foundation, Inc. Copyright 1996, 2002 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus support (fnf@cygnus.com) Written by Fred Fish at Cygnus support (fnf@cygnus.com)
This file is part of BFD, the Binary File Descriptor library. This file is part of BFD, the Binary File Descriptor library.
@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_tic80_arch =
"tic80", /* architecture name */ "tic80", /* architecture name */
"tic80", /* printable name */ "tic80", /* printable name */
2, /* section alignment power */ 2, /* section alignment power */
true, /* default machine for architecture */ TRUE, /* default machine for architecture */
bfd_default_compatible, bfd_default_compatible,
bfd_default_scan , bfd_default_scan ,
NULL, /* Pointer to next in chain */ NULL, /* Pointer to next in chain */

Some files were not shown because too many files have changed in this diff Show more