This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
SH build - Odd Link Error
- To: "Ecos - Discuss" <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] SH build - Odd Link Error
- From: "Nick - eCos Developer" <n_ecos at targus dot net>
- Date: Tue, 6 Mar 2001 15:54:25 -0500
- Reply-To: "Nick - eCos Developer" <n_ecos at mail dot targus dot net>
Using: GCC built for target sh: "gcc version 2.95.1 19990816 (release)"
running on Linux. Although I can get the same error on NT.
I get the link error: undefined reference to 'dsr_disable_counter'
implicating the declaration near line 60 drv_api.c:
(Complete path "ecos/packages/hal/common/current/src/drv_api.c")
Line 60+ from drv_api.c
<snip>
//--------------------------------------------------------------------------
// Statics
static volatile cyg_int32 isr_disable_counter = 1; // ISR disable counter
volatile cyg_int32 dsr_disable_counter asm("cyg_scheduler_sched_lock"); //
DSR disable counter
static cyg_interrupt* volatile dsr_list; // List of pending DSRs
<snip>
The middle declaration seems to be declaring space for
cyg_scheduler_sched_lock and simultaneously giving it the alias
dsr_disable_counter, so If I simplify this FROM:
volatile cyg_int32 dsr_disable_counter asm("cyg_scheduler_sched_lock");
TO:
volatile cyg_int32 cyg_scheduler_sched_lock;
#define dsr_disable_counter cyg_scheduler_sched_lock // DSR disable counter
It will compile and "seems" to work. Am I correct in assuming that the
original line allocated space for cyg_scheduler_sched_lock and made
dsr_disable_counter an alias for it in this file. (Other files (some
assembler) refer only to the name cyg_scheduler_sched_lock.
What is this and why the complex syntax? Is my hack equivalent?