Commit 17e9e88c by Jakub Jelinek Committed by Jakub Jelinek

sparc.h (ASM_PREFERRED_EH_DATA_FORMAT, [...]): Define.

	* config/sparc/sparc.h (ASM_PREFERRED_EH_DATA_FORMAT,
	ASM_OUTPUT_DWARF_PCREL): Define.
	* config/sparc/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define.
	* configure.in (HAVE_AS_SPARC_UA_PCREL): Check whether as supports
	.uaword %r_disp32() and linker handles it correctly.
	* configure, config.in: Rebuilt.

From-SVN: r48344
parent ad47f1e5
2001-12-28 Jakub Jelinek <jakub@redhat.com> 2001-12-28 Jakub Jelinek <jakub@redhat.com>
* config/sparc/sparc.h (ASM_PREFERRED_EH_DATA_FORMAT,
ASM_OUTPUT_DWARF_PCREL): Define.
* config/sparc/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define.
* configure.in (HAVE_AS_SPARC_UA_PCREL): Check whether as supports
.uaword %r_disp32() and linker handles it correctly.
* configure, config.in: Rebuilt.
2001-12-28 Jakub Jelinek <jakub@redhat.com>
* c-typeck.c (store_init_value): If initializing object with array * c-typeck.c (store_init_value): If initializing object with array
type of unknown size by a compound literal, set object's size from type of unknown size by a compound literal, set object's size from
compound literal size. compound literal size.
......
...@@ -535,6 +535,9 @@ ...@@ -535,6 +535,9 @@
/* Define if your assembler supports -relax option. */ /* Define if your assembler supports -relax option. */
#undef HAVE_AS_RELAX_OPTION #undef HAVE_AS_RELAX_OPTION
/* Define if your assembler and linker support unaligned PC relative relocs. */
#undef HAVE_AS_SPARC_UA_PCREL
/* Define if the assembler supports 64bit sparc. */ /* Define if the assembler supports 64bit sparc. */
#undef AS_SPARC64_FLAG #undef AS_SPARC64_FLAG
......
...@@ -184,6 +184,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -184,6 +184,17 @@ Boston, MA 02111-1307, USA. */
|| (CHAR) == 'h' \ || (CHAR) == 'h' \
|| (CHAR) == 'x' \ || (CHAR) == 'x' \
|| (CHAR) == 'z') || (CHAR) == 'z')
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations.
Some Solaris dynamic linkers don't handle unaligned section relative
relocs properly, so force them to be aligned. */
#ifndef HAVE_AS_SPARC_UA_PCREL
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
#endif
/* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h. /* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
Instead, it is enabled here, because it does work under Solaris. */ Instead, it is enabled here, because it does work under Solaris. */
......
...@@ -1969,6 +1969,32 @@ do { \ ...@@ -1969,6 +1969,32 @@ do { \
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 24 : INVALID_REGNUM) #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 24 : INVALID_REGNUM)
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 1) /* %g1 */ #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 1) /* %g1 */
#define EH_RETURN_HANDLER_RTX gen_rtx_REG (Pmode, 31) /* %i7 */ #define EH_RETURN_HANDLER_RTX gen_rtx_REG (Pmode, 31) /* %i7 */
/* Select a format to encode pointers in exception handling data. CODE
is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
true if the symbol may be affected by dynamic relocations.
If assembler and linker properly support .uaword %r_disp32(foo),
then use PC relative 32-bit relocations instead of absolute relocs
for shared libraries. On sparc64, use pc relative 32-bit relocs even
for binaries, to save memory. */
#ifdef HAVE_AS_SPARC_UA_PCREL
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(flag_pic \
? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
: ((TARGET_ARCH64 && ! GLOBAL) \
? (DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
: DW_EH_PE_absptr))
/* Emit a PC-relative relocation. */
#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
do { \
fputs (integer_asm_op (SIZE, FALSE), FILE); \
fprintf (FILE, "%%r_disp%d(", SIZE * 8); \
assemble_name (FILE, LABEL); \
fputc (')', FILE); \
} while (0)
#endif
/* Addressing modes, and classification of registers for them. */ /* Addressing modes, and classification of registers for them. */
......
...@@ -7408,10 +7408,38 @@ EOF ...@@ -7408,10 +7408,38 @@ EOF
fi fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
echo "configure:7413: checking assembler and linker support unaligned pc related relocs" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
gcc_cv_as_sparc_ua_pcrel=unknown
if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
gcc_cv_as_sparc_ua_pcrel=no
echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1; then
if $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
gcc_cv_as_sparc_ua_pcrel=yes
fi
fi
rm -f conftest.s conftest.o conftest
fi
fi
echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel" 1>&6
if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
cat >> confdefs.h <<\EOF
#define HAVE_AS_SPARC_UA_PCREL 1
EOF
fi
case "$tm_file" in case "$tm_file" in
*64*) *64*)
echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6 echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6
echo "configure:7415: checking for 64 bit support in assembler ($gcc_cv_as)" >&5 echo "configure:7442: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -7456,7 +7484,7 @@ EOF ...@@ -7456,7 +7484,7 @@ EOF
if test "x$gcc_cv_as_flags64" != xno; then if test "x$gcc_cv_as_flags64" != xno; then
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6 echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
echo "configure:7460: checking for assembler offsetable %lo() support" >&5 echo "configure:7487: checking for assembler offsetable %lo() support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
...@@ -7496,7 +7524,7 @@ EOF ...@@ -7496,7 +7524,7 @@ EOF
i[34567]86-*-* | x86_64-*-*) i[34567]86-*-* | x86_64-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6 echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
echo "configure:7500: checking assembler instructions" >&5 echo "configure:7527: checking assembler instructions" >&5
gcc_cv_as_instructions= gcc_cv_as_instructions=
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
...@@ -7523,7 +7551,7 @@ EOF ...@@ -7523,7 +7551,7 @@ EOF
echo "$ac_t""$gcc_cv_as_instructions" 1>&6 echo "$ac_t""$gcc_cv_as_instructions" 1>&6
echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6 echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
echo "configure:7527: checking assembler GOTOFF in data directives" >&5 echo "configure:7554: checking assembler GOTOFF in data directives" >&5
gcc_cv_as_gotoff_in_data=no gcc_cv_as_gotoff_in_data=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
then then
...@@ -7553,7 +7581,7 @@ EOF ...@@ -7553,7 +7581,7 @@ EOF
esac esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6 echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
echo "configure:7557: checking assembler dwarf2 debug_line support" >&5 echo "configure:7584: checking assembler dwarf2 debug_line support" >&5
gcc_cv_as_dwarf2_debug_line=no gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version # ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any # of gas. Moreover, we need to emit a valid instruction to trigger any
...@@ -7609,7 +7637,7 @@ fi ...@@ -7609,7 +7637,7 @@ fi
echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6 echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6 echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
echo "configure:7613: checking assembler --gdwarf2 support" >&5 echo "configure:7640: checking assembler --gdwarf2 support" >&5
gcc_cv_as_gdwarf2_flag=no gcc_cv_as_gdwarf2_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then then
...@@ -7638,7 +7666,7 @@ fi ...@@ -7638,7 +7666,7 @@ fi
echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6 echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6 echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
echo "configure:7642: checking assembler --gstabs support" >&5 echo "configure:7669: checking assembler --gstabs support" >&5
gcc_cv_as_gstabs_flag=no gcc_cv_as_gstabs_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then then
...@@ -7666,7 +7694,7 @@ fi ...@@ -7666,7 +7694,7 @@ fi
echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6 echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6 echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
echo "configure:7670: checking linker PT_GNU_EH_FRAME support" >&5 echo "configure:7697: checking linker PT_GNU_EH_FRAME support" >&5
gcc_cv_ld_eh_frame_hdr=no gcc_cv_ld_eh_frame_hdr=no
if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
...@@ -7829,7 +7857,7 @@ fi ...@@ -7829,7 +7857,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
echo "configure:7833: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo "configure:7860: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode" enableval="$enable_maintainer_mode"
......
...@@ -1706,6 +1706,25 @@ EOF ...@@ -1706,6 +1706,25 @@ EOF
[Define if your assembler supports -relax option.]) [Define if your assembler supports -relax option.])
fi fi
AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
gcc_cv_as_sparc_ua_pcrel, [
gcc_cv_as_sparc_ua_pcrel=unknown
if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
gcc_cv_as_sparc_ua_pcrel=no
echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1; then
if $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
gcc_cv_as_sparc_ua_pcrel=yes
fi
fi
rm -f conftest.s conftest.o conftest
fi
])
if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
[Define if your assembler and linker support unaligned PC relative relocs.])
fi
case "$tm_file" in case "$tm_file" in
*64*) *64*)
AC_CACHE_CHECK([for 64 bit support in assembler ($gcc_cv_as)], AC_CACHE_CHECK([for 64 bit support in assembler ($gcc_cv_as)],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment