aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-05-30 14:29:27 +0000
committerAlan Modra <amodra@gmail.com>2007-05-30 14:29:27 +0000
commit42bb2e3317a7ff36fff57469b1303775a8ab1242 (patch)
tree5e5d6156ce01a3e646f6a9371fb40b1e5b75fa98 /bfd/elf.c
parent02bf8d82b539bf6c1cb8d4f7b12449930e94d431 (diff)
downloadgdb-42bb2e3317a7ff36fff57469b1303775a8ab1242.zip
gdb-42bb2e3317a7ff36fff57469b1303775a8ab1242.tar.gz
gdb-42bb2e3317a7ff36fff57469b1303775a8ab1242.tar.bz2
bfd/
* elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections created by objcopy --only-keep-debug. (_bfd_elf_init_private_section_data): Only change elf_section_type if it is SHT_NULL. binutils/ * objcopy.c (copy_object): Revert 2007-05-11 change. Don't avoid calling bfd_copy_private_bfd_data for ELF STRIP_NONDEBUG. (setup_section): Don't modify flags, and don't avoid calling bfd_copy_private_section_data for ELF STRIP_NONDEBUG. * readelf.c (process_program_headers): Ignore .dynamic of type SHT_NOBITS.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 25266ea..532e6b5 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2907,11 +2907,10 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg)
&& !(*bed->elf_backend_fake_sections) (abfd, this_hdr, asect))
*failedptr = TRUE;
- if (sh_type == SHT_NOBITS
- && elf_elfheader (abfd)->e_phnum == 0)
+ if (sh_type == SHT_NOBITS && asect->size != 0)
{
/* Don't change the header type from NOBITS if we are being
- called for strip/objcopy --only-keep-debug. */
+ called for objcopy --only-keep-debug. */
this_hdr->sh_type = sh_type;
}
@@ -6039,13 +6038,9 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
output BFD section flags have been set to something different.
elf_fake_sections will set ELF section type based on BFD
section flags. */
- if (osec->flags == isec->flags || !osec->flags)
- {
- BFD_ASSERT (osec->flags == isec->flags
- || (!osec->flags
- && elf_section_type (osec) == SHT_NULL));
- elf_section_type (osec) = elf_section_type (isec);
- }
+ if (elf_section_type (osec) == SHT_NULL
+ && (osec->flags == isec->flags || !osec->flags))
+ elf_section_type (osec) = elf_section_type (isec);
/* FIXME: Is this correct for all OS/PROC specific flags? */
elf_section_flags (osec) |= (elf_section_flags (isec)