* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
@ 2018-11-24 0:54 ` slyfox at inbox dot ru
2018-11-24 1:04 ` mark at klomp dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: slyfox at inbox dot ru @ 2018-11-24 0:54 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
--- Comment #1 from Sergei Trofimovich <slyfox at inbox dot ru> ---
objtool is a part of linux kernel:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/objtool
Attached b.tar.gz contains:
- objtool binary
- object files before and after mangling with objtool
Note the .debug_info offset and alignment change:
$ readelf -a rapl.o.back > pre
$ readelf -a rapl.o > post
$ diff -U 0 pre post
- [ 4] .debug_info PROGBITS 0000000000000000 00000047
- 000000000000003c 0000000000000000 C 0 0 1
+ [ 4] .debug_info PROGBITS 0000000000000000 00000048
+ 000000000000003c 0000000000000000 C 0 0 8
My wild guess is that section's start is not adjusted correctly.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
2018-11-24 0:54 ` [Bug libelf/23916] " slyfox at inbox dot ru
@ 2018-11-24 1:04 ` mark at klomp dot org
2018-11-24 10:31 ` slyfox at inbox dot ru
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mark at klomp dot org @ 2018-11-24 1:04 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
Thanks. I am fairly sure this is a bug in binutils/bfd.
First gas creates a compressed section with the wrong alignment.
Because a compressed section has a Chdr it needs to be aligned
to either 4 or 8 depending on ELF class (32 or 64 bit). The actual
alignment of the uncompressed section data is contained in the Chdr
as ch_addralign. gas/bfd seems to always just use the same (1) alignment
for both the uncompressed section data and compressed data.
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.
The following (obviously somewhat incorrect, because it just ignores the
alignment completely) patch seems to fix/workaround things:
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 15becd7ae8..9cc05a0174 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -2404,7 +2404,7 @@ bfd_check_compression_header (bfd *abfd, bfd_byte
*contents,
chdr.ch_addralign = bfd_get_64 (abfd, &echdr->ch_addralign);
}
if (chdr.ch_type == ELFCOMPRESS_ZLIB
- && chdr.ch_addralign == 1U << sec->alignment_power)
+ /* && chdr.ch_addralign == 1U << sec->alignment_power */)
{
*uncompressed_size = chdr.ch_size;
return TRUE;
I'll file a proper bug and patch tomorrow against binutils.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
2018-11-24 0:54 ` [Bug libelf/23916] " slyfox at inbox dot ru
2018-11-24 1:04 ` mark at klomp dot org
@ 2018-11-24 10:31 ` slyfox at inbox dot ru
2018-11-24 22:09 ` mark at klomp dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: slyfox at inbox dot ru @ 2018-11-24 10:31 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
--- Comment #3 from Sergei Trofimovich <slyfox at inbox dot ru> ---
Oh, interesting!
On a related note: should eu-elflint complain on originally compiled
rapl.o.back (from tarball)? That would ease detecting non-conformant binutils
versions.
Today no warnings are issued:
$ eu-elflint rapl.o rapl.o.back
rapl.o:
No errors
rapl.o.back:
No errors
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
` (2 preceding siblings ...)
2018-11-24 10:31 ` slyfox at inbox dot ru
@ 2018-11-24 22:09 ` mark at klomp dot org
2018-11-26 12:13 ` mark at klomp dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ 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=23916
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |23919
Referenced Bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=23919
[Bug 23919] bfd doesn't handle ELF compressed data alignment
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
` (3 preceding siblings ...)
2018-11-24 22:09 ` mark at klomp dot org
@ 2018-11-26 12:13 ` mark at klomp dot org
2018-11-26 12:16 ` mark at klomp dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mark at klomp dot org @ 2018-11-26 12:13 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
--- Comment #4 from Mark Wielaard <mark at klomp dot org> ---
(In reply to Sergei Trofimovich from comment #3)
> On a related note: should eu-elflint complain on originally compiled
> rapl.o.back (from tarball)? That would ease detecting non-conformant
> binutils versions.
Yes, that is probably a good idea, I filed two new bugs:
Bug 23920 - elflint should check sanity check Chdr fields and uncompressed data
of compressed sections
Bug 23921 - elflint should check (minimum) section alignment sanity
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
` (4 preceding siblings ...)
2018-11-26 12:13 ` mark at klomp dot org
@ 2018-11-26 12:16 ` mark at klomp dot org
2018-12-03 0:06 ` slyfox at inbox dot ru
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mark at klomp dot org @ 2018-11-26 12:16 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
--- Comment #5 from Mark Wielaard <mark at klomp dot org> ---
I filed a binutils bug with patch.
https://sourceware.org/bugzilla/show_bug.cgi?id=23919
If you are able to test patch that on your setup to see if it resolves the
issue with objtool that would be really helpful.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
` (5 preceding siblings ...)
2018-11-26 12:16 ` mark at klomp dot org
@ 2018-12-03 0:06 ` slyfox at inbox dot ru
2018-12-03 0:19 ` ldv at sourceware dot org
2018-12-05 11:55 ` mark at klomp dot org
8 siblings, 0 replies; 10+ messages in thread
From: slyfox at inbox dot ru @ 2018-12-03 0:06 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
--- Comment #6 from Sergei Trofimovich <slyfox at inbox dot ru> ---
(In reply to Mark Wielaard from comment #5)
> I filed a binutils bug with patch.
> https://sourceware.org/bugzilla/show_bug.cgi?id=23919
>
> If you are able to test patch that on your setup to see if it resolves the
> issue with objtool that would be really helpful.
Built kernel successfully against binutils from git master and elfutils-0.175.
Boots fine and gdb can still load .ko files for debugging.
Thank you!
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
` (6 preceding siblings ...)
2018-12-03 0:06 ` slyfox at inbox dot ru
@ 2018-12-03 0:19 ` ldv at sourceware dot org
2018-12-05 11:55 ` mark at klomp dot org
8 siblings, 0 replies; 10+ messages in thread
From: ldv at sourceware dot org @ 2018-12-03 0:19 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
Dmitry V. Levin <ldv at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-12-03
Ever confirmed|0 |1
--- Comment #7 from Dmitry V. Levin <ldv at sourceware dot org> ---
Same here. I think this bug report can be closed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libelf/23916] [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works)
2018-11-24 0:49 [Bug libelf/23916] New: [bisected] elifutils-0.175 broke kernel's objtool (elifutils-0.173 works) slyfox at inbox dot ru
` (7 preceding siblings ...)
2018-12-03 0:19 ` ldv at sourceware dot org
@ 2018-12-05 11:55 ` mark at klomp dot org
8 siblings, 0 replies; 10+ messages in thread
From: mark at klomp dot org @ 2018-12-05 11:55 UTC (permalink / raw)
To: elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=23916
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Mark Wielaard <mark at klomp dot org> ---
Thanks for testing.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread