public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] SH build - Odd Link Error
@ 2001-03-06 12:54 Nick - eCos Developer
  2001-03-06 23:18 ` Jesper Skov
  0 siblings, 1 reply; 3+ messages in thread
From: Nick - eCos Developer @ 2001-03-06 12:54 UTC (permalink / raw)
  To: Ecos - Discuss

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?


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

* Re: [ECOS] SH build - Odd Link Error
  2001-03-06 12:54 [ECOS] SH build - Odd Link Error Nick - eCos Developer
@ 2001-03-06 23:18 ` Jesper Skov
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Skov @ 2001-03-06 23:18 UTC (permalink / raw)
  To: Nick - eCos Developer; +Cc: Ecos - Discuss

>>>>> ""Nick" == "Nick  <- eCos Developer" <n_ecos@targus.net>> writes:

"Nick> volatile cyg_int32 dsr_disable_counter
"Nick> asm("cyg_scheduler_sched_lock"); // DSR disable counter

Try the below patch.

Jesper

Index: ChangeLog
===================================================================
RCS file: /local/cvsfiles/ecc/ecc/hal/common/current/ChangeLog,v
retrieving revision 1.259
diff -u -5 -r1.259 ChangeLog
--- ChangeLog	2001/03/05 15:37:54	1.259
+++ ChangeLog	2001/03/07 07:17:02
@@ -1,5 +1,9 @@
+2001-03-07  Jesper Skov  <jskov@redhat.com>
+
+	* src/drv_api.c: Use macro to provide symbol alias.
+
 2001-03-05  Jesper Skov  <jskov@redhat.com>
 
 	* src/hal_if.c (hal_if_diag_init): Ensure the function only
 	executes once.
 
Index: src/drv_api.c
===================================================================
RCS file: /local/cvsfiles/ecc/ecc/hal/common/current/src/drv_api.c,v
retrieving revision 1.10
diff -u -5 -r1.10 drv_api.c
--- src/drv_api.c	2001/02/01 18:20:48	1.10
+++ src/drv_api.c	2001/03/07 07:16:17
@@ -60,11 +60,12 @@
 //--------------------------------------------------------------------------
 // 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
+volatile cyg_int32 dsr_disable_counter  // DSR disable counter
+                      CYGBLD_ATTRIB_ASM_ALIAS( cyg_scheduler_sched_lock );
 
 static cyg_interrupt* volatile dsr_list;        // List of pending DSRs
 
 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN
 

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

* re: [ECOS] SH build - Odd Link Error
@ 2001-03-06 13:05 Nick - eCos Developer
  0 siblings, 0 replies; 3+ messages in thread
From: Nick - eCos Developer @ 2001-03-06 13:05 UTC (permalink / raw)
  To: Ecos - Discuss

Sorry, this link error shows up when build the stubs.

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

end of thread, other threads:[~2001-03-06 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-06 12:54 [ECOS] SH build - Odd Link Error Nick - eCos Developer
2001-03-06 23:18 ` Jesper Skov
2001-03-06 13:05 Nick - eCos Developer

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).