pic patch for arm-elf
Daniel Jacobowitz
drow@mvista.com
Wed Oct 29 17:17:00 GMT 2003
On Sun, Oct 26, 2003 at 11:52:48PM +0000, Phil Blundell wrote:
> This patch implements GC for GOT and PLT relocs in the elf32-arm
> backend. One effect of this is to avoid a spurious R_ARM_NONE reloc
> which was blighting glibc by causing libc.so to be marked as
> DT_TEXTREL.
>
> It also replaces the code sequence used for PLT thunks with a more
> efficient version, which can make a significant difference on some
> processors.
>
> May I check this in?
Found a probem :(
> @@ -1134,16 +1307,21 @@ elf32_arm_final_link_relocate (howto, in
> #ifndef OLD_ARM_ABI
> case R_ARM_XPC25:
> #endif
> + /* r_symndx will be zero only for relocs against symbols
> + from removed linkonce sections, or sections discarded by
> + a linker script. */
> + if (r_symndx == 0
> + || (input_section->flags & SEC_ALLOC) == 0)
> + return bfd_reloc_ok;
> +
> /* When generating a shared object, these relocations are copied
> into the output file to be resolved at run time. */
> - if (info->shared
> - && r_symndx != 0
> - && (r_type != R_ARM_PC24
> - || (h != NULL
> - && h->dynindx != -1
> - && (! info->symbolic
> - || (h->elf_link_hash_flags
> - & ELF_LINK_HASH_DEF_REGULAR) == 0))))
> + if ((info->shared
> + && (h == NULL
> + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
> + || h->root.type != bfd_link_hash_undefweak)
> + && (r_type != R_ARM_PC24
> + || !SYMBOL_CALLS_LOCAL (info, h))))
> {
> Elf_Internal_Rela outrel;
> bfd_byte *loc;
What's the SEC_ALLOC check for? It breaks relocation of .debug_info.
I'm testing without it.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Binutils
mailing list