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

            Bug ID: 33485
           Summary: ar: Maps in a.out thin archives missing symbols for
                    subsequent members
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: macro at orcam dot me.uk
  Target Milestone: ---
            Target: i[3-7]86-*-bsd* i[3-7]86-*-msdos* pdp11-*-*

For i386 and PDP-11 a.out targets given these sources and recipe:

$ cat a.s
        .data
        .globl  aa
aa:
        .dc.a   bb
$ cat b.s
        .data
        .globl  bb
bb:
        .dc.a   aa
$ as -o a.o a.s
$ as -o b.o b.s
$ ar rcT abt.a a.o b.o
$ 

an archive is produced that only has symbols from a.o in the map:

$ nm --print-armap abt.a

Archive index:
aa in tmpdir/a.o
bb

tmpdir/a.o:
00000000 D aa
         U bb

tmpdir/b.o:
         U aa
00000000 D bb
$ 

The same recipe works for all other targets, producing correct contents,
e.g.:

$ i386-linux-nm abt.a

Archive index:
aa in tmpdir/a.o
bb in tmpdir/b.o

tmpdir/a.o:
00000000 D aa
         U bb

tmpdir/b.o:
         U aa
00000000 D bb
$

Consistently, the archive also fails link:

$ cat abc.s
        .text
        .globl  ff
ff:
        .data
        .globl  cc
cc:
        .dc.a   aa, bb
$ as -o abc.o abc.s
$ ld -o abtc -e ff abc.o abt.a
ld: abt.a: error adding symbols: no more archived files
$ 

Here it works for most other targets, except for Alpha/ECOFF ones which
fail for another reason.

I've examined the state as at commit a8da6403829d ("Add support for thin
archives.") and it produced the same results, so it's not a regression
and thin archives have never worked for these a.out targets.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to