This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
SELECT_SECTION on HPUX10
- To: egcs at cygnus dot com
- Subject: SELECT_SECTION on HPUX10
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Tue, 03 Nov 1998 09:31:10 +0000
- Organization: Computer Science Dept, Bristol University
Hi,
I've discovered that a patch I sent in to deal with constant vars with
mutable members (that's not yet been installed), doesn't cover all the
cases. In fixing it properly, i've come across the following definition
of SELECT_SECTION in gcc/config/pa/pa.h
/* 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 ();
It looks to me that `reloc' in the macro body should really be `RELOC'.
It probably works by accident, as variable_section (varasm.c), from
whence it's called has a local variable called `reloc'.
Could someone with knowledge of the HPUX port confirm or deny?
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk