This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Nick Clifton <nickc at redhat dot com>
- Date: Fri, 9 Sep 2011 14:41:58 +0200
- Subject: [patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX
Hi,
this patch avoids the removal of leading underscores for pe-coff
targets with empty USER_LABEL_PREFIX (like x86_64-pe-coff, and arm).
Regression-tested for i686-w64-mingw32 and x86_64-w64-mingw32. Ok for apply?
ChangeLog
2011-09-09 Kai Tietz <ktietz@redhat.com>
* peicode.h (pe_ILF_build_a_bfd): Don't remove leading underscore
for targets without symbol_leading_char.
Regards,
Kai
Index: src/bfd/peicode.h
===================================================================
--- src.orig/bfd/peicode.h
+++ src/bfd/peicode.h
@@ -884,7 +884,11 @@ pe_ILF_build_a_bfd (bfd * abfd
if (import_name_type != IMPORT_NAME)
{
char c = symbol[0];
- if (c == '_' || c == '@' || c == '?')
+
+ /* Check that we don't remove for targets with empty
+ USER_LABEL_PREFIX the leading underscore. */
+ if ((c == '_' && abfd->xvec->symbol_leading_char != 0)
+ || c == '@' || c == '?')
symbol++;
}