For RTOS who need to relocate executable, PC relative and GOTOFF cannot be
used as the offset between any sections won't be fixed. Only GOT can be
used, just as VxWorks RTP does.

This patch introduces a new option enable user to choose between fixed
offset or not. Enabled for VxWorks RTP to keep its behavior unchanged.

Tested with arm-none-eabi make and VxWorks RTP small case

OK to trunk?

ChangeLog:
2013-11-12  Joey Ye  <joey...@arm.com>

        * config/arm/arm.c (arm_option_override):  Error if
        -mpic-offset-unfixed without -fpic, and set for
        VxWorks RTP.
        (legitimize_pic_address): Use arm_pic_offset_unfixed.
        (arm_assemble_integer): Likewise.
        * config/arm/arm.h
        (TARGET_DEFAULT_PIC_OFFSET_UNFIXED): New macro.
        * config/arm/arm.opt (mpic-offset-unfixed): New option.
        * doc/invoke.texi (-mpic-offset-unfixed): Doc for new option.

Attachment: pic_offset_fixed-1112.patch
Description: Binary data

Reply via email to