public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX
@ 2011-09-09 12:42 Kai Tietz
  2011-09-09 13:15 ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Tietz @ 2011-09-09 12:42 UTC (permalink / raw)
  To: Binutils; +Cc: Nick Clifton

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++;
        }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX
  2011-09-09 12:42 [patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX Kai Tietz
@ 2011-09-09 13:15 ` Christopher Faylor
  2011-09-09 13:21   ` Kai Tietz
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Faylor @ 2011-09-09 13:15 UTC (permalink / raw)
  To: Kai Tietz, Binutils

On Fri, Sep 09, 2011 at 02:41:58PM +0200, Kai Tietz wrote:
>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?

Shouldn't that testing include a non-w64 Windows target too?

>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.

It looks ok to me, but I would like confirmation that it works with
mingw32 and Cygwin.

cgf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX
  2011-09-09 13:15 ` Christopher Faylor
@ 2011-09-09 13:21   ` Kai Tietz
  2011-09-09 13:57     ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Tietz @ 2011-09-09 13:21 UTC (permalink / raw)
  To: Kai Tietz, Binutils

2011/9/9 Christopher Faylor <cgf-use-the-mailinglist-please@sourceware.org>:
> On Fri, Sep 09, 2011 at 02:41:58PM +0200, Kai Tietz wrote:
>>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?
>
> Shouldn't that testing include a non-w64 Windows target too?
>
>>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.
>
> It looks ok to me, but I would like confirmation that it works with
> mingw32 and Cygwin.
>
> cgf

I tested iit for 686-w64-mingw32 target - as I wrote - and this is a
32-bit i686 target.  So test is sufficiant as there is in binutils'
bfd code no difference between i686-pc-mingw32, i686-pc-cygwin, and
i686-w64.mingw32 targets in this area.

Kai

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX
  2011-09-09 13:21   ` Kai Tietz
@ 2011-09-09 13:57     ` Christopher Faylor
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Faylor @ 2011-09-09 13:57 UTC (permalink / raw)
  To: Kai Tietz, Binutils

On Fri, Sep 09, 2011 at 03:20:48PM +0200, Kai Tietz wrote:
>2011/9/9 Christopher Faylor <cgf-use-the-mailinglist-please@sourceware.org>:
>> On Fri, Sep 09, 2011 at 02:41:58PM +0200, Kai Tietz wrote:
>>>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?
>>
>> Shouldn't that testing include a non-w64 Windows target too?
>>
>>>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.
>>
>> It looks ok to me, but I would like confirmation that it works with
>> mingw32 and Cygwin.
>
>I tested iit for 686-w64-mingw32 target - as I wrote - and this is a
>32-bit i686 target.  So test is sufficiant as there is in binutils'
>bfd code no difference between i686-pc-mingw32, i686-pc-cygwin, and
>i686-w64.mingw32 targets in this area.

Ok, then please check in.

cgf

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-09 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09 12:42 [patch bfd]: Avoid to remove leading underscore for anon-object for pe-coff targets with empty USER_LABEL_PREFIX Kai Tietz
2011-09-09 13:15 ` Christopher Faylor
2011-09-09 13:21   ` Kai Tietz
2011-09-09 13:57     ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).