.option directive

Jim Wilson jimw@sifive.com
Sat Nov 25 01:22:00 GMT 2017


On 11/24/2017 12:03 AM, Paulo Matos wrote:
> When compiling a riscv program, I get at the start of the file:
>          .file   "1818492087.c"
>          .option nopic
> I am curious about the option directive. I can't seem to find it
> documented anywhere:

It is a risc-v feature, similar to the MIPS .set directive.  Adding 
documentation for it is on my todo list.  You can only have one word 
after the .option.  The current choices are rvc, norvc, pic, nopic, 
relax, norelax, push, and pop.  The last two allow you to stack the 
option choices.  E.g. if you want a guaranteed 4-byte instruction, and 
you are compiling for a target that has compressed instructions, then 
you can use
.option push
.option norvc
...instructions...
.option pop

Jim



More information about the Binutils mailing list