SEC_DEBUGGING relocs
Alan Modra
amodra@bigpond.net.au
Thu Jul 11 04:07:00 GMT 2002
Aughh. SEC_DEBUGGING relocs bite again.
powerpc64-linux-gcc -o smtpd smtpd.o address_check.o -lresolv
ld: smtpd.o(.debug_info+0x4b43): unresolvable relocation against symbol
`optind@@GLIBC_2.2.5'
I've also updated the FIXME comment that I wrote in elf32-i386.c a
long time ago. Someone correct me if the new one is wrong, please.
bfd/ChangeLog
* elf32-i386.c (elf_i386_relocate_section): Don't complain about
unresolved debugging relocs on dynamic applications.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.74
diff -u -p -r1.74 elf32-i386.c
--- bfd/elf32-i386.c 1 Jul 2002 08:06:44 -0000 1.74
+++ bfd/elf32-i386.c 11 Jul 2002 05:29:08 -0000
@@ -2737,14 +2737,11 @@ elf_i386_relocate_section (output_bfd, i
break;
}
- /* FIXME: Why do we allow debugging sections to escape this error?
- More importantly, why do we not emit dynamic relocs for
- R_386_32 above in debugging sections (which are ! SEC_ALLOC)?
- If we had emitted the dynamic reloc, we could remove the
- fudge here. */
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
- && !(info->shared
- && (input_section->flags & SEC_DEBUGGING) != 0
+ && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
Index: bfd/elf32-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-s390.c,v
retrieving revision 1.27
diff -u -p -r1.27 elf32-s390.c
--- bfd/elf32-s390.c 1 Jul 2002 08:06:44 -0000 1.27
+++ bfd/elf32-s390.c 11 Jul 2002 05:29:10 -0000
@@ -1971,9 +1971,11 @@ elf_s390_relocate_section (output_bfd, i
break;
}
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
- && !(info->shared
- && (input_section->flags & SEC_DEBUGGING) != 0
+ && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
Index: bfd/elf32-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sparc.c,v
retrieving revision 1.39
diff -u -p -r1.39 elf32-sparc.c
--- bfd/elf32-sparc.c 1 Jul 2002 08:06:44 -0000 1.39
+++ bfd/elf32-sparc.c 11 Jul 2002 05:29:12 -0000
@@ -1561,10 +1561,11 @@ elf32_sparc_relocate_section (output_bfd
break;
}
- /* ??? Copied from elf32-i386.c, debugging section check and all. */
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
- && !(info->shared
- && (input_section->flags & SEC_DEBUGGING) != 0
+ && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.58
diff -u -p -r1.58 elf64-ppc.c
--- bfd/elf64-ppc.c 10 Jul 2002 11:46:19 -0000 1.58
+++ bfd/elf64-ppc.c 11 Jul 2002 05:29:15 -0000
@@ -5907,13 +5907,11 @@ ppc64_elf_relocate_section (output_bfd,
break;
}
- /* FIXME: Why do we allow debugging sections to escape this error?
- More importantly, why do we not emit dynamic relocs above in
- debugging sections (which are ! SEC_ALLOC)? If we had
- emitted the dynamic reloc, we could remove the fudge here. */
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
- && !(info->shared
- && (input_section->flags & SEC_DEBUGGING) != 0
+ && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
{
(*_bfd_error_handler)
Index: bfd/elf64-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-s390.c,v
retrieving revision 1.28
diff -u -p -r1.28 elf64-s390.c
--- bfd/elf64-s390.c 2 Jul 2002 09:05:51 -0000 1.28
+++ bfd/elf64-s390.c 11 Jul 2002 05:29:18 -0000
@@ -1935,9 +1935,11 @@ elf_s390_relocate_section (output_bfd, i
break;
}
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
- && !(info->shared
- && (input_section->flags & SEC_DEBUGGING) != 0
+ && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
Index: bfd/elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.57
diff -u -p -r1.57 elf64-sparc.c
--- bfd/elf64-sparc.c 10 Jul 2002 04:59:42 -0000 1.57
+++ bfd/elf64-sparc.c 11 Jul 2002 05:29:21 -0000
@@ -2568,9 +2568,11 @@ sparc64_elf_relocate_section (output_bfd
break;
}
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
- && !(info->shared
- && (input_section->flags & SEC_DEBUGGING) != 0
+ && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
Index: bfd/elf64-x86-64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-x86-64.c,v
retrieving revision 1.46
diff -u -p -r1.46 elf64-x86-64.c
--- bfd/elf64-x86-64.c 1 Jul 2002 08:47:13 -0000 1.46
+++ bfd/elf64-x86-64.c 11 Jul 2002 05:29:22 -0000
@@ -1938,14 +1938,11 @@ elf64_x86_64_relocate_section (output_bf
break;
}
- /* FIXME: Why do we allow debugging sections to escape this error?
- More importantly, why do we not emit dynamic relocs for
- R_386_32 above in debugging sections (which are ! SEC_ALLOC)?
- If we had emitted the dynamic reloc, we could remove the
- fudge here. */
+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
- && !(info->shared
- && (input_section->flags & SEC_DEBUGGING) != 0
+ && !((input_section->flags & SEC_DEBUGGING) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
(*_bfd_error_handler)
(_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"),
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list