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: Option -K in GNU assembler


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


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