x86: relocs is only used with 32bit
diff mbox series

Message ID 49B80F7B.2020007@kernel.org
State New, archived
Headers show
Series
  • x86: relocs is only used with 32bit
Related show

Commit Message

Yinghai Lu March 11, 2009, 7:22 p.m. UTC
Impact: cleanup

those lines is not needed for 64bit

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/boot/compressed/Makefile |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
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/

Comments

H. Peter Anvin March 12, 2009, 4:28 a.m. UTC | #1
Hi Yinghai,

In general I prefer minimizing the conditional sections rather than
maximizing them.  If nothing else, it catches errors earlier that way,
and makes it easier to eventually eliminate them entirely.

	-hpa

Yinghai Lu wrote:
> Impact: cleanup
> 
> those lines is not needed for 64bit
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> ---
>  arch/x86/boot/compressed/Makefile |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> Index: linux-2.6/arch/x86/boot/compressed/Makefile
> ===================================================================
> --- linux-2.6.orig/arch/x86/boot/compressed/Makefile
> +++ linux-2.6/arch/x86/boot/compressed/Makefile
> @@ -26,6 +26,7 @@ OBJCOPYFLAGS_vmlinux.bin :=  -R .comment
>  $(obj)/vmlinux.bin: vmlinux FORCE
>  	$(call if_changed,objcopy)
>  
> +ifeq ($(CONFIG_X86_32),y)
>  
>  targets += vmlinux.bin.all vmlinux.relocs relocs
>  hostprogs-$(CONFIG_X86_32) += relocs
> @@ -42,8 +43,6 @@ quiet_cmd_relocbin = BUILD   $@
>  $(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
>  	$(call if_changed,relocbin)
>  
> -ifeq ($(CONFIG_X86_32),y)
> -
>  ifdef CONFIG_RELOCATABLE
>  $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
>  	$(call if_changed,gzip)
Eric W. Biederman March 13, 2009, 10:29 p.m. UTC | #2
"H. Peter Anvin" <hpa@zytor.com> writes:

> Hi Yinghai,
>
> In general I prefer minimizing the conditional sections rather than
> maximizing them.  If nothing else, it catches errors earlier that way,
> and makes it easier to eventually eliminate them entirely.

Makes sense.  Although in this case that rule appears like it
can't even execute on x86_64.

The architectural differences result in different tradeoffs so the
relocation design is completely different on x86_64 and x86_32.

On x86_64 we just change the underlying page tables to point
at different physical addresses and have a fixed virtual address.
Since x86_64 is best with short (< 2GB) offsets that is a fairly
optimal.

On x86_32 where address space is precious and it doesn't really
matter where the kernel lives we take a 5% or so size penalty
to hold relocations in the binary and update the kernel at boot
time so everything assumes we run at the loaded address.

With the result that we need a link time helper on x86_32 and
not on x86_64.

Eric

--
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/
H. Peter Anvin March 13, 2009, 11:31 p.m. UTC | #3
Eric W. Biederman wrote:
>>
>> In general I prefer minimizing the conditional sections rather than
>> maximizing them.  If nothing else, it catches errors earlier that way,
>> and makes it easier to eventually eliminate them entirely.
> 
> Makes sense.  Although in this case that rule appears like it
> can't even execute on x86_64.
> 

That's fine.  This is the same reason why it's better to have
if () { ... } than #ifdef as long as the condition can be statically 
determined -- at least this way make will complain about a syntax error.

	-hpa
--
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/

Patch
diff mbox series

Index: linux-2.6/arch/x86/boot/compressed/Makefile
===================================================================
--- linux-2.6.orig/arch/x86/boot/compressed/Makefile
+++ linux-2.6/arch/x86/boot/compressed/Makefile
@@ -26,6 +26,7 @@  OBJCOPYFLAGS_vmlinux.bin :=  -R .comment
 $(obj)/vmlinux.bin: vmlinux FORCE
 	$(call if_changed,objcopy)
 
+ifeq ($(CONFIG_X86_32),y)
 
 targets += vmlinux.bin.all vmlinux.relocs relocs
 hostprogs-$(CONFIG_X86_32) += relocs
@@ -42,8 +43,6 @@  quiet_cmd_relocbin = BUILD   $@
 $(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
 	$(call if_changed,relocbin)
 
-ifeq ($(CONFIG_X86_32),y)
-
 ifdef CONFIG_RELOCATABLE
 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
 	$(call if_changed,gzip)