configure.in (HAVE_SPARC_UA_PCREL_HIDDEN): Test whether %r_disp32() works properly with .hidden symbols.

* configure.in (HAVE_SPARC_UA_PCREL_HIDDEN): Test whether %r_disp32()
	works properly with .hidden symbols.
	* configure: Rebuilt.
	* config.in: Rebuilt.
	* config/sparc/sparc.h (ASM_PREFERRED_EH_DATA_FORMAT): Use
	DW_EH_PE_absptr for flag_pic && GLOBAL if %r_disp32() doesn't work
	properly with .hidden symbols.

From-SVN: r51816
This commit is contained in:
Jakub Jelinek 2002-04-04 00:21:12 +02:00 committed by Jakub Jelinek
parent 9d7013b8ac
commit cf7b8b0dc4
5 changed files with 104 additions and 9 deletions

View File

@ -1,3 +1,13 @@
2002-04-03 Jakub Jelinek <jakub@redhat.com>
* configure.in (HAVE_SPARC_UA_PCREL_HIDDEN): Test whether %r_disp32()
works properly with .hidden symbols.
* configure: Rebuilt.
* config.in: Rebuilt.
* config/sparc/sparc.h (ASM_PREFERRED_EH_DATA_FORMAT): Use
DW_EH_PE_absptr for flag_pic && GLOBAL if %r_disp32() doesn't work
properly with .hidden symbols.
2002-04-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/6102

View File

@ -529,6 +529,9 @@
/* Define if your assembler and linker support unaligned PC relative relocs. */
#undef HAVE_AS_SPARC_UA_PCREL
/* Define if your assembler and linker support unaligned PC relative relocs against hidden symbols. */
#undef HAVE_AS_SPARC_UA_PCREL_HIDDEN
/* Define if the assembler supports 64bit sparc. */
#undef AS_SPARC64_FLAG

View File

@ -1955,14 +1955,27 @@ do { \
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. */
for binaries, to save memory.
binutils 2.12 would emit a R_SPARC_DISP32 dynamic relocation if the
symbol %r_disp32() is against was not local, but .hidden. In that
case, we have to use DW_EH_PE_absptr for pic personality. */
#ifdef HAVE_AS_SPARC_UA_PCREL
#ifdef HAVE_AS_SPARC_UA_PCREL_HIDDEN
#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))
#else
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(flag_pic \
? (GLOBAL ? DW_EH_PE_absptr : (DW_EH_PE_pcrel | DW_EH_PE_sdata4)) \
: ((TARGET_ARCH64 && ! GLOBAL) \
? (DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
: DW_EH_PE_absptr))
#endif
/* Emit a PC-relative relocation. */
#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \

47
gcc/configure vendored
View File

@ -7462,10 +7462,9 @@ else
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
if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
&& $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
gcc_cv_as_sparc_ua_pcrel=yes
fi
rm -f conftest.s conftest.o conftest
fi
@ -7480,6 +7479,46 @@ EOF
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
echo "configure:7430: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
gcc_cv_as_sparc_ua_pcrel_hidden=unknown
if test x$gcc_cv_objdump != x; then
gcc_cv_as_sparc_ua_pcrel_hidden=no
echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
echo "foo: .skip 4" >> conftest.s
if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
&& $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
&& $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
| grep ' 31000000 07323334' > /dev/null 2>&1; then
if $gcc_cv_objdump -R conftest 2> /dev/null \
| grep 'DISP32' > /dev/null 2>&1; then
:
else
gcc_cv_as_sparc_ua_pcrel_hidden=yes
fi
fi
fi
rm -f conftest.s conftest.o conftest
else
gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
fi
fi
echo "$ac_t""$gcc_cv_as_sparc_ua_pcrel_hidden" 1>&6
if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
cat >> confdefs.h <<\EOF
#define HAVE_AS_SPARC_UA_PCREL_HIDDEN 1
EOF
fi
case "$tm_file" in
*64*)
echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6

View File

@ -1755,10 +1755,9 @@ EOF
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
if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
&& $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
gcc_cv_as_sparc_ua_pcrel=yes
fi
rm -f conftest.s conftest.o conftest
fi
@ -1768,6 +1767,37 @@ EOF
[Define if your assembler and linker support unaligned PC relative relocs.])
fi
AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs against hidden symbols],
gcc_cv_as_sparc_ua_pcrel_hidden, [
if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
gcc_cv_as_sparc_ua_pcrel_hidden=unknown
if test x$gcc_cv_objdump != x; then
gcc_cv_as_sparc_ua_pcrel_hidden=no
echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
echo "foo: .skip 4" >> conftest.s
if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
&& $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
&& $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
| grep ' 31000000 07323334' > /dev/null 2>&1; then
if $gcc_cv_objdump -R conftest 2> /dev/null \
| grep 'DISP32' > /dev/null 2>&1; then
:
else
gcc_cv_as_sparc_ua_pcrel_hidden=yes
fi
fi
fi
rm -f conftest.s conftest.o conftest
else
gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
fi
])
if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
AC_DEFINE(HAVE_AS_SPARC_UA_PCREL_HIDDEN, 1,
[Define if your assembler and linker support unaligned PC relative relocs against hidden symbols.])
fi
case "$tm_file" in
*64*)
AC_CACHE_CHECK([for 64 bit support in assembler ($gcc_cv_as)],