diff options
-rw-r--r-- | bfd/ChangeLog | 45 | ||||
-rw-r--r-- | bfd/aclocal.m4 | 2071 | ||||
-rwxr-xr-x | bfd/configure | 724 | ||||
-rw-r--r-- | bfd/configure.in | 2 | ||||
-rw-r--r-- | bfd/elf-bfd.h | 48 | ||||
-rw-r--r-- | bfd/elf-hppa.h | 18 | ||||
-rw-r--r-- | bfd/elf-m10300.c | 44 | ||||
-rw-r--r-- | bfd/elf.c | 34 | ||||
-rw-r--r-- | bfd/elf32-arm.h | 64 | ||||
-rw-r--r-- | bfd/elf32-cris.c | 88 | ||||
-rw-r--r-- | bfd/elf32-frv.c | 19 | ||||
-rw-r--r-- | bfd/elf32-hppa.c | 94 | ||||
-rw-r--r-- | bfd/elf32-i370.c | 19 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 86 | ||||
-rw-r--r-- | bfd/elf32-m32r.c | 97 | ||||
-rw-r--r-- | bfd/elf32-m68k.c | 64 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 103 | ||||
-rw-r--r-- | bfd/elf32-s390.c | 94 | ||||
-rw-r--r-- | bfd/elf32-sh-symbian.c | 2 | ||||
-rw-r--r-- | bfd/elf32-sh.c | 116 | ||||
-rw-r--r-- | bfd/elf32-sh64.c | 2 | ||||
-rw-r--r-- | bfd/elf32-sparc.c | 88 | ||||
-rw-r--r-- | bfd/elf32-vax.c | 55 | ||||
-rw-r--r-- | bfd/elf32-xtensa.c | 8 | ||||
-rw-r--r-- | bfd/elf64-alpha.c | 43 | ||||
-rw-r--r-- | bfd/elf64-hppa.c | 11 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 125 | ||||
-rw-r--r-- | bfd/elf64-s390.c | 94 | ||||
-rw-r--r-- | bfd/elf64-sh64.c | 63 | ||||
-rw-r--r-- | bfd/elf64-sparc.c | 39 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 86 | ||||
-rw-r--r-- | bfd/elflink.c | 252 | ||||
-rw-r--r-- | bfd/elfxx-ia64.c | 23 | ||||
-rw-r--r-- | bfd/elfxx-mips.c | 89 |
34 files changed, 2560 insertions, 2250 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4d4ed46..83e8141 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,50 @@ 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 around uses of R_ARM_TARGET1. (elf32_arm_check_relocs): Likewise. diff --git a/bfd/aclocal.m4 b/bfd/aclocal.m4 index 4759a9f..49e8d5b 100644 --- a/bfd/aclocal.m4 +++ b/bfd/aclocal.m4 @@ -1,1067 +1,835 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p6 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -sinclude(../config/accross.m4) -sinclude(../config/acx.m4) - -dnl See whether we need to use fopen-bin.h rather than fopen-same.h. -AC_DEFUN([BFD_BINARY_FOPEN], -[AC_REQUIRE([AC_CANONICAL_TARGET]) -case "${host}" in -changequote(,)dnl -*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) -changequote([,])dnl - AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;; -esac])dnl - -dnl Get a default for CC_FOR_BUILD to put into Makefile. -AC_DEFUN([BFD_CC_FOR_BUILD], -[# Put a plausible default for CC_FOR_BUILD in Makefile. -if test -z "$CC_FOR_BUILD"; then - if test "x$cross_compiling" = "xno"; then - CC_FOR_BUILD='$(CC)' - else - CC_FOR_BUILD=gcc - fi -fi -AC_SUBST(CC_FOR_BUILD) -# Also set EXEEXT_FOR_BUILD. -if test "x$cross_compiling" = "xno"; then - EXEEXT_FOR_BUILD='$(EXEEXT)' +# generated automatically by aclocal 1.9.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.1])]) + +# AM_AUX_DIR_EXPAND + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 6 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' else - AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext, - [rm -f conftest* - echo 'int main () { return 0; }' > conftest.c - bfd_cv_build_exeext= - ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 - for file in conftest.*; do - case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; - *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - rm -f conftest* - test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no]) - EXEEXT_FOR_BUILD="" - test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} -fi -AC_SUBST(EXEEXT_FOR_BUILD)])dnl - -dnl See whether we need a declaration for a function. -AC_DEFUN([BFD_NEED_DECLARATION], -[AC_MSG_CHECKING([whether $1 must be declared]) -AC_CACHE_VAL(bfd_cv_decl_needed_$1, -[AC_TRY_COMPILE([ -#include <stdio.h> -#ifdef HAVE_STRING_H -#include <string.h> -#else -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif], -[char *(*pfn) = (char *(*)) $1], -bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)]) -AC_MSG_RESULT($bfd_cv_decl_needed_$1) -if test $bfd_cv_decl_needed_$1 = yes; then - AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, - [Define if $1 is not declared in system header files.]) + $1_TRUE='#' + $1_FALSE= fi -])dnl - -dnl Check for existence of a type $1 in sys/procfs.h - -AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE], -[AC_MSG_CHECKING([for $1 in sys/procfs.h]) - AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([ -#define _SYSCALL32 -#include <sys/procfs.h>], - [$1 avar], - bfd_cv_have_sys_procfs_type_$1=yes, - bfd_cv_have_sys_procfs_type_$1=no - )]) - if test $bfd_cv_have_sys_procfs_type_$1 = yes; then - AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z]), 1, - [Define if <sys/procfs.h> has $1.]) - fi - AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_$1) -]) +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) +# serial 7 -*- Autoconf -*- -dnl Check for existence of member $2 in type $1 in sys/procfs.h - -AC_DEFUN([BFD_HAVE_SYS_PROCFS_TYPE_MEMBER], -[AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) - AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([ -#define _SYSCALL32 -#include <sys/procfs.h>], - [$1 avar; void* aref = (void*) &avar.$2], - bfd_cv_have_sys_procfs_type_member_$1_$2=yes, - bfd_cv_have_sys_procfs_type_member_$1_$2=no - )]) - if test $bfd_cv_have_sys_procfs_type_member_$1_$2 = yes; then - AC_DEFINE([HAVE_]translit($1, [a-z], [A-Z])[_]translit($2, [a-z], [A-Z]), 1, - [Define if <sys/procfs.h> has $1.$2.]) - fi - AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) -]) +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. -sinclude(../libtool.m4) -dnl The lines below arrange for aclocal not to bring libtool.m4 -dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake -dnl to add a definition of LIBTOOL to Makefile.in. -ifelse(yes,no,[ -AC_DEFUN([AM_PROG_LIBTOOL],) -AC_DEFUN([AM_DISABLE_SHARED],) -AC_SUBST(LIBTOOL) -]) +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. -sinclude(../gettext.m4) -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) -]) +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -AC_DEFUN([AM_INSTALL_LIBBFD], -[AC_MSG_CHECKING([whether to install libbfd]) - AC_ARG_ENABLE(install-libbfd, -[ --enable-install-libbfd controls installation of libbfd and related headers], - install_libbfd_p=$enableval, - if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then - install_libbfd_p=yes - else - install_libbfd_p=no - fi) - AC_MSG_RESULT($install_libbfd_p) - AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes) - # Need _noncanonical variables for this. - ACX_NONCANONICAL_HOST - ACX_NONCANONICAL_TARGET - # libbfd.a is a host library containing target dependent code - bfdlibdir='$(libdir)' - bfdincludedir='$(includedir)' - if test "${host}" != "${target}"; then - bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' - bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[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_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi - AC_SUBST(bfdlibdir) - AC_SUBST(bfdincludedir) -] -) + 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 -# lib-prefix.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) + 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 - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi + break fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - 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_$1_dependencies_compiler_type=$depmode + break fi fi - fi -]) + done -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) -# lib-link.m4 serial 4 (gettext-0.12) -dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Bruno Haible. - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) ]) -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[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=`AS_DIRNAME("$mf")` else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= + continue fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) -]) + # 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=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS -dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; -*) - acl_cv_prog_gnu_ld=no ;; -esac]) -with_gnu_ld=$acl_cv_prog_gnu_ld -]) +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 7 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -dnl From libtool-1.4. Sets the variable LD. -AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 11 + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +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 - PATH_SEPARATOR=: + CYGPATH_W=echo fi - rm -f conf$$.sh fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. else - AC_MSG_CHECKING([for non-GNU ld]) + am__leading_dot=_ fi -AC_CACHE_VAL(acl_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[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. +AC_MSG_CHECKING([for style of include used by $am_make]) +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 -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU +# 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 +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf ]) -# Define a conditional. +# -*- Autoconf -*- -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' + +# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +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 - $1_TRUE='#' - $1_FALSE= -fi]) - -# isc-posix.m4 serial 2 (gettext-0.11.2) -dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. - -# This test replaces the one in autoconf. -# Currently this macro should have the same name as the autoconf macro -# because gettext's gettext.m4 (distributed in the automake package) -# still uses it. Otherwise, the use in gettext.m4 makes autoheader -# give these diagnostics: -# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX - -undefine([AC_ISC_POSIX]) - -AC_DEFUN([AC_ISC_POSIX], - [ - dnl This test replaces the obsolescent AC_ISC_POSIX kludge. - AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) - ] -) + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# serial 1 +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[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 -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# Copyright 2002 Free Software Foundation, Inc. +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1076,42 +844,77 @@ AC_REQUIRE([AC_PROG_MAKE_SET])]) # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) +# serial 2 -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.4-p6])]) +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # 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` - if test "[$]*" = "X"; then + 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 @@ -1121,7 +924,7 @@ if ( alias in your environment]) fi - test "[$]2" = conftestfile + test "$[2]" = conftest.file ) then # Ok. @@ -1130,65 +933,153 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -rm -f conftest* AC_MSG_RESULT(yes)]) -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# 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 ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) +# AM_PROG_INSTALL_STRIP + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# 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. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) fi -AC_SUBST($1)]) +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<<am_indx=1 -for am_file in <<$1>>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false ;; esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break -# serial 1 + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR +m4_include([acinclude.m4]) diff --git a/bfd/configure b/bfd/configure index 48d6ca6..6710ec6 100755 --- a/bfd/configure +++ b/bfd/configure @@ -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 + +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +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 -PACKAGE=bfd -VERSION=2.15.91 -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then +# 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,86 +2846,234 @@ cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +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"} -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 +# 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 + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else - ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" - echo "$as_me:$LINENO: result: missing" >&5 -echo "${ECHO_T}missing" >&6 +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 + 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 + 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 -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 + 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 - AUTOCONF="$missing_dir/missing autoconf" - echo "$as_me:$LINENO: result: missing" >&5 -echo "${ECHO_T}missing" >&6 + 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 + 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 -' + -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 + + +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 + 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 -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 + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$as_me:$LINENO: result: missing" >&5 -echo "${ECHO_T}missing" >&6 + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -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 diff --git a/bfd/configure.in b/bfd/configure.in index 7e3fa45..c5fe78e 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -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. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 5565e49..03fbd75 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -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. */ diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index b1e00af..a6d3d69 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -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; diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index a83015d..5daf27f 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -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; @@ -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; diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index 9314045..706ca59 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -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; diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index ae8b3d2..7414ca7 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -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, diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index 9341fe8..bdb2760 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -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 diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 701c72f..4cfb259 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -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; diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index a44ff4c..75a92f5 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -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); diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index f689bee..87df2f9 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -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; diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index b7609e0..fc95840 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -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; diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 08cc793..a7696cd 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -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; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 9c22c17..c6f01a8 100644 --- a/bfd/elf32-ppc.c +++ b/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'"), diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 72ae02e..f7f17fc 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -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; diff --git a/bfd/elf32-sh-symbian.c b/bfd/elf32-sh-symbian.c index 1247c6f..adce088 100644 --- a/bfd/elf32-sh-symbian.c +++ b/bfd/elf32-sh-symbian.c @@ -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); diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index a5aa4ff..e4f195d 100644 --- a/bfd/elf32-sh.c +++ b/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; diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 5883371..f7d8949 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -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 diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index 5b80533..48906fd 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -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; diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index a0249b1..6cf279e 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -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; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index cfdbd23..99d4f9b 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -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. */ diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index a1f4e03..5a8e5b1 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -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. */ diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 25431d4..dbfefe9 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -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; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index b49b613..3a49acb 100644 --- a/bfd/elf64-ppc.c +++ b/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; diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 821ea51..1e84f30 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -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; diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index ea6f4df..28ee26b 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -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; diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index ca35eec..9d7469a 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -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; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index a5c5c9f..959be55 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -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; diff --git a/bfd/elflink.c b/bfd/elflink.c index e4e8dcc..9332366 100644 --- a/bfd/elflink.c +++ b/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; diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index a3a69e4..ed4b08e 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -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; } diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 56d0d78..5b4ae5d 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -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 |