From 74fe26b270f55b1245d6cb863fca3734003a277a Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Thu, 16 Nov 2000 20:01:21 +0000 Subject: [PATCH] Fix ia64 C++ gprel link errors. * config/ia64/ia64.c (ia64_encode_section_info): Disallow decls with DECL_EXTERNAL set. From-SVN: r37505 --- gcc/ChangeLog | 5 +++++ gcc/config/ia64/ia64.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9866dc4cc79..b735f44e355 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-11-16 Jim Wilson + + * config/ia64/ia64.c (ia64_encode_section_info): Disallow decls with + DECL_EXTERNAL set. + 2000-11-16 Nick Clifton * config/arm/arm.c (output_arm_prologue): Note nested functions. diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 87cc12d346f..ee8121f8198 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -4764,8 +4764,12 @@ ia64_encode_section_info (decl) /* ??? Actually, we can put globals in sdata, as long as we don't use gprel to access them. The linker may then be able to do linker relaxation to optimize references to them. Currently sdata implies use of gprel. */ + /* We need the DECL_EXTERNAL check for C++. static class data members get + both TREE_STATIC and DECL_EXTERNAL set, to indicate that they are + statically allocated, but the space is allocated somewhere else. Such + decls can not be own data. */ if (! TARGET_NO_SDATA - && TREE_STATIC (decl) + && TREE_STATIC (decl) && ! DECL_EXTERNAL (decl) && ! (DECL_ONE_ONLY (decl) || DECL_WEAK (decl)) && ! (TREE_PUBLIC (decl) && (flag_pic -- 2.30.2