This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Current gcc snapshot, -ffunction-sections
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: [ECOS] Current gcc snapshot, -ffunction-sections
- From: Chan Shih-Ping Richard <cshihpin at dso dot org dot sg>
- Date: Thu, 20 Jan 2000 08:44:07 +0800 (SGT)
- Reply-To: Chan Shih-Ping <cshihpin at dso dot org dot sg>
The current gcc snapshot (20000117) doesn't seem
to add prefixes (.data., .rodata.) to data sections
when compiled with -ffunction-sections -fdata-sections.
(Target is sparclite-elf).
I think I've isolated the problem to config/elfos.h
/* BTW: sec = 0 means prefix .text.
sec = 1 means prefix .data.
sec = 2 means prefix .rodata.
sec = 3 means no prefix */
\
if (TREE_CODE (DECL) == FUNCTION_DECL) \
sec = 0; /* .text. */ \
else if (DECL_INITIAL (DECL) == 0 \
|| DECL_INITIAL (DECL) == error_mark_node) \
sec = 3; /* NO PREFIX!! */ \
else if (DECL_READONLY_SECTION (DECL, RELOC)) \
sec = 1; /* prefix .rodata. but never seem to get here */ \
else \
sec = 2; /* prefix .data. but never seem to get here */
Can anyone explain why the first "else if" captures all
the .data and .rodata sections which result in no
prefix. (Symptom is that the assembler complains about
"symbol already defined".) The ecosSWtools of 3/99 doesn't
have a catch-all clause and prepends .text./.rodata./.data.
as necessary.
Removing the offending clause "seems" to work. The resulting
cross-compiler (gcc-20000117, binutils-20000117, newlib-1.8.2)
is able to build the tutorial and run simple tests.
--
Chan Shih-Ping (Richard) <cshihpin@dso.org.sg>
DSO National Laboratories
20 Science Park Drive
Singapore 118230