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]
Other format: [Raw text]

Re: Use of exception and RTTI in application C+ code


W. Jensen wrote:
Jonathan,

Can you send me this patch when you get a chance? I'm curious about what is
involved.  I assume that at the very least it needs an exception stack for
each thread.  Perhaps I can port it to the CF platform if it is not too
complicated.  I am a bit concerned that it would be a gcc-version-dependant
patch though.  If that is the case, maybe it is not worth it.
It is gcc 3.x only. In fact at the time it was done, it was early 3.x so I can't guarantee changes aren't required for more recent gcc.

But there is a possibility it may be easy for you to get something going for yourself in some cases in fact. For your information, and _only_ if you need something for yourself here's the type of change required. It's quite simple in this case. This .ldi file gives an example of what you may need to add to your own memory layout:

Index: include/pkgconf/mlt_arm_ebsa285_ram.ldi
===================================================================
--- include/pkgconf/mlt_arm_ebsa285_ram.ldi
+++ include/pkgconf/mlt_arm_ebsa285_ram.ldi
@@ -12,17 +12,20 @@ MEMORY
SECTIONS
{
SECTIONS_BEGIN
SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
SECTION_rom_vectors (ram, 0x20000, LMA_EQ_VMA)
+ SECTION_RELOCS (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_eh_frame (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
+ SECTION_got (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
CYG_LABEL_DEFN(__pci_window) = 0xf00000; . = CYG_LABEL_DEFN(__pci_window) + 0x100000;
SECTIONS_END
}

Index: pkgconf/rules.mak
===================================================================
--- pkgconf/rules.mak
+++ pkgconf/rules.mak
@@ -120,13 +120,13 @@ ifeq ($(HOST),CYGWIN)
@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
else
@mkdir -p $(dir $@)
endif
ifneq ($(IGNORE_LINK_ERRORS),)
- -$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ $(<:.d=.o)
+ -$(CC) -L$(PREFIX)/lib -Ttarget.ld -o $@ $(<:.d=.o) $(LDFLAGS)
else
- $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ $(<:.d=.o)
+ $(CC) -L$(PREFIX)/lib -Ttarget.ld -o $@ $(<:.d=.o) $(LDFLAGS)
endif

# rule to generate all tests and create a dependency file "tests.deps" by
# concatenating the individual dependency rule files (file extension = ".d")
# generated during compilation


Some of the other required changes are already included in arm.ld, but not for other architectures. The changes are non-trivial, and I don't really have the time to detail them right at the moment.

There is much more to it than this already that has been written but not checked in. On that basis I can't really accept a patch to do it - it requires more work than this relatively trivial excerpt I show above. For example the resulting exceptions will _not_ be thread safe. That work is almost complete, but also not complete as it requires gcc changes that have not yet been made.

So use it for yourself, if it works. But it may not, and if not then "caveat emptor", sorry.

Jifl
--
eCosCentric http://www.eCosCentric.com/ <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine


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


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