Option -K in GNU assembler
Nick Clifton
nickc@cambridge.redhat.com
Tue Apr 17 01:14:00 GMT 2001
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
More information about the Binutils
mailing list