mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-04-18 14:41:04 +08:00
* elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags
with bitfields. Make "type" and "other" bitfields too. (ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR, ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC, ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED, ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF, ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK, ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK, ELF_LINK_POINTER_EQUALITY_NEEDED): Delete. (ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update. * elf-hppa.h: Update all uses of elf_link_hash_flags. * elf-m10300.c: Likewise. * elf.c: Likewise. * elf32-arm.h: Likewise. * elf32-cris.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-sparc.c: Likewise. * elf32-vax.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elflink.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92. * configure: Regenerate. * aclocal.m4: Regenerate.
This commit is contained in:
parent
b6ee372a3e
commit
f5385ebfb8
@ -1,3 +1,48 @@
|
||||
2004-09-16 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* elf-bfd.h (struct elf_link_hash_entry): Replace elf_link_hash_flags
|
||||
with bitfields. Make "type" and "other" bitfields too.
|
||||
(ELF_LINK_HASH_REF_REGULAR, ELF_LINK_HASH_DEF_REGULAR,
|
||||
ELF_LINK_HASH_REF_DYNAMIC, ELF_LINK_HASH_DEF_DYNAMIC,
|
||||
ELF_LINK_HASH_REF_REGULAR_NONWEAK, ELF_LINK_HASH_DYNAMIC_ADJUSTED,
|
||||
ELF_LINK_HASH_NEEDS_COPY, ELF_LINK_HASH_NEEDS_PLT, ELF_LINK_NON_ELF,
|
||||
ELF_LINK_HIDDEN, ELF_LINK_FORCED_LOCAL, ELF_LINK_HASH_MARK,
|
||||
ELF_LINK_NON_GOT_REF, ELF_LINK_DYNAMIC_DEF, ELF_LINK_DYNAMIC_WEAK,
|
||||
ELF_LINK_POINTER_EQUALITY_NEEDED): Delete.
|
||||
(ELF_COMMON_DEF_P, WILL_CALL_FINISH_DYNAMIC_SYMBOL): Update.
|
||||
* elf-hppa.h: Update all uses of elf_link_hash_flags.
|
||||
* elf-m10300.c: Likewise.
|
||||
* elf.c: Likewise.
|
||||
* elf32-arm.h: Likewise.
|
||||
* elf32-cris.c: Likewise.
|
||||
* elf32-frv.c: Likewise.
|
||||
* elf32-hppa.c: Likewise.
|
||||
* elf32-i370.c: Likewise.
|
||||
* elf32-i386.c: Likewise.
|
||||
* elf32-m32r.c: Likewise.
|
||||
* elf32-m68k.c: Likewise.
|
||||
* elf32-ppc.c: Likewise.
|
||||
* elf32-s390.c: Likewise.
|
||||
* elf32-sh-symbian.c: Likewise.
|
||||
* elf32-sh.c: Likewise.
|
||||
* elf32-sh64.c: Likewise.
|
||||
* elf32-sparc.c: Likewise.
|
||||
* elf32-vax.c: Likewise.
|
||||
* elf32-xtensa.c: Likewise.
|
||||
* elf64-alpha.c: Likewise.
|
||||
* elf64-hppa.c: Likewise.
|
||||
* elf64-ppc.c: Likewise.
|
||||
* elf64-s390.c: Likewise.
|
||||
* elf64-sh64.c: Likewise.
|
||||
* elf64-sparc.c: Likewise.
|
||||
* elf64-x86-64.c: Likewise.
|
||||
* elflink.c: Likewise.
|
||||
* elfxx-ia64.c: Likewise.
|
||||
* elfxx-mips.c: Likewise.
|
||||
* configure.in (AM_INIT_AUTOMAKE): Set version to 2.15.92.
|
||||
* configure: Regenerate.
|
||||
* aclocal.m4: Regenerate.
|
||||
|
||||
2004-09-16 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* elf32-arm.h (elf32_arm_gc_sweep_hook): Add #ifndef OLD_ARM_ABI
|
||||
|
2135
bfd/aclocal.m4
vendored
2135
bfd/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
728
bfd/configure
vendored
728
bfd/configure
vendored
@ -309,7 +309,7 @@ ac_includes_default="\
|
||||
# include <unistd.h>
|
||||
#endif"
|
||||
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S STRIP ac_ct_STRIP LIBTOOL WARN_CFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults LIBOBJS LTLIBOBJS'
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB LN_S LIBTOOL WARN_CFLAGS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG WIN32LDFLAGS WIN32LIBADD TDEFINES wordsize bfd_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults LIBOBJS LTLIBOBJS'
|
||||
ac_subst_files=''
|
||||
|
||||
# Initialize some variables set by options.
|
||||
@ -850,6 +850,8 @@ if test -n "$ac_init_help"; then
|
||||
Optional Features:
|
||||
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
|
||||
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
||||
--disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors
|
||||
--enable-shared=PKGS build shared libraries default=no
|
||||
--enable-static=PKGS build static libraries default=yes
|
||||
--enable-fast-install=PKGS optimize for fast installation default=yes
|
||||
@ -858,8 +860,8 @@ Optional Features:
|
||||
--enable-targets alternative target configurations
|
||||
--enable-commonbfdlib build shared BFD/opcodes/libiberty library
|
||||
--enable-build-warnings Enable build-time compiler warnings if gcc is used
|
||||
--enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer
|
||||
--enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer
|
||||
--enable-install-libbfd controls installation of libbfd and related headers
|
||||
--disable-nls do not use Native Language Support
|
||||
|
||||
@ -2358,14 +2360,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
|
||||
echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_cposix_strerror+set}" = set; then
|
||||
echo "$as_me:$LINENO: checking for library containing strerror" >&5
|
||||
echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
|
||||
if test "${ac_cv_search_strerror+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lcposix $LIBS"
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
ac_cv_search_strerror=no
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
@ -2410,27 +2411,83 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_lib_cposix_strerror=yes
|
||||
ac_cv_search_strerror="none required"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_lib_cposix_strerror=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
if test "$ac_cv_search_strerror" = no; then
|
||||
for ac_lib in cposix; do
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char strerror ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
strerror ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_search_strerror="-l$ac_lib"
|
||||
break
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
|
||||
if test $ac_cv_lib_cposix_strerror = yes; then
|
||||
LIBS="$LIBS -lcposix"
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
done
|
||||
fi
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
|
||||
echo "${ECHO_T}$ac_cv_search_strerror" >&6
|
||||
if test "$ac_cv_search_strerror" != no; then
|
||||
test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
am__api_version="1.4"
|
||||
am__api_version="1.9"
|
||||
# Find a good install program. We prefer a C program (faster),
|
||||
# so one script is as good as another. But avoid the broken or
|
||||
# incompatible versions:
|
||||
@ -2514,20 +2571,21 @@ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
|
||||
echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
if test "$*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "$*" != "X conftestfile $srcdir/configure"; then
|
||||
rm -f conftest.file
|
||||
if test "$*" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$*" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
@ -2540,7 +2598,7 @@ alias in your environment" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
test "$2" = conftestfile
|
||||
test "$2" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
@ -2552,7 +2610,6 @@ echo "$as_me: error: newly created file is older than distributed files!
|
||||
Check your system clock" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
rm -f conftest*
|
||||
echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6
|
||||
test "$program_prefix" != NONE &&
|
||||
@ -2568,6 +2625,92 @@ _ACEOF
|
||||
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
|
||||
rm conftest.sed
|
||||
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
{ echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
|
||||
echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
|
||||
fi
|
||||
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
# We used to keeping the `.' as first argument, in order to
|
||||
# allow $(mkdir_p) to be used without argument. As in
|
||||
# $(mkdir_p) $(somedir)
|
||||
# where $(somedir) is conditionally defined. However this is wrong
|
||||
# for two reasons:
|
||||
# 1. if the package is installed by a user who cannot write `.'
|
||||
# make install will fail,
|
||||
# 2. the above comment should most certainly read
|
||||
# $(mkdir_p) $(DESTDIR)$(somedir)
|
||||
# so it does not work when $(somedir) is undefined and
|
||||
# $(DESTDIR) is not.
|
||||
# To support the latter case, we have to write
|
||||
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
|
||||
# so the `.' trick is pointless.
|
||||
mkdir_p='mkdir -p --'
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
for d in ./-p ./--version;
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
|
||||
if test -f "$ac_aux_dir/mkinstalldirs"; then
|
||||
mkdir_p='$(mkinstalldirs)'
|
||||
else
|
||||
mkdir_p='$(install_sh) -d'
|
||||
fi
|
||||
fi
|
||||
|
||||
for ac_prog in gawk mawk nawk awk
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||
if test "${ac_cv_prog_AWK+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
if test -n "$AWK"; then
|
||||
ac_cv_prog_AWK="$AWK" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_prog_AWK="$ac_prog"
|
||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
fi
|
||||
fi
|
||||
AWK=$ac_cv_prog_AWK
|
||||
if test -n "$AWK"; then
|
||||
echo "$as_me:$LINENO: result: $AWK" >&5
|
||||
echo "${ECHO_T}$AWK" >&6
|
||||
else
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
test -n "$AWK" && break
|
||||
done
|
||||
|
||||
echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
|
||||
echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
|
||||
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
|
||||
@ -2597,17 +2740,103 @@ echo "${ECHO_T}no" >&6
|
||||
SET_MAKE="MAKE=${MAKE-make}"
|
||||
fi
|
||||
|
||||
rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
|
||||
PACKAGE=bfd
|
||||
DEPDIR="${am__leading_dot}deps"
|
||||
|
||||
VERSION=2.15.91
|
||||
ac_config_commands="$ac_config_commands depfiles"
|
||||
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
|
||||
am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
|
||||
echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "$as_me:$LINENO: result: $_am_result" >&5
|
||||
echo "${ECHO_T}$_am_result" >&6
|
||||
rm -f confinc confmf
|
||||
|
||||
# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
|
||||
if test "${enable_dependency_tracking+set}" = set; then
|
||||
enableval="$enable_dependency_tracking"
|
||||
|
||||
fi;
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
|
||||
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
AMDEP_TRUE=
|
||||
AMDEP_FALSE='#'
|
||||
else
|
||||
AMDEP_TRUE='#'
|
||||
AMDEP_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" &&
|
||||
test -f $srcdir/config.status; then
|
||||
{ { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
|
||||
echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE=bfd
|
||||
VERSION=2.15.92
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define PACKAGE "$PACKAGE"
|
||||
_ACEOF
|
||||
@ -2617,83 +2846,231 @@ cat >>confdefs.h <<_ACEOF
|
||||
#define VERSION "$VERSION"
|
||||
_ACEOF
|
||||
|
||||
# Some tools Automake needs.
|
||||
|
||||
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
|
||||
|
||||
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5
|
||||
echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
|
||||
ACLOCAL=aclocal-${am__api_version}
|
||||
echo "$as_me:$LINENO: result: found" >&5
|
||||
echo "${ECHO_T}found" >&6
|
||||
AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
|
||||
|
||||
|
||||
AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
|
||||
|
||||
|
||||
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
|
||||
|
||||
|
||||
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
|
||||
|
||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
if test "$cross_compiling" != no; then
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}strip; ac_word=$2
|
||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||
if test "${ac_cv_prog_STRIP+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
|
||||
echo "$as_me:$LINENO: result: missing" >&5
|
||||
echo "${ECHO_T}missing" >&6
|
||||
if test -n "$STRIP"; then
|
||||
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
|
||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
fi
|
||||
fi
|
||||
STRIP=$ac_cv_prog_STRIP
|
||||
if test -n "$STRIP"; then
|
||||
echo "$as_me:$LINENO: result: $STRIP" >&5
|
||||
echo "${ECHO_T}$STRIP" >&6
|
||||
else
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
echo "$as_me:$LINENO: checking for working autoconf" >&5
|
||||
echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
|
||||
AUTOCONF=autoconf
|
||||
echo "$as_me:$LINENO: result: found" >&5
|
||||
echo "${ECHO_T}found" >&6
|
||||
fi
|
||||
if test -z "$ac_cv_prog_STRIP"; then
|
||||
ac_ct_STRIP=$STRIP
|
||||
# Extract the first word of "strip", so it can be a program name with args.
|
||||
set dummy strip; ac_word=$2
|
||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
AUTOCONF="$missing_dir/missing autoconf"
|
||||
echo "$as_me:$LINENO: result: missing" >&5
|
||||
echo "${ECHO_T}missing" >&6
|
||||
if test -n "$ac_ct_STRIP"; then
|
||||
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
|
||||
else
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_prog_ac_ct_STRIP="strip"
|
||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
|
||||
fi
|
||||
fi
|
||||
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
|
||||
if test -n "$ac_ct_STRIP"; then
|
||||
echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
|
||||
echo "${ECHO_T}$ac_ct_STRIP" >&6
|
||||
else
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
|
||||
echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5
|
||||
echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
|
||||
AUTOMAKE=automake-${am__api_version}
|
||||
echo "$as_me:$LINENO: result: found" >&5
|
||||
echo "${ECHO_T}found" >&6
|
||||
STRIP=$ac_ct_STRIP
|
||||
else
|
||||
AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
|
||||
echo "$as_me:$LINENO: result: missing" >&5
|
||||
echo "${ECHO_T}missing" >&6
|
||||
STRIP="$ac_cv_prog_STRIP"
|
||||
fi
|
||||
|
||||
echo "$as_me:$LINENO: checking for working autoheader" >&5
|
||||
echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if (autoheader --version) < /dev/null > /dev/null 2>&1; then
|
||||
AUTOHEADER=autoheader
|
||||
echo "$as_me:$LINENO: result: found" >&5
|
||||
echo "${ECHO_T}found" >&6
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
||||
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
# Always define AMTAR for backward compatibility.
|
||||
|
||||
AMTAR=${AMTAR-"${am_missing_run}tar"}
|
||||
|
||||
am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
|
||||
|
||||
|
||||
|
||||
|
||||
depcc="$CC" am_compiler_list=
|
||||
|
||||
echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
|
||||
echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
|
||||
if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
AUTOHEADER="$missing_dir/missing autoheader"
|
||||
echo "$as_me:$LINENO: result: missing" >&5
|
||||
echo "${ECHO_T}missing" >&6
|
||||
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_CC_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_CC_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_CC_dependencies_compiler_type=none
|
||||
fi
|
||||
|
||||
echo "$as_me:$LINENO: checking for working makeinfo" >&5
|
||||
echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
|
||||
MAKEINFO=makeinfo
|
||||
echo "$as_me:$LINENO: result: found" >&5
|
||||
echo "${ECHO_T}found" >&6
|
||||
else
|
||||
MAKEINFO="$missing_dir/missing makeinfo"
|
||||
echo "$as_me:$LINENO: result: missing" >&5
|
||||
echo "${ECHO_T}missing" >&6
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
|
||||
echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
|
||||
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
|
||||
|
||||
|
||||
|
||||
if
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
|
||||
am__fastdepCC_TRUE=
|
||||
am__fastdepCC_FALSE='#'
|
||||
else
|
||||
am__fastdepCC_TRUE='#'
|
||||
am__fastdepCC_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3597,7 +3974,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
|
||||
case $host in
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 3600 "configure"' > conftest.$ac_ext
|
||||
echo '#line 3977 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@ -3907,11 +4284,8 @@ if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then
|
||||
fi
|
||||
|
||||
|
||||
|
||||
ac_config_headers="$ac_config_headers config.h:config.in"
|
||||
|
||||
ac_config_commands="$ac_config_commands default-1"
|
||||
|
||||
|
||||
if test -z "$target" ; then
|
||||
{ { echo "$as_me:$LINENO: error: Unrecognized target system type; please check config.sub." >&5
|
||||
@ -3939,6 +4313,7 @@ else
|
||||
MAINTAINER_MODE_TRUE='#'
|
||||
MAINTAINER_MODE_FALSE=
|
||||
fi
|
||||
|
||||
MAINT=$MAINTAINER_MODE_TRUE
|
||||
|
||||
|
||||
@ -3981,6 +4356,7 @@ else
|
||||
INSTALL_LIBBFD_TRUE='#'
|
||||
INSTALL_LIBBFD_FALSE=
|
||||
fi
|
||||
|
||||
# Need _noncanonical variables for this.
|
||||
|
||||
|
||||
@ -12341,6 +12717,34 @@ LIBOBJS=$ac_libobjs
|
||||
LTLIBOBJS=$ac_ltlibobjs
|
||||
|
||||
|
||||
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
echo "$as_me: error: conditional \"AMDEP\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
if test -z "${INSTALL_LIBBFD_TRUE}" && test -z "${INSTALL_LIBBFD_FALSE}"; then
|
||||
{ { echo "$as_me:$LINENO: error: conditional \"INSTALL_LIBBFD\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&5
|
||||
echo "$as_me: error: conditional \"INSTALL_LIBBFD\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
: ${CONFIG_STATUS=./config.status}
|
||||
ac_clean_files_save=$ac_clean_files
|
||||
@ -12774,7 +13178,7 @@ cat >>$CONFIG_STATUS <<_ACEOF
|
||||
# INIT-COMMANDS section.
|
||||
#
|
||||
|
||||
|
||||
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
|
||||
|
||||
|
||||
_ACEOF
|
||||
@ -12790,7 +13194,7 @@ do
|
||||
"doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
|
||||
"bfd-in3.h" ) CONFIG_FILES="$CONFIG_FILES bfd-in3.h:bfd-in2.h" ;;
|
||||
"po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;;
|
||||
"default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
|
||||
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
|
||||
"default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
|
||||
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
|
||||
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
|
||||
@ -12900,6 +13304,7 @@ s,@OBJEXT@,$OBJEXT,;t t
|
||||
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
|
||||
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
|
||||
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
|
||||
s,@CYGPATH_W@,$CYGPATH_W,;t t
|
||||
s,@PACKAGE@,$PACKAGE,;t t
|
||||
s,@VERSION@,$VERSION,;t t
|
||||
s,@ACLOCAL@,$ACLOCAL,;t t
|
||||
@ -12907,14 +13312,31 @@ s,@AUTOCONF@,$AUTOCONF,;t t
|
||||
s,@AUTOMAKE@,$AUTOMAKE,;t t
|
||||
s,@AUTOHEADER@,$AUTOHEADER,;t t
|
||||
s,@MAKEINFO@,$MAKEINFO,;t t
|
||||
s,@install_sh@,$install_sh,;t t
|
||||
s,@STRIP@,$STRIP,;t t
|
||||
s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
|
||||
s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
|
||||
s,@mkdir_p@,$mkdir_p,;t t
|
||||
s,@AWK@,$AWK,;t t
|
||||
s,@SET_MAKE@,$SET_MAKE,;t t
|
||||
s,@am__leading_dot@,$am__leading_dot,;t t
|
||||
s,@AMTAR@,$AMTAR,;t t
|
||||
s,@am__tar@,$am__tar,;t t
|
||||
s,@am__untar@,$am__untar,;t t
|
||||
s,@DEPDIR@,$DEPDIR,;t t
|
||||
s,@am__include@,$am__include,;t t
|
||||
s,@am__quote@,$am__quote,;t t
|
||||
s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
|
||||
s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
|
||||
s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
|
||||
s,@CCDEPMODE@,$CCDEPMODE,;t t
|
||||
s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
|
||||
s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
|
||||
s,@AR@,$AR,;t t
|
||||
s,@ac_ct_AR@,$ac_ct_AR,;t t
|
||||
s,@RANLIB@,$RANLIB,;t t
|
||||
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
|
||||
s,@LN_S@,$LN_S,;t t
|
||||
s,@STRIP@,$STRIP,;t t
|
||||
s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
|
||||
s,@LIBTOOL@,$LIBTOOL,;t t
|
||||
s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
|
||||
s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
|
||||
@ -13432,6 +13854,28 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
|
||||
cat $tmp/config.h
|
||||
rm -f $tmp/config.h
|
||||
fi
|
||||
# Compute $ac_file's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$ac_file | $ac_file:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
|
||||
$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X$ac_file : 'X\(//\)[^/]' \| \
|
||||
X$ac_file : 'X\(//\)$' \| \
|
||||
X$ac_file : 'X\(/\)' \| \
|
||||
. : '\(.\)' 2>/dev/null ||
|
||||
echo X$ac_file |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
|
||||
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
|
||||
/^X\(\/\/\)$/{ s//\1/; q; }
|
||||
/^X\(\/\).*/{ s//\1/; q; }
|
||||
s/.*/./; q'`/stamp-h$_am_stamp_count
|
||||
done
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<\_ACEOF
|
||||
@ -13548,7 +13992,91 @@ esac
|
||||
{ echo "$as_me:$LINENO: executing $ac_dest commands" >&5
|
||||
echo "$as_me: executing $ac_dest commands" >&6;}
|
||||
case $ac_dest in
|
||||
default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
|
||||
depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# So let's grep whole file.
|
||||
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
|
||||
dirpart=`(dirname "$mf") 2>/dev/null ||
|
||||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$mf" : 'X\(//\)[^/]' \| \
|
||||
X"$mf" : 'X\(//\)$' \| \
|
||||
X"$mf" : 'X\(/\)' \| \
|
||||
. : '\(.\)' 2>/dev/null ||
|
||||
echo X"$mf" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
|
||||
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
|
||||
/^X\(\/\/\)$/{ s//\1/; q; }
|
||||
/^X\(\/\).*/{ s//\1/; q; }
|
||||
s/.*/./; q'`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`(dirname "$file") 2>/dev/null ||
|
||||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$file" : 'X\(//\)[^/]' \| \
|
||||
X"$file" : 'X\(//\)$' \| \
|
||||
X"$file" : 'X\(/\)' \| \
|
||||
. : '\(.\)' 2>/dev/null ||
|
||||
echo X"$file" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
|
||||
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
|
||||
/^X\(\/\/\)$/{ s//\1/; q; }
|
||||
/^X\(\/\).*/{ s//\1/; q; }
|
||||
s/.*/./; q'`
|
||||
{ if $as_mkdir_p; then
|
||||
mkdir -p $dirpart/$fdir
|
||||
else
|
||||
as_dir=$dirpart/$fdir
|
||||
as_dirs=
|
||||
while test ! -d "$as_dir"; do
|
||||
as_dirs="$as_dir $as_dirs"
|
||||
as_dir=`(dirname "$as_dir") 2>/dev/null ||
|
||||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$as_dir" : 'X\(//\)[^/]' \| \
|
||||
X"$as_dir" : 'X\(//\)$' \| \
|
||||
X"$as_dir" : 'X\(/\)' \| \
|
||||
. : '\(.\)' 2>/dev/null ||
|
||||
echo X"$as_dir" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
|
||||
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
|
||||
/^X\(\/\/\)$/{ s//\1/; q; }
|
||||
/^X\(\/\).*/{ s//\1/; q; }
|
||||
s/.*/./; q'`
|
||||
done
|
||||
test ! -n "$as_dirs" || mkdir $as_dirs
|
||||
fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
|
||||
echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
|
||||
{ (exit 1); exit 1; }; }; }
|
||||
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
;;
|
||||
default ) sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile ;;
|
||||
esac
|
||||
done
|
||||
|
@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c])
|
||||
AC_CANONICAL_TARGET
|
||||
AC_ISC_POSIX
|
||||
|
||||
AM_INIT_AUTOMAKE(bfd, 2.15.91)
|
||||
AM_INIT_AUTOMAKE(bfd, 2.15.92)
|
||||
|
||||
dnl These must be called before AM_PROG_LIBTOOL, because it may want
|
||||
dnl to call AC_CHECK_PROG.
|
||||
|
@ -162,47 +162,45 @@ struct elf_link_hash_entry
|
||||
bfd_size_type size;
|
||||
|
||||
/* Symbol type (STT_NOTYPE, STT_OBJECT, etc.). */
|
||||
char type;
|
||||
unsigned int type : 8;
|
||||
|
||||
/* Symbol st_other value, symbol visibility. */
|
||||
unsigned char other;
|
||||
unsigned int other : 8;
|
||||
|
||||
/* Some flags; legal values follow. */
|
||||
unsigned short elf_link_hash_flags;
|
||||
/* Symbol is referenced by a non-shared object. */
|
||||
#define ELF_LINK_HASH_REF_REGULAR 01
|
||||
unsigned int ref_regular : 1;
|
||||
/* Symbol is defined by a non-shared object. */
|
||||
#define ELF_LINK_HASH_DEF_REGULAR 02
|
||||
unsigned int def_regular : 1;
|
||||
/* Symbol is referenced by a shared object. */
|
||||
#define ELF_LINK_HASH_REF_DYNAMIC 04
|
||||
unsigned int ref_dynamic : 1;
|
||||
/* Symbol is defined by a shared object. */
|
||||
#define ELF_LINK_HASH_DEF_DYNAMIC 010
|
||||
unsigned int def_dynamic : 1;
|
||||
/* Symbol has a non-weak reference from a non-shared object. */
|
||||
#define ELF_LINK_HASH_REF_REGULAR_NONWEAK 020
|
||||
unsigned int ref_regular_nonweak : 1;
|
||||
/* Dynamic symbol has been adjustd. */
|
||||
#define ELF_LINK_HASH_DYNAMIC_ADJUSTED 040
|
||||
unsigned int dynamic_adjusted : 1;
|
||||
/* Symbol needs a copy reloc. */
|
||||
#define ELF_LINK_HASH_NEEDS_COPY 0100
|
||||
unsigned int needs_copy : 1;
|
||||
/* Symbol needs a procedure linkage table entry. */
|
||||
#define ELF_LINK_HASH_NEEDS_PLT 0200
|
||||
unsigned int needs_plt : 1;
|
||||
/* Symbol appears in a non-ELF input file. */
|
||||
#define ELF_LINK_NON_ELF 0400
|
||||
unsigned int non_elf : 1;
|
||||
/* Symbol should be marked as hidden in the version information. */
|
||||
#define ELF_LINK_HIDDEN 01000
|
||||
unsigned int hidden : 1;
|
||||
/* Symbol was forced to local scope due to a version script file. */
|
||||
#define ELF_LINK_FORCED_LOCAL 02000
|
||||
unsigned int forced_local : 1;
|
||||
/* Symbol was marked during garbage collection. */
|
||||
#define ELF_LINK_HASH_MARK 04000
|
||||
unsigned int mark : 1;
|
||||
/* Symbol is referenced by a non-GOT/non-PLT relocation. This is
|
||||
not currently set by all the backends. */
|
||||
#define ELF_LINK_NON_GOT_REF 010000
|
||||
unsigned int non_got_ref : 1;
|
||||
/* Symbol has a definition in a shared object. */
|
||||
#define ELF_LINK_DYNAMIC_DEF 020000
|
||||
unsigned int dynamic_def : 1;
|
||||
/* Symbol is weak in all shared objects. */
|
||||
#define ELF_LINK_DYNAMIC_WEAK 040000
|
||||
unsigned int dynamic_weak : 1;
|
||||
/* Symbol is referenced with a relocation where C/C++ pointer equality
|
||||
matters. */
|
||||
#define ELF_LINK_POINTER_EQUALITY_NEEDED 0100000
|
||||
unsigned int pointer_equality_needed : 1;
|
||||
};
|
||||
|
||||
/* Will references to this symbol always reference the symbol
|
||||
@ -221,8 +219,8 @@ struct elf_link_hash_entry
|
||||
/* Common symbols that are turned into definitions don't have the
|
||||
DEF_REGULAR flag set, so they might appear to be undefined. */
|
||||
#define ELF_COMMON_DEF_P(H) \
|
||||
(((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 \
|
||||
&& ((H)->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 \
|
||||
(!(H)->def_regular \
|
||||
&& !(H)->def_dynamic \
|
||||
&& (H)->root.type == bfd_link_hash_defined)
|
||||
|
||||
/* Records local symbols to be emitted in the dynamic symbol table. */
|
||||
@ -1771,10 +1769,8 @@ extern bfd_boolean _sh_elf_set_mach_from_flags
|
||||
about initializing any .plt and .got entries in relocate_section. */
|
||||
#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
|
||||
((DYN) \
|
||||
&& ((SHARED) \
|
||||
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
|
||||
&& ((H)->dynindx != -1 \
|
||||
|| ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
|
||||
&& ((SHARED) || !(H)->forced_local) \
|
||||
&& ((H)->dynindx != -1 || (H)->forced_local))
|
||||
|
||||
/* This macro is to avoid lots of duplicated code in the body
|
||||
of xxx_relocate_section() in the various elfxx-xxxx.c files. */
|
||||
|
@ -1115,11 +1115,11 @@ elf_hppa_unmark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
|
||||
if (! info->relocatable
|
||||
&& info->unresolved_syms_in_shared_libs != RM_IGNORE
|
||||
&& h->root.type == bfd_link_hash_undefined
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
|
||||
&& h->ref_dynamic
|
||||
&& !h->ref_regular)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_REF_DYNAMIC;
|
||||
h->elf_link_hash_flags |= 0x8000;
|
||||
h->ref_dynamic = 0;
|
||||
h->pointer_equality_needed = 1;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1149,12 +1149,12 @@ elf_hppa_remark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
|
||||
if (! info->relocatable
|
||||
&& info->unresolved_syms_in_shared_libs != RM_IGNORE
|
||||
&& h->root.type == bfd_link_hash_undefined
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
|
||||
&& (h->elf_link_hash_flags & 0x8000) != 0)
|
||||
&& !h->ref_dynamic
|
||||
&& !h->ref_regular
|
||||
&& h->pointer_equality_needed)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
|
||||
h->elf_link_hash_flags &= ~0x8000;
|
||||
h->ref_dynamic = 1;
|
||||
h->pointer_equality_needed = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -593,7 +593,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
|
||||
get_elf_backend_data (abfd)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -627,7 +627,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
|
||||
bed->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -864,7 +864,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
|
||||
break;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
|
||||
break;
|
||||
|
||||
@ -875,12 +875,12 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
|
||||
case R_MN10300_PCREL16:
|
||||
case R_MN10300_PCREL8:
|
||||
if (h != NULL)
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
break;
|
||||
|
||||
case R_MN10300_32:
|
||||
if (h != NULL)
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* If we are creating a shared library, then we need to copy
|
||||
the reloc into the shared library. */
|
||||
@ -1470,8 +1470,7 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
externally in shared libraries. We can't
|
||||
do anything with them here. */
|
||||
|| ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)))))
|
||||
&& h->root.def_dynamic)))))
|
||||
/* In these cases, we don't need the relocation
|
||||
value. We check specially because in some
|
||||
obscure cases sec->output_section will be NULL. */
|
||||
@ -4021,31 +4020,28 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic)
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
object. In such a case, we don't actually need to build
|
||||
a procedure linkage table, and we can just do a REL32
|
||||
reloc instead. */
|
||||
BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
|
||||
BFD_ASSERT (h->needs_plt);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -4070,7 +4066,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = s->size;
|
||||
@ -4121,7 +4117,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* We must allocate the symbol in our .dynbss section, which will
|
||||
@ -4148,7 +4144,7 @@ _bfd_mn10300_elf_adjust_dynamic_symbol (info, h)
|
||||
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -4445,7 +4441,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
(bfd_byte *) ((Elf32_External_Rela *) srel->contents
|
||||
+ plt_index));
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
sym->st_shndx = SHN_UNDEF;
|
||||
@ -4474,7 +4470,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
initialized in the relocate_section function. */
|
||||
if (info->shared
|
||||
&& (info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& h->def_regular)
|
||||
{
|
||||
rel.r_info = ELF32_R_INFO (0, R_MN10300_RELATIVE);
|
||||
rel.r_addend = (h->root.u.def.value
|
||||
@ -4494,7 +4490,7 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
++ srel->reloc_count;
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection * s;
|
||||
Elf_Internal_Rela rel;
|
||||
|
34
bfd/elf.c
34
bfd/elf.c
@ -1407,7 +1407,22 @@ _bfd_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
|
||||
This flag is then reset by the code which reads an ELF input
|
||||
file. This ensures that a symbol created by a non-ELF symbol
|
||||
reader will have the flag set correctly. */
|
||||
ret->elf_link_hash_flags = ELF_LINK_NON_ELF;
|
||||
ret->ref_regular = 0;
|
||||
ret->def_regular = 0;
|
||||
ret->ref_dynamic = 0;
|
||||
ret->def_dynamic = 0;
|
||||
ret->ref_regular_nonweak = 0;
|
||||
ret->dynamic_adjusted = 0;
|
||||
ret->needs_copy = 0;
|
||||
ret->needs_plt = 0;
|
||||
ret->non_elf = 1;
|
||||
ret->hidden = 0;
|
||||
ret->forced_local = 0;
|
||||
ret->mark = 0;
|
||||
ret->non_got_ref = 0;
|
||||
ret->dynamic_def = 0;
|
||||
ret->dynamic_weak = 0;
|
||||
ret->pointer_equality_needed = 0;
|
||||
}
|
||||
|
||||
return entry;
|
||||
@ -1427,13 +1442,12 @@ _bfd_elf_link_hash_copy_indirect (const struct elf_backend_data *bed,
|
||||
/* Copy down any references that we may have already seen to the
|
||||
symbol which just became indirect. */
|
||||
|
||||
dir->elf_link_hash_flags
|
||||
|= ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_NON_GOT_REF
|
||||
| ELF_LINK_HASH_NEEDS_PLT
|
||||
| ELF_LINK_POINTER_EQUALITY_NEEDED);
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->non_got_ref |= ind->non_got_ref;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
dir->pointer_equality_needed |= ind->pointer_equality_needed;
|
||||
|
||||
if (ind->root.type != bfd_link_hash_indirect)
|
||||
return;
|
||||
@ -1475,10 +1489,10 @@ _bfd_elf_link_hash_hide_symbol (struct bfd_link_info *info,
|
||||
bfd_boolean force_local)
|
||||
{
|
||||
h->plt = elf_hash_table (info)->init_offset;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
if (force_local)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
|
||||
h->forced_local = 1;
|
||||
if (h->dynindx != -1)
|
||||
{
|
||||
h->dynindx = -1;
|
||||
|
@ -1330,8 +1330,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
||||
&& h->dynindx != -1
|
||||
&& (!info->shared
|
||||
|| !info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
else
|
||||
{
|
||||
@ -2112,10 +2111,8 @@ elf32_arm_relocate_section (bfd * output_bfd,
|
||||
case R_ARM_PLT32:
|
||||
|
||||
if (info->shared
|
||||
&& (
|
||||
(!info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
)
|
||||
&& ((!info->symbolic && h->dynindx != -1)
|
||||
|| !h->def_regular)
|
||||
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
&& ((input_section->flags & SEC_ALLOC) != 0
|
||||
/* DWARF will emit R_ARM_ABS32 relocations in its
|
||||
@ -2123,8 +2120,7 @@ elf32_arm_relocate_section (bfd * output_bfd,
|
||||
in shared libraries. We can't do anything
|
||||
with them here. */
|
||||
|| ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
)
|
||||
relocation = 0;
|
||||
break;
|
||||
@ -2139,8 +2135,7 @@ elf32_arm_relocate_section (bfd * output_bfd,
|
||||
info->shared, h))
|
||||
&& (!info->shared
|
||||
|| (!info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
relocation = 0;
|
||||
break;
|
||||
|
||||
@ -2905,7 +2900,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
Tentatively set the flag for now, and correct in
|
||||
adjust_dynamic_symbol. */
|
||||
if (!info->shared)
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* We may need a .plt entry if the function this reloc
|
||||
refers to is in a different object. We can't tell for
|
||||
@ -2913,7 +2908,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
symbol local. */
|
||||
if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24
|
||||
|| ELF32_R_TYPE (rel->r_info) == R_ARM_PLT32)
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
|
||||
/* If we create a PLT entry, this relocation will reference
|
||||
it, even if it's an ABS32 relocation. */
|
||||
@ -2942,8 +2937,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
&& ELF32_R_TYPE (rel->r_info) != R_ARM_REL32)
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
{
|
||||
struct elf32_arm_relocs_copied *p, **head;
|
||||
|
||||
@ -3192,20 +3186,17 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| SYMBOL_CALLS_LOCAL (info, h)
|
||||
@ -3218,7 +3209,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
|
||||
such a case, we don't actually need to build a procedure
|
||||
linkage table, and we can just do a PC24 reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -3276,7 +3267,7 @@ elf32_arm_adjust_dynamic_symbol (struct bfd_link_info * info,
|
||||
srel = bfd_get_section_by_name (dynobj, ".rel.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rel);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -3332,7 +3323,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -3356,7 +3347,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -3376,13 +3367,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
if (h->got.refcount > 0)
|
||||
@ -3393,7 +3384,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -3439,9 +3430,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->root.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -3449,7 +3440,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -3800,7 +3791,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
|
||||
loc = srel->contents + plt_index * sizeof (Elf32_External_Rel);
|
||||
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -3809,8 +3800,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
|
||||
Otherwise, the PLT entry would provide a definition for
|
||||
the symbol even if the symbol wasn't defined anywhere,
|
||||
and so the symbol would never be NULL. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
|
||||
== 0)
|
||||
if (!h->ref_regular_nonweak)
|
||||
sym->st_value = 0;
|
||||
}
|
||||
}
|
||||
@ -3854,7 +3844,7 @@ elf32_arm_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info * info,
|
||||
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection * s;
|
||||
Elf_Internal_Rela rel;
|
||||
|
@ -905,8 +905,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
other targets. */
|
||||
if (info->shared
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
|| !h->def_regular)
|
||||
&& (input_section->flags & SEC_ALLOC) != 0
|
||||
&& (r_type == R_CRIS_8
|
||||
|| r_type == R_CRIS_16
|
||||
@ -967,11 +966,9 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
if (h != NULL
|
||||
&& (h->got.offset == (bfd_vma) -1
|
||||
|| (!info->shared
|
||||
&& !((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& h->root.type == bfd_link_hash_undefweak)))))
|
||||
&& !(h->def_regular
|
||||
|| (!h->def_dynamic
|
||||
&& h->root.type == bfd_link_hash_undefweak)))))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
((h->got.offset == (bfd_vma) -1)
|
||||
@ -1011,13 +1008,12 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|
||||
if (!elf_hash_table (info)->dynamic_sections_created
|
||||
|| (! info->shared
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
&& (h->def_regular
|
||||
|| h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_NEEDS_PLT)))
|
||||
|| h->needs_plt))
|
||||
|| (info->shared
|
||||
&& (info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
&& h->def_regular))
|
||||
{
|
||||
/* This wasn't checked above for ! info->shared, but
|
||||
must hold there if we get here; the symbol must
|
||||
@ -1025,11 +1021,9 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
or be a function or otherwise need a PLT. */
|
||||
BFD_ASSERT (!elf_hash_table (info)->dynamic_sections_created
|
||||
|| info->shared
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
|| h->def_regular
|
||||
|| h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_NEEDS_PLT)
|
||||
|| h->needs_plt
|
||||
|| h->root.type == bfd_link_hash_undefweak);
|
||||
|
||||
/* This is actually a static link, or it is a
|
||||
@ -1133,8 +1127,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
if (h != NULL
|
||||
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
&& !(!info->shared
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
|| ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->def_regular
|
||||
|| (!h->def_dynamic
|
||||
&& h->root.type == bfd_link_hash_undefweak))))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
@ -1236,8 +1230,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
&& r_type != R_CRIS_16_PCREL
|
||||
&& r_type != R_CRIS_32_PCREL)
|
||||
|| (!info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
bfd_byte *loc;
|
||||
@ -1300,8 +1293,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
become local. */
|
||||
else if (h != NULL
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
BFD_ASSERT (h->dynindx != -1);
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
@ -1515,7 +1507,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -1529,8 +1521,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
Otherwise, the PLT entry would provide a definition for
|
||||
the symbol even if the symbol wasn't defined anywhere,
|
||||
and so the symbol would never be NULL. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
|
||||
== 0)
|
||||
if (!h->ref_regular_nonweak)
|
||||
sym->st_value = 0;
|
||||
}
|
||||
}
|
||||
@ -1544,7 +1535,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
&& (info->shared
|
||||
|| (h->dynindx != -1
|
||||
&& h->plt.offset == (bfd_vma) -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
&& !h->def_regular
|
||||
&& h->root.type != bfd_link_hash_undefweak)))
|
||||
{
|
||||
asection *sgot;
|
||||
@ -1572,7 +1563,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
if (! elf_hash_table (info)->dynamic_sections_created
|
||||
|| (info->shared
|
||||
&& (info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
&& h->def_regular))
|
||||
{
|
||||
rela.r_info = ELF32_R_INFO (0, R_CRIS_RELATIVE);
|
||||
rela.r_addend = bfd_get_signed_32 (output_bfd, where);
|
||||
@ -1589,7 +1580,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rela;
|
||||
@ -2032,20 +2023,17 @@ elf_cris_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
/* If we link a program (not a DSO), we'll get rid of unnecessary
|
||||
PLT entries; we point to the actual symbols -- even for pic
|
||||
@ -2054,15 +2042,15 @@ elf_cris_adjust_dynamic_symbol (info, h)
|
||||
symbols.
|
||||
FIXME: m68k and i386 differ here, for unclear reasons. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0)
|
||||
&& !h->def_dynamic)
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input file,
|
||||
but the symbol was not defined by a dynamic object. In such
|
||||
a case, we don't actually need to build a procedure linkage
|
||||
table, and we can just do an absolute or PC reloc instead, or
|
||||
change a .got.plt index to a .got index for GOTPLT relocs. */
|
||||
BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
BFD_ASSERT (h->needs_plt);
|
||||
h->needs_plt = 0;
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
return
|
||||
elf_cris_adjust_gotplt_to_got ((struct
|
||||
@ -2083,7 +2071,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
|
||||
/* GC or folding may have rendered this entry unused. */
|
||||
if (h->plt.refcount <= 0)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
return TRUE;
|
||||
}
|
||||
@ -2107,7 +2095,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
|
||||
not generating a shared library, then set the symbol to this
|
||||
location in the .plt. */
|
||||
if (!info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = s->size;
|
||||
@ -2195,7 +2183,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* We must allocate the symbol in our .dynbss section, which will
|
||||
@ -2222,7 +2210,7 @@ elf_cris_adjust_dynamic_symbol (info, h)
|
||||
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* Historic precedent: m68k and i386 allow max 8-byte alignment for the
|
||||
@ -2478,7 +2466,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
|
||||
if (h == NULL)
|
||||
continue;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount++;
|
||||
break;
|
||||
|
||||
@ -2510,7 +2498,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
|
||||
case R_CRIS_32_PCREL:
|
||||
if (h != NULL)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* Make sure a plt entry is created for this symbol if it
|
||||
turns out to be a function defined by a dynamic object. */
|
||||
@ -2558,7 +2546,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
|
||||
we can't identify at this time. */
|
||||
if (info->symbolic
|
||||
&& h->root.type != bfd_link_hash_defweak
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
|
||||
&& h->def_regular)
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2868,8 +2856,8 @@ elf_cris_discard_excess_dso_dynamics (h, inf)
|
||||
/* If a symbol has been forced local or we have found a regular
|
||||
definition for the symbolic link case, then we won't be needing
|
||||
any relocs. */
|
||||
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
&& ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
|
||||
if (h->root.def_regular
|
||||
&& (h->root.forced_local
|
||||
|| info->symbolic))
|
||||
{
|
||||
for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
|
||||
@ -2898,7 +2886,7 @@ elf_cris_discard_excess_program_dynamics (h, inf)
|
||||
(or rather, not defined by a DSO) then lose the reloc for the .got
|
||||
(don't allocate room for it). Likewise for relocs for something
|
||||
for which we create a PLT. */
|
||||
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
if (!h->root.def_dynamic
|
||||
|| h->root.plt.refcount > 0)
|
||||
{
|
||||
if (h->root.got.refcount > 0
|
||||
@ -2925,8 +2913,8 @@ elf_cris_discard_excess_program_dynamics (h, inf)
|
||||
introduce new problems. Of course we don't do this if we're
|
||||
exporting all dynamic symbols. */
|
||||
if (! info->export_dynamic
|
||||
&& (h->root.elf_link_hash_flags
|
||||
& (ELF_LINK_HASH_DEF_DYNAMIC|ELF_LINK_HASH_REF_DYNAMIC)) == 0)
|
||||
&& !h->root.def_dynamic
|
||||
&& !h->root.ref_dynamic)
|
||||
{
|
||||
h->root.dynindx = -1;
|
||||
_bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
|
||||
|
@ -2755,7 +2755,7 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
|
||||
bed->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
/* Machine-specific: we want the symbol for executables as
|
||||
@ -2814,7 +2814,7 @@ _frv_create_got_section (bfd *abfd, struct bfd_link_info *info)
|
||||
bed->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
/* Machine-specific: we want the symbol for executables as well. */
|
||||
@ -2869,7 +2869,7 @@ elf32_frvfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
FALSE, get_elf_backend_data (abfd)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (! info->executable
|
||||
@ -3677,7 +3677,7 @@ elf32_frvfdpic_always_size_sections (bfd *output_bfd,
|
||||
FALSE, FALSE, FALSE);
|
||||
if (! h || h->root.type != bfd_link_hash_defined
|
||||
|| h->type != STT_OBJECT
|
||||
|| !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
|| !h->def_regular)
|
||||
{
|
||||
struct bfd_link_hash_entry *bh = NULL;
|
||||
|
||||
@ -3689,7 +3689,7 @@ elf32_frvfdpic_always_size_sections (bfd *output_bfd,
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
}
|
||||
|
||||
@ -3866,12 +3866,9 @@ elf32_frvfdpic_adjust_dynamic_symbol
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& (h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a weak symbol, and there is a real definition, the
|
||||
processor independent code will have arranged for us to see the
|
||||
|
@ -570,7 +570,7 @@ hppa_type_of_stub (asection *input_sec,
|
||||
&& hash->elf.dynindx != -1
|
||||
&& !hash->plabel
|
||||
&& (info->shared
|
||||
|| !(hash->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
|| !hash->elf.def_regular
|
||||
|| hash->elf.root.type == bfd_link_hash_defweak))
|
||||
{
|
||||
/* We need an import stub. Decide between hppa_stub_import
|
||||
@ -1019,15 +1019,16 @@ elf32_hppa_copy_indirect_symbol (const struct elf_backend_data *bed,
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS
|
||||
&& ind->root.type != bfd_link_hash_indirect
|
||||
&& (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->elf_link_hash_flags |=
|
||||
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT));
|
||||
&& dir->dynamic_adjusted)
|
||||
{
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
}
|
||||
else
|
||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||
}
|
||||
@ -1278,7 +1279,7 @@ elf32_hppa_check_relocs (bfd *abfd,
|
||||
{
|
||||
if (h != NULL)
|
||||
{
|
||||
h->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->elf.needs_plt = 1;
|
||||
h->elf.plt.refcount += 1;
|
||||
|
||||
/* If this .plt entry is for a plabel, mark it so
|
||||
@ -1319,7 +1320,7 @@ elf32_hppa_check_relocs (bfd *abfd,
|
||||
so that we generate copy relocs if it turns out to be
|
||||
dynamic. */
|
||||
if (h != NULL && !info->shared)
|
||||
h->elf.elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->elf.non_got_ref = 1;
|
||||
|
||||
/* If we are creating a shared library then we need to copy
|
||||
the reloc into the shared library. However, if we are
|
||||
@ -1355,15 +1356,13 @@ elf32_hppa_check_relocs (bfd *abfd,
|
||||
|| (h != NULL
|
||||
&& (!info->symbolic
|
||||
|| h->elf.root.type == bfd_link_hash_defweak
|
||||
|| (h->elf.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->elf.def_regular))))
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->elf.root.type == bfd_link_hash_defweak
|
||||
|| (h->elf.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->elf.def_regular)))
|
||||
{
|
||||
struct elf32_hppa_dyn_reloc_entry *p;
|
||||
struct elf32_hppa_dyn_reloc_entry **head;
|
||||
@ -1611,7 +1610,7 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
|
||||
{
|
||||
if (force_local)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
|
||||
h->forced_local = 1;
|
||||
if (h->dynindx != -1)
|
||||
{
|
||||
h->dynindx = -1;
|
||||
@ -1622,7 +1621,7 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
|
||||
|
||||
if (! ((struct elf32_hppa_link_hash_entry *) h)->plabel)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
h->plt = elf_hash_table (info)->init_refcount;
|
||||
}
|
||||
}
|
||||
@ -1644,10 +1643,10 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
|| (h->def_regular
|
||||
&& h->root.type != bfd_link_hash_defweak
|
||||
&& ! ((struct elf32_hppa_link_hash_entry *) h)->plabel
|
||||
&& (!info->shared || info->symbolic)))
|
||||
@ -1661,7 +1660,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
application or we are doing a shared symbolic link. */
|
||||
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1680,9 +1679,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (ELIMINATE_COPY_RELOCS)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1698,7 +1695,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS)
|
||||
@ -1718,7 +1715,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1741,7 +1738,7 @@ elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
htab->srelbss->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1794,7 +1791,7 @@ allocate_plt_static (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
|
||||
&& !h->forced_local
|
||||
&& h->type != STT_PARISC_MILLI)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
@ -1821,13 +1818,13 @@ allocate_plt_static (struct elf_link_hash_entry *h, void *inf)
|
||||
{
|
||||
/* No .plt entry needed. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1872,7 +1869,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
|
||||
&& !h->forced_local
|
||||
&& h->type != STT_PARISC_MILLI)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
@ -1885,7 +1882,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
if (htab->elf.dynamic_sections_created
|
||||
&& (info->shared
|
||||
|| (h->dynindx != -1
|
||||
&& h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0))
|
||||
&& !h->forced_local)))
|
||||
{
|
||||
htab->srelgot->size += sizeof (Elf32_External_Rela);
|
||||
}
|
||||
@ -1932,10 +1929,10 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* For the non-shared case, discard space for relocs against
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
if (!h->non_got_ref
|
||||
&& ((ELIMINATE_COPY_RELOCS
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->elf.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -1943,7 +1940,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
|
||||
&& !h->forced_local
|
||||
&& h->type != STT_PARISC_MILLI)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
@ -1987,7 +1984,7 @@ clobber_millicode_symbols (struct elf_link_hash_entry *h,
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
if (h->type == STT_PARISC_MILLI
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
elf32_hppa_hide_symbol (info, h, TRUE);
|
||||
}
|
||||
@ -2546,8 +2543,8 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info)
|
||||
&& (hash->elf.root.u.def.section->output_section->owner
|
||||
== output_bfd)
|
||||
&& hash->elf.root.u.def.section->owner == input_bfd
|
||||
&& (hash->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
&& !(hash->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
&& hash->elf.def_regular
|
||||
&& !hash->elf.forced_local
|
||||
&& ELF_ST_VISIBILITY (hash->elf.other) == STV_DEFAULT)
|
||||
{
|
||||
asection *sec;
|
||||
@ -3104,7 +3101,7 @@ final_link_relocate (asection *input_section,
|
||||
&& h->elf.dynindx != -1
|
||||
&& !h->plabel
|
||||
&& (info->shared
|
||||
|| !(h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
|| !h->elf.def_regular
|
||||
|| h->elf.root.type == bfd_link_hash_defweak)))
|
||||
{
|
||||
stub_entry = hppa_get_stub_entry (input_section, sym_sec,
|
||||
@ -3690,12 +3687,10 @@ elf32_hppa_relocate_section (bfd *output_bfd,
|
||||
|| (!info->shared
|
||||
&& h != NULL
|
||||
&& h->elf.dynindx != -1
|
||||
&& (h->elf.elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& !h->elf.non_got_ref
|
||||
&& ((ELIMINATE_COPY_RELOCS
|
||||
&& (h->elf.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& h->elf.def_dynamic
|
||||
&& !h->elf.def_regular)
|
||||
|| h->elf.root.type == bfd_link_hash_undefweak
|
||||
|| h->elf.root.type == bfd_link_hash_undefined)))
|
||||
{
|
||||
@ -3727,8 +3722,7 @@ elf32_hppa_relocate_section (bfd *output_bfd,
|
||||
|| !IS_ABSOLUTE_RELOC (r_type)
|
||||
|| !info->shared
|
||||
|| !info->symbolic
|
||||
|| (h->elf.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->elf.def_regular))
|
||||
{
|
||||
outrel.r_info = ELF32_R_INFO (h->elf.dynindx, r_type);
|
||||
}
|
||||
@ -3894,7 +3888,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
|
||||
loc += htab->srelplt->reloc_count++ * sizeof (Elf32_External_Rela);
|
||||
bfd_elf32_swap_reloca_out (htab->splt->output_section->owner, &rel, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -3918,7 +3912,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
|
||||
relocate_section function. */
|
||||
if (info->shared
|
||||
&& (info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& h->def_regular)
|
||||
{
|
||||
rel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32);
|
||||
rel.r_addend = (h->root.u.def.value
|
||||
@ -3939,7 +3933,7 @@ elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
|
||||
|
@ -500,14 +500,11 @@ i370_elf_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
s = bfd_get_section_by_name (dynobj, ".rela.text");
|
||||
BFD_ASSERT (s != NULL);
|
||||
@ -569,7 +566,7 @@ i370_elf_adjust_dynamic_symbol (info, h)
|
||||
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1218,8 +1215,7 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
sec = h->root.u.def.section;
|
||||
if (info->shared
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
|| !h->def_regular)
|
||||
&& (input_section->flags & SEC_ALLOC) != 0
|
||||
&& (r_type == R_I370_ADDR31
|
||||
|| r_type == R_I370_COPY
|
||||
@ -1338,8 +1334,7 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
become local. */
|
||||
else if (h != NULL
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
BFD_ASSERT (h->dynindx != -1);
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
|
@ -784,16 +784,17 @@ elf_i386_copy_indirect_symbol (const struct elf_backend_data *bed,
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS
|
||||
&& ind->root.type != bfd_link_hash_indirect
|
||||
&& (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->elf_link_hash_flags |=
|
||||
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT
|
||||
| ELF_LINK_POINTER_EQUALITY_NEEDED));
|
||||
&& dir->dynamic_adjusted)
|
||||
{
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
dir->pointer_equality_needed |= ind->pointer_equality_needed;
|
||||
}
|
||||
else
|
||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||
}
|
||||
@ -893,7 +894,7 @@ elf_i386_check_relocs (bfd *abfd,
|
||||
if (h == NULL)
|
||||
continue;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
break;
|
||||
|
||||
@ -1018,13 +1019,13 @@ elf_i386_check_relocs (bfd *abfd,
|
||||
sections have not yet been mapped to output sections.
|
||||
Tentatively set the flag for now, and correct in
|
||||
adjust_dynamic_symbol. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* We may need a .plt entry if the function this reloc
|
||||
refers to is in a shared lib. */
|
||||
h->plt.refcount += 1;
|
||||
if (r_type != R_386_PC32)
|
||||
h->elf_link_hash_flags |= ELF_LINK_POINTER_EQUALITY_NEEDED;
|
||||
h->pointer_equality_needed = 1;
|
||||
}
|
||||
|
||||
/* If we are creating a shared library, and this is a reloc
|
||||
@ -1054,15 +1055,13 @@ elf_i386_check_relocs (bfd *abfd,
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct elf_i386_dyn_relocs *p;
|
||||
struct elf_i386_dyn_relocs **head;
|
||||
@ -1326,7 +1325,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| SYMBOL_CALLS_LOCAL (info, h)
|
||||
@ -1339,7 +1338,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
such a case, we don't actually need to build a procedure
|
||||
linkage table, and we can just do a PC32 reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1362,9 +1361,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1380,13 +1377,13 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* If -z nocopyreloc was given, we won't generate them either. */
|
||||
if (info->nocopyreloc)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1407,7 +1404,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1430,7 +1427,7 @@ elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
htab->srelbss->size += sizeof (Elf32_External_Rel);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1487,7 +1484,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1511,7 +1508,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -1530,13 +1527,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
/* If R_386_TLS_{IE_32,IE,GOTIE} symbol is now local to the binary,
|
||||
@ -1555,7 +1552,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1634,9 +1631,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->elf.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -1644,7 +1641,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -2344,11 +2341,9 @@ elf_i386_relocate_section (bfd *output_bfd,
|
||||
&& !info->shared
|
||||
&& h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined)))
|
||||
{
|
||||
@ -2381,8 +2376,7 @@ elf_i386_relocate_section (bfd *output_bfd,
|
||||
&& (r_type == R_386_PC32
|
||||
|| !info->shared
|
||||
|| !info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
else
|
||||
{
|
||||
@ -2912,7 +2906,7 @@ elf_i386_relocate_section (bfd *output_bfd,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
@ -3045,7 +3039,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
|
||||
loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rel);
|
||||
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value if there were any
|
||||
@ -3056,7 +3050,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
|
||||
called from a binary, there is no need to slow down
|
||||
shared libraries because of that. */
|
||||
sym->st_shndx = SHN_UNDEF;
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_POINTER_EQUALITY_NEEDED) == 0)
|
||||
if (!h->pointer_equality_needed)
|
||||
sym->st_value = 0;
|
||||
}
|
||||
}
|
||||
@ -3102,7 +3096,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
Elf_Internal_Rela rel;
|
||||
bfd_byte *loc;
|
||||
|
@ -1783,7 +1783,7 @@ m32r_elf_create_dynamic_sections (abfd, info)
|
||||
get_elf_backend_data (abfd)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -1954,25 +1954,22 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic
|
||||
&& h->root.type != bfd_link_hash_undefweak
|
||||
&& h->root.type != bfd_link_hash_undefined)
|
||||
{
|
||||
@ -1982,7 +1979,7 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
|
||||
a procedure linkage table, and we can just do a PCREL
|
||||
reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -2014,13 +2011,13 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* If -z nocopyreloc was given, we won't generate them either. */
|
||||
if (info->nocopyreloc)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2037,7 +2034,7 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
|
||||
the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2066,7 +2063,7 @@ printf("m32r_elf_adjust_dynamic_symbol()\n");
|
||||
srel = htab->srelbss;
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -2120,7 +2117,7 @@ allocate_dynrelocs (h, inf)
|
||||
|
||||
eh = (struct elf_m32r_link_hash_entry *) h;
|
||||
// if ((h->got.refcount > 0
|
||||
// || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
// || h->forced_local)
|
||||
// && eh->gotplt_refcount > 0)
|
||||
// {
|
||||
// /* The symbol has been forced local, or we have some direct got refs,
|
||||
@ -2136,7 +2133,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -2159,7 +2156,7 @@ allocate_dynrelocs (h, inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -2178,13 +2175,13 @@ allocate_dynrelocs (h, inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
if (h->got.refcount > 0)
|
||||
@ -2195,7 +2192,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -2223,8 +2220,8 @@ allocate_dynrelocs (h, inf)
|
||||
|
||||
if (info->shared)
|
||||
{
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
|
||||
if (h->def_regular
|
||||
&& (h->forced_local
|
||||
|| info->symbolic))
|
||||
{
|
||||
struct elf_m32r_dyn_relocs **pp;
|
||||
@ -2245,9 +2242,9 @@ allocate_dynrelocs (h, inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->root.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -2255,7 +2252,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -2761,20 +2758,17 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
info->shared, h)
|
||||
&& (! info->shared
|
||||
|| (! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
|| (info->shared
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
|| !h->def_regular)
|
||||
&& (((r_type == R_M32R_16_RELA
|
||||
|| r_type == R_M32R_32_RELA
|
||||
|| r_type == R_M32R_24_RELA
|
||||
|| r_type == R_M32R_HI16_ULO_RELA
|
||||
|| r_type == R_M32R_HI16_SLO_RELA
|
||||
|| r_type == R_M32R_LO16_RELA)
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
|| r_type == R_M32R_10_PCREL_RELA
|
||||
|| r_type == R_M32R_18_PCREL_RELA
|
||||
|| r_type == R_M32R_26_PCREL_RELA)
|
||||
@ -2784,8 +2778,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
externally in shared libraries. We can't do
|
||||
anything with them here. */
|
||||
|| ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
|
||||
&& h->def_dynamic))))
|
||||
{
|
||||
/* In these cases, we don't need the relocation
|
||||
value. We check specially because in some
|
||||
@ -2909,8 +2902,8 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular))
|
||||
{
|
||||
/* This is actually a static link, or it is a
|
||||
-Bsymbolic link and the symbol is defined
|
||||
@ -3000,7 +2993,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
//if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
|
||||
// || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
|
||||
// break;
|
||||
if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
if (h->forced_local)
|
||||
break;
|
||||
|
||||
if (h->plt.offset == (bfd_vma) -1)
|
||||
@ -3039,8 +3032,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (! info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
bfd_boolean skip, relocate;
|
||||
@ -3099,8 +3091,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
become local. */
|
||||
if (h == NULL
|
||||
|| ((info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) != 0))
|
||||
&& h->def_regular))
|
||||
{
|
||||
relocate = TRUE;
|
||||
outrel.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
|
||||
@ -3400,7 +3391,7 @@ printf("m32r_elf_finish_dynamic_symbol()\n");
|
||||
loc += plt_index * sizeof(Elf32_External_Rela);
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -3433,8 +3424,8 @@ printf("m32r_elf_finish_dynamic_symbol()\n");
|
||||
if (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular)
|
||||
{
|
||||
rela.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
|
||||
rela.r_addend = (h->root.u.def.value
|
||||
@ -3455,7 +3446,7 @@ printf("m32r_elf_finish_dynamic_symbol()\n");
|
||||
++srela->reloc_count;
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rela;
|
||||
@ -4564,10 +4555,10 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
|
||||
if (h == NULL)
|
||||
continue;
|
||||
|
||||
if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
if (h->forced_local)
|
||||
break;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
break;
|
||||
|
||||
@ -4583,7 +4574,7 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
|
||||
|
||||
if (h != NULL && !info->shared)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
h->plt.refcount += 1;
|
||||
}
|
||||
|
||||
@ -4613,14 +4604,12 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (!info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct elf_m32r_dyn_relocs *p;
|
||||
struct elf_m32r_dyn_relocs **head;
|
||||
|
@ -506,7 +506,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
|
||||
{
|
||||
/* Make sure this symbol is output as a dynamic symbol. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (!bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -564,7 +564,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
|
||||
if (h == NULL)
|
||||
continue;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount++;
|
||||
break;
|
||||
|
||||
@ -584,13 +584,13 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
|
||||
|
||||
/* Make sure this symbol is output as a dynamic symbol. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (!bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount++;
|
||||
break;
|
||||
|
||||
@ -612,8 +612,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
|
||||
&& h != NULL
|
||||
&& (!info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
if (h != NULL)
|
||||
{
|
||||
@ -925,24 +924,21 @@ elf_m68k_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic
|
||||
/* We must always create the plt entry if it was referenced
|
||||
by a PLTxxO relocation. In this case we already recorded
|
||||
it as a dynamic symbol. */
|
||||
@ -953,7 +949,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
|
||||
object. In such a case, we don't actually need to build
|
||||
a procedure linkage table, and we can just do a PCxx
|
||||
reloc instead. */
|
||||
BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
|
||||
BFD_ASSERT (h->needs_plt);
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
return TRUE;
|
||||
}
|
||||
@ -961,14 +957,14 @@ elf_m68k_adjust_dynamic_symbol (info, h)
|
||||
/* GC may have rendered this entry unused. */
|
||||
if (h->plt.refcount <= 0)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Make sure this symbol is output as a dynamic symbol. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -993,7 +989,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (!info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = s->size;
|
||||
@ -1071,7 +1067,7 @@ elf_m68k_adjust_dynamic_symbol (info, h)
|
||||
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1295,9 +1291,9 @@ elf_m68k_discard_copies (h, inf)
|
||||
if (h->root.type == bfd_link_hash_warning)
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
if (!h->def_regular
|
||||
|| (!info->symbolic
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0))
|
||||
&& !h->forced_local))
|
||||
{
|
||||
if ((info->flags & DF_TEXTREL) == 0)
|
||||
{
|
||||
@ -1442,8 +1438,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) != 0)
|
||||
|| h->forced_local)
|
||||
&& h->def_regular))
|
||||
{
|
||||
/* This is actually a static link, or it is a
|
||||
-Bsymbolic link and the symbol is defined
|
||||
@ -1579,7 +1575,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
case R_68K_PC32:
|
||||
if (h == NULL
|
||||
|| (info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
|
||||
&& h->forced_local))
|
||||
break;
|
||||
/* Fall through. */
|
||||
case R_68K_8:
|
||||
@ -1597,8 +1593,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (!info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
bfd_byte *loc;
|
||||
@ -1630,8 +1625,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| r_type == R_68K_PC32
|
||||
|| !info->shared
|
||||
|| !info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
outrel.r_addend = rel->r_addend;
|
||||
@ -1702,7 +1696,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
@ -1854,7 +1848,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
loc = srela->contents + plt_index * sizeof (Elf32_External_Rela);
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -1888,8 +1882,8 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
if (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular)
|
||||
{
|
||||
rela.r_info = ELF32_R_INFO (0, R_68K_RELATIVE);
|
||||
rela.r_addend = bfd_get_signed_32 (output_bfd,
|
||||
@ -1909,7 +1903,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rela;
|
||||
|
103
bfd/elf32-ppc.c
103
bfd/elf32-ppc.c
@ -329,15 +329,16 @@ ppc_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS
|
||||
&& ind->root.type != bfd_link_hash_indirect
|
||||
&& (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->elf_link_hash_flags |=
|
||||
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT));
|
||||
&& dir->dynamic_adjusted)
|
||||
{
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
}
|
||||
else
|
||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||
}
|
||||
@ -2526,7 +2527,7 @@ elf_finish_pointer_linker_section (bfd *output_bfd,
|
||||
if (! elf_hash_table (info)->dynamic_sections_created
|
||||
|| (info->shared
|
||||
&& info->symbolic
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
&& h->def_regular))
|
||||
{
|
||||
/* This is actually a static link, or it is a
|
||||
-Bsymbolic link and the symbol is defined
|
||||
@ -2872,18 +2873,15 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
/* Make sure we know what is going on here. */
|
||||
htab = ppc_elf_hash_table (info);
|
||||
BFD_ASSERT (htab->elf.dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* Deal with function syms. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
/* Clear procedure linkage table information for any symbol that
|
||||
won't need a .plt entry. */
|
||||
@ -2903,7 +2901,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
3. We know for certain that a call to this symbol
|
||||
will go to this object, or will remain undefined. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -2920,9 +2918,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (ELIMINATE_COPY_RELOCS)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2938,7 +2934,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS)
|
||||
@ -2955,7 +2951,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -2994,7 +2990,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
srel = htab->relbss;
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -3057,7 +3053,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
{
|
||||
/* Make sure this symbol is output as a dynamic symbol. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -3087,7 +3083,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
function pointers compare as equal between the normal
|
||||
executable and the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -3106,13 +3102,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
eh = (struct ppc_elf_link_hash_entry *) h;
|
||||
@ -3120,14 +3116,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
{
|
||||
/* Make sure this symbol is output as a dynamic symbol. */
|
||||
if (eh->elf.dynindx == -1
|
||||
&& (eh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !eh->elf.forced_local)
|
||||
{
|
||||
if (!bfd_elf_link_record_dynamic_symbol (info, &eh->elf))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (eh->tls_mask == (TLS_TLS | TLS_LD)
|
||||
&& !(eh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
|
||||
&& !eh->elf.def_dynamic)
|
||||
/* If just an LD reloc, we'll just use htab->tlsld_got.offset. */
|
||||
eh->elf.got.offset = (bfd_vma) -1;
|
||||
else
|
||||
@ -3210,7 +3206,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
&& eh->dyn_relocs != NULL
|
||||
&& h->dynindx == -1
|
||||
&& h->root.type == bfd_link_hash_undefweak
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -3222,14 +3218,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
{
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -3774,7 +3770,7 @@ ppc_elf_check_relocs (bfd *abfd,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount++;
|
||||
break;
|
||||
|
||||
@ -3883,7 +3879,7 @@ ppc_elf_check_relocs (bfd *abfd,
|
||||
h->plt.refcount++;
|
||||
|
||||
/* We may need a copy reloc too. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
}
|
||||
|
||||
dodyn:
|
||||
@ -3913,15 +3909,13 @@ ppc_elf_check_relocs (bfd *abfd,
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct ppc_elf_dyn_relocs *p;
|
||||
struct ppc_elf_dyn_relocs **head;
|
||||
@ -4250,7 +4244,7 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
|
||||
|
||||
is_local = FALSE;
|
||||
if (h == NULL
|
||||
|| !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
|
||||
|| !h->def_dynamic)
|
||||
is_local = TRUE;
|
||||
|
||||
r_type = ELF32_R_TYPE (rel->r_info);
|
||||
@ -4478,7 +4472,7 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
+ reloc_index * sizeof (Elf32_External_Rela));
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -4487,13 +4481,12 @@ ppc_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
Otherwise, the PLT entry would provide a definition for
|
||||
the symbol even if the symbol wasn't defined anywhere,
|
||||
and so the symbol would never be NULL. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
|
||||
== 0)
|
||||
if (!h->ref_regular_nonweak)
|
||||
sym->st_value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rela;
|
||||
@ -5032,7 +5025,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
||||
indx = 0;
|
||||
if (tls_type == (TLS_TLS | TLS_LD)
|
||||
&& (h == NULL
|
||||
|| !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
|
||||
|| !h->def_dynamic))
|
||||
offp = &htab->tlsld_got.offset;
|
||||
else if (h != NULL)
|
||||
{
|
||||
@ -5075,8 +5068,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
||||
if (offp == &htab->tlsld_got.offset)
|
||||
tls_m = TLS_LD;
|
||||
else if (h == NULL
|
||||
|| !(h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC))
|
||||
|| !h->def_dynamic)
|
||||
tls_m &= ~TLS_LD;
|
||||
|
||||
/* We might have multiple got entries for this sym.
|
||||
@ -5195,8 +5187,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
||||
{
|
||||
if ((tls_mask & TLS_LD) != 0
|
||||
&& !(h == NULL
|
||||
|| !(h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC)))
|
||||
|| !h->def_dynamic))
|
||||
off += 8;
|
||||
if (tls_type != (TLS_TLS | TLS_GD))
|
||||
{
|
||||
@ -5321,9 +5312,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
||||
&& (input_section->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
&& !h->non_got_ref
|
||||
&& h->def_dynamic
|
||||
&& !h->def_regular))
|
||||
{
|
||||
int skip;
|
||||
|
||||
@ -5722,7 +5713,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
|
||||
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
|
||||
|
@ -899,15 +899,16 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS
|
||||
&& ind->root.type != bfd_link_hash_indirect
|
||||
&& (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->elf_link_hash_flags |=
|
||||
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT));
|
||||
&& dir->dynamic_adjusted)
|
||||
{
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
}
|
||||
else
|
||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||
}
|
||||
@ -1068,7 +1069,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
creating a procedure linkage table entry. */
|
||||
if (h != NULL)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
}
|
||||
break;
|
||||
@ -1089,7 +1090,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
if (h != NULL)
|
||||
{
|
||||
((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
}
|
||||
else
|
||||
@ -1198,7 +1199,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
sections have not yet been mapped to output sections.
|
||||
Tentatively set the flag for now, and correct in
|
||||
adjust_dynamic_symbol. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* We may need a .plt entry if the function this reloc
|
||||
refers to is in a shared lib. */
|
||||
@ -1235,15 +1236,13 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct elf_s390_dyn_relocs *p;
|
||||
struct elf_s390_dyn_relocs **head;
|
||||
@ -1580,12 +1579,12 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
will fill in the contents of the procedure linkage table later
|
||||
(although we could actually do it here). */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic
|
||||
&& h->root.type != bfd_link_hash_undefweak
|
||||
&& h->root.type != bfd_link_hash_undefined))
|
||||
{
|
||||
@ -1595,7 +1594,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
such a case, we don't actually need to build a procedure
|
||||
linkage table, and we can just do a PC32 reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
|
||||
}
|
||||
|
||||
@ -1619,9 +1618,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1637,13 +1634,13 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* If -z nocopyreloc was given, we won't generate them either. */
|
||||
if (info->nocopyreloc)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1664,7 +1661,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1687,7 +1684,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
htab->srelbss->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1748,7 +1745,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1772,7 +1769,7 @@ allocate_dynrelocs (h, inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -1791,14 +1788,14 @@ allocate_dynrelocs (h, inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
|
||||
}
|
||||
|
||||
@ -1831,7 +1828,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1899,9 +1896,9 @@ allocate_dynrelocs (h, inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->elf.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -1909,7 +1906,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -2372,8 +2369,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular)
|
||||
|| (ELF_ST_VISIBILITY (h->other)
|
||||
&& h->root.type == bfd_link_hash_undefweak))
|
||||
{
|
||||
@ -2553,11 +2550,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
&& !info->shared
|
||||
&& h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined)))
|
||||
{
|
||||
@ -2593,8 +2588,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| r_type == R_390_PC32
|
||||
|| !info->shared
|
||||
|| !info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
outrel.r_addend = rel->r_addend;
|
||||
@ -2990,7 +2984,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
input_bfd,
|
||||
@ -3194,7 +3188,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rela);
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. This is a clue
|
||||
@ -3231,8 +3225,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
if (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular)
|
||||
{
|
||||
BFD_ASSERT((h->got.offset & 1) != 0);
|
||||
rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
|
||||
@ -3253,7 +3247,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
Elf_Internal_Rela rela;
|
||||
bfd_byte *loc;
|
||||
|
@ -505,7 +505,7 @@ sh_symbian_relocate_section (bfd * output_bfd,
|
||||
|
||||
/* Allow the symbol to become local if necessary. */
|
||||
if (new_hash->dynindx == -1)
|
||||
new_hash->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
new_hash->def_regular = 1;
|
||||
|
||||
if (DEBUG)
|
||||
fprintf (stderr, "Created new symbol %s\n", ptr->new_name);
|
||||
|
116
bfd/elf32-sh.c
116
bfd/elf32-sh.c
@ -3910,7 +3910,7 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -4017,20 +4017,17 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (htab->root.dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| SYMBOL_CALLS_LOCAL (info, h)
|
||||
@ -4043,7 +4040,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
a procedure linkage table, and we can just do a REL32
|
||||
reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -4061,9 +4058,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (info->nocopyreloc)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -4079,13 +4074,13 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* If -z nocopyreloc was given, we won't generate them either. */
|
||||
if (info->nocopyreloc)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -4102,7 +4097,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -4130,7 +4125,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
srel = htab->srelbss;
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -4182,7 +4177,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
|
||||
eh = (struct elf_sh_link_hash_entry *) h;
|
||||
if ((h->got.refcount > 0
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
|| h->forced_local)
|
||||
&& eh->gotplt_refcount > 0)
|
||||
{
|
||||
/* The symbol has been forced local, or we have some direct got refs,
|
||||
@ -4200,7 +4195,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -4224,7 +4219,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -4243,13 +4238,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
if (h->got.refcount > 0)
|
||||
@ -4261,7 +4256,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -4299,7 +4294,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -4354,9 +4349,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->root.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -4364,7 +4359,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -4862,8 +4857,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
&& WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
|
||||
&& (! info->shared
|
||||
|| (! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
/* The cases above are those in which relocation is
|
||||
overwritten in the switch block below. The cases
|
||||
below are those in which we must defer relocation
|
||||
@ -4871,11 +4865,9 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
addresses when creating a shared library. */
|
||||
|| (info->shared
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
|| !h->def_regular)
|
||||
&& ((r_type == R_SH_DIR32
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
|| r_type == R_SH_REL32)
|
||||
&& ((input_section->flags & SEC_ALLOC) != 0
|
||||
/* DWARF will emit R_SH_DIR32 relocations in its
|
||||
@ -4883,15 +4875,13 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
in shared libraries. We can't do anything
|
||||
with them here. */
|
||||
|| ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
|
||||
&& h->def_dynamic)))
|
||||
/* Dynamic relocs are not propagated for SEC_DEBUGGING
|
||||
sections because such sections are not SEC_ALLOC and
|
||||
thus ld.so will not process them. */
|
||||
|| (sec->output_section == NULL
|
||||
&& ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
|| (sec->output_section == NULL
|
||||
&& (sh_elf_hash_entry (h)->tls_type == GOT_TLS_IE
|
||||
|| sh_elf_hash_entry (h)->tls_type == GOT_TLS_GD)))
|
||||
@ -5138,8 +5128,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
become local. */
|
||||
if (h == NULL
|
||||
|| ((info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) != 0))
|
||||
&& h->def_regular))
|
||||
{
|
||||
relocate = TRUE;
|
||||
outrel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE);
|
||||
@ -5183,7 +5172,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
procedure linkage table. */
|
||||
|
||||
if (h == NULL
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
|| h->forced_local
|
||||
|| ! info->shared
|
||||
|| info->symbolic
|
||||
|| h->dynindx == -1
|
||||
@ -5411,7 +5400,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
if (h == NULL)
|
||||
goto final_link_relocate;
|
||||
|
||||
if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
if (h->forced_local)
|
||||
goto final_link_relocate;
|
||||
|
||||
if (h->plt.offset == (bfd_vma) -1)
|
||||
@ -5464,7 +5453,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
tls_type = sh_elf_hash_entry (h)->tls_type;
|
||||
if (! info->shared
|
||||
&& (h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
|| h->def_regular))
|
||||
r_type = R_SH_TLS_LE_32;
|
||||
}
|
||||
|
||||
@ -6307,15 +6296,16 @@ sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
|
||||
}
|
||||
|
||||
if (ind->root.type != bfd_link_hash_indirect
|
||||
&& (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->elf_link_hash_flags |=
|
||||
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT));
|
||||
&& dir->dynamic_adjusted)
|
||||
{
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
}
|
||||
else
|
||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||
}
|
||||
@ -6411,7 +6401,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
&& h->root.type != bfd_link_hash_undefined
|
||||
&& h->root.type != bfd_link_hash_undefweak
|
||||
&& (h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
|| h->def_regular))
|
||||
r_type = R_SH_TLS_LE_32;
|
||||
|
||||
/* Some relocs require a global offset table. */
|
||||
@ -6608,13 +6598,13 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
creating a procedure linkage table entry. */
|
||||
|
||||
if (h == NULL
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
|| h->forced_local
|
||||
|| ! info->shared
|
||||
|| info->symbolic
|
||||
|| h->dynindx == -1)
|
||||
goto force_got;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
((struct elf_sh_link_hash_entry *) h)->gotplt_refcount += 1;
|
||||
|
||||
@ -6639,10 +6629,10 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
if (h == NULL)
|
||||
continue;
|
||||
|
||||
if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
if (h->forced_local)
|
||||
break;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
break;
|
||||
|
||||
@ -6656,7 +6646,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
#endif
|
||||
if (h != NULL && ! info->shared)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
h->plt.refcount += 1;
|
||||
}
|
||||
|
||||
@ -6685,14 +6675,12 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (! info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct elf_sh_dyn_relocs *p;
|
||||
struct elf_sh_dyn_relocs **head;
|
||||
@ -7081,7 +7069,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
|
||||
loc = srel->contents + plt_index * sizeof (Elf32_External_Rela);
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -7185,7 +7173,7 @@ sh_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info,
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rel;
|
||||
|
@ -425,7 +425,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
|
||||
}
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
|
||||
h->non_elf = 0;
|
||||
h->type = STT_DATALABEL;
|
||||
}
|
||||
else
|
||||
|
@ -1098,7 +1098,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
||||
break;
|
||||
}
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
|
||||
if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32)
|
||||
goto r_sparc_plt32;
|
||||
@ -1108,7 +1108,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
||||
case R_SPARC_PC10:
|
||||
case R_SPARC_PC22:
|
||||
if (h != NULL)
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
if (h != NULL
|
||||
&& strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
|
||||
@ -1132,7 +1132,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
||||
case R_SPARC_UA16:
|
||||
case R_SPARC_UA32:
|
||||
if (h != NULL)
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
r_sparc_plt32:
|
||||
if (h != NULL && !info->shared)
|
||||
@ -1169,14 +1169,12 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs)
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (!info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct elf32_sparc_dyn_relocs *p;
|
||||
struct elf32_sparc_dyn_relocs **head;
|
||||
@ -1457,14 +1455,11 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (htab->elf.dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later
|
||||
@ -1474,7 +1469,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
||||
some of their functions as STT_NOTYPE when they really should be
|
||||
STT_FUNC. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
|
||||
|| h->needs_plt
|
||||
|| (h->type == STT_NOTYPE
|
||||
&& (h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
@ -1482,8 +1477,8 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic
|
||||
&& h->root.type != bfd_link_hash_undefweak
|
||||
&& h->root.type != bfd_link_hash_undefined))
|
||||
{
|
||||
@ -1493,7 +1488,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
||||
such a case, we don't actually need to build a procedure
|
||||
linkage table, and we can just do a WDISP30 reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1525,7 +1520,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
eh = (struct elf32_sparc_link_hash_entry *) h;
|
||||
@ -1540,7 +1535,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1561,7 +1556,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h)
|
||||
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
htab->srelbss->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1620,7 +1615,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1649,7 +1644,7 @@ allocate_dynrelocs (h, inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -1664,13 +1659,13 @@ allocate_dynrelocs (h, inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
/* If R_SPARC_TLS_IE_{HI22,LO10} symbol is now local to the binary,
|
||||
@ -1689,7 +1684,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1728,8 +1723,8 @@ allocate_dynrelocs (h, inf)
|
||||
|
||||
if (info->shared)
|
||||
{
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
|
||||
if (h->def_regular
|
||||
&& (h->forced_local
|
||||
|| info->symbolic))
|
||||
{
|
||||
struct elf32_sparc_dyn_relocs **pp;
|
||||
@ -1751,9 +1746,9 @@ allocate_dynrelocs (h, inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->elf.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -1761,7 +1756,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -2229,8 +2224,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular))
|
||||
{
|
||||
/* This is actually a static link, or it is a
|
||||
-Bsymbolic link and the symbol is defined
|
||||
@ -2378,16 +2373,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (! info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (!info->shared
|
||||
&& h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined)))
|
||||
{
|
||||
@ -2452,8 +2444,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
become local. */
|
||||
else if (h != NULL && ! is_plt
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
BFD_ASSERT (h->dynindx != -1);
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
@ -2849,7 +2840,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
input_bfd,
|
||||
@ -3100,7 +3091,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
loc += (h->plt.offset / PLT_ENTRY_SIZE - 4) * sizeof (Elf32_External_Rela);
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -3109,8 +3100,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
Otherwise, the PLT entry would provide a definition for
|
||||
the symbol even if the symbol wasn't defined anywhere,
|
||||
and so the symbol would never be NULL. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
|
||||
== 0)
|
||||
if (!h->ref_regular_nonweak)
|
||||
sym->st_value = 0;
|
||||
}
|
||||
}
|
||||
@ -3142,7 +3132,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
initialized in the relocate_section function. */
|
||||
if (info->shared
|
||||
&& (info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& h->def_regular)
|
||||
{
|
||||
asection *sec = h->root.u.def.section;
|
||||
rela.r_info = ELF32_R_INFO (0, R_SPARC_RELATIVE);
|
||||
@ -3163,7 +3153,7 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rela;
|
||||
|
@ -682,7 +682,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
|
||||
if (h == NULL)
|
||||
continue;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
if (h->plt.refcount == -1)
|
||||
h->plt.refcount = 1;
|
||||
else
|
||||
@ -706,8 +706,7 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (!info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
if (h != NULL)
|
||||
{
|
||||
@ -962,24 +961,21 @@ elf_vax_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic
|
||||
/* We must always create the plt entry if it was referenced
|
||||
by a PLTxxO relocation. In this case we already recorded
|
||||
it as a dynamic symbol. */
|
||||
@ -990,7 +986,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
|
||||
object. In such a case, we don't actually need to build
|
||||
a procedure linkage table, and we can just do a PCxx
|
||||
reloc instead. */
|
||||
BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
|
||||
BFD_ASSERT (h->needs_plt);
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
return TRUE;
|
||||
}
|
||||
@ -998,7 +994,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
|
||||
/* GC may have rendered this entry unused. */
|
||||
if (h->plt.refcount <= 0)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
return TRUE;
|
||||
}
|
||||
@ -1026,7 +1022,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (!info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = s->size;
|
||||
@ -1103,7 +1099,7 @@ elf_vax_adjust_dynamic_symbol (info, h)
|
||||
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf32_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1349,7 +1345,7 @@ elf_vax_discard_copies (h, ignore)
|
||||
h = (struct elf_vax_link_hash_entry *) h->root.root.u.i.link;
|
||||
|
||||
/* We only discard relocs for symbols defined in a regular object. */
|
||||
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->root.def_regular)
|
||||
return TRUE;
|
||||
|
||||
for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
|
||||
@ -1504,12 +1500,10 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
&& elf_hash_table (info)->dynamic_sections_created
|
||||
&& (! info->shared
|
||||
|| (! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
|| (info->shared
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
|| !h->def_regular)
|
||||
&& ((input_section->flags & SEC_ALLOC) != 0
|
||||
/* DWARF will emit R_VAX_32 relocations in its
|
||||
sections against symbols defined externally
|
||||
@ -1517,8 +1511,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
with them here. */
|
||||
|
||||
|| ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
&& (r_type == R_VAX_8
|
||||
|| r_type == R_VAX_16
|
||||
|| r_type == R_VAX_32
|
||||
@ -1558,7 +1551,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|
||||
if (info->shared
|
||||
&& h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& h->def_regular)
|
||||
{
|
||||
/* The symbol was forced to be local
|
||||
because of a version file.. We must initialize
|
||||
@ -1665,8 +1658,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
&& r_type != R_VAX_PC16
|
||||
&& r_type != R_VAX_PC32)
|
||||
|| (!info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
bfd_byte *loc;
|
||||
@ -1714,8 +1706,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
become local. */
|
||||
else if (h != NULL
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
BFD_ASSERT (h->dynindx != -1);
|
||||
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
|
||||
@ -1923,7 +1914,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
loc = srela->contents + plt_index * sizeof (Elf32_External_Rela);
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -1954,7 +1945,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
the relocate_section function. */
|
||||
if (info->shared
|
||||
&& h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& h->def_regular)
|
||||
{
|
||||
rela.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE);
|
||||
}
|
||||
@ -1971,7 +1962,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rela;
|
||||
|
@ -681,7 +681,7 @@ elf_xtensa_check_relocs (abfd, info, sec, relocs)
|
||||
{
|
||||
if (h->plt.refcount <= 0)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount = 1;
|
||||
}
|
||||
else
|
||||
@ -2100,7 +2100,7 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
input_bfd,
|
||||
@ -2160,8 +2160,8 @@ elf_xtensa_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
struct elf_link_hash_entry *h;
|
||||
Elf_Internal_Sym *sym;
|
||||
{
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (h->needs_plt
|
||||
&& !h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
|
@ -2111,7 +2111,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
|
||||
|
||||
/* If the symbol isn't defined in the current module, again
|
||||
we can't do anything. */
|
||||
if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
if (!h->root.def_regular)
|
||||
{
|
||||
/* Except for TLSGD relocs, which can sometimes be
|
||||
relaxed to GOTTPREL relocs. */
|
||||
@ -2450,7 +2450,7 @@ elf64_alpha_create_dynamic_sections (abfd, info)
|
||||
get_elf_backend_data (abfd)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -2494,7 +2494,7 @@ elf64_alpha_create_dynamic_sections (abfd, info)
|
||||
FALSE, get_elf_backend_data (abfd)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -2741,10 +2741,9 @@ elf64_alpha_output_extsym (h, data)
|
||||
|
||||
if (h->root.indx == -2)
|
||||
strip = FALSE;
|
||||
else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
|| (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
|
||||
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
|
||||
else if ((h->root.def_dynamic || h->root.ref_dynamic)
|
||||
&& !h->root.def_regular
|
||||
&& !h->root.ref_regular)
|
||||
strip = TRUE;
|
||||
else if (einfo->info->strip == strip_all
|
||||
|| (einfo->info->strip == strip_some
|
||||
@ -2831,7 +2830,7 @@ elf64_alpha_output_extsym (h, data)
|
||||
else
|
||||
h->esym.asym.value = 0;
|
||||
}
|
||||
else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
else if (h->root.needs_plt)
|
||||
{
|
||||
/* Set type and value for a symbol with a function stub. */
|
||||
h->esym.asym.st = stProc;
|
||||
@ -2998,7 +2997,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
|
||||
|| h->root.root.type == bfd_link_hash_warning)
|
||||
h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
|
||||
|
||||
h->root.elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
|
||||
h->root.ref_regular = 1;
|
||||
}
|
||||
|
||||
/* We can only get preliminary data on whether a symbol is
|
||||
@ -3008,7 +3007,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
|
||||
maybe_dynamic = FALSE;
|
||||
if (h && ((info->shared
|
||||
&& (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
|
||||
|| ! (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
|| !h->root.def_regular
|
||||
|| h->root.root.type == bfd_link_hash_defweak))
|
||||
maybe_dynamic = TRUE;
|
||||
|
||||
@ -3114,9 +3113,9 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
|
||||
/* Make a guess as to whether a .plt entry is needed. */
|
||||
if ((gotent_flags & ALPHA_ELF_LINK_HASH_LU_FUNC)
|
||||
&& !(gotent_flags & ~ALPHA_ELF_LINK_HASH_LU_FUNC))
|
||||
h->root.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->root.needs_plt = 1;
|
||||
else
|
||||
h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->root.needs_plt = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3240,7 +3239,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h)
|
||||
somewhere later. But for now don't bother. */
|
||||
&& ah->got_entries)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
|
||||
s = bfd_get_section_by_name(dynobj, ".plt");
|
||||
if (!s && !elf64_alpha_create_dynamic_sections (dynobj, info))
|
||||
@ -3275,7 +3274,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h)
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
|
||||
/* If this is a weak symbol, and there is a real definition, the
|
||||
processor independent code will have arranged for us to see the
|
||||
@ -3727,7 +3726,7 @@ elf64_alpha_size_plt_section_1 (h, data)
|
||||
struct alpha_elf_got_entry *gotent;
|
||||
|
||||
/* If we didn't need an entry before, we still don't. */
|
||||
if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT))
|
||||
if (!h->root.needs_plt)
|
||||
return TRUE;
|
||||
|
||||
/* There must still be a LITERAL got entry for the function. */
|
||||
@ -3747,7 +3746,7 @@ elf64_alpha_size_plt_section_1 (h, data)
|
||||
}
|
||||
else
|
||||
{
|
||||
h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->root.needs_plt = 0;
|
||||
h->root.plt.offset = -1;
|
||||
|
||||
/* Undo the definition frobbing begun in adjust_dynamic_symbol. */
|
||||
@ -3849,15 +3848,13 @@ elf64_alpha_calc_dynrel_sizes (h, info)
|
||||
set. This is done for dynamic symbols in
|
||||
elf_adjust_dynamic_symbol but this is not done for non-dynamic
|
||||
symbols, somehow. */
|
||||
if (((h->root.elf_link_hash_flags
|
||||
& (ELF_LINK_HASH_DEF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_DEF_DYNAMIC))
|
||||
== ELF_LINK_HASH_REF_REGULAR)
|
||||
if (!h->root.def_regular
|
||||
&& h->root.ref_regular
|
||||
&& !h->root.def_dynamic
|
||||
&& (h->root.root.type == bfd_link_hash_defined
|
||||
|| h->root.root.type == bfd_link_hash_defweak)
|
||||
&& !(h->root.root.u.def.section->owner->flags & DYNAMIC))
|
||||
h->root.elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->root.def_regular = 1;
|
||||
|
||||
/* If the symbol is dynamic, we'll need all the relocations in their
|
||||
natural form. If this is a shared object, and it has been forced
|
||||
@ -4897,7 +4894,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
loc = srel->contents + plt_index * sizeof (Elf64_External_Rela);
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
|
||||
|
||||
if (!(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in the
|
||||
.plt section. Leave the value alone. */
|
||||
|
@ -743,7 +743,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
|
||||
|| h->root.type == bfd_link_hash_warning)
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
|
||||
h->ref_regular = 1;
|
||||
}
|
||||
|
||||
/* We can only get preliminary data on whether a symbol is
|
||||
@ -752,8 +752,9 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
|
||||
this may help reduce memory usage and processing time later. */
|
||||
maybe_dynamic = FALSE;
|
||||
if (h && ((info->shared
|
||||
&& (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
|
||||
|| ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
&& (!info->symbolic
|
||||
|| info->unresolved_syms_in_shared_libs == RM_IGNORE))
|
||||
|| !h->def_regular
|
||||
|| h->root.type == bfd_link_hash_defweak))
|
||||
maybe_dynamic = TRUE;
|
||||
|
||||
@ -913,7 +914,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
|
||||
/* This could be a local function that had its address taken, in
|
||||
which case H will be NULL. */
|
||||
if (h)
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
}
|
||||
|
||||
/* Add a new dynamic relocation to the chain of dynamic
|
||||
@ -1014,7 +1015,7 @@ elf64_hppa_mark_exported_functions (h, data)
|
||||
dyn_h->want_opd = 1;
|
||||
/* Put a flag here for output_symbol_hook. */
|
||||
dyn_h->st_shndx = -1;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
125
bfd/elf64-ppc.c
125
bfd/elf64-ppc.c
@ -3766,7 +3766,6 @@ ppc64_elf_copy_indirect_symbol
|
||||
struct elf_link_hash_entry *ind)
|
||||
{
|
||||
struct ppc_link_hash_entry *edir, *eind;
|
||||
flagword mask;
|
||||
|
||||
edir = (struct ppc_link_hash_entry *) dir;
|
||||
eind = (struct ppc_link_hash_entry *) ind;
|
||||
@ -3810,18 +3809,18 @@ ppc64_elf_copy_indirect_symbol
|
||||
edir->is_func_descriptor |= eind->is_func_descriptor;
|
||||
edir->tls_mask |= eind->tls_mask;
|
||||
|
||||
mask = (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF
|
||||
| ELF_LINK_HASH_NEEDS_PLT);
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
of elf_adjust_dynamic_symbol, don't copy NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
if (ELIMINATE_COPY_RELOCS
|
||||
&& eind->elf.root.type != bfd_link_hash_indirect
|
||||
&& (edir->elf.elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
mask &= ~ELF_LINK_NON_GOT_REF;
|
||||
if (!(ELIMINATE_COPY_RELOCS
|
||||
&& eind->elf.root.type != bfd_link_hash_indirect
|
||||
&& edir->elf.dynamic_adjusted))
|
||||
edir->elf.non_got_ref |= eind->elf.non_got_ref;
|
||||
|
||||
edir->elf.elf_link_hash_flags |= eind->elf.elf_link_hash_flags & mask;
|
||||
edir->elf.ref_dynamic |= eind->elf.ref_dynamic;
|
||||
edir->elf.ref_regular |= eind->elf.ref_regular;
|
||||
edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
|
||||
edir->elf.needs_plt |= eind->elf.needs_plt;
|
||||
|
||||
/* If we were called to copy over info for a weak sym, that's all. */
|
||||
if (eind->elf.root.type != bfd_link_hash_indirect)
|
||||
@ -4155,7 +4154,7 @@ update_plt_info (bfd *abfd, struct ppc_link_hash_entry *eh, bfd_vma addend)
|
||||
eh->elf.plt.plist = ent;
|
||||
}
|
||||
ent->plt.refcount += 1;
|
||||
eh->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
eh->elf.needs_plt = 1;
|
||||
eh->is_func = 1;
|
||||
return TRUE;
|
||||
}
|
||||
@ -4551,7 +4550,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
case R_PPC64_TOC:
|
||||
if (h != NULL && !info->shared)
|
||||
/* We may need a copy reloc. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* Don't propagate .opd relocs. */
|
||||
if (NO_OPD_RELOCS && opd_sym_map != NULL)
|
||||
@ -4584,14 +4583,12 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !info->shared
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct ppc_dyn_relocs *p;
|
||||
struct ppc_dyn_relocs **head;
|
||||
@ -5080,13 +5077,13 @@ sfpr_define (struct bfd_link_info *info, const struct sfpr_def_parms *parm)
|
||||
sym[len + 1] = i % 10 + '0';
|
||||
h = elf_link_hash_lookup (&htab->elf, sym, FALSE, FALSE, TRUE);
|
||||
if (h != NULL
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.type = bfd_link_hash_defined;
|
||||
h->root.u.def.section = htab->sfpr;
|
||||
h->root.u.def.value = htab->sfpr->size;
|
||||
h->type = STT_FUNC;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
_bfd_elf_link_hash_hide_symbol (info, h, TRUE);
|
||||
writing = TRUE;
|
||||
if (htab->sfpr->contents == NULL)
|
||||
@ -5311,7 +5308,7 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
|
||||
&fh->elf.root.u.def.value) != (bfd_vma) -1)
|
||||
{
|
||||
fh->elf.root.type = fh->oh->elf.root.type;
|
||||
fh->elf.elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
|
||||
fh->elf.forced_local = 1;
|
||||
}
|
||||
|
||||
/* If this is a function code symbol, transfer dynamic linking
|
||||
@ -5362,27 +5359,26 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
|
||||
return FALSE;
|
||||
}
|
||||
fdh = (struct ppc_link_hash_entry *) bh;
|
||||
fdh->elf.elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
|
||||
fdh->elf.non_elf = 0;
|
||||
fdh->elf.size = 24;
|
||||
fdh->elf.type = STT_OBJECT;
|
||||
}
|
||||
|
||||
if (fdh != NULL
|
||||
&& (fdh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
|
||||
&& !fdh->elf.forced_local
|
||||
&& (info->shared
|
||||
|| (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
|| (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
|
||||
|| fdh->elf.def_dynamic
|
||||
|| fdh->elf.ref_dynamic
|
||||
|| (fdh->elf.root.type == bfd_link_hash_undefweak
|
||||
&& ELF_ST_VISIBILITY (fdh->elf.other) == STV_DEFAULT)))
|
||||
{
|
||||
if (fdh->elf.dynindx == -1)
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, &fdh->elf))
|
||||
return FALSE;
|
||||
fdh->elf.elf_link_hash_flags
|
||||
|= (fh->elf.elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_NON_GOT_REF));
|
||||
fdh->elf.ref_regular |= fh->elf.ref_regular;
|
||||
fdh->elf.ref_dynamic |= fh->elf.ref_dynamic;
|
||||
fdh->elf.ref_regular_nonweak |= fh->elf.ref_regular_nonweak;
|
||||
fdh->elf.non_got_ref |= fh->elf.non_got_ref;
|
||||
if (ELF_ST_VISIBILITY (fh->elf.other) == STV_DEFAULT)
|
||||
{
|
||||
struct plt_entry **ep = &fdh->elf.plt.plist;
|
||||
@ -5390,7 +5386,7 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
|
||||
ep = &(*ep)->next;
|
||||
*ep = fh->elf.plt.plist;
|
||||
fh->elf.plt.plist = NULL;
|
||||
fdh->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
fdh->elf.needs_plt = 1;
|
||||
}
|
||||
fdh->is_func_descriptor = 1;
|
||||
fdh->oh = fh;
|
||||
@ -5406,10 +5402,10 @@ func_desc_adjust (struct elf_link_hash_entry *h, void *inf)
|
||||
linker dragging in a definition from a static library. */
|
||||
force_local
|
||||
= (info->shared
|
||||
&& ((fh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
&& (!fh->elf.def_regular
|
||||
|| fdh == NULL
|
||||
|| (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
|| (fdh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0));
|
||||
|| !fdh->elf.def_regular
|
||||
|| fdh->elf.forced_local));
|
||||
_bfd_elf_link_hash_hide_symbol (info, &fh->elf, force_local);
|
||||
|
||||
return TRUE;
|
||||
@ -5479,7 +5475,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* Deal with function syms. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
/* Clear procedure linkage table information for any symbol that
|
||||
won't need a .plt entry. */
|
||||
@ -5493,7 +5489,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
&& h->root.type == bfd_link_hash_undefweak))
|
||||
{
|
||||
h->plt.plist = NULL;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -5509,9 +5505,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (ELIMINATE_COPY_RELOCS)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -5524,7 +5518,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS)
|
||||
@ -5544,7 +5538,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -5582,7 +5576,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
htab->relbss->size += sizeof (Elf64_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -5812,7 +5806,7 @@ get_tls_mask (char **tls_maskp, unsigned long *toc_symndx,
|
||||
if ((h == NULL
|
||||
|| ((h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
&& !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
|
||||
&& !h->def_dynamic))
|
||||
&& (next_r == -1 || next_r == -2))
|
||||
return 1 - next_r;
|
||||
return 1;
|
||||
@ -6404,7 +6398,7 @@ ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
|
||||
ok_tprel = FALSE;
|
||||
is_local = FALSE;
|
||||
if (h == NULL
|
||||
|| !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
|
||||
|| !h->def_dynamic)
|
||||
{
|
||||
is_local = TRUE;
|
||||
value += sym_sec->output_offset;
|
||||
@ -6683,13 +6677,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
if (!doneone)
|
||||
{
|
||||
h->plt.plist = NULL;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.plist = NULL;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
eh = (struct ppc_link_hash_entry *) h;
|
||||
@ -6727,14 +6721,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
Undefined weak syms won't yet be marked as dynamic,
|
||||
nor will all TLS symbols. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((gent->tls_type & TLS_LD) != 0
|
||||
&& !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))
|
||||
&& !h->def_dynamic)
|
||||
{
|
||||
gent->got.offset = ppc64_tlsld_got (gent->owner)->offset;
|
||||
continue;
|
||||
@ -6801,14 +6795,14 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
{
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -7537,10 +7531,11 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
|
||||
h->root.type = bfd_link_hash_defined;
|
||||
h->root.u.def.section = stub_entry->stub_sec;
|
||||
h->root.u.def.value = stub_entry->stub_offset;
|
||||
h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_DEF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_FORCED_LOCAL);
|
||||
h->ref_regular = 1;
|
||||
h->def_regular = 1;
|
||||
h->ref_regular_nonweak = 1;
|
||||
h->forced_local = 1;
|
||||
h->non_elf = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8403,10 +8398,11 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
|
||||
h->root.type = bfd_link_hash_defined;
|
||||
h->root.u.def.section = htab->glink;
|
||||
h->root.u.def.value = 0;
|
||||
h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_DEF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_FORCED_LOCAL);
|
||||
h->ref_regular = 1;
|
||||
h->def_regular = 1;
|
||||
h->ref_regular_nonweak = 1;
|
||||
h->forced_local = 1;
|
||||
h->non_elf = 0;
|
||||
}
|
||||
}
|
||||
p = htab->glink->contents;
|
||||
@ -9322,8 +9318,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|
||||
|
||||
if (tls_type == (TLS_TLS | TLS_LD)
|
||||
&& (h == NULL
|
||||
|| (h->elf.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) == 0))
|
||||
|| !h->elf.def_dynamic))
|
||||
offp = &ppc64_tlsld_got (input_bfd)->offset;
|
||||
else
|
||||
{
|
||||
@ -9642,9 +9637,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|
||||
&& !info->shared
|
||||
&& h != NULL
|
||||
&& h->elf.dynindx != -1
|
||||
&& !(h->elf.elf_link_hash_flags & ELF_LINK_NON_GOT_REF)
|
||||
&& (h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
|
||||
&& !(h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
&& !h->elf.non_got_ref
|
||||
&& h->elf.def_dynamic
|
||||
&& !h->elf.def_regular))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
bfd_boolean skip, relocate;
|
||||
@ -9897,7 +9892,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)))
|
||||
&& h->elf.def_dynamic))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
|
||||
@ -10035,7 +10030,7 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
Elf_Internal_Rela rela;
|
||||
bfd_byte *loc;
|
||||
|
@ -852,15 +852,16 @@ elf_s390_copy_indirect_symbol (bed, dir, ind)
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS
|
||||
&& ind->root.type != bfd_link_hash_indirect
|
||||
&& (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->elf_link_hash_flags |=
|
||||
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT));
|
||||
&& dir->dynamic_adjusted)
|
||||
{
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
}
|
||||
else
|
||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||
}
|
||||
@ -1028,7 +1029,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
creating a procedure linkage table entry. */
|
||||
if (h != NULL)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
}
|
||||
break;
|
||||
@ -1050,7 +1051,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
if (h != NULL)
|
||||
{
|
||||
((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
}
|
||||
else
|
||||
@ -1162,7 +1163,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
sections have not yet been mapped to output sections.
|
||||
Tentatively set the flag for now, and correct in
|
||||
adjust_dynamic_symbol. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* We may need a .plt entry if the function this reloc
|
||||
refers to is in a shared lib. */
|
||||
@ -1200,15 +1201,13 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct elf_s390_dyn_relocs *p;
|
||||
struct elf_s390_dyn_relocs **head;
|
||||
@ -1552,12 +1551,12 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
will fill in the contents of the procedure linkage table later
|
||||
(although we could actually do it here). */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic
|
||||
&& h->root.type != bfd_link_hash_undefweak
|
||||
&& h->root.type != bfd_link_hash_undefined))
|
||||
{
|
||||
@ -1567,7 +1566,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
such a case, we don't actually need to build a procedure
|
||||
linkage table, and we can just do a PC32 reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
|
||||
}
|
||||
|
||||
@ -1591,9 +1590,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1609,13 +1606,13 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* If -z nocopyreloc was given, we won't generate them either. */
|
||||
if (info->nocopyreloc)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1636,7 +1633,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1659,7 +1656,7 @@ elf_s390_adjust_dynamic_symbol (info, h)
|
||||
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
htab->srelbss->size += sizeof (Elf64_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1720,7 +1717,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1744,7 +1741,7 @@ allocate_dynrelocs (h, inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -1763,14 +1760,14 @@ allocate_dynrelocs (h, inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
|
||||
}
|
||||
|
||||
@ -1803,7 +1800,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1871,9 +1868,9 @@ allocate_dynrelocs (h, inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->elf.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -1881,7 +1878,7 @@ allocate_dynrelocs (h, inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -2345,8 +2342,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular)
|
||||
|| (ELF_ST_VISIBILITY (h->other)
|
||||
&& h->root.type == bfd_link_hash_undefweak))
|
||||
{
|
||||
@ -2532,11 +2529,9 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
&& !info->shared
|
||||
&& h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined)))
|
||||
{
|
||||
@ -2573,8 +2568,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| r_type == R_390_PC64
|
||||
|| !info->shared
|
||||
|| !info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
|
||||
outrel.r_addend = rel->r_addend;
|
||||
@ -2987,7 +2981,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
input_bfd,
|
||||
@ -3137,7 +3131,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela);
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. This is a clue
|
||||
@ -3173,8 +3167,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
if (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular)
|
||||
{
|
||||
BFD_ASSERT((h->got.offset & 1) != 0);
|
||||
rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE);
|
||||
@ -3195,7 +3189,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
Elf_Internal_Rela rela;
|
||||
bfd_byte *loc;
|
||||
|
@ -1653,8 +1653,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
&& elf_hash_table (info)->dynamic_sections_created
|
||||
&& (! info->shared
|
||||
|| (! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
/* The cases above are those in which relocation is
|
||||
overwritten in the switch block below. The cases
|
||||
below are those in which we must defer relocation
|
||||
@ -1662,8 +1661,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
addresses when creating a shared library. */
|
||||
|| (info->shared
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
|| !h->def_regular)
|
||||
&& ((r_type == R_SH_64
|
||||
&& !(ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_HIDDEN))
|
||||
@ -1679,8 +1677,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
thus ld.so will not process them. */
|
||||
|| (sec->output_section == NULL
|
||||
&& ((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
|
||||
&& h->def_dynamic)))
|
||||
relocation = 0;
|
||||
else if (sec->output_section == NULL)
|
||||
{
|
||||
@ -1747,8 +1744,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
|| (h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (! info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
{
|
||||
Elf_Internal_Rela outrel;
|
||||
bfd_byte *loc;
|
||||
@ -1807,8 +1803,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
become local. */
|
||||
if (h == NULL
|
||||
|| ((info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) != 0))
|
||||
&& h->def_regular))
|
||||
{
|
||||
relocate = TRUE;
|
||||
outrel.r_info = ELF64_R_INFO (0, R_SH_RELATIVE64);
|
||||
@ -1906,7 +1901,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
&& (info->symbolic || h->dynindx == -1
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
&& h->def_regular))
|
||||
{
|
||||
/* This is actually a static link, or it is a
|
||||
-Bsymbolic link and the symbol is defined
|
||||
@ -2720,7 +2715,7 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
|
||||
break;
|
||||
|
||||
@ -2744,14 +2739,14 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
|| ELF_ST_VISIBILITY (h->other) == STV_HIDDEN)
|
||||
break;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
|
||||
break;
|
||||
|
||||
case R_SH_64:
|
||||
case R_SH_64_PCREL:
|
||||
if (h != NULL)
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* If we are creating a shared library, and this is a reloc
|
||||
against a global symbol, or a non PC relative reloc
|
||||
@ -2770,8 +2765,7 @@ sh_elf64_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
&& (ELF32_R_TYPE (rel->r_info) != R_SH_64_PCREL
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
{
|
||||
/* When creating a shared object, we must copy these
|
||||
reloc types into the output file. We create a reloc
|
||||
@ -2935,7 +2929,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
|
||||
}
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
|
||||
h->non_elf = 0;
|
||||
h->type = STT_DATALABEL;
|
||||
}
|
||||
else
|
||||
@ -3294,7 +3288,7 @@ sh64_elf64_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -3393,31 +3387,28 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
|
||||
&& !h->def_dynamic
|
||||
&& !h->ref_dynamic)
|
||||
{
|
||||
/* This case can occur if we saw a PLT reloc in an input
|
||||
file, but the symbol was never referred to by a dynamic
|
||||
object. In such a case, we don't actually need to build
|
||||
a procedure linkage table, and we can just do a REL64
|
||||
reloc instead. */
|
||||
BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
|
||||
BFD_ASSERT (h->needs_plt);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -3442,7 +3433,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = s->size;
|
||||
@ -3493,7 +3484,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* We must allocate the symbol in our .dynbss section, which will
|
||||
@ -3520,7 +3511,7 @@ sh64_elf64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf64_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -3564,7 +3555,7 @@ sh64_elf64_discard_copies (struct elf_sh64_link_hash_entry *h,
|
||||
h = (struct elf_sh64_link_hash_entry *) h->root.root.u.i.link;
|
||||
|
||||
/* We only discard relocs for symbols defined in a regular object. */
|
||||
if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->root.def_regular)
|
||||
return TRUE;
|
||||
|
||||
for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
|
||||
@ -3872,7 +3863,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
|
||||
loc = srel->contents + plt_index * sizeof (Elf64_External_Rela);
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rel, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -3905,7 +3896,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
|
||||
initialized in the relocate_section function. */
|
||||
if (info->shared
|
||||
&& (info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& h->def_regular)
|
||||
{
|
||||
rel.r_info = ELF64_R_INFO (0, R_SH_RELATIVE64);
|
||||
rel.r_addend = (h->root.u.def.value
|
||||
@ -3924,7 +3915,7 @@ sh64_elf64_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rel, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rel;
|
||||
|
@ -1265,7 +1265,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
if (ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT32
|
||||
&& ELF64_R_TYPE_ID (rel->r_info) != R_SPARC_PLT64)
|
||||
break;
|
||||
@ -1612,14 +1612,11 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this is a function, put it in the procedure linkage table. We
|
||||
will fill in the contents of the procedure linkage table later
|
||||
@ -1629,7 +1626,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
|
||||
some of their functions as STT_NOTYPE when they really should be
|
||||
STT_FUNC. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
|
||||
|| h->needs_plt
|
||||
|| (h->type == STT_NOTYPE
|
||||
&& (h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
@ -1642,7 +1639,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
|
||||
In such a case, we don't actually need to build a
|
||||
procedure linkage table, and we can just do a WDISP30
|
||||
reloc instead. */
|
||||
BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0);
|
||||
BFD_ASSERT (h->needs_plt);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1662,7 +1659,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = sparc64_elf_plt_entry_offset (h->plt.offset);
|
||||
@ -1735,7 +1732,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
|
||||
srel = bfd_get_section_by_name (dynobj, ".rela.bss");
|
||||
BFD_ASSERT (srel != NULL);
|
||||
srel->size += sizeof (Elf64_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -2222,8 +2219,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
become local. */
|
||||
else if (h != NULL && ! is_plt
|
||||
&& ((! info->symbolic && h->dynindx != -1)
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
BFD_ASSERT (h->dynindx != -1);
|
||||
outrel.r_info
|
||||
@ -2325,8 +2321,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
|| (info->shared
|
||||
&& (info->symbolic
|
||||
|| h->dynindx == -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
|| h->forced_local)
|
||||
&& h->def_regular))
|
||||
{
|
||||
/* This is actually a static link, or it is a -Bsymbolic
|
||||
link and the symbol is defined locally, or the symbol
|
||||
@ -2614,7 +2610,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
input_bfd, input_section,
|
||||
@ -2736,7 +2732,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
loc += (h->plt.offset - 4) * sizeof (Elf64_External_Rela);
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value alone. */
|
||||
@ -2745,8 +2741,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
Otherwise, the PLT entry would provide a definition for
|
||||
the symbol even if the symbol wasn't defined anywhere,
|
||||
and so the symbol would never be NULL. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
|
||||
== 0)
|
||||
if (!h->ref_regular_nonweak)
|
||||
sym->st_value = 0;
|
||||
}
|
||||
}
|
||||
@ -2775,7 +2770,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
initialized in the relocate_section function. */
|
||||
if (info->shared
|
||||
&& (info->symbolic || h->dynindx == -1)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
|
||||
&& h->def_regular)
|
||||
{
|
||||
asection *sec = h->root.u.def.section;
|
||||
rela.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE);
|
||||
@ -2796,7 +2791,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
asection *s;
|
||||
Elf_Internal_Rela rela;
|
||||
|
@ -553,16 +553,17 @@ elf64_x86_64_copy_indirect_symbol (const struct elf_backend_data *bed,
|
||||
|
||||
if (ELIMINATE_COPY_RELOCS
|
||||
&& ind->root.type != bfd_link_hash_indirect
|
||||
&& (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->elf_link_hash_flags |=
|
||||
(ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT
|
||||
| ELF_LINK_POINTER_EQUALITY_NEEDED));
|
||||
&& dir->dynamic_adjusted)
|
||||
{
|
||||
/* If called to transfer flags for a weakdef during processing
|
||||
of elf_adjust_dynamic_symbol, don't copy non_got_ref.
|
||||
We clear it ourselves for ELIMINATE_COPY_RELOCS. */
|
||||
dir->ref_dynamic |= ind->ref_dynamic;
|
||||
dir->ref_regular |= ind->ref_regular;
|
||||
dir->ref_regular_nonweak |= ind->ref_regular_nonweak;
|
||||
dir->needs_plt |= ind->needs_plt;
|
||||
dir->pointer_equality_needed |= ind->pointer_equality_needed;
|
||||
}
|
||||
else
|
||||
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
|
||||
}
|
||||
@ -770,7 +771,7 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
if (h == NULL)
|
||||
continue;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->plt.refcount += 1;
|
||||
break;
|
||||
|
||||
@ -808,13 +809,13 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
sections have not yet been mapped to output sections.
|
||||
Tentatively set the flag for now, and correct in
|
||||
adjust_dynamic_symbol. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 1;
|
||||
|
||||
/* We may need a .plt entry if the function this reloc
|
||||
refers to is in a shared lib. */
|
||||
h->plt.refcount += 1;
|
||||
if (r_type != R_X86_64_PC32)
|
||||
h->elf_link_hash_flags |= ELF_LINK_POINTER_EQUALITY_NEEDED;
|
||||
h->pointer_equality_needed = 1;
|
||||
}
|
||||
|
||||
/* If we are creating a shared library, and this is a reloc
|
||||
@ -846,15 +847,13 @@ elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|
||||
|| (h != NULL
|
||||
&& (! info->symbolic
|
||||
|| h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))))
|
||||
|| !h->def_regular))))
|
||||
|| (ELIMINATE_COPY_RELOCS
|
||||
&& !info->shared
|
||||
&& (sec->flags & SEC_ALLOC) != 0
|
||||
&& h != NULL
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
|| !h->def_regular)))
|
||||
{
|
||||
struct elf64_x86_64_dyn_relocs *p;
|
||||
struct elf64_x86_64_dyn_relocs **head;
|
||||
@ -1126,7 +1125,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
will fill in the contents of the procedure linkage table later,
|
||||
when we know the address of the .got section. */
|
||||
if (h->type == STT_FUNC
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
|| h->needs_plt)
|
||||
{
|
||||
if (h->plt.refcount <= 0
|
||||
|| SYMBOL_CALLS_LOCAL (info, h)
|
||||
@ -1139,7 +1138,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
such a case, we don't actually need to build a procedure
|
||||
linkage table, and we can just do a PC32 reloc instead. */
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1162,9 +1161,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
h->root.u.def.section = h->weakdef->root.u.def.section;
|
||||
h->root.u.def.value = h->weakdef->root.u.def.value;
|
||||
if (ELIMINATE_COPY_RELOCS || info->nocopyreloc)
|
||||
h->elf_link_hash_flags
|
||||
= ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF)
|
||||
| (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF));
|
||||
h->non_got_ref = h->weakdef->non_got_ref;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1180,13 +1177,13 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* If there are no references to this symbol that do not use the
|
||||
GOT, we don't need to generate a copy reloc. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0)
|
||||
if (!h->non_got_ref)
|
||||
return TRUE;
|
||||
|
||||
/* If -z nocopyreloc was given, we won't generate them either. */
|
||||
if (info->nocopyreloc)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1207,7 +1204,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
we'll be keeping the dynamic relocs and avoiding the copy reloc. */
|
||||
if (p == NULL)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF;
|
||||
h->non_got_ref = 0;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -1230,7 +1227,7 @@ elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
htab->srelbss->size += sizeof (Elf64_External_Rela);
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
|
||||
h->needs_copy = 1;
|
||||
}
|
||||
|
||||
/* We need to figure out the alignment required for this symbol. I
|
||||
@ -1287,7 +1284,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1311,7 +1308,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
pointers compare as equal between the normal executable and
|
||||
the shared library. */
|
||||
if (! info->shared
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
h->root.u.def.section = s;
|
||||
h->root.u.def.value = h->plt.offset;
|
||||
@ -1330,13 +1327,13 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
h->plt.offset = (bfd_vma) -1;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 0;
|
||||
}
|
||||
|
||||
/* If R_X86_64_GOTTPOFF symbol is now local to the binary,
|
||||
@ -1355,7 +1352,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1430,9 +1427,9 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
symbols which turn out to need copy relocs or are not
|
||||
dynamic. */
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| (htab->elf.dynamic_sections_created
|
||||
&& (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined))))
|
||||
@ -1440,7 +1437,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
|
||||
/* Make sure this symbol is output as a dynamic symbol.
|
||||
Undefined weak syms won't yet be marked as dynamic. */
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
return FALSE;
|
||||
@ -1987,11 +1984,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
&& !info->shared
|
||||
&& h != NULL
|
||||
&& h->dynindx != -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
|
||||
&& (((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->non_got_ref
|
||||
&& ((h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
|| h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_undefined)))
|
||||
{
|
||||
@ -2029,8 +2024,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
|| r_type == R_X86_64_PC32
|
||||
|| !info->shared
|
||||
|| !info->symbolic
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
|
||||
outrel.r_addend = rel->r_addend;
|
||||
@ -2404,7 +2398,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
|
||||
not process them. */
|
||||
if (unresolved_reloc
|
||||
&& !((input_section->flags & SEC_DEBUGGING) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
|
||||
&& h->def_dynamic))
|
||||
(*_bfd_error_handler)
|
||||
(_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
|
||||
input_bfd,
|
||||
@ -2540,7 +2534,7 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
|
||||
loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela);
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* Mark the symbol as undefined, rather than as defined in
|
||||
the .plt section. Leave the value if there were any
|
||||
@ -2551,7 +2545,7 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
|
||||
called from a binary, there is no need to slow down
|
||||
shared libraries because of that. */
|
||||
sym->st_shndx = SHN_UNDEF;
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_POINTER_EQUALITY_NEEDED) == 0)
|
||||
if (!h->pointer_equality_needed)
|
||||
sym->st_value = 0;
|
||||
}
|
||||
}
|
||||
@ -2600,7 +2594,7 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
|
||||
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
|
||||
if (h->needs_copy)
|
||||
{
|
||||
Elf_Internal_Rela rela;
|
||||
bfd_byte *loc;
|
||||
|
252
bfd/elflink.c
252
bfd/elflink.c
@ -86,7 +86,7 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
|
||||
bed->got_symbol_offset, NULL, FALSE, bed->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (! info->executable
|
||||
@ -213,7 +213,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
get_elf_backend_data (abfd)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (! info->executable
|
||||
@ -276,7 +276,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
FALSE, get_elf_backend_data (abfd)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (! info->executable
|
||||
@ -363,7 +363,7 @@ bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (h->root.type != bfd_link_hash_undefined
|
||||
&& h->root.type != bfd_link_hash_undefweak)
|
||||
{
|
||||
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
|
||||
h->forced_local = 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -439,15 +439,15 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
h->root.type = bfd_link_hash_new;
|
||||
|
||||
if (h->root.type == bfd_link_hash_new)
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
|
||||
h->non_elf = 0;
|
||||
|
||||
/* If this symbol is being provided by the linker script, and it is
|
||||
currently defined by a dynamic object, but not by a regular
|
||||
object, then mark it as undefined so that the generic linker will
|
||||
force the correct value. */
|
||||
if (provide
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
h->root.type = bfd_link_hash_undefined;
|
||||
|
||||
/* If this symbol is not being provided by the linker script, and it is
|
||||
@ -455,14 +455,14 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
then clear out any version information because the symbol will not be
|
||||
associated with the dynamic object any more. */
|
||||
if (!provide
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& h->def_dynamic
|
||||
&& !h->def_regular)
|
||||
h->verinfo.verdef = NULL;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
|
||||
if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_DYNAMIC)) != 0
|
||||
if ((h->def_dynamic
|
||||
|| h->ref_dynamic
|
||||
|| info->shared)
|
||||
&& h->dynindx == -1)
|
||||
{
|
||||
@ -749,7 +749,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
|
||||
if (h->root.type == bfd_link_hash_new)
|
||||
{
|
||||
h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
|
||||
h->non_elf = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -784,7 +784,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
dynamic object, which we do want to handle here. */
|
||||
if (abfd == oldbfd
|
||||
&& ((abfd->flags & DYNAMIC) == 0
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
return TRUE;
|
||||
|
||||
/* NEWDYN and OLDDYN indicate whether the new or old symbol,
|
||||
@ -843,22 +843,22 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
/* We need to remember if a symbol has a definition in a dynamic
|
||||
object or is weak in all dynamic objects. Internal and hidden
|
||||
visibility will make it unavailable to dynamic objects. */
|
||||
if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0)
|
||||
if (newdyn && !h->dynamic_def)
|
||||
{
|
||||
if (!bfd_is_und_section (sec))
|
||||
h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF;
|
||||
h->dynamic_def = 1;
|
||||
else
|
||||
{
|
||||
/* Check if this symbol is weak in all dynamic objects. If it
|
||||
is the first time we see it in a dynamic object, we mark
|
||||
if it is weak. Otherwise, we clear it. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)
|
||||
if (!h->ref_dynamic)
|
||||
{
|
||||
if (bind == STB_WEAK)
|
||||
h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK;
|
||||
h->dynamic_weak = 1;
|
||||
}
|
||||
else if (bind != STB_WEAK)
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK;
|
||||
h->dynamic_weak = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -870,7 +870,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
{
|
||||
*skip = TRUE;
|
||||
/* Make sure this symbol is dynamic. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
|
||||
h->ref_dynamic = 1;
|
||||
/* A protected symbol has external availability. Make sure it is
|
||||
recorded as dynamic.
|
||||
|
||||
@ -882,7 +882,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
}
|
||||
else if (!newdyn
|
||||
&& ELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
|
||||
&& h->def_dynamic)
|
||||
{
|
||||
/* If the new symbol with non-default visibility comes from a
|
||||
relocatable file and the old definition comes from a dynamic
|
||||
@ -909,11 +909,11 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
h->root.u.undef.abfd = NULL;
|
||||
}
|
||||
|
||||
if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
|
||||
if (h->def_dynamic)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
|
||||
h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_DYNAMIC_DEF);
|
||||
h->def_dynamic = 0;
|
||||
h->ref_dynamic = 1;
|
||||
h->dynamic_def = 1;
|
||||
}
|
||||
/* FIXME: Should we check type and size for protected symbol? */
|
||||
h->size = 0;
|
||||
@ -996,7 +996,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
if (olddyn
|
||||
&& olddef
|
||||
&& h->root.type == bfd_link_hash_defined
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& h->def_dynamic
|
||||
&& (h->root.u.def.section->flags & SEC_ALLOC) != 0
|
||||
&& (h->root.u.def.section->flags & SEC_LOAD) == 0
|
||||
&& h->size > 0
|
||||
@ -1103,7 +1103,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
|| h->type == STT_FUNC)))
|
||||
&& olddyn
|
||||
&& olddef
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
|
||||
&& h->def_dynamic)
|
||||
{
|
||||
/* Change the hash table entry to undefined, and let
|
||||
_bfd_generic_link_add_one_symbol do the right thing with the
|
||||
@ -1185,10 +1185,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
|
||||
h->root.u.i.link = (struct bfd_link_hash_entry *) flip;
|
||||
(*bed->elf_backend_copy_indirect_symbol) (bed, flip, h);
|
||||
flip->root.u.undef.abfd = h->root.u.undef.abfd;
|
||||
if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
|
||||
if (h->def_dynamic)
|
||||
{
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC;
|
||||
flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
|
||||
h->def_dynamic = 0;
|
||||
flip->ref_dynamic = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1311,13 +1311,12 @@ _bfd_elf_add_default_symbol (bfd *abfd,
|
||||
|
||||
h->root.type = bfd_link_hash_indirect;
|
||||
h->root.u.i.link = (struct bfd_link_hash_entry *) hi;
|
||||
if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)
|
||||
if (h->def_dynamic)
|
||||
{
|
||||
h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC;
|
||||
hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
|
||||
if (hi->elf_link_hash_flags
|
||||
& (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_DEF_REGULAR))
|
||||
h->def_dynamic = 0;
|
||||
hi->ref_dynamic = 1;
|
||||
if (hi->ref_regular
|
||||
|| hi->def_regular)
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, hi))
|
||||
return FALSE;
|
||||
@ -1347,14 +1346,12 @@ _bfd_elf_add_default_symbol (bfd *abfd,
|
||||
if (! dynamic)
|
||||
{
|
||||
if (info->shared
|
||||
|| ((hi->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_DYNAMIC) != 0))
|
||||
|| hi->ref_dynamic)
|
||||
*dynsym = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((hi->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0)
|
||||
if (hi->ref_regular)
|
||||
*dynsym = TRUE;
|
||||
}
|
||||
}
|
||||
@ -1418,14 +1415,12 @@ nondefault:
|
||||
if (! dynamic)
|
||||
{
|
||||
if (info->shared
|
||||
|| ((hi->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_DYNAMIC) != 0))
|
||||
|| hi->ref_dynamic)
|
||||
*dynsym = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((hi->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0)
|
||||
if (hi->ref_regular)
|
||||
*dynsym = TRUE;
|
||||
}
|
||||
}
|
||||
@ -1451,8 +1446,8 @@ _bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data)
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
if (h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags
|
||||
& (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0)
|
||||
&& (h->def_regular
|
||||
|| h->ref_regular))
|
||||
{
|
||||
struct bfd_elf_version_tree *t;
|
||||
struct bfd_elf_version_expr *d;
|
||||
@ -1507,8 +1502,8 @@ _bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h,
|
||||
|
||||
/* We only care about symbols defined in shared objects with version
|
||||
information. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
if (!h->def_dynamic
|
||||
|| h->def_regular
|
||||
|| h->dynindx == -1
|
||||
|| h->verinfo.verdef == NULL)
|
||||
return TRUE;
|
||||
@ -1598,7 +1593,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
|
||||
|
||||
/* We only need version numbers for symbols defined in regular
|
||||
objects. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
return TRUE;
|
||||
|
||||
bed = get_elf_backend_data (sinfo->output_bfd);
|
||||
@ -1623,7 +1618,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
|
||||
if (*p == '\0')
|
||||
{
|
||||
if (hidden)
|
||||
h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
|
||||
h->hidden = 1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1718,7 +1713,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
|
||||
}
|
||||
|
||||
if (hidden)
|
||||
h->elf_link_hash_flags |= ELF_LINK_HIDDEN;
|
||||
h->hidden = 1;
|
||||
}
|
||||
|
||||
/* If we don't have a version for this symbol, see if we can find
|
||||
@ -2096,29 +2091,33 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
|
||||
DEF_REGULAR and REF_REGULAR correctly. This is the only way to
|
||||
permit a non-ELF file to correctly refer to a symbol defined in
|
||||
an ELF dynamic object. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0)
|
||||
if (h->non_elf)
|
||||
{
|
||||
while (h->root.type == bfd_link_hash_indirect)
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
if (h->root.type != bfd_link_hash_defined
|
||||
&& h->root.type != bfd_link_hash_defweak)
|
||||
h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK);
|
||||
{
|
||||
h->ref_regular = 1;
|
||||
h->ref_regular_nonweak = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (h->root.u.def.section->owner != NULL
|
||||
&& (bfd_get_flavour (h->root.u.def.section->owner)
|
||||
== bfd_target_elf_flavour))
|
||||
h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK);
|
||||
{
|
||||
h->ref_regular = 1;
|
||||
h->ref_regular_nonweak = 1;
|
||||
}
|
||||
else
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
}
|
||||
|
||||
if (h->dynindx == -1
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0))
|
||||
&& (h->def_dynamic
|
||||
|| h->ref_dynamic))
|
||||
{
|
||||
if (! bfd_elf_link_record_dynamic_symbol (eif->info, h))
|
||||
{
|
||||
@ -2129,7 +2128,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol
|
||||
/* Unfortunately, NON_ELF is only correct if the symbol
|
||||
was first seen in a non-ELF file. Fortunately, if the symbol
|
||||
was first seen in an ELF file, we're probably OK unless the
|
||||
symbol was defined in a non-ELF file. Catch that case here.
|
||||
@ -2137,27 +2136,26 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
|
||||
a dynamic object, and then later in a non-ELF regular object. */
|
||||
if ((h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
&& !h->def_regular
|
||||
&& (h->root.u.def.section->owner != NULL
|
||||
? (bfd_get_flavour (h->root.u.def.section->owner)
|
||||
!= bfd_target_elf_flavour)
|
||||
: (bfd_is_abs_section (h->root.u.def.section)
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) == 0)))
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
&& !h->def_dynamic)))
|
||||
h->def_regular = 1;
|
||||
}
|
||||
|
||||
/* If this is a final link, and the symbol was defined as a common
|
||||
symbol in a regular object file, and there was no definition in
|
||||
any dynamic object, then the linker will have allocated space for
|
||||
the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR
|
||||
the symbol in a common section but the DEF_REGULAR
|
||||
flag will not have been set. */
|
||||
if (h->root.type == bfd_link_hash_defined
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
&& !h->def_regular
|
||||
&& h->ref_regular
|
||||
&& !h->def_dynamic
|
||||
&& (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
|
||||
/* If -Bsymbolic was used (which means to bind references to global
|
||||
symbols to the definition within the shared object), and this
|
||||
@ -2165,12 +2163,12 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
|
||||
need a PLT entry. Likewise, if the symbol has non-default
|
||||
visibility. If the symbol has hidden or internal visibility, we
|
||||
will force it local. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
|
||||
if (h->needs_plt
|
||||
&& eif->info->shared
|
||||
&& is_elf_hash_table (eif->info->hash)
|
||||
&& (eif->info->symbolic
|
||||
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
|
||||
&& h->def_regular)
|
||||
{
|
||||
const struct elf_backend_data *bed;
|
||||
bfd_boolean force_local;
|
||||
@ -2207,12 +2205,12 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
|
||||
|| h->root.type == bfd_link_hash_defweak);
|
||||
BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
|
||||
|| weakdef->root.type == bfd_link_hash_defweak);
|
||||
BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC);
|
||||
BFD_ASSERT (weakdef->def_dynamic);
|
||||
|
||||
/* If the real definition is defined by a regular object file,
|
||||
don't do anything special. See the longer description in
|
||||
_bfd_elf_adjust_dynamic_symbol, below. */
|
||||
if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
|
||||
if (weakdef->def_regular)
|
||||
h->weakdef = NULL;
|
||||
else
|
||||
{
|
||||
@ -2266,10 +2264,10 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
|
||||
to the dynamic symbol table. FIXME: Do we normally need to worry
|
||||
about symbols which are defined by one dynamic object and
|
||||
referenced by another one? */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
|
||||
|| ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
|
||||
if (!h->needs_plt
|
||||
&& (h->def_regular
|
||||
|| !h->def_dynamic
|
||||
|| (!h->ref_regular
|
||||
&& (h->weakdef == NULL || h->weakdef->dynindx == -1))))
|
||||
{
|
||||
h->plt = elf_hash_table (eif->info)->init_offset;
|
||||
@ -2278,14 +2276,14 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
|
||||
|
||||
/* If we've already adjusted this symbol, don't do it again. This
|
||||
can happen via a recursive call. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0)
|
||||
if (h->dynamic_adjusted)
|
||||
return TRUE;
|
||||
|
||||
/* Don't look at this symbol again. Note that we must set this
|
||||
after checking the above conditions, because we may look at a
|
||||
symbol once, decide not to do anything, and then get called
|
||||
recursively later after REF_REGULAR is set below. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED;
|
||||
h->dynamic_adjusted = 1;
|
||||
|
||||
/* If this is a weak definition, and we know a real definition, and
|
||||
the real symbol is not itself defined by a regular object file,
|
||||
@ -2321,7 +2319,7 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
|
||||
reference by a regular object file via the weak symbol H.
|
||||
FIXME: Is this really true? What if the traversal finds
|
||||
H->WEAKDEF before it finds H? */
|
||||
h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
|
||||
h->weakdef->ref_regular = 1;
|
||||
|
||||
if (! _bfd_elf_adjust_dynamic_symbol (h->weakdef, eif))
|
||||
return FALSE;
|
||||
@ -2334,7 +2332,7 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
|
||||
code, and the assembly code fails to set the symbol type. */
|
||||
if (h->size == 0
|
||||
&& h->type == STT_NOTYPE
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
|
||||
&& !h->needs_plt)
|
||||
(*_bfd_error_handler)
|
||||
(_("warning: type and size of dynamic symbol `%s' are not defined"),
|
||||
h->root.root.string);
|
||||
@ -2399,7 +2397,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
|
||||
/* If it was forced local, then clearly it's not dynamic. */
|
||||
if (h->dynindx == -1)
|
||||
return FALSE;
|
||||
if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)
|
||||
if (h->forced_local)
|
||||
return FALSE;
|
||||
|
||||
/* Identify the cases where name binding rules say that a
|
||||
@ -2425,7 +2423,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
|
||||
}
|
||||
|
||||
/* If it isn't defined locally, then clearly it's dynamic. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
return TRUE;
|
||||
|
||||
/* Otherwise, the symbol is dynamic if binding rules don't tell
|
||||
@ -2453,11 +2451,11 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
|
||||
/* Do nothing. */;
|
||||
/* If we don't have a definition in a regular file, then we can't
|
||||
resolve locally. The sym is either undefined or dynamic. */
|
||||
else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
else if (!h->def_regular)
|
||||
return FALSE;
|
||||
|
||||
/* Forced local symbols resolve locally. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||
if (h->forced_local)
|
||||
return TRUE;
|
||||
|
||||
/* As do non-dynamic symbols. */
|
||||
@ -3633,9 +3631,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
|
||||
if (is_elf_hash_table (hash_table))
|
||||
{
|
||||
int old_flags;
|
||||
bfd_boolean dynsym;
|
||||
int new_flag;
|
||||
|
||||
/* Check the alignment when a common symbol is involved. This
|
||||
can change when a common symbol is overridden by a normal
|
||||
@ -3753,39 +3749,36 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
the number of dynamic symbols we find. A dynamic symbol
|
||||
is one which is referenced or defined by both a regular
|
||||
object and a shared object. */
|
||||
old_flags = h->elf_link_hash_flags;
|
||||
dynsym = FALSE;
|
||||
if (! dynamic)
|
||||
{
|
||||
if (! definition)
|
||||
{
|
||||
new_flag = ELF_LINK_HASH_REF_REGULAR;
|
||||
h->ref_regular = 1;
|
||||
if (bind != STB_WEAK)
|
||||
new_flag |= ELF_LINK_HASH_REF_REGULAR_NONWEAK;
|
||||
h->ref_regular_nonweak = 1;
|
||||
}
|
||||
else
|
||||
new_flag = ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->def_regular = 1;
|
||||
if (! info->executable
|
||||
|| (old_flags & (ELF_LINK_HASH_DEF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_DYNAMIC)) != 0)
|
||||
|| h->def_dynamic
|
||||
|| h->ref_dynamic)
|
||||
dynsym = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! definition)
|
||||
new_flag = ELF_LINK_HASH_REF_DYNAMIC;
|
||||
h->ref_dynamic = 1;
|
||||
else
|
||||
new_flag = ELF_LINK_HASH_DEF_DYNAMIC;
|
||||
if ((old_flags & (ELF_LINK_HASH_DEF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR)) != 0
|
||||
h->def_dynamic = 1;
|
||||
if (h->def_regular
|
||||
|| h->ref_regular
|
||||
|| (h->weakdef != NULL
|
||||
&& ! new_weakdef
|
||||
&& h->weakdef->dynindx != -1))
|
||||
dynsym = TRUE;
|
||||
}
|
||||
|
||||
h->elf_link_hash_flags |= new_flag;
|
||||
|
||||
/* Check to see if we need to add an indirect symbol for
|
||||
the default name. */
|
||||
if (definition || h->root.type == bfd_link_hash_common)
|
||||
@ -3839,8 +3832,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
||||
if (!add_needed
|
||||
&& definition
|
||||
&& dynsym
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0)
|
||||
&& h->ref_regular)
|
||||
{
|
||||
int ret;
|
||||
const char *soname = elf_dt_name (abfd);
|
||||
@ -4865,8 +4857,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
|
||||
/* Mark this version if there is a definition and it is
|
||||
not defined in a shared object. */
|
||||
if (newh != NULL
|
||||
&& ((newh->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) == 0)
|
||||
&& !newh->def_dynamic
|
||||
&& (newh->root.type == bfd_link_hash_defined
|
||||
|| newh->root.type == bfd_link_hash_defweak))
|
||||
d->symver = 1;
|
||||
@ -4925,8 +4916,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
|
||||
FALSE, FALSE)
|
||||
: NULL);
|
||||
if (h != NULL
|
||||
&& (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_DEF_REGULAR)) != 0)
|
||||
&& (h->ref_regular
|
||||
|| h->def_regular))
|
||||
{
|
||||
if (!_bfd_elf_add_dynamic_entry (info, DT_INIT, 0))
|
||||
return FALSE;
|
||||
@ -4937,8 +4928,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
|
||||
FALSE, FALSE)
|
||||
: NULL);
|
||||
if (h != NULL
|
||||
&& (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_DEF_REGULAR)) != 0)
|
||||
&& (h->ref_regular
|
||||
|| h->def_regular))
|
||||
{
|
||||
if (!_bfd_elf_add_dynamic_entry (info, DT_FINI, 0))
|
||||
return FALSE;
|
||||
@ -5127,8 +5118,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
|
||||
get_elf_backend_data (dynobj)->collect, &bh)))
|
||||
return FALSE;
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->non_elf = 0;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
h->verinfo.vertree = t;
|
||||
|
||||
@ -5992,12 +5983,12 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
/* Decide whether to output this symbol in this pass. */
|
||||
if (eoinfo->localsyms)
|
||||
{
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
if (!h->forced_local)
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||
if (h->forced_local)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -6008,8 +5999,8 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
references in regular files have already been handled). If we
|
||||
are reporting errors for this situation then do so now. */
|
||||
if (h->root.type == bfd_link_hash_undefined
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
|
||||
&& h->ref_dynamic
|
||||
&& !h->ref_regular
|
||||
&& ! elf_link_check_versioned_symbol (finfo->info, bed, h)
|
||||
&& finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE)
|
||||
{
|
||||
@ -6026,9 +6017,10 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
shared libraries. */
|
||||
if (! finfo->info->relocatable
|
||||
&& (! finfo->info->shared)
|
||||
&& (h->elf_link_hash_flags
|
||||
& (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK))
|
||||
== (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC)
|
||||
&& h->forced_local
|
||||
&& h->ref_dynamic
|
||||
&& !h->dynamic_def
|
||||
&& !h->dynamic_weak
|
||||
&& ! elf_link_check_versioned_symbol (finfo->info, bed, h))
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
@ -6049,10 +6041,10 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
output it. */
|
||||
if (h->indx == -2)
|
||||
strip = FALSE;
|
||||
else if (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
|
||||
else if ((h->def_dynamic
|
||||
|| h->ref_dynamic)
|
||||
&& !h->def_regular
|
||||
&& !h->ref_regular)
|
||||
strip = TRUE;
|
||||
else if (finfo->info->strip == strip_all)
|
||||
strip = TRUE;
|
||||
@ -6072,13 +6064,13 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
nothing else to do unless it is a forced local symbol. */
|
||||
if (strip
|
||||
&& h->dynindx == -1
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
&& !h->forced_local)
|
||||
return TRUE;
|
||||
|
||||
sym.st_value = 0;
|
||||
sym.st_size = h->size;
|
||||
sym.st_other = h->other;
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||
if (h->forced_local)
|
||||
sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type);
|
||||
else if (h->root.type == bfd_link_hash_undefweak
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
@ -6165,11 +6157,11 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
symbol. FIXME: Not calling elf_backend_finish_dynamic_symbol for
|
||||
forced local syms when non-shared is due to a historical quirk. */
|
||||
if ((h->dynindx != -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||
|| h->forced_local)
|
||||
&& ((finfo->info->shared
|
||||
&& (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|
||||
|| h->root.type != bfd_link_hash_undefweak))
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
|
||||
|| !h->forced_local)
|
||||
&& elf_hash_table (finfo->info)->dynamic_sections_created)
|
||||
{
|
||||
if (! ((*bed->elf_backend_finish_dynamic_symbol)
|
||||
@ -6187,13 +6179,13 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
because it might not be marked as undefined until the
|
||||
finish_dynamic_symbol routine gets through with it. */
|
||||
if (sym.st_shndx == SHN_UNDEF
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& h->ref_regular
|
||||
&& (ELF_ST_BIND (sym.st_info) == STB_GLOBAL
|
||||
|| ELF_ST_BIND (sym.st_info) == STB_WEAK))
|
||||
{
|
||||
int bindtype;
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) != 0)
|
||||
if (h->ref_regular_nonweak)
|
||||
bindtype = STB_GLOBAL;
|
||||
else
|
||||
bindtype = STB_WEAK;
|
||||
@ -6206,7 +6198,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
&& ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT
|
||||
&& ELF_ST_BIND (sym.st_info) != STB_WEAK
|
||||
&& h->root.type == bfd_link_hash_undefined
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& !h->def_regular)
|
||||
{
|
||||
(*_bfd_error_handler)
|
||||
(_("%B: %s symbol `%s' isn't defined"),
|
||||
@ -6254,7 +6246,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
Elf_Internal_Versym iversym;
|
||||
Elf_External_Versym *eversym;
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
if (h->verinfo.verdef == NULL)
|
||||
iversym.vs_vers = 0;
|
||||
@ -6269,7 +6261,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|
||||
iversym.vs_vers = h->verinfo.vertree->vernum + 1;
|
||||
}
|
||||
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HIDDEN) != 0)
|
||||
if (h->hidden)
|
||||
iversym.vs_vers |= VERSYM_HIDDEN;
|
||||
|
||||
eversym = (Elf_External_Versym *) finfo->symver_sec->contents;
|
||||
@ -8686,7 +8678,7 @@ elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h,
|
||||
|
||||
if ((h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC))
|
||||
&& h->ref_dynamic)
|
||||
h->root.u.def.section->flags |= SEC_KEEP;
|
||||
|
||||
return TRUE;
|
||||
|
@ -1641,12 +1641,10 @@ elfNN_ia64_hash_copy_indirect (bed, xdir, xind)
|
||||
/* Copy down any references that we may have already seen to the
|
||||
symbol which just became indirect. */
|
||||
|
||||
dir->root.elf_link_hash_flags |=
|
||||
(ind->root.elf_link_hash_flags
|
||||
& (ELF_LINK_HASH_REF_DYNAMIC
|
||||
| ELF_LINK_HASH_REF_REGULAR
|
||||
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
|
||||
| ELF_LINK_HASH_NEEDS_PLT));
|
||||
dir->root.ref_dynamic |= ind->root.ref_dynamic;
|
||||
dir->root.ref_regular |= ind->root.ref_regular;
|
||||
dir->root.ref_regular_nonweak |= ind->root.ref_regular_nonweak;
|
||||
dir->root.needs_plt |= ind->root.needs_plt;
|
||||
|
||||
if (ind->root.root.type != bfd_link_hash_indirect)
|
||||
return;
|
||||
@ -2235,7 +2233,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
|
||||
|| h->root.type == bfd_link_hash_warning)
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
|
||||
h->ref_regular = 1;
|
||||
}
|
||||
|
||||
/* We can only get preliminary data on whether a symbol is
|
||||
@ -2244,8 +2242,9 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
|
||||
this may help reduce memory usage and processing time later. */
|
||||
maybe_dynamic = FALSE;
|
||||
if (h && ((!info->executable
|
||||
&& (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
|
||||
|| ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
&& (!info->symbolic
|
||||
|| info->unresolved_syms_in_shared_libs == RM_IGNORE))
|
||||
|| !h->def_regular
|
||||
|| h->root.type == bfd_link_hash_defweak))
|
||||
maybe_dynamic = TRUE;
|
||||
|
||||
@ -2444,7 +2443,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
|
||||
{
|
||||
if (!ia64_info->root.dynobj)
|
||||
ia64_info->root.dynobj = abfd;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
dyn_i->want_plt = 1;
|
||||
}
|
||||
if (need_entry & NEED_FULL_PLT)
|
||||
@ -2651,7 +2650,7 @@ allocate_plt_entries (dyn_i, data)
|
||||
|| h->root.type == bfd_link_hash_warning)
|
||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||
|
||||
/* ??? Versioned symbols seem to lose ELF_LINK_HASH_NEEDS_PLT. */
|
||||
/* ??? Versioned symbols seem to lose NEEDS_PLT. */
|
||||
if (elfNN_ia64_dynamic_symbol_p (h, x->info, 0))
|
||||
{
|
||||
bfd_size_type offset = x->ofs;
|
||||
@ -4575,7 +4574,7 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym)
|
||||
plt section. Leave the value alone. */
|
||||
/* ??? We didn't redefine it in adjust_dynamic_symbol in the
|
||||
first place. But perhaps elflink.c did some for us. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
sym->st_shndx = SHN_UNDEF;
|
||||
}
|
||||
|
||||
|
@ -1490,10 +1490,10 @@ mips_elf_output_extsym (struct mips_elf_link_hash_entry *h, void *data)
|
||||
|
||||
if (h->root.indx == -2)
|
||||
strip = FALSE;
|
||||
else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
|| (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
|
||||
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
|
||||
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
|
||||
else if ((h->root.def_dynamic
|
||||
|| h->root.ref_dynamic)
|
||||
&& !h->root.def_regular
|
||||
&& !h->root.ref_regular)
|
||||
strip = TRUE;
|
||||
else if (einfo->info->strip == strip_all
|
||||
|| (einfo->info->strip == strip_some
|
||||
@ -1611,7 +1611,7 @@ mips_elf_output_extsym (struct mips_elf_link_hash_entry *h, void *data)
|
||||
else
|
||||
h->esym.asym.value = 0;
|
||||
}
|
||||
else if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
else if (h->root.needs_plt)
|
||||
{
|
||||
struct mips_elf_link_hash_entry *hd = h;
|
||||
bfd_boolean no_fn_stub = h->no_fn_stub;
|
||||
@ -2411,10 +2411,8 @@ mips_elf_set_global_got_offset (void **entryp, void *p)
|
||||
entry->gotidx = arg->value * (long) g->assigned_gotno++;
|
||||
if (arg->info->shared
|
||||
|| (elf_hash_table (arg->info)->dynamic_sections_created
|
||||
&& ((entry->d.h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)
|
||||
&& ((entry->d.h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
&& entry->d.h->root.def_dynamic
|
||||
&& !entry->d.h->root.def_regular))
|
||||
++arg->needed_relocs;
|
||||
}
|
||||
else
|
||||
@ -2764,7 +2762,7 @@ mips_elf_local_relocation_p (bfd *input_bfd,
|
||||
while (h->root.root.type == bfd_link_hash_indirect
|
||||
|| h->root.root.type == bfd_link_hash_warning)
|
||||
h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
|
||||
if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
|
||||
if (h->root.forced_local)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2910,8 +2908,8 @@ mips_elf_create_got_section (bfd *abfd, struct bfd_link_info *info,
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->non_elf = 0;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (info->shared
|
||||
@ -3237,7 +3235,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
|
||||
if (! elf_hash_table(info)->dynamic_sections_created
|
||||
|| (info->shared
|
||||
&& (info->symbolic || h->root.dynindx == -1)
|
||||
&& (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
|
||||
&& h->root.def_regular))
|
||||
{
|
||||
/* This is a static link or a -Bsymbolic link. The
|
||||
symbol is defined locally, or was forced to be local.
|
||||
@ -3300,10 +3298,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
|
||||
if ((info->shared
|
||||
|| (elf_hash_table (info)->dynamic_sections_created
|
||||
&& h != NULL
|
||||
&& ((h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)
|
||||
&& ((h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
&& h->root.def_dynamic
|
||||
&& !h->root.def_regular))
|
||||
&& r_symndx != 0
|
||||
&& (input_section->flags & SEC_ALLOC) != 0)
|
||||
{
|
||||
@ -3857,16 +3853,14 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
|
||||
/* We must now calculate the dynamic symbol table index to use
|
||||
in the relocation. */
|
||||
if (h != NULL
|
||||
&& (! info->symbolic || (h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
&& (! info->symbolic || !h->root.def_regular)
|
||||
/* h->root.dynindx may be -1 if this symbol was marked to
|
||||
become local. */
|
||||
&& h->root.dynindx != -1)
|
||||
{
|
||||
indx = h->root.dynindx;
|
||||
if (SGI_COMPAT (output_bfd))
|
||||
defined_p = ((h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) != 0);
|
||||
defined_p = h->root.def_regular;
|
||||
else
|
||||
/* ??? glibc's ld.so just adds the final GOT entry to the
|
||||
relocation field. It therefore treats relocs against
|
||||
@ -4813,8 +4807,8 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->non_elf = 0;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
@ -4925,8 +4919,8 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->non_elf = 0;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_SECTION;
|
||||
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
@ -4970,8 +4964,8 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->non_elf = 0;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_SECTION;
|
||||
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
@ -4994,8 +4988,8 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
|
||||
return FALSE;
|
||||
|
||||
h = (struct elf_link_hash_entry *) bh;
|
||||
h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
|
||||
h->non_elf = 0;
|
||||
h->def_regular = 1;
|
||||
h->type = STT_OBJECT;
|
||||
|
||||
if (! bfd_elf_link_record_dynamic_symbol (info, h))
|
||||
@ -5318,7 +5312,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
/* We need a stub, not a plt entry for the undefined
|
||||
function. But we record it as if it needs plt. See
|
||||
_bfd_elf_adjust_dynamic_symbol. */
|
||||
h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
|
||||
h->needs_plt = 1;
|
||||
h->type = STT_FUNC;
|
||||
}
|
||||
break;
|
||||
@ -5338,10 +5332,9 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
||||
hmips = (struct mips_elf_link_hash_entry *)
|
||||
hmips->root.root.u.i.link;
|
||||
|
||||
if ((hmips->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|
||||
if (hmips->root.def_regular
|
||||
&& ! (info->shared && ! info->symbolic
|
||||
&& ! (hmips->root.elf_link_hash_flags
|
||||
& ELF_LINK_FORCED_LOCAL)))
|
||||
&& ! hmips->root.forced_local))
|
||||
break;
|
||||
}
|
||||
/* Fall through. */
|
||||
@ -5550,7 +5543,7 @@ _bfd_mips_relax_section (bfd *abfd, asection *sec,
|
||||
|| h->root.root.type == bfd_link_hash_defweak)
|
||||
&& h->root.root.u.def.section)
|
||||
|| (link_info->shared && ! link_info->symbolic
|
||||
&& ! (h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)))
|
||||
&& !h->root.forced_local))
|
||||
continue;
|
||||
|
||||
sym_sec = h->root.root.u.def.section;
|
||||
@ -5674,14 +5667,11 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* Make sure we know what is going on here. */
|
||||
BFD_ASSERT (dynobj != NULL
|
||||
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)
|
||||
&& (h->needs_plt
|
||||
|| h->weakdef != NULL
|
||||
|| ((h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_REF_REGULAR) != 0
|
||||
&& (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)));
|
||||
|| (h->def_dynamic
|
||||
&& h->ref_regular
|
||||
&& !h->def_regular)));
|
||||
|
||||
/* If this symbol is defined in a dynamic object, we need to copy
|
||||
any R_MIPS_32 or R_MIPS_REL32 relocs against it into the output
|
||||
@ -5690,8 +5680,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
if (! info->relocatable
|
||||
&& hmips->possibly_dynamic_relocs != 0
|
||||
&& (h->root.type == bfd_link_hash_defweak
|
||||
|| (h->elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|
||||
|| !h->def_regular))
|
||||
{
|
||||
mips_elf_allocate_dynamic_relocations (dynobj,
|
||||
hmips->possibly_dynamic_relocs);
|
||||
@ -5703,7 +5692,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
|
||||
/* For a function, create a stub, if allowed. */
|
||||
if (! hmips->no_fn_stub
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0)
|
||||
&& h->needs_plt)
|
||||
{
|
||||
if (! elf_hash_table (info)->dynamic_sections_created)
|
||||
return TRUE;
|
||||
@ -5712,7 +5701,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
the symbol to the stub location. This is required to make
|
||||
function pointers compare as equal between the normal
|
||||
executable and the shared library. */
|
||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||
if (!h->def_regular)
|
||||
{
|
||||
/* We need .stub section. */
|
||||
s = bfd_get_section_by_name (dynobj,
|
||||
@ -5734,7 +5723,7 @@ _bfd_mips_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
|
||||
}
|
||||
}
|
||||
else if ((h->type == STT_FUNC)
|
||||
&& (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0)
|
||||
&& !h->needs_plt)
|
||||
{
|
||||
/* This will set the entry for this symbol in the GOT to 0, and
|
||||
the dynamic linker will take care of this. */
|
||||
@ -6608,7 +6597,7 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
}
|
||||
|
||||
BFD_ASSERT (h->dynindx != -1
|
||||
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0);
|
||||
|| h->forced_local);
|
||||
|
||||
sgot = mips_elf_got_section (dynobj, FALSE);
|
||||
BFD_ASSERT (sgot != NULL);
|
||||
@ -6651,10 +6640,8 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
|
||||
if (info->shared
|
||||
|| (elf_hash_table (info)->dynamic_sections_created
|
||||
&& p->d.h != NULL
|
||||
&& ((p->d.h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_DYNAMIC) != 0)
|
||||
&& ((p->d.h->root.elf_link_hash_flags
|
||||
& ELF_LINK_HASH_DEF_REGULAR) == 0)))
|
||||
&& p->d.h->root.def_dynamic
|
||||
&& !p->d.h->root.def_regular))
|
||||
{
|
||||
/* Create an R_MIPS_REL32 relocation for this entry. Due to
|
||||
the various compatibility problems, it's easier to mock
|
||||
|
Loading…
x
Reference in New Issue
Block a user