From f6fe1ccd62e4492aabda6a9a9d12da438d0ebf2b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 23 Apr 2015 07:58:05 -0700 Subject: Don't change compressed input debug section names Change compressed input debug section name for objdump is very confusing. But we need to change it for linker so that linker will consider the input section as a debug section. This patch delays section rename to elf_fake_sections for objcopy and avoids it for objdump. bfd/ PR binutils/18209 * bfd.c (bfd): Add is_linker_input. * elf.c (convert_debug_to_zdebug): New. (convert_zdebug_to_debug): Likewise. (_bfd_elf_make_section_from_shdr): Don't convert .debug_* to .zdebug_* here. Use convert_zdebug_to_debug. Set SEC_ELF_RENAME. (_bfd_elf_init_reloc_shdr): Pass a pointer to section name instead of a pointer to section. (elf_fake_sections): Rename the section name if SEC_ELF_RENAME is set. * section.c (SEC_ELF_RENAME): New. * bfd-in2.h: Regenerated. binutils/ PR binutils/18209 * objcopy.c (setup_section): Copy compress status. binutils/testsuite/ PR binutils/18209 * binutils-all/compress.exp: Replace dw2-3.W with dw2-3gabi.W on zlib-gabi output. * binutils-all/dw2-1.W: Convert section names to .zdebug_*. * binutils-all/dw2-3.W: Likewise. * binutils-all/objdump.W: Likewise. * binutils-all/dw2-3gabi.W: New file. ld/ PR binutils/18209 * ldfile.c (ldfile_try_open_bfd): Set is_linker_input to 1. --- ld/ChangeLog | 5 +++++ ld/ldfile.c | 3 +++ 2 files changed, 8 insertions(+) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index bfa89d5..f5e25b2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2015-04-23 H.J. Lu + + PR binutils/18209 + * ldfile.c (ldfile_try_open_bfd): Set is_linker_input to 1. + 2015-04-23 Alan Modra * emulparams/elf64ppc.sh (GOT): Align. diff --git a/ld/ldfile.c b/ld/ldfile.c index 21bdbf4..d4f7cb4 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -142,6 +142,9 @@ ldfile_try_open_bfd (const char *attempt, /* Linker needs to decompress sections. */ entry->the_bfd->flags |= BFD_DECOMPRESS; + /* This is a linker input BFD. */ + entry->the_bfd->is_linker_input = 1; + #ifdef ENABLE_PLUGINS if (entry->flags.lto_output) entry->the_bfd->lto_output = 1; -- cgit v1.1