Re: [PATCH] objtool: Use idiomatic section name for relocatable rodata under PIE

From: Tiezhu Yang
Date: Tue Feb 18 2025 - 20:02:08 EST


On 02/18/2025 05:29 PM, Ard Biesheuvel wrote:
On Tue, 18 Feb 2025 at 10:26, Ard Biesheuvel <ardb+git@xxxxxxxxxx> wrote:

From: Ard Biesheuvel <ardb@xxxxxxxxxx>

When running in PIE mode, the compiler will emit const global objects
into .data.rel.ro rather than into .rodata if those objects contain
statically initialized fields carrying addresses that are subject to
runtime relocation (e.g., function pointers).

...

I'll send a fixed v2 once the LoongArch folks confirm that this works for them.

This change works well with GCC and Clang on LoongArch.

Tested-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> # on LoongArch