From: mmarek@suse.com (Michal Marek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: xip: Move XIP linking to a separate file
Date: Thu, 19 Nov 2015 17:21:06 +0100 [thread overview]
Message-ID: <564DF6F2.5090808@suse.com> (raw)
In-Reply-To: <HK2PR06MB0561F1A746E04D0A205B2DBB8A1B0@HK2PR06MB0561.apcprd06.prod.outlook.com>
On 2015-11-19 17:04, Chris Brandt wrote:
> On Thu, 19 Nov 2015, Michal Marek wrote:
>> Why not have a vmlinux.lds.S and #include a vmlinux-xip.lds.S /
>> vmlinux-nonxip.lds.S from there? That way, you do not clutter the
>> main Makefile and you can reuse the boilerplate of the linker script.
>>
>> Michal
>
> On Thu, 19 Nov 2015, Nicolas Pitre wrote:
>> I agree with Michal's suggestion to do the selection locally with an
>> include.
>
>
> That's actually how I started out locally, but I thought if I tried submitting that, I'd get a bunch of "Eww, that's ugly".
:-). It arguably is not the most beautiful pattern, but it is still easy
to understand and there is some prior art in the kernel already, where
we include variants of C / asm files from other source files:
arch/arm/mm/fault.c:#include "fsr-3level.c"
arch/arm/mm/fault.c:#include "fsr-2level.c"
arch/m68k/kernel/setup.c:#include "setup_mm.c"
arch/m68k/kernel/setup.c:#include "setup_no.c"
arch/powerpc/kvm/book3s_segment.S:#include "book3s_64_slb.S"
arch/powerpc/kvm/book3s_segment.S:#include "book3s_32_sr.S"
mm/percpu.c:#include "percpu-km.c"
mm/percpu.c:#include "percpu-vm.c"
UM even uses it in its linker script:
arch/um/kernel/vmlinux.lds.S:#include "uml.lds.S"
arch/um/kernel/vmlinux.lds.S:#include "dyn.lds.S"
Michal
next prev parent reply other threads:[~2015-11-19 16:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 14:24 [PATCH] ARM: xip: Move XIP linking to a separate file Chris Brandt
2015-11-19 15:07 ` Michal Marek
2015-11-19 15:54 ` Nicolas Pitre
2015-11-19 16:04 ` Chris Brandt
2015-11-19 16:21 ` Michal Marek [this message]
2015-11-19 16:26 ` Chris Brandt
2015-11-19 17:08 ` [PATCH v2] " Chris Brandt
2015-11-19 17:31 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564DF6F2.5090808@suse.com \
--to=mmarek@suse.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).