[PATCH] ELF: Move readonly_dynrelocs_against_ifunc to elf_link_hash_table

Alan Modra amodra@gmail.com
Mon Jun 8 01:25:12 GMT 2020


On Sat, Jun 06, 2020 at 07:33:48AM -0700, H.J. Lu via Binutils wrote:
> All IFUNC targets can use readonly_dynrelocs_against_ifunc to warn
> dynamic IFUNC relocations in read-only segment.
> 
> I'd like to check it into master if there are no objections.

Do you actually need one of the dynamic ifunc relocations itself to be
in a read-only section for this problem to occur?  I don't think so.

The problem with IFUNC and TEXTREL occurs when the ifunc resolver
function is in a segment that needs to be made writable to apply
relocations.  Making a memory region writable typically makes it
non-executable (but that might depend on architecture), resulting
in segfaults when attempting to run the ifunc resolver to apply
dynamic ifunc relocations.  That has nothing to do with where the
ifunc dynamic relocation itself occurs.

So it seems to me your logic is incorrect.  Please don't apply.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list