[llvm] [Bolt] Fix address translation for KASLR kernel (PR #114261)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 11 21:53:54 PST 2024


xur-llvm wrote:

When I worked on this patch, I had a question on why
HasFixedLoadAddress is needed. To me, ASLR (KASLR), or not, should use
one code path. Non-ASLR (to me) is a trivial case of ASLR -- at least
from parsing and reading perf file point of view.
I was thinking about removing this field. But this field also used to
control some optimizations. So I leave it there.

It seems to me the only upside of using FixedLoadAddress is to avoid
address adjustments -- but that should be very cheap.

Is my understanding correct?

Thanks,

-Rong

On Mon, Nov 11, 2024 at 9:20 PM Maksim Panchenko
***@***.***> wrote:
>
> @maksfb commented on this pull request.
>
> ________________________________
>
> In bolt/lib/Rewrite/RewriteInstance.cpp:
>
> >          BC->IsLinuxKernel = true;
> +        BC->HasFixedLoadAddress = false;
>
> Is there any way to detect KASLR by looking at vmlinux ELF and only then set HasFixedLoadAddress.
>
>> Reply to this email directly, view it on GitHub, or unsubscribe.
> You are receiving this because you were mentioned.Message ID: ***@***.***>


https://github.com/llvm/llvm-project/pull/114261


More information about the llvm-commits mailing list