+2003-06-25 Alan Modra <amodra@bigpond.net.au>
+
+ * aout-ns32k.c: Correct spelling of "relocatable".
+ * aoutx.h: Likewise.
+ * bfd-in.h: Likewise.
+ * bfd.c: Likewise.
+ * bout.c: Likewise.
+ * coff-a29k.c: Likewise.
+ * coff-alpha.c: Likewise.
+ * coff-arm.c: Likewise.
+ * coff-i386.c: Likewise.
+ * coff-i860.c: Likewise.
+ * coff-i960.c: Likewise.
+ * coff-m68k.c: Likewise.
+ * coff-m88k.c: Likewise.
+ * coff-mcore.c: Likewise.
+ * coff-mips.c: Likewise.
+ * coff-or32.c: Likewise.
+ * coff-ppc.c: Likewise.
+ * coff-rs6000.c: Likewise.
+ * coff-sh.c: Likewise.
+ * coff-tic80.c: Likewise.
+ * coff64-rs6000.c: Likewise.
+ * cofflink.c: Likewise.
+ * cpu-ns32k.c: Likewise.
+ * ecoff.c: Likewise.
+ * ecofflink.c: Likewise.
+ * elf-bfd.h: Likewise.
+ * elf-eh-frame.c: Likewise.
+ * elf-hppa.h: Likewise.
+ * elf-m10200.c: Likewise.
+ * elf-m10300.c: Likewise.
+ * elf.c: Likewise.
+ * elf32-arm.h: Likewise.
+ * elf32-avr.c: Likewise.
+ * elf32-cris.c: Likewise.
+ * elf32-d10v.c: Likewise.
+ * elf32-dlx.c: Likewise.
+ * elf32-fr30.c: Likewise.
+ * elf32-frv.c: Likewise.
+ * elf32-h8300.c: Likewise.
+ * elf32-hppa.c: Likewise.
+ * elf32-i370.c: Likewise.
+ * elf32-i386.c: Likewise.
+ * elf32-i860.c: Likewise.
+ * elf32-i960.c: Likewise.
+ * elf32-ip2k.c: Likewise.
+ * elf32-iq2000.c: Likewise.
+ * elf32-m32r.c: Likewise.
+ * elf32-m68hc11.c: Likewise.
+ * elf32-m68hc1x.c: Likewise.
+ * elf32-m68k.c: Likewise.
+ * elf32-mcore.c: Likewise.
+ * elf32-mips.c: Likewise.
+ * elf32-msp430.c: Likewise.
+ * elf32-openrisc.c: Likewise.
+ * elf32-ppc.c: Likewise.
+ * elf32-s390.c: Likewise.
+ * elf32-sh.c: Likewise.
+ * elf32-sh64.c: Likewise.
+ * elf32-sparc.c: Likewise.
+ * elf32-v850.c: Likewise.
+ * elf32-vax.c: Likewise.
+ * elf32-xstormy16.c: Likewise.
+ * elf32-xtensa.c: Likewise.
+ * elf64-alpha.c: Likewise.
+ * elf64-hppa.c: Likewise.
+ * elf64-mips.c: Likewise.
+ * elf64-mmix.c: Likewise.
+ * elf64-ppc.c: Likewise.
+ * elf64-s390.c: Likewise.
+ * elf64-sh64.c: Likewise.
+ * elf64-sparc.c: Likewise.
+ * elf64-x86-64.c: Likewise.
+ * elfcode.h: Likewise.
+ * elflink.h: Likewise.
+ * elfn32-mips.c: Likewise.
+ * elfxx-ia64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * i386linux.c: Likewise.
+ * ieee.c: Likewise.
+ * libcoff-in.h: Likewise.
+ * linker.c: Likewise.
+ * m68klinux.c: Likewise.
+ * pdp11.c: Likewise.
+ * pe-mips.c: Likewise.
+ * peXXigen.c: Likewise.
+ * reloc.c: Likewise.
+ * reloc16.c: Likewise.
+ * sparclinux.c: Likewise.
+ * sunos.c: Likewise.
+ * syms.c: Likewise.
+ * versados.c: Likewise.
+ * vms.c: Likewise.
+ * xcofflink.c: Likewise.
+ * bfd-in2.h: Regenerate.
+ * libcoff.h: Regenerate.
+ * libbfd.h: Regenerate.
+
2003-06-24 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against
in a local var. Comment typo fixes.
(h8300_bfd_link_add_symbols): Likewise.
- * bfd/reloc.c (struct reloc_howto_struct): Revise src_mask and
+ * reloc.c (struct reloc_howto_struct): Revise src_mask and
dst_mask comments.
* bfd-in2.h: Regenerate.
2002-08-16 Stephen Clarke <stephen.clarke@superh.com>
- * bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
+ * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
symbols when looking for section referred to by a relocation.
- * bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
+ * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
2002-08-15 Alan Modra <amodra@bigpond.net.au>
struct reloc_std_external *));
/* The ns32k series is ah, unusual, when it comes to relocation.
- There are three storage methods for relocateable objects. There
+ There are three storage methods for relocatable objects. There
are displacements, immediate operands and ordinary twos complement
data. Of these, only the last fits into the standard relocation
scheme. Immediate operands are stored huffman encoded and
includes_hash_initialized = TRUE;
/* Figure out the largest section size. Also, if generating
- relocateable output, count the relocs. */
+ relocatable output, count the relocs. */
trsize = 0;
drsize = 0;
max_contents_size = 0;
{
bfd_size_type sz;
- if (info->relocateable)
+ if (info->relocatable)
{
if (bfd_get_flavour (sub) == bfd_target_aout_flavour)
{
work out the number of relocs needed, and then multiply
by the reloc size. */
(*_bfd_error_handler)
- (_("%s: relocateable link from %s to %s not supported"),
+ (_("%s: relocatable link from %s to %s not supported"),
bfd_get_filename (abfd),
sub->xvec->name, abfd->xvec->name);
bfd_set_error (bfd_error_invalid_operation);
}
}
- if (info->relocateable)
+ if (info->relocatable)
{
if (obj_textsec (abfd) != (asection *) NULL)
trsize += (_bfd_count_link_order_relocs (obj_textsec (abfd)
input_size))
return FALSE;
- /* If we are producing relocateable output, the relocs were
+ /* If we are producing relocatable output, the relocs were
modified, and we now write them out. */
- if (finfo->info->relocateable && rel_size > 0)
+ if (finfo->info->relocatable && rel_size > 0)
{
if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
return FALSE;
struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
bfd_vma *));
bfd *output_bfd;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
struct external_nlist *syms;
char *strings;
struct aout_link_hash_entry **sym_hashes;
BFD_ASSERT (input_bfd->xvec->header_byteorder
== output_bfd->xvec->header_byteorder);
- relocateable = finfo->info->relocateable;
+ relocatable = finfo->info->relocatable;
syms = obj_aout_external_syms (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_hashes = obj_aout_sym_hashes (input_bfd);
}
#endif
- if (relocateable)
+ if (relocatable)
{
- /* We are generating a relocateable output file, and must
+ /* We are generating a relocatable output file, and must
modify the reloc accordingly. */
if (r_extern)
{
struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
bfd_vma *));
bfd *output_bfd;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
struct external_nlist *syms;
char *strings;
struct aout_link_hash_entry **sym_hashes;
BFD_ASSERT (input_bfd->xvec->header_byteorder
== output_bfd->xvec->header_byteorder);
- relocateable = finfo->info->relocateable;
+ relocatable = finfo->info->relocatable;
syms = obj_aout_external_syms (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_hashes = obj_aout_sym_hashes (input_bfd);
BFD_ASSERT (r_type < TABLE_SIZE (howto_table_ext));
- if (relocateable)
+ if (relocatable)
{
- /* We are generating a relocateable output file, and must
+ /* We are generating a relocatable output file, and must
modify the reloc accordingly. */
if (r_extern
|| r_type == (unsigned int) RELOC_BASE10
extern bfd_boolean bfd_ecoff_debug_externals
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
- bfd_boolean relocateable,
+ bfd_boolean relocatable,
bfd_boolean (*get_extr) (struct symbol_cache_entry *,
struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *,
extern bfd_boolean bfd_ecoff_debug_externals
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
- bfd_boolean relocateable,
+ bfd_boolean relocatable,
bfd_boolean (*get_extr) (struct symbol_cache_entry *,
struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *,
bfd_byte *
bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
- relocateable, symbols)
+ relocatable, symbols)
bfd *abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
bfd *abfd2;
fn = abfd2->xvec->_bfd_get_relocated_section_contents;
- return (*fn) (abfd, link_info, link_order, data, relocateable, symbols);
+ return (*fn) (abfd, link_info, link_order, data, relocatable, symbols);
}
/* Record information about an ELF program header. */
/* BFD back-end for Intel 960 b.out binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
static bfd_byte *
b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
/* Get enough memory to hold the stuff. */
if (reloc_size < 0)
goto error_return;
- /* If producing relocateable output, don't bother to relax. */
- if (relocateable)
+ /* If producing relocatable output, don't bother to relax. */
+ if (relocatable)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order,
- data, relocateable,
+ data, relocatable,
symbols);
reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
/* BFD back-end for AMD 29000 COFF binaries.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
+ 2002, 2003
Free Software Foundation, Inc.
Contributed by David Wood at New York University 7/8/91.
bfd_boolean hihalf;
bfd_vma hihalf_val;
- /* If we are performing a relocateable link, we don't need to do a
+ /* If we are performing a relocatable link, we don't need to do a
thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
hihalf = FALSE;
/* BFD back-end for ALPHA Extended-Coff files.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
Ian Lance Taylor <ian@cygnus.com>.
PARAMS ((bfd *, bfd_reloc_code_real_type));
static bfd_byte *alpha_ecoff_get_relocated_section_contents
PARAMS ((bfd *abfd, struct bfd_link_info *, struct bfd_link_order *,
- bfd_byte *data, bfd_boolean relocateable, asymbol **symbols));
+ bfd_byte *data, bfd_boolean relocatable, asymbol **symbols));
static bfd_vma alpha_convert_external_reloc
PARAMS ((bfd *, struct bfd_link_info *, bfd *, struct external_reloc *,
struct ecoff_link_hash_entry *));
static bfd_byte *
alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
bfd *input_bfd = link_order->u.indirect.section->owner;
long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
arelent **reloc_vector = NULL;
long reloc_count;
- bfd *output_bfd = relocateable ? abfd : (bfd *) NULL;
+ bfd *output_bfd = relocatable ? abfd : (bfd *) NULL;
bfd_vma gp;
bfd_boolean gp_undefined;
bfd_vma stack[RELOC_STACKSIZE];
gp = _bfd_get_gp_value (abfd);
if (gp == 0)
{
- if (relocateable)
+ if (relocatable)
{
asection *sec;
bfd_vma lo;
case ALPHA_R_SREL16:
case ALPHA_R_SREL32:
case ALPHA_R_SREL64:
- if (relocateable
+ if (relocatable
&& ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0)
{
rel->address += input_section->output_offset;
asymbol *symbol;
bfd_vma relocation;
- if (relocateable)
+ if (relocatable)
{
rel->address += input_section->output_offset;
break;
bfd_vma val;
int offset, size;
- if (relocateable)
+ if (relocatable)
{
rel->address += input_section->output_offset;
break;
asymbol *symbol;
bfd_vma relocation;
- if (relocateable)
+ if (relocatable)
{
rel->address += input_section->output_offset;
break;
asymbol *symbol;
bfd_vma relocation;
- if (relocateable)
+ if (relocatable)
{
rel->address += input_section->output_offset;
break;
abort ();
}
- if (relocateable)
+ if (relocatable)
{
asection *os = input_section->output_section;
}
\f
/* A helper routine for alpha_relocate_section which converts an
- external reloc when generating relocateable output. Returns the
+ external reloc when generating relocatable output. Returns the
relocation amount. */
static bfd_vma
unsigned long r_symndx;
bfd_vma relocation;
- BFD_ASSERT (info->relocateable);
+ BFD_ASSERT (info->relocatable);
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
lita_sec = symndx_to_section[RELOC_SECTION_LITA];
gp = _bfd_get_gp_value (output_bfd);
- if (! info->relocateable && lita_sec != NULL)
+ if (! info->relocatable && lita_sec != NULL)
{
struct ecoff_section_tdata *lita_sec_data;
not otherwise used for anything. For some reason, the
address of the relocation does not appear to include the
section VMA, unlike the other relocation types. */
- if (info->relocateable)
+ if (info->relocatable)
H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr,
ext_rel->r_vaddr);
adjust_addrp = FALSE;
if (h == (struct ecoff_link_hash_entry *) NULL)
abort ();
- if (! info->relocateable)
+ if (! info->relocatable)
{
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
addend += r_vaddr;
- if (info->relocateable)
+ if (info->relocatable)
{
/* Adjust r_vaddr by the addend. */
H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr);
case ALPHA_R_OP_STORE:
/* Store a value from the reloc stack into a bitfield. If
- we are generating relocateable output, all we do is
+ we are generating relocatable output, all we do is
adjust the address of the reloc. */
- if (! info->relocateable)
+ if (! info->relocatable)
{
bfd_vma mask;
bfd_vma val;
abort ();
}
- if (info->relocateable)
+ if (info->relocatable)
{
- /* We are generating relocateable output, and must
+ /* We are generating relocatable output, and must
convert the existing reloc. */
if (r_extern)
{
}
}
- if (info->relocateable && adjust_addrp)
+ if (info->relocatable && adjust_addrp)
{
/* Change the address of the relocation. */
H_PUT_64 (input_bfd,
/* BFD back-end for ARM COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
return FALSE;
/* The relocation_section function will skip pcrel_offset relocs
- when doing a relocateable link. However, we want to convert
+ when doing a relocatable link. However, we want to convert
ARM26 to ARM26D relocs if possible. We return a fake howto in
this case without pcrel_offset set, and adjust the addend to
compensate. */
if (rel->r_type == ARM_26
&& h != NULL
- && info->relocateable
+ && info->relocatable
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& (h->root.u.def.section->output_section
the next opcode's pc, so is off by one. */
#if 0 /* This appears to have been true for WINCE 2.0, but it is not
true for WINCE 3.0. */
- if (howto->pc_relative && !info->relocateable)
+ if (howto->pc_relative && !info->relocatable)
addend -= 8;
#endif
#endif
- /* If we are doing a relocateable link, then we can just ignore
+ /* If we are doing a relocatable link, then we can just ignore
a PC relative reloc that is pcrel_offset. It will already
- have the correct value. If this is not a relocateable link,
+ have the correct value. If this is not a relocatable link,
then we should ignore the symbol value. */
if (howto->pc_relative && howto->pcrel_offset)
{
- if (info->relocateable)
+ if (info->relocatable)
continue;
/* FIXME - it is not clear which targets need this next test
and which do not. It is known that it is needed for the
stub generation to the final linker pass. If we fail to
verify that the name is defined, we'll try to build stubs
for an undefined name... */
- if (! info->relocateable
+ if (! info->relocatable
&& ( h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak))
{
+ sec->output_offset);
}
- else if (! info->relocateable)
+ else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
rstat = bfd_reloc_ok;
#ifndef ARM_WINCE
/* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */
- else if (! info->relocateable
+ else if (! info->relocatable
&& howto->type == ARM_THUMB23)
{
/* This is pretty much a copy of what the default
Is this the best way to fix up thumb addresses? krk@cygnus.com
Probably not, but it works, and if it works it don't need fixing! nickc@cygnus.com */
/* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */
- if (! info->relocateable
+ if (! info->relocatable
&& (rel->r_type == ARM_32 || rel->r_type == ARM_RVA32))
{
/* Determine if we need to set the bottom bit of a relocated address
/* If we are only performing a partial link do not bother
getting a bfd to hold the glue. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
globals = coff_arm_hash_table (info);
/* If we are only performing a partial link do not bother
to construct any glue. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* Here we have a bfd that is to be included on the link. We have a hook
#define coff_bfd_copy_private_bfd_data coff_arm_copy_private_bfd_data
#define coff_bfd_link_hash_table_create coff_arm_link_hash_table_create
-/* When doing a relocateable link, we want to convert ARM26 relocs
+/* When doing a relocatable link, we want to convert ARM26 relocs
into ARM26D relocs. */
static bfd_boolean
/* BFD back-end for Intel 386 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
section for a reference to a common symbol is the value itself plus
any desired offset. Ian Taylor, Cygnus Support. */
-/* If we are producing relocateable output, we need to do some
+/* If we are producing relocatable output, we need to do some
adjustments to the object file that are not done by the
bfd_perform_relocation function. This function is called by every
reloc type to make any required adjustments. */
{
/* For some reason bfd_perform_relocation always effectively
ignores the addend for a COFF target when producing
- relocateable output. This seems to be always wrong for 386
+ relocatable output. This seems to be always wrong for 386
COFF, so we handle the addend here instead. */
#ifdef COFF_WITH_PE
if (output_bfd == (bfd *) NULL)
/* The PE relocate section routine. The only difference between this
and the regular routine is that we don't want to do anything for a
- relocateable link. */
+ relocatable link. */
static bfd_boolean coff_pe_i386_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_syment *syms;
asection **sections;
{
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
#ifndef COFF_WITH_PE
/* If the output symbol is common (in which case this must be a
- relocateable link), we need to add in the final size of the
+ relocatable link), we need to add in the final size of the
common symbol. */
if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
/* BFD back-end for Intel 860 COFF files.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c
Harry Dolan <dolan@ssd.intel.com>, October 1995
section for a reference to a common symbol is the value itself plus
any desired offset. Ian Taylor, Cygnus Support. */
-/* If we are producing relocateable output, we need to do some
+/* If we are producing relocatable output, we need to do some
adjustments to the object file that are not done by the
bfd_perform_relocation function. This function is called by every
reloc type to make any required adjustments. */
{
/* For some reason bfd_perform_relocation always effectively
ignores the addend for a COFF target when producing
- relocateable output. This seems to be always wrong for 860
+ relocatable output. This seems to be always wrong for 860
COFF, so we handle the addend here instead. */
diff = reloc_entry->addend;
}
}
/* If the output symbol is common (in which case this must be a
- relocateable link), we need to add in the final size of the
+ relocatable link), we need to add in the final size of the
common symbol. */
if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
/* BFD back-end for Intel 960 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
same object file. It appears to simply discard such relocs, rather
than adding their values into the object file. We handle this here
by converting all relocs against defined symbols into relocs
- against the section symbol, when generating a relocateable output
+ against the section symbol, when generating a relocatable output
file.
Note that this function is only called if we are not using the COFF
specific backend linker. It only does something when doing a
- relocateable link, which will almost certainly fail when not
+ relocatable link, which will almost certainly fail when not
generating COFF i960 output, so this function is actually no longer
useful. It was used before this target was converted to use the
COFF specific backend linker. */
if (output_bfd == NULL)
{
- /* Not generating relocateable output file. */
+ /* Not generating relocatable output file. */
return bfd_reloc_continue;
}
asection *o;
bfd_byte *esym;
- if (! info->relocateable)
+ if (! info->relocatable)
return TRUE;
esym = (bfd_byte *) bfd_malloc (symesz);
+ sec->output_section->vma
+ sec->output_offset);
}
- else if (! info->relocateable)
+ else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
done = FALSE;
- if (howto->type == R_OPTCALL && ! info->relocateable && symndx != -1)
+ if (howto->type == R_OPTCALL && ! info->relocatable && symndx != -1)
{
int class;
/* BFD back-end for Motorola 68000 COFF binaries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
symbol is the value itself plus any desired offset. (taken from
work done by Ian Taylor, Cygnus Support, for I386 COFF). */
-/* If we are producing relocateable output, we need to do some
+/* If we are producing relocatable output, we need to do some
adjustments to the object file that are not done by the
bfd_perform_relocation function. This function is called by every
reloc type to make any required adjustments. */
{
/* For some reason bfd_perform_relocation always effectively
ignores the addend for a COFF target when producing
- relocateable output. This seems to be always wrong for 386
+ relocatable output. This seems to be always wrong for 386
COFF, so we handle the addend here instead. */
diff = reloc_entry->addend;
}
}
/* If the output symbol is common (in which case this must be a
- relocateable link), we need to add in the final size of the
+ relocatable link), we need to add in the final size of the
common symbol. */
if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
bfd_byte *p;
bfd_size_type amt;
- BFD_ASSERT (! info->relocateable);
+ BFD_ASSERT (! info->relocatable);
*errmsg = NULL;
/* BFD back-end for Motorola 88000 COFF "Binary Compatability Standard" files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
(unsigned char *) data + addr);
}
- /* If we are not producing relocateable output, return an error if
+ /* If we are not producing relocatable output, return an error if
the symbol is not defined. */
if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL)
return bfd_reloc_undefined;
/* BFD back-end for Motorola MCore COFF/PE
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
bfd_boolean hihalf;
bfd_vma hihalf_val;
- /* If we are performing a relocateable link, we don't need to do a
+ /* If we are performing a relocatable link, we don't need to do a
thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* Check if we have the same endianess */
/* BFD back-end for MIPS Extended-Coff files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Original version by Per Bothner.
Full support added by Ian Lance Taylor, ian@cygnus.com.
}
/* ECOFF relocs are either against external symbols, or against
- sections. If we are producing relocateable output, and the reloc
+ sections. If we are producing relocatable output, and the reloc
is against an external symbol, and nothing has given us any
additional addend, the resulting reloc will also be against the
same symbol. In such a case, we don't want to change anything
final link time. Rather than put special case code into
bfd_perform_relocation, all the reloc types use this howto
function. It just short circuits the reloc if producing
- relocateable output against an external symbol. */
+ relocatable output against an external symbol. */
static bfd_reloc_status_type
mips_generic_reloc (abfd,
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_vma gp;
bfd_vma relocation;
unsigned long val;
}
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- if (bfd_is_und_section (symbol->section) && ! relocateable)
+ if (bfd_is_und_section (symbol->section) && ! relocatable)
return bfd_reloc_undefined;
/* We have to figure out the gp value, so that we can adjust the
symbol value correctly. We look up the symbol _gp in the output
BFD. If we can't find it, we're stuck. We cache it in the ECOFF
target data. We don't need to adjust the symbol value for an
- external symbol if we are producing relocateable output. */
+ external symbol if we are producing relocatable output. */
gp = _bfd_get_gp_value (output_bfd);
if (gp == 0
- && (! relocateable
+ && (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0))
{
- if (relocateable)
+ if (relocatable)
{
/* Make up a value. */
gp = symbol->section->output_section->vma + 0x4000;
val -= 0x10000;
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
insn = (insn &~ (unsigned) 0xffff) | (val & 0xffff);
bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + reloc_entry->address);
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
/* Make sure it fit in 16 bits. */
}
/* bfd_perform_relocation does not handle pcrel_offset relocations
- correctly when generating a relocateable file, so handle them
+ correctly when generating a relocatable file, so handle them
directly here. */
if (output_bfd != (bfd *) NULL)
{
and the GP value of OUTPUT_BFD (which is in GP). */
addend = ecoff_data (input_bfd)->gp - gp;
}
- else if (! info->relocateable
+ else if (! info->relocatable
|| h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
/* This is a relocation against an undefined or common
symbol. The current addend in the instruction is
simply the desired offset into the symbol (normally
- zero). We are generating relocateable output, and we
+ zero). We are generating relocatable output, and we
aren't going to define this symbol, so we just leave
the instruction alone. */
addend = 0;
if (offsets != NULL
&& offsets[i] != 0)
{
- BFD_ASSERT (! info->relocateable);
+ BFD_ASSERT (! info->relocatable);
BFD_ASSERT (int_rel.r_type == MIPS_R_PCREL16
|| int_rel.r_type == MIPS_R_RELHI
|| int_rel.r_type == MIPS_R_RELLO);
}
}
- if (info->relocateable)
+ if (info->relocatable)
{
- /* We are generating relocateable output, and must convert
+ /* We are generating relocatable output, and must convert
the existing reloc. */
if (int_rel.r_extern)
{
bfd_byte *p;
bfd_size_type amt;
- BFD_ASSERT (! info->relocateable);
+ BFD_ASSERT (! info->relocatable);
*errmsg = NULL;
/* BFD back-end for OpenRISC 1000 COFF binaries.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
Contributed by Ivan Guzvinec <ivang@opencores.org>
This file is part of BFD, the Binary File Descriptor library.
bfd_boolean hihalf;
bfd_vma hihalf_val;
- /* If we are performing a relocateable link, we don't need to do a
+ /* If we are performing a relocatable link, we don't need to do a
thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
hihalf = FALSE;
bfd_vma relocation;
reloc_howto_type *howto = 0;
- /* If we are performing a relocateable link, we don't need to do a
+ /* If we are performing a relocatable link, we don't need to do a
thing. The caller will take care of adjusting the reloc
addresses and symbol indices. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
hihalf = FALSE;
|| info->strip == strip_some)
o->lineno_count += sec->lineno_count;
- if (info->relocateable)
+ if (info->relocatable)
o->reloc_count += sec->reloc_count;
if (sec->_raw_size > max_contents_size)
if (sec->reloc_count > max_reloc_count)
max_reloc_count = sec->reloc_count;
}
- else if (info->relocateable
+ else if (info->relocatable
&& (p->type == bfd_section_reloc_link_order
|| p->type == bfd_symbol_reloc_link_order))
++o->reloc_count;
}
}
- /* If doing a relocateable link, allocate space for the pointers we
+ /* If doing a relocatable link, allocate space for the pointers we
need to keep. */
- if (info->relocateable)
+ if (info->relocatable)
{
unsigned int i;
Because of this problem, we also keep the relocs in
memory until the end of the link. This wastes memory,
- but only when doing a relocateable link, which is not the
+ but only when doing a relocatable link, which is not the
common case. */
- BFD_ASSERT (info->relocateable);
+ BFD_ASSERT (info->relocatable);
amt = o->reloc_count;
amt *= sizeof (struct internal_reloc);
finfo.section_info[o->target_index].relocs =
finfo.linenos = (bfd_byte *) bfd_malloc (amt);
finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz);
- if (! info->relocateable)
+ if (! info->relocatable)
{
amt = max_reloc_count * sizeof (struct internal_reloc);
finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt);
|| (finfo.linenos == NULL && max_lineno_count > 0)
|| (finfo.contents == NULL && max_contents_size > 0)
|| (finfo.external_relocs == NULL && max_reloc_count > 0)
- || (! info->relocateable
+ || (! info->relocatable
&& finfo.internal_relocs == NULL
&& max_reloc_count > 0))
goto error_return;
finfo.outsyms = NULL;
}
- if (info->relocateable)
+ if (info->relocatable)
{
/* Now that we have written out all the global symbols, we know
the symbol indices to use for relocs against them, and we can
/* BFD back-end for IBM RS/6000 "XCOFF" files.
- Copyright 1990-1999, 2000, 2001, 2002
+ Copyright 1990-1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
FIXME: Can someone provide a transliteration of this name into ASCII?
Using the following chars caused a compiler warning on HIUX (so I replaced
}
else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT)))
- && ! info->relocateable)
+ && ! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
*again = FALSE;
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0)
return TRUE;
+ sec->output_section->vma
+ sec->output_offset);
}
- else if (! info->relocateable)
+ else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
static bfd_byte *
sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
asection *input_section = link_order->u.indirect.section;
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| coff_section_data (input_bfd, input_section) == NULL
|| coff_section_data (input_bfd, input_section)->contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
memcpy (data, coff_section_data (input_bfd, input_section)->contents,
/* BFD back-end for Texas Instruments TMS320C80 Multimedia Video Processor (MVP).
- Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com)
+ sec->output_offset);
}
- else if (! info->relocateable)
+ else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
/* BFD back-end for IBM RS/6000 "XCOFF64" files.
- Copyright 2000, 2001, 2002
+ Copyright 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written Clinton Popetz.
Contributed by Cygnus Support.
+ sec->output_offset);
}
else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT)))
- && ! info->relocateable)
+ && ! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
/* COFF specific linker code.
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
sym_hash += sym.n_numaux + 1;
}
- /* If this is a non-traditional, non-relocateable link, try to
+ /* If this is a non-traditional, non-relocatable link, try to
optimize the handling of any .stab/.stabstr sections. */
- if (! info->relocateable
+ if (! info->relocatable
&& ! info->traditional_format
&& info->hash->creator->flavour == bfd_get_flavour (abfd)
&& (info->strip != strip_all && info->strip != strip_debugger))
|| info->strip == strip_some)
o->lineno_count += sec->lineno_count;
- if (info->relocateable)
+ if (info->relocatable)
o->reloc_count += sec->reloc_count;
if (sec->_raw_size > max_contents_size)
if (sec->reloc_count > max_reloc_count)
max_reloc_count = sec->reloc_count;
}
- else if (info->relocateable
+ else if (info->relocatable
&& (p->type == bfd_section_reloc_link_order
|| p->type == bfd_symbol_reloc_link_order))
++o->reloc_count;
}
}
- /* If doing a relocateable link, allocate space for the pointers we
+ /* If doing a relocatable link, allocate space for the pointers we
need to keep. */
- if (info->relocateable)
+ if (info->relocatable)
{
unsigned int i;
Because of this problem, we also keep the relocs in
memory until the end of the link. This wastes memory,
- but only when doing a relocateable link, which is not the
+ but only when doing a relocatable link, which is not the
common case. */
- BFD_ASSERT (info->relocateable);
+ BFD_ASSERT (info->relocatable);
amt = o->reloc_count;
amt *= sizeof (struct internal_reloc);
finfo.section_info[o->target_index].relocs =
finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
amt = max_reloc_count * relsz;
finfo.external_relocs = (bfd_byte *) bfd_malloc (amt);
- if (! info->relocateable)
+ if (! info->relocatable)
{
amt = max_reloc_count * sizeof (struct internal_reloc);
finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt);
|| (finfo.linenos == NULL && max_lineno_count > 0)
|| (finfo.contents == NULL && max_contents_size > 0)
|| (finfo.external_relocs == NULL && max_reloc_count > 0)
- || (! info->relocateable
+ || (! info->relocatable
&& finfo.internal_relocs == NULL
&& max_reloc_count > 0))
goto error_return;
finfo.outsyms = NULL;
}
- if (info->relocateable && max_output_reloc_count > 0)
+ if (info->relocatable && max_output_reloc_count > 0)
{
/* Now that we have written out all the global symbols, we know
the symbol indices to use for relocs against them, and we can
internal_relocs = _bfd_coff_read_internal_relocs
(input_bfd, a, FALSE,
finfo->external_relocs,
- finfo->info->relocateable,
- (finfo->info->relocateable
+ finfo->info->relocatable,
+ (finfo->info->relocatable
? (finfo->section_info[ a->output_section->target_index ].relocs + a->output_section->reloc_count)
: finfo->internal_relocs)
);
going to be involved in the relocations */
if (( finfo->info->strip != strip_none
|| finfo->info->discard != discard_none)
- && finfo->info->relocateable)
+ && finfo->info->relocatable)
{
/* mark the symbol array as 'not-used' */
memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp);
relocation. */
if ((finfo->info->strip != strip_none
|| finfo->info->discard != discard_none)
- && finfo->info->relocateable)
+ && finfo->info->relocatable)
dont_skip_symbol = *indexp;
else
dont_skip_symbol = FALSE;
target_index = o->output_section->target_index;
internal_relocs = (_bfd_coff_read_internal_relocs
(input_bfd, o, FALSE, finfo->external_relocs,
- finfo->info->relocateable,
- (finfo->info->relocateable
+ finfo->info->relocatable,
+ (finfo->info->relocatable
? (finfo->section_info[target_index].relocs
+ o->output_section->reloc_count)
: finfo->internal_relocs)));
finfo->sec_ptrs))
return FALSE;
- if (finfo->info->relocateable)
+ if (finfo->info->relocatable)
{
bfd_vma offset;
struct internal_reloc *irelend;
/* When a weak symbol is not overriden by a strong one,
turn it into an external symbol when not building a
- shared or relocateable object. */
+ shared or relocatable object. */
if (! finfo->info->shared
- && ! finfo->info->relocateable
+ && ! finfo->info->relocatable
&& IS_WEAK_EXTERNAL (finfo->output_bfd, isym))
isym.n_sclass = C_EXT;
if (sec->reloc_count > 0xffff
&& (! obj_pe (output_bfd)
- || finfo->info->relocateable))
+ || finfo->info->relocatable))
(*_bfd_error_handler)
(_("%s: %s: reloc overflow: 0x%lx > 0xffff"),
bfd_get_filename (output_bfd),
if (sec->lineno_count > 0xffff
&& (! obj_pe (output_bfd)
- || finfo->info->relocateable))
+ || finfo->info->relocatable))
(*_bfd_error_handler)
(_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
bfd_get_filename (output_bfd),
if (howto == NULL)
return FALSE;
- /* If we are doing a relocateable link, then we can just ignore
+ /* If we are doing a relocatable link, then we can just ignore
a PC relative reloc that is pcrel_offset. It will already
- have the correct value. If this is not a relocateable link,
+ have the correct value. If this is not a relocatable link,
then we should ignore the symbol value. */
if (howto->pc_relative && howto->pcrel_offset)
{
- if (info->relocateable)
+ if (info->relocatable)
continue;
if (sym != NULL && sym->n_scnum != 0)
addend += sym->n_value;
else if (h->root.type == bfd_link_hash_undefweak)
val = 0;
- else if (! info->relocateable)
+ else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
/* BFD support for the ns32k architecture.
- Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001, 2002
+ Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Almost totally rewritten by Ian Dall from initial work
by Andrew Cagney.
return bfd_reloc_ok;
}
- /* If we are not producing relocateable output, return an error if
+ /* If we are not producing relocatable output, return an error if
the symbol is not defined. An undefined weak symbol is
considered to have a value of zero (SVR4 ABI, p. 4-27). */
if (symbol->section == &bfd_und_section
include the position of the location; for example, m88kbcs,
or ELF. For those targets, pcrel_offset is TRUE.
- If we are producing relocateable output, then we must ensure
+ If we are producing relocatable output, then we must ensure
that this reloc will be correctly computed when the final
relocation is done. If pcrel_offset is FALSE we want to wind
up with the negative of the location within the section,
we do not want to adjust the existing addend at all.
FIXME: This seems logical to me, but for the case of
- producing relocateable output it is not what the code
+ producing relocatable output it is not what the code
actually does. I don't want to change it, because it seems
far too likely that something will break. */
relocation -=
should not have any tests that depend upon the flavour. It's
seem like entirely the wrong place for such a thing. The
second obvious point is that the current code ignores the
- reloc addend when producing relocateable output for COFF.
+ reloc addend when producing relocatable output for COFF.
That's peculiar. In fact, I really have no idea what the
point of the line you want to remove is.
(coff-i386 does subtract the old value, to be compatible with
existing coff-i386 targets, like SCO).
- So everything works fine when not producing relocateable
- output. When we are producing relocateable output, logically
+ So everything works fine when not producing relocatable
+ output. When we are producing relocatable output, logically
we should do exactly what we do when not producing
- relocateable output. Therefore, your patch is correct. In
+ relocatable output. Therefore, your patch is correct. In
fact, it should probably always just set reloc_entry->addend
to 0 for all cases, since it is, in fact, going to add the
value into the object file. This won't hurt the COFF code,
to other formats (the thing to check for would be whether
any formats both use the addend and set partial_inplace).
- When I wanted to make coff-i386 produce relocateable output,
+ When I wanted to make coff-i386 produce relocatable output,
I ran into the problem that you are running into: I wanted
to remove that line. Rather than risk it, I made the
coff-i386 relocs use a special function; it's coff_i386_reloc
\input texinfo
@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
-@c 2000, 2001
+@c 2000, 2001, 2002, 2003
@c Free Software Foundation, Inc.
@setfilename bfdint.info
@item _bfd_get_relocated_section_contents
Read the contents of a section and apply the relocation information.
-This handles both a final link and a relocateable link; in the latter
+This handles both a final link and a relocatable link; in the latter
case, it adjust the relocation information as well. This is called via
@samp{bfd_get_relocated_section_contents}. Most targets implement it by
calling @samp{bfd_generic_get_relocated_section_contents}.
section as the value to store. In the IEEE object file format,
relocations may involve arbitrary expressions.
-When doing a relocateable link, the linker may or may not have to do
+When doing a relocatable link, the linker may or may not have to do
anything with a relocation, depending upon the definition of the
relocation. Simple relocations generally do not require any special
action.
@itemize @bullet
@item
Make sure you clearly understand what the contents of the section should
-look like after assembly, after a relocateable link, and after a final
+look like after assembly, after a relocatable link, and after a final
link. Make sure you clearly understand the operations the linker must
-perform during a relocateable link and during a final link.
+perform during a relocatable link and during a final link.
@item
Write a howto structure for the relocation. The howto structure is
able to handle that. You may need to set the @samp{special_function}
field to handle assembly correctly. Be careful to ensure that any code
you write to handle the assembler will also work correctly when doing a
-relocateable link. For example, see @samp{bfd_elf_generic_reloc}.
+relocatable link. For example, see @samp{bfd_elf_generic_reloc}.
@item
Test the assembler. Consider the cases of relocation against an
required handling to the target specific relocation function. In simple
cases this will just involve a call to @samp{_bfd_final_link_relocate}
or @samp{_bfd_relocate_contents}, depending upon the definition of the
-relocation and whether the link is relocateable or not.
+relocation and whether the link is relocatable or not.
@item
Test the linker. Test the case of a final link. If the relocation can
overflow, use a linker script to force an overflow and make sure the
-error is reported correctly. Test a relocateable link, whether the
-symbol is defined or undefined in the relocateable output. For both the
-final and relocateable link, test the case when the symbol is a common
+error is reported correctly. Test a relocatable link, whether the
+symbol is defined or undefined in the relocatable output. For both the
+final and relocatable link, test the case when the symbol is a common
symbol, when the symbol looked like a common symbol but became a defined
symbol, when the symbol is defined in a different object file, and when
the symbol is defined in the same object file.
doing a link in which the output object file format is S-records.
@item
-Using the linker to generate relocateable output in a different object
+Using the linker to generate relocatable output in a different object
file format is impossible in the general case, so you generally don't
have to worry about that. The GNU linker makes sure to stop that from
happening when an input file in a different format has relocations.
of howto structure was being used by a particular format.
The new howto structure would clearly define the relocation behaviour in
-the case of an assembly, a relocateable link, and a final link. At
+the case of an assembly, a relocatable link, and a final link. At
least one special function would be defined as an escape, and it might
make sense to define more.
files (but not in executables, except when using dynamic linking).
However, this is outweighed by the simplicity of addend handling when
using @samp{Rela} relocations. With @samp{Rel} relocations, the addend
-must be stored in the section contents, which makes relocateable links
+must be stored in the section contents, which makes relocatable links
more complex.
For example, consider C code like @code{i = a[1000];} where @samp{a} is
If you are adding support for a RISC chip which uses two or more
instructions to load an address, then the addend may not fit in a single
instruction, and will have to be somehow split among the instructions.
-This makes linking awkward, particularly when doing a relocateable link
+This makes linking awkward, particularly when doing a relocatable link
in which the addend may have to be updated. It can be done---the MIPS
ELF support does it---but it should be avoided when possible.
information. In simple cases, this is little more than a loop over the
relocations which computes the value of each relocation and calls
@samp{_bfd_final_link_relocate}. The function must check for a
-relocateable link, and in that case normally needs to do nothing other
+relocatable link, and in that case normally needs to do nothing other
than adjust the addend for relocations against a section symbol.
The complex cases generally have to do with dynamic linker support. GOT
ecoff_link_write_external,
(PTR) &einfo);
- if (info->relocateable)
+ if (info->relocatable)
{
/* We need to make a pass over the link_orders to count up the
number of relocations we will need to output, so that we know
bfd_ecoff_debug_free (handle, abfd, debug, &backend->debug_swap, info);
- if (info->relocateable)
+ if (info->relocatable)
{
/* Now reset the reloc_count field of the sections in the output
BFD to 0, so that we can use them to keep track of how many
ecoff_data (abfd)->gp = (h->u.def.value
+ h->u.def.section->output_section->vma
+ h->u.def.section->output_offset);
- else if (info->relocateable)
+ else if (info->relocatable)
{
bfd_vma lo;
cooked_size))
goto error_return;
- /* If we are producing relocateable output, the relocs were
+ /* If we are producing relocatable output, the relocs were
modified, and we write them out now. We use the reloc_count
field of output_section to keep track of the number of relocs we
have output so far. */
- if (info->relocateable)
+ if (info->relocatable)
{
file_ptr pos = (output_section->rel_filepos
+ output_section->reloc_count * external_reloc_size);
/* Routines to link ECOFF debugging information.
- Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
+ Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
ainfo->largest_file_shuffle = 0;
- if (! info->relocateable)
+ if (! info->relocatable)
{
if (! bfd_hash_table_init (&ainfo->str_hash.table, string_hash_newfunc))
return NULL;
bfd_hash_table_free (&ainfo->fdr_hash.table);
- if (! info->relocateable)
+ if (! info->relocatable)
bfd_hash_table_free (&ainfo->str_hash.table);
objalloc_free (ainfo->memory);
/* If we are doing a final link, we hash all the strings in
the local symbol table together. This reduces the amount
of space required by debugging information. We don't do
- this when performing a relocateable link because it would
+ this when performing a relocatable link because it would
prevent us from easily merging different FDR's. */
- if (! info->relocateable)
+ if (! info->relocatable)
{
bfd_boolean ffilename;
const char *name;
fdr.iauxBase = output_symhdr->iauxMax;
output_symhdr->iauxMax += fdr.caux;
}
- if (! info->relocateable)
+ if (! info->relocatable)
{
/* When are are hashing strings, we lie about the number of
symhdr = &debug->symbolic_header;
len = strlen (string);
- if (info->relocateable)
+ if (info->relocatable)
{
if (!add_memory_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end, (PTR) string,
len + 1))
this interface, so that must be changed to do something else. */
bfd_boolean
-bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr,
+bfd_ecoff_debug_externals (abfd, debug, swap, relocatable, get_extr,
set_index)
bfd *abfd;
struct ecoff_debug_info *debug;
const struct ecoff_debug_swap *swap;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_boolean (*get_extr) PARAMS ((asymbol *, EXTR *));
void (*set_index) PARAMS ((asymbol *, bfd_size_type));
{
/* If we're producing an executable, move common symbols into
bss. */
- if (! relocateable)
+ if (! relocatable)
{
if (esym.asym.sc == scCommon)
esym.asym.sc = scBss;
/* The string table is written out from the hash table if this is a
final link. */
- if (info->relocateable)
+ if (info->relocatable)
{
BFD_ASSERT (ainfo->ss_hash == (struct string_hash_entry *) NULL);
if (! ecoff_write_shuffle (abfd, swap, ainfo->ss, space))
This function is responsible for adjust the section contents as
necessary, and (if using Rela relocs and generating a
- relocateable output file) adjusting the reloc addend as
+ relocatable output file) adjusting the reloc addend as
necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
in which case we can remove it provided we adjust
all FDEs. Also, it can be removed if we have removed
all FDEs using it. */
- if ((!info->relocateable
+ if ((!info->relocatable
&& cie_compare (&cie, &hdr_info->last_cie) == 0)
|| cie_usage_count == 0)
{
/* Common code for PA ELF implementations.
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
Ultimately we should have better controls over the generic ELF BFD
linker code. */
- if (! info->relocateable
+ if (! info->relocatable
&& ! (info->shared
&& !info->no_undefined)
&& h->root.type == bfd_link_hash_undefined
Ultimately we should have better controls over the generic ELF BFD
linker code. */
- if (! info->relocateable
+ if (! info->relocatable
&& ! (info->shared
&& !info->no_undefined)
&& h->root.type == bfd_link_hash_undefined
bfd_boolean retval;
struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
- if (! info->relocateable)
+ if (! info->relocatable)
{
struct elf_link_hash_entry *gp;
bfd_vma gp_val;
Elf_Internal_Rela *relend;
struct elf64_hppa_link_hash_table *hppa_info;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
hppa_info = elf64_hppa_hash_table (info);
struct elf_link_hash_entry **sym_hashes;
Elf_Internal_Rela *rel, *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
/* Assume nothing changes. */
*again = FALSE;
- /* We don't have to do anything for a relocateable link, if
+ /* We don't have to do anything for a relocatable link, if
this section does not have relocs, or if this is not a
code section. */
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
|| (sec->flags & SEC_CODE) == 0)
static bfd_byte *
mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
Elf_Internal_Shdr *symtab_hdr;
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
struct elf32_mn10300_link_hash_entry **sym_hashes;
Elf_Internal_Rela *rel, *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
/* For error_return. */
section = sec;
- /* We don't have to do anything for a relocateable link, if
+ /* We don't have to do anything for a relocatable link, if
this section does not have relocs, or if this is not a
code section. */
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
|| (sec->flags & SEC_CODE) == 0)
static bfd_byte *
mn10300_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
Elf_Internal_Shdr *symtab_hdr;
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
"SHT_NOBITS", "SHT_REL", "SHT_SHLIB", "SHT_DYNSYM",
};
-/* ELF relocs are against symbols. If we are producing relocateable
+/* ELF relocs are against symbols. If we are producing relocatable
output, and the reloc is against an external symbol, and nothing
has given us any additional addend, the resulting reloc will also
be against the same symbol. In such a case, we don't want to
all be done at final link time. Rather than put special case code
into bfd_perform_relocation, all the reloc types use this howto
function. It just short circuits the reloc if producing
- relocateable output against an external symbol. */
+ relocatable output against an external symbol. */
bfd_reloc_status_type
bfd_elf_generic_reloc (abfd,
SHF_ALLOC is set, and this is a shared object, then we also
treat this section as a BFD section. We can not base the
decision purely on SHF_ALLOC, because that flag is sometimes
- set in a relocateable object file, which would confuse the
+ set in a relocatable object file, which would confuse the
linker. */
if ((hdr->sh_flags & SHF_ALLOC) != 0
&& (abfd->flags & DYNAMIC) != 0
/* If we are only performing a partial
link do not bother adding the glue. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME);
/* If we are only performing a partial link
do not bother getting a bfd to hold the glue. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
globals = elf32_arm_hash_table (info);
/* If we are only performing a partial link do not bother
to construct any glue. */
- if (link_info->relocateable)
+ if (link_info->relocatable)
return TRUE;
/* Here we have a bfd that is to be included on the link. We have a hook
const char *name;
#if !USE_REL
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
#endif
howto = bfd_reloc.howto;
#if USE_REL
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link. We don't have to change
+ /* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
asection *sgot, *srelgot, *sreloc;
bfd_vma *local_got_offsets;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
sgot = srelgot = sreloc = NULL;
/* AVR-specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
This file is part of BFD, the Binary File Descriptor library.
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
Elf_Internal_Rela * rel;
Elf_Internal_Rela * relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
asection *srelgot;
asection *sreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
/* D10V-specific support for 32-bit ELF
- Copyright 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
Contributed by Martin Hunt (hunt@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
howto = elf_d10v_howto_table + r_type;
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link. We don't have to change
+ /* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
/* DLX specific support for 32-bit ELF
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
return ret;
}
-/* ELF relocs are against symbols. If we are producing relocateable
+/* ELF relocs are against symbols. If we are producing relocatable
output, and the reloc is against an external symbol, and nothing
has given us any additional addend, the resulting reloc will also
be against the same symbol. In such a case, we don't want to
all be done at final link time. Rather than put special case code
into bfd_perform_relocation, all the reloc types use this howto
function. It just short circuits the reloc if producing
- relocateable output against an external symbol. */
+ relocatable output against an external symbol. */
static bfd_reloc_status_type
elf32_dlx_relocate16 (abfd, reloc_entry, symbol, data,
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* FR30-specific support for 32-bit ELF.
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
zero.
This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocateable
+ necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* FRV-specific support for 32-bit ELF.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
zero.
This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocateable
+ necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
bfd_vma *valp;
{
if (sym->st_shndx == SHN_COMMON
- && !info->relocateable
+ && !info->relocatable
&& (int)sym->st_size <= (int)bfd_get_gp_size (abfd))
{
/* Common symbols less than or equal to -G nn bytes are
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
Elf_Internal_Rela *rel, *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
/* Assume nothing changes. */
*again = FALSE;
- /* We don't have to do anything for a relocateable link, if
+ /* We don't have to do anything for a relocatable link, if
this section does not have relocs, or if this is not a
code section. */
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
|| (sec->flags & SEC_CODE) == 0)
static bfd_byte *
elf32_h8_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
Elf_Internal_Shdr *symtab_hdr;
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
asection *sreloc;
asection *stubreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = hppa_link_hash_table (info);
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
/* i370-specific support for 32-bit ELF
- Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
+ Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
Hacked by Linas Vepstas for i370 linas@linas.org
bfd_vma *local_got_offsets;
asection *sreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
#ifdef DEBUG
This function is responsible for adjust the section contents as
necessary, and (if using Rela relocs and generating a
- relocateable output file) adjusting the reloc addend as
+ relocatable output file) adjusting the reloc addend as
necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
bfd_vma *local_got_offsets;
bfd_boolean ret = TRUE;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
#ifdef DEBUG
bfd_archive_filename (input_bfd),
bfd_section_name(input_bfd, input_section),
(long) input_section->reloc_count,
- (info->relocateable) ? " (relocatable)" : "");
+ (info->relocatable) ? " (relocatable)" : "");
#endif
if (!i370_elf_howto_table[ R_I370_ADDR31 ]) /* Initialize howto table if needed */
const Elf_Internal_Rela *rel_end;
asection *sreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf_i386_hash_table (info);
r_symndx = ELF32_R_SYM (rel->r_info);
- if (info->relocateable)
+ if (info->relocatable)
{
bfd_vma val;
bfd_byte *where;
/* Intel i860 specific support for 32-bit ELF.
- Copyright 1993, 1995, 1999, 2000, 2001, 2002
+ Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Full i860 support contributed by Jason Eckhardt <jle@cygnus.com>.
zero.
This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocateable
+ necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
/* Intel 860 specific support for 32-bit ELF
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
cache_ptr->howto = &elf_howto_table[(int) type];
}
-/* ELF relocs are against symbols. If we are producing relocateable
+/* ELF relocs are against symbols. If we are producing relocatable
output, and the reloc is against an external symbol, and nothing
has given us any additional addend, the resulting reloc will also
be against the same symbol. In such a case, we don't want to
all be done at final link time. Rather than put special case code
into bfd_perform_relocation, all the reloc types use this howto
function. It just short circuits the reloc if producing
- relocateable output against an external symbol. */
+ relocatable output against an external symbol. */
bfd_reloc_status_type
elf32_i960_relocate (abfd,
/* We don't have to do anything for a relocatable link,
if this section does not have relocs, or if this is
not a code section. */
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
|| (sec->flags & SEC_CODE) == 0)
zero.
This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocateable
+ necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
const Elf_Internal_Rela *rel_end;
bfd_boolean changed = FALSE;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
zero.
This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocateable
+ necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
asection **secp;
bfd_vma *valp;
{
- if (! info->relocateable
+ if (! info->relocatable
&& (*namep)[0] == '_' && (*namep)[1] == 'S'
&& strcmp (*namep, "_SDA_BASE_") == 0
&& info->hash->creator->flavour == bfd_target_elf_flavour)
symbol value correctly. We look up the symbol _SDA_BASE_ in the output
BFD. If we can't find it, we're stuck. We cache it in the ELF
target data. We don't need to adjust the symbol value for an
- external symbol if we are producing relocateable output. */
+ external symbol if we are producing relocatable output. */
static bfd_reloc_status_type
m32r_elf_final_sda_base (output_bfd, info, error_message, psb)
This function is responsible for adjust the section contents as
necessary, and (if using Rela relocs and generating a
- relocateable output file) adjusting the reloc addend as
+ relocatable output file) adjusting the reloc addend as
necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
bfd_boolean ret = TRUE;
#if !USE_REL
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
#endif
r_symndx = ELF32_R_SYM (rel->r_info);
#if USE_REL
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link. We don't have to change
+ /* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
/* Assume nothing changes. */
*again = FALSE;
- /* We don't have to do anything for a relocateable link, if
+ /* We don't have to do anything for a relocatable link, if
this section does not have relocs, or if this is not a
code section. */
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
|| (sec->flags & SEC_CODE) == 0
static bfd_byte *
m32r_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
Elf_Internal_Shdr *symtab_hdr;
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Assume nothing changes. */
*again = FALSE;
- /* We don't have to do anything for a relocateable link, if
+ /* We don't have to do anything for a relocatable link, if
this section does not have relocs, or if this is not a
code section. */
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
|| (sec->flags & SEC_CODE) == 0)
const Elf_Internal_Rela * rel;
const Elf_Internal_Rela * rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
|| r_type == R_M68HC11_GNU_VTINHERIT )
continue;
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link. We don't have to change
+ /* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
asection *srelgot;
asection *sreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
bfd_byte *p;
bfd_size_type amt;
- BFD_ASSERT (! info->relocateable);
+ BFD_ASSERT (! info->relocatable);
*errmsg = NULL;
/* Motorola MCore specific support for 32-bit ELF
- Copyright 1994, 1995, 1999, 2000, 2001, 2002
+ Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This function is responsible for adjust the section contents as
necessary, and (if using Rela relocs and generating a
- relocateable output file) adjusting the reloc addend as
+ relocatable output file) adjusting the reloc addend as
necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
bfd_archive_filename (input_bfd),
bfd_section_name(input_bfd, input_section),
(long) input_section->reloc_count,
- (info->relocateable) ? " (relocatable)" : "");
+ (info->relocatable) ? " (relocatable)" : "");
#endif
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
if (! mcore_elf_howto_table [R_MCORE_PCRELIMM8BY4]) /* Initialize howto table if needed */
const Elf_Internal_Rela * rel;
const Elf_Internal_Rela * rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
if (strcmp (bfd_asymbol_name (symbol), "_gp_disp") == 0)
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_vma gp;
if (ret == bfd_reloc_undefined)
abort ();
if (output_bfd != NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable,
error_message, &gp);
if (ret != bfd_reloc_ok)
return ret;
symbol value correctly. We look up the symbol _gp in the output
BFD. If we can't find it, we're stuck. We cache it in the ELF
target data. We don't need to adjust the symbol value for an
- external symbol if we are producing relocateable output. */
+ external symbol if we are producing relocatable output. */
static bfd_reloc_status_type
-mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp)
+mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp)
bfd *output_bfd;
asymbol *symbol;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
char **error_message;
bfd_vma *pgp;
{
if (bfd_is_und_section (symbol->section)
- && ! relocateable)
+ && ! relocatable)
{
*pgp = 0;
return bfd_reloc_undefined;
*pgp = _bfd_get_gp_value (output_bfd);
if (*pgp == 0
- && (! relocateable
+ && (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0))
{
- if (relocateable)
+ if (relocatable)
{
/* Make up a value. */
*pgp = symbol->section->output_section->vma + 0x4000;
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
}
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
- input_section, relocateable,
+ input_section, relocatable,
data, gp);
}
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
}
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable,
error_message, &gp);
if (ret != bfd_reloc_ok)
return ret;
return gprel32_with_gp (abfd, symbol, reloc_entry, input_section,
- relocateable, data, gp);
+ relocatable, data, gp);
}
static bfd_reloc_status_type
-gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data,
+gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data,
gp)
bfd *abfd;
asymbol *symbol;
arelent *reloc_entry;
asection *input_section;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
PTR data;
bfd_vma gp;
{
val += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
else
reloc_entry->addend = val;
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
unsigned short extend = 0;
}
if (output_bfd != NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
_bfd_mips_elf_sign_extend(val, 16);
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
else
reloc_entry->addend = val;
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0))
return bfd_reloc_overflow;
Elf_Internal_Rela *irel, *irelend;
bfd_byte *p;
- BFD_ASSERT (! info->relocateable);
+ BFD_ASSERT (! info->relocatable);
*errmsg = NULL;
/* MSP430-specific support for 32-bit ELF
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Dmitry Diky <diwil@mail.ru>
This file is part of BFD, the Binary File Descriptor library.
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* OpenRISC-specific support for 32-bit ELF.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Johan Rydberg, jrydberg@opencores.org
This file is part of BFD, the Binary File Descriptor library.
zero.
This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocateable
+ necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
const Elf_Internal_Rela *rel_end;
asection *sreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
#ifdef DEBUG
asection *sec;
struct ppc_elf_link_hash_table *htab;
- if (info->relocateable || info->shared)
+ if (info->relocatable || info->shared)
return TRUE;
htab = ppc_elf_hash_table (info);
bfd_vma *valp)
{
if (sym->st_shndx == SHN_COMMON
- && !info->relocateable
+ && !info->relocatable
&& sym->st_size <= elf_gp_size (abfd)
&& info->hash->creator->flavour == bfd_target_elf_flavour)
{
This function is responsible for adjust the section contents as
necessary, and (if using Rela relocs and generating a
- relocateable output file) adjusting the reloc addend as
+ relocatable output file) adjusting the reloc addend as
necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
bfd_archive_filename (input_bfd),
bfd_section_name(input_bfd, input_section),
(long) input_section->reloc_count,
- (info->relocateable) ? " (relocatable)" : "");
+ (info->relocatable) ? " (relocatable)" : "");
#endif
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
if (!ppc_elf_howto_table[R_PPC_ADDR32])
bfd_signed_vma *local_got_refcounts;
int tls_type, old_tls_type;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf_s390_hash_table (info);
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf_s390_hash_table (info);
*again = FALSE;
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0)
return TRUE;
(info,
_("Unexpected STO_SH5_ISA32 on local symbol is not handled"),
input_bfd, input_section, rel->r_offset));
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link. We don't have to change
+ /* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
{
/* Section symbol are never (?) placed in the hash table, so
we can just ignore hash relocations when creating a
- relocateable object file. */
- if (info->relocateable)
+ relocatable object file. */
+ if (info->relocatable)
continue;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
static bfd_byte *
sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
Elf_Internal_Shdr *symtab_hdr;
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
srelgot = NULL;
sreloc = NULL;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
{
struct elf_link_hash_entry *h;
- /* For relocateable links, we register the DataLabel sym in its own
+ /* For relocatable links, we register the DataLabel sym in its own
right, and tweak the name when it's output. Otherwise, we make
an indirect symbol of it. */
flagword flags
- = info->relocateable || info->emitrelocations
+ = info->relocatable || info->emitrelocations
? BSF_GLOBAL : BSF_GLOBAL | BSF_INDIRECT;
char *dl_name
free (dl_name);
if (h->type != STT_DATALABEL
- || ((info->relocateable || info->emitrelocations)
+ || ((info->relocatable || info->emitrelocations)
&& h->root.type != bfd_link_hash_undefined)
- || (! info->relocateable && !info->emitrelocations
+ || (! info->relocatable && !info->emitrelocations
&& h->root.type != bfd_link_hash_indirect))
{
/* Make sure we don't get confused on invalid input. */
{
char *name = (char *) cname;
- if (info->relocateable || info->emitrelocations)
+ if (info->relocatable || info->emitrelocations)
{
if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL)
name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0;
asection *sreloc;
bfd_boolean checked_tlsgd = FALSE;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf32_sparc_hash_table (info);
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf32_sparc_hash_table (info);
int other = 0;
const char *common = (const char *)0;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
#ifdef DEBUG
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
*again = FALSE;
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0)
return TRUE;
asection *srelgot;
asection *sreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
/* XSTORMY16-specific support for 32-bit ELF.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
asection *splt;
bfd *dynobj;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata(abfd)->symtab_hdr;
/* Assume nothing changes. */
*again = FALSE;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* We only relax the .plt section at the moment. */
bfd *dynobj;
asection *splt;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
zero.
This function is responsible for adjusting the section contents as
- necessary, and (if using Rela relocs and generating a relocateable
+ necessary, and (if using Rela relocs and generating a relocatable
output file) adjusting the reloc addend as necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
bfd *dynobj;
asection *splt;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
PARAMS ((xtensa_opcode, xtensa_encode_result));
static bfd_reloc_status_type bfd_elf_xtensa_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static void do_fix_for_relocateable_link
+static void do_fix_for_relocatable_link
PARAMS ((Elf_Internal_Rela *, bfd *, asection *));
static void do_fix_for_final_link
PARAMS ((Elf_Internal_Rela *, asection *, bfd_vma *));
property_table_entry *lit_table;
int ltblsize;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
asection *reloc_target_output_section;
bfd_boolean is_weak_undef;
- /* ELF relocs are against symbols. If we are producing relocateable
+ /* ELF relocs are against symbols. If we are producing relocatable
output, and the reloc is against an external symbol, the resulting
reloc will also be against the same symbol. In such a case, we
don't want to change anything about the way the reloc is handled,
/* Relocate an Xtensa ELF section. This is invoked by the linker for
- both relocateable and final links. */
+ both relocatable and final links. */
static bfd_boolean
elf_xtensa_relocate_section (output_bfd, info, input_bfd,
r_symndx = ELF32_R_SYM (rel->r_info);
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link.
+ /* This is a relocatable link.
1) If the reloc is against a section symbol, adjust
according to the output section.
2) If there is a new target for this relocation,
if (relaxing_section)
{
/* Check if this references a section in another input file. */
- do_fix_for_relocateable_link (rel, input_bfd, input_section);
+ do_fix_for_relocatable_link (rel, input_bfd, input_section);
r_type = ELF32_R_TYPE (rel->r_info);
}
r_type = ELF32_R_TYPE (rel->r_info);
}
- /* This is a relocateable link, so we don't have to change
+ /* This is a relocatable link, so we don't have to change
anything unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
/* If there is an addend with a partial_inplace howto,
then move the addend to the contents. This is a hack
- to work around problems with DWARF in relocateable links
+ to work around problems with DWARF in relocatable links
with some previous version of BFD. Now we can't easily get
rid of the hack without breaking backward compatibility.... */
if (rel->r_addend)
}
}
- /* Done with work for relocateable link; continue with next reloc. */
+ /* Done with work for relocatable link; continue with next reloc. */
continue;
}
}
/* Combine adjacent literal table entries. */
- BFD_ASSERT (! info->relocateable);
+ BFD_ASSERT (! info->relocatable);
num_xtlit_entries = elf_xtensa_combine_prop_entries (output_bfd, ".xt.lit");
if (num_xtlit_entries < 0)
return FALSE;
if (!target_sec->output_section)
return FALSE;
- /* For relocateable sections, we can only simplify when the output
+ /* For relocatable sections, we can only simplify when the output
section of the target is the same as the output section of the
source. */
- if (link_info->relocateable
+ if (link_info->relocatable
&& (target_sec->output_section != sec->output_section))
return FALSE;
/* "Fix" handling functions, called while performing relocations. */
static void
-do_fix_for_relocateable_link (rel, input_bfd, input_section)
+do_fix_for_relocatable_link (rel, input_bfd, input_section)
Elf_Internal_Rela *rel;
bfd *input_bfd;
asection *input_section;
/* We are not currently changing any sizes, so only one pass. */
*again = FALSE;
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0)
return TRUE;
bfd_vma *valp;
{
if (sym->st_shndx == SHN_COMMON
- && !info->relocateable
+ && !info->relocatable
&& sym->st_size <= elf_gp_size (abfd))
{
/* Common symbols less than or equal to -G nn bytes are
bfd_boolean got_created;
bfd_size_type amt;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table(info)->dynobj;
{
bfd *i;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* First, take care of the indirect symbols created by versioning. */
const char *section_name;
/* Handle relocatable links with a smaller loop. */
- if (info->relocateable)
+ if (info->relocatable)
return elf64_alpha_relocate_section_r (output_bfd, info, input_bfd,
input_section, contents, relocs,
local_syms, local_sections);
size_t buf_len;
int sec_symndx;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* If this is the first dynamic object found in the link, create
symbol value correctly. We look up the symbol _gp in the output
BFD. If we can't find it, we're stuck. We cache it in the ELF
target data. We don't need to adjust the symbol value for an
- external symbol if we are producing relocateable output. */
+ external symbol if we are producing relocatable output. */
static bfd_reloc_status_type
-mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message, pgp)
+mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message, pgp)
bfd *output_bfd;
asymbol *symbol;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
char **error_message;
bfd_vma *pgp;
{
if (bfd_is_und_section (symbol->section)
- && ! relocateable)
+ && ! relocatable)
{
*pgp = 0;
return bfd_reloc_undefined;
*pgp = _bfd_get_gp_value (output_bfd);
if (*pgp == 0
- && (! relocateable
+ && (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0))
{
- if (relocateable)
+ if (relocatable)
{
/* Make up a value. */
*pgp = symbol->section->output_section->vma /*+ 0x4000*/;
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
}
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
- input_section, relocateable,
+ input_section, relocatable,
data, gp);
}
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
/* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
- input_section, relocateable,
+ input_section, relocatable,
data, gp);
}
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
bfd_vma relocation;
}
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf64_final_gp (output_bfd, symbol, relocateable,
+ ret = mips_elf64_final_gp (output_bfd, symbol, relocatable,
error_message, &gp);
if (ret != bfd_reloc_ok)
return ret;
val += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
else
reloc_entry->addend = val;
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
unsigned short extend = 0;
}
if (output_bfd != NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf64_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf64_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
_bfd_mips_elf_sign_extend(val, 16);
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
else
reloc_entry->addend = val;
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0))
return bfd_reloc_overflow;
r_symndx = ELF64_R_SYM (rel->r_info);
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link. We don't have to change
+ /* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* We currently have to abuse this COFF-specific member, since there's
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
if (sec->_cooked_size == 0)
sec->_cooked_size = sec->_raw_size;
- /* We don't have to do anything for a relocateable link, if
+ /* We don't have to do anything for a relocatable link, if
this section does not have relocs, or if this is not a
code section. */
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0
|| (sec->flags & SEC_CODE) == 0
asection *sreloc;
asection **opd_sym_map;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = ppc_hash_table (info);
asection *sec;
struct ppc_link_hash_table *htab;
- if (info->relocateable || info->shared)
+ if (info->relocatable || info->shared)
return TRUE;
htab = ppc_hash_table (info);
This function is responsible for adjust the section contents as
necessary, and (if using Rela relocs and generating a
- relocateable output file) adjusting the reloc addend as
+ relocatable output file) adjusting the reloc addend as
necessary.
This function does not have to worry about setting the reloc
The global hash table entry for the global symbols can be found
via elf_sym_hashes (input_bfd).
- When generating relocateable output, this function must handle
+ When generating relocatable output, this function must handle
STB_LOCAL/STT_SECTION symbols specially. The output symbol is
going to be the section symbol corresponding to the output
section, which means that the addend must be adjusted
/* Disabled until we sort out how ld should choose 'y' vs 'at'. */
bfd_boolean is_power4 = FALSE;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* Initialize howto table if needed. */
bfd_signed_vma *local_got_refcounts;
int tls_type, old_tls_type;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf_s390_hash_table (info);
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf_s390_hash_table (info);
_("Unexpected STO_SH5_ISA32 on local symbol is not handled"),
input_bfd, input_section, rel->r_offset));
- if (info->relocateable)
+ if (info->relocatable)
{
- /* This is a relocateable link. We don't have to change
+ /* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
section symbol winds up in the output section. */
{
/* Section symbols are never (?) placed in the hash table, so
we can just ignore hash relocations when creating a
- relocateable object file. */
- if (info->relocateable)
+ relocatable object file. */
+ if (info->relocatable)
continue;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
static bfd_byte *
sh_elf64_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
Elf_Internal_Shdr *symtab_hdr;
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
srelgot = NULL;
sreloc = NULL;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
{
struct elf_link_hash_entry *h;
- /* For relocateable links, we register the DataLabel sym in its own
+ /* For relocatable links, we register the DataLabel sym in its own
right, and tweak the name when it's output. Otherwise, we make
an indirect symbol of it. */
flagword flags
- = info->relocateable || info->emitrelocations
+ = info->relocatable || info->emitrelocations
? BSF_GLOBAL : BSF_GLOBAL | BSF_INDIRECT;
char *dl_name
free (dl_name);
if (h->type != STT_DATALABEL
- || ((info->relocateable || info->emitrelocations)
+ || ((info->relocatable || info->emitrelocations)
&& h->root.type != bfd_link_hash_undefined)
- || (! info->relocateable && !info->emitrelocations
+ || (! info->relocatable && !info->emitrelocations
&& h->root.type != bfd_link_hash_indirect))
{
/* Make sure we don't get confused on invalid input. */
{
char *name = (char *) cname;
- if (info->relocateable || info->emitrelocations)
+ if (info->relocatable || info->emitrelocations)
{
if (ELF_ST_TYPE (sym->st_info) == STT_DATALABEL)
name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0;
asection *srelgot;
asection *sreloc;
- if (info->relocateable || !(sec->flags & SEC_ALLOC))
+ if (info->relocatable || !(sec->flags & SEC_ALLOC))
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
const Elf_Internal_Rela *rel_end;
asection *sreloc;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf64_x86_64_hash_table (info);
Elf_Internal_Rela *rel;
Elf_Internal_Rela *relend;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
htab = elf64_x86_64_hash_table (info);
else
sym->symbol.section = bfd_abs_section_ptr;
- /* If this is a relocateable file, then the symbol value is
+ /* If this is a relocatable file, then the symbol value is
already section relative. */
if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
sym->symbol.value -= sym->symbol.section->vma;
/* You can't use -r against a dynamic object. Also, there's no
hope of using a dynamic object which does not exactly match
the format of the output file. */
- if (info->relocateable || info->hash->creator != abfd->xvec)
+ if (info->relocatable || info->hash->creator != abfd->xvec)
{
bfd_set_error (bfd_error_invalid_operation);
goto error_return;
FALSE, collect, (struct bfd_link_hash_entry **) NULL)))
goto error_return;
- if (! info->relocateable)
+ if (! info->relocatable)
{
/* Clobber the section size so that the warning does
not get copied into the output file. */
}
}
- if (! info->relocateable && ! dynamic
+ if (! info->relocatable && ! dynamic
&& is_elf_hash_table (info))
{
asection *s;
if (notesec)
{
elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | exec;
- if (exec && info->relocateable
+ if (exec && info->relocatable
&& notesec->output_section != bfd_abs_section_ptr)
notesec->output_section->flags |= SEC_CODE;
}
struct elf_final_link_info *finfo;
};
-/* When performing a relocateable link, the input relocations are
+/* When performing a relocatable link, the input relocations are
preserved. But, if they reference global symbols, the indices
referenced must be updated. Update all the relocations in
REL_HDR (there are COUNT of them), using the data in REL_HASH. */
dynamic = elf_hash_table (info)->dynamic_sections_created;
dynobj = elf_hash_table (info)->dynobj;
- emit_relocs = (info->relocateable
+ emit_relocs = (info->relocatable
|| info->emitrelocations
|| bed->elf_backend_emit_relocs);
if (sec->flags & SEC_MERGE)
merged = TRUE;
- if (info->relocateable || info->emitrelocations)
+ if (info->relocatable || info->emitrelocations)
reloc_count = sec->reloc_count;
else if (bed->elf_backend_count_relocs)
{
o->vma = 0;
}
- if (! info->relocateable && merged)
+ if (! info->relocatable && merged)
elf_link_hash_traverse (elf_hash_table (info),
_bfd_elf_link_sec_merge_syms, (PTR) abfd);
if (o != NULL)
o->target_index = bfd_get_symcount (abfd);
elfsym.st_shndx = i;
- if (info->relocateable || o == NULL)
+ if (info->relocatable || o == NULL)
elfsym.st_value = 0;
else
elfsym.st_value = o->vma;
Unfortunately, there is no way to know the total number of local
symbols until we have seen all of them, and the local symbol
indices precede the global symbol indices. This means that when
- we are generating relocateable output, and we see a reloc against
+ we are generating relocatable output, and we see a reloc against
a global symbol, we can not know the symbol index until we have
finished examining all the local symbols to see which ones we are
going to output. To deal with this, we keep the relocations in
memory, and don't output them until the end of the link. This is
an unfortunate waste of memory, but I don't see a good way around
- it. Fortunately, it only happens when performing a relocateable
+ it. Fortunately, it only happens when performing a relocatable
link, which is not the common case. FIXME: If keep_memory is set
we could write the relocs out and then read them again; I don't
know how bad the memory loss will be. */
}
}
- if (info->relocateable)
+ if (info->relocatable)
{
bfd_boolean failed = FALSE;
program is run. We don't have to worry about symbols that are
referenced by regular files, because we will already have issued
warnings for them. */
- if (! finfo->info->relocateable
+ if (! finfo->info->relocatable
&& (finfo->info->executable
|| ! finfo->info->allow_shlib_undefined)
&& h->root.type == bfd_link_hash_undefined
/* We should also warn if a forced local symbol is referenced from
shared libraries. */
- if (! finfo->info->relocateable
+ if (! finfo->info->relocatable
&& (! finfo->info->shared || ! finfo->info->allow_shlib_undefined)
&& (h->elf_link_hash_flags
& (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC
return FALSE;
}
- /* ELF symbols in relocateable files are section relative,
- but in nonrelocateable files they are virtual
+ /* ELF symbols in relocatable files are section relative,
+ but in nonrelocatable files they are virtual
addresses. */
sym.st_value = h->root.u.def.value + input_sec->output_offset;
- if (! finfo->info->relocateable)
+ if (! finfo->info->relocatable)
{
sym.st_value += input_sec->output_section->vma;
if (h->type == STT_TLS)
/* If a non-weak symbol with non-default visibility is not defined
locally, it is a fatal error. */
- if (! finfo->info->relocateable
+ if (! finfo->info->relocatable
&& ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT
&& ELF_ST_BIND (sym.st_info) != STB_WEAK
&& h->root.type == bfd_link_hash_undefined
if ((input_bfd->flags & DYNAMIC) != 0)
return TRUE;
- emit_relocs = (finfo->info->relocateable
+ emit_relocs = (finfo->info->relocatable
|| finfo->info->emitrelocations
|| bed->elf_backend_emit_relocs);
continue;
/* If we are discarding all local symbols, we don't want to
- output this one. If we are generating a relocateable output
+ output this one. If we are generating a relocatable output
file, then some of the local symbols may be required by
relocs; we output them below as we discover that they are
needed. */
if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
&& isec != NULL
&& ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0)
- || (! finfo->info->relocateable
+ || (! finfo->info->relocatable
&& (isec->flags & SEC_EXCLUDE) != 0)))
continue;
&& (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
== NULL))
|| (((finfo->info->discard == discard_sec_merge
- && (isec->flags & SEC_MERGE) && ! finfo->info->relocateable)
+ && (isec->flags & SEC_MERGE) && ! finfo->info->relocatable)
|| finfo->info->discard == discard_l)
&& bfd_is_local_label_name (input_bfd, name)))
continue;
*pindex = bfd_get_symcount (output_bfd);
- /* ELF symbols in relocateable files are section relative, but
+ /* ELF symbols in relocatable files are section relative, but
in executable files they are virtual addresses. Note that
this code assumes that all ELF sections have an associated
BFD section with a reasonable value for output_offset; below
output_section. Any special sections must be set up to meet
these requirements. */
osym.st_value += isec->output_offset;
- if (! finfo->info->relocateable)
+ if (! finfo->info->relocatable)
{
osym.st_value += isec->output_section->vma;
if (ELF_ST_TYPE (osym.st_info) == STT_TLS)
The back end routine is responsible for adjusting the
section contents as necessary, and (if using Rela relocs
- and generating a relocateable output file) adjusting the
+ and generating a relocatable output file) adjusting the
reloc addend as necessary.
The back end routine does not have to worry about setting
internal symbols, and can access the hash table entries
for the external symbols via elf_sym_hashes (input_bfd).
- When generating relocateable output, the back end routine
+ When generating relocatable output, the back end routine
must handle STB_LOCAL/STT_SECTION symbols specially. The
output symbol is going to be a section symbol
corresponding to the output section, which will require
+ elf_section_data (o->output_section)->rel_count
+ elf_section_data (o->output_section)->rel_count2);
last_offset = o->output_offset;
- if (!finfo->info->relocateable)
+ if (!finfo->info->relocatable)
last_offset += o->output_section->vma;
for (next_erel = 0; irela < irelaend; irela++, next_erel++)
{
irela->r_offset += o->output_offset;
/* Relocs in an executable have to be virtual addresses. */
- if (!finfo->info->relocateable)
+ if (!finfo->info->relocatable)
irela->r_offset += o->output_section->vma;
last_offset = irela->r_offset;
return FALSE;
sym.st_value += sec->output_offset;
- if (! finfo->info->relocateable)
+ if (! finfo->info->relocatable)
{
sym.st_value += osec->vma;
if (ELF_ST_TYPE (sym.st_info) == STT_TLS)
/* Swap out the relocs. */
if (bed->elf_backend_emit_relocs
- && !(finfo->info->relocateable
+ && !(finfo->info->relocatable
|| finfo->info->emitrelocations))
reloc_emitter = bed->elf_backend_emit_relocs;
else
}
/* The address of a reloc is relative to the section in a
- relocateable file, and is a virtual address in an executable
+ relocatable file, and is a virtual address in an executable
file. */
offset = link_order->offset;
- if (! info->relocateable)
+ if (! info->relocatable)
offset += output_section->vma;
for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
struct elf_link_hash_entry *h, Elf_Internal_Sym *));
if (!get_elf_backend_data (abfd)->can_gc_sections
- || info->relocateable || info->emitrelocations
+ || info->relocatable || info->emitrelocations
|| elf_hash_table (info)->dynamic_sections_created)
return TRUE;
continue;
eh = bfd_get_section_by_name (abfd, ".eh_frame");
- if (info->relocateable
+ if (info->relocatable
|| (eh != NULL
&& (eh->_raw_size == 0
|| bfd_is_abs_section (eh->output_section))))
}
if (info->eh_frame_hdr
- && !info->relocateable
+ && !info->relocatable
&& _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
ret = TRUE;
symbol value correctly. We look up the symbol _gp in the output
BFD. If we can't find it, we're stuck. We cache it in the ELF
target data. We don't need to adjust the symbol value for an
- external symbol if we are producing relocateable output. */
+ external symbol if we are producing relocatable output. */
static bfd_reloc_status_type
-mips_elf_final_gp (output_bfd, symbol, relocateable, error_message, pgp)
+mips_elf_final_gp (output_bfd, symbol, relocatable, error_message, pgp)
bfd *output_bfd;
asymbol *symbol;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
char **error_message;
bfd_vma *pgp;
{
if (bfd_is_und_section (symbol->section)
- && ! relocateable)
+ && ! relocatable)
{
*pgp = 0;
return bfd_reloc_undefined;
*pgp = _bfd_get_gp_value (output_bfd);
if (*pgp == 0
- && (! relocateable
+ && (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0))
{
- if (relocateable)
+ if (relocatable)
{
/* Make up a value. */
*pgp = symbol->section->output_section->vma /*+ 0x4000*/;
bfd *output_bfd;
char **error_message ATTRIBUTE_UNUSED;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section)
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
- input_section, relocateable,
+ input_section, relocatable,
data, gp);
}
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
/* FIXME: The entries in the .lit8 and .lit4 sections should be merged. */
if (output_bfd != (bfd *) NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
- input_section, relocateable,
+ input_section, relocatable,
data, gp);
}
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
if (output_bfd != (bfd *) NULL)
{
- relocateable = TRUE;
+ relocatable = TRUE;
gp = _bfd_get_gp_value (output_bfd);
}
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable,
error_message, &gp);
if (ret != bfd_reloc_ok)
return ret;
}
return gprel32_with_gp (abfd, symbol, reloc_entry, input_section,
- relocateable, data, gp);
+ relocatable, data, gp);
}
static bfd_reloc_status_type
-gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocateable, data,
+gprel32_with_gp (abfd, symbol, reloc_entry, input_section, relocatable, data,
gp)
bfd *abfd;
asymbol *symbol;
arelent *reloc_entry;
asection *input_section;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
PTR data;
bfd_vma gp;
{
val += reloc_entry->addend;
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
bfd_put_32 (abfd, (bfd_vma) val, (bfd_byte *) data + reloc_entry->address);
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
bfd *output_bfd;
char **error_message;
{
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
bfd_reloc_status_type ret;
bfd_vma gp;
unsigned short extend = 0;
GET_RELOC_ADDEND (output_bfd, symbol, reloc_entry, input_section)
if (output_bfd != NULL)
- relocateable = TRUE;
+ relocatable = TRUE;
else
{
- relocateable = FALSE;
+ relocatable = FALSE;
output_bfd = symbol->section->output_section->owner;
}
- ret = mips_elf_final_gp (output_bfd, symbol, relocateable, error_message,
+ ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
&gp);
if (ret != bfd_reloc_ok)
return ret;
_bfd_mips_elf_sign_extend(val, 16);
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
else
reloc_entry->addend = val;
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0))
return bfd_reloc_overflow;
bfd_vma *valp;
{
if (sym->st_shndx == SHN_COMMON
- && !info->relocateable
+ && !info->relocatable
&& sym->st_size <= elf_gp_size (abfd))
{
/* Common symbols less than or equal to -G nn bytes are
const Elf_Internal_Rela *rel;
asection *got, *fptr, *srel;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
ia64_info = elfNN_ia64_hash_table (info);
/* Make sure we've got ourselves a nice fat __gp value. */
- if (!info->relocateable)
+ if (!info->relocatable)
{
bfd_vma gp_val = _bfd_get_gp_value (abfd);
struct elf_link_hash_entry *gp;
of the .IA_64.unwind section. Force this section to be relocated
into memory rather than written immediately to the output file. */
unwind_output_sec = NULL;
- if (!info->relocateable)
+ if (!info->relocatable)
{
asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
if (s)
ia64_info = elfNN_ia64_hash_table (info);
/* Infect various flags from the input section to the output section. */
- if (info->relocateable)
+ if (info->relocatable)
{
bfd_vma flags;
\f
bfd_reloc_status_type
_bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry, input_section,
- relocateable, data, gp)
+ relocatable, data, gp)
bfd *abfd;
asymbol *symbol;
arelent *reloc_entry;
asection *input_section;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
PTR data;
bfd_vma gp;
{
_bfd_mips_elf_sign_extend(val, 16);
/* Adjust val for the final section location and GP value. If we
- are producing relocateable output, we don't want to do this for
+ are producing relocatable output, we don't want to do this for
an external symbol. */
- if (! relocateable
+ if (! relocatable
|| (symbol->flags & BSF_SECTION_SYM) != 0)
val += relocation - gp;
else
reloc_entry->addend = val;
- if (relocateable)
+ if (relocatable)
reloc_entry->address += input_section->output_offset;
else if (((val & ~0xffff) != ~0xffff) && ((val & ~0xffff) != 0))
return bfd_reloc_overflow;
/* If this is a 32- or 64-bit call to a 16-bit function with a stub, we
need to redirect the call to the stub, unless we're already *in*
a stub. */
- if (r_type != R_MIPS16_26 && !info->relocateable
+ if (r_type != R_MIPS16_26 && !info->relocatable
&& ((h != NULL && h->fn_stub != NULL)
|| (local_p && elf_tdata (input_bfd)->local_stubs != NULL
&& elf_tdata (input_bfd)->local_stubs[r_symndx] != NULL))
}
/* If this is a 16-bit call to a 32- or 64-bit function with a stub, we
need to redirect the call to the stub. */
- else if (r_type == R_MIPS16_26 && !info->relocateable
+ else if (r_type == R_MIPS16_26 && !info->relocatable
&& h != NULL
&& (h->call_stub != NULL || h->call_fp_stub != NULL)
&& !target_is_16_bit_code_p)
/* Calls from 16-bit code to 32-bit code and vice versa require the
special jalx instruction. */
- *require_jalxp = (!info->relocateable
+ *require_jalxp = (!info->relocatable
&& (((r_type == R_MIPS16_26) && !target_is_16_bit_code_p)
|| ((r_type == R_MIPS_26) && target_is_16_bit_code_p)));
JALX is the 5-bit value 00011. X is 0 for jal, 1 for jalx.
Note that the immediate value in the first word is swapped.
- When producing a relocateable object file, R_MIPS16_26 is
+ When producing a relocatable object file, R_MIPS16_26 is
handled mostly like R_MIPS_26. In particular, the addend is
stored as a straight 26-bit value in a 32-bit instruction.
(gas makes life simpler for itself by never adjusting a
where targ26-16 is sub1 followed by sub2 (i.e., the addend field A is
((sub1 << 16) | sub2)).
- When producing a relocateable object file, the calculation is
+ When producing a relocatable object file, the calculation is
(((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2)
When producing a fully linked file, the calculation is
let R = (((A < 2) | ((P + 4) & 0xf0000000) + S) >> 2)
((R & 0x1f0000) << 5) | ((R & 0x3e00000) >> 5) | (R & 0xffff) */
- if (!info->relocateable)
+ if (!info->relocatable)
/* Shuffle the bits according to the formula above. */
value = (((value & 0x1f0000) << 5)
| ((value & 0x3e00000) >> 5)
asection *sreloc;
struct elf_backend_data *bed;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
dynobj = elf_hash_table (info)->dynobj;
/* We are not currently changing any sizes, so only one pass. */
*again = FALSE;
- if (link_info->relocateable)
+ if (link_info->relocatable)
return TRUE;
internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL,
any R_MIPS_32 or R_MIPS_REL32 relocs against it into the output
file. */
hmips = (struct mips_elf_link_hash_entry *) h;
- if (! info->relocateable
+ if (! info->relocatable
&& hmips->possibly_dynamic_relocs != 0
&& (h->root.type == bfd_link_hash_defweak
|| (h->elf_link_hash_flags
bfd_set_section_size (output_bfd, ri,
(bfd_size_type) sizeof (Elf32_External_RegInfo));
- if (! (info->relocateable
+ if (! (info->relocatable
|| ! mips_elf_hash_table (info)->mips16_stubs_seen))
mips_elf_link_hash_traverse (mips_elf_hash_table (info),
mips_elf_check_mips16_stubs,
addend = rel->r_addend;
}
- if (info->relocateable)
+ if (info->relocatable)
{
Elf_Internal_Sym *sym;
unsigned long r_symndx;
they're against a section symbol, in which case we need
to adjust by the section offset, or unless they're GP
relative in which case we need to adjust by the amount
- that we're adjusting GP in this relocateable object. */
+ that we're adjusting GP in this relocatable object. */
if (! mips_elf_local_relocation_p (input_bfd, rel, local_sections,
FALSE))
bfd_byte *
_bfd_elf_mips_get_relocated_section_contents (abfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
/* Get enough memory to hold the stuff */
{
/* bypass special_function call */
r = _bfd_mips_elf_gprel16_with_gp (input_bfd, sym, *parent,
- input_section, relocateable,
+ input_section, relocatable,
(PTR) data, gp);
goto skip_bfd_perform_relocation;
}
*parent,
(PTR) data,
input_section,
- relocateable ? abfd : (bfd *) NULL,
+ relocatable ? abfd : (bfd *) NULL,
&error_message);
skip_bfd_perform_relocation:
- if (relocateable)
+ if (relocatable)
{
asection *os = input_section->output_section;
elf_gp (abfd) = (h->u.def.value
+ h->u.def.section->output_section->vma
+ h->u.def.section->output_offset);
- else if (info->relocateable)
+ else if (info->relocatable)
{
bfd_vma lo = MINUS_ONE;
information describing how the small data area would
change depending upon the -G switch. These sections
not used in executables files. */
- if (! info->relocateable)
+ if (! info->relocatable)
{
for (p = o->link_order_head;
p != (struct bfd_link_order *) NULL;
insert = FALSE;
- if (! info->relocateable
+ if (! info->relocatable
&& linux_hash_table (info)->dynobj == NULL
&& strcmp (name, SHARABLE_CONFLICTS) == 0
&& (flags & BSF_CONSTRUCTOR) != 0
0xf0, 0x20, 0x00,
0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3. */
0xf1, 0xce, 0x20, 0x00, 39, 2, /* Keep symbol in original case. */
- 0xf1, 0xce, 0x20, 0x00, 38 /* Set object type relocateable to x. */
+ 0xf1, 0xce, 0x20, 0x00, 38 /* Set object type relocatable to x. */
};
static const unsigned char envi[] =
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
- bfd_boolean relocateable,
+ bfd_boolean relocatable,
asymbol **symbols));
/* Extracted from archures.c. */
/* BFD COFF object file private structure.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
/* Information we keep for each section in the output file when doing
- a relocateable link. */
+ a relocatable link. */
struct coff_link_section_info
{
bfd_boolean global_to_static;
/* Hash table for long symbol names. */
struct bfd_strtab_hash *strtab;
- /* When doing a relocateable link, an array of information kept for
+ /* When doing a relocatable link, an array of information kept for
each output section, indexed by the target_index field. */
struct coff_link_section_info *section_info;
/* Symbol index of last C_FILE symbol (-1 if none). */
bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
/* Information we keep for each section in the output file when doing
- a relocateable link. */
+ a relocatable link. */
struct coff_link_section_info
{
bfd_boolean global_to_static;
/* Hash table for long symbol names. */
struct bfd_strtab_hash *strtab;
- /* When doing a relocateable link, an array of information kept for
+ /* When doing a relocatable link, an array of information kept for
each output section, indexed by the target_index field. */
struct coff_link_section_info *section_info;
/* Symbol index of last C_FILE symbol (-1 if none). */
For example, with each entry in the hash table the a.out
linker keeps the index the symbol has in the final output file
- (this index number is used so that when doing a relocateable
+ (this index number is used so that when doing a relocatable
link the symbol index used in the output file can be quickly
filled in when copying over a reloc). The a.out linker code
defines the required structures and functions for a hash table
the input sections and copy the data into the output sections.
It must build an output symbol table including any local
symbols from the input files and the global symbols from the
- hash table. When producing relocateable output, it must
+ hash table. When producing relocatable output, it must
modify the input relocs and write them into the output file.
There may also be object format dependent work to be done.
types of information. They also describe relocs that must be
created by the BFD backend, but do not correspond to any input
file; this is used to support -Ur, which builds constructors
- while generating a relocateable object file.
+ while generating a relocatable object file.
INODE
Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link
input files. The <<_bfd_final_link>> function should read the
contents of the section and any associated relocs, apply the
relocs to the section contents, and write out the modified
- section contents. If performing a relocateable link, the
+ section contents. If performing a relocatable link, the
relocs themselves must also be modified and written out.
@findex _bfd_relocate_contents
if (! generic_add_output_symbol (abfd, &outsymalloc, NULL))
return FALSE;
- if (info->relocateable)
+ if (info->relocatable)
{
/* Allocate space for the output relocs for each section. */
for (o = abfd->sections;
break;
case discard_sec_merge:
output = TRUE;
- if (info->relocateable
+ if (info->relocatable
|| ! (sym->section->flags & SEC_MERGE))
break;
/* FALLTHROUGH */
{
arelent *r;
- if (! info->relocateable)
+ if (! info->relocatable)
abort ();
if (sec->orelocation == (arelent **) NULL)
abort ();
BFD_ASSERT (input_section->output_offset == link_order->offset);
BFD_ASSERT (input_section->_cooked_size == link_order->size);
- if (info->relocateable
+ if (info->relocatable
&& input_section->reloc_count > 0
&& output_section->orelocation == (arelent **) NULL)
{
types of object files. Handling this case correctly is
difficult, and sometimes impossible. */
(*_bfd_error_handler)
- (_("Attempt to do relocateable link with %s input and %s output"),
+ (_("Attempt to do relocatable link with %s input and %s output"),
bfd_get_target (input_bfd), bfd_get_target (output_bfd));
bfd_set_error (bfd_error_wrong_format);
return FALSE;
if (contents == NULL && sec_size != 0)
goto error_return;
new_contents = (bfd_get_relocated_section_contents
- (output_bfd, info, link_order, contents, info->relocateable,
+ (output_bfd, info, link_order, contents, info->relocatable,
_bfd_generic_link_get_symbols (input_bfd)));
if (!new_contents)
goto error_return;
insert = FALSE;
- if (! info->relocateable
+ if (! info->relocatable
&& linux_hash_table (info)->dynobj == NULL
&& strcmp (name, SHARABLE_CONFLICTS) == 0
&& (flags & BSF_CONSTRUCTOR) != 0
/* BFD back-end for PDP-11 a.out binaries.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
includes_hash_initialized = TRUE;
/* Figure out the largest section size. Also, if generating
- relocateable output, count the relocs. */
+ relocatable output, count the relocs. */
trsize = 0;
drsize = 0;
max_contents_size = 0;
{
size_t sz;
- if (info->relocateable)
+ if (info->relocatable)
{
if (bfd_get_flavour (sub) == bfd_target_aout_flavour)
{
work out the number of relocs needed, and then multiply
by the reloc size. */
(*_bfd_error_handler)
- ("%s: relocateable link from %s to %s not supported",
+ ("%s: relocatable link from %s to %s not supported",
bfd_get_filename (abfd),
sub->xvec->name, abfd->xvec->name);
bfd_set_error (bfd_error_invalid_operation);
}
}
- if (info->relocateable)
+ if (info->relocatable)
{
if (obj_textsec (abfd) != (asection *) NULL)
trsize += (_bfd_count_link_order_relocs (obj_textsec (abfd)
input_size))
return FALSE;
- /* If we are producing relocateable output, the relocs were
+ /* If we are producing relocatable output, the relocs were
modified, and we now write them out. */
- if (finfo->info->relocateable && rel_size > 0)
+ if (finfo->info->relocatable && rel_size > 0)
{
if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
return FALSE;
struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
bfd_vma *));
bfd *output_bfd;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
struct external_nlist *syms;
char *strings;
struct aout_link_hash_entry **sym_hashes;
BFD_ASSERT (input_bfd->xvec->header_byteorder
== output_bfd->xvec->header_byteorder);
- relocateable = finfo->info->relocateable;
+ relocatable = finfo->info->relocatable;
syms = obj_aout_external_syms (input_bfd);
strings = obj_aout_external_strings (input_bfd);
sym_hashes = obj_aout_sym_hashes (input_bfd);
howto = howto_table_pdp11 + howto_idx;
}
- if (relocateable)
+ if (relocatable)
{
- /* We are generating a relocateable output file, and must
+ /* We are generating a relocatable output file, and must
modify the reloc accordingly. */
if (r_extern)
{
/* BFD back-end for MIPS PE COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
This file is part of BFD, the Binary File Descriptor library.
section for a reference to a common symbol is the value itself plus
any desired offset. Ian Taylor, Cygnus Support. */
-/* If we are producing relocateable output, we need to do some
+/* If we are producing relocatable output, we need to do some
adjustments to the object file that are not done by the
bfd_perform_relocation function. This function is called by every
reloc type to make any required adjustments. */
{
/* For some reason bfd_perform_relocation always effectively
ignores the addend for a COFF target when producing
- relocateable output. This seems to be always wrong for 386
+ relocatable output. This seems to be always wrong for 386
COFF, so we handle the addend here instead. */
diff = reloc_entry->addend;
}
#ifndef COFF_WITH_PE
/* If the output symbol is common (in which case this must be a
- relocateable link), we need to add in the final size of the
+ relocatable link), we need to add in the final size of the
common symbol. */
if (h != NULL && h->root.type == bfd_link_hash_common)
*addendp += h->root.u.c.size;
unsigned int i;
bfd_boolean got_lo;
- if (info->relocateable)
+ if (info->relocatable)
{
(*_bfd_error_handler) (_("\
%s: `ld -r' not supported with PE MIPS objects\n"),
if (howto == NULL)
return FALSE;
- /* If we are doing a relocateable link, then we can just ignore
+ /* If we are doing a relocatable link, then we can just ignore
a PC relative reloc that is pcrel_offset. It will already
- have the correct value. If this is not a relocateable link,
+ have the correct value. If this is not a relocatable link,
then we should ignore the symbol value. */
if (howto->pc_relative && howto->pcrel_offset)
{
- if (info->relocateable)
+ if (info->relocatable)
continue;
if (sym != NULL && sym->n_scnum != 0)
addend += sym->n_value;
+ sec->output_offset);
}
- else if (! info->relocateable)
+ else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
}
if (coff_data (abfd)->link_info
- && ! coff_data (abfd)->link_info->relocateable
+ && ! coff_data (abfd)->link_info->relocatable
&& ! coff_data (abfd)->link_info->shared
&& strcmp (scnhdr_int->s_name, ".text") == 0)
{
return bfd_reloc_ok;
}
- /* If we are not producing relocateable output, return an error if
+ /* If we are not producing relocatable output, return an error if
the symbol is not defined. An undefined weak symbol is
considered to have a value of zero (SVR4 ABI, p. 4-27). */
if (bfd_is_und_section (symbol->section)
include the position of the location; for example, m88kbcs,
or ELF. For those targets, pcrel_offset is TRUE.
- If we are producing relocateable output, then we must ensure
+ If we are producing relocatable output, then we must ensure
that this reloc will be correctly computed when the final
relocation is done. If pcrel_offset is FALSE we want to wind
up with the negative of the location within the section,
we do not want to adjust the existing addend at all.
FIXME: This seems logical to me, but for the case of
- producing relocateable output it is not what the code
+ producing relocatable output it is not what the code
actually does. I don't want to change it, because it seems
far too likely that something will break. */
not have any tests that depend upon the flavour. It's seem like
entirely the wrong place for such a thing. The second obvious point
is that the current code ignores the reloc addend when producing
-relocateable output for COFF. That's peculiar. In fact, I really
+relocatable output for COFF. That's peculiar. In fact, I really
have no idea what the point of the line you want to remove is.
A typical COFF reloc subtracts the old value of the symbol and adds in
compatibility with old object files) (coff-i386 does subtract the old
value, to be compatible with existing coff-i386 targets, like SCO).
-So everything works fine when not producing relocateable output. When
-we are producing relocateable output, logically we should do exactly
-what we do when not producing relocateable output. Therefore, your
+So everything works fine when not producing relocatable output. When
+we are producing relocatable output, logically we should do exactly
+what we do when not producing relocatable output. Therefore, your
patch is correct. In fact, it should probably always just set
reloc_entry->addend to 0 for all cases, since it is, in fact, going to
add the value into the object file. This won't hurt the COFF code,
formats (the thing to check for would be whether any formats both use
the addend and set partial_inplace).
-When I wanted to make coff-i386 produce relocateable output, I ran
+When I wanted to make coff-i386 produce relocatable output, I ran
into the problem that you are running into: I wanted to remove that
line. Rather than risk it, I made the coff-i386 relocs use a special
function; it's coff_i386_reloc in coff-i386.c. The function
include the position of the location; for example, m88kbcs,
or ELF. For those targets, pcrel_offset is TRUE.
- If we are producing relocateable output, then we must ensure
+ If we are producing relocatable output, then we must ensure
that this reloc will be correctly computed when the final
relocation is done. If pcrel_offset is FALSE we want to wind
up with the negative of the location within the section,
we do not want to adjust the existing addend at all.
FIXME: This seems logical to me, but for the case of
- producing relocateable output it is not what the code
+ producing relocatable output it is not what the code
actually does. I don't want to change it, because it seems
far too likely that something will break. */
not have any tests that depend upon the flavour. It's seem like
entirely the wrong place for such a thing. The second obvious point
is that the current code ignores the reloc addend when producing
-relocateable output for COFF. That's peculiar. In fact, I really
+relocatable output for COFF. That's peculiar. In fact, I really
have no idea what the point of the line you want to remove is.
A typical COFF reloc subtracts the old value of the symbol and adds in
compatibility with old object files) (coff-i386 does subtract the old
value, to be compatible with existing coff-i386 targets, like SCO).
-So everything works fine when not producing relocateable output. When
-we are producing relocateable output, logically we should do exactly
-what we do when not producing relocateable output. Therefore, your
+So everything works fine when not producing relocatable output. When
+we are producing relocatable output, logically we should do exactly
+what we do when not producing relocatable output. Therefore, your
patch is correct. In fact, it should probably always just set
reloc_entry->addend to 0 for all cases, since it is, in fact, going to
add the value into the object file. This won't hurt the COFF code,
formats (the thing to check for would be whether any formats both use
the addend and set partial_inplace).
-When I wanted to make coff-i386 produce relocateable output, I ran
+When I wanted to make coff-i386 produce relocatable output, I ran
into the problem that you are running into: I wanted to remove that
line. Rather than risk it, I made the coff-i386 relocs use a special
function; it's coff_i386_reloc in coff-i386.c. The function
function than to try to deal with it.
This routine does a final relocation. Whether it is useful for a
- relocateable link depends upon how the object format defines
+ relocatable link depends upon how the object format defines
relocations.
FIXME: This routine ignores any special_function in the HOWTO,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
- bfd_boolean relocateable,
+ bfd_boolean relocatable,
asymbol **symbols);
DESCRIPTION
bfd_byte *
bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
- relocateable, symbols)
+ relocatable, symbols)
bfd *abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
/* Get enough memory to hold the stuff. */
*parent,
(PTR) data,
input_section,
- relocateable ? abfd : (bfd *) NULL,
+ relocatable ? abfd : (bfd *) NULL,
&error_message);
- if (relocateable)
+ if (relocatable)
{
asection *os = input_section->output_section;
/* 8 and 16 bit COFF relocation functions, for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
link_info,
link_order,
data,
- relocateable,
+ relocatable,
symbols)
bfd *in_abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
/* Get enough memory to hold the stuff. */
if (reloc_size < 0)
return NULL;
- /* If producing relocateable output, don't bother to relax. */
- if (relocateable)
+ /* If producing relocatable output, don't bother to relax. */
+ if (relocatable)
return bfd_generic_get_relocated_section_contents (in_abfd, link_info,
link_order,
- data, relocateable,
+ data, relocatable,
symbols);
/* Read in the section. */
insert = FALSE;
- if (! info->relocateable
+ if (! info->relocatable
&& linux_hash_table (info)->dynobj == NULL
&& strcmp (name, SHARABLE_CONFLICTS) == 0
&& (flags & BSF_CONSTRUCTOR) != 0
/* BFD backend for SunOS binaries.
Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
{
if (! sunos_create_dynamic_sections (abfd, info,
((abfd->flags & DYNAMIC) != 0
- && !info->relocateable)))
+ && !info->relocatable)))
return FALSE;
}
/* The native linker seems to just ignore dynamic objects when -r is
used. */
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
/* There's no hope of using a dynamic object which does not exactly
*sneedptr = NULL;
*srulesptr = NULL;
- if (info->relocateable)
+ if (info->relocatable)
return TRUE;
if (output_bfd->xvec != &MY(vec))
(bfd_vma) 0, strsize))
return FALSE;
- /* If this is a relocateable object file, we have to relocate
+ /* If this is a relocatable object file, we have to relocate
the entries in .stab. This should always be simple 32 bit
relocations against symbols defined in this object file, so
this should be no big deal. */
/* BFD back-end for VERSAdos-E objects.
- Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002
+ Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
/*
SUBSECTION
- VERSAdos-E relocateable object file format
+ VERSAdos-E relocatable object file format
DESCRIPTION
- This module supports reading of VERSAdos relocateable
+ This module supports reading of VERSAdos relocatable
object files.
A VERSAdos file looks like contains
/* vms.c -- BFD back-end for VAX (openVMS/VAX) and
EVAX (openVMS/Alpha) files.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Klaus K"ampf (kkaempf@rmi.de)
static bfd_byte *vms_bfd_get_relocated_section_contents
PARAMS ((bfd *abfd, struct bfd_link_info *link_info,
struct bfd_link_order *link_order, bfd_byte *data,
- bfd_boolean relocateable, asymbol **symbols));
+ bfd_boolean relocatable, asymbol **symbols));
static bfd_boolean vms_bfd_relax_section
PARAMS ((bfd *abfd, asection *section, struct bfd_link_info *link_info,
bfd_boolean *again));
static bfd_byte *
vms_bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
- relocateable, symbols)
+ relocatable, symbols)
bfd *abfd ATTRIBUTE_UNUSED;
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
struct bfd_link_order *link_order ATTRIBUTE_UNUSED;
bfd_byte *data ATTRIBUTE_UNUSED;
- bfd_boolean relocateable ATTRIBUTE_UNUSED;
+ bfd_boolean relocatable ATTRIBUTE_UNUSED;
asymbol **symbols ATTRIBUTE_UNUSED;
{
#if VMS_DEBUG
vms_debug (1, "vms_bfd_get_relocated_section_contents(%p, %p, %p, %p, %s, %p)\n",
- abfd, link_info, link_order, data, (relocateable)?"True":"False", symbols);
+ abfd, link_info, link_order, data, (relocatable)?"True":"False", symbols);
#endif
return 0;
}
/* POWER/PowerPC XCOFF linker support.
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
}
/* Garbage collect unused sections. */
- if (info->relocateable
+ if (info->relocatable
|| ! gc
|| hentry == NULL
|| (hentry->root.type != bfd_link_hash_defined
}
else
{
- if (! finfo->info->relocateable
+ if (! finfo->info->relocatable
&& (h->flags & XCOFF_DEF_DYNAMIC) == 0
&& (h->flags & XCOFF_IMPORT) == 0)
{
+2003-06-25 Alan Modra <amodra@bigpond.net.au>
+
+ * NEWS: Correct spelling of "relocatable".
+ * objdump.c: Likewise.
+ * sysroff.info: Likewise.
+
2003-06-19 Nick Clifton <nickc@redhat.com>
* readelf.c (print_vma): When printing DEC_5 values, if the
Changes in binutils 2.5:
* Changed objdump -dr to dump the relocs interspersed with the assembly
- listing, for a more useful listing of relocateable files.
+ listing, for a more useful listing of relocatable files.
* Changed objdump -d/--disassemble to only disassemble SEC_CODE sections.
Added -D/--disassemble-all option to disassemble all sections.
== bfd_asymbol_value (sorted_syms[thisplace - 1])))
--thisplace;
- /* If the file is relocateable, and the symbol could be from this
+ /* If the file is relocatable, and the symbol could be from this
section, prefer a symbol from this section over symbols from
others, even if the other symbol's value might be closer.
("rl" 0x20
- (("boundary of relocateable area") (4 bits) ("boundary"))
+ (("boundary of relocatable area") (4 bits) ("boundary"))
(("address polarity") (1 bit) ("apol"))
(("segment number") (1 bit) ("segment"))
(("sign of relocation") (1 bit) ("sign"))
/* tc-i370.c -- Assembler for the IBM 360/370/390 instruction set.
Loosely based on the ppc files by Linas Vepstas <linas@linas.org> 1998, 99
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
give to this location in the toc; this will be a symbol with class
TC. The rest of the arguments are 4 byte values to actually put at
this location in the TOC; often there is just one more argument, a
- relocateable symbol reference.
+ relocatable symbol reference.
When not generating XCOFF output, the arguments are the same, but
the first argument is simply ignored. */
give to this location in the toc; this will be a symbol with class
TC. The rest of the arguments are N-byte values to actually put at
this location in the TOC; often there is just one more argument, a
- relocateable symbol reference. The size of the value to store
+ relocatable symbol reference. The size of the value to store
depends on target word size. A 32-bit target uses 4-byte values, a
64-bit target uses 8-byte values.
+2003-06-25 Alan Modra <amodra@bigpond.net.au>
+
+ * bfdlink.h: Correct spelling of "relocatable".
+
2003-06-22 Zack Weinberg <zack@codesourcery.com>
* safe-ctype.h (HC_UNKNOWN, HC_ASCII, HC_EBCDIC): Rename to
/* bfdlink.h -- header file for BFD link routines
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
struct bfd_link_info
{
/* TRUE if BFD should generate a relocatable object file. */
- unsigned int relocateable: 1;
+ unsigned int relocatable: 1;
/* TRUE if BFD should generate relocation information in the final
executable. */
/* A function which is called to add a symbol to a set. ENTRY is
the link hash table entry for the set itself (e.g.,
__CTOR_LIST__). RELOC is the relocation to use for an entry in
- the set when generating a relocateable file, and is also used to
+ the set when generating a relocatable file, and is also used to
get the size of the entry when generating an executable file.
ABFD, SEC and VALUE identify the value to add to the set. */
bfd_boolean (*add_to_set)
destructor is found. This is only called by some object file
formats. CONSTRUCTOR is TRUE for a constructor, FALSE for a
destructor. This will use BFD_RELOC_CTOR when generating a
- relocateable file. NAME is the name of the symbol found. ABFD,
+ relocatable file. NAME is the name of the symbol found. ABFD,
SECTION and VALUE are the value of the symbol. */
bfd_boolean (*constructor)
PARAMS ((struct bfd_link_info *, bfd_boolean constructor,
+2003-06-25 Alan Modra <amodra@bigpond.net.au>
+
+ * ld.texinfo: Correct spelling of "relocatable".
+ * ldctor.c: Likewise
+ * ldexp.c: Likewise
+ * ldfile.c: Likewise
+ * ldint.texinfo: Likewise
+ * ldlang.c: Likewise
+ * ldmain.c: Likewise
+ * ldwrite.c: Likewise
+ * lexsup.c: Likewise
+ * emultempl/aix.em: Likewise
+ * emultempl/alphaelf.em: Likewise
+ * emultempl/armcoff.em: Likewise
+ * emultempl/armelf_oabi.em: Likewise
+ * emultempl/beos.em: Likewise
+ * emultempl/elf32.em: Likewise
+ * emultempl/generic.em: Likewise
+ * emultempl/gld960.em: Likewise
+ * emultempl/gld960c.em: Likewise
+ * emultempl/hppaelf.em: Likewise
+ * emultempl/linux.em: Likewise
+ * emultempl/lnk960.em: Likewise
+ * emultempl/m68hc1xelf.em: Likewise
+ * emultempl/m68kcoff.em: Likewise
+ * emultempl/m68kelf.em: Likewise
+ * emultempl/mipsecoff.em: Likewise
+ * emultempl/mipself.em: Likewise
+ * emultempl/mmix-elfnmmo.em: Likewise
+ * emultempl/mmo.em: Likewise
+ * emultempl/needrelax.em: Likewise
+ * emultempl/pe.em: Likewise
+ * emultempl/ppc64elf.em: Likewise
+ * emultempl/sh64elf.em: Likewise
+ * emultempl/sunos.em: Likewise
+ * emultempl/ticoff.em: Likewise
+ * emultempl/xtensaelf.em: Likewise
+
2003-06-24 Alan Modra <amodra@bigpond.net.au>
* emultempl/ppc32elf.em: Convert to C90.
2002-01-14 Charles Wilson <cwilson@ece.gatech.edu>
- * ld/ld.texinfo (node WIN32): Some clarifications
+ * ld.texinfo (node WIN32): Some clarifications
and formatting fixups.
2003-01-09 Chris Demetriou <cgd@broadcom.com>
2003-01-03 Charles Wilson <cwilson@ece.gatech.edu>
- * ld/pe-dll.c (autofilter_symbollist): Add cygwin_crt0.
+ * pe-dll.c (autofilter_symbollist): Add cygwin_crt0.
2003-01-04 Daniel Jacobowitz <drow@mvista.com>
2002-12-30 Ralf Habacker <Ralf.Habacker@freenet.de>
Charles Wilson <cwilson@ece.gatech.edu>
- * ld/config.in (HAVE_REALPATH): New entry.
+ * config.in (HAVE_REALPATH): New entry.
(HAVE_SYS_STAT_H, HAVE_SYS_TYPES_H): Removed: obsolete.
2002-12-30 Ralf Habacker <ralf.habacker@freenet.de>
2002-12-17 Ralf Habacker <ralf.habacker@freenet.de>
- * ld/emultempl/pe.em (pe_find_data_imports): Don't search for data
+ * emultempl/pe.em (pe_find_data_imports): Don't search for data
import when auto-import is disabled.
2002-12-17 Danny Smith <dannysmith@users.sourceforge.net>
* configure.in: added --with-lib-path argument to ld's configure
to set LIB_PATH.
- * ld/NEWS: Document new switch.
- * ld/README: Mention new switch.
+ * NEWS: Document new switch.
+ * README: Mention new switch.
* configure: Regenerate.
* Makefile.in: Regenerate.
2002-06-20 Nathanael Nerode <neroden@twcny.rr.com>
- * ld/configure.host (romp): Drop support.
+ * configure.host (romp): Drop support.
2002-06-18 Chris Demetriou <cgd@broadcom.com>
2002-06-07 Charles Wilson <cwilson@ece.gatech.edu>
- * ld/ldmain.c (main): initialize link_info.pei386_auto_import
+ * ldmain.c (main): initialize link_info.pei386_auto_import
to -1 == implicit enable.
- * ld/emultempl/pe.em (gld_${EMULATION_NAME}_before_parse):
+ * emultempl/pe.em (gld_${EMULATION_NAME}_before_parse):
initialize link_info.pei386_auto_import to -1 == implicit
enable.
(gld_${EMULATION_NAME}_parse_args): When processing
2002-04-07 matthew green <mrg@redhat.com>
- * ld/configure.host (*-*-netbsd*): Add support for NetBSD/ELF.
+ * configure.host (*-*-netbsd*): Add support for NetBSD/ELF.
2002-04-04 Alan Modra <amodra@bigpond.net.au>
* configure.tgt (sh*le-*-netbsdelf*): New target.
(sh*-*-netbsdelf*): New target.
* emulparams/shelf.sh: Document that shelf_nbsd.sh sources this file.
- * ld/emulparams/shelf_nbsd.sh: New emulation.
- * ld/emulparams/shlelf_nbsd.sh: New emulation.
+ * emulparams/shelf_nbsd.sh: New emulation.
+ * emulparams/shlelf_nbsd.sh: New emulation.
2002-01-07 Nick Clifton <nickc@cambridge.redhat.com>
* When an ELF section named .gnu.warning.SYMBOL is encountered in an input
file, and the symbol SYMBOL is referenced by some object file, the contents of
the section are displayed as an error message. The section is not copied into
-the output file, unless doing a relocateable or shared link. This is used by
+the output file, unless doing a relocatable or shared link. This is used by
glibc.
* New options -split-by-reloc and -split-by-file.
struct set_info *p;
/* Call ldctor_build_sets, after pretending that this is a
- relocateable link. We do this because AIX requires relocation
+ relocatable link. We do this because AIX requires relocation
entries for all references to symbols, even in a final
executable. Of course, we only want to do this if we are
producing an XCOFF output file. */
- r = link_info.relocateable;
+ r = link_info.relocatable;
if (strstr (bfd_get_target (output_bfd), "xcoff") != NULL)
- link_info.relocateable = TRUE;
+ link_info.relocatable = TRUE;
ldctor_build_sets ();
- link_info.relocateable = r;
+ link_info.relocatable = r;
/* For each set, record the size, so that the XCOFF backend can
output the correct csect length. */
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
static void
alpha_after_parse ()
{
- if (elf64alpha_32bit && !link_info.shared && !link_info.relocateable)
+ if (elf64alpha_32bit && !link_info.shared && !link_info.relocatable)
lang_section_start (".interp",
exp_binop ('+',
exp_intop (ALPHA_TEXT_START_32BIT),
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
if (!init[IMAGEBASEOFF].inited)
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
init[IMAGEBASEOFF].value = 0;
else if (init[DLLOFF].value)
init[IMAGEBASEOFF].value = BEOS_DLL_IMAGE_BASE;
init[IMAGEBASEOFF].value = BEOS_EXE_IMAGE_BASE;
}
- /* Don't do any symbol assignments if this is a relocateable link. */
- if (link_info.relocateable)
+ /* Don't do any symbol assignments if this is a relocatable link. */
+ if (link_info.relocatable)
return;
/* Glue the assignments into the abs section */
If they're marked as COMDAT sections, we don't want .text\$foo to
end up in .text and then have .text disappear because it's marked
link-once-discard. */
- if (link_info.relocateable)
+ if (link_info.relocatable)
return FALSE;
secname = bfd_get_section_name (s->owner, s);
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
struct bfd_link_needed_list *needed, *l;
/* We only need to worry about this when doing a final link. */
- if (link_info.relocateable || !link_info.executable)
+ if (link_info.relocatable || !link_info.executable)
return;
/* Get the list of files which appear in DT_NEEDED entries in
int isdyn = 0;
secname = bfd_get_section_name (s->owner, s);
- if (! link_info.relocateable
+ if (! link_info.relocatable
&& link_info.combreloc
&& (s->flags & SEC_ALLOC)
&& strncmp (secname, ".rel", 4) == 0)
/* If this is a final link, then always put .gnu.warning.SYMBOL
sections into the .text section to get them out of the way. */
if (link_info.executable
- && ! link_info.relocateable
+ && ! link_info.relocatable
&& strncmp (secname, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0
&& hold_text.os != NULL)
{
#define HAVE_SECTION(hold, name) \
(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
- if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocateable)
+ if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocatable)
{
if (s->output_section == NULL)
s->output_section = bfd_abs_section_ptr;
}
address = NULL;
- if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
address = exp_intop ((bfd_vma) 0);
load_base = NULL;
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
/* This file is is generated by a shell script. DO NOT EDIT! */
/* emulate the original gld for the given ${EMULATION_NAME}
- Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002
+ Copyright 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
static void
hppaelf_after_parse ()
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
lang_add_unique (".text");
#if 0 /* Enable this once we split millicode stuff from libgcc. */
else
/* If generating a relocatable output file, then we don't
have to examine the relocs. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
int ret = elf32_hppa_setup_section_lists (output_bfd, &link_info);
if (need_laying_out)
hppaelf_layout_sections_again ();
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
/* Set the global data pointer. */
if (! elf32_hppa_set_gp (output_bfd, &link_info))
static void
gld${EMULATION_NAME}_before_allocation ()
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
return;
/* Let the backend work out the sizes of any sections required by
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
static void
lnk960_after_allocation ()
{
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
{
lang_abs_symbol_at_end_of (".text", "_etext");
lang_abs_symbol_at_end_of (".data", "_edata");
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
/* If generating a relocatable output file, then we don't
have to generate the trampolines. */
- if (link_info.relocateable)
+ if (link_info.relocatable)
return;
ret = elf32_m68hc11_setup_section_lists (output_bfd, &link_info);
bfd *abfd;
if (! command_line.embedded_relocs
- || link_info.relocateable)
+ || link_info.relocatable)
return;
for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
bfd *abfd;
if (! command_line.embedded_relocs
- || link_info.relocateable)
+ || link_info.relocatable)
return;
for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
# This shell script emits a C file. -*- C -*-
-# Copyright 2000, 2001 Free Software Foundation, Inc.
+# Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
# Written by Michael Sokolov <msokolov@ivan.Harhan.ORG>, based on armelf.em
#
# This file is part of GLD, the Gnu Linker.
#ifdef SUPPORT_EMBEDDED_RELOCS
if (command_line.embedded_relocs
- && (! link_info.relocateable))
+ && (! link_info.relocatable))
{
bfd *abfd;
#ifdef SUPPORT_EMBEDDED_RELOCS
if (command_line.embedded_relocs
- && (! link_info.relocateable))
+ && (! link_info.relocatable))
{
bfd *abfd;
bfd *abfd;
if (! command_line.embedded_relocs
- || link_info.relocateable)
+ || link_info.relocatable)
return;
for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
bfd *abfd;
if (! command_line.embedded_relocs
- || link_info.relocateable)
+ || link_info.relocatable)
return;
for (abfd = link_info.input_bfds; abfd != NULL; abfd = abfd->link_next)
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 Free Software Foundation, Inc.
# Written by Mitch Lichtenberg <mpl@broadcom.com> and
# Chris Demetriou <cgd@broadcom.com> based on m68kelf.em and mipsecoff.em.
#
gld${EMULATION_NAME}_after_open ();
#ifdef SUPPORT_EMBEDDED_RELOCS
- if (command_line.embedded_relocs && (! link_info.relocateable))
+ if (command_line.embedded_relocs && (! link_info.relocatable))
{
bfd *abfd;
after_allocation_default ();
#ifdef SUPPORT_EMBEDDED_RELOCS
- if (command_line.embedded_relocs && (! link_info.relocateable))
+ if (command_line.embedded_relocs && (! link_info.relocatable))
{
bfd *abfd;
# This shell script emits a C file. -*- C -*-
-# Copyright 2001, 2002 Free Software Foundation, Inc.
+# Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
maintenance burden of checking that it still does what we need.) */
/* Force -relax on if not doing a relocatable link. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
command_line.relax = TRUE;
if (!_bfd_mmix_prepare_linker_allocated_gregs (output_bfd, &link_info))
# This shell script emits a C file. -*- C -*-
-# Copyright 2001, 2002 Free Software Foundation, Inc.
+# Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
asection *snew, **pps, *bfd_section;
/* We have nothing to say for anything other than a final link. */
- if (link_info.relocateable
+ if (link_info.relocatable
|| (bfd_get_section_flags (s->owner, s)
& (SEC_EXCLUDE | SEC_LOAD)) != SEC_LOAD)
return FALSE;
# This shell script emits a C file. -*- C -*-
-# Copyright 2001, 2002 Free Software Foundation, Inc.
+# Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
gld${EMULATION_NAME}_before_allocation ();
/* Force -relax on if not doing a relocatable link. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
command_line.relax = TRUE;
}
EOF
if (!init[IMAGEBASEOFF].inited)
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
init[IMAGEBASEOFF].value = 0;
else if (init[DLLOFF].value || link_info.shared)
#ifdef DLL_SUPPORT
init[IMAGEBASEOFF].value = NT_EXE_IMAGE_BASE;
}
- /* Don't do any symbol assignments if this is a relocateable link. */
- if (link_info.relocateable)
+ /* Don't do any symbol assignments if this is a relocatable link. */
+ if (link_info.relocatable)
return;
/* Glue the assignments into the abs section. */
opened, so registering the symbol as undefined will make a
difference. */
- if (! link_info.relocateable && entry_symbol.name != NULL)
+ if (! link_info.relocatable && entry_symbol.name != NULL)
ldlang_add_undef (entry_symbol.name);
}
#if ! (defined (TARGET_IS_i386pe) || defined (TARGET_IS_armpe))
if (link_info.shared)
#else
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
#endif
pe_dll_build_sections (output_bfd, &link_info);
#ifdef DLL_SUPPORT
if (link_info.shared
#if !defined(TARGET_IS_shpe) && !defined(TARGET_IS_mipspe)
- || (!link_info.relocateable && pe_def_file->num_exports != 0)
+ || (!link_info.relocatable && pe_def_file->num_exports != 0)
#endif
)
{
/* Look through the script to see where to place this section. */
hold_section_name = xstrdup (secname);
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
{
dollar = strchr (hold_section_name, '$');
if (dollar != NULL)
}
}
- if (link_info.relocateable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
+ if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
address = exp_intop ((bfd_vma) 0);
else
{
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
static void
gld${EMULATION_NAME}_after_allocation (void)
{
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
_bfd_set_gp_value (output_bfd, ppc64_elf_toc (output_bfd));
}
/* If generating a relocatable output file, then we don't have any
stubs. */
- if (stub_file != NULL && !link_info.relocateable)
+ if (stub_file != NULL && !link_info.relocatable)
{
int ret = ppc64_elf_setup_section_lists (output_bfd, &link_info);
if (ret != 0)
continue;
}
- /* If we emit relocateable contents, we need a
+ /* If we emit relocatable contents, we need a
relocation for the start address. */
- if (link_info.relocateable || link_info.emitrelocations)
+ if (link_info.relocatable || link_info.emitrelocations)
{
/* FIXME: We could perhaps use lang_add_reloc and
friends here, but I'm not really sure that
}
/* The .cranges section will have this size, no larger or smaller.
- Since relocs (if relocateable linking) will be emitted into the
+ Since relocs (if relocatable linking) will be emitted into the
"extended" size, we must set the raw size to the total. We have to
keep track of the number of new .cranges entries.
struct bfd_link_needed_list *needed, *l;
/* We only need to worry about this when doing a final link. */
- if (link_info.relocateable || link_info.shared)
+ if (link_info.relocatable || link_info.shared)
return;
/* Get the list of files which appear in ld_need entries in dynamic
/* The SunOS native linker creates a shared library whenever there
are any undefined symbols in a link, unless -e is used. This is
pretty weird, but we are compatible. */
- if (! link_info.shared && ! link_info.relocateable && ! entry_from_cmdline)
+ if (! link_info.shared && ! link_info.relocatable && ! entry_from_cmdline)
{
struct bfd_link_hash_entry *h;
one. We need to create the symbol before calling
size_dynamic_sections, although we can't set the value until
afterward. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
hdyn = bfd_link_hash_lookup (link_info.hash, "__DYNAMIC", TRUE, FALSE,
FALSE);
/* We must assign a value to __DYNAMIC. It should be zero if we are
not doing a dynamic link, or the start of the .dynamic section if
we are doing one. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
hdyn->type = bfd_link_hash_defined;
hdyn->u.def.value = 0;
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocateable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
cat >>e${EMULATION_NAME}.c <<EOF
{
*isfile = 0;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xu`;
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xr`;
else if (!config.text_read_only)
return `sed "$sc" ldscripts/${EMULATION_NAME}.xbn`;
{
*isfile = 1;
- if (link_info.relocateable && config.build_constructors)
+ if (link_info.relocatable && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocateable)
+ else if (link_info.relocatable)
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
asection *s;
{
/* Early exit for relocatable links. */
- if (link_info.relocateable)
+ if (link_info.relocatable)
return FALSE;
return gld${EMULATION_NAME}_place_orphan (file, s);
/* TBD: We need to force the page alignments to here and only do
them as needed for the entire output section. Finally, if this
- is a relocateable link then we need to add alignment notes so
+ is a relocatable link then we need to add alignment notes so
that the literals can be separated later. */
}
@cindex partial link
@cindex relocatable output
@kindex -r
-@kindex --relocateable
+@kindex --relocatable
@item -r
-@itemx --relocateable
+@itemx --relocatable
Generate relocatable output---i.e., generate an output file that can in
turn serve as input to @command{ld}. This is often called @dfn{partial
linking}. As a side effect, in environments that support standard Unix
/* ldctor.c -- constructor support routines
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003 Free Software Foundation, Inc.
By Steve Chamberlain <sac@cygnus.com>
This file is part of GLD, the Gnu Linker.
.long elementN
.long 0
except that we use the right size instead of .long. When
- generating relocateable output, we generate relocs instead of
+ generating relocatable output, we generate relocs instead of
addresses. */
howto = bfd_reloc_type_lookup (output_bfd, p->reloc);
if (howto == (reloc_howto_type *) NULL)
{
- if (link_info.relocateable)
+ if (link_info.relocatable)
{
einfo (_("%P%X: %s does not support reloc %s for set %s\n"),
bfd_get_target (output_bfd),
continue;
}
- /* If this is not a relocateable link, all we need is the
+ /* If this is not a relocatable link, all we need is the
size, which we can get from the input BFD. */
if (p->elements->section->owner != NULL)
howto = bfd_reloc_type_lookup (p->elements->section->owner,
if (! bfd_is_abs_section (e->section))
e->section->flags |= SEC_KEEP;
- if (link_info.relocateable)
+ if (link_info.relocatable)
lang_add_reloc (p->reloc, howto, e->section, e->name,
exp_intop (e->value));
else
/* This module handles expression trees.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
{ ADDR, "ADDR" },
{ LOADADDR, "LOADADDR" },
{ MAX_K, "MAX_K" },
- { REL, "relocateable" },
+ { REL, "relocatable" },
{ DATA_SEGMENT_ALIGN, "DATA_SEGMENT_ALIGN" },
{ DATA_SEGMENT_END, "DATA_SEGMENT_END" }
};
return new;
}
-/* Build an expression representing an unnamed relocateable value. */
+/* Build an expression representing an unnamed relocatable value. */
etree_type *
exp_relop (section, value)
{
result = new_abs ((bfd_vma)
bfd_sizeof_headers (output_bfd,
- link_info.relocateable));
+ link_info.relocatable));
}
else
{
{
char *string;
- if (entry->dynamic && ! link_info.relocateable)
+ if (entry->dynamic && ! link_info.relocatable)
{
if (ldemul_open_dynamic_archive (arch, search, entry))
{
\input texinfo
@setfilename ldint.info
-@c Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+@c Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
@c Free Software Foundation, Inc.
@ifinfo
variable substitution based on @code{RELOCATING}. For example, on many
targets special symbols such as @code{_end} should be defined when doing
a final link. Naturally, those symbols should not be defined when doing
-a relocateable link using @code{-r}. The @file{scripttempl} script
+a relocatable link using @code{-r}. The @file{scripttempl} script
could use a construct like this to define those symbols:
@smallexample
$@{RELOCATING+ _end = .;@}
link. Discard debugging sections marked with SEC_EXCLUDE on a
relocatable link too. */
if ((flags & SEC_EXCLUDE) != 0
- && ((flags & SEC_DEBUGGING) != 0 || !link_info.relocateable))
+ && ((flags & SEC_DEBUGGING) != 0 || !link_info.relocatable))
discard = TRUE;
/* Discard input sections which are assigned to a section named
format targets, .text$foo sections go into .text and it's odd
to see .text with SEC_LINK_ONCE set. */
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
flags &= ~ (SEC_LINK_ONCE | SEC_LINK_DUPLICATES);
/* If this is not the first input section, and the SEC_READONLY
}
/* For now make .tbss normal section. */
- if ((flags & SEC_THREAD_LOCAL) && ! link_info.relocateable)
+ if ((flags & SEC_THREAD_LOCAL) && ! link_info.relocatable)
flags |= SEC_LOAD;
section->output_section->flags |= flags;
ASSERT (output_bfd == (bfd *) NULL);
output_bfd = open_output (statement->output_statement.name);
ldemul_set_output_arch ();
- if (config.magic_demand_paged && !link_info.relocateable)
+ if (config.magic_demand_paged && !link_info.relocatable)
output_bfd->flags |= D_PAGED;
else
output_bfd->flags &= ~D_PAGED;
& (SEC_ALLOC | SEC_LOAD)) != 0
&& (bfd_get_section_flags (output_bfd, os->bfd_section)
& SEC_NEVER_LOAD) == 0
- && ! link_info.relocateable
+ && ! link_info.relocatable
&& check_regions
&& strcmp (os->region->name, "*default*") == 0
&& lang_memory_region_list != NULL
ASSERT (after == os->bfd_section->vma);
else if ((os->bfd_section->flags & SEC_HAS_CONTENTS) == 0
&& (os->bfd_section->flags & SEC_THREAD_LOCAL)
- && ! link_info.relocateable)
+ && ! link_info.relocatable)
os->bfd_section->_raw_size = 0;
else
os->bfd_section->_raw_size =
{
asection *s;
- if (link_info.relocateable)
+ if (link_info.relocatable)
return;
for (s = output_bfd->sections; s != NULL; s = s->next)
struct bfd_link_hash_entry *h;
bfd_boolean warn;
- if (link_info.relocateable || link_info.shared)
+ if (link_info.relocatable || link_info.shared)
warn = FALSE;
else
warn = TRUE;
input format may not have equivalent representations in
the output format (and besides BFD does not translate
relocs for other link purposes than a final link). */
- if ((link_info.relocateable || link_info.emitrelocations)
+ if ((link_info.relocatable || link_info.emitrelocations)
&& (compatible == NULL
|| bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd))
&& (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0)
{
if (command_line.inhibit_common_definition)
return;
- if (link_info.relocateable
+ if (link_info.relocatable
&& ! command_line.force_common_definition)
return;
/* This is a lonely common section which must have
come from an archive. We attach to the section
with the wildcard. */
- if (! link_info.relocateable
+ if (! link_info.relocatable
|| command_line.force_common_definition)
{
if (default_common_section == NULL)
/* Find any sections not attached explicitly and handle them. */
lang_place_orphans ();
- if (! link_info.relocateable)
+ if (! link_info.relocatable)
{
/* Look for a text section and set the readonly attribute in it. */
asection *found = bfd_get_section_by_name (output_bfd, ".text");
and other back-ends size dynamic sections. */
ldemul_before_allocation ();
- if (!link_info.relocateable)
+ if (!link_info.relocatable)
strip_excluded_output_sections ();
/* We must record the program headers before we try to fix the
(fill_type *) 0, (bfd_vma) 0);
/* Make sure that the section addresses make sense. */
- if (! link_info.relocateable
+ if (! link_info.relocatable
&& command_line.check_section_addresses)
lang_check_section_addresses ();
interface by default. */
demangling = getenv ("COLLECT_NO_DEMANGLE") == NULL;
- link_info.relocateable = FALSE;
+ link_info.relocatable = FALSE;
link_info.emitrelocations = FALSE;
link_info.task_link = FALSE;
link_info.shared = FALSE;
ldemul_set_symbols ();
- if (link_info.relocateable)
+ if (link_info.relocatable)
{
if (command_line.gc_sections)
einfo ("%P%F: --gc-sections and -r may not be used together\n");
/* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I
don't see how else this can be handled, since in this case we
must preserve all externally visible symbols. */
- if (link_info.relocateable && link_info.strip == strip_all)
+ if (link_info.relocatable && link_info.strip == strip_all)
{
link_info.strip = strip_debugger;
if (link_info.discard == discard_sec_merge)
/* Print error messages for any missing symbols, for any warning
symbols, and possibly multiple definitions. */
- if (link_info.relocateable)
+ if (link_info.relocatable)
output_bfd->flags &= ~EXEC_P;
else
output_bfd->flags |= EXEC_P;
if (nocrossref_list != NULL)
check_nocrossrefs ();
- /* Even if we're producing relocateable output, some non-fatal errors should
+ /* Even if we're producing relocatable output, some non-fatal errors should
be reported in the exit status. (What non-fatal errors, if any, do we
- want to ignore for relocateable output?) */
+ want to ignore for relocatable output?) */
if (!config.make_executable && !force_make_executable)
{
if (trace_files)
/* If the --force-exe-suffix is enabled, and we're making an
executable file and it doesn't end in .exe, copy it to one
which does. */
- if (! link_info.relocateable && command_line.force_exe_suffix)
+ if (! link_info.relocatable && command_line.force_exe_suffix)
{
int len = strlen (output_filename);
/* Ensure that BFD_RELOC_CTOR exists now, so that we can give a
useful error message. */
if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL
- && (link_info.relocateable
+ && (link_info.relocatable
|| bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n"));
/* ldwrite.c -- write out the linked file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2003
Free Software Foundation, Inc.
Written by Steve Chamberlain sac@cygnus.com
|| info->strip == strip_some)
thislines = sec->lineno_count;
- if (info->relocateable)
+ if (info->relocatable)
thisrelocs = sec->reloc_count;
if (sec->_cooked_size != 0)
thissize = sec->_raw_size;
}
- else if (info->relocateable
+ else if (info->relocatable
&& (p->type == bfd_section_reloc_link_order
|| p->type == bfd_symbol_reloc_link_order))
thisrelocs++;
'\0', NULL, N_("Ignored for SVR4 compatibility"), ONE_DASH },
{ {"emit-relocs", no_argument, NULL, 'q'},
'q', NULL, "Generate relocations in final output", TWO_DASHES },
- { {"relocateable", no_argument, NULL, 'r'},
- 'r', NULL, N_("Generate relocateable output"), TWO_DASHES },
+ { {"relocatable", no_argument, NULL, 'r'},
+ 'r', NULL, N_("Generate relocatable output"), TWO_DASHES },
{ {NULL, no_argument, NULL, '\0'},
'i', NULL, NULL, ONE_DASH },
{ {"just-symbols", required_argument, NULL, 'R'},
and will seg-fault the next time around. */
einfo(_("%P%F: bad -rpath option\n"));
- link_info.relocateable = TRUE;
+ link_info.relocatable = TRUE;
config.build_constructors = FALSE;
config.magic_demand_paged = FALSE;
config.text_read_only = FALSE;
link_info.task_link = TRUE;
/* Fall through - do an implied -r option. */
case OPTION_UR:
- link_info.relocateable = TRUE;
+ link_info.relocatable = TRUE;
config.build_constructors = TRUE;
config.magic_demand_paged = FALSE;
config.text_read_only = FALSE;