bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/28254] New: gas 2.63.1 fails to generate debugging information


From: dcmay at copper dot net
Subject: [Bug gas/28254] New: gas 2.63.1 fails to generate debugging information for aarch64 .S files
Date: Fri, 20 Aug 2021 15:06:29 +0000

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

            Bug ID: 28254
           Summary: gas 2.63.1 fails to generate debugging information for
                    aarch64 .S files
           Product: binutils
           Version: 2.36.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: dcmay at copper dot net
  Target Milestone: ---

Created attachment 13622
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13622&action=edit
sample .s file

Using as from binutils 2.36.1 while building a bare metal bootloader,

the boot.s entry code is missing all debugging information (and presumably
other .s files as well).

As such, gdb fails to single step or honor breakpoints in the startup code.

binutils 2.35.1 generates debugging information as expected.


The problem was originally seen using the Linaro / ARM 10.3 (ie. gcc 10.3.1)
release. Per the linaro manifest, binutils in that release was generated from
commit a7eb3ff36cebc093af6658049e03d63579dade86. See
https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/srcrel/gcc-arm-src-snapshot-10.3-2021.07-manifest.txt.

The problem has been verified to exist with cross tools built from git tag
binutils-2_36_1.


The problem is trivially reproduced using the attached file.

----

$ linaro/10.3.1/bin/aarch64-none-elf-as --gdwarf2 -EL -mabi=lp64 -o boot.o
boot.s
$ linaro/10.3.1/bin/aarch64-none-elf-objdump -W boot.o

boot.o:     file format elf64-littleaarch64
$

----

Using as from binutils-2.35.1, debugging information is present:

----

$ /opt/linaro/10.2.1/bin/aarch64-none-elf-as --gdwarf2 -EL -mabi=lp64 -o boot.o
boot.s

$ /opt/linaro/10.2.1/bin/aarch64-none-elf-objdump -W boot.o

boot.o:     file format elf64-littleaarch64

Raw dump of debug contents of section .debug_line:

  Offset:                      0x0
  Length:                      100
  DWARF Version:               3
  Prologue Length:             33
  Minimum Instruction Length:  4
  Initial value of 'is_stmt':  1
  Line Base:                   -5
  Line Range:                  14
  Opcode Base:                 13

 Opcodes:
  Opcode 1 has 0 args
  Opcode 2 has 1 arg
  Opcode 3 has 1 arg
  Opcode 4 has 1 arg
  Opcode 5 has 1 arg
  Opcode 6 has 0 args
  Opcode 7 has 0 args
  Opcode 8 has 0 args
  Opcode 9 has 1 arg
  Opcode 10 has 0 args
  Opcode 11 has 0 args
  Opcode 12 has 1 arg

 The Directory Table (offset 0x1b):
  1     src

 The File Name Table (offset 0x20):
  Entry Dir     Time    Size    Name
  1     1       0       0       boot.S

 Line Number Statements:
  [0x0000002b]  Extended opcode 2: set Address to 0x0
  [0x00000036]  Advance Line by 31 to 32
  [0x00000038]  Copy
  [0x00000039]  Special opcode 20: advance Address by 4 to 0x4 and Line by 1 to
33
  [0x0000003a]  Special opcode 20: advance Address by 4 to 0x8 and Line by 1 to
34
  [0x0000003b]  Special opcode 20: advance Address by 4 to 0xc and Line by 1 to
35
  [0x0000003c]  Special opcode 21: advance Address by 4 to 0x10 and Line by 2
to 37
  [0x0000003d]  Special opcode 20: advance Address by 4 to 0x14 and Line by 1
to 38
  [0x0000003e]  Special opcode 20: advance Address by 4 to 0x18 and Line by 1
to 39
  [0x0000003f]  Special opcode 20: advance Address by 4 to 0x1c and Line by 1
to 40
  [0x00000040]  Special opcode 20: advance Address by 4 to 0x20 and Line by 1
