This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Kernel Linking Issue? (comparison between binutils 2.11.2 with binutils-cvs)


I've been trying to compile the linux kernel 2.6.5 for a Sharp PDA (SL-C760)
which is Arm PXA255 based. I've been using a cross compiler build using
openembedded (http://openembedded.org/). I'm using gcc 3.3.3 and binutils
from CVS (I tried 2.15.90.0.3 prior to this with the same results).

I've not been having much success as everything compiles but fails very
early in the boot process (the kernel image doesn't get uncompressed). The
stack section of the zImage file appears not the get linked.

In an effort to track down the problem I've been comparing things with a
working 2.4.18 kernel which was built using gcc 2.95.3 and bintuils 2.11.2.

If I take the final output objects from the 2.4.18 build and link them using
binutils from CVS I get different results from when I link them using
bintuils 2.11.2.

The linker commands I'm using are:

/usr/tmp4/build/tmp/cross/bin/arm-linux-ld   \
-p --no-undefined -X   \
/usr/tmp4/build/tmp/cross/lib/gcc-lib/arm-linux/3.3.3/libgcc.a \
-T vmlinux.lds \
head.o piggy.o misc.o head-xscale.o -o a-vmlinux

/usr/local/arm/2.95.3/bin/arm-linux-ld \
-p --no-undefined -X \
/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/libgcc.a \
-T vmlinux.lds \
head.o piggy.o misc.o head-xscale.o -o b-vmlinux

(It doesn't matter which libgcc I actually use - the results are the same).

Both resulting vmlinux files are the same size however when I run the final
command to generate the zImage file:

/usr/tmp4/build/tmp/cross/bin/arm-linux-objcopy -O binary \
-R .note -R .comment -S  b-vmlinux zImage

The zImage differs depending on which arm-linux-ld I used. The big problem
is that for cvs binutils, the stack section disappears which is probably a
large factor in the image not booting.

To me the differences appear to be in vmlinux. I've put up a number of files
at http://www.rpsys.net/linker/ in the hope that someone can help me track
this problem down.

I've run objdump -x, objdump -xs and objdump --syms on both vmlinux files
and the differences are in vmlinux.*diff.

Things I noticed:

"Contents of section .stack:" is completely missing from one of the
objdump -xs vmlinux outputs.
When the headers are dumped, .stack is listed as just "ALLOC" instead of
"CONTENTS, ALLOC, LOAD, DATA
"
   5 .stack        00001000  000f6668  000f6668  000f6230  2**0
-                  ALLOC
+                  CONTENTS, ALLOC, LOAD, DATA

Could someone have a look and tell me why the .stack section disappears from
zImage (or as I guess the question becomes, why its not being marked as
CONTENTS,LOAD,DATA)?. Is this a problem with my linker options, the
vmlinux.lds file or a problem with binutils itself?

Any help in tracking this down further would be appreciated. I'm happy to
provide any further information anyone needs.

(Please cc me in any messages to the list)

Thanks,

RP


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]