This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: dynamic location for argc, argv
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Slide <slide dot o dot mix at gmail dot com>
- Cc: ecos-discuss <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 9 Aug 2007 17:45:57 +0200
- Subject: Re: [ECOS] dynamic location for argc, argv
- References: <a623f7d10708090822s25b0e846ka655dbe505de6679@mail.gmail.com>
On Thu, Aug 09, 2007 at 08:22:40AM -0700, Slide wrote:
> I noticed in the CDL there is a CYGDAT_LIBC_ARGUMENTS item that allows
> you to specify arguments to main when using the ISO C library. My
> command line arguments can be in various locations in memory, is there
> another method for setting this up dynamically?
Sure. main() is called by a default implementation of
cyg_user_start(). See
packages/language/c/libc/startup/current/src/cstartup.cxx. You could
provide your own cyg_user_start() which calls your own implementation
of the function cyg_libc_invoke_main(). You can then setup argc & argv
however you want before calling main().
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