[Top] [All Lists]

merge .text.*/.rel.text.* sections in module build with -ffunction-secti

To:, Linux Kernel list <>
Subject: merge .text.*/.rel.text.* sections in module build with -ffunction-section
From: matthieu castet <>
Date: Sat, 27 Feb 2010 18:57:30 +0100
Original-recipient: rfc822;
User-agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv: Gecko/20090823 SeaMonkey/1.1.18

mips (and other arch) use -ffunction-section (I am not sure why. It may be to 
prevent gcc to emit bad relocation).

Apart from making the code a bit bigger it :
- make very difficult to analyze binary kernel dump (without symbol) of module 
: you can't easily knowing the load address of the module find the symbol of an 
- make module bigger (due to alignment between section and bigger section table)
- make the module loading slower (more section to parse)

I wondering why we doesn't merge all text section in one section when building 
This can be done with :
mipsel-openwrt-linux-uclibc-ld -r  -m elf32ltsmip  -o vfat2.ko vfat.ko -T

Why doesn't mips provide a custom that does that ?


PS : could you keep me in CC

PS2 : ls -l vfat2.ko vfat.ko
12881 vfat2.ko
14748 vfat.ko

we save 13% of module size !
 * Common module linker script, always used when linking a module.
 * Archs are free to supply their own linker scripts.  ld will
 * combine them automatically.
        .text : {
        .rel.text : {
        /DISCARD/ : { *(.discard) }
<Prev in Thread] Current Thread [Next in Thread>
  • merge .text.*/.rel.text.* sections in module build with -ffunction-section, matthieu castet <=