Support %Lx, %Lu, %Ld in _bfd_error_handler format

H.J. Lu hjl.tools@gmail.com
Thu Jul 6 15:24:00 GMT 2017


On Thu, Jul 6, 2017 at 7:36 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Jul 6, 2017 at 7:27 AM, Alan Modra <amodra@gmail.com> wrote:
>> On Thu, Jul 06, 2017 at 06:50:18AM -0700, H.J. Lu wrote:
>>> This is incomplete and breaks 32-bit bfd_vma.  I am checking in
>>>
>>> diff --git a/bfd/bfd.c b/bfd/bfd.c
>>> index b6cdf3f..a119ac4 100644
>>> --- a/bfd/bfd.c
>>> +++ b/bfd/bfd.c
>>> @@ -727,7 +727,10 @@ _doprnt (FILE *stream, const char *format, va_list ap)
>>>              either long long or long.  */
>>>           if ((BFD_ARCH_SIZE < 64 || BFD_HOST_64BIT_LONG)
>>>          && sptr[-2] == 'L')
>>> -           wide_width = 1;
>>> +           {
>>> +        wide_width = 1;
>>> +        sptr[-2] = 'l';
>>> +           }
>>>
>>>           switch (wide_width)
>>>
>>> to fix it.
>>
>> Thanks.  Hmm, maybe "L" should be changed to "ll" for long long too.
>
> On Linux, L == l:
>
>  L      A following a, A, e, E, f, F, g, or G conversion corresponds  to
>               a  long  double argument.  (C99 allows %LF, but SUSv2 does not.)
>               This is a synonym for ll.
>
>

I backported it to 2.29 branch.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Convert-L-to-l-when-setting-wide_width-to-1.patch
Type: text/x-patch
Size: 1393 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170706/efd29bbf/attachment.bin>


More information about the Binutils mailing list