From 893c4fe2991f82578f16be1750c1f9fd958ad016 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 11 Nov 2003 13:32:38 +0000 Subject: [PATCH] Fix decision about when a .interp section should exist --- bfd/ChangeLog | 16 ++++++++++++++++ bfd/elf-m10300.c | 2 +- bfd/elf32-arm.h | 2 +- bfd/elf32-cris.c | 2 +- bfd/elf32-hppa.c | 2 +- bfd/elf32-i370.c | 2 +- bfd/elf32-m68k.c | 2 +- bfd/elf32-vax.c | 2 +- bfd/elf32-xtensa.c | 2 +- bfd/elf64-hppa.c | 2 +- bfd/elflink.h | 2 +- bfd/elfxx-mips.c | 2 +- 12 files changed, 27 insertions(+), 11 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 73cabd8..2fd5efe 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,19 @@ +2003-11-11 Nick Clifton + + * elf-m10300.c (bfd_mn10300_elf_size_dynamic_sections): Use + info->executable not info->shared to decide if a .interp section + should be present. + * elf32-arm.h (elf32_arm_size_dynamic_sections): Likewise. + * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + * elfxx-mips.c (_bfd_mips_size_dynamic_sections): Likewise. + * elflink.h (size_dynamic_sections): Likewise. + 2003-11-10 Jonathan Wilson * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Swap out tls pointer. diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 8f69c52..685ac9b 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -4351,7 +4351,7 @@ _bfd_mn10300_elf_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index efb713c..bcc1188 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -3523,7 +3523,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index e145b26..2c63474 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -2638,7 +2638,7 @@ elf_cris_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (!info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 1fab847..c2e2f70 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -2047,7 +2047,7 @@ elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index b4d305d..83783ae 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -653,7 +653,7 @@ i370_elf_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 849bfe8..90609c5 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -1127,7 +1127,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (!info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 5d729ef..21fdd9d 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -1149,7 +1149,7 @@ elf_vax_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (!info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 31adf3b..e8c276b 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -1176,7 +1176,7 @@ elf_xtensa_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index b2ca726..294d643 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -1642,7 +1642,7 @@ elf64_hppa_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); diff --git a/bfd/elflink.h b/bfd/elflink.h index 7cd1bdc..04df5d6 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -1981,7 +1981,7 @@ NAME(bfd_elf,size_dynamic_sections) (bfd *output_bfd, bfd_boolean all_defined; *sinterpptr = bfd_get_section_by_name (dynobj, ".interp"); - BFD_ASSERT (*sinterpptr != NULL || info->shared); + BFD_ASSERT (*sinterpptr != NULL || !info->executable); if (soname != NULL) { diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 51b1b59..b545683 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -5871,7 +5871,7 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); -- 2.7.4