Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1335584 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-02-16 17:10 +0100 |
| Last post | 2016-02-16 17:40 +0100 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/2] ARM: mm: hide __start_rodata_section_aligned for non-debug builds Arnd Bergmann <arnd@arndb.de> - 2016-02-16 17:10 +0100
Re: [PATCH 2/2] ARM: mm: hide __start_rodata_section_aligned for non-debug builds Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-02-16 17:20 +0100
Re: [PATCH 2/2] ARM: mm: hide __start_rodata_section_aligned for non-debug builds Arnd Bergmann <arnd@arndb.de> - 2016-02-16 17:40 +0100
Re: [PATCH 2/2] ARM: mm: hide __start_rodata_section_aligned for non-debug builds Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-02-16 17:40 +0100
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-02-16 17:10 +0100 |
| Subject | [PATCH 2/2] ARM: mm: hide __start_rodata_section_aligned for non-debug builds |
| Message-ID | <r2Qmm-1Is-11@gated-at.bofh.it> |
The __start_rodata_section_aligned is only referenced by the
DEBUG_RODATA code, which is only used when the MMU is enabled,
but the definition fails on !MMU builds:
arch/arm/kernel/vmlinux.lds:702: undefined symbol `SECTION_SHIFT' referenced in expression
This hides the symbol whenever DEBUG_RODATA is disabled.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 64ac2e74f0b2 ("ARM: 8502/1: mm: mark section-aligned portion of rodata NX")
---
arch/arm/kernel/vmlinux.lds.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 2d7085ae1c2f..bb12933aee22 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -322,12 +322,14 @@ SECTIONS
STABS_DEBUG
}
+#ifdef CONFIG_DEBUG_RODATA
/*
* Without CONFIG_DEBUG_ALIGN_RODATA, __start_rodata_section_aligned will
* be the first section-aligned location after __start_rodata. Otherwise,
* it will be equal to __start_rodata.
*/
__start_rodata_section_aligned = ALIGN(__start_rodata, 1 << SECTION_SHIFT);
+#endif
/*
* These must never be empty
--
2.7.0
[toc] | [next] | [standalone]
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Date | 2016-02-16 17:20 +0100 |
| Subject | Re: [PATCH 2/2] ARM: mm: hide __start_rodata_section_aligned for non-debug builds |
| Message-ID | <r2Qw2-1LV-11@gated-at.bofh.it> |
| In reply to | #1335584 |
On 16 February 2016 at 17:03, Arnd Bergmann <arnd@arndb.de> wrote:
> The __start_rodata_section_aligned is only referenced by the
> DEBUG_RODATA code, which is only used when the MMU is enabled,
> but the definition fails on !MMU builds:
>
> arch/arm/kernel/vmlinux.lds:702: undefined symbol `SECTION_SHIFT' referenced in expression
>
> This hides the symbol whenever DEBUG_RODATA is disabled.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 64ac2e74f0b2 ("ARM: 8502/1: mm: mark section-aligned portion of rodata NX")
> ---
> arch/arm/kernel/vmlinux.lds.S | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
> index 2d7085ae1c2f..bb12933aee22 100644
> --- a/arch/arm/kernel/vmlinux.lds.S
> +++ b/arch/arm/kernel/vmlinux.lds.S
> @@ -322,12 +322,14 @@ SECTIONS
> STABS_DEBUG
> }
>
> +#ifdef CONFIG_DEBUG_RODATA
> /*
> * Without CONFIG_DEBUG_ALIGN_RODATA, __start_rodata_section_aligned will
> * be the first section-aligned location after __start_rodata. Otherwise,
> * it will be equal to __start_rodata.
> */
> __start_rodata_section_aligned = ALIGN(__start_rodata, 1 << SECTION_SHIFT);
> +#endif
>
Does
PROVIDE(__start_rodata_section_aligned = xxx);
do the trick as well? If it does, it's a bit cleaner.
[toc] | [prev] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-02-16 17:40 +0100 |
| Message-ID | <r2QPo-1Uv-15@gated-at.bofh.it> |
| In reply to | #1335599 |
On Tuesday 16 February 2016 17:12:52 Ard Biesheuvel wrote: > > +#ifdef CONFIG_DEBUG_RODATA > > /* > > * Without CONFIG_DEBUG_ALIGN_RODATA, __start_rodata_section_aligned will > > * be the first section-aligned location after __start_rodata. Otherwise, > > * it will be equal to __start_rodata. > > */ > > __start_rodata_section_aligned = ALIGN(__start_rodata, 1 << SECTION_SHIFT); > > +#endif > > > > Does > > PROVIDE(__start_rodata_section_aligned = xxx); > > do the trick as well? If it does, it's a bit cleaner. > I would assume not, as the problem is that SECTION_SHIFT is a macro that is not defined when the MMU is disabled. Arnd
[toc] | [prev] | [next] | [standalone]
| From | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
|---|---|
| Date | 2016-02-16 17:40 +0100 |
| Subject | Re: [PATCH 2/2] ARM: mm: hide __start_rodata_section_aligned for non-debug builds |
| Message-ID | <r2QPo-1Uv-23@gated-at.bofh.it> |
| In reply to | #1335618 |
On 16 February 2016 at 17:34, Arnd Bergmann <arnd@arndb.de> wrote: > On Tuesday 16 February 2016 17:12:52 Ard Biesheuvel wrote: >> > +#ifdef CONFIG_DEBUG_RODATA >> > /* >> > * Without CONFIG_DEBUG_ALIGN_RODATA, __start_rodata_section_aligned will >> > * be the first section-aligned location after __start_rodata. Otherwise, >> > * it will be equal to __start_rodata. >> > */ >> > __start_rodata_section_aligned = ALIGN(__start_rodata, 1 << SECTION_SHIFT); >> > +#endif >> > >> >> Does >> >> PROVIDE(__start_rodata_section_aligned = xxx); >> >> do the trick as well? If it does, it's a bit cleaner. >> > > I would assume not, as the problem is that SECTION_SHIFT is a macro that > is not defined when the MMU is disabled. > I just tested it myself, and it in fact does work. PROVIDE() means the expression is evaluated lazily, and SECTION_SHIFT is just an undefined identifier in the linker script scope if the preprocessor does not define it. Anyway, I don't have a strong preference, so ack either way.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web