diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 169b8b5e27..3d4dc40a33 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-08-26 Cupertino Miranda + + * elf32-arc.c (elf_arc_relocate_section): Changed. Set should_relocate + to TRUE for GOT and TLS relocs. + 2016-08-26 Cupertino Miranda * elf32-arc.c (elf_arc_finish_dynamic_sections): Changed. diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 5ba170e7fa..b726dab960 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1374,6 +1374,8 @@ elf_arc_relocate_section (bfd * output_bfd, if ((is_reloc_for_GOT (howto) || is_reloc_for_TLS (howto))) { + reloc_data.should_relocate = TRUE; + struct got_entry **list = get_got_entry_list_for_symbol (output_bfd, r_symndx, h); diff --git a/ld/ChangeLog b/ld/ChangeLog index 76c28631ff..bf186c5d26 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2016-08-26 Cupertino Miranda + + * ld/testsuite/ld-arc/tls_gd-01.s: Added a testcase for this patch. + * ld/testsuite/ld-arc/tls_gd-01.d: Likewise. + 2016-08-26 Cupertino Miranda * testsuite/ld-arc/tls_ie-01.s: Added to verify associated fix. diff --git a/ld/testsuite/ld-arc/tls_gd-01.d b/ld/testsuite/ld-arc/tls_gd-01.d new file mode 100644 index 0000000000..f7027afc81 --- /dev/null +++ b/ld/testsuite/ld-arc/tls_gd-01.d @@ -0,0 +1,13 @@ +#source: tls_gd-01.s +#as: -mcpu=arc700 +#ld: -shared +#objdump: -d + +[^:]+: file format elf32-littlearc + + +Disassembly of section \.text: + +[0-9a-f]+ <__start>: + [0-9a-f]+: 2700 7f80 0000 2080 add r0,pcl,0x2080 + [0-9a-f]+: 2700 7f80 0000 2080 add r0,pcl,0x2080 diff --git a/ld/testsuite/ld-arc/tls_gd-01.s b/ld/testsuite/ld-arc/tls_gd-01.s new file mode 100644 index 0000000000..5fbfc547eb --- /dev/null +++ b/ld/testsuite/ld-arc/tls_gd-01.s @@ -0,0 +1,7 @@ + .text + .align 4 + + .global __start +__start: + add r0, pcl, @baz@tlsgd + add r0, pcl, @bar@tlsgd