__eh_frame info changes in Clang?

Nick,
      Do you happen to know why the version reported in 'dwarfdump
--eh-frame' for object files now differs when compiled with and
without -g? The test used in FSF gcc's configure produces a diff of..

% diff -u conftest.o.g.stripped.dwarfdump conftest.o.g0.stripped.dwarfdump
--- conftest.o.g.stripped.dwarfdump 2015-04-10 21:43:15.000000000 -0400
+++ conftest.o.g0.stripped.dwarfdump 2015-04-10 21:43:04.000000000 -0400
@@ -1,5 +1,5 @@

That looks like a bug.

From

http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-generic/ehframechpt.html

Version
A 1 byte value that identifies the version number of the frame
information structure. This value shall be 1.

This was introduced by r211272. We should probably be producing 1/3/4
for .debug_frame, but only 1 for .eh_frame.

From: llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu] On
Behalf Of Rafael Espíndola
Sent: Monday, April 27, 2015 2:07 PM
To: Jack Howarth
Cc: LLVM Developers Mailing List
Subject: Re: [LLVMdev] __eh_frame info changes in Clang?

That looks like a bug.

From

http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-
generic/ehframechpt.html

Version
A 1 byte value that identifies the version number of the frame
information structure. This value shall be 1.

This was introduced by r211272. We should probably be producing 1/3/4
for .debug_frame, but only 1 for .eh_frame.

I expect that truly strict conformance would require that .eh_frame v1
should be emitted as-if DWARF v2, regardless of the DWARF version used
for the .debug_* sections.

Just for grins I'll point out that the AMD64 ABI specifies that the
version field is 1, but elsewhere suggests that the content of the
.eh_frame section is dependent on the DWARF version... which is not
specified anywhere in the .eh_frame section.

Kind of annoying, really.
--paulr

I expect that truly strict conformance would require that .eh_frame v1
should be emitted as-if DWARF v2, regardless of the DWARF version used
for the .debug_* sections.

And a few extra difference on top of v2, like what is the value of the
CIE id :frowning:

Kind of annoying, really.

Sure is.

Cheers,
Rafael

> I expect that truly strict conformance would require that .eh_frame v1
> should be emitted as-if DWARF v2, regardless of the DWARF version used
> for the .debug_* sections.

And a few extra difference on top of v2, like what is the value of the
CIE id :frowning:

> Kind of annoying, really.

Sure is.

Without looking at it real closely, I see that various things are based
on IsEH and nothing obviously conditioned on the DWARF version, other
than the CIE version, so it probably has the correct effect.
--paulr