to 41
  [0x00000041]  Special opcode 20: advance Address by 4 to 0x24 and Line by 1
to 42
  [0x00000042]  Special opcode 20: advance Address by 4 to 0x28 and Line by 1
to 43
  [0x00000043]  Special opcode 20: advance Address by 4 to 0x2c and Line by 1
to 44
  [0x00000044]  Special opcode 21: advance Address by 4 to 0x30 and Line by 2
to 46
  [0x00000045]  Special opcode 20: advance Address by 4 to 0x34 and Line by 1
to 47
  [0x00000046]  Special opcode 20: advance Address by 4 to 0x38 and Line by 1
to 48
  [0x00000047]  Special opcode 21: advance Address by 4 to 0x3c and Line by 2
to 50
  [0x00000048]  Special opcode 20: advance Address by 4 to 0x40 and Line by 1
to 51
  [0x00000049]  Special opcode 20: advance Address by 4 to 0x44 and Line by 1
to 52
  [0x0000004a]  Special opcode 20: advance Address by 4 to 0x48 and Line by 1
to 53
  [0x0000004b]  Special opcode 20: advance Address by 4 to 0x4c and Line by 1
to 54
  [0x0000004c]  Special opcode 21: advance Address by 4 to 0x50 and Line by 2
to 56
  [0x0000004d]  Special opcode 21: advance Address by 4 to 0x54 and Line by 2
to 58
  [0x0000004e]  Special opcode 20: advance Address by 4 to 0x58 and Line by 1
to 59
  [0x0000004f]  Advance PC by 16 to 0x68
  [0x00000051]  Extended opcode 1: End of Sequence

  [0x00000054]  Extended opcode 2: set Address to 0x0
  [0x0000005f]  Advance Line by 71 to 72
  [0x00000062]  Copy
  [0x00000063]  Advance PC by 4 to 0x4
  [0x00000065]  Extended opcode 1: End of Sequence


Contents of the .debug_info section:

  Compilation Unit @ offset 0x0:
   Length:        0x1e (32-bit)
   Version:       2
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <c>   DW_AT_stmt_list   : 0x0
    <10>   DW_AT_ranges      : 0x0
    <14>   DW_AT_name        : (indirect string, offset: 0x0): src/boot.S
    <18>   DW_AT_comp_dir    : (indirect string, offset: 0xb): /b/code/aarch64
    <1c>   DW_AT_producer    : (indirect string, offset: 0x1b): GNU AS 2.35.1
    <20>   DW_AT_language    : 32769    (MIPS assembler)

Contents of the .debug_abbrev section:

  Number TAG (0x0)
   1      DW_TAG_compile_unit    [no children]
    DW_AT_stmt_list    DW_FORM_data4
    DW_AT_ranges       DW_FORM_data4
    DW_AT_name         DW_FORM_strp
    DW_AT_comp_dir     DW_FORM_strp
    DW_AT_producer     DW_FORM_strp
    DW_AT_language     DW_FORM_data2
    DW_AT value: 0     DW_FORM value: 0

Contents of the .debug_aranges section:

  Length:                   60
  Version:                  2
  Offset into .debug_info:  0x0
  Pointer Size:             8
  Segment Size:             0

    Address            Length
    0000000000000000 0000000000000068 
    0000000000000000 0000000000000004 
    0000000000000000 0000000000000000 

Contents of the .debug_str section:

  0x00000000 7372632f 626f6f74 2e53002f 622f636f src/boot.S./b/co
  0x00000010 64652f61 61726368 36340047 4e552041 de/aarch64.GNU A
  0x00000020 5320322e 33352e31 00                S 2.35.1.

Contents of the .debug_ranges section:

    Offset   Begin    End
    00000000 ffffffffffffffff 0000000000000000 (base address)
    00000000 0000000000000000 0000000000000068 
    00000000 0000000000000000 0000000000000004 
    00000000 <End of list>

----

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