This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Need Help on Symbol/Variable Name Problem

thanks to everyone who responded and provided suggestions.

Unfortunately, none provided exactly what I wanted.
I would either get an undefined symbol error during
link time or each symbol would be assigned different
memory locations.

However, your suggestions did provide some more ideas
for me to experiment with.  I found one that gave me
what I needed.  See below.

	.type Testcode,@object
	.size Testcode,4
testcode:  .int 0
	.global testcode
	.global Testcode

I wanted Testcode (GNU Pascal global variable
name declared as VAR TESTCode:Cardinal) and
testcode (C global variable name declared as
extern int testcode) to be assigned to the
same memory location. The above code did the
trick. The code is in a separate .s file and
assembled separately.


Jing Gloria
Texas Instruments
Sherman, Texas

--- Ian Lance Taylor <> wrote:
> Jing Gloria <> writes:
> > Is there a way to write an assembly code so that two different symbols
> > (actually global variable names) get resolved to the same memory location?
> Sure.  Just do something like
>     .global ALIAS
> In C, wrap this in an asm statement.
> Ian

Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]