+2009-08-26 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * elf32-m68k.c (elf_m68k_copy_indirect_symbol): Propagate
+ non_got_ref value.
+ (elf_m68k_check_relocs): Handle dynamic TLS relocations.
+ Handle non_got_ref field.
+ (elf_m68k_adjust_dynamic_symbol): Handle non_got_ref field.
+
2009-08-26 Alan Modra <amodra@bigpond.net.au>
PR ld/10515
dir = elf_m68k_hash_entry (_dir);
ind = elf_m68k_hash_entry (_ind);
+ /* Any absolute non-dynamic relocations against an indirect or weak
+ definition will be against the target symbol. */
+ _dir->non_got_ref |= _ind->non_got_ref;
+
/* We might have a direct symbol already having entries in the GOTs.
Update its key only in case indirect symbol has GOT entries and
assert that both indirect and direct symbols don't have GOT entries
case R_68K_TLS_IE16:
case R_68K_TLS_IE32:
+ case R_68K_TLS_TPREL32:
+ case R_68K_TLS_DTPREL32:
+
+ if (ELF32_R_TYPE (rel->r_info) == R_68K_TLS_TPREL32
+ && info->shared)
+ /* Do the special chorus for libraries with static TLS. */
+ info->flags |= DF_STATIC_TLS;
+
/* This symbol requires a global offset table entry. */
if (dynobj == NULL)
/* Make sure a plt entry is created for this symbol if it
turns out to be a function defined by a dynamic object. */
h->plt.refcount++;
+
+ if (!info->shared)
+ /* This symbol needs a non-GOT reference. */
+ h->non_got_ref = 1;
}
/* If we are creating a shared library, we need to copy the
case R_68K_TLS_IE16:
case R_68K_TLS_IE32:
+ case R_68K_TLS_TPREL32:
+ case R_68K_TLS_DTPREL32:
+
if (got == NULL)
{
got = elf_m68k_get_bfd2got_entry (elf_m68k_multi_got (info),
if (info->shared)
return TRUE;
+ /* If there are no references to this symbol that do not use the
+ GOT, we don't need to generate a copy reloc. */
+ if (!h->non_got_ref)
+ return TRUE;
+
if (h->size == 0)
{
(*_bfd_error_handler) (_("dynamic variable `%s' is zero size"),