+2011-01-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf64-x86-64.c (elf_x86_64_link_hash_table): Add pointer_r_type.
+ (elf_x86_64_link_hash_table_create): Set pointer_r_type.
+ (elf_x86_64_check_relocs): Handle R_X86_64_32 like R_X86_64_64
+ for ILP32. Remove ABI_64_P PIC check for R_X86_64_8,
+ R_X86_64_16, R_X86_64_32 and R_X86_64_32S.
+ (elf_x86_64_relocate_section): Handle R_X86_64_32 like R_X86_64_64
+ for ILP32.
+
2011-01-14 Alan Modra <amodra@gmail.com>
* bfd.c (bfd_perror): Flush stdout before and stderr after printing
bfd_vma (*r_info) (bfd_vma, bfd_vma);
bfd_vma (*r_sym) (bfd_vma);
+ unsigned int pointer_r_type;
const char *dynamic_interpreter;
int dynamic_interpreter_size;
{
ret->r_info = elf64_r_info;
ret->r_sym = elf64_r_sym;
+ ret->pointer_r_type = R_X86_64_64;
ret->dynamic_interpreter = ELF64_DYNAMIC_INTERPRETER;
ret->dynamic_interpreter_size = sizeof ELF64_DYNAMIC_INTERPRETER;
}
{
ret->r_info = elf32_r_info;
ret->r_sym = elf32_r_sym;
+ ret->pointer_r_type = R_X86_64_32;
ret->dynamic_interpreter = ELF32_DYNAMIC_INTERPRETER;
ret->dynamic_interpreter_size = sizeof ELF32_DYNAMIC_INTERPRETER;
}
bfd_set_error (bfd_error_bad_value);
return FALSE;
+ case R_X86_64_32:
+ if (ABI_64_P (abfd))
+ goto not_pointer;
case R_X86_64_64:
h->non_got_ref = 1;
h->pointer_equality_needed = 1;
break;
case R_X86_64_32S:
- case R_X86_64_32:
case R_X86_64_PC32:
case R_X86_64_PC64:
+not_pointer:
h->non_got_ref = 1;
if (r_type != R_X86_64_PC32
&& r_type != R_X86_64_PC64)
}
goto create_got;
+ case R_X86_64_32:
+ if (!ABI_64_P (abfd))
+ goto pointer;
case R_X86_64_8:
case R_X86_64_16:
- case R_X86_64_32:
case R_X86_64_32S:
/* Let's help debug shared library creation. These relocs
cannot be used in shared libs. Don't error out for
sections we don't care about, such as debug sections or
non-constant sections. */
if (info->shared
- && ABI_64_P (abfd)
&& (sec->flags & SEC_ALLOC) != 0
&& (sec->flags & SEC_READONLY) != 0)
{
case R_X86_64_PC32:
case R_X86_64_PC64:
case R_X86_64_64:
+pointer:
if (h != NULL && info->executable)
{
/* If this reloc is in a read-only section, we might
abort ();
goto do_relocation;
+ case R_X86_64_32:
+ if (ABI_64_P (output_bfd))
+ goto do_relocation;
case R_X86_64_64:
if (rel->r_addend != 0)
{
continue;
}
- case R_X86_64_32:
case R_X86_64_PC32:
case R_X86_64_PC64:
case R_X86_64_PLT32:
else
{
/* This symbol is local, or marked to become local. */
- if (r_type == R_X86_64_64)
+ if (r_type == htab->pointer_r_type)
{
relocate = TRUE;
outrel.r_info = htab->r_info (0, R_X86_64_RELATIVE);