/* The type of PLT to use. */
const struct elf_sh_plt_info *plt_info;
- /* True if the target system is VxWorks. */
- bfd_boolean vxworks_p;
-
/* True if the target system uses FDPIC. */
bfd_boolean fdpic_p;
};
return NULL;
}
- ret->vxworks_p = vxworks_object_p (abfd);
ret->fdpic_p = fdpic_object_p (abfd);
return &ret->root.root;
}
}
- if (htab->vxworks_p)
+ if (htab->root.target_os == is_vxworks)
{
if (!elf_vxworks_create_dynamic_sections (abfd, info, &htab->srelplt2))
return FALSE;
/* We also need to make an entry in the .rel.plt section. */
htab->root.srelplt->size += sizeof (Elf32_External_Rela);
- if (htab->vxworks_p && !bfd_link_pic (info))
+ if (htab->root.target_os == is_vxworks && !bfd_link_pic (info))
{
/* VxWorks executables have a second set of relocations
for each PLT entry. They go in a separate relocation
}
}
- if (htab->vxworks_p)
+ if (htab->root.target_os == is_vxworks)
{
struct elf_dyn_relocs **pp;
linker script /DISCARD/, so we'll be discarding
the relocs too. */
}
- else if (htab->vxworks_p
+ else if (htab->root.target_os == is_vxworks
&& strcmp (p->sec->output_section->name,
".tls_vars") == 0)
{
return FALSE;
}
}
- if (htab->vxworks_p
+ if (htab->root.target_os == is_vxworks
&& !elf_vxworks_add_dynamic_entries (output_bfd, info))
return FALSE;
}
/* We have to handle relocations in vxworks .tls_vars sections
specially, because the dynamic loader is 'weird'. */
- is_vxworks_tls = (htab && htab->vxworks_p && bfd_link_pic (info)
+ is_vxworks_tls = (htab && htab->root.target_os == is_vxworks && bfd_link_pic (info)
&& !strcmp (input_section->output_section->name,
".tls_vars"));
(splt->contents
+ h->plt.offset
+ plt_info->symbol_fields.got_entry));
- if (htab->vxworks_p)
+ if (htab->root.target_os == is_vxworks)
{
unsigned int reachable_plts, plts_per_4k;
int distance;
loc = srelplt->contents + plt_index * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
- if (htab->vxworks_p && !bfd_link_pic (info))
+ if (htab->root.target_os == is_vxworks && !bfd_link_pic (info))
{
/* Create the .rela.plt.unloaded relocations for this PLT entry.
Begin by pointing LOC to the first such relocation. */
_GLOBAL_OFFSET_TABLE_ is not absolute: it is relative to the
".got" section. */
if (h == htab->root.hdynamic
- || (!htab->vxworks_p && h == htab->root.hgot))
+ || (htab->root.target_os != is_vxworks && h == htab->root.hgot))
sym->st_shndx = SHN_ABS;
return TRUE;
switch (dyn.d_tag)
{
default:
- if (htab->vxworks_p
+ if (htab->root.target_os == is_vxworks
&& elf_vxworks_finish_dynamic_entry (output_bfd, &dyn))
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
(splt->contents
+ htab->plt_info->plt0_got_fields[i]));
- if (htab->vxworks_p)
+ if (htab->root.target_os == is_vxworks)
{
/* Finalize the .rela.plt.unloaded contents. */
Elf_Internal_Rela rel;
#define ELF_MAXPAGESIZE 0x1000
#undef ELF_COMMONPAGESIZE
+#undef ELF_TARGET_OS
+#define ELF_TARGET_OS is_vxworks
+
#include "elf32-target.h"
#endif /* not SH_TARGET_ALREADY_DEFINED */