gas: Multiple default version .file directives

Jan Beulich jbeulich@suse.com
Fri Feb 5 08:14:22 GMT 2021


On 05.02.2021 08:58, Fangrui Song wrote:
> For ELF, the default version .file directive can be specified multiple
> times to create multiple STT_FILE symbols. It looks like that in the
> symbol table, local symbols (including section symbols) are ordered
> after their preceding .file directives. So is this a guaranteed
> behavior?

At least for ordinary symbols it is supposed to be guaranteed
behavior, or else how would a consumer of the data know where
the symbol is coming from? I'm not certain about section
symbols here, though.

Jan

>  (https://sourceware.org/binutils/docs/as/File.html#File does
> not document this)
> 
> .file   "2.cc"
> l2:
> 
> .file   "1.cc"
> l1:
> .section .xxx,"a"
> .long .xxx
> 
> .file   "0.cc"
> l0:
> .section .yyy,"a"
> .long .yyy
> 



More information about the Binutils mailing list