public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug binutils/23919] New: bfd doesn't handle ELF compressed data alignment
@ 2018-11-24 22:09 mark at klomp dot org
  2018-11-24 22:27 ` [Bug binutils/23919] " mark at klomp dot org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: mark at klomp dot org @ 2018-11-24 22:09 UTC (permalink / raw)
  To: elfutils-devel

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

            Bug ID: 23919
           Summary: bfd doesn't handle ELF compressed data alignment
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: mark at klomp dot org
                CC: devurandom at gmx dot net, elfutils-devel at sourceware dot org,
                    mark at klomp dot org, slyfox at inbox dot ru,
                    unassigned at sourceware dot org
        Depends on: 23916
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #23916 +++

The ELF compression header has a field (ch_addralign) that is set to the
alignment of the uncompressed section. This way the section itself can have a
different alignment than the decompressed section. bfd (and readelf) however
explicitly make the section sh_addralign and ch_addralign equal. It also always
sets the alignment to 1 which is wrong when using a Elf32_Chdr (which has
alignment of 4) or Elf64_Chdr (which has alignment of 8).

This shows up with tools that use elfutils libelf which sets up the alignment
correctly.

First gas creates a compressed section with on alignment of 1.
Second libelf accepts this, but corrects the alignment when it
writes out the section.
Third bfd_check_compression_header sanity checks the section alignment,
but it checks that the compressed and decompressed alignment is equal?!?
I think it wanted to check that the alignment is a power of 2 instead.


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=23916
[Bug 23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173
works)
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-02-26 20:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24 22:09 [Bug binutils/23919] New: bfd doesn't handle ELF compressed data alignment mark at klomp dot org
2018-11-24 22:27 ` [Bug binutils/23919] " mark at klomp dot org
2018-11-27 12:03 ` cvs-commit at gcc dot gnu.org
2018-11-27 12:06 ` nickc at redhat dot com
2018-11-27 12:22 ` mark at klomp dot org
2018-11-27 13:47 ` hjl.tools at gmail dot com
2018-11-27 14:06 ` cvs-commit at gcc dot gnu.org
2018-11-27 14:07 ` hjl.tools at gmail dot com
2018-11-28 13:55 ` ldv at sourceware dot org
2018-11-28 14:42 ` hjl.tools at gmail dot com
2018-11-28 14:57 ` mark at klomp dot org
2018-11-28 15:03 ` mark at klomp dot org
2018-12-02 13:46 ` cvs-commit at gcc dot gnu.org
2018-12-02 13:52 ` hjl.tools at gmail dot com
2018-12-05 11:55 ` mark at klomp dot org
2019-02-18 15:10 ` cvs-commit at gcc dot gnu.org
2019-02-26 20:12 ` cvs-commit at gcc dot gnu.org
2019-02-26 20:14 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).