diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-27 18:11:00 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-27 18:11:00 +0000 |
commit | 017e92fb56e7ccc23acd08e2f921d5026f661ff2 (patch) | |
tree | 6f1f7fb2c72bb99e77499fa0b962b812dcc32188 /gcc/config | |
parent | 5ee52e91abe11464113b9dcea4c939ceeb8356ac (diff) | |
download | gcc-017e92fb56e7ccc23acd08e2f921d5026f661ff2.tar.gz |
Add default_binds_local_p_2 and use it for x86
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.
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): Set to
default_binds_local_p_2 if TARGET_MACHO is undefined.
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221742 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 862bda529b8..744642c7e36 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -51900,6 +51900,9 @@ ix86_initialize_bounds (tree var, tree lb, tree ub, tree *stmts) #if TARGET_MACHO #undef TARGET_BINDS_LOCAL_P #define TARGET_BINDS_LOCAL_P darwin_binds_local_p +#else +#undef TARGET_BINDS_LOCAL_P +#define TARGET_BINDS_LOCAL_P default_binds_local_p_2 #endif #if TARGET_DLLIMPORT_DECL_ATTRIBUTES #undef TARGET_BINDS_LOCAL_P |