Re: [PATCH] Modules 3/3: Sort sections

Richard Henderson
2003-01-02T04:46:29Z

On Thu, Jan 02, 2003 at 02:00:27PM +1100, Rusty Russell wrote:
> + /* Find .plt and .pltinit sections */

Typo.

> +/* Make empty sections for module_frob_arch_sections to expand. */
> +#ifdef MODULE
> +asm(".section .plt,\"aws\",@nobits; .align 3; .previous");
> +asm(".section .plt.init,\"aws\",@nobits; .align 3; .previous");

Should use "ax", do make the plt sections executable,
since the plt section contains code that branches.
Additionally, this will place the .plt section next
to .text, which improves icache usage, and minimizes
the branch distance.

Incidentally, why do we do strstr(name, ".init") instead
of strncmp(name, ".init", 5)? Is there any particular
need for the .init to come at the end?

r~