[PATCH 4/6] h8300 CONFIG_KALLSYMS fix - Kernel

This is a discussion on [PATCH 4/6] h8300 CONFIG_KALLSYMS fix - Kernel ; Please comment "C_SYMBOL_PREFIX". Makefile | 3 ++- arch/h8300/Kconfig | 4 ++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index c162370..745e31f 100644 --- a/Makefile +++ b/Makefile @@ -751,7 +751,8 @@ endef # Generate .S file with all ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: [PATCH 4/6] h8300 CONFIG_KALLSYMS fix

  1. [PATCH 4/6] h8300 CONFIG_KALLSYMS fix

    Please comment "C_SYMBOL_PREFIX".

    Makefile | 3 ++-
    arch/h8300/Kconfig | 4 ++++
    2 files changed, 6 insertions(+), 1 deletions(-)

    diff --git a/Makefile b/Makefile
    index c162370..745e31f 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -751,7 +751,8 @@ endef
    # Generate .S file with all kernel symbols
    quiet_cmd_kallsyms = KSYM $@
    cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \
    - $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
    + $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) \
    + $(if $(CONFIG_C_SYMBOL_PREFIX),--symbol-prefix='_') > $@

    .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE
    $(call if_changed_dep,as_o_S)
    diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
    index 085dc6e..2804edd 100644
    --- a/arch/h8300/Kconfig
    +++ b/arch/h8300/Kconfig
    @@ -87,6 +87,10 @@ config HZ
    int
    default 100

    +config C_SYMBOL_PREFIX
    + bool
    + default y
    +
    source "init/Kconfig"

    source "arch/h8300/Kconfig.cpu"
    --
    1.5.4.1

    --
    Yoshinori Sato

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH 4/6] h8300 CONFIG_KALLSYMS fix

    Signed-off-by: Yoshinori Sato

    At Sat, 16 Feb 2008 01:13:47 -0500,
    Yoshinori Sato wrote:
    >
    > Please comment "C_SYMBOL_PREFIX".
    >
    > Makefile | 3 ++-
    > arch/h8300/Kconfig | 4 ++++
    > 2 files changed, 6 insertions(+), 1 deletions(-)
    >
    > diff --git a/Makefile b/Makefile
    > index c162370..745e31f 100644
    > --- a/Makefile
    > +++ b/Makefile
    > @@ -751,7 +751,8 @@ endef
    > # Generate .S file with all kernel symbols
    > quiet_cmd_kallsyms = KSYM $@
    > cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \
    > - $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
    > + $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) \
    > + $(if $(CONFIG_C_SYMBOL_PREFIX),--symbol-prefix='_') > $@
    >
    > .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE
    > $(call if_changed_dep,as_o_S)
    > diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
    > index 085dc6e..2804edd 100644
    > --- a/arch/h8300/Kconfig
    > +++ b/arch/h8300/Kconfig
    > @@ -87,6 +87,10 @@ config HZ
    > int
    > default 100
    >
    > +config C_SYMBOL_PREFIX
    > + bool
    > + default y
    > +
    > source "init/Kconfig"
    >
    > source "arch/h8300/Kconfig.cpu"
    > --
    > 1.5.4.1
    >
    > --
    > Yoshinori Sato
    >

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [PATCH 4/6] h8300 CONFIG_KALLSYMS fix

    On Sat, 16 Feb 2008 01:13:47 -0500 Yoshinori Sato wrote:

    > Please comment "C_SYMBOL_PREFIX".
    >
    > Makefile | 3 ++-
    > arch/h8300/Kconfig | 4 ++++
    > 2 files changed, 6 insertions(+), 1 deletions(-)
    >
    > diff --git a/Makefile b/Makefile
    > index c162370..745e31f 100644
    > --- a/Makefile
    > +++ b/Makefile
    > @@ -751,7 +751,8 @@ endef
    > # Generate .S file with all kernel symbols
    > quiet_cmd_kallsyms = KSYM $@
    > cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \
    > - $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
    > + $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) \
    > + $(if $(CONFIG_C_SYMBOL_PREFIX),--symbol-prefix='_') > $@
    >
    > .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE
    > $(call if_changed_dep,as_o_S)
    > diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
    > index 085dc6e..2804edd 100644
    > --- a/arch/h8300/Kconfig
    > +++ b/arch/h8300/Kconfig
    > @@ -87,6 +87,10 @@ config HZ
    > int
    > default 100
    >
    > +config C_SYMBOL_PREFIX
    > + bool
    > + default y
    > +
    > source "init/Kconfig"
    >
    > source "arch/h8300/Kconfig.cpu"
    > --


    Sam looks after that code.

    None of these patches added your Signed-off-by:. Please confirm that it
    is OK if I add it.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: [PATCH 4/6] h8300 CONFIG_KALLSYMS fix

    On Fri, Feb 15, 2008 at 10:32:01PM -0800, Andrew Morton wrote:
    > On Sat, 16 Feb 2008 01:13:47 -0500 Yoshinori Sato wrote:
    >
    > > Please comment "C_SYMBOL_PREFIX".
    > >
    > > Makefile | 3 ++-
    > > arch/h8300/Kconfig | 4 ++++
    > > 2 files changed, 6 insertions(+), 1 deletions(-)
    > >
    > > diff --git a/Makefile b/Makefile
    > > index c162370..745e31f 100644
    > > --- a/Makefile
    > > +++ b/Makefile
    > > @@ -751,7 +751,8 @@ endef
    > > # Generate .S file with all kernel symbols
    > > quiet_cmd_kallsyms = KSYM $@
    > > cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \
    > > - $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
    > > + $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) \
    > > + $(if $(CONFIG_C_SYMBOL_PREFIX),--symbol-prefix='_') > $@
    > >
    > > .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE
    > > $(call if_changed_dep,as_o_S)
    > > diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
    > > index 085dc6e..2804edd 100644
    > > --- a/arch/h8300/Kconfig
    > > +++ b/arch/h8300/Kconfig
    > > @@ -87,6 +87,10 @@ config HZ
    > > int
    > > default 100
    > >
    > > +config C_SYMBOL_PREFIX
    > > + bool
    > > + default y
    > > +
    > > source "init/Kconfig"
    > >
    > > source "arch/h8300/Kconfig.cpu"
    > > --


    The intent with this patch is fine but we should go for
    another implementation.

    In arch/Kconfig we should put the general config symbol
    that says if we use '_' or not - where the default is to
    not use underscore.

    Something like this:
    diff --git a/arch/Kconfig b/arch/Kconfig
    index 3d72dc3..f2928c5 100644
    --- a/arch/Kconfig
    +++ b/arch/Kconfig
    @@ -29,3 +29,8 @@ config KPROBES

    config HAVE_KPROBES
    def_bool n
    +
    +# Architectures where binutils prefix C symbols with
    +# underscore '_' shall select this symbol.
    +config SYMBOL_C_PREFIX
    + bool


    Then in the relevant architectures we should do a

    config H8300
    + select SYMBOL_C_PREFIX # We prefix C symbols with '_'

    And we should do this for all the relevant architectures:
    blackfin, v850 springs to my mind.
    For the other archs as separate patches via the respective
    maintainers.

    Sam
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [PATCH 4/6] h8300 CONFIG_KALLSYMS fix

    On Sat, Feb 16, 2008 at 11:46:47AM +0100, Sam Ravnborg wrote:
    > Something like this:
    > diff --git a/arch/Kconfig b/arch/Kconfig
    > index 3d72dc3..f2928c5 100644
    > --- a/arch/Kconfig
    > +++ b/arch/Kconfig
    > @@ -29,3 +29,8 @@ config KPROBES
    >
    > config HAVE_KPROBES
    > def_bool n
    > +
    > +# Architectures where binutils prefix C symbols with
    > +# underscore '_' shall select this symbol.
    > +config SYMBOL_C_PREFIX
    > + bool
    >
    >
    > Then in the relevant architectures we should do a
    >
    > config H8300
    > + select SYMBOL_C_PREFIX # We prefix C symbols with '_'
    >
    > And we should do this for all the relevant architectures:
    > blackfin, v850 springs to my mind.
    > For the other archs as separate patches via the respective
    > maintainers.
    >

    It's really a product of the toolchain, not the architecture. For SH also
    we have some toolchains that do this, and others that don't. (Usually
    sh-elf insteatd of sh-linux, the -elf toolchains in general are pretty
    common for the nommu targets). In general we've just not supported the
    symbol prefixing toolchains, but if there's a way we can handle this
    cleanly at compile time then it's certainly worth trying to support.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread