This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: pic patch for arm-elf
On Wed, Oct 29, 2003 at 12:17:26PM -0500, Daniel Jacobowitz wrote:
> What's the SEC_ALLOC check for? It breaks relocation of .debug_info.
> I'm testing without it.
I suggest this patch. Rather than silently discarding non-SEC_ALLOC
relocations, just be sure not to emit them into the resulting shared
object.
(Some platforms do emit them; see the archives for heated discussion.
But the code in place for emitting such relocations in elf32-arm.h
can't handle this case, and ARM didn't used to emit them, so I chose
the path of least resistance.)
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-10-29 Daniel Jacobowitz <drow@mvista.com>
* elf32-arm.h (elf32_arm_final_link_relocate): Move check for
SEC_ALLOC.
--- binutils-2.14/bfd/elf32-arm.h.orig 2003-10-29 12:46:06.000000000 -0500
+++ binutils-2.14/bfd/elf32-arm.h 2003-10-29 12:45:56.000000000 -0500
@@ -1329,8 +1329,7 @@ elf32_arm_final_link_relocate (howto, in
/* 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)
+ if (r_symndx == 0)
return bfd_reloc_ok;
if ((r_type == R_ARM_PLT32 || r_type == R_ARM_PC24)
@@ -1356,6 +1355,7 @@ elf32_arm_final_link_relocate (howto, in
/* When generating a shared object, these relocations are copied
into the output file to be resolved at run time. */
if ((info->shared
+ && (input_section->flags & SEC_ALLOC)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak)