+2019-04-11 Tamar Christina <tamar.christina@arm.com>
+
+ PR ld/24302
+ * elfnn-aarch64.c (elfNN_aarch64_size_dynamic_sections): Don't emit
+ DT_TLSDESC_GOT and DT_TLSDESC_PLT when DF_BIND_NOW.
+ (elfNN_aarch64_finish_dynamic_sections): Don't write PLT if DF_BIND_NOW.
+
2019-04-10 Michael Forney <mforney@mforney.org>
PR 24427
if (htab->root.splt->size == 0)
htab->root.splt->size += htab->plt_header_size;
- htab->tlsdesc_plt = htab->root.splt->size;
- htab->root.splt->size += htab->tlsdesc_plt_entry_size;
-
/* If we're not using lazy TLS relocations, don't generate the
- GOT entry required. */
+ GOT and PLT entry required. */
if (!(info->flags & DF_BIND_NOW))
{
+ htab->tlsdesc_plt = htab->root.splt->size;
+ htab->root.splt->size += htab->tlsdesc_plt_entry_size;
+
htab->dt_tlsdesc_got = htab->root.sgot->size;
htab->root.sgot->size += GOT_ENTRY_SIZE;
}
return FALSE;
if (htab->tlsdesc_plt
+ && !(info->flags & DF_BIND_NOW)
&& (!add_dynamic_entry (DT_TLSDESC_PLT, 0)
|| !add_dynamic_entry (DT_TLSDESC_GOT, 0)))
return FALSE;
case DT_TLSDESC_GOT:
s = htab->root.sgot;
+ BFD_ASSERT (htab->dt_tlsdesc_got != (bfd_vma)-1);
dyn.d_un.d_ptr = s->output_section->vma + s->output_offset
+ htab->dt_tlsdesc_got;
break;
this_hdr.sh_entsize = htab->plt_entry_size;
- if (htab->tlsdesc_plt)
+ if (htab->tlsdesc_plt && !(info->flags & DF_BIND_NOW))
{
+ BFD_ASSERT (htab->dt_tlsdesc_got != (bfd_vma)-1);
bfd_put_NN (output_bfd, (bfd_vma) 0,
htab->root.sgot->contents + htab->dt_tlsdesc_got);
+2019-04-11 Tamar Christina <tamar.christina@arm.com>
+
+ PR ld/24302
+ * testsuite/ld-aarch64/aarch64-elf.exp: Add new test.
+ * testsuite/ld-aarch64/tls-relax-gdesc-le-now.d: New test.
+
2019-04-10 H.J. Lu <hongjiu.lu@intel.com>
* scripttempl/elf.sc (CREATE_PIC): New. Set for CREATE_SHLIB or
run_dump_test "tls-relax-gd-le"
run_dump_test "tls-relax-gd-le-ilp32"
run_dump_test "tls-relax-gdesc-le"
+run_dump_test "tls-relax-gdesc-le-now"
run_dump_test "tls-relax-gdesc-le-ilp32"
run_dump_test "tls-relax-gd-ie"
run_dump_test "tls-relax-gd-ie-ilp32"
--- /dev/null
+#source: tls-relax-gdesc-le.s
+#ld: -shared -z now
+#readelf: -dr
+#...
+ 0x.+ \(STRTAB\) \s+0x.+
+ 0x.+ \(SYMTAB\) \s+0x.+
+ 0x.+ \(STRSZ\) \s+.+ \(bytes\)
+ 0x.+ \(SYMENT\) \s+.+ \(bytes\)
+ 0x.+ \(PLTGOT\) \s+0x.+
+ 0x.+ \(PLTRELSZ\) \s+.+ \(bytes\)
+ 0x.+ \(PLTREL\) \s+RELA
+ 0x.+ \(JMPREL\) \s+0x.+
+ 0x.+ \(BIND_NOW\) \s+
+ 0x.+ \(FLAGS_1\) \s+ Flags: NOW
+ 0x.+ \(NULL\) \s+ 0x0
+
+Relocation section '\.rela\.plt' at offset .+ contains 1 entry:
+ Offset Info Type Sym\. Value Sym\. Name \+ Addend
+.+ .+ R_AARCH64_TLSDESC 0