* [ECOS] Using RedBoot_cmd
@ 2007-01-16 8:40 Guillaume Menant
2007-01-16 11:43 ` Andrew Lunn
2007-01-16 13:33 ` Gary Thomas
0 siblings, 2 replies; 5+ messages in thread
From: Guillaume Menant @ 2007-01-16 8:40 UTC (permalink / raw)
To: ecos-discuss
Hi,
I'm trying to add a command to RedBoot with inserting the following code in
a file names pci.c placed in the src of redboot package:
-----------------------------------------
#include <redboot.h>
void
do_pcitest(int argc, char *argv[]);
RedBoot_cmd("pcitest",
"Tests PCI block",
"",
do_pcitest
);
void
do_pcitest(int argc, char *argv[])
{
}
-----------------------------------------
But I'm facing to this when I'm trying to compile:
-----------------------------------------
sparc-rtems-gcc -msoft-float -g -nostdlib -Wl,--gc-sections -Wl,-static
-L/ecos-f/TEMP/untitled_install/lib -Ttarget.ld -o
/ecos-f/TEMP/untitled_install/bin/redboot.elf
/ecos-f/TEMP/untitled_install/lib/version.o
make[1]: Leaving directory `/ecos-f/TEMP/untitled_build/redboot/v2_0'
/ecos-f/TEMP/untitled_install/lib/extras.o(.ecos.table.RedBoot_commands.data
.do_pcitest+0xc): undefined reference to `do_pcitest'
make: Leaving directory `/ecos-f/TEMP/untitled_build'
collect2: ld returned 1 exit status
make[1]: *** [/ecos-f/TEMP/untitled_install/bin/redboot.elf] Error 1
make: *** [build] Error 2
-----------------------------------------
Why my do_pcitest function is undefined?
Thanks for your time.
Guillaume MENANT
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Using RedBoot_cmd
2007-01-16 8:40 [ECOS] Using RedBoot_cmd Guillaume Menant
@ 2007-01-16 11:43 ` Andrew Lunn
2007-01-16 13:33 ` Gary Thomas
1 sibling, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2007-01-16 11:43 UTC (permalink / raw)
To: Guillaume Menant; +Cc: ecos-discuss
> Why my do_pcitest function is undefined?
Use nm to see if the symbol really is in the object file and in the
library. Also check it has not been C++ name mangled.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ECOS] Using RedBoot_cmd
2007-01-16 8:40 [ECOS] Using RedBoot_cmd Guillaume Menant
2007-01-16 11:43 ` Andrew Lunn
@ 2007-01-16 13:33 ` Gary Thomas
2007-01-16 13:39 ` [ECOS] RE : " Guillaume Menant
1 sibling, 1 reply; 5+ messages in thread
From: Gary Thomas @ 2007-01-16 13:33 UTC (permalink / raw)
To: Guillaume Menant; +Cc: ecos-discuss
Guillaume Menant wrote:
> Hi,
>
> I'm trying to add a command to RedBoot with inserting the following code in
> a file names pci.c placed in the src of redboot package:
>
> -----------------------------------------
> #include <redboot.h>
>
> void
> do_pcitest(int argc, char *argv[]);
>
> RedBoot_cmd("pcitest",
> "Tests PCI block",
> "",
> do_pcitest
> );
>
> void
> do_pcitest(int argc, char *argv[])
> {
> }
> -----------------------------------------
>
> But I'm facing to this when I'm trying to compile:
>
> -----------------------------------------
> sparc-rtems-gcc -msoft-float -g -nostdlib -Wl,--gc-sections -Wl,-static
> -L/ecos-f/TEMP/untitled_install/lib -Ttarget.ld -o
> /ecos-f/TEMP/untitled_install/bin/redboot.elf
> /ecos-f/TEMP/untitled_install/lib/version.o
> make[1]: Leaving directory `/ecos-f/TEMP/untitled_build/redboot/v2_0'
> /ecos-f/TEMP/untitled_install/lib/extras.o(.ecos.table.RedBoot_commands.data
> .do_pcitest+0xc): undefined reference to `do_pcitest'
> make: Leaving directory `/ecos-f/TEMP/untitled_build'
> collect2: ld returned 1 exit status
> make[1]: *** [/ecos-f/TEMP/untitled_install/bin/redboot.elf] Error 1
> make: *** [build] Error 2
> -----------------------------------------
>
> Why my do_pcitest function is undefined?
Leave out the declaration of the function - the RedBoot_cmd()
macro will declare it as static. I think this is what's causing
the confusion.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ECOS] RE : [ECOS] Using RedBoot_cmd
2007-01-16 13:33 ` Gary Thomas
@ 2007-01-16 13:39 ` Guillaume Menant
0 siblings, 0 replies; 5+ messages in thread
From: Guillaume Menant @ 2007-01-16 13:39 UTC (permalink / raw)
To: 'Gary Thomas'; +Cc: ecos-discuss
Thanks for your answers; it was due to a #ifdef I haven't seen before :-(
Guillaume MENANT
-----Message d'origine-----
De : ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] De la part de Gary Thomas
Envoyé : mardi 16 janvier 2007 14:33
À : Guillaume Menant
Cc : ecos-discuss@sources.redhat.com
Objet : Re: [ECOS] Using RedBoot_cmd
Guillaume Menant wrote:
> Hi,
>
> I'm trying to add a command to RedBoot with inserting the following code
in
> a file names pci.c placed in the src of redboot package:
>
> -----------------------------------------
> #include <redboot.h>
>
> void
> do_pcitest(int argc, char *argv[]);
>
> RedBoot_cmd("pcitest",
> "Tests PCI block",
> "",
> do_pcitest
> );
>
> void
> do_pcitest(int argc, char *argv[])
> {
> }
> -----------------------------------------
>
> But I'm facing to this when I'm trying to compile:
>
> -----------------------------------------
> sparc-rtems-gcc -msoft-float -g -nostdlib -Wl,--gc-sections -Wl,-static
> -L/ecos-f/TEMP/untitled_install/lib -Ttarget.ld -o
> /ecos-f/TEMP/untitled_install/bin/redboot.elf
> /ecos-f/TEMP/untitled_install/lib/version.o
> make[1]: Leaving directory `/ecos-f/TEMP/untitled_build/redboot/v2_0'
>
/ecos-f/TEMP/untitled_install/lib/extras.o(.ecos.table.RedBoot_commands.data
> .do_pcitest+0xc): undefined reference to `do_pcitest'
> make: Leaving directory `/ecos-f/TEMP/untitled_build'
> collect2: ld returned 1 exit status
> make[1]: *** [/ecos-f/TEMP/untitled_install/bin/redboot.elf] Error 1
> make: *** [build] Error 2
> -----------------------------------------
>
> Why my do_pcitest function is undefined?
Leave out the declaration of the function - the RedBoot_cmd()
macro will declare it as static. I think this is what's causing
the confusion.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ECOS] Re : [ECOS] Using RedBoot_cmd
@ 2007-01-16 10:55 ayoub zaki
0 siblings, 0 replies; 5+ messages in thread
From: ayoub zaki @ 2007-01-16 10:55 UTC (permalink / raw)
To: Guillaume Menant, ecos-discuss
Hi,
You need also to update the file redboot.cdl with this new command.
Cheers
----- Message d'origine ----
De : Guillaume Menant <g.menant@ayrtontechnology.com>
À : ecos-discuss@sources.redhat.com
Envoyé le : Mardi, 16 Janvier 2007, 9h39mn 50s
Objet : [ECOS] Using RedBoot_cmd
Hi,
I'm trying to add a command to RedBoot with inserting the following code in
a file names pci.c placed in the src of redboot package:
-----------------------------------------
#include <redboot.h>
void
do_pcitest(int argc, char *argv[]);
RedBoot_cmd("pcitest",
"Tests PCI block",
"",
do_pcitest
);
void
do_pcitest(int argc, char *argv[])
{
}
-----------------------------------------
But I'm facing to this when I'm trying to compile:
-----------------------------------------
sparc-rtems-gcc -msoft-float -g -nostdlib -Wl,--gc-sections -Wl,-static
-L/ecos-f/TEMP/untitled_install/lib -Ttarget.ld -o
/ecos-f/TEMP/untitled_install/bin/redboot.elf
/ecos-f/TEMP/untitled_install/lib/version.o
make[1]: Leaving directory `/ecos-f/TEMP/untitled_build/redboot/v2_0'
/ecos-f/TEMP/untitled_install/lib/extras.o(.ecos.table.RedBoot_commands.data
.do_pcitest+0xc): undefined reference to `do_pcitest'
make: Leaving directory `/ecos-f/TEMP/untitled_build'
collect2: ld returned 1 exit status
make[1]: *** [/ecos-f/TEMP/untitled_install/bin/redboot.elf] Error 1
make: *** [build] Error 2
-----------------------------------------
Why my do_pcitest function is undefined?
Thanks for your time.
Guillaume MENANT
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-01-16 13:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16 8:40 [ECOS] Using RedBoot_cmd Guillaume Menant
2007-01-16 11:43 ` Andrew Lunn
2007-01-16 13:33 ` Gary Thomas
2007-01-16 13:39 ` [ECOS] RE : " Guillaume Menant
2007-01-16 10:55 [ECOS] Re " ayoub zaki
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).