bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/29393] Option to emit .debug_info CU version 4


From: nickc at redhat dot com
Subject: [Bug ld/29393] Option to emit .debug_info CU version 4
Date: Tue, 26 Jul 2022 13:21:20 +0000

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

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |NOTABUG
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |nickc at redhat dot com

--- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Jan Engelhardt from comment #0)

> I did not find an option to emit v4 CUs. gcc's -gdwarf-4 option has no
> effect in that regard, either.

The secret is that you need to use both gcc's dwarf-4 option and the
assembler's dwarf-4 option.  Like this:

  $ gcc x.c -g -gdwarf-4 -Wa,--gdwarf-4
  $ objdump -W a.out
  [...]
  Contents of the .debug_info section:

    Compilation Unit @ offset 0x0:
     Length:        0x4f (32-bit)
     Version:       4
     Abbrev Offset: 0x0
     Pointer Size:  8

You need the assembler's --gdwarf-4 option so that it will default to
generating a version 4 .debug_info section.  But you also need to use gcc's
-gdwarf-4 option as otherwise it will generated dwarf version 5 line table
information and the assembler will notice this and automatically bump the
version of dwarf that it generates to version 5.

-- 
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]