This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: version scripts and default/C language mangling


On Sunday, July 11, 2010 07:56:56 Ian Lance Taylor wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
> > the current version script page does not define a default language:
> > 	http://sourceware.org/binutils/docs/ld/VERSION.html
> > 
> > presumably it works with linker-visible symbols by default which means
> > targets that have an ABI prefix (like the Blackfin port) wont usually
> > match.
> 
> A leading underscore is normally returned by bfd_get_symbol_leading_char
> on the BFD, which returns '\0' if there is no leading character.  I
> think you are suggesting that the version script handling is not
> checking for that.

first, i'm asking what the default language is for the version script.  i'd 
expect the answer to be "no language" which means the symbols would be matched 
against any random leading char a target introduces.  i'm also OK with the 
answer "C language", although it does prevent working with symbols that lack 
the prefix char because they were created via assembly code.

> > at the moment, ldlang.c:lang_vers_match() doesnt do demangling for C
> > symbols, and the cplus_demangle() doesnt account for the ABI prefix. 
> > that is only declared via USER_LABEL_PREFIX in the emulparams subfolder,
> > but it isnt exported to any C code that i can see.  not that we'd really
> > want to since this is a bfd target specific issue.  any tips on how best
> > to proceed here to fix things ?
> 
> USER_LABEL_PREFIX only affects the default linker script.  The relevant
> code here is
> 
> #define elf_symbol_leading_char		'_'
> 
> in bfd/elf32-bfin.c.

yes, but presumably changing ldlang.c to consider that value is unacceptable.  
the current parsing code is also not given the current bfd, only 
bfd_elf_version_expr structures, and those dont contain links back to a bfd 
that i can see.  unless there is a way to get the current "active" bfd ?  then 
it should be easy to drop in support in lang_vers_match() with the function 
bfd_get_symbol_leading_char() you pointed out.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]