Module Name: src
Committed By: joerg
Date: Tue Jul 25 19:44:25 UTC 2017
Modified Files:
src/external/gpl3/binutils/dist/bfd: elfxx-sparc.c
Log Message:
TLS relocations for PIE and non-PIE main executable work the same, so
apply the same relaxation rules and the same static binding rules.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c
diff -u src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.11 src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.12
--- src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c:1.11 Wed Oct 26 18:42:52 2016
+++ src/external/gpl3/binutils/dist/bfd/elfxx-sparc.c Tue Jul 25 19:44:25 2017
@@ -1330,7 +1330,7 @@ sparc_elf_tls_transition (struct bfd_lin
&& ! _bfd_sparc_elf_tdata (abfd)->has_tlsgd)
r_type = R_SPARC_REV32;
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
return r_type;
switch (r_type)
@@ -1501,13 +1501,13 @@ _bfd_sparc_elf_check_relocs (bfd *abfd,
case R_SPARC_TLS_LE_HIX22:
case R_SPARC_TLS_LE_LOX10:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
goto r_sparc_plt32;
break;
case R_SPARC_TLS_IE_HI22:
case R_SPARC_TLS_IE_LO10:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
info->flags |= DF_STATIC_TLS;
/* Fall through */
@@ -2334,7 +2334,7 @@ allocate_dynrelocs (struct elf_link_hash
/* If R_SPARC_TLS_IE_{HI22,LO10} symbol is now local to the binary,
make it a R_SPARC_TLS_LE_{HI22,LO10} requiring no TLS entry. */
if (h->got.refcount > 0
- && !bfd_link_pic (info)
+ && !bfd_link_dll (info)
&& h->dynindx == -1
&& _bfd_sparc_elf_hash_entry(h)->tls_type == GOT_TLS_IE)
h->got.offset = (bfd_vma) -1;
@@ -3582,7 +3582,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
else if (h != NULL)
{
tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type;
- if (!bfd_link_pic (info)
+ if (!bfd_link_dll (info)
&& h->dynindx == -1
&& tls_type == GOT_TLS_IE)
switch (SPARC_ELF_R_TYPE (rel->r_info))
@@ -3706,7 +3706,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
case R_SPARC_TLS_LDM_HI22:
case R_SPARC_TLS_LDM_LO10:
- if (! bfd_link_pic (info))
+ if (! bfd_link_dll (info))
{
bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset);
continue;
@@ -3717,7 +3717,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
case R_SPARC_TLS_LDO_HIX22:
case R_SPARC_TLS_LDO_LOX10:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
{
relocation -= dtpoff_base (info);
break;
@@ -3729,7 +3729,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
case R_SPARC_TLS_LE_HIX22:
case R_SPARC_TLS_LE_LOX10:
- if (bfd_link_pic (info))
+ if (bfd_link_dll (info))
{
Elf_Internal_Rela outrel;
bfd_boolean skip;
@@ -3761,7 +3761,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
break;
case R_SPARC_TLS_LDM_CALL:
- if (! bfd_link_pic (info))
+ if (! bfd_link_dll (info))
{
/* mov %g0, %o0 */
bfd_put_32 (output_bfd, 0x90100000, contents + rel->r_offset);
@@ -3775,13 +3775,13 @@ _bfd_sparc_elf_relocate_section (bfd *ou
tls_type = _bfd_sparc_elf_local_got_tls_type (input_bfd) [r_symndx];
else if (h != NULL)
tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type;
- if (! bfd_link_pic (info)
+ if (! bfd_link_dll (info)
|| (r_type == R_SPARC_TLS_GD_CALL && tls_type == GOT_TLS_IE))
{
Elf_Internal_Rela *rel2;
bfd_vma insn;
- if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
+ if (!bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
{
/* GD -> LE */
bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset);
@@ -3868,12 +3868,12 @@ _bfd_sparc_elf_relocate_section (bfd *ou
continue;
case R_SPARC_TLS_LDM_ADD:
- if (! bfd_link_pic (info))
+ if (! bfd_link_dll (info))
bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset);
continue;
case R_SPARC_TLS_LDO_ADD:
- if (! bfd_link_pic (info))
+ if (! bfd_link_dll (info))
{
/* Change rs1 into %g7. */
bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
@@ -3884,7 +3884,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
case R_SPARC_TLS_IE_LD:
case R_SPARC_TLS_IE_LDX:
- if (! bfd_link_pic (info) && (h == NULL || h->dynindx == -1))
+ if (! bfd_link_dll (info) && (h == NULL || h->dynindx == -1))
{
bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
int rs2 = insn & 0x1f;