On Fri, Mar 6, 2015 at 2:42 PM, H.J. Lu <hongjiu...@intel.com> wrote:
> On Thu, Mar 05, 2015 at 05:31:51PM -0800, H.J. Lu wrote:
>> Protected data symbol means that it can't be pre-emptied.  It doesn't mean
>> its address won't be external.  This is true for pointer to protected
>> function.  With copy relocation, address of protected data defined in the
>> shared library may also be external.  We only know that for sure at
>> run-time.  TARGET_BINDS_LOCAL_P should return false on protected data
>> symbol.  OK for trunk?
>>
>> Thanks.
>>
>> H.J.
>> ---
>>       PR target/65248
>>       * output.h (default_binds_local_p_2): New.
>>       * varasm.c (default_binds_local_p_2): Renamed to ...
>>       (default_binds_local_p_3): This.  Don't return true on protected
>>       data symbol if protected data may be external.
>>       (default_binds_local_p): Use default_binds_local_p_3.
>>       (default_binds_local_p_1): Likewise.
>>       (default_binds_local_p_2): New.
>>       * config/i386/i386.c (TARGET_BINDS_LOCAL_P): Replace
>>       darwin_binds_local_p with default_binds_local_p_2.
>
> Here is the updated patch with testcases.  Tested on Linux/x86.  OK
> for trunk?
>
> Thanks.
>
>
> H.J.
> ----
> gcc/
>
>         PR target/65248
>         * output.h (default_binds_local_p_2): New.
>         * varasm.c (default_binds_local_p_2): Renamed to ...
>         (default_binds_local_p_3): This.  Don't return true on protected
>         data symbol if protected data may be external.
>         (default_binds_local_p): Use default_binds_local_p_3.
>         (default_binds_local_p_1): Likewise.
>         (default_binds_local_p_2): New.
>         * config/i386/i386.c (TARGET_BINDS_LOCAL_P): Replace
>         darwin_binds_local_p with default_binds_local_p_2.
>
> gcc/testsuite/
>
>         PR target/65248
>         * gcc.target/i386/pr65248-1.c: New file.
>         * gcc.target/i386/pr65248-2.c: Likewise.
>         * gcc.target/i386/pr65248-3.c: Likewise.
>         * gcc.target/i386/pr65248-4.c: Likewise.

This patch needs global reviewer approval (I have added Jakub to CC)
and Darwin maintainer approval.

Uros.

Reply via email to