[lld] r277222 - [LinkerScript] Filler can have a decimal value.

Rafael Espíndola via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 18:40:41 PDT 2016


On 2 August 2016 at 18:29, Rui Ueyama <ruiu at google.com> wrote:
> On Tue, Aug 2, 2016 at 3:27 PM, Rafael Espíndola
> <llvm-commits at lists.llvm.org> wrote:
>>
>> On 2 August 2016 at 18:03, Davide Italiano <davide at freebsd.org> wrote:
>> > On Tue, Aug 2, 2016 at 5:59 AM, Rafael Espíndola
>> > <rafael.espindola at gmail.com> wrote:
>> >>> +  next();
>> >>> +  if (Tok.startswith("=0x"))
>> >>> +    return parseHex(Tok.substr(3));
>> >>
>> >> This is missing the error check for Value below.
>> >>
>> >
>> > My understanding is that we support arbitrary hex values, the
>> > restriction is only for decimal.
>>
>> Why?
>
>
> In this context 0xbeef is different from 0x0000beef. The former is 2 byte
> padding while the latter is 4 bytes.

I see.

So, the handling of this in bfd/gold seems to be

* Decimal and octal denote a 32 bit value.
* Hexadecimal denotes a 32 value on gold.
* The size of the representation is significant in bsd if hexadecimal.

I wonder if we could get away like gold by always using a 32 bit
value, which would allow a simple use of getAsInteger for all cases.

Cheers,
Rafael


More information about the llvm-commits mailing list