From 239e1f3afa2f6bc24acde3b81481f933b40a3531 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 11 Jul 2002 05:33:28 +0000 Subject: [PATCH] * elf32-i386.c (elf_i386_relocate_section): Don't complain about unresolved debugging relocs in 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. --- bfd/ChangeLog | 11 +++++++++++ bfd/elf32-i386.c | 11 ++++------- bfd/elf32-s390.c | 6 ++++-- bfd/elf32-sparc.c | 7 ++++--- bfd/elf64-ppc.c | 10 ++++------ bfd/elf64-s390.c | 6 ++++-- bfd/elf64-sparc.c | 6 ++++-- bfd/elf64-x86-64.c | 11 ++++------- 8 files changed, 39 insertions(+), 29 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 126085fc81f..3dc0f25408c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2002-07-11 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Don't complain about + unresolved debugging relocs in 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. + 2002-07-10 Alan Modra * elf64-ppc.c (ONES): Define. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 1e886a59335..f8b64d577ab 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2737,14 +2737,11 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, 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'"), diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index d6d7adaf513..5879995164f 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1971,9 +1971,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, 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'"), diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 3a78f5f758a..38200dc04bf 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -1561,10 +1561,11 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, 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'"), diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 43126207b81..9ed037f5279 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -5907,13 +5907,11 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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) diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index c4e4f6891f9..6e7b5d94c20 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1935,9 +1935,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, 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'"), diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 7dd51f76172..def93c41fe0 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -2568,9 +2568,11 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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'"), diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 8b4276f248b..8016bd5efe0 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1938,14 +1938,11 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, 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'"), -- 2.30.2