* elf32-arm.c (elf32_arm_final_link_relocate): Add cases
for R_ARM_ABS32_NOI and R_ARM_REL32_NOI. (elf32_arm_gc_sweep_hook): Likewise. (elf32_arm_check_relocs): Likewise. (allocate_dynrelocs): Likewise.
This commit is contained in:
parent
e1b5fdd47d
commit
bb224fc379
|
@ -1,3 +1,11 @@
|
||||||
|
2006-10-17 Mark Shinwell <shinwell@codesourcery.com>
|
||||||
|
|
||||||
|
* elf32-arm.c (elf32_arm_final_link_relocate): Add cases
|
||||||
|
for R_ARM_ABS32_NOI and R_ARM_REL32_NOI.
|
||||||
|
(elf32_arm_gc_sweep_hook): Likewise.
|
||||||
|
(elf32_arm_check_relocs): Likewise.
|
||||||
|
(allocate_dynrelocs): Likewise.
|
||||||
|
|
||||||
2006-10-17 Alan Modra <amodra@bigpond.net.au>
|
2006-10-17 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* elf-bfd.h (struct elf_link_hash_table): Reorder. Add
|
* elf-bfd.h (struct elf_link_hash_table): Reorder. Add
|
||||||
|
|
|
@ -3626,7 +3626,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
||||||
|
|
||||||
case R_ARM_PC24:
|
case R_ARM_PC24:
|
||||||
case R_ARM_ABS32:
|
case R_ARM_ABS32:
|
||||||
|
case R_ARM_ABS32_NOI:
|
||||||
case R_ARM_REL32:
|
case R_ARM_REL32:
|
||||||
|
case R_ARM_REL32_NOI:
|
||||||
case R_ARM_CALL:
|
case R_ARM_CALL:
|
||||||
case R_ARM_JUMP24:
|
case R_ARM_JUMP24:
|
||||||
case R_ARM_XPC25:
|
case R_ARM_XPC25:
|
||||||
|
@ -3642,7 +3644,8 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
||||||
will use the symbol's value, which may point to a PLT entry, but we
|
will use the symbol's value, which may point to a PLT entry, but we
|
||||||
don't need to handle that here. If we created a PLT entry, all
|
don't need to handle that here. If we created a PLT entry, all
|
||||||
branches in this object should go to it. */
|
branches in this object should go to it. */
|
||||||
if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32)
|
if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32
|
||||||
|
&& r_type != R_ARM_ABS32_NOI && r_type != R_ARM_REL32_NOI)
|
||||||
&& h != NULL
|
&& h != NULL
|
||||||
&& splt != NULL
|
&& splt != NULL
|
||||||
&& h->plt.offset != (bfd_vma) -1)
|
&& h->plt.offset != (bfd_vma) -1)
|
||||||
|
@ -3666,7 +3669,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
||||||
run time. */
|
run time. */
|
||||||
if ((info->shared || globals->root.is_relocatable_executable)
|
if ((info->shared || globals->root.is_relocatable_executable)
|
||||||
&& (input_section->flags & SEC_ALLOC)
|
&& (input_section->flags & SEC_ALLOC)
|
||||||
&& (r_type != R_ARM_REL32
|
&& ((r_type != R_ARM_REL32 && r_type != R_ARM_REL32_NOI)
|
||||||
|| !SYMBOL_CALLS_LOCAL (info, h))
|
|| !SYMBOL_CALLS_LOCAL (info, h))
|
||||||
&& (h == NULL
|
&& (h == NULL
|
||||||
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||||
|
@ -3898,6 +3901,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
||||||
value |= 1;
|
value |= 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case R_ARM_ABS32_NOI:
|
||||||
|
value += addend;
|
||||||
|
break;
|
||||||
|
|
||||||
case R_ARM_REL32:
|
case R_ARM_REL32:
|
||||||
value += addend;
|
value += addend;
|
||||||
if (sym_flags == STT_ARM_TFUNC)
|
if (sym_flags == STT_ARM_TFUNC)
|
||||||
|
@ -3906,6 +3913,12 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
||||||
+ input_section->output_offset + rel->r_offset);
|
+ input_section->output_offset + rel->r_offset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case R_ARM_REL32_NOI:
|
||||||
|
value += addend;
|
||||||
|
value -= (input_section->output_section->vma
|
||||||
|
+ input_section->output_offset + rel->r_offset);
|
||||||
|
break;
|
||||||
|
|
||||||
case R_ARM_PREL31:
|
case R_ARM_PREL31:
|
||||||
value -= (input_section->output_section->vma
|
value -= (input_section->output_section->vma
|
||||||
+ input_section->output_offset + rel->r_offset);
|
+ input_section->output_offset + rel->r_offset);
|
||||||
|
@ -6787,7 +6800,9 @@ elf32_arm_gc_sweep_hook (bfd * abfd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R_ARM_ABS32:
|
case R_ARM_ABS32:
|
||||||
|
case R_ARM_ABS32_NOI:
|
||||||
case R_ARM_REL32:
|
case R_ARM_REL32:
|
||||||
|
case R_ARM_REL32_NOI:
|
||||||
case R_ARM_PC24:
|
case R_ARM_PC24:
|
||||||
case R_ARM_PLT32:
|
case R_ARM_PLT32:
|
||||||
case R_ARM_CALL:
|
case R_ARM_CALL:
|
||||||
|
@ -6820,14 +6835,17 @@ elf32_arm_gc_sweep_hook (bfd * abfd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r_type == R_ARM_ABS32
|
if (r_type == R_ARM_ABS32
|
||||||
|| r_type == R_ARM_REL32)
|
|| r_type == R_ARM_REL32
|
||||||
|
|| r_type == R_ARM_ABS32_NOI
|
||||||
|
|| r_type == R_ARM_REL32_NOI)
|
||||||
{
|
{
|
||||||
for (pp = &eh->relocs_copied; (p = *pp) != NULL;
|
for (pp = &eh->relocs_copied; (p = *pp) != NULL;
|
||||||
pp = &p->next)
|
pp = &p->next)
|
||||||
if (p->section == sec)
|
if (p->section == sec)
|
||||||
{
|
{
|
||||||
p->count -= 1;
|
p->count -= 1;
|
||||||
if (ELF32_R_TYPE (rel->r_info) == R_ARM_REL32)
|
if (ELF32_R_TYPE (rel->r_info) == R_ARM_REL32
|
||||||
|
|| ELF32_R_TYPE (rel->r_info) == R_ARM_REL32_NOI)
|
||||||
p->pc_count -= 1;
|
p->pc_count -= 1;
|
||||||
if (p->count == 0)
|
if (p->count == 0)
|
||||||
*pp = p->next;
|
*pp = p->next;
|
||||||
|
@ -7005,7 +7023,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
|
|
||||||
case R_ARM_ABS32:
|
case R_ARM_ABS32:
|
||||||
|
case R_ARM_ABS32_NOI:
|
||||||
case R_ARM_REL32:
|
case R_ARM_REL32:
|
||||||
|
case R_ARM_REL32_NOI:
|
||||||
case R_ARM_PC24:
|
case R_ARM_PC24:
|
||||||
case R_ARM_PLT32:
|
case R_ARM_PLT32:
|
||||||
case R_ARM_CALL:
|
case R_ARM_CALL:
|
||||||
|
@ -7036,7 +7056,10 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||||
refers to is in a different object. We can't tell for
|
refers to is in a different object. We can't tell for
|
||||||
sure yet, because something later might force the
|
sure yet, because something later might force the
|
||||||
symbol local. */
|
symbol local. */
|
||||||
if (r_type != R_ARM_ABS32 && r_type != R_ARM_REL32)
|
if (r_type != R_ARM_ABS32
|
||||||
|
&& r_type != R_ARM_REL32
|
||||||
|
&& r_type != R_ARM_ABS32_NOI
|
||||||
|
&& r_type != R_ARM_REL32_NOI)
|
||||||
h->needs_plt = 1;
|
h->needs_plt = 1;
|
||||||
|
|
||||||
/* If we create a PLT entry, this relocation will reference
|
/* If we create a PLT entry, this relocation will reference
|
||||||
|
@ -7061,7 +7084,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||||
relocs_copied field of the hash table entry. */
|
relocs_copied field of the hash table entry. */
|
||||||
if ((info->shared || htab->root.is_relocatable_executable)
|
if ((info->shared || htab->root.is_relocatable_executable)
|
||||||
&& (sec->flags & SEC_ALLOC) != 0
|
&& (sec->flags & SEC_ALLOC) != 0
|
||||||
&& (r_type == R_ARM_ABS32
|
&& ((r_type == R_ARM_ABS32 || r_type == R_ARM_ABS32_NOI)
|
||||||
|| (h != NULL && ! h->needs_plt
|
|| (h != NULL && ! h->needs_plt
|
||||||
&& (! info->symbolic || ! h->def_regular))))
|
&& (! info->symbolic || ! h->def_regular))))
|
||||||
{
|
{
|
||||||
|
@ -7145,7 +7168,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||||
p->pc_count = 0;
|
p->pc_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r_type == R_ARM_REL32)
|
if (r_type == R_ARM_REL32 || r_type == R_ARM_REL32_NOI)
|
||||||
p->pc_count += 1;
|
p->pc_count += 1;
|
||||||
p->count += 1;
|
p->count += 1;
|
||||||
}
|
}
|
||||||
|
@ -7680,12 +7703,12 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||||
|
|
||||||
if (info->shared || htab->root.is_relocatable_executable)
|
if (info->shared || htab->root.is_relocatable_executable)
|
||||||
{
|
{
|
||||||
/* The only reloc that uses pc_count is R_ARM_REL32, which will
|
/* The only reloc thats uses pc_count are R_ARM_REL32 and
|
||||||
appear on something like ".long foo - .". We want calls to
|
R_ARM_REL32_NOI, which will appear on something like
|
||||||
protected symbols to resolve directly to the function rather
|
".long foo - .". We want calls to protected symbols to resolve
|
||||||
than going via the plt. If people want function pointer
|
directly to the function rather than going via the plt. If people
|
||||||
comparisons to work as expected then they should avoid
|
want function pointer comparisons to work as expected then they
|
||||||
writing assembly like ".long foo - .". */
|
should avoid writing assembly like ".long foo - .". */
|
||||||
if (SYMBOL_CALLS_LOCAL (info, h))
|
if (SYMBOL_CALLS_LOCAL (info, h))
|
||||||
{
|
{
|
||||||
struct elf32_arm_relocs_copied **pp;
|
struct elf32_arm_relocs_copied **pp;
|
||||||
|
|
Loading…
Reference in New Issue