Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/gnu/dist/toolchain/gcc/config/i386 Pull up revision 1.6...



details:   https://anonhg.NetBSD.org/src/rev/3b5d0566d0ee
branches:  netbsd-1-6
changeset: 529491:3b5d0566d0ee
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Nov 24 16:17:32 2002 +0000

description:
Pull up revision 1.6 (requested by mycroft in ticket #742):
Fix SELECT_SECTION() so that C++ run-time type info constructors do not go in
.rodata on PIC systems, which was causing text relocations (and associated
performance loss).

diffstat:

 gnu/dist/toolchain/gcc/config/i386/netbsd-elf.h |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (27 lines):

diff -r 11fb92252fdf -r 3b5d0566d0ee gnu/dist/toolchain/gcc/config/i386/netbsd-elf.h
--- a/gnu/dist/toolchain/gcc/config/i386/netbsd-elf.h   Sun Nov 24 16:17:23 2002 +0000
+++ b/gnu/dist/toolchain/gcc/config/i386/netbsd-elf.h   Sun Nov 24 16:17:32 2002 +0000
@@ -411,7 +411,9 @@
 
 #define SELECT_SECTION(DECL,RELOC)                                     \
 {                                                                      \
-  if (TREE_CODE (DECL) == STRING_CST)                                  \
+  if (flag_pic && RELOC)                                               \
+    data_section ();                                                   \
+  else if (TREE_CODE (DECL) == STRING_CST)                             \
     {                                                                  \
       if (! flag_writable_strings)                                     \
        const_section ();                                               \
@@ -420,11 +422,7 @@
     }                                                                  \
   else if (TREE_CODE (DECL) == VAR_DECL)                               \
     {                                                                  \
-      if ((flag_pic && RELOC)                                          \
-         || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL)          \
-         || !DECL_INITIAL (DECL)                                       \
-         || (DECL_INITIAL (DECL) != error_mark_node                    \
-             && !TREE_CONSTANT (DECL_INITIAL (DECL))))                 \
+      if (! DECL_READONLY_SECTION (DECL, RELOC))                       \
        data_section ();                                                \
       else                                                             \
        const_section ();                                               \



Home | Main Index | Thread Index | Old Index