TPREL in a PIE image.
(alpha_dynamic_entries_for_reloc): Likewise.
(elf64_alpha_relocate_section): Allow TPREL in PIE images.
(elf64_alpha_relax_got_load): Likewise.
+2011-06-22 Richard Henderson <rth@redhat.com>
+
+ * elf64-alpha.c (elf64_alpha_check_relocs): No dynamic reloc for
+ TPREL in a PIE image.
+ (alpha_dynamic_entries_for_reloc): Likewise.
+ (elf64_alpha_relocate_section): Allow TPREL in PIE images.
+ (elf64_alpha_relax_got_load): Likewise.
+
2011-06-22 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
* elf32-arm.c (elf32_arm_final_link_relocate): Allow R_ARM_TLS_LE32
2011-06-22 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
* elf32-arm.c (elf32_arm_final_link_relocate): Allow R_ARM_TLS_LE32
break;
case R_ALPHA_TPREL64:
break;
case R_ALPHA_TPREL64:
- if (info->shared || maybe_dynamic)
+ if (info->shared && !info->pie)
+ {
+ info->flags |= DF_STATIC_TLS;
+ need = NEED_DYNREL;
+ }
+ else if (maybe_dynamic)
- if (info->shared)
- info->flags |= DF_STATIC_TLS;
/* The number of dynamic relocations required by a static relocation. */
static int
/* The number of dynamic relocations required by a static relocation. */
static int
-alpha_dynamic_entries_for_reloc (int r_type, int dynamic, int shared)
+alpha_dynamic_entries_for_reloc (int r_type, int dynamic, int shared, int pie)
case R_ALPHA_TLSLDM:
return shared;
case R_ALPHA_LITERAL:
case R_ALPHA_TLSLDM:
return shared;
case R_ALPHA_LITERAL:
return dynamic || shared;
return dynamic || shared;
+ case R_ALPHA_GOTTPREL:
+ return dynamic || (shared && !pie);
case R_ALPHA_GOTDTPREL:
return dynamic;
/* May appear in data sections. */
case R_ALPHA_REFLONG:
case R_ALPHA_REFQUAD:
case R_ALPHA_GOTDTPREL:
return dynamic;
/* May appear in data sections. */
case R_ALPHA_REFLONG:
case R_ALPHA_REFQUAD:
return dynamic || shared;
return dynamic || shared;
+ case R_ALPHA_TPREL64:
+ return dynamic || (shared && !pie);
/* Everything else is illegal. We'll issue an error during
relocate_section. */
/* Everything else is illegal. We'll issue an error during
relocate_section. */
for (relent = h->reloc_entries; relent; relent = relent->next)
{
entries = alpha_dynamic_entries_for_reloc (relent->rtype, dynamic,
for (relent = h->reloc_entries; relent; relent = relent->next)
{
entries = alpha_dynamic_entries_for_reloc (relent->rtype, dynamic,
+ info->shared, info->pie);
if (entries)
{
relent->srel->size +=
if (entries)
{
relent->srel->size +=
entries = 0;
for (gotent = h->got_entries; gotent ; gotent = gotent->next)
if (gotent->use_count > 0)
entries = 0;
for (gotent = h->got_entries; gotent ; gotent = gotent->next)
if (gotent->use_count > 0)
- entries += alpha_dynamic_entries_for_reloc (gotent->reloc_type,
- dynamic, info->shared);
+ entries += alpha_dynamic_entries_for_reloc (gotent->reloc_type, dynamic,
+ info->shared, info->pie);
gotent ; gotent = gotent->next)
if (gotent->use_count > 0)
entries += (alpha_dynamic_entries_for_reloc
gotent ; gotent = gotent->next)
if (gotent->use_count > 0)
entries += (alpha_dynamic_entries_for_reloc
- (gotent->reloc_type, 0, info->shared));
+ (gotent->reloc_type, 0, info->shared, info->pie));
return TRUE;
/* Can't use local-exec relocations in shared libraries. */
return TRUE;
/* Can't use local-exec relocations in shared libraries. */
- if (r_type == R_ALPHA_GOTTPREL && info->link_info->shared)
+ if (r_type == R_ALPHA_GOTTPREL
+ && (info->link_info->shared && !info->link_info->pie))
return TRUE;
if (r_type == R_ALPHA_LITERAL)
return TRUE;
if (r_type == R_ALPHA_LITERAL)
else if (r_type == R_ALPHA_TPREL64)
{
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
else if (r_type == R_ALPHA_TPREL64)
{
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
+ if (!info->shared || info->pie)
{
value -= tp_base;
goto default_reloc;
{
value -= tp_base;
goto default_reloc;
case R_ALPHA_TPRELHI:
case R_ALPHA_TPRELLO:
case R_ALPHA_TPREL16:
case R_ALPHA_TPRELHI:
case R_ALPHA_TPRELLO:
case R_ALPHA_TPREL16:
+ if (info->shared && !info->pie)
{
(*_bfd_error_handler)
(_("%B: TLS local exec code cannot be linked into shared objects"),
{
(*_bfd_error_handler)
(_("%B: TLS local exec code cannot be linked into shared objects"),