This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
[Bug 1001142] User defined linker sections.
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-patches at ecos dot sourceware dot org
- Date: Mon, 14 Feb 2011 21:06:05 +0000
- Subject: [Bug 1001142] User defined linker sections.
- Auto-submitted: auto-generated
- References: <bug-1001142-104@http.bugs.ecos.sourceware.org/>
Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001142
--- Comment #16 from Ilija Kocho <ilijak@siva.com.mk> 2011-02-14 21:06:02 GMT ---
Created an attachment (id=1127)
--> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1127)
CYG_USER_SECTION_XXX() macro use/test case.
(In reply to comment #15)
> (In reply to comment #11)
Sergei, This looks like solution as a solution for provision of section name
from CDL, but in cortexm.ld/USER_SECTION() we still need concatenation in order
to get __foo_start and __foo_end . Same is for user application should it need
to perform some operation on section. Please look at attached use/test case.
About the attached use/test case:
Due to prescan we need proxies. In the submitted example I am using John's
names CYG_USER_SECTION_XXX() for proxies since they are supposed to appear in
user code. Concatenation macros are named __CYG_USER_SECTION_XXX() respectively
and they are also used by USER_SECTION() (see NOTE below.)
The example includes both correct and wrong code (with respect to prescan)
selectable by TRY_RIGHT switch.
This example should be combined with cortexm_ld_1.diff, the patch that I am
posting in following attachment.
NOTE: __CYG_USER_SECTION_XXX() macros, for this example also appear (as a
copypaste) in cortexm.ld since I couldn't locate a suitable header.
> > I introduced them because of properties of CPP concatenation ## with
> > respect to argument prescan.
> > http://gcc.gnu.org/onlinedocs/cpp/Argument-Prescan.html#Argument-Prescan
> > They are needed if "_name_" is a macro:
> >
> > #define FOO "foo"
> > USER_SECTION(FOO, reg, vma, lma)
> >
> > Example use case is when the section name is provided via CDL. I
> > would keep them but we may consider more suitable names.
>
> Maybe "complexity" starts in the target's config, as that CDL booldata
> (for the section's name) was set as a string
>
> default_value { "foo" }
>
> In fact then in the most we need to manage the labels and addresses
> (!strings). If we avoid the first stringification, i.e. define in CDL
>
> default_value foo
>
> then we will have destringified things in pkgconf/* like
>
> #define CYGHWR_~~~_FOO foo
> #define CYGHWR_~~~_FOO_foo
>
> And CYGHWR_~~~_...FOO is ready to use in .ld, .ldi, .h files, is it
> not? Well, I call the LWIP's MEM_SECTION macro. If it make life easier,
> I would prefer to add 1 "extra" line in lwipopts.h
>
> #define STRINGIFY(x) #x
> #define MEM_SECTION CYGBLD_ATTRIB_SECTION(STRINFIFY(CYGHWR_~~~_xxxFOO))
>
> It seems to me this would let us do not use complex de-stringify macros in
> arch. ld script.
--
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.