[PATCH] D37517: [ELF] - Report orphan sections if -verbose given.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 17:51:18 PDT 2017


Turns out we still can't link the linux kernel:

 error: ./arch/x86/kernel/vmlinux.lds:652: unable to evaluate expression: input section .head.text has no output section assigned

 error: ./arch/x86/kernel/vmlinux.lds:871: at least one side of the expression must be absolute

I will open a bug for that. In any case, I think this LGTM since we
really don't expect too many orphan sections.

Cheers,
Rafael

Rui Ueyama <ruiu at google.com> writes:

> Most programs I use don't use linker scripts at all (which is a good
> thing).Is Linux kernel a good test case? I wonder if it is sufficiently
> large so that benchmark numbers make sense.
>
> On Tue, Sep 19, 2017 at 4:52 PM, Rafael Avila de Espindola <
> rafael.espindola at gmail.com> wrote:
>
>> I really don't expect this to be too expensive.
>>
>> The cost is proportional to the number or orphan sections, which is
>> hopefully very small.
>>
>> That does remind me that I don't have any testcase that uses a
>> linkerscript in the benchmark set I use. Any suggestions of a program to
>> add?
>>
>> Cheers,
>> Rafael
>>
>> Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:
>>
>> > ruiu added a comment.
>> >
>> >> I performed a quck test which tries to simulate the situation (
>> https://ideone.com/p07NYi). It calls some method log() which do nothing
>> with random string argument million of times.
>> >>  Like if we would have script with million of orphans and verbose set
>> to off. It takes 80 milliseconds in total. That probably can be considered
>> as the approximation of worst possible scenario ?
>> >
>> > Well, I do not believe that the cost of calling `log` really matters,
>> but your test doesn't seem to test it correctly. We are talking about the
>> cost of calling toString on `InputSectionBase *`. I don't think it makes
>> much sense to write some different function and measure its performance on
>> dummy inputs. Why don't you just profile it?
>> >
>> >
>> > https://reviews.llvm.org/D37517
>>


More information about the llvm-commits mailing list