Re: [PATCH 1/23] make section names compatible with -ffunction-sections -fdata-sections

Eduard - Gabriel Munteanu
2008-07-02T01:38:25Z

On Wed, 2 Jul 2008 02:33:48 +0200
Denys Vlasenko <vda.linux@googlemail.com> wrote:

> Hi Andrew, folks,
>
> I am unsure how to synchronize propagation of these patches
> across all architectures.
>
> Andrew, how this can be done without causing lots of pain
> for arch maintainers? Please advise.

Hi,

AFAICS, there is a lot of code in .lds.S files which really is
arch-independent, but still is duplicated in every arch. Kinda messy to
change anything in there.

I noticed this while writing another patch, namely early (pre-SMP)
initcall support. Fortunately, there was a generic header included by
all .lds.S files and I could fit my modification in there.

My suggestion is (for both you and arch maintainers)... why not make an
effort to reduce code duplication in these files? Life would be so much
easier. The idea is:
- Write a macro to define all generic sections, possibly taking in
alignment as an argument.
- Have each arch's .lds.S file define arch-dependent stuff and use that
macro for generic sections.

This would surely be immediately useful, more readily accepted by
maintainers and would open up the way for a lighter version of your
patch, IMO.

Cheers,
Eduard