getting gnu as to check the current location

Harvey Chapman hchapman-binutils@3gfp.com
Wed Apr 14 13:56:00 GMT 2010


On Apr 13, 2010, at 9:57 PM, Alan Modra wrote:

> On Tue, Apr 13, 2010 at 01:36:16PM -0400, Harvey Chapman wrote:
>> Is it possible with gnu as to do something like this?
>> 
>> .if (. - _start1) < 0x100 || (. - _start1) > 0x1ff
>> 	.error	"some_label must be between 0x100 and 0x1FF!"
>> .endif
>> some_label:
> 
> It depends on what is between . and _start.  They must be in the same
> section, and there can't be any .align or similar directives between.

Both of those are true. The code above does not work. I was hoping someone else more knowledgeable would see it and either know the solution or point me in the right direction. I may simply have to add a binary grep step to my build which grabs and checks the offset of some_label. I have an ascii string right next to it for debugging purposes, anyway.

Thank you,
Harvey



More information about the Binutils mailing list