Bug 28102 - [gas, --gdwarf-5] Duplicate file and dir
Summary: [gas, --gdwarf-5] Duplicate file and dir
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.38 (HEAD)
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-19 10:07 UTC by Tom de Vries
Modified: 2021-07-19 10:07 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2021-07-19 10:07:33 UTC
Consider test-case ./tui-layout-asm-short-prog.s (based on gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S):
...
$ cat ./tui-layout-asm-short-prog.s
        .global _start
_start:
        .rept 5
        nop
        .endr
...

Assembled and dwarf-5 generated:
...
$ ~/binutils/install/bin/as --gdwarf-5 --64 -o o.o ./tui-layout-asm-short-prog.s
...

We have:
...
$ readelf -wl o.o
  ...
 The Directory Table (offset 0x22, lines 2, columns 1):
  Entry Name
  0     (indirect line string, offset: 0x0): .
  1     (indirect line string, offset: 0x2): .

 The File Name Table (offset 0x30, lines 2, columns 2):
  Entry Dir     Name
  0     0       (indirect line string, offset: 0x4): tui-layout-asm-short-prog.s
  1     1       (indirect line string, offset: 0x20): tui-layout-asm-short-prog.s
...

In other words, we've got duplicate directories and duplicate files.