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: [patch x64 SEH]: Sort pdata section ascending


2010/9/11 Dave Korn <dave.korn.cygwin@gmail.com>:
> On 11/09/2010 14:04, Andreas Schwab wrote:
>> Kai Tietz <ktietz70@googlemail.com> writes:
>>
>>> Index: src/bfd/peXXigen.c
>>> ===================================================================
>>> --- src.orig/bfd/peXXigen.c ?2010-09-07 21:55:15.000000000 +0200
>>> +++ src/bfd/peXXigen.c ? ? ? 2010-09-11 13:17:30.547535100 +0200
>>> @@ -2256,6 +2256,24 @@ _bfd_XX_get_symbol_info (bfd * abfd, asy
>>> ? ?coff_get_symbol_info (abfd, symbol, ret);
>>> ?}
>>>
>>> +#if !defined(COFF_WITH_pep) && defined(COFF_WITH_pex64)
>>> +static int
>>> +sort_x64_pdata (const void *lp, const void *rp)
>>> +{
>>> + ?bfd_vma vl, vr;
>>> + ?vl = bfd_getl32 (lp); vr = bfd_getl32 (rp);
>>> + ?if (vl != vr)
>>> + ? ?return (vl < vr ? -1 : 1);
>>> + ?vl = bfd_getl32 (lp + 4); vr = bfd_getl32 (rp + 4);
>>> + ?if (vl != vr)
>>> + ? ?return (vl < vr ? -1 : 1);
>>> + ?vl = bfd_getl32 (lp + 8); vr = bfd_getl32 (rp + 8);
>>
>> You can't do arithmetics on pointers to void.
>
> ?Oh, well spotted. ?That's a GNU extension, which would be why GCC didn't
> complain.
>
> ? ?cheers,
> ? ? ?DaveK
>

Ok, here version doing it via const char *, which should satisfy all
standard c compilers doing the right thing.

Cheers,
Kai

-- 
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

Attachment: sort_pdata.diff
Description: Binary data


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