[lld] r245880 - Add support for reading files with more than 0xff00 sections.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 05:28:42 PDT 2015


Semantically it does, but we hit

<instantiation>:3:17: error: macros cannot be nested more than 20 levels deep

The way it is currently written the instantiation depth is O(log(n)),
with this it is O(n).

On 8 September 2015 at 22:17, Sean Silva <chisophugis at gmail.com> wrote:
> Hmm, I guess gnu as doesn't have a notion of variable assignment at assemble
> time.
>
> Anyway, something like this should work:
>
> .macro  range_inclusive from, to
> .section foo,"ax", at progbits,unique,\from
> .if \to-\from
> range_inclusive "(\from+1)",\to
> .endif
> .endm
>
> range_inclusive 1,20
>
> -- Sean Silva
>
> On Tue, Sep 8, 2015 at 6:59 AM, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>>
>> On 4 September 2015 at 23:09, Sean Silva <chisophugis at gmail.com> wrote:
>> > Can you use .rept for this?
>>
>> I don't think so. .rept always creates identical lines, so we can
>> switch to the same section 0xff00 times, but would still just create
>> 1, no?
>>
>> Cheers,
>> Rafael
>
>


More information about the llvm-commits mailing list