/* IBM S/390-specific support for 32-bit ELF
- Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ Copyright (C) 2000-2015 Free Software Foundation, Inc.
Contributed by Carl B. Pedersen and Martin Schwidefsky.
This file is part of BFD, the Binary File Descriptor library.
{
HOWTO (R_390_NONE, /* type */
0, /* rightshift */
- 0, /* size (0 = byte, 1 = 2 byte, 2 = 4 byte) */
+ 3, /* size (0 = byte, 1 = 2 byte, 2 = 4 byte) */
0, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
/* Fall through. */
case R_390_TLS_LE32:
+ /* 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)
+ break;
+
if (!info->shared)
break;
info->flags |= DF_STATIC_TLS;
s = htab->sdynbss;
- return _bfd_elf_adjust_dynamic_copy (h, s);
+ return _bfd_elf_adjust_dynamic_copy (info, h, s);
}
/* Allocate space in .plt, .got and associated reloc sections for
break;
case R_390_TLS_LE32:
- if (info->shared)
+ if (info->shared && !info->pie)
{
/* Linking a shared library with non-fpic code requires
a R_390_TLS_TPOFF relocation. */
#define elf_backend_grok_prstatus elf_s390_grok_prstatus
#define elf_backend_plt_sym_val elf_s390_plt_sym_val
#define elf_backend_add_symbol_hook elf_s390_add_symbol_hook
+#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p
#define bfd_elf32_mkobject elf_s390_mkobject
#define elf_backend_object_p elf_s390_object_p