More PA work

Jeffrey A Law law@cygnus.com
Mon Aug 9 00:20:00 GMT 1999


Fun fun fun.  I had hoped we could bury the oddities of SELECT_SECTION
in one of the SOM specific files.  But it turns out HP's hpux11 ELF tools
behave in a manner very similar to the SOM tools.

So I've promoted SELECT_SECTION back into pa.h

        * pa.h (SELECT_SECTION): Define.
        * som.h (SELECT_SECTION): Delete.


Index: som.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/config/pa/som.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 som.h
*** som.h	1999/08/06 17:20:06	1.4
--- som.h	1999/08/09 07:15:54
*************** Boston, MA 02111-1307, USA.  */
*** 51,76 ****
    fprintf (FILE,							\
  	   "\t.stabs \"\",%d,0,0,L$text_end0000\nL$text_end0000:\n", N_SO)
  
- /* On hpux10, the linker will give an error if we have a reference
-    in the read-only data section to a symbol defined in a shared
-    library.  Therefore, expressions that might require a reloc can
-    not be placed in the read-only data section.  */
- #define SELECT_SECTION(EXP,RELOC) \
-   if (TREE_CODE (EXP) == VAR_DECL \
-       && TREE_READONLY (EXP) \
-       && !TREE_THIS_VOLATILE (EXP) \
-       && DECL_INITIAL (EXP) \
-       && (DECL_INITIAL (EXP) == error_mark_node \
-           || TREE_CONSTANT (DECL_INITIAL (EXP))) \
-       && !RELOC) \
-     readonly_data_section (); \
-   else if (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'c' \
- 	   && !(TREE_CODE (EXP) == STRING_CST && flag_writable_strings) \
- 	   && !RELOC) \
-     readonly_data_section (); \
-   else \
-     data_section ();
-    
  /* HPUX has a program 'chatr' to list the dependencies of dynamically
     linked executables and shared libraries.  */
  #define LDD_SUFFIX "chatr"
--- 51,56 ----
Index: pa.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/config/pa/pa.h,v
retrieving revision 1.171
diff -c -3 -p -r1.171 pa.h
*** pa.h	1999/08/06 17:20:01	1.171
--- pa.h	1999/08/09 07:15:59
*************** extern struct rtx_def *hppa_legitimize_a
*** 1740,1745 ****
--- 1709,1734 ----
    else					\
      readonly_data_section ();
  
+ /* On hpux10, the linker will give an error if we have a reference
+    in the read-only data section to a symbol defined in a shared
+    library.  Therefore, expressions that might require a reloc can
+    not be placed in the read-only data section.  */
+ #define SELECT_SECTION(EXP,RELOC) \
+   if (TREE_CODE (EXP) == VAR_DECL \
+       && TREE_READONLY (EXP) \
+       && !TREE_THIS_VOLATILE (EXP) \
+       && DECL_INITIAL (EXP) \
+       && (DECL_INITIAL (EXP) == error_mark_node \
+           || TREE_CONSTANT (DECL_INITIAL (EXP))) \
+       && !RELOC) \
+     readonly_data_section (); \
+   else if (TREE_CODE_CLASS (TREE_CODE (EXP)) == 'c' \
+ 	   && !(TREE_CODE (EXP) == STRING_CST && flag_writable_strings) \
+ 	   && !RELOC) \
+     readonly_data_section (); \
+   else \
+     data_section ();
+    
  /* Define this macro if references to a symbol must be treated
     differently depending on something about the variable or
     function named by the symbol (such as what section it is in).






More information about the Gcc-patches mailing list