public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Help With CYG_HAL_TABLEs
@ 2003-10-17 18:38 Jay Foster
  2003-10-17 20:04 ` Gary Thomas
  0 siblings, 1 reply; 3+ messages in thread
From: Jay Foster @ 2003-10-17 18:38 UTC (permalink / raw)
  To: 'ecos-discuss@sources.redhat.com'

I'm trying to use the CYG_HAL_TABLE macros to implement an extensible table.
My table entries aren't getting added to the table.  I first suspected that
the linker was removing them, since there are no references to them, but I'm
not so sure, since other tables, such as the DEVTAB table encounter the same
situation, yet its entries get added.

In a header file, I declare the following:

#include <cyg/hal/hal_tables.h>
typedef struct myentry
{
	STUFF HERE
} CYG_HAL_TABLE_TYPE myentry_t;

extern myentry_t __MYTABLE__[], __MYTABLE_END__;
#define MYTABLE_ENTRY(_l, arg, arg) \
myentry_t _l CYG_HAL_TABLE_ENTRY(myentrytype) = { \
	arg, \
	arg \
}

In a source file, I do:

#include <header file>
CYG_HAL_TABLE_BEGIN( __MYTABLE__, myentrytype );
CYG_HAL_TABLE_END( __MYTABLE_END__, myentrytype );


myentry_t *p;
for (p=&(__MYTABLE__[0]; p!=&(__MYTABLE_END__); p++
{
	stuff
}

In another source file, I do:
#include <header file>
MYTABLE_ENTRY(l0, stuff);
MYTABLE_ENTRY(l1, stuff);
etc.


In my symbol table, I find entries for __MYTABLE__ and __MYTABLE_END__, but
no symbols in between for the table entries (l0, l1, etc.).  There are no
references to the table entry labels, so I suspected the linker was removing
them.  Other tables don't suffer from this, so I'm thinking it's something
else.  What, I don't know.  For example, in my symbol table I see:

	__DEVTAB__
	haldiag_io0
	__DEVTAB_END__

yet there are no references to haldiag_io0, except for the DEVTAB_ENTRY()
macro.

Jay


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] Help With CYG_HAL_TABLEs
  2003-10-17 18:38 [ECOS] Help With CYG_HAL_TABLEs Jay Foster
@ 2003-10-17 20:04 ` Gary Thomas
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Thomas @ 2003-10-17 20:04 UTC (permalink / raw)
  To: Jay Foster; +Cc: 'ecos-discuss@sources.redhat.com'

