summaryrefslogtreecommitdiff
path: root/bfd/elf32-s390.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/elf32-s390.c
parentb2a33439909493f5bf93ada871bd588f365d61f4 (diff)
downloadbinutils-gdb-0e1862bb401f47716446aef143b2bf7a4563f541.tar.gz
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/elf32-s390.c')
-rw-r--r--bfd/elf32-s390.c100
1 files changed, 53 insertions, 47 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 19ba0442518..de37ca46cc5 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -856,11 +856,11 @@ elf_s390_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
htab->elf.splt = bfd_get_linker_section (dynobj, ".plt");
htab->elf.srelplt = bfd_get_linker_section (dynobj, ".rela.plt");
htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss");
- if (!info->shared)
+ if (!bfd_link_pic (info))
htab->srelbss = bfd_get_linker_section (dynobj, ".rela.bss");
if (!htab->elf.splt || !htab->elf.srelplt || !htab->sdynbss
- || (!info->shared && !htab->srelbss))
+ || (!bfd_link_pic (info) && !htab->srelbss))
abort ();
return TRUE;
@@ -937,7 +937,7 @@ elf_s390_tls_transition (struct bfd_link_info *info,
int r_type,
int is_local)
{
- if (info->shared)
+ if (bfd_link_pic (info))
return r_type;
switch (r_type)
@@ -978,7 +978,7 @@ elf_s390_check_relocs (bfd *abfd,
int tls_type, old_tls_type;
Elf_Internal_Sym *isym;
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
return TRUE;
BFD_ASSERT (is_s390_elf (abfd));
@@ -1177,7 +1177,7 @@ elf_s390_check_relocs (bfd *abfd,
case R_390_TLS_GOTIE20:
case R_390_TLS_GOTIE32:
case R_390_TLS_IEENT:
- if (info->shared)
+ if (bfd_link_pic (info))
info->flags |= DF_STATIC_TLS;
/* Fall through. */
@@ -1253,10 +1253,10 @@ elf_s390_check_relocs (bfd *abfd,
/* For static linking and executables this reloc will be
calculated at linktime otherwise a TLS_TPOFF runtime
reloc will be generated. */
- if (r_type == R_390_TLS_LE32 && info->pie)
+ if (r_type == R_390_TLS_LE32 && bfd_link_pie (info))
break;
- if (!info->shared)
+ if (!bfd_link_pic (info))
break;
info->flags |= DF_STATIC_TLS;
/* Fall through. */
@@ -1280,7 +1280,7 @@ elf_s390_check_relocs (bfd *abfd,
adjust_dynamic_symbol. */
h->non_got_ref = 1;
- if (!info->shared)
+ if (!bfd_link_pic (info))
{
/* We may need a .plt entry if the function this reloc
refers to is in a shared lib. */
@@ -1309,7 +1309,7 @@ elf_s390_check_relocs (bfd *abfd,
may need to keep relocations for symbols satisfied by a
dynamic library if we manage to avoid copy relocs for the
symbol. */
- if ((info->shared
+ if ((bfd_link_pic (info)
&& (sec->flags & SEC_ALLOC) != 0
&& ((ELF32_R_TYPE (rel->r_info) != R_390_PC16
&& ELF32_R_TYPE (rel->r_info) != R_390_PC12DBL
@@ -1322,7 +1322,7 @@ elf_s390_check_relocs (bfd *abfd,
|| h->root.type == bfd_link_hash_defweak
|| !h->def_regular))))
|| (ELIMINATE_COPY_RELOCS
- && !info->shared
+ && !bfd_link_pic (info)
&& (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak
@@ -1459,7 +1459,7 @@ elf_s390_gc_sweep_hook (bfd *abfd,
bfd_signed_vma *local_got_refcounts;
const Elf_Internal_Rela *rel, *relend;
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
return TRUE;
htab = elf_s390_hash_table (info);
@@ -1565,7 +1565,7 @@ elf_s390_gc_sweep_hook (bfd *abfd,
case R_390_PC24DBL:
case R_390_PC32DBL:
case R_390_PC32:
- if (info->shared)
+ if (bfd_link_pic (info))
break;
/* Fall through. */
@@ -1702,7 +1702,7 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info,
only references to the symbol are via the global offset table.
For such cases we need not do anything here; the relocations will
be handled correctly by relocate_section. */
- if (info->shared)
+ if (bfd_link_pic (info))
return TRUE;
/* If there are no references to this symbol that do not use the
@@ -1799,7 +1799,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
return FALSE;
}
- if (info->shared
+ if (bfd_link_pic (info)
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
{
asection *s = htab->elf.splt;
@@ -1816,7 +1816,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
location in the .plt. This is required to make function
pointers compare as equal between the normal executable and
the shared library. */
- if (! info->shared
+ if (! bfd_link_pic (info)
&& !h->def_regular)
{
h->root.u.def.section = s;
@@ -1852,7 +1852,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
to R_390_TLS_LE32 requiring no TLS entry. For GOTIE12 and IEENT
we can save the dynamic TLS relocation. */
if (h->got.refcount > 0
- && !info->shared
+ && !bfd_link_pic (info)
&& h->dynindx == -1
&& elf_s390_hash_entry(h)->tls_type >= GOT_TLS_IE)
{
@@ -1898,7 +1898,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
htab->elf.srelgot->size += 2 * sizeof (Elf32_External_Rela);
else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak)
- && (info->shared
+ && (bfd_link_pic (info)
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
htab->elf.srelgot->size += sizeof (Elf32_External_Rela);
}
@@ -1914,7 +1914,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
space for pc-relative relocs that have become local due to symbol
visibility changes. */
- if (info->shared)
+ if (bfd_link_pic (info))
{
if (SYMBOL_CALLS_LOCAL (info, h))
{
@@ -2039,7 +2039,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab->elf.dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
- if (info->executable)
+ if (bfd_link_executable (info))
{
s = bfd_get_linker_section (dynobj, ".interp");
if (s == NULL)
@@ -2107,7 +2107,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
s->size += GOT_ENTRY_SIZE;
if (*local_tls_type == GOT_TLS_GD)
s->size += GOT_ENTRY_SIZE;
- if (info->shared)
+ if (bfd_link_pic (info))
srela->size += sizeof (Elf32_External_Rela);
}
else
@@ -2216,7 +2216,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
#define add_dynamic_entry(TAG, VAL) \
_bfd_elf_add_dynamic_entry (info, TAG, VAL)
- if (info->executable)
+ if (bfd_link_executable (info))
{
if (!add_dynamic_entry (DT_DEBUG, 0))
return FALSE;
@@ -2432,7 +2432,7 @@ elf_s390_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;
switch (r_type)
@@ -2515,8 +2515,10 @@ elf_s390_relocate_section (bfd *output_bfd,
finish_dynamic_symbol. */
}
}
- else if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
- || (info->shared
+ else if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
+ bfd_link_pic (info),
+ h)
+ || (bfd_link_pic (info)
&& SYMBOL_REFERENCES_LOCAL (info, h))
|| (ELF_ST_VISIBILITY (h->other)
&& h->root.type == bfd_link_hash_undefweak))
@@ -2544,7 +2546,7 @@ elf_s390_relocate_section (bfd *output_bfd,
}
if ((h->def_regular
- && info->shared
+ && bfd_link_pic (info)
&& SYMBOL_REFERENCES_LOCAL (info, h))
/* lrl rx,sym@GOTENT -> larl rx, sym */
&& ((r_type == R_390_GOTENT
@@ -2593,7 +2595,7 @@ elf_s390_relocate_section (bfd *output_bfd,
bfd_put_32 (output_bfd, relocation,
htab->elf.sgot->contents + off);
- if (info->shared)
+ if (bfd_link_pic (info))
{
asection *srelgot;
Elf_Internal_Rela outrel;
@@ -2726,7 +2728,7 @@ elf_s390_relocate_section (bfd *output_bfd,
&& s390_is_ifunc_symbol_p (h)
&& h->def_regular)
{
- if (!info->shared || !h->non_got_ref)
+ if (!bfd_link_pic (info) || !h->non_got_ref)
{
/* For a non-shared object STT_GNU_IFUNC symbol must
go through PLT. */
@@ -2757,7 +2759,7 @@ elf_s390_relocate_section (bfd *output_bfd,
if (h->dynindx == -1
|| h->forced_local
- || info->executable)
+ || bfd_link_executable (info))
{
/* This symbol is resolved locally. */
outrel.r_info = ELF32_R_INFO (0, R_390_IRELATIVE);
@@ -2786,7 +2788,7 @@ elf_s390_relocate_section (bfd *output_bfd,
if ((input_section->flags & SEC_ALLOC) == 0)
break;
- if ((info->shared
+ if ((bfd_link_pic (info)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak)
@@ -2798,7 +2800,7 @@ elf_s390_relocate_section (bfd *output_bfd,
&& r_type != R_390_PC32)
|| !SYMBOL_CALLS_LOCAL (info, h)))
|| (ELIMINATE_COPY_RELOCS
- && !info->shared
+ && !bfd_link_pic (info)
&& h != NULL
&& h->dynindx != -1
&& !h->non_got_ref
@@ -2839,7 +2841,7 @@ elf_s390_relocate_section (bfd *output_bfd,
|| r_type == R_390_PC24DBL
|| r_type == R_390_PC32DBL
|| r_type == R_390_PC32
- || !info->shared
+ || !bfd_link_pic (info)
|| !SYMBOLIC_BIND (info, h)
|| !h->def_regular))
{
@@ -2909,7 +2911,7 @@ elf_s390_relocate_section (bfd *output_bfd,
/* Relocations for tls literal pool entries. */
case R_390_TLS_IE32:
- if (info->shared)
+ if (bfd_link_pic (info))
{
Elf_Internal_Rela outrel;
asection *sreloc;
@@ -2937,7 +2939,9 @@ elf_s390_relocate_section (bfd *output_bfd,
else if (h != NULL)
{
tls_type = elf_s390_hash_entry(h)->tls_type;
- if (!info->shared && h->dynindx == -1 && tls_type >= GOT_TLS_IE)
+ if (!bfd_link_pic (info)
+ && h->dynindx == -1
+ && tls_type >= GOT_TLS_IE)
r_type = R_390_TLS_LE32;
}
if (r_type == R_390_TLS_GD32 && tls_type >= GOT_TLS_IE)
@@ -3048,14 +3052,16 @@ elf_s390_relocate_section (bfd *output_bfd,
if (local_got_offsets == NULL)
abort();
off = local_got_offsets[r_symndx];
- if (info->shared)
+ if (bfd_link_pic (info))
goto emit_tls_relocs;
}
else
{
off = h->got.offset;
tls_type = elf_s390_hash_entry(h)->tls_type;
- if (info->shared || h->dynindx != -1 || tls_type < GOT_TLS_IE)
+ if (bfd_link_pic (info)
+ || h->dynindx != -1
+ || tls_type < GOT_TLS_IE)
goto emit_tls_relocs;
}
@@ -3072,7 +3078,7 @@ elf_s390_relocate_section (bfd *output_bfd,
break;
case R_390_TLS_LDM32:
- if (! info->shared)
+ if (! bfd_link_pic (info))
/* The literal pool entry this relocation refers to gets ignored
by the optimized code of the local exec model. Do nothing
and the value will turn out zero. */
@@ -3110,7 +3116,7 @@ elf_s390_relocate_section (bfd *output_bfd,
break;
case R_390_TLS_LE32:
- if (info->shared && !info->pie)
+ if (bfd_link_pic (info) && !bfd_link_pie (info))
{
/* Linking a shared library with non-fpic code requires
a R_390_TLS_TPOFF relocation. */
@@ -3147,7 +3153,7 @@ elf_s390_relocate_section (bfd *output_bfd,
continue;
case R_390_TLS_LDO32:
- if (info->shared || (input_section->flags & SEC_DEBUGGING))
+ if (bfd_link_pic (info) || (input_section->flags & SEC_DEBUGGING))
relocation -= dtpoff_base (info);
else
/* When converting LDO to LE, we must negate. */
@@ -3169,7 +3175,7 @@ elf_s390_relocate_section (bfd *output_bfd,
if (r_type == R_390_TLS_LOAD)
{
- if (!info->shared && (h == NULL || h->dynindx == -1))
+ if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
{
/* IE->LE transition. Four valid cases:
l %rx,0(0,%ry) -> lr %rx,%ry + bcr 0,0
@@ -3207,7 +3213,7 @@ elf_s390_relocate_section (bfd *output_bfd,
(insn & 0xffff0000) != 0xc0e50000 &&
(insn & 0xff000000) != 0x0d000000)
invalid_tls_insn (input_bfd, input_section, rel);
- if (!info->shared && (h == NULL || h->dynindx == -1))
+ if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
{
if ((insn & 0xff000000) == 0x0d000000)
{
@@ -3257,7 +3263,7 @@ elf_s390_relocate_section (bfd *output_bfd,
}
else if (r_type == R_390_TLS_LDCALL)
{
- if (!info->shared)
+ if (!bfd_link_pic (info))
{
unsigned int insn;
@@ -3422,7 +3428,7 @@ elf_s390_finish_ifunc_symbol (bfd *output_bfd,
= -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2);
/* Fill in the entry in the procedure linkage table. */
- if (!info->shared)
+ if (!bfd_link_pic (info))
{
memcpy (plt->contents + iplt_offset, elf_s390_plt_entry,
PLT_ENTRY_SIZE);
@@ -3505,7 +3511,7 @@ elf_s390_finish_ifunc_symbol (bfd *output_bfd,
if (!h
|| h->dynindx == -1
- || ((info->executable
+ || ((bfd_link_executable (info)
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
&& h->def_regular))
{
@@ -3584,7 +3590,7 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
= -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2);
/* Fill in the entry in the procedure linkage table. */
- if (!info->shared)
+ if (!bfd_link_pic (info))
{
memcpy (htab->elf.splt->contents + h->plt.offset, elf_s390_plt_entry,
PLT_ENTRY_SIZE);
@@ -3708,7 +3714,7 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
initialized in the relocate_section function. */
if (h->def_regular && s390_is_ifunc_symbol_p (h))
{
- if (info->shared)
+ if (bfd_link_pic (info))
{
/* An explicit GOT slot usage needs GLOB_DAT. If the
symbol references local the implicit got.iplt slot
@@ -3728,7 +3734,7 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
return TRUE;
}
}
- else if (info->shared
+ else if (bfd_link_pic (info)
&& SYMBOL_REFERENCES_LOCAL (info, h))
{
/* If this is a static link, or it is a -Bsymbolic link and
@@ -3870,7 +3876,7 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
if (htab->elf.splt && htab->elf.splt->size > 0)
{
memset (htab->elf.splt->contents, 0, PLT_FIRST_ENTRY_SIZE);
- if (info->shared)
+ if (bfd_link_pic (info))
{
memcpy (htab->elf.splt->contents, elf_s390_plt_pic_first_entry,
PLT_FIRST_ENTRY_SIZE);