[RFC PATCH 5/7] x86/module: perpare module loading for ROX allocations of text

Ingo Molnar mingo at kernel.org
Fri Apr 12 19:08:00 AEST 2024


* Mike Rapoport <rppt at kernel.org> wrote:

>  	for (s = start; s < end; s++) {
>  		void *addr = (void *)s + *s;
> +		void *wr_addr = addr + module_writable_offset(mod, addr);

So instead of repeating this pattern in a dozen of places, why not use a 
simpler method:

		void *wr_addr = module_writable_address(mod, addr);

or so, since we have to pass 'addr' to the module code anyway.

The text patching code is pretty complex already.

Thanks,

	Ingo


More information about the Linuxppc-dev mailing list