Re: [PATCH] elf: Support multiple PT_GNU_RELRO segments

"H.J. Lu" <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <CAMe9rOocPgipphQbEAjXYipM_i7z=andD0xoOYNGK03JA72Hcw@mail.gmail.com>
On Tue, Jul 7, 2026 at 5:11 AM Justin Rivera <[email protected]> wrote:
>
> Hello,
>
> While this patch appears to be working as intended, I had a question
> regarding any additions to the test suite for testing RELRO behavior.
>
> This patch modifies elf/tst-relro-symbols.py, which can statically check
> ELF headers. However, there don't seem to be any dynamic checks that would
> work for multiple RELRO segments. We were able to do some ad-hoc testing
> with some hand-written assembly, but getting something working within the
> test suite seemed to be a bit trickier. (Often ran into
> `/usr/bin/ld: foo.so: warning: unable to allocate any sections to PT_GNU_RELRO segment`
> without some additional patching hack, for example).
>
> Are there any suggestions on how to best test the behavior changed by this patch?

We should add the linker support first.  Linker can have an option
to generate multiple PT_GNU_RELRO segments for small binaries.


H.J.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.