On Fri, 2003-10-17 at 12:23, Jay Foster wrote:
> I'm trying to use the CYG_HAL_TABLE macros to implement an extensible table.
> My table entries aren't getting added to the table.  I first suspected that
> the linker was removing them, since there are no references to them, but I'm
> not so sure, since other tables, such as the DEVTAB table encounter the same
> situation, yet its entries get added.
> 
> In a header file, I declare the following:
> 
> #include <cyg/hal/hal_tables.h>
> typedef struct myentry
> {
> 	STUFF HERE
> } CYG_HAL_TABLE_TYPE myentry_t;
> 
> extern myentry_t __MYTABLE__[], __MYTABLE_END__;
> #define MYTABLE_ENTRY(_l, arg, arg) \
> myentry_t _l CYG_HAL_TABLE_ENTRY(myentrytype) = { \
> 	arg, \
> 	arg \
> }
> 
> In a source file, I do:
> 
> #include <header file>
> CYG_HAL_TABLE_BEGIN( __MYTABLE__, myentrytype );
> CYG_HAL_TABLE_END( __MYTABLE_END__, myentrytype );
> 
> 
> myentry_t *p;
> for (p=&(__MYTABLE__[0]; p!=&(__MYTABLE_END__); p++
> {
> 	stuff
> }
> 
> In another source file, I do:
> #include <header file>
> MYTABLE_ENTRY(l0, stuff);
> MYTABLE_ENTRY(l1, stuff);
> etc.
> 
> 
> In my symbol table, I find entries for __MYTABLE__ and __MYTABLE_END__, but
> no symbols in between for the table entries (l0, l1, etc.).  There are no
> references to the table entry labels, so I suspected the linker was removing
> them.  Other tables don't suffer from this, so I'm thinking it's something
> else.  What, I don't know.  For example, in my symbol table I see:
> 
> 	__DEVTAB__
> 	haldiag_io0
> 	__DEVTAB_END__
> 
> yet there are no references to haldiag_io0, except for the DEVTAB_ENTRY()
> macro.
> 

Note that any file which uses tables must either be specified directly
in the link/build or be included in "libextras.a".  Is this the case?

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [ECOS] Help With CYG_HAL_TABLEs
@ 2003-10-17 20:34 Jay Foster
  0 siblings, 0 replies; 3+ messages in thread
From: Jay Foster @ 2003-10-17 20:34 UTC (permalink / raw)
  To: 'Gary Thomas', Jay Foster
  Cc: 'ecos-discuss@sources.redhat.com'

No, that wasn't the case.  I had just discovered this on my own.  Adding the
"-library=libextras.a" to the compile line in the CDL resolved this.  I
found a good explanation in the CDL component writer's guide, chapter 4,
page 102.

Thanks

Jay

-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com]
Sent: Friday, October 17, 2003 1:04 PM
To: Jay Foster
Cc: 'ecos-discuss@sources.redhat.com'
Subject: Re: [ECOS] Help With CYG_HAL_TABLEs


On Fri, 2003-10-17 at 12:23, Jay Foster wrote:
> I'm trying to use the CYG_HAL_TABLE macros to implement an extensible
table.
> My table entries aren't getting added to the table.  I first suspected
that
> the linker was removing them, since there are no references to them, but
I'm
> not so sure, since other tables, such as the DEVTAB table encounter the
same
> situation, yet its entries get added.
> 
> In a header file, I declare the following:
> 
> #include <cyg/hal/hal_tables.h>
> typedef struct myentry
> {
> 	STUFF HERE
> } CYG_HAL_TABLE_TYPE myentry_t;
> 
> extern myentry_t __MYTABLE__[], __MYTABLE_END__;
> #define MYTABLE_ENTRY(_l, arg, arg) \
> myentry_t _l CYG_HAL_TABLE_ENTRY(myentrytype) = { \
> 	arg, \
> 	arg \
> }
> 
> In a source file, I do:
> 
> #include <header file>
> CYG_HAL_TABLE_BEGIN( __MYTABLE__, myentrytype );
> CYG_HAL_TABLE_END( __MYTABLE_END__, myentrytype );
> 
> 
> myentry_t *p;
> for (p=&(__MYTABLE__[0]; p!=&(__MYTABLE_END__); p++
> {
> 	stuff
> }
> 
> In another source file, I do:
> #include <header file>
> MYTABLE_ENTRY(l0, stuff);
> MYTABLE_ENTRY(l1, stuff);
> etc.
> 
> 
> In my symbol table, I find entries for __MYTABLE__ and __MYTABLE_END__,
but
> no symbols in between for the table entries (l0, l1, etc.).  There are no
> references to the table entry labels, so I suspected the linker was
removing
> them.  Other tables don't suffer from this, so I'm thinking it's something
> else.  What, I don't know.  For example, in my symbol table I see:
> 
> 	__DEVTAB__
> 	haldiag_io0
> 	__DEVTAB_END__
> 
> yet there are no references to haldiag_io0, except for the DEVTAB_ENTRY()
> macro.
> 

Note that any file which uses tables must either be specified directly
in the link/build or be included in "libextras.a".  Is this the case?

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-17 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-17 18:38 [ECOS] Help With CYG_HAL_TABLEs Jay Foster
2003-10-17 20:04 ` Gary Thomas
2003-10-17 20:34 Jay Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).