[U-Boot-Users] Re: MIPS LE build problems

Wolfgang Denk wd at denx.de
Thu Aug 18 23:38:25 CEST 2005


In message <4304D3FD.7080107 at smiths-aerospace.com> you wrote:
>
> As noted in other email in this thread, executing the above code won't 
> work.  What about simply compiling a file containing:
> 
> constant int data = 0x01234567;
> 
> objdumping the data section, and looking (grepping) to see if the data 
> section has 0x12345678 or 0x78563412?

Doesn't work as objdump will be user friendly and  always  print  the
"correct" value, i. e. 0x01234567.

But the idea is good.

The attached test script works with the tool chains available to  me.
Can others please test this, too?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Many aligators will be slain, but the swamp will remain.

-------------- next part --------------
#!/bin/sh

set -e
# make sure CROSS_COMPILE is defined
[ "${CROSS_COMPILE}" ]

# create temp directory
TMPDIR=`mktemp -d`

# and make sure it gets removed automagically
trap 'rm -fr ${TMPDIR}' 0 1 2 3 15

>${TMPDIR}/foo.c
${CROSS_COMPILE}gcc -c ${TMPDIR}/foo.c -o ${TMPDIR}/foo.o
readelf -h ${TMPDIR}/foo.o | \
sed -n 's/.*Data:.* \([^ ][^ ]*\) endian/\1/p'

exit 0


More information about the U-Boot mailing list