From a21aaa7e03242573f5d3a3975240fd05b7462e49 Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 18 Feb 2015 17:24:20 +0000 Subject: Return false for common symbols in sdata_symbolic_operand Although common symbols are defined in executables, they aren't in small data section. But a definition in small data section overrides a common symbol, which still binds lcoally, and turns a reference to common symbol to reference to small data section. Even if ia64_in_small_data_p returns true on common symbols, sdata_symbolic_operand must return false on common symbols. Common symbols are assumed to be placed in small data section, but are accessed as if they are in normal data section so that they won't cause any relocation overflow. PR target/65064 * config/ia64/predicates.md (sdata_symbolic_operand): Return false for common symbols. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220792 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/ia64/predicates.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/config/ia64') diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md index cba0efe7a6e..2aa7a780e02 100644 --- a/gcc/config/ia64/predicates.md +++ b/gcc/config/ia64/predicates.md @@ -69,7 +69,12 @@ of constants here. */ t = SYMBOL_REF_DECL (op); if (DECL_P (t)) - t = DECL_SIZE_UNIT (t); + { + /* Common symbol isn't placed in small data section. */ + if (DECL_COMMON (t)) + return false; + t = DECL_SIZE_UNIT (t); + } else t = TYPE_SIZE_UNIT (TREE_TYPE (t)); if (t && tree_fits_shwi_p (t)) -- cgit v1.2.1