aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-ia64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-08-18 05:51:03 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-08-18 05:51:19 -0700
commit0e1862bb401f47716446aef143b2bf7a4563f541 (patch)
tree8410cdece79e8df2f1394b53d1e992736323baac /bfd/elfnn-ia64.c
parentb2a33439909493f5bf93ada871bd588f365d61f4 (diff)
downloadgdb-0e1862bb401f47716446aef143b2bf7a4563f541.zip
gdb-0e1862bb401f47716446aef143b2bf7a4563f541.tar.gz
gdb-0e1862bb401f47716446aef143b2bf7a4563f541.tar.bz2
Add output_type to bfd_link_info
The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
Diffstat (limited to 'bfd/elfnn-ia64.c')
-rw-r--r--bfd/elfnn-ia64.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c
index 1bbccd6..c45fa28 100644
--- a/bfd/elfnn-ia64.c
+++ b/bfd/elfnn-ia64.c
@@ -346,7 +346,7 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
one pass. */
*again = FALSE;
- if (link_info->relocatable)
+ if (bfd_link_relocatable (link_info))
(*link_info->callbacks->einfo)
(_("%P%F: --relax and -r may not be used together\n"));
@@ -831,7 +831,7 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec,
{
/* Resize .rela.got. */
ia64_info->root.srelgot->size = 0;
- if (link_info->shared
+ if (bfd_link_pic (link_info)
&& ia64_info->self_dtpmod_offset != (bfd_vma) -1)
ia64_info->root.srelgot->size += sizeof (ElfNN_External_Rela);
data.only_got = TRUE;
@@ -1033,7 +1033,7 @@ elfNN_ia64_add_symbol_hook (bfd *abfd,
bfd_vma *valp)
{
if (sym->st_shndx == SHN_COMMON
- && !info->relocatable
+ && !bfd_link_relocatable (info)
&& sym->st_size <= elf_gp_size (abfd))
{
/* Common symbols less than or equal to -G nn bytes are
@@ -1993,8 +1993,8 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
| SEC_LOAD
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY
- | (info->pie ? 0
- : SEC_READONLY)
+ | (bfd_link_pie (info)
+ ? 0 : SEC_READONLY)
| SEC_LINKER_CREATED));
if (!fptr
|| !bfd_set_section_alignment (abfd, fptr, 4))
@@ -2005,7 +2005,7 @@ get_fptr (bfd *abfd, struct bfd_link_info *info,
ia64_info->fptr_sec = fptr;
- if (info->pie)
+ if (bfd_link_pie (info))
{
asection *fptr_rel;
fptr_rel = bfd_make_section_anyway_with_flags (dynobj, ".rela.opd",
@@ -2158,7 +2158,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
unsigned long r_symndx;
bfd_boolean maybe_dynamic;
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -2191,7 +2191,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
locally or externally defined, as not all of the input files
have yet been processed. Do something with what we know, as
this may help reduce memory usage and processing time later. */
- maybe_dynamic = (h && ((!info->executable
+ maybe_dynamic = (h && ((!bfd_link_executable (info)
&& (!SYMBOLIC_BIND (info, h)
|| info->unresolved_syms_in_shared_libs == RM_IGNORE))
|| !h->def_regular
@@ -2202,13 +2202,13 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
case R_IA64_TPREL64MSB:
case R_IA64_TPREL64LSB:
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
break;
case R_IA64_LTOFF_TPREL22:
need_entry = NEED_TPREL;
- if (info->shared)
+ if (bfd_link_pic (info))
info->flags |= DF_STATIC_TLS;
break;
@@ -2216,7 +2216,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_DTPREL32LSB:
case R_IA64_DTPREL64MSB:
case R_IA64_DTPREL64LSB:
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
break;
@@ -2226,7 +2226,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_DTPMOD64MSB:
case R_IA64_DTPMOD64LSB:
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
break;
@@ -2248,7 +2248,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_FPTR32LSB:
case R_IA64_FPTR64MSB:
case R_IA64_FPTR64LSB:
- if (info->shared || h)
+ if (bfd_link_pic (info) || h)
need_entry = NEED_FPTR | NEED_DYNREL;
else
need_entry = NEED_FPTR;
@@ -2299,14 +2299,14 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_DIR64MSB:
case R_IA64_DIR64LSB:
/* Shared objects will always need at least a REL relocation. */
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
break;
case R_IA64_IPLTMSB:
case R_IA64_IPLTLSB:
/* Shared objects will always need at least a REL relocation. */
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
break;
@@ -2366,7 +2366,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
locally or externally defined, as not all of the input files
have yet been processed. Do something with what we know, as
this may help reduce memory usage and processing time later. */
- maybe_dynamic = (h && ((!info->executable
+ maybe_dynamic = (h && ((!bfd_link_executable (info)
&& (!SYMBOLIC_BIND (info, h)
|| info->unresolved_syms_in_shared_libs == RM_IGNORE))
|| !h->def_regular
@@ -2377,16 +2377,16 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
{
case R_IA64_TPREL64MSB:
case R_IA64_TPREL64LSB:
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
dynrel_type = R_IA64_TPREL64LSB;
- if (info->shared)
+ if (bfd_link_pic (info))
info->flags |= DF_STATIC_TLS;
break;
case R_IA64_LTOFF_TPREL22:
need_entry = NEED_TPREL;
- if (info->shared)
+ if (bfd_link_pic (info))
info->flags |= DF_STATIC_TLS;
break;
@@ -2394,7 +2394,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_DTPREL32LSB:
case R_IA64_DTPREL64MSB:
case R_IA64_DTPREL64LSB:
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
dynrel_type = R_IA64_DTPRELNNLSB;
break;
@@ -2405,7 +2405,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_DTPMOD64MSB:
case R_IA64_DTPMOD64LSB:
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
dynrel_type = R_IA64_DTPMOD64LSB;
break;
@@ -2428,7 +2428,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_FPTR32LSB:
case R_IA64_FPTR64MSB:
case R_IA64_FPTR64LSB:
- if (info->shared || h)
+ if (bfd_link_pic (info) || h)
need_entry = NEED_FPTR | NEED_DYNREL;
else
need_entry = NEED_FPTR;
@@ -2474,7 +2474,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_DIR64MSB:
case R_IA64_DIR64LSB:
/* Shared objects will always need at least a REL relocation. */
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
dynrel_type = R_IA64_DIRNNLSB;
break;
@@ -2482,7 +2482,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_IA64_IPLTMSB:
case R_IA64_IPLTLSB:
/* Shared objects will always need at least a REL relocation. */
- if (info->shared || maybe_dynamic)
+ if (bfd_link_pic (info) || maybe_dynamic)
need_entry = NEED_DYNREL;
dynrel_type = R_IA64_IPLTLSB;
break;
@@ -2540,7 +2540,7 @@ elfNN_ia64_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* FPTRs for shared libraries are allocated by the dynamic
linker. Make sure this local symbol will appear in the
dynamic symbol table. */
- if (!h && info->shared)
+ if (!h && bfd_link_pic (info))
{
if (! (bfd_elf_link_record_local_dynamic_symbol
(info, abfd, (long) r_symndx)))
@@ -2712,7 +2712,7 @@ allocate_fptr (struct elfNN_ia64_dyn_sym_info *dyn_i, void * data)
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if (!x->info->executable
+ if (!bfd_link_executable (x->info)
&& (!h
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| (h->root.type != bfd_link_hash_undefweak
@@ -2841,7 +2841,7 @@ allocate_dynrel_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
/* Note that this can't be used in relation to FPTR relocs below. */
dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info, 0);
- shared = x->info->shared;
+ shared = bfd_link_pic (x->info);
resolved_zero = (dyn_i->h
&& ELF_ST_VISIBILITY (dyn_i->h->other)
&& dyn_i->h->root.type == bfd_link_hash_undefweak);
@@ -2856,7 +2856,7 @@ allocate_dynrel_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
&& dyn_i->h->dynindx != -1))
{
if (!dyn_i->want_ltoff_fptr
- || !x->info->pie
+ || !bfd_link_pie (x->info)
|| dyn_i->h == NULL
|| dyn_i->h->root.type != bfd_link_hash_undefweak)
ia64_info->root.srelgot->size += sizeof (ElfNN_External_Rela);
@@ -2906,7 +2906,7 @@ allocate_dynrel_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
will be true only if we're actually allocating one statically
in the main executable. Position independent executables
need a relative reloc. */
- if (dyn_i->want_fptr && !x->info->pie)
+ if (dyn_i->want_fptr && !bfd_link_pie (x->info))
continue;
break;
case R_IA64_PCREL32LSB:
@@ -2992,7 +2992,7 @@ elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Set the contents of the .interp section to the interpreter. */
if (ia64_info->root.dynamic_sections_created
- && info->executable)
+ && bfd_link_executable (info))
{
sec = bfd_get_linker_section (dynobj, ".interp");
BFD_ASSERT (sec != NULL);
@@ -3069,7 +3069,7 @@ elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
/* Allocate space for the dynamic relocations that turned out to be
required. */
- if (info->shared && ia64_info->self_dtpmod_offset != (bfd_vma) -1)
+ if (bfd_link_pic (info) && ia64_info->self_dtpmod_offset != (bfd_vma) -1)
ia64_info->root.srelgot->size += sizeof (ElfNN_External_Rela);
data.only_got = FALSE;
elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data);
@@ -3181,7 +3181,7 @@ elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
later (in finish_dynamic_sections) but we must add the entries now
so that we get the correct size for the .dynamic section. */
- if (info->executable)
+ if (bfd_link_executable (info))
{
/* The DT_DEBUG entry is filled in by the dynamic linker and used
by the debugger. */
@@ -3315,7 +3315,7 @@ set_got_entry (bfd *abfd, struct bfd_link_info *info,
bfd_put_64 (abfd, value, got_sec->contents + got_offset);
/* Install a dynamic relocation if needed. */
- if (((info->shared
+ if (((bfd_link_pic (info)
&& (!dyn_i->h
|| ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
|| dyn_i->h->root.type != bfd_link_hash_undefweak)
@@ -3326,7 +3326,7 @@ set_got_entry (bfd *abfd, struct bfd_link_info *info,
&& (dyn_r_type == R_IA64_FPTR32LSB
|| dyn_r_type == R_IA64_FPTR64LSB)))
&& (!dyn_i->want_ltoff_fptr
- || !info->pie
+ || !bfd_link_pie (info)
|| !dyn_i->h
|| dyn_i->h->root.type != bfd_link_hash_undefweak))
{
@@ -3479,7 +3479,7 @@ set_pltoff_entry (bfd *abfd, struct bfd_link_info *info,
/* Install dynamic relocations if needed. */
if (!is_plt
- && info->shared
+ && bfd_link_pic (info)
&& (!dyn_i->h
|| ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
|| dyn_i->h->root.type != bfd_link_hash_undefweak))
@@ -3715,7 +3715,7 @@ elfNN_ia64_final_link (bfd *abfd, struct bfd_link_info *info)
return FALSE;
/* Make sure we've got ourselves a nice fat __gp value. */
- if (!info->relocatable)
+ if (!bfd_link_relocatable (info))
{
bfd_vma gp_val;
struct elf_link_hash_entry *gp;
@@ -3741,7 +3741,7 @@ elfNN_ia64_final_link (bfd *abfd, struct bfd_link_info *info)
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->relocatable)
+ if (!bfd_link_relocatable (info))
{
asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
if (s)
@@ -3799,7 +3799,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
return FALSE;
/* Infect various flags from the input section to the output section. */
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
{
bfd_vma flags;
@@ -3856,7 +3856,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
sym_sec = local_sections[r_symndx];
msec = sym_sec;
value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
- if (!info->relocatable
+ if (!bfd_link_relocatable (info)
&& (sym_sec->flags & SEC_MERGE) != 0
&& ELF_ST_TYPE (sym->st_info) == STT_SECTION
&& sym_sec->sec_info_type == SEC_INFO_TYPE_MERGE)
@@ -3913,7 +3913,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
- else if (warned || (ignored && info->executable))
+ else if (warned || (ignored && bfd_link_executable (info)))
continue;
}
@@ -3921,7 +3921,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
continue;
hit_addr = contents + rel->r_offset;
@@ -3942,7 +3942,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
case R_IA64_DIR64MSB:
case R_IA64_DIR64LSB:
/* Install a dynamic relocation for this reloc. */
- if ((dynamic_symbol_p || info->shared)
+ if ((dynamic_symbol_p || bfd_link_pic (info))
&& r_symndx != STN_UNDEF
&& (input_section->flags & SEC_ALLOC) != 0)
{
@@ -4070,7 +4070,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
if (!undef_weak_ref)
value = set_fptr_entry (output_bfd, info, dyn_i, value);
}
- if (!dyn_i->want_fptr || info->pie)
+ if (!dyn_i->want_fptr || bfd_link_pie (info))
{
long dynindx;
unsigned int dyn_r_type = r_type;
@@ -4291,7 +4291,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
case R_IA64_IPLTMSB:
case R_IA64_IPLTLSB:
/* Install a dynamic relocation for this reloc. */
- if ((dynamic_symbol_p || info->shared)
+ if ((dynamic_symbol_p || bfd_link_pic (info))
&& (input_section->flags & SEC_ALLOC) != 0)
{
BFD_ASSERT (srel != NULL);
@@ -4368,7 +4368,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
{
if (elf_hash_table (info)->tls_sec == NULL)
goto missing_tls_sec;
- if (!info->shared)
+ if (!bfd_link_pic (info))
value -= elfNN_ia64_tprel_base (info);
else
{
@@ -4379,7 +4379,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
got_r_type = R_IA64_TPREL64LSB;
break;
case R_IA64_LTOFF_DTPMOD22:
- if (!dynamic_symbol_p && !info->shared)
+ if (!dynamic_symbol_p && !bfd_link_pic (info))
value = 1;
got_r_type = R_IA64_DTPMOD64LSB;
break;