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

Richard Earnshaw rearnsha@arm.com
Wed Nov 13 18:00:00 GMT 2013


On 13/11/13 15:57, Joey Ye wrote:
> 
> 
>> -----Original Message-----
>> From: Richard Earnshaw
>> Sent: Wednesday, November 13, 2013 19:17
>> To: Joey Ye
>> Cc: gcc-patches@gcc.gnu.org
>> Subject: Re: [patch] [arm] New option for PIC offset unfixed
>>
>> On 13/11/13 10:20, Joey Ye wrote:
>>>>> +  if (TARGET_VXWORKS_RTP)
>>>>>>> +    arm_pic_data_is_text_relative = 0;
>>>>>
>>>>> Why is this needed?  Surely, even a VxWorks user should have the
>>>>> right to force the compiler to behave differently.  You've set
>>>>> things up through
>>> the
>>>>> default, now just accept what the user has asked for.
>>> The reason is that TARGET_VXWORKS_RTP isn't a compile time value to
>>> initiate arm.opt. Instead it is true only when -mrtp is specified in
>>> runtime. Also enable text relative may result in runtime error on
>>> vxworks, it is better to prevent it here.
>>
>> I'd be happier if this was only done if the command-line option was not
>> explicitly set on the command line.
> So you are suggesting change like this:
> + Target Report Var(arm_pic_data_is_text_relative) Init(-1)
> 
> +   if (arm_pic_data_is_text_relative < 0 && TARGET_VXWORKS_RTP)
> +     arm_pic_data_is_text_relative = 0;
> +   else
> +     arm_pic_data_is_text_relative = 1;
> 

No, use the global_options_set structure to find out if the user has set
the value.



More information about the Gcc-patches mailing list