public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] *.lds for examples
@ 2004-10-07 23:21 Robin Getz
  2004-10-08  0:12 ` Detlev Zundel
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Getz @ 2004-10-07 23:21 UTC (permalink / raw)
  To: u-boot

I noticed there was linker files for the examples directory for two 
architectures (mips and nios), but was struggling to figure out where the 
default came from. If I have architecture specific examples, do I need to 
add lds file for the examples?

I was trying to add an example, and was unable to get things to work 
properly. To start I tried just copying the hello_world.c to a 
smc91111_eeprom.c, and making what I thought were the correct entries in 
the examples/Makefile and top level Makefile (for make clean only).

However, if smc91111_eeprom and hello_world.c are exactly the same, I end 
up with different object files, because the entry point is different. The 
following linker error occurs

/home/rgetz/uClinux/toolchainoutput/bin/bfin-elf-ld.real: warning: cannot 
find entry symbol smc91111_eeprom; defaulting to 00001000

So, where is the entry point set?

The actual make looked OK to me (sorry for the long lines):
bfin-elf-gcc  -O0  -ffixed-P5 -D__KERNEL__ -DTEXT_BASE=0x20000000 
-I/home/rgetz/u-boot/u-boot_1.1.1/include -fno-built in -ffreestanding 
-nostdinc -isystem 
/home/rgetz/uClinux/toolchainoutput/lib/gcc-lib/bfin-elf/3.3.3/include
-pipe  -D_
_BLACKFIN__ -mno-underscore -DCONFIG_blackfin -D__blackfin__
-I/home/rgetz/u-boot/u-boot_1.1.1 -Wall -Wstrict-prototyp es -c -o 
hello_world.o hello_world.c bfin-elf-ld -g  -Ttext 0x1000 \
         -o hello_world -e hello_world hello_world.o libstubs.a \
         -L/home/rgetz/uClinux/toolchainoutput/lib/gcc-lib/bfin-elf/3.3.3
-lgcc
bfin-elf-objcopy -O srec hello_world hello_world.srec 2>/dev/null 
bfin-elf-gcc  -O0  -ffixed-P5 -D__KERNEL__ -DTEXT_BASE=0x20000000 
-I/home/rgetz/u-boot/u-boot_1.1.1/include -fno-built in -ffreestanding 
-nostdinc -isystem 
/home/rgetz/uClinux/toolchainoutput/lib/gcc-lib/bfin-elf/3.3.3/include
-pipe  -D_
_BLACKFIN__ -mno-underscore -DCONFIG_blackfin -D__blackfin__
-I/home/rgetz/u-boot/u-boot_1.1.1 -Wall -Wstrict-prototyp es -c -o 
smc91111_eeprom.o smc91111_eeprom.c bfin-elf-ld -g  -Ttext 0x1000 \
         -o smc91111_eeprom -e smc91111_eeprom smc91111_eeprom.o libstubs.a \
         -L/home/rgetz/uClinux/toolchainoutput/lib/gcc-lib/bfin-elf/3.3.3
-lgcc
bfin-elf-objcopy -O srec smc91111_eeprom smc91111_eeprom.srec 2>/dev/null 
bfin-elf-objcopy -O binary hello_world hello_world.bin 2>/dev/null 
bfin-elf-objcopy -O binary smc91111_eeprom smc91111_eeprom.bin 2>/dev/null

Any thoughts?

pointers appreciated.

Thanks
-Robin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] *.lds for examples
  2004-10-07 23:21 [U-Boot-Users] *.lds for examples Robin Getz
@ 2004-10-08  0:12 ` Detlev Zundel
  0 siblings, 0 replies; 2+ messages in thread
From: Detlev Zundel @ 2004-10-08  0:12 UTC (permalink / raw)
  To: u-boot

Hi Robin,

> I was trying to add an example, and was unable to get things to work
> properly. To start I tried just copying the hello_world.c to a
> smc91111_eeprom.c, and making what I thought were the correct entries
> in the examples/Makefile and top level Makefile (for make clean only).

Did you change the function name to smc9111_eeprom too?

> So, where is the entry point set?
>
> The actual make looked OK to me (sorry for the long lines):
> bfin-elf-gcc  -O0  -ffixed-P5 -D__KERNEL__ -DTEXT_BASE=0x20000000
> -I/home/rgetz/u-boot/u-boot_1.1.1/include -fno-built in -ffreestanding
> -nostdinc -isystem
> /home/rgetz/uClinux/toolchainoutput/lib/gcc-lib/bfin-elf/3.3.3/include
> -pipe  -D_
> _BLACKFIN__ -mno-underscore -DCONFIG_blackfin -D__blackfin__
> -I/home/rgetz/u-boot/u-boot_1.1.1 -Wall -Wstrict-prototyp es -c -o 
> hello_world.o hello_world.c bfin-elf-ld -g  -Ttext 0x1000 \
>          -o hello_world -e hello_world hello_world.o libstubs.a \
                          ^^^^^^^^^^^^^^
                               here
>          -L/home/rgetz/uClinux/toolchainoutput/lib/gcc-lib/bfin-elf/3.3.3
> -lgcc

The -e option (see info(ld)) is generated in the Makefile from the object
file name so probably the function in your object file was still
called 'hello_world'....

Cheers
  Detlev


-- 
Zivilisation ist der Zaubertrick, der uns unsere wahre Natur verbirgt.
                                            -- Salman Rushdie

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-08  0:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-07 23:21 [U-Boot-Users] *.lds for examples Robin Getz
2004-10-08  0:12 ` Detlev Zundel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox