Re: [PATCH 2/7] linker script: throw away .discard section

From: Mike Frysinger
Date: Wed May 20 2009 - 04:28:31 EST


On Wed, May 20, 2009 at 04:18, Tejun Heo wrote:
> Tejun Heo wrote:
>> Mike Frysinger wrote:
>>> On Wed, May 20, 2009 at 03:37, Tejun Heo wrote:
>>>> x86 throws away .discard section but no other archs do. ÂAlso,
>>>> .discard is not thrown away while linking modules. ÂMake every arch
>>>> and module linking throw it away. ÂThis will be used to define dummy
>>>> variables for percpu declarations and definitions.
>>> seems like a good time to introduce a common DISCARD define to
>>> include/asm-generic/vmlinux.lds.h. Âconsidering multiple /DISCARD/
>>> entries are allowed in a linker script, the define should be pretty
>>> straightforward:
>>> #define DISCARDS \
>>> Â Â /DISCARD/ : { \
>>> Â Â Â Â EXIT_TEXT \
>>> Â Â Â Â EXIT_DATA \
>>> Â Â Â Â *(.exitcall.exit) \
>>> Â Â Â Â *(.discard) \
>>> Â Â }
>>
>> Hmmm... indeed, that would be nice. ÂI'll update the patch.
>
> Eh... handling of EXIT_TEXT and DATA aren't uniform across archs. ÂI
> think I'll leave the /DISCARD/ unification for the next time.

right, i think that's a bug where people simply forgot to declare
them. if you stick DISCARDS at the end (and only replace when an arch
already has it at the end), there should be no change in behavior.
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/