This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Option -K in GNU assembler
- To: "deepak shekhar" <dipaktc at rediffmail dot com>
- Subject: Re: Option -K in GNU assembler
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 17 Apr 2001 10:11:03 +0100
- Cc: "binutils at sources dot redhat dot com" <binutils at sources dot redhat dot com>
- References: <20010417072047.15354.qmail@mailweb18.rediffmail.com>
Hi Deepak
> can somebody explain me what is the option -K for in the GAS (GNU
> Assembler). The man pages says
> -K Issue warnings when difference tables altered
> for long displacements.
>
> Why and when are these difference tables created???
Difference tables created by .word directives which are the difference
between two symbols. eg:
.word foo - bar
This creates a word which is the difference between the address of
symbol 'foo' and symbol 'bar'.
On some systems the implementation of .word cannot handle this
expression if the difference evaluates to a number that will not fit
into 16 signed bits. In such cases the assembler tries to work around
this by storing the expression as a symbol and allowing the linker to
sort it out. (A really horrible hack). Anyway the -K option is there
to have the assembler generate a warning if it ever does this.
Cheers
Nick