This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] [arm] New option for PIC offset unfixed

On 12/11/13 06:59, Joey Ye wrote:
> 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  <>
> 	* 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
> 	* config/arm/arm.opt (mpic-offset-unfixed): New option.
> 	* doc/invoke.texi (-mpic-offset-unfixed): Doc for new option.

The name of the option and the documentation highlights that the
option's concept is confusing.

I think what you really need to do is to reverse the sense of the option
name and have


with the inverse (-mno-pic-data-is-text-relative) being the active value
that triggers for vxworks.  That is, PIC data being text-relative is the
default for all targets except vxworks.


Oh, and at run time, we should be talking about segments, not sections!

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