Question About 'ar' Output
Jan Beulich
jbeulich@suse.com
Tue Apr 26 06:15:47 GMT 2022
On 26.04.2022 05:46, Jon Forrest via Binutils wrote:
> (GNU ar version 2.37-10.fc35)
>
> As a learning exercise, I'm trying to duplicate some of what
> the 'ar' command does. (There's nothing wrong with 'ar').
>
> I have a .a library that ar shows has the following content:
>
> % ar t libctf.a
> libctf_la-ctf-archive.o
> libctf_la-ctf-dump.o
> libctf_la-ctf-create.o
> libctf_la-ctf-decl.o
> libctf_la-ctf-error.o
> libctf_la-ctf-hash.o
> libctf_la-ctf-labels.o
> [rest omitted]
>
> When I run my test program I see
> /
> //
> /0
> /25
> /47
> /71
> /93
> [rest omitted]
>
> When I look at my .a library using 'od' I can see the names starting
> with '/' characters. I can also see the names starting with 'libctf'.
>
> I don't understand what the slash names are, nor how they're mapped to
> the real names. I tried looking at the 'ar' source code but I didn't
> see anything that jumped out at me.
Member names, when they're longer than what fits in the designated
member header field, can use an escape mechanism by indexing into the
special "//" member using the "/<offset>" notation.
Jan
More information about the Binutils
mailing list