This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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

RE: --entry= (slightly off topic)


I don't know why it wasn't working before, but it works now.  I must
have done something odd that caused it not to work.

Will the all the 0x8000s be removed with a linker script then?

-----Original Message-----
From: Fabrice Gautier [mailto:Fabrice_Gautier@sdesigns.com] 
Sent: Thursday, September 20, 2001 5:38 PM
To: 'Trenton D. Adams'; 'eCos Discussion'
Subject: RE: [ECOS] --entry= (slightly off topic)




> -----Original Message-----
> From: Trenton D. Adams [mailto:tadams@theone.dnsalias.com]
> Sent: Thursday, September 20, 2001 4:13 PM
> To: 'Fabrice Gautier'; 'eCos Discussion'
> Subject: RE: [ECOS] --entry= (slightly off topic)
> 
> 
> I get 
> 
> a.out:     file format elf32-littlearm
> architecture: arm, flags 0x00000112:
> EXEC_P, HAS_SYMS, D_PAGED
> start address 0x00008000
 

Uh... Let's see:

Case 1:

$ arm-elf-gcc -nostdlib -nostartfiles  test.c
/d/gnu-tools/H-i686-pc-cygwin/arm-elf/bin/ld: warning: cannot find entry
symbol
_start; defaulting to 00008000

$ arm-elf-objdump.exe -f a.out

a.out:     file format elf32-littlearm
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00008000

Case 2:

$ arm-elf-gcc -nostdlib -nostartfiles -Wl,--entry=0x0 test.c

$ arm-elf-objdump.exe -f a.out

a.out:     file format elf32-littlearm
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00000000

Looks like it works for me...

But in both case I get 
$ arm-elf-objdump.exe -h a.out

a.out:     file format elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000014  00008000  00008000  00008000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000000  00008114  00008114  00008114  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .sbss         00000000  00008114  00008114  00008114  2**0
                  CONTENTS
  3 .bss          00000000  00008114  00008114  00008114  2**0
                  ALLOC
  4 .stack        00000000  00080000  00080000  00008114  2**0
                  CONTENTS

And sure enough if you are doing a bootloader you need a custom linker
script to specify the memory map. You can take the eCos scripts as an
example or see the ld documentation
(http://www.redhat.com/docs/manuals/gnupro/GNUPro-Toolkit-00r1/5_ut/b_Us
ingl
d/ld.html)

Regards,


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