bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/26428] New: BFD linker creates compressed sections with 1 byte a


From: nickc at redhat dot com
Subject: [Bug ld/26428] New: BFD linker creates compressed sections with 1 byte alignment
Date: Thu, 20 Aug 2020 12:13:08 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=26428

            Bug ID: 26428
           Summary: BFD linker creates compressed sections with 1 byte
                    alignment
           Product: binutils
           Version: 2.36 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: nickc at redhat dot com
  Target Milestone: ---

The BFD linker will create compressed debug sections with 1 byte alignment.
This is despite the fact that these sections start with a chdr structure that
needs 4-byte or 8-byte alignment.  (For the 32-bit and 64-bit versions of the
structure respectively).

For example:

  $ echo 'int main(int argc, char **argv) { return 0; }' | gcc -c -o ex.o -g
-gz=zlib -x c -
  $ ld -o ex --compress-debug-sections=zlib ex.o
  $ readelf -N --wide ex
Section Headers:
  [Nr] Name
       Type            Address          Off    Size   ES   Lk Inf Al
       Flags
 [...]
  [ 5] .debug_info
       PROGBITS        0000000000000000 002206 00006f 00   0   0  1
       [0000000000000800]: COMPRESSED
       ZLIB, 0000000000000085, 1
 [...]

This causes problems for other tools which expect the proper alignment.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]