Bug 18656 - unable to initialize decompress status for section .debug_info
Summary: unable to initialize decompress status for section .debug_info
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.26
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-10 15:52 UTC by H.J. Lu
Modified: 2019-02-23 21:03 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2015-07-10 15:52:09 UTC
[hjl@gnu-6 xxx]$ cat x.c
int
foo (int x)
{
  return x * 4;
}
[hjl@gnu-6 xxx]$ make
gcc -g -fPIC -Wa,--compress-debug-sections=zlib-gabi   -c -o x.o x.c
objcopy -O elf32-x86-64 x.o x32.o
./ld -melf32_x86_64 -shared -o x32.so x32.o
./ld: x32.o: unable to initialize decompress status for section .debug_info
./ld: x32.o: unable to initialize decompress status for section .debug_info
x32.o: file not recognized: File format not recognized
Makefile:29: recipe for target 'x32.so' failed
make: *** [x32.so] Error 1
[hjl@gnu-6 xxx]$
Comment 1 Sourceware Commits 2015-07-10 21:43:19 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=889884731e09b46e4c2ecb051dfde1e2f69d2b47

commit 889884731e09b46e4c2ecb051dfde1e2f69d2b47
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 10 14:20:20 2015 -0700

    Properly convert objects between different ELF classes
    
    The output SHF_COMPRESSED section size is different from input if
    ELF classes of input and output aren't the same.  We must adjust
    the section sizes as well as the compression headers in
    SHF_COMPRESSED sections when converting objects between different
    ELF classes.
    
    bfd/
    
    	 PR binutils/18656
    	 * bfd.c (bfd_convert_section_size): New function.
    	 (bfd_convert_section_contents): Likewise.
    	 * bfd-in2.h: Regenerated.
    
    binutils/
    
    2015-07-10  H.J. Lu  <hongjiu.lu@intel.com>
    
    	 PR binutils/18656
    	 * objcopy.c (setup_section): Call bfd_convert_section_size
    	 to get the output section size.
    	 (copy_section): Get the section size from the output section
    	 and call bfd_get_full_section_contents to convert section
    	 contents for output.
    
    binutils/testsuite/
    
    	 PR binutils/18656
    	 * binutils-all/compress.exp (convert_test): New proc.
    	 Run conversion tests between x86-64 and x32.
Comment 2 H.J. Lu 2015-07-10 21:46:07 UTC
Fixed.