[ECOS] Linkerscript -- C++ new/delete functions requirement

Nick Garnett nickg@ecoscentric.com
Wed May 28 21:04:00 GMT 2003


"David Marqvar (DAM)" <DAM@tt.dk> writes:

> Hi,
> 
> I am currently creating a little patch (fix IMHO) that makes it
> configureable from configtool if the new/delete functions should be taken
> from libsupc++.a or be provided directly in eCos.
> This is to allow us (and others) to avoid the need for C++ libraries in eCos
> since we currently will not allow the use of these in our code, and
> therefore don't like the idea of having them available at all.

libsupc++ is only a low level C++ runtime library that supplies
functionality that the compiler depends on. It is not the full C++
library at all. Apart from new and delete it mostly contains support
for exception handling, nothing more.

Given the subtle interaction between the compiler, the contents of
this library, and the definitions in the <new> header, I would be very
wary of trying to remove it.

> 
> To check if the C++ library should be used I need to have a macro available
> in the linker script...
> 
> Currently I've only tested with synth.ld, and I'm wondering why the 
> #include <pkgconf/system.h>
> is not placed in the top of the "master" linker script file (e.g. synth.ld)
> - if it is moved up there I can just define the needed macro in system.h ...
>
> Is there any not-so-obvious reason to this - maybe something that only exist
> for a different target?

I doubt it. That's just the way it was done. There was never anything
in the main part of that file that needed configuration. The .ld files
for other architectures do include system.h, and other headers, at the
start.

> 
> Further more the EXTRAS could just be defined in a standard manner with a
> more conventional name, not by the current "hack":
> $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o
> $@ $<

I'm not sure I understand your point here.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list