/* ELF STT_GNU_IFUNC support.
- Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
if (bed->plt_readonly)
pltflags |= SEC_READONLY;
- if (info->shared)
+ if (bfd_link_pic (info))
{
/* We need to create .rel[a].ifunc for shared objects. */
const char *rel_sec = (bed->rela_plts_and_copies_p
But in non-shared executable, the address of its .plt slot may
be used. Pointer equality may not work correctly. PIE should
be used if pointer equality is required here. */
- if (!info->shared
+ if (!bfd_link_pic (info)
&& (h->dynindx != -1
|| info->export_dynamic)
&& h->pointer_equality_needed)
/* When building shared library, we need to handle the case where it is
marked with regular reference, but not non-GOT reference since the
non-GOT reference bit may not be set here. */
- if (info->shared && !h->non_got_ref && h->ref_regular)
+ if (bfd_link_pic (info) && !h->non_got_ref && h->ref_regular)
for (p = *head; p != NULL; p = p->next)
if (p->count)
{
/* We need dynamic relocation for STT_GNU_IFUNC symbol only when
there is a non-GOT reference in a shared object. */
- if (!info->shared
+ if (!bfd_link_pic (info)
|| !h->non_got_ref)
*head = NULL;
objects at run-time.
We only need to relocate .got entry in shared object. */
if (h->got.refcount <= 0
- || (info->shared
+ || (bfd_link_pic (info)
&& (h->dynindx == -1
|| h->forced_local))
- || (!info->shared
+ || (!bfd_link_pic (info)
&& !h->pointer_equality_needed)
- || (info->executable && info->shared)
+ || bfd_link_pie (info)
|| htab->sgot == NULL)
{
/* Use .got.plt. */
{
h->got.offset = htab->sgot->size;
htab->sgot->size += got_entry_size;
- if (info->shared)
+ if (bfd_link_pic (info))
htab->srelgot->size += sizeof_reloc;
}