lkml.org 
[lkml]   [2004]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: kernel-image-2.6.7
On Wed, Aug 25, 2004 at 10:50:36PM +0200, Geert Uytterhoeven wrote:

> Indeed, in arch/m68k/kernel/setup.o .bss and .init.data become zero-sized,
> while all other sections have the same size.
Not good.. Se below.

>
> If I do `make V=1 arch/m68k/kernel/setup.o', I get:
>
> | anakin$ make V=1 arch/m68k/kernel/setup.o
> | make -C /home/geert/linux/testing/linux-m68k-2.6.9-rc1 O=/home/geert/linux/testing/linux-m68k-2.6.x-amiga-mod arch/m68k/kernel/setup.o
> | make -C /home/geert/linux/testing/linux-m68k-2.6.x-amiga-mod \
> | KBUILD_SRC=/home/geert/linux/testing/linux-m68k-2.6.9-rc1 KBUILD_VERBOSE=1 \
> | KBUILD_CHECK= KBUILD_EXTMOD="" \
> | -f /home/geert/linux/testing/linux-m68k-2.6.9-rc1/Makefile arch/m68k/kernel/setup.o
> | make -f /home/geert/linux/testing/linux-m68k-2.6.9-rc1/scripts/Makefile.build obj=scripts/basic
> | make -f /home/geert/linux/testing/linux-m68k-2.6.9-rc1/scripts/Makefile.build obj=scripts
> | make -f /home/geert/linux/testing/linux-m68k-2.6.9-rc1/scripts/Makefile.build obj=scripts/genksyms
> | make -f /home/geert/linux/testing/linux-m68k-2.6.9-rc1/scripts/Makefile.build obj=scripts/mod
> | make -f /home/geert/linux/testing/linux-m68k-2.6.9-rc1/scripts/Makefile.build obj=arch/m68k/kernel arch/m68k/kernel/setup.o
> | m68k-linux-gcc -Wp,-MD,arch/m68k/kernel/.setup.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/geert/linux/testing/linux-m68k-2.6.9-rc1/include -I/home/geert/linux/testing/linux-m68k-2.6.9-rc1/arch/m68k/kernel -Iarch/m68k/kernel -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -fno-strength-reduce -ffixed-a2 -m68040 -O2 -fomit-frame-pointer -DKBUILD_BASENAME=setup -DKBUILD_MODNAME=setup -c -o arch/m68k/kernel/.tmp_setup.o /home/geert/linux/testing/linux-m68k-2.6.9-rc1/arch/m68k/kernel/setup.c
> | anakin$
>
> Note that according to the last line, m68k-linux-gcc will store its output in
> arch/m68k/kernel/.tmp_setup.o instead of arch/m68k/kernel/setup.o! But
> afterwards there is no arch/m68k/kernel/.tmp_setup.o, only
> arch/m68k/kernel/setup.o?
>
> If I execute the m68k-linux-gcc command by hand, it does create
> arch/m68k/kernel/.tmp_setup.o, and ... surprise! The sizes of the .bss and .init.data sections in that file are correct:
>
> | anakin$ m68k-linux-objdump -h arch/m68k/kernel/.tmp_setup.o
> |
> | arch/m68k/kernel/.tmp_setup.o: file format elf32-m68k
> |
> | Sections:
> | Idx Name Size VMA LMA File off Algn
> | 0 .text 0000024a 00000000 00000000 00000034 2**2
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
> | 1 .data 0000001a 00000000 00000000 00000280 2**2
> | CONTENTS, ALLOC, LOAD, RELOC, DATA
> | 2 .bss 00000188 00000000 00000000 0000029c 2**2
> ^^^^^^^^
> | ALLOC
> | 3 .note 00000014 00000000 00000000 0000029c 2**0
> | CONTENTS, READONLY
> | 4 .init.data 00000008 00000000 00000000 000002b0 2**1
> ^^^^^^^^
> | CONTENTS, ALLOC, LOAD, DATA
> | 5 __kcrctab 00000004 00000000 00000000 000002b8 2**1
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
> | 6 __ksymtab_strings 0000000f 00000000 00000000 000002bc 2**0
> | CONTENTS, ALLOC, LOAD, READONLY, DATA
> | 7 __ksymtab 00000008 00000000 00000000 000002cc 2**1
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
> | 8 .rodata 00000256 00000000 00000000 000002d4 2**0
> | CONTENTS, ALLOC, LOAD, READONLY, DATA
> | 9 .init.text 00000396 00000000 00000000 0000052a 2**1
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
> | 10 .comment 0000002f 00000000 00000000 000008c0 2**0
> | CONTENTS, READONLY
> | anakin$
>
> while .bss and .init.data are of size zero in arch/m68k/kernel/setup.o:
>
> | anakin$ m68k-linux-objdump -h arch/m68k/kernel/setup.o
> |
> | arch/m68k/kernel/setup.o: file format elf32-m68k
> |
> | Sections:
> | Idx Name Size VMA LMA File off Algn
> | 0 .text 0000024a 00000000 00000000 00000034 2**2
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
> | 1 __kcrctab 00000004 00000000 00000000 0000027e 2**1
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
> | 2 __ksymtab_strings 0000000f 00000000 00000000 00000282 2**0
> | CONTENTS, ALLOC, LOAD, READONLY, DATA
> | 3 __ksymtab 00000008 00000000 00000000 00000292 2**1
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA
> | 4 .rodata 00000256 00000000 00000000 0000029a 2**0
> | CONTENTS, ALLOC, LOAD, READONLY, DATA
> | 5 .init.text 00000396 00000000 00000000 000004f0 2**1
> | CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
> | 6 .data 0000001a 00000000 00000000 00000888 2**2
> | CONTENTS, ALLOC, LOAD, RELOC, DATA
> | 7 .bss 00000000 00000000 00000000 000008a4 2**2
> ^^^^^^^^
> | ALLOC
> | 8 .init.data 00000000 00000000 00000000 000008a4 2**1
> ^^^^^^^^
> | CONTENTS, ALLOC, LOAD, DATA
> | 9 .note 00000014 00000000 00000000 000008a4 2**0
> | CONTENTS, READONLY
> | 10 .comment 0000002f 00000000 00000000 000008b8 2**0
> | CONTENTS, READONLY
> | anakin$
>
> Now the remaining questions are:
> 1. Why does kbuild create arch/m68k/kernel/.tmp_setup.o?
> 2. How does kbuild create setup.o from .tmp_setup.o, destroying .bss and
> .init.data?
> 3. Why doesn't the above step show up with `make V=1'?
>
> [ digging into scripts/Makefile.build ]
>
> Aha, kbuild does this only if CONFIG_MODVERSIONS=y.
>
> So it goes wrong during this step:
>
> | m68k-linux-ld -r -o x.o arch/m68k/kernel/.tmp_setup.o -T \
> | arch/m68k/kernel/.tmp_setup.ver
>
> | anakin$ cat arch/m68k/kernel/.tmp_setup.ver
> | __crc_mach_heartbeat = 0x39638af7 ;
> | anakin$

A bit code from Makefile.build:
cmd_modversions = \
if ! $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
mv $(@D)/.tmp_$(@F) $@; \
else \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \
| $(GENKSYMS) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
fi;

First part checks if there is any exported symbols - which we have in this case.
The $(CPP) and $(GENKSYMS) part finds exported symbols and creates the .ver file.
Your .ver file looked fine - so this step has succeded..
Then we do the linking.

Could you try to stuff in an echo line here - something like:
echo $(LD) $(LDFLAGS) \
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \

Just to be confirmed that there is no LDFLAGS that fouls us here.

Otherwise I have no good suggestions.

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/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.119 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site