From: ANDRE Sébastien <sebastien.andre@sxb.bsf.alcatel.fr>
To: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] arm-elf-gcc comprehension
Date: Fri, 29 Jun 2001 02:22:00 -0000 [thread overview]
Message-ID: <3B3C48A9.3646FA6@sxb.bsf.alcatel.fr> (raw)
In-Reply-To: <3B3C3857.AA3C0B04@sxb.bsf.alcatel.fr>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3840 bytes --]
Hi again,
So i work on my problem !! but i see a strange thinks !!
When i make this command,
arm-elf-gcc -c test.c -ggdb -Wall
Normally it generate a "test.o" object file !!! but by hazardous way i see that it's already an elf
executable file
I test it with "arm-elf-size test.o"
>> text data bss dec hex filename
>> 84 0 0 84 54 test.o
and with "arm-elf-readelf -S test.o"
>> Section Headers:
>> [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
>> [ 0] NULL 00000000 000000 000000 00 0 0 0
>> [ 1] .text PROGBITS 00000000 000034 000054 00 AX 0 0 4
>> [ 2] .rel.text REL 00000000 00064c 000028 08 15 1 4
>> [ 3] .data PROGBITS 00000000 000088 000000 00 WA 0 0 1
>> [ 4] .bss NOBITS 00000000 000088 000000 00 WA 0 0 1
>> [ 5] .debug_abbrev PROGBITS 00000000 000088 000045 00 0 0 1
>> [ 6] .debug_info PROGBITS 00000000 0000cd 00007b 00 0 0 1
>> [ 7] .rel.debug_info REL 00000000 000674 000030 08 15 6 4
>> [ 8] .debug_line PROGBITS 00000000 000148 000066 00 0 0 1
>> [ 9] .rel.debug_line REL 00000000 0006a4 000040 08 15 8 4
>> [10] .debug_pubnames PROGBITS 00000000 0001ae 00001b 00 0 0 1
>>[11] .rel.debug_pubnam REL 00000000 0006e4 000008 08 15 a 4
>> [12] .debug_aranges PROGBITS 00000000 0001c9 000020 00 0 0 1
>> [13] .rel.debug_arange REL 00000000 0006ec 000010 08 15 c 4
>> [14] .shstrtab STRTAB 00000000 0001e9 0000c2 00 0 0 1
>> [15] .symtab SYMTAB 00000000 000554 0000d0 10 16 b 4
>>[16] .strtab STRTAB 00000000 000624 000027 00 0 0 1
and i can simulate it on arm-elf-gdb !!!
WHAT IS HAPPENED !!!??? Why it's an elf-executable ? and not an object file ???
best regards,
Sébastien.
ANDRE Sébastien wrote:
> Hi all,
>
> So i try a test with "arm-elf-gdb" and "arm-elf-gcc" !!
>
> Typically i write a basycally C program like it
>
> int main()
> { int a;
> while (a < 5000)
> { a++ ; }
> return a;
> }
>
> ==> a program without stdlib, stdio, etc ..... :-)
>
> So i want to compile and build it for arm processor but NOT for eCos Kernel !!
> I want only arm executable file (it possible normally ?)
>
> and after my idea is to try to simulate it on gdb (normally it's possible now because no really hardware
> dependant exept arm core ! ?)
> If i'm wrong somewhere again !! say me it !
>
> So i build around like it :
> arm-elf-gcc -c test.c -o test.o -ggdb -Wall
> arm-elf-gcc -Wl,--gc-sections -o test test.o -nostdlib
>
> PS: i try without "-Wl,--gcc-sections" but if i suppress it i have an error build process like it :
> test.o: In function `main':
> /root/test/test.c:4: undefined reference to `__gccmain'
> collect2: ld returned 1 exit status
>
> An executalble file is generate ..... but i have two mistake (in reallity only one i think)
>
> If i try to simulate it (debug) on gdb with this procedure
> arm-elf-gdb test
> > target sim
> > load
>
> i have this error :
> gdbsim: no loadable sections "/root/test/test"
> unable to load program
>
> So now for see if i have some sections i launch this command :
> arm-elf-size test
> and say it :
>
> text data bss dec hex filename
> 0 0 0 0 0 test
>
> So what i miss for build correctly my elf executable files ?
>
> So i know that isn't really an eCos problem but i thanks you if somebody can help me..
>
> bestregards,
> Sébastien.
next prev parent reply other threads:[~2001-06-29 2:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-28 23:50 [ECOS] Newbie - Help booting ECOS Nagendra EM
2001-06-29 1:12 ` [ECOS] arm-elf-gcc comprehension ANDRE Sébastien
2001-06-29 2:22 ` ANDRE Sébastien [this message]
2001-06-29 2:34 ` Jesper Skov
2001-06-29 7:22 ` Jonathan Larmour
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B3C48A9.3646FA6@sxb.bsf.alcatel.fr \
--to=sebastien.andre@sxb.bsf.alcatel.fr \
--cc=ecos-discuss@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).