###############################################################################
name = binutils
-version = 2.22
-release = 3
+version = 2.22.52.0.3
+release = 1
maintainer = Michael Tremer <michael.tremer@ipfire.org>
groups = Development/Tools
tools for the manipulation of object code in various object file formats.
end
-source_dl = http://ftp.gnu.org/gnu/binutils/
+source_dl
+ http://ftp.gnu.org/gnu/binutils/
+ ftp://ftp.kernel.org/pub/linux/devel/binutils
+end
build
requires
make tooldir=/usr %{PARALLELISMFLAGS}
end
- #def test
- # # Apply a sed substitution to prevent a testsuite error:
- # sed -i 's/getline/get_line/' libiberty/testsuite/test-demangle.c
- # cd %{DIR_SRC}/binutils-build && make check
- #end
+ test
+ cd %{DIR_SRC}/binutils-build
+ make -k check </dev/null || :
+
+ echo "==== RESULTS ===="
+ cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum
+ end
install
- cd %{DIR_SRC}/binutils-build && make tooldir=/usr install DESTDIR=%{BUILDROOT}
+ cd %{DIR_SRC}/binutils-build
+ make tooldir=/usr install DESTDIR=%{BUILDROOT}
cp -fv %{DIR_APP}/include/libiberty.h %{BUILDROOT}/usr/include
# Prevent packages from linking against libbfd and libopcodes,
# because they change too often.
rm -rfv %{BUILDROOT}%{libdir}/lib{bfd,opcodes}.so
+
+ # Remove Windows/Novell only man pages.
+ rm -vf %{BUILDROOT}%{mandir}/man1/{dlltool,nlmconv,windres}*
end
# Keep static version of libiberty.
+++ /dev/null
-background:
-http://www.airs.com/blog/archives/189
-
---- binutils/ld/ldmain.c
-+++ binutils/ld/ldmain.c
-@@ -293,2 +293,3 @@ main (int argc, char **argv)
- link_info.combreloc = TRUE;
-+ link_info.relro = TRUE;
- link_info.strip_discarded = TRUE;
--- /dev/null
+*** ../binutils-2.20.51.0.10.orig/bfd/merge.c 2010-08-20 12:19:33.000000000 +0100
+--- bfd/merge.c 2010-08-20 12:18:01.000000000 +0100
+*************** sec_merge_emit (bfd *abfd, struct sec_me
+*** 307,312 ****
+--- 307,315 ----
+ len = -off & (entry->alignment - 1);
+ if (len != 0)
+ {
++ /* We should never have an entry with an alignment
++ greater than the section's alignment. */
++ BFD_ASSERT (len <= (bfd_size_type) (1 << alignment_power));
+ if (bfd_bwrite (pad, len, abfd) != len)
+ goto err;
+ off += len;
+*************** sec_merge_emit (bfd *abfd, struct sec_me
+*** 324,329 ****
+--- 327,333 ----
+ /* Trailing alignment needed? */
+ off = sec->size - off;
+ if (off != 0
++ && alignment_power
+ && bfd_bwrite (pad, off, abfd) != off)
+ goto err;
+
+++ /dev/null
---- bfd/compress.c.jj 2010-12-24 11:40:19.000000000 +0100
-+++ bfd/compress.c 2011-01-28 15:40:19.869777126 +0100
-@@ -174,7 +174,7 @@ bfd_get_full_section_contents (bfd *abfd
- case COMPRESS_SECTION_NONE:
- if (p == NULL)
- {
-- p = (bfd_byte *) bfd_malloc (sz);
-+ p = (bfd_byte *) bfd_zmalloc (sz);
- if (p == NULL)
- return FALSE;
- }
-@@ -214,7 +214,7 @@ bfd_get_full_section_contents (bfd *abfd
- if (!ret)
- goto fail_compressed;
-
-- uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size);
-+ uncompressed_buffer = (bfd_byte *) bfd_zmalloc (uncompressed_size);
- if (uncompressed_buffer == NULL)
- goto fail_compressed;
-
---- bfd/elfcode.h.jj 2010-12-31 03:43:21.000000000 +0100
-+++ bfd/elfcode.h 2011-01-28 15:34:39.055388479 +0100
-@@ -1158,6 +1158,24 @@ elf_checksum_contents (bfd *abfd,
-
- if (i_shdr.contents)
- (*process) (i_shdr.contents, i_shdr.sh_size, arg);
-+ else
-+ {
-+ asection *sec;
-+
-+ sec = bfd_section_from_elf_index (abfd, count);
-+ if (sec != NULL)
-+ {
-+ if (sec->contents == NULL)
-+ {
-+ /* Force rereading from file. */
-+ sec->flags &= ~SEC_IN_MEMORY;
-+ if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents))
-+ continue;
-+ }
-+ if (sec->contents != NULL)
-+ (*process) (sec->contents, i_shdr.sh_size, arg);
-+ }
-+ }
- }
-
- return TRUE;
--- /dev/null
+diff -rcp ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure
+*** ../binutils-2.20.51.0.7.original/bfd/configure 2010-04-08 14:53:48.000000000 +0100
+--- ./bfd/configure 2010-04-08 14:56:50.000000000 +0100
+*************** fi
+*** 10762,10771 ****
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+--- 10762,10795 ----
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
++ # find out which ABI we are using
++ libsuff=
++ case "$host_cpu" in
++ x86_64*|s390*|powerpc*|ppc*|sparc*)
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *64-bit*)
++ libsuff=64
++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
++ fi
++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++ esac
++
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+diff -rcp ../binutils-2.20.51.0.7.original/binutils/configure ./binutils/configure
+*** ../binutils-2.20.51.0.7.original/binutils/configure 2010-04-08 14:53:45.000000000 +0100
+--- ./binutils/configure 2010-04-08 14:56:21.000000000 +0100
+*************** fi
+*** 10560,10569 ****
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+--- 10560,10593 ----
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
++ # find out which ABI we are using
++ libsuff=
++ case "$host_cpu" in
++ x86_64*|s390*|powerpc*|ppc*|sparc*)
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *64-bit*)
++ libsuff=64
++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
++ fi
++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++ esac
++
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+diff -rcp ../binutils-2.20.51.0.7.original/gas/configure ./gas/configure
+*** ../binutils-2.20.51.0.7.original/gas/configure 2010-04-08 14:53:47.000000000 +0100
+--- ./gas/configure 2010-04-08 14:57:24.000000000 +0100
+*************** fi
+*** 10547,10556 ****
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+--- 10547,10580 ----
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
++ # find out which ABI we are using
++ libsuff=
++ case "$host_cpu" in
++ x86_64*|s390*|powerpc*|ppc*|sparc*)
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *64-bit*)
++ libsuff=64
++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
++ fi
++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++ esac
++
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+diff -rcp ../binutils-2.20.51.0.7.original/gprof/configure ./gprof/configure
+*** ../binutils-2.20.51.0.7.original/gprof/configure 2010-04-08 14:53:45.000000000 +0100
+--- ./gprof/configure 2010-04-08 14:57:50.000000000 +0100
+*************** fi
+*** 10485,10494 ****
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+--- 10485,10518 ----
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
++ # find out which ABI we are using
++ libsuff=
++ case "$host_cpu" in
++ x86_64*|s390*|powerpc*|ppc*|sparc*)
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *64-bit*)
++ libsuff=64
++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
++ fi
++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++ esac
++
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+diff -rcp ../binutils-2.20.51.0.7.original/ld/configure ./ld/configure
+*** ../binutils-2.20.51.0.7.original/ld/configure 2010-04-08 14:53:44.000000000 +0100
+--- ./ld/configure 2010-04-08 14:58:21.000000000 +0100
+*************** fi
+*** 10966,10975 ****
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+--- 10966,10999 ----
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
++ # find out which ABI we are using
++ libsuff=
++ case "$host_cpu" in
++ x86_64*|s390*|powerpc*|ppc*|sparc*)
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *64-bit*)
++ libsuff=64
++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
++ fi
++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++ esac
++
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+Only in .: .#libtool.m4
+Only in .: #libtool.m4#
+diff -rcp ../binutils-2.20.51.0.7.original/opcodes/configure ./opcodes/configure
+*** ../binutils-2.20.51.0.7.original/opcodes/configure 2010-04-08 14:53:45.000000000 +0100
+--- ./opcodes/configure 2010-04-08 14:59:10.000000000 +0100
+*************** fi
+*** 10496,10505 ****
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+--- 10496,10529 ----
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
++ # find out which ABI we are using
++ libsuff=
++ case "$host_cpu" in
++ x86_64*|s390*|powerpc*|ppc*|sparc*)
++ echo 'int i;' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *64-bit*)
++ libsuff=64
++ if test x"$sys_lib_search_path_spec" = x"/lib /usr/lib /usr/local/lib"; then
++ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
++ fi
++ sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++ esac
++
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+! sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
--- /dev/null
+diff -rcp ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure
+*** ../binutils-2.20.51.0.7.original/bfd/configure 2010-04-08 15:23:58.000000000 +0100
+--- ./bfd/configure 2010-04-08 15:24:06.000000000 +0100
+*************** if test "x${ac_cv_sizeof_long}" = "x8";
+*** 12819,12829 ****
+ BFD_HOST_64BIT_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
+! elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
+ BFD_HOST_64BIT_LONG_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
+! if test "x${ac_cv_sizeof_void_p}" = "x8"; then
+ BFD_HOSTPTR_T="unsigned long long"
+ fi
+ fi
+--- 12819,12831 ----
+ BFD_HOST_64BIT_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
+! fi
+! if test "x${ac_cv_sizeof_long_long}" = "x8"; then
+ BFD_HOST_64BIT_LONG_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
+! if test "x${ac_cv_sizeof_void_p}" = "x8" \
+! -a "x${ac_cv_sizeof_long}" != "x8"; then
+ BFD_HOSTPTR_T="unsigned long long"
+ fi
+ fi
+diff -rcp ../binutils-2.20.51.0.7.original/bfd/configure.in ./bfd/configure.in
+*** ../binutils-2.20.51.0.7.original/bfd/configure.in 2010-04-08 15:23:58.000000000 +0100
+--- ./bfd/configure.in 2010-04-08 15:24:06.000000000 +0100
+*************** if test "x${ac_cv_sizeof_long}" = "x8";
+*** 153,163 ****
+ BFD_HOST_64BIT_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
+! elif test "x${ac_cv_sizeof_long_long}" = "x8"; then
+ BFD_HOST_64BIT_LONG_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
+! if test "x${ac_cv_sizeof_void_p}" = "x8"; then
+ BFD_HOSTPTR_T="unsigned long long"
+ fi
+ fi
+--- 153,165 ----
+ BFD_HOST_64BIT_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long"
+! fi
+! if test "x${ac_cv_sizeof_long_long}" = "x8"; then
+ BFD_HOST_64BIT_LONG_LONG=1
+ test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long"
+ test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long"
+! if test "x${ac_cv_sizeof_void_p}" = "x8" \
+! -a "x${ac_cv_sizeof_long}" != "x8"; then
+ BFD_HOSTPTR_T="unsigned long long"
+ fi
+ fi
+++ /dev/null
-textrels are bad for forcing copy-on-write (this affects everyone),
-and for security/runtime code generation, this affects security ppl.
-But in either case, it doesn't matter who needs textrels, it's
-the very fact that they're needed at all.
-
-2006-06-10 Ned Ludd <solar@gentoo.org>, Mike Frysinger <vapier@gentoo.org>
-
- * bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs.
- * ld/ldmain.c (main): Change textrel warning default to true.
- * ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL
- warnings from ld output.
-
---- a/bfd/elflink.c
-+++ b/bfd/elflink.c
-@@ -8652,14 +8652,12 @@ bfd_elf_final_link (bfd *abfd, struct bf
- goto error_return;
-
- /* Check for DT_TEXTREL (late, in case the backend removes it). */
-- if ((info->warn_shared_textrel && info->shared)
-+ o = bfd_get_section_by_name (dynobj, ".dynamic");
-+ if ((info->warn_shared_textrel && o != NULL)
- || info->error_textrel)
- {
- bfd_byte *dyncon, *dynconend;
-
- /* Fix up .dynamic entries. */
-- o = bfd_get_section_by_name (dynobj, ".dynamic");
-- BFD_ASSERT (o != NULL);
--
- dyncon = o->contents;
- dynconend = o->contents + o->size;
- for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
-@@ -8702,7 +8702,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
- (_("%P%X: read-only segment has dynamic relocations.\n"));
- else
- info->callbacks->einfo
-- (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
-+ (_("%P: warning: creating a DT_TEXTREL in object.\n"));
- break;
- }
- }
---- a/ld/ldmain.c
-+++ b/ld/ldmain.c
-@@ -282,2 +282,3 @@ main (int argc, char **argv)
- link_info.spare_dynamic_tags = 5;
-+ link_info.warn_shared_textrel = TRUE;
- link_info.sharable_sections = FALSE;
---- a/ld/testsuite/lib/ld-lib.exp
-+++ b/ld/testsuite/lib/ld-lib.exp
-@@ -181,6 +181,10 @@ proc default_ld_simple_link { ld target
- # symbol, since the default linker script might use ENTRY.
- regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
-
-+ # Gentoo tweak:
-+ # We want to ignore TEXTREL warnings since we force enable them by default
-+ regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
-+
- if [string match "" $exec_output] then {
- return 1
- } else {
--- /dev/null
+*** ../binutils-2.22.52.0.1.orig/bfd/Makefile.am 2012-03-06 14:00:33.229957572 +0000
+--- bfd/Makefile.am 2012-04-27 16:46:05.410974817 +0100
+*************** if INSTALL_LIBBFD
+*** 18,24 ****
+ bfdlibdir = @bfdlibdir@
+ bfdincludedir = @bfdincludedir@
+ bfdlib_LTLIBRARIES = libbfd.la
+! bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
+ else !INSTALL_LIBBFD
+ # Empty these so that the respective installation directories will not be created.
+ bfdlibdir =
+--- 18,24 ----
+ bfdlibdir = @bfdlibdir@
+ bfdincludedir = @bfdincludedir@
+ bfdlib_LTLIBRARIES = libbfd.la
+! bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h
+ else !INSTALL_LIBBFD
+ # Empty these so that the respective installation directories will not be created.
+ bfdlibdir =
+*** ../binutils-2.22.52.0.1.orig/bfd/Makefile.in 2012-03-06 14:00:32.952957600 +0000
+--- bfd/Makefile.in 2012-04-27 16:46:19.718975214 +0100
+*************** RECURSIVE_TARGETS = all-recursive check-
+*** 138,144 ****
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+ am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
+! $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
+ HEADERS = $(bfdinclude_HEADERS)
+ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+--- 138,145 ----
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+ am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \
+! $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h \
+! $(INCDIR)/demangle.h
+ HEADERS = $(bfdinclude_HEADERS)
+ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+*************** libbfd_la_LDFLAGS = $(am__append_1) -rel
+*** 331,337 ****
+ @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
+ @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
+ @INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
+! @INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(am__append_2)
+ @INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
+ @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
+ AM_CFLAGS = $(WARN_CFLAGS)
+--- 332,339 ----
+ @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2)
+ @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \
+ @INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
+! @INSTALL_LIBBFD_TRUE@ $(INCDIR)/bfdlink.h $(INCDIR)/demangle.h \
+! @INSTALL_LIBBFD_TRUE@ $(am__append_2)
+ @INSTALL_LIBBFD_FALSE@rpath_bfdlibdir = @bfdlibdir@
+ @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
+ AM_CFLAGS = $(WARN_CFLAGS)
--- /dev/null
+diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/config/default.exp ld/testsuite/config/default.exp
+*** ../binutils-2.22.52.0.1.orig/ld/testsuite/config/default.exp 2012-03-06 14:00:31.141957656 +0000
+--- ld/testsuite/config/default.exp 2012-03-06 14:09:33.492940503 +0000
+***************
+*** 23,29 ****
+ #
+
+ if ![info exists ld] then {
+! set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
+ }
+
+ if ![info exists as] then {
+--- 23,29 ----
+ #
+
+ if ![info exists ld] then {
+! set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro"
+ }
+
+ if ![info exists as] then {
+*************** if {![file isdirectory tmpdir/ld]} then
+*** 69,75 ****
+ catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
+ catch "exec ln -s ld tmpdir/ld/collect-ld" status
+ }
+! set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
+
+ # load the linker path
+ if {[file exists tmpdir/libpath.exp]} {
+--- 69,75 ----
+ catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
+ catch "exec ln -s ld tmpdir/ld/collect-ld" status
+ }
+! set gcc_ld_flag "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
+
+ # load the linker path
+ if {[file exists tmpdir/libpath.exp]} {
+*************** if ![info exists READELFFLAGS] then {
+*** 279,285 ****
+ }
+
+ if ![info exists LD] then {
+! set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
+ }
+
+ if ![info exists LDFLAGS] then {
+--- 279,285 ----
+ }
+
+ if ![info exists LD] then {
+! set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
+ }
+
+ if ![info exists LDFLAGS] then {
+diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp ld/testsuite/ld-bootstrap/bootstrap.exp
+*** ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 14:00:30.503957676 +0000
+--- ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 15:03:33.949837926 +0000
+*************** foreach flags {"" "strip" "--static" "--
+*** 71,77 ****
+
+ # This test can only be run if we have the ld build directory,
+ # since we need the object files.
+! if {$ld != "$objdir/ld-new"} {
+ untested $testname
+ continue
+ }
+--- 71,83 ----
+
+ # This test can only be run if we have the ld build directory,
+ # since we need the object files.
+! set ldexe $ld
+! set ldparm [string first " " $ld]
+! if { $ldparm > 0 } then {
+! set ldparm [expr $ldparm - 1]
+! set ldexe [string range $ld 0 $ldparm]
+! }
+! if {$ldexe != "$objdir/ld-new"} {
+ untested $testname
+ continue
+ }
+*** ../binutils-2.22.52.0.2.orig/ld/emultempl/elf32.em 2012-04-30 16:12:52.642766221 +0100
+--- ld/emultempl/elf32.em 2012-04-30 16:13:13.869766905 +0100
+*************** gld${EMULATION_NAME}_before_parse (void)
+*** 106,111 ****
+--- 106,112 ----
+ input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
+ config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
+ link_info.sharable_sections = `if test "$SHARABLE_SECTIONS" = "yes" ; then echo TRUE ; else echo FALSE ; fi`;
++ link_info.relro = TRUE;
+ }
+
+ EOF
making some of the address matches more flexible fixes tests when using
pax/relro/hash patches
---- binutils/ld/testsuite/ld-i386/hidden2.d
-+++ binutils/ld/testsuite/ld-i386/hidden2.d
-@@ -8,6 +8,6 @@
- Disassembly of section .text:
-
- [a-f0-9]+ <bar>:
--[ ]*[a-f0-9]+: e8 cf fe ff ff call 0 .*
-+[ ]*[a-f0-9]+: e8 ([a-f0-9]{2} ){2}ff ff call 0 .*
- [ ]*[a-f0-9]+: c3 ret
- #pass
---- binutils/ld/testsuite/ld-x86-64/hidden2.d
-+++ binutils/ld/testsuite/ld-x86-64/hidden2.d
-@@ -8,6 +8,6 @@
- Disassembly of section .text:
-
- [a-f0-9]+ <bar>:
--[ ]*[a-f0-9]+: e8 33 fe ff ff callq 0 .*
-+[ ]*[a-f0-9]+: e8 ([a-f0-9]{2} ){2}ff ff callq 0 .*
- [ ]*[a-f0-9]+: c3 retq
- #pass
--- binutils/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d
+++ binutils/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d
@@ -4,6 +4,6 @@
#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */
#define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */
+#define PT_PAX_FLAGS (PT_LOOS + 0x5041580) /* PaX flags */
+ #define PT_GNU_SHR (PT_LOOS + 0x474e554) /* Sharable segment */
/* Program segment permissions, in program header p_flags field. */
-
@@ -439,6 +440,21 @@
#define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
#define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.22/ld/testsuite/ld-i386/tlsdesc.sd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlsdesc.sd
-@@ -14,7 +14,7 @@ Contents of section \.got:
- [0-9a-f]+ 6c000000 b4ffffff 4c000000 68000000 .*
- [0-9a-f]+ 50000000 70000000 00000000 bcffffff .*
- Contents of section \.got\.plt:
-- [0-9a-f]+ b0150000 00000000 00000000 00000000 .*
-+ [0-9a-f]+ [a-f]0150000 00000000 00000000 00000000 .*
- [0-9a-f]+ 20000000 00000000 60000000 00000000 .*
- [0-9a-f]+ 00000000 00000000 00000000 00000000 .*
- [0-9a-f]+ 40000000 +.*
--- binutils-2.22/ld/testsuite/ld-i386/tlsgdesc.rd
+++ binutils-2.22/ld/testsuite/ld-i386/tlsgdesc.rd
@@ -36,12 +36,14 @@ Program Headers:
#...
Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
---- binutils-2.22/ld/testsuite/ld-x86-64/protected3.d
-+++ binutils-2.22/ld/testsuite/ld-x86-64/protected3.d
-@@ -8,6 +8,6 @@
- Disassembly of section .text:
-
- 0+[a-f0-9]+ <bar>:
--[ ]*[a-f0-9]+: 8b 05 [a-f0-9][a-f0-9] 00 [a-f0-9][a-f0-9] 00 mov 0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo>
-+[ ]*[a-f0-9]+: 8b 05 [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] 00 mov 0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo>
- [ ]*[a-f0-9]+: c3 retq
- #pass
--- binutils-2.22/ld/testsuite/ld-x86-64/tlsgdesc.rd
+++ binutils-2.22/ld/testsuite/ld-x86-64/tlsgdesc.rd
@@ -36,12 +36,14 @@ Program Headers: