This is the mail archive of the binutils@sources.redhat.com 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]

Re: equ directive problem


Hi John,

: I have an equate at the beginning of my program:
: .equ ADDRESS, 0x300f0000
: 
: I actually use the ADDRESS over 4,000 lines later, but I'm getting an error
: when trying to assemble using as. The error is: Error: Literal referenced
: across section boundary (Implicit dump?)
: 
: Anyway I can fix it without moving the equate? I want to be able to
: reference it anywhere in the program.

You could try using the C preprocessor instead.  Assuming that you are
using gcc to run the assembler, eg by typing "gcc foo.s", then if you
change the file extension to a capital S, gcc will run the C
preprocessor on the file before passing it on to the assembler.  ie
"gcc foo.S".  Then all you needs to do is:

     #define ADDRESS 0x300f0000

Cheers
	Nick

PS.  If this does not work, please could you try to create a simple
test case to reproduce the problem.  You can probably use .fill or
.space to create large blocks of empty space in your program if
necessary.

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