This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: identifier mangling when linking binary "blobs"
From: jtc@redback.com (J.T. Conklin)
Date: 28 May 1999 16:21:56 -0700
>>>>> "Ian" == Ian Lance Taylor <ian@airs.com> writes:
Ian> I think it's a bug. mangle_name in binary.c should prepend
Ian> bfd_get_symbol_leading_char (abfd). That should make the name
Ian> consistently start with an underscore, which I think is correct.
I finally got a chance to follow up, and came up with the enclosed
patch. Unfortunately, it doesn't work as expected. As bfd_get_
symbol_leading_char(abfd) returns the leading character of the
"binary" BFD vector instead of that the output file.
Oh yeah.
After poking around for a while, I could not find a way for
mangle_name() to get that info without causing major damage.
Any ideas?
I don't have any. I guess the problem is that we want the symbol name
to depend upon the output format. BFD is not really geared to do
that. It naturally expects to find the symbols defined by the input
format.
I can't think of anything except using --defsym or the gcc asm
variable naming feature to rename the symbols.
Ian