to do. Add an inverse switch. Update the documentation.
+2003-02-17 Nick Clifton <nickc@redhat.com>
+
+ * elflink.h (elf_link_output_extsym): Only check
+ allow_shlib_undefined for shared libraries.
+ * elf32-i386.c (elf_i386_relocate_section): Remove bogus check
+ of allow_shlib_undefined.
+ * elf32-cris.c (cris_elf_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-s390.c (elf_s390_relocate_section): Likewise.
+ * elf32-sh.c (sh_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf32-vax.c (elf_vax_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
+
2003-02-17 Nick Clifton <nickc@redhat.com>
* elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the
/* CRIS-specific support for 32-bit ELF.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Axis Communications AB.
Written by Hans-Peter Nilsson, based on elf32-fr30.c
PIC and shlib bits based primarily on elf32-m68k.c and elf32-i386.c.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
University of Utah
Largely rewritten by Alan Modra <alan@linuxcare.com.au>
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
: ldw -24(%sp),%rp ; restore the original rp
: ldsid (%rp),%r1
: mtsp %r1,%sr0
- : be,n 0(%sr0,%rp) ; inter-space return */
+ : be,n 0(%sr0,%rp) ; inter-space return. */
#define PLT_ENTRY_SIZE 8
#define GOT_ENTRY_SIZE 4
&& ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT
&& h->elf.type != STT_PARISC_MILLI)
{
- if (info->symbolic && !info->allow_shlib_undefined)
- {
- if (!((*info->callbacks->undefined_symbol)
- (info, h->elf.root.root.string, input_bfd,
- input_section, rel->r_offset, FALSE)))
- return FALSE;
- warned_undef = TRUE;
- }
+ if (!((*info->callbacks->undefined_symbol)
+ (info, h->elf.root.root.string, input_bfd,
+ input_section, rel->r_offset, FALSE)))
+ return FALSE;
+ warned_undef = TRUE;
}
else
{
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
HOWTO(R_68K_GLOB_DAT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_GLOB_DAT", FALSE, 0, 0xffffffff,FALSE),
HOWTO(R_68K_JMP_SLOT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_JMP_SLOT", FALSE, 0, 0xffffffff,FALSE),
HOWTO(R_68K_RELATIVE, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_RELATIVE", FALSE, 0, 0xffffffff,FALSE),
- /* GNU extension to record C++ vtable hierarchy */
+ /* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_68K_GNU_VTINHERIT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
0, /* src_mask */
0, /* dst_mask */
FALSE),
- /* GNU extension to record C++ vtable member usage */
+ /* GNU extension to record C++ vtable member usage. */
HOWTO (R_68K_GNU_VTENTRY, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
#define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
#define ELF_ARCH bfd_arch_m68k
-/* end code generated by elf.el */
\f
/* Functions for the m68k ELF linker. */
return &ret->root.root;
}
-/* Keep m68k-specific flags in the ELF header */
+/* Keep m68k-specific flags in the ELF header. */
static bfd_boolean
elf32_m68k_set_private_flags (abfd, flags)
bfd *abfd;
return TRUE;
}
-/* Display the flags field */
+/* Display the flags field. */
static bfd_boolean
elf32_m68k_print_private_bfd_data (abfd, ptr)
bfd *abfd;
/* We also need to make an entry in the .got.plt section, which
will be placed in the .got section by the linker script. */
-
s = bfd_get_section_by_name (dynobj, ".got.plt");
BFD_ASSERT (s != NULL);
s->_raw_size += 4;
/* We also need to make an entry in the .rela.plt section. */
-
s = bfd_get_section_by_name (dynobj, ".rela.plt");
BFD_ASSERT (s != NULL);
s->_raw_size += sizeof (Elf32_External_Rela);
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file is based on a preliminary PowerPC ELF ABI. The
information may not match the final PowerPC ELF ABI. It includes
static bfd_boolean ppc_elf_grok_psinfo
PARAMS ((bfd *abfd, Elf_Internal_Note *note));
-#define BRANCH_PREDICT_BIT 0x200000 /* branch prediction bit for branch taken relocs */
-#define RA_REGISTER_MASK 0x001f0000 /* mask to set RA in memory instructions */
-#define RA_REGISTER_SHIFT 16 /* value to shift register by to insert RA */
+#define BRANCH_PREDICT_BIT 0x200000 /* Branch prediction bit for branch taken relocs. */
+#define RA_REGISTER_MASK 0x001f0000 /* Mask to set RA in memory instructions. */
+#define RA_REGISTER_SHIFT 16 /* Value to shift register by to insert RA. */
/* The name of the dynamic interpreter. This is put in the .interp
section. */
/* The remaining relocs are from the Embedded ELF ABI, and are not
in the SVR4 ELF ABI. */
- /* 32 bit value resulting from the addend minus the symbol */
+ /* 32 bit value resulting from the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit value resulting from the addend minus the symbol */
+ /* 16 bit value resulting from the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* 16 bit value resulting from the addend minus the symbol */
+ /* 16 bit value resulting from the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR16_LO, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* The high order 16 bits of the addend minus the symbol */
+ /* The high order 16 bits of the addend minus the symbol. */
HOWTO (R_PPC_EMB_NADDR16_HI, /* type */
16, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
/* 16 bit value resulting from allocating a 4 byte word to hold an
address in the .sdata section, and returning the offset from
- _SDA_BASE_ for that relocation */
+ _SDA_BASE_ for that relocation. */
HOWTO (R_PPC_EMB_SDAI16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- /* GNU extension to record C++ vtable hierarchy */
+ /* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_PPC_GNU_VTINHERIT, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* dst_mask */
FALSE), /* pcrel_offset */
- /* GNU extension to record C++ vtable member usage */
+ /* GNU extension to record C++ vtable member usage. */
HOWTO (R_PPC_GNU_VTENTRY, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* dst_mask */
FALSE), /* pcrel_offset */
- /* Phony reloc to handle AIX style TOC entries */
+ /* Phony reloc to handle AIX style TOC entries. */
HOWTO (R_PPC_TOC16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
3/ Conditional forward branches - Ensure that the "inverse prediction
bit" is set (ensure it is predicted taken).
4/ Conditional register branches - Ensure that the "y bit" is set
- (ensure it is predicted taken).
-*/
+ (ensure it is predicted taken). */
/* Sort sections by address. */
The array rela_comb is built here for use in the EOP scan loop. */
switch (r_type)
{
- case R_PPC_ADDR14_BRNTAKEN: /* absolute, predicted not taken */
- case R_PPC_REL14: /* relative cond. br. */
- case R_PPC_REL14_BRNTAKEN: /* rel. cond. br., predicted not taken */
+ case R_PPC_ADDR14_BRNTAKEN: /* Absolute, predicted not taken */
+ case R_PPC_REL14: /* Relative cond. br. */
+ case R_PPC_REL14_BRNTAKEN: /* Rel. cond. br., predicted not taken */
/* We should check the instruction. */
break;
default:
bfd_boolean skip, modified;
/* Don't process this word if there is a relocation for it and
- the relocation indicates the word is not a conditional branch. */
+ the relocation indicates the word is not a conditional branch. */
skip = FALSE;
isec_offset = dot - isec->vma;
for (; comb_curr<comb_count; ++comb_curr)
{
bfd_vma target;
/* This branch is predicted as "normal".
- If this is a forward branch, it is problematic. */
+ If this is a forward branch, it is problematic. */
target = insn & 0x0000Fffc; /*extract*/
target = (target ^ 0x8000) - 0x8000; /*sign extend*/
target += dot; /*convert to abs*/
if (target > dot)
{
- insn |= 0x00200000; /* set the prediction bit */
+ insn |= 0x00200000; /* Set the prediction bit. */
modified = TRUE;
}
}
}
else if ((insn & 0xFc00Fffe) == 0x4c000420)
{
- /* Instruction is BCCTRx */
+ /* Instruction is BCCTRx. */
if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
{
/* This branch is predicted as not-taken.
- If this is a forward branch, it is problematic.
- Since we can't tell statically if it will branch forward,
- always set the prediction bit. */
- insn |= 0x00200000; /* set the prediction bit */
+ If this is a forward branch, it is problematic.
+ Since we can't tell statically if it will branch forward,
+ always set the prediction bit. */
+ insn |= 0x00200000; /* Set the prediction bit. */
modified = TRUE;
}
}
if ((!BO0(insn) || !BO2(insn)) && !BO4(insn))
{
/* This branch is predicted as not-taken.
- If this is a forward branch, it is problematic.
- Since we can't tell statically if it will branch forward,
- always set the prediction bit. */
- insn |= 0x00200000; /* set the prediction bit */
+ If this is a forward branch, it is problematic.
+ Since we can't tell statically if it will branch forward,
+ always set the prediction bit. */
+ insn |= 0x00200000; /* Set the prediction bit. */
modified = TRUE;
}
}
}
/* Merge backend specific data from an object file to the output
- object file when linking */
+ object file when linking. */
+
static bfd_boolean
ppc_elf_merge_private_bfd_data (ibfd, obfd)
bfd *ibfd;
flagword new_flags;
bfd_boolean error;
- /* Check if we have the same endianess */
+ /* Check if we have the same endianess. */
if (! _bfd_generic_verify_endian_match (ibfd, obfd))
return FALSE;
new_flags = elf_elfheader (ibfd)->e_flags;
old_flags = elf_elfheader (obfd)->e_flags;
- if (!elf_flags_init (obfd)) /* First call, no flags set */
+ if (!elf_flags_init (obfd)) /* First call, no flags set. */
{
elf_flags_init (obfd) = TRUE;
elf_elfheader (obfd)->e_flags = new_flags;
}
- else if (new_flags == old_flags) /* Compatible flags are ok */
+ else if (new_flags == old_flags) /* Compatible flags are ok. */
;
- else /* Incompatible flags */
+ else /* Incompatible flags. */
{
/* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib to be linked
with either. */
&& (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)))
elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE;
- /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if any module uses it */
+ /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if any module uses it. */
elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB);
new_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
old_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB);
- /* Warn about any other mismatches */
+ /* Warn about any other mismatches. */
if (new_flags != old_flags)
{
error = TRUE;
bfd *dynobj = elf_hash_table (info)->dynobj;
elf_linker_section_t *lsect;
- /* Record the first bfd section that needs the special section */
+ /* Record the first bfd section that needs the special section. */
if (!dynobj)
dynobj = elf_hash_table (info)->dynobj = abfd;
- /* If this is the first time, create the section */
+ /* If this is the first time, create the section. */
lsect = elf_linker_section (dynobj, which);
if (!lsect)
{
}
break;
- /* Indirect .sdata relocation */
+ /* Indirect .sdata relocation. */
case R_PPC_EMB_SDAI16:
if (info->shared)
{
break;
- /* Indirect .sdata2 relocation */
+ /* Indirect .sdata2 relocation. */
case R_PPC_EMB_SDA2I16:
if (info->shared)
{
case R_PPC_SECTOFF_HA:
break;
- /* This refers only to functions defined in the shared library */
+ /* This refers only to functions defined in the shared library. */
case R_PPC_LOCAL24PC:
break;
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
-
if (sreloc == NULL)
{
const char *name;
}
break;
- /* branch taken prediction relocations */
+ /* Branch taken prediction relocations. */
case (int) R_PPC_ADDR14_BRTAKEN:
case (int) R_PPC_REL14_BRTAKEN:
insn = bfd_get_32 (output_bfd, contents + offset);
bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
break;
- /* branch not taken predicition relocations */
+ /* Branch not taken predicition relocations. */
case (int) R_PPC_ADDR14_BRNTAKEN:
case (int) R_PPC_REL14_BRNTAKEN:
insn = bfd_get_32 (output_bfd, contents + offset);
bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset);
break;
- /* GOT16 relocations */
+ /* GOT16 relocations. */
case (int) R_PPC_GOT16:
case (int) R_PPC_GOT16_LO:
case (int) R_PPC_GOT16_HI:
addend += ((relocation + addend) & 0x8000) << 1;
break;
- /* Indirect .sdata relocation */
+ /* Indirect .sdata relocation. */
case (int) R_PPC_EMB_SDAI16:
BFD_ASSERT (sdata != NULL);
relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
R_PPC_RELATIVE);
break;
- /* Indirect .sdata2 relocation */
+ /* Indirect .sdata2 relocation. */
case (int) R_PPC_EMB_SDA2I16:
BFD_ASSERT (sdata2 != NULL);
relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info,
+ h->plt.offset);
break;
- /* relocate against _SDA_BASE_ */
+ /* Relocate against _SDA_BASE_. */
case (int) R_PPC_SDAREL16:
{
const char *name;
}
break;
- /* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */
+ /* Relocate against either _SDA_BASE_, _SDA2_BASE_, or 0. */
case (int) R_PPC_EMB_SDA21:
case (int) R_PPC_EMB_RELSDA:
{
}
break;
- /* Relocate against the beginning of the section */
+ /* Relocate against the beginning of the section. */
case (int) R_PPC_SECTOFF:
case (int) R_PPC_SECTOFF_LO:
case (int) R_PPC_SECTOFF_HI:
}
}
\f
-/* Support for core dump NOTE sections */
+/* Support for core dump NOTE sections. */
+
static bfd_boolean
ppc_elf_grok_prstatus (abfd, note)
bfd *abfd;
default:
return FALSE;
- case 268: /* Linux/PPC */
+ case 268: /* Linux/PPC. */
/* pr_cursig */
elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
default:
return FALSE;
- case 128: /* Linux/PPC elf_prpsinfo */
+ case 128: /* Linux/PPC elf_prpsinfo. */
elf_tdata (abfd)->core_program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
elf_tdata (abfd)->core_command
case R_390_TLS_IEENT:
if (info->shared)
info->flags |= DF_STATIC_TLS;
- /* Fall through */
+ /* Fall through. */
case R_390_GOT12:
case R_390_GOT16:
if (r_type != R_390_TLS_IE32)
break;
- /* Fall through */
+ /* Fall through. */
case R_390_TLS_LE32:
if (!info->shared)
break;
info->flags |= DF_STATIC_TLS;
- /* Fall through */
+ /* Fall through. */
case R_390_8:
case R_390_16:
/* Track dynamic relocs needed for local syms too.
We really need local syms available to do this
easily. Oh well. */
-
asection *s;
+
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
sec, r_symndx);
if (s == NULL)
if (p == NULL || p->sec != sec)
{
bfd_size_type amt = sizeof *p;
+
p = ((struct elf_s390_dyn_relocs *)
bfd_alloc (htab->elf.dynobj, amt));
if (p == NULL)
}
if (r_type != R_390_TLS_IE32)
break;
- /* Fall through */
+ /* Fall through. */
case R_390_TLS_LE32:
if (!info->shared)
break;
- /* Fall through */
+ /* Fall through. */
case R_390_8:
case R_390_12:
for (p = eh->dyn_relocs; p != NULL; p = p->next)
{
asection *sreloc = elf_section_data (p->sec)->sreloc;
+
sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
relocation = htab->sgot->output_offset + off;
- /*
- * For @GOTENT the relocation is against the offset between
- * the instruction and the symbols entry in the GOT and not
- * between the start of the GOT and the symbols entry. We
- * add the vma of the GOT to get the correct value.
- */
+ /* For @GOTENT the relocation is against the offset between
+ the instruction and the symbols entry in the GOT and not
+ between the start of the GOT and the symbols entry. We
+ add the vma of the GOT to get the correct value. */
if ( r_type == R_390_GOTENT
|| r_type == R_390_GOTPLTENT)
relocation += htab->sgot->output_section->vma;
loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
}
- /* Fall through */
+ /* Fall through. */
case R_390_TLS_GD32:
case R_390_TLS_GOTIE32:
/* This symbol has an entry in the procedure linkage table. Set
it up. */
-
if (h->dynindx == -1
|| htab->splt == NULL
|| htab->sgotplt == NULL
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (! info->symbolic || info->allow_shlib_undefined)
&& ! info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003 Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
/* VAX series support for 32-bit ELF
- Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Contributed by Matt Thomas <matt@3am-software.com>.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
-
if (sreloc == NULL)
{
const char *name;
/* This symbol has an entry in the procedure linkage table. Set
it up. */
-
BFD_ASSERT (h->dynindx != -1);
splt = bfd_get_section_by_name (dynobj, ".plt");
/* This symbol has an entry in the global offset table. Set it
up. */
-
sgot = bfd_get_section_by_name (dynobj, ".got");
srela = bfd_get_section_by_name (dynobj, ".rela.got");
BFD_ASSERT (sgot != NULL && srela != NULL);
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */
-
BFD_ASSERT (h->dynindx != -1
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak));
else if (h->root.root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
;
bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
}
- /* Initialize the PLT0 entry */
+ /* Initialize the PLT0 entry. */
if (splt->_raw_size > 0)
{
bfd_put_32 (output_bfd, PLT_HEADER_WORD1, splt->contents);
/* Support for HPPA 64-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.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "alloca-conf.h"
#include "bfd.h"
Written by Linus Nordberg, Swox AB <info@swox.com>,
based on elf32-ppc.c by Ian Lance Taylor.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file is based on the 64-bit PowerPC ELF ABI. It is also based
on the file elf32-ppc.c. */
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
case R_PPC64_RELATIVE:
/* We shouldn't ever see these dynamic relocs in relocatable
files. */
- /* Fall thru */
+ /* Fall through. */
case R_PPC64_PLTGOT16:
case R_PPC64_PLTGOT16_DS:
/* Create a JMP_SLOT reloc to inform the dynamic linker to
fill in the PLT entry. */
-
rela.r_offset = (htab->splt->output_section->vma
+ htab->splt->output_offset
+ ent->plt.offset);
/* IBM S/390-specific support for 64-bit ELF
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of BFD, the Binary File Descriptor library.
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
relocation = htab->sgot->output_offset + off;
- /*
- * For @GOTENT the relocation is against the offset between
- * the instruction and the symbols entry in the GOT and not
- * between the start of the GOT and the symbols entry. We
- * add the vma of the GOT to get the correct value.
- */
+ /* For @GOTENT the relocation is against the offset between
+ the instruction and the symbols entry in the GOT and not
+ between the start of the GOT and the symbols entry. We
+ add the vma of the GOT to get the correct value. */
if ( r_type == R_390_GOTENT
|| r_type == R_390_GOTPLTENT)
relocation += htab->sgot->output_section->vma;
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
-
skip = FALSE;
relocate = FALSE;
loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloc_out (output_bfd, &outrel, loc);
}
- /* Fall through */
+ /* Fall through. */
case R_390_TLS_GD64:
case R_390_TLS_GOTIE64:
/* This symbol has an entry in the global offset table. Set it
up. */
-
if (htab->sgot == NULL || htab->srelgot == NULL)
abort ();
return TRUE;
}
-/*
- * Why was the hash table entry size definition changed from
- * ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and
- * this is the only reason for the s390_elf64_size_info structure.
- */
+/* Why was the hash table entry size definition changed from
+ ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and
+ this is the only reason for the s390_elf64_size_info structure. */
const struct elf_size_info s390_elf64_size_info =
{
sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note),
- 8, /* hash-table entry size */
- 1, /* internal relocations per external relocations */
- 64, /* arch_size */
- 8, /* file_align */
+ 8, /* hash-table entry size. */
+ 1, /* internal relocations per external relocations. */
+ 64, /* arch_size. */
+ 8, /* file_align. */
ELFCLASS64, EV_CURRENT,
bfd_elf64_write_out_phdrs,
bfd_elf64_write_shdrs_and_ehdr,
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003 Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
else if (h->root.type == bfd_link_hash_undefweak)
;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
/* To avoid generating warning messages about truncated
relocations, set the relocation's address to be the same as
the start of this section. */
-
if (input_section->output_section != NULL)
relocation = input_section->output_section->vma;
else
}
}
}
- /* FALLTHROUGH */
+ /* Fall through. */
default:
do_default:
bfd_byte *loc;
/* This symbols needs a copy reloc. Set it up. */
-
BFD_ASSERT (h->dynindx != -1);
s = bfd_get_section_by_name (h->root.u.def.section->owner,
/* Initialize the contents of the .plt section. */
if (splt->_raw_size > 0)
- {
- sparc64_elf_build_plt (output_bfd, splt->contents,
- (int) (splt->_raw_size / PLT_ENTRY_SIZE));
- }
+ sparc64_elf_build_plt (output_bfd, splt->contents,
+ (int) (splt->_raw_size / PLT_ENTRY_SIZE));
elf_section_data (splt->output_section)->this_hdr.sh_entsize =
PLT_ENTRY_SIZE;
sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note),
- 4, /* hash-table entry size */
- /* internal relocations per external relocations.
+ 4, /* hash-table entry size. */
+ /* Internal relocations per external relocations.
For link purposes we use just 1 internal per
1 external, for assembly and slurp symbol table
we use 2. */
1,
- 64, /* arch_size */
- 8, /* file_align */
+ 64, /* arch_size. */
+ 8, /* file_align. */
ELFCLASS64,
EV_CURRENT,
bfd_elf64_write_out_phdrs,
/* X86-64 specific support for 64-bit ELF
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Jan Hubicka <jh@suse.cz>.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
/* When generating a shared object, these relocations
are copied into the output file to be resolved at run
time. */
-
skip = FALSE;
relocate = FALSE;
/* This symbol has an entry in the procedure linkage table. Set
it up. */
-
if (h->dynindx == -1
|| htab->splt == NULL
|| htab->sgotplt == NULL
/* This symbol has an entry in the global offset table. Set it
up. */
-
if (htab->sgot == NULL || htab->srelgot == NULL)
abort ();
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* ELF linker code. */
referenced by regular files, because we will already have issued
warnings for them. */
if (! finfo->info->relocateable
- && ! finfo->info->allow_shlib_undefined
- && ! finfo->info->shared
+ && (! finfo->info->shared || ! finfo->info->allow_shlib_undefined)
&& h->root.type == bfd_link_hash_undefined
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
else if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
;
srel, rel->r_offset, dyn_r_type,
dynindx, addend);
}
- /* FALLTHRU */
+ /* Fall through. */
case R_IA64_LTV32MSB:
case R_IA64_LTV32LSB:
bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon);
}
- /* Initialize the PLT0 entry */
+ /* Initialize the PLT0 entry. */
if (ia64_info->plt_sec)
{
bfd_byte *loc = ia64_info->plt_sec->contents;
return TRUE;
}
\f
-/* ELF file flag handling: */
+/* ELF file flag handling: */
/* Function to keep IA-64 specific file flags. */
static bfd_boolean
Traditional MIPS targets support added by Koundinya.K, Dansk Data
Elektronik & Operations Research Group. <kk@ddeorg.soft.net>
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file handles functionality common to the different MIPS ABI's. */
loader for use by the static exception system. */
typedef struct runtime_pdr {
- bfd_vma adr; /* memory address of start of procedure */
- long regmask; /* save register mask */
- long regoffset; /* save register offset */
- long fregmask; /* save floating point register mask */
- long fregoffset; /* save floating point register offset */
- long frameoffset; /* frame size */
- short framereg; /* frame pointer register */
- short pcreg; /* offset or reg of return pc */
- long irpss; /* index into the runtime string table */
+ bfd_vma adr; /* Memory address of start of procedure. */
+ long regmask; /* Save register mask. */
+ long regoffset; /* Save register offset. */
+ long fregmask; /* Save floating point register mask. */
+ long fregoffset; /* Save floating point register offset. */
+ long frameoffset; /* Frame size. */
+ short framereg; /* Frame pointer register. */
+ short pcreg; /* Offset or reg of return pc. */
+ long irpss; /* Index into the runtime string table. */
long reserved;
- struct exception_info *exception_info;/* pointer to exception array */
+ struct exception_info *exception_info;/* Pointer to exception array. */
} RPDR, *pRPDR;
#define cbRPDR sizeof (RPDR)
#define rpdNil ((pRPDR) 0)
addresses. */
symbol = 0;
else if (info->shared
- && (!info->symbolic || info->allow_shlib_undefined)
&& !info->no_undefined
&& ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
symbol = 0;
+2003-02-17 Nick Clifton <nickc@redhat.com>
+
+ * ldmain.c (main) Default allow_shlib_undefined to true.
+ * lexsup.c (ld_options): Add --no-allow-shlib-undefined.
+ (parse_args): Parse the new switch.
+ * ld.texinfo: Document new switch and default behaviour of
+ allowing undefined symbols in shared libraries.
+
2003-02-11 Dmitry Diky <diwil@mail.ru>
* scripttempl/elf32msp430.sc: Add new data anchors definitions.
@item --no-undefined
@itemx -z defs
Normally when creating a non-symbolic shared library, undefined symbols
-are allowed and left to be resolved by the runtime loader. These options
-disallows such undefined symbols.
+are allowed and left to be resolved by the runtime loader. This option
+disallows such undefined symbols if they come from regular object
+files. The switch @samp{--no-allow-shlib-undefined} controls the
+behaviour for shared objects being linked into the shared library.
@kindex --allow-multiple-definition
@kindex -z muldefs
first definition will be used.
@kindex --allow-shlib-undefined
+@kindex --no-allow-shlib-undefined
@item --allow-shlib-undefined
-Allow undefined symbols in shared objects even when --no-undefined is
-set. The net result will be that undefined symbols in regular objects
-will still trigger an error, but undefined symbols in shared objects
-will be ignored. The implementation of no_undefined makes the
-assumption that the runtime linker will choke on undefined symbols.
-However there is at least one system (BeOS) where undefined symbols in
-shared libraries is normal since the kernel patches them at load time to
-select which function is most appropriate for the current architecture.
-I.E. dynamically select an appropriate memset function. Apparently it
-is also normal for HPPA shared libraries to have undefined symbols.
+@itemx --no-allow-shlib-undefined
+Allow (the default) or disallow undefined symbols in shared objects.
+The setting of this switch overrides @samp {--no-undefined} where
+shared objects are concerned. Thus if @samp {--no-undefined} is set
+but @samp {--no-allow-shlib-undefined} is not, the net result will be
+that undefined symbols in regular object files will trigger an error,
+but undefined symbols in shared objects will be ignored.
+
+The reason that @samp{--allow-shlib-undefined} is the default is that
+the shared object being specified at link time may not be the same one
+that is available at load time, so the symbols might actually be
+resolvable at load time. Plus there are some systems, (eg BeOS) where
+undefined symbols in shared libraries is normal since the kernel
+patches them at load time to select which function is most appropriate
+for the current architecture. eg. to dynamically select an appropriate
+memset function. Apparently it is also normal for HPPA shared
+libraries to have undefined symbols.
@kindex --no-undefined-version
@item --no-undefined-version
link_info.traditional_format = FALSE;
link_info.optimize = FALSE;
link_info.no_undefined = FALSE;
- link_info.allow_shlib_undefined = FALSE;
+ link_info.allow_shlib_undefined = TRUE;
link_info.allow_multiple_definition = FALSE;
link_info.allow_undefined_version = TRUE;
link_info.keep_memory = TRUE;
/* Parse options for the GNU linker.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
#define OPTION_UNIQUE (OPTION_SECTION_START + 1)
#define OPTION_TARGET_HELP (OPTION_UNIQUE + 1)
#define OPTION_ALLOW_SHLIB_UNDEFINED (OPTION_TARGET_HELP + 1)
-#define OPTION_ALLOW_MULTIPLE_DEFINITION (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
+#define OPTION_NO_ALLOW_SHLIB_UNDEFINED (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
+#define OPTION_ALLOW_MULTIPLE_DEFINITION (OPTION_NO_ALLOW_SHLIB_UNDEFINED + 1)
#define OPTION_NO_UNDEFINED_VERSION (OPTION_ALLOW_MULTIPLE_DEFINITION + 1)
#define OPTION_DISCARD_NONE (OPTION_NO_UNDEFINED_VERSION + 1)
#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1)
{ {"no-undefined", no_argument, NULL, OPTION_NO_UNDEFINED},
'\0', NULL, N_("Allow no undefined symbols"), TWO_DASHES },
{ {"allow-shlib-undefined", no_argument, NULL, OPTION_ALLOW_SHLIB_UNDEFINED},
- '\0', NULL, N_("Allow undefined symbols in shared objects"), TWO_DASHES },
+ '\0', NULL, N_("Allow undefined symbols in shared objects (the default)"), TWO_DASHES },
+ { {"no-allow-shlib-undefined", no_argument, NULL, OPTION_NO_ALLOW_SHLIB_UNDEFINED},
+ '\0', NULL, N_("Do not allow undefined symbols in shared objects"), TWO_DASHES },
{ {"allow-multiple-definition", no_argument, NULL, OPTION_ALLOW_MULTIPLE_DEFINITION},
'\0', NULL, N_("Allow multiple definitions"), TWO_DASHES },
{ {"no-undefined-version", no_argument, NULL, OPTION_NO_UNDEFINED_VERSION},
case OPTION_ALLOW_SHLIB_UNDEFINED:
link_info.allow_shlib_undefined = TRUE;
break;
+ case OPTION_NO_ALLOW_SHLIB_UNDEFINED:
+ link_info.allow_shlib_undefined = FALSE;
+ break;
case OPTION_ALLOW_MULTIPLE_DEFINITION:
link_info.allow_multiple_definition = TRUE;
break;