can I build binutil with elf32-tradlittlemips support

loody miloody@gmail.com
Sun Nov 22 16:52:00 GMT 2009


Hi all:

I have something wired and I have no idea whether it comes with
elf32-littlemips and elf32-tradlittlemips these 2 different mips link
format.

1. I have 2 mips-toolchains, tool A, one support elf32-tradlittlemips
with gcc 3.4.4, and, tool B, generated by cross-ng which support
elf32-littlemips with gcc4.2.1.
2. I compile my test program with these 2 toolchain with "-c -g "
option, and i can see source codes embedded in *.o, the elf output I
build.
3. but after I use linker to link them together, I can see the source
codes embedded in the final ELF output with tool A build, but tool B
cannot.

I know the version of these toolchains is quite different, 4.2.1 vs 3.4.4.
But everything seems fine before final linking, and the parameters i
pass to ld are the same, except the output format they support.

Is there any document or steps can tell me how to generate binutils
which supports elf32-tradlittlemips such that I can do the comparison,
since i cannot see any setting about these 2 format in ct-ng
menuconfig.

I attach my result and commands at the end of letter for your reference.
appreciate your help,
miloody


/* source codes not embedded in the elf*/
80000298 <main>:
80000298:       27bdffd8        addiu   sp,sp,-40
8000029c:       afbf0024        sw      ra,36(sp)
800002a0:       afbe0020        sw      s8,32(sp)
800002a4:       03a0f021        move    s8,sp
800002a8:       24020017        li      v0,23
800002ac:       afc20018        sw      v0,24(s8)
800002b0:       24020020        li      v0,32
800002b4:       afc20014        sw      v0,20(s8)
800002b8:       2402002c        li      v0,44
800002bc:       afc20010        sw      v0,16(s8)
800002c0:       8fc30018        lw      v1,24(s8)
800002c4:       8fc20014        lw      v0,20(s8)
800002c8:       00621821        addu    v1,v1,v0
800002cc:       8fc20010        lw      v0,16(s8)
800002d0:       00621021        addu    v0,v1,v0
800002d4:       afc20018        sw      v0,24(s8)
800002d8:       24040100        li      a0,256
800002dc:       0c0000d8        jal     80000360 <malloc>
800002e0:       00000000        nop
800002e4:       afc2001c        sw      v0,28(s8)
800002e8:       0c00009e        jal     80000278 <newline>
800002ec:       00000000        nop
800002f0:       03c0e821        move    sp,s8
800002f4:       8fbf0024        lw      ra,36(sp)
800002f8:       8fbe0020        lw      s8,32(sp)
800002fc:       27bd0028        addiu   sp,sp,40

/*source code is embedded in elf*/
int main()
//int c_entry()
{
 90:   27bdffd8        addiu   sp,sp,-40
 94:   afbf0024        sw      ra,36(sp)
 98:   afbe0020        sw      s8,32(sp)
 9c:   03a0f021        move    s8,sp
char * point;
int a,b,c;
a =23;
 a0:   24020017        li      v0,23
 a4:   afc20018        sw      v0,24(s8)
b = 32;
 a8:   24020020        li      v0,32
 ac:   afc20014        sw      v0,20(s8)
c = 44;
 b0:   2402002c        li      v0,44
 b4:   afc20010        sw      v0,16(s8)
a = a+b+c;
 b8:   8fc30018        lw      v1,24(s8)
 bc:   8fc20014        lw      v0,20(s8)
 c0:   00621821        addu    v1,v1,v0
 c4:   8fc20010        lw      v0,16(s8)
 c8:   00621021        addu    v0,v1,v0
 cc:   afc20018        sw      v0,24(s8)

/*my commands that I can see source */
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -D_ASSEMBLER_  -c
init.S
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -D_ASSEMBLER_  -c
reset.S
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -c atexit.c
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -c main.c
mipsel-unknown-elf-ld -T ./link.xn -o TestCode.elf -Map TestCode.map
--oformat elf32-littlemips  init.o reset.o atexit.o main.o -static
-nostdlib -L/media/sdb1/newlib-1.17.0/build/mipsel/lib
-L/root/bare_metal/x-tools/mipsel-unknown-elf/lib/gcc/mipsel-unknown-elf/4.2.4
 -lc -lnullmon -lgcc
rm -f TestCode.dla
rm -f TestCode.dnm

/* commands that I cannot see source
sde-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -D_ASSEMBLER_  -c
init.S
sde-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -D_ASSEMBLER_  -c
reset.S
sde-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -c atexit.c
sde-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -c main.c
sde-ld -T ./link.xn -o TestCode.elf -Map TestCode.map --oformat
elf32-tradlittlemips  init.o reset.o atexit.o main.o -static -nostdlib
-L/media/sdb1/newlib-1.17.0/build/mipsel/lib
-L/root/bare_metal/x-tools/sde/lib/gcc/3.4.4/el  -lc -lnullmon -lgcc
rm -f TestCode.dla

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list