diff mbox

[5/9] arm64: Fix include header order in vmlinux.lds.S

Message ID 314ef77423f90ed407b54b4658ea41a96b6f6170.1408736066.git.geoff@infradead.org (mailing list archive)
State New, archived
Headers show

Commit Message

Geoff Levand Aug. 22, 2014, 7:49 p.m. UTC
asm-generic/vmlinux.lds.h should be included after the arch
specific headers so that the arch headers can override the
generic macro defs in asm-generic/vmlinux.lds.h.

Fixes preprosessor redefined warnings when adding arch specific
macros.

Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
 arch/arm64/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Rutland Aug. 26, 2014, 4:27 p.m. UTC | #1
On Fri, Aug 22, 2014 at 08:49:16PM +0100, Geoff Levand wrote:
> asm-generic/vmlinux.lds.h should be included after the arch
> specific headers so that the arch headers can override the
> generic macro defs in asm-generic/vmlinux.lds.h.
> 
> Fixes preprosessor redefined warnings when adding arch specific
> macros.

A sample of those warnings would be nice. What do you see being
redefined?

Thanks,
Mark.

> Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> ---
>  arch/arm64/kernel/vmlinux.lds.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
> index fbb1af7..8dc1d46 100644
> --- a/arch/arm64/kernel/vmlinux.lds.S
> +++ b/arch/arm64/kernel/vmlinux.lds.S
> @@ -4,10 +4,10 @@
>   * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
>   */
>  
> -#include <asm-generic/vmlinux.lds.h>
>  #include <asm/thread_info.h>
>  #include <asm/memory.h>
>  #include <asm/page.h>
> +#include <asm-generic/vmlinux.lds.h>
>  
>  #include "image.h"
>  
> -- 
> 1.9.1
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Geoff Levand Aug. 26, 2014, 7:27 p.m. UTC | #2
Hi Mark,

On Tue, 2014-08-26 at 17:27 +0100, Mark Rutland wrote:
> On Fri, Aug 22, 2014 at 08:49:16PM +0100, Geoff Levand wrote:
> > asm-generic/vmlinux.lds.h should be included after the arch
> > specific headers so that the arch headers can override the
> > generic macro defs in asm-generic/vmlinux.lds.h.
> > 
> > Fixes preprosessor redefined warnings when adding arch specific
> > macros.
> 
> A sample of those warnings would be nice. What do you see being
> redefined?

In testing I wanted to set LOAD_OFFSET.  If gave warnings like
these:

  arch/arm64/include/asm/page.h: warning: "LOAD_OFFSET" redefined [enabled by default]

I'll send out another patch with updated message.

-Geoff
Catalin Marinas Aug. 27, 2014, 8:24 a.m. UTC | #3
On Tue, Aug 26, 2014 at 08:27:30PM +0100, Geoff Levand wrote:
> On Tue, 2014-08-26 at 17:27 +0100, Mark Rutland wrote:
> > On Fri, Aug 22, 2014 at 08:49:16PM +0100, Geoff Levand wrote:
> > > asm-generic/vmlinux.lds.h should be included after the arch
> > > specific headers so that the arch headers can override the
> > > generic macro defs in asm-generic/vmlinux.lds.h.
> > > 
> > > Fixes preprosessor redefined warnings when adding arch specific
> > > macros.
> > 
> > A sample of those warnings would be nice. What do you see being
> > redefined?
> 
> In testing I wanted to set LOAD_OFFSET.  If gave warnings like
> these:
> 
>   arch/arm64/include/asm/page.h: warning: "LOAD_OFFSET" redefined [enabled by default]
> 
> I'll send out another patch with updated message.

We currently don't define LOAD_OFFSET, so it would be good to see
what/why it is defined to. You could keep this patch as part of the
series introducing LOAD_OFFSET.
Geoff Levand Aug. 29, 2014, 9:53 p.m. UTC | #4
Hi Catalin,

On Wed, 2014-08-27 at 09:24 +0100, Catalin Marinas wrote:
> On Tue, Aug 26, 2014 at 08:27:30PM +0100, Geoff Levand wrote:
> > On Tue, 2014-08-26 at 17:27 +0100, Mark Rutland wrote:
> > > On Fri, Aug 22, 2014 at 08:49:16PM +0100, Geoff Levand wrote:
> > > > asm-generic/vmlinux.lds.h should be included after the arch
> > > > specific headers so that the arch headers can override the
> > > > generic macro defs in asm-generic/vmlinux.lds.h.
> > > > 
> > > > Fixes preprosessor redefined warnings when adding arch specific
> > > > macros.
> > > 
> > > A sample of those warnings would be nice. What do you see being
> > > redefined?
> > 
> > In testing I wanted to set LOAD_OFFSET.  If gave warnings like
> > these:
> > 
> >   arch/arm64/include/asm/page.h: warning: "LOAD_OFFSET" redefined [enabled by default]
> > 
> > I'll send out another patch with updated message.
> 
> We currently don't define LOAD_OFFSET, so it would be good to see
> what/why it is defined to. You could keep this patch as part of the
> series introducing LOAD_OFFSET.

Sorry I wasn't clear on this, but I have no plan to define an arm64
specific LOAD_OFFSET.  This patch was intended to add consistency
to the output section definitions in the arm64 linker script, and to
also make the output section definitions in the arm64 linker script
consistent with the way other architectures have their output sections
defined.

If this is not enough motivation for you to be interested in this,
then I won't bother to send out that updated patch.  Please let me
know.

-Geoff
diff mbox

Patch

diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index fbb1af7..8dc1d46 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -4,10 +4,10 @@ 
  * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
  */
 
-#include <asm-generic/vmlinux.lds.h>
 #include <asm/thread_info.h>
 #include <asm/memory.h>
 #include <asm/page.h>
+#include <asm-generic/vmlinux.lds.h>
 
 #include "image.h"