/* FRV-specific support for 32-bit ELF.
- Copyright (C) 2002-2015 Free Software Foundation, Inc.
+ Copyright (C) 2002-2016 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* If we're linking an executable at a fixed address, we can
omit the dynamic relocation as long as the symbol is local to
this module. */
- if (bfd_link_executable (info) && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& (entry->symndx != -1
|| FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
{
if (entry->symndx == -1
&& ! FRVFDPIC_FUNCDESC_LOCAL (info, entry->d.h)
&& FRVFDPIC_SYM_LOCAL (info, entry->d.h)
- && !(bfd_link_executable (info) && !bfd_link_pic (info)))
+ && !bfd_link_pde (info))
{
reloc = R_FRV_FUNCDESC;
idx = elf_section_data (entry->d.h->root.u.def.section
dynamic symbol entry for the got section, so idx will be
zero, which means we can and should compute the address
of the private descriptor ourselves. */
- if (bfd_link_executable (info) && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& (entry->symndx != -1
|| FRVFDPIC_FUNCDESC_LOCAL (info, entry->d.h)))
{
/* If we're linking an executable at a fixed address, we can
omit the dynamic relocation as long as the symbol is local to
this module. */
- if (bfd_link_executable (info) && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& (entry->symndx != -1 || FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
{
if (sec)
/* If we've omitted the dynamic relocation, just emit the fixed
addresses of the symbol and of the local GOT base offset. */
- if (bfd_link_executable (info)
- && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& sec
&& sec->output_section)
{
if (bfd_link_executable (info) && ! entry->tlsoff_entry)
entry->tlsoff_entry = entry->tlsdesc_entry + 4;
- if (bfd_link_executable (info) && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& ((idx == 0
&& (bfd_is_abs_section (sec)
|| bfd_is_und_section (sec)))
section+offset. */
if (h && ! FRVFDPIC_FUNCDESC_LOCAL (info, h)
&& FRVFDPIC_SYM_LOCAL (info, h)
- && !(bfd_link_executable (info)
- && !bfd_link_pic (info)))
+ && !bfd_link_pde (info))
{
dynindx = elf_section_data (h->root.u.def.section
->output_section)->dynindx;
dynamic symbol entry for the got section, so idx will
be zero, which means we can and should compute the
address of the private descriptor ourselves. */
- if (bfd_link_executable (info) && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& (!h || FRVFDPIC_FUNCDESC_LOCAL (info, h)))
{
addend += frvfdpic_got_section (info)->output_section->vma;
can omit the dynamic relocation as long as the symbol
is defined in the current link unit (which is implied
by its output section not being NULL). */
- if (bfd_link_executable (info) && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& (!h || FRVFDPIC_SYM_LOCAL (info, h)))
{
if (osec)
/* If we've omitted the dynamic relocation, just emit
the fixed addresses of the symbol and of the local
GOT base offset. */
- if (bfd_link_executable (info) && !bfd_link_pic (info)
+ if (bfd_link_pde (info)
&& (!h || FRVFDPIC_SYM_LOCAL (info, h)))
bfd_put_32 (output_bfd,
frvfdpic_got_section (info)->output_section->vma
switch (r)
{
case bfd_reloc_overflow:
- r = info->callbacks->reloc_overflow
+ (*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
- r = info->callbacks->undefined_symbol
+ (*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE);
break;
input_bfd, input_section, rel->r_offset, name, msg);
return FALSE;
}
-
- if (! r)
- return FALSE;
}
}
{
bfd_vma relocs = 0, fixups = 0, tlsrets = 0;
- if (!bfd_link_executable (dinfo->info) || bfd_link_pie (dinfo->info))
+ if (!bfd_link_pde (dinfo->info))
{
relocs = entry->relocs32 + entry->relocsfd + entry->relocsfdv
+ entry->relocstlsd;
+ 32768) < (bfd_vma)65536))
|| (entry->symndx != -1
&& (elf_hash_table (dinfo->info)->tls_sec->size
- + abs (entry->addend) < 32768 + FRVFDPIC_TLS_BIAS))))
+ + entry->addend < 32768 + FRVFDPIC_TLS_BIAS))))
{
if (! changed)
{
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
- if (bfd_link_executable (info))
+ if (bfd_link_executable (info) && !info->nointerp)
{
s = bfd_get_linker_section (dynobj, ".interp");
BFD_ASSERT (s != NULL);