--- binutils-2.20.1.orig/debian/binutils-multiarch.postrm +++ binutils-2.20.1/debian/binutils-multiarch.postrm @@ -0,0 +1,32 @@ +#! /bin/sh + +set -e + +if [ "$1" = "remove" -o "$1" = "abort-install" ]; then + + for f in size objdump ar strings ranlib objcopy addr2line \ + readelf nm strip gprof; do + dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/bin/$f.single /usr/bin/$f + done + + dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/libbfd-single.a /usr/lib/libbfd.a + dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/libopcodes-single.a /usr/lib/libopcodes.a + +fi + +if [ -e /usr/lib/libbfd-*-multiarch.so.0 ]; then + rm -f /usr/lib/libbfd-*-multiarch.so.0; +fi +if [ -e /usr/lib/libopcodes-*-multiarch.so.0 ]; then + rm -f /usr/lib/libopcodes-*-multiarch.so.0; +fi + +if [ "$1" = "remove" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/binutils-hppa64.postrm +++ binutils-2.20.1/debian/binutils-hppa64.postrm @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ "$1" = "remove" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/test-suite-compare.py +++ binutils-2.20.1/debian/test-suite-compare.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python + +# Quick'n'dirty regression check for dejagnu testsuites +# Copyright (C) 2003, 2004, 2005, 2006, 2007 James Troup + +# 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 of the License, 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;5B 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 + +################################################################################ + +import optparse +import os +import sys + +################################################################################ + +def fubar(msg, exit_code=1): + sys.stderr.write("E: %s\n" % (msg)) + sys.exit(exit_code) + +def warn(msg): + sys.stderr.write("W: %s\n" % (msg)) + +def info(msg): + sys.stderr.write("I: %s\n" % (msg)) + +################################################################################ + +def read_testsummary(filename): + results = {} + file = open(filename) + for line in file.readlines(): + if not line: + continue + if line.startswith("Running"): + s = line.split() + if "/" in s[1]: + x = s[1] + if x.find("/testsuite/") == -1: + fubar("Can't find /testsuite/ in '%s'." % (x)) + # 'Running /home/james/debian/packages/binutils/binutils-2.14.90.0.7/gas/testsuite/gas/hppa/unsorted/unsorted.exp ...' -> 'gas/hppa/unsorted/unsorted.exp' + # ... since using basename() isn't dupe safe. + section = x[x.find("/testsuite/"):].replace("/testsuite/","").split()[0] + + # Tests can be duplicated, e.g. hppa/basic/basic.exp + # is run twice, once for hppa-linux and once for + # hppa64-linux. This is of course a horrible bodge, + # but I can't think of anything trivial and better off + # hand. + + if results.has_key(section): + extra = 1 + too_many = 10 + while results.has_key(section) and extra < too_many: + section = "%s.%s" % (section, extra) + extra += 1 + if extra >= too_many: + fubar("gave up trying to unduplicate %s." % (section)) + + results[section] = {} + continue + + got_state = 0 + for state in [ "PASS", "XPASS", "FAIL", "XFAIL", "UNRESOLVED", + "UNTESTED", "UNSUPPORTED" ]: + if line.startswith(state): + s = line.split(':') + state = s[0] + test = ':'.join(s[1:]).strip() + if results.has_key(test): + warn("%s/%s is duplicated." % (section, test)) + results[section][test] = state + got_state = 1 + break + + if got_state: + continue + + return results + +################################################################################ + +def compare_results(old, new): + total_num = 0 + pass_count = 0 + fail_count = 0 + xfail_count = 0 + untested_count = 0 + regression_count = 0 + progression_count = 0 + change_count = 0 + + for section in new.keys(): + for test in new[section].keys(): + state = new[section][test] + + # Stats pr0n + total_num += 1 + if state == "PASS" or state == "XPASS": + pass_count += 1 + elif state == "FAIL" or state == "UNRESOLVED": + fail_count += 1 + elif state == "XFAIL": + xfail_count += 1 + elif state == "UNTESTED": + untested_count += 1 + + # Compare to old + if not old.has_key(section): + continue + if not old[section].has_key(test): + continue + old_state = old[section][test] + if state == "PASS": + if old_state != "PASS": + progression_count += 1 + info("[%s] progression (%s -> %s): %s" % (section, old_state, state, test)) + elif state == "XPASS": + if old_state != "XPASS" and old_state != "PASS": + progression_count += 1 + warn("[%s] %s: %s" % (section, state, test)) + elif state == "FAIL": + if old_state != "FAIL": + regression_count += 1 + warn("[%s] REGRESSION (%s -> %s): %s" % (section, old_state, state, test)) + elif state == "XFAIL": + if old_state != "XFAIL": + change_count += 1 + info("[%s] change (%s -> %s): %s" % (section, old_state, state, test)) + elif state == "UNRESOLVED": + if old_state != "UNRESOLVED" and old_state != "FAIL": + regression_count += 1 + warn("[%s] REGRESSION (%s -> %s): %s" % (section, old_state, state, test)) + if old_state == "FAIL": + change_count += 1 + info("[%s] change (%s -> %s): %s" % (section, old_state, state, test)) + elif state == "UNTESTED": + if old_state != "UNTESTED": + change_count += 1 + warn("[%s] REGRESSION (%s -> %s): %s" % (section, old_state, state, test)) + + if regression_count: + print "%d REGRESSIONS (%.2f%%)." % (regression_count, (float(regression_count)/total_num)*100) + if progression_count: + print "%d progressions (%.2f%%)." % (progression_count, (float(progression_count)/total_num)*100) + + if change_count: + print "%d changes (%.2f%%)." % (change_count, (float(change_count)/total_num)*100) + + print "%d tests: %d pass (%.2f%%), %d fail (%.2f%%), %d xfail (%.2f%%) %d untested (%.2f%%)." \ + % (total_num, pass_count, (float(pass_count)/total_num)*100, + fail_count, (float(fail_count)/total_num)*100, + xfail_count, (float(xfail_count)/total_num)*100, + untested_count, (float(untested_count)/total_num)*100) + + if regression_count: + sys.exit(1) + +################################################################################ + +def compare_multiple(directory, first_version, second_version): + architectures = [ "alpha", "arm", "hppa", "i386", "ia64", "mips", + "m68k", "mipsel", "powerpc", "s390", "sparc" ] + + for arch in architectures: + print "*********************************** %s ******************************" % (arch) + second_filename = "%s/%s_%s" % (directory, second_version, arch) + if not os.path.exists(second_filename): + print " -- NOT AVAILABLE --" + continue + + new = read_testsummary(second_filename) + first_filename = "%s/%s_%s" % (directory, first_version, arch) + old = read_testsummary(first_filename) + compare_results(old, new) + +################################################################################ + +def init(): + """Initalization, including parsing of options.""" + + usage = """usage: %prog [OPTIONS] +compare (binutils) dejagnu testsuite results. + +Example usage: + + test-suite-compare.py binutils-2.17/test-summary binutils-2.18/test-summary + +Or to compare across all architectures (with test results stored in a +'test-summary' directory): + + test-suite-compare.py -mtest-summary 2.17-3 2.18-1""" + parser = optparse.OptionParser(usage) + parser.add_option("-m", "--multiple", dest="multiple", + nargs=1, type="string", + help="compare multiple architectures") + (options, args) = parser.parse_args() + + if len(args) > 2 or len(args) < 2: + parser.error("takes 2 arguments (old and new)") + (old_version, new_version) = args + + return options, old_version, new_version + +################################################################################ + +def main(): + (options, old_version, new_version) = init() + if options.multiple: + compare_multiple(options.multiple, old_version, new_version) + else: + old = read_testsummary(old_version) + new = read_testsummary(new_version) + compare_results(old, new) + +################################################################################ + +if __name__ == '__main__': + main() --- binutils-2.20.1.orig/debian/binutils-multiarch.preinst +++ binutils-2.20.1/debian/binutils-multiarch.preinst @@ -0,0 +1,82 @@ +#! /bin/sh + +set -e + +if [ install = "$1" -o upgrade = "$1" ]; then + + for f in size objdump ar strings ranlib objcopy addr2line \ + readelf nm strip gprof; do + dpkg-divert --package binutils-multiarch \ + --add --rename \ + --divert /usr/bin/$f.single /usr/bin/$f + done + + dpkg-divert --package binutils-multiarch \ + --add --rename \ + --divert /usr/lib/libbfd-single.a /usr/lib/libbfd.a + dpkg-divert --package binutils-multiarch \ + --add --rename \ + --divert /usr/lib/libopcodes-single.a /usr/lib/libopcodes.a + + if [ -x /usr/bin/ld.single ]; then + rm -f /usr/bin/ld + dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/bin/ld.single /usr/bin/ld \ + | grep -v '^No diversion' || true + fi + +fi + +# remove obsolete diversions +for f in elf32_sparc elf32ppc elf64alpha elf_i386 m68kelf \ + alpha i386linux m68klinux sparclinux sun4; do + for ext in x xbn xn xr xs xu; do + dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/ldscripts/$f.$ext.single \ + /usr/lib/ldscripts/$f.$ext \ + | grep -v '^No diversion' || true + done +done +dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/libbfd-single-2.9.1.0.15.so.0.0.0 \ + /usr/lib/libbfd-2.9.1.0.15.so.0.0.0 \ + | grep -v '^No diversion' || true +dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/libopcodes-single-2.9.1.0.15.so.0.0.0 \ + /usr/lib/libopcodes-2.9.1.0.15.so.0.0.0 \ + | grep -v '^No diversion' || true +dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/libbfd-single.la \ + /usr/lib/libbfd.la \ + | grep -v '^No diversion' || true +dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/libopcodes-single.la \ + /usr/lib/libopcodes.la \ + | grep -v '^No diversion' || true +dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/include/bfd.single.h /usr/include/bfd.h \ + | grep -v '^No diversion' || true +dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/lib/ldscripts.single /usr/lib/ldscripts \ + | grep -v '^No diversion' || true +if [ -e /usr/bin/c++filt.single ]; then +dpkg-divert --package binutils-multiarch \ + --remove --rename \ + --divert /usr/bin/c++filt.single /usr/bin/c++filt \ + | grep -v '^No diversion' || true +fi + +if [ -e /usr/lib/libbfd-*-multiarch.so.0 ]; then + rm -f libbfd-*-multiarch.so.0; +fi +if [ -e /usr/lib/libopcodes-*-multiarch.so.0 ]; then + rm -f libopcodes-*-multiarch.so.0; +fi --- binutils-2.20.1.orig/debian/binutils.overrides +++ binutils-2.20.1/debian/binutils.overrides @@ -0,0 +1,2 @@ +# the API of the shared libs is not public, don't care about the name +binutils binary: package-name-doesnt-match-sonames --- binutils-2.20.1.orig/debian/binutils.postinst +++ binutils-2.20.1/debian/binutils.postinst @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ "$1" = "configure" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/control.static +++ binutils-2.20.1/debian/control.static @@ -0,0 +1,18 @@ + +Package: binutils-static +Architecture: any +Depends: ${shlibs:Depends} +Description: statically linked binutils tools + This package contains statically linked binutils tools used + for linking kernel modules needed to mount /usr or /. At the moment, + it only contains ld. + +Package: binutils-static-udeb +Section: debian-installer +Architecture: any +Depends: ${shlibs:Depends} +Description: statically linked binutils tools for for the Debian installer + This package contains statically linked binutils tools used + for linking kernel modules needed to mount /usr or /. At the moment, + it only contains ld. + --- binutils-2.20.1.orig/debian/control +++ binutils-2.20.1/debian/control @@ -0,0 +1,121 @@ +Source: binutils +Section: devel +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Matthias Klose +Uploaders: James Troup +Standards-Version: 3.8.4 +Build-Depends: dpkg-dev (>= 1.13.9), autoconf (>= 2.64), bison, flex, gettext, texinfo, gcc (>= 4:4.2.2), dejagnu (>= 1.4.2-1.1), dpatch, file, bzip2, lsb-release, zlib1g-dev, gcc-4.4 (>= 4.4.2-1) + +Package: binutils +Architecture: any +Depends: ${shlibs:Depends} +Conflicts: gas, elf-binutils, modutils (<< 2.4.19-1), ${extraConflicts} +Provides: elf-binutils +Suggests: binutils-doc (>= ${source:Version}) +Replaces: binutils-gold (<< 2.20-5) +Description: The GNU assembler, linker and binary utilities + The programs in this package are used to assemble, link and manipulate + binary and object files. They may be used in conjunction with a compiler + and various libraries to build programs. + +Package: binutils-dev +Architecture: any +Priority: extra +Depends: binutils (= ${binary:Version}) +Conflicts: libbfd-dev +Provides: libbfd-dev +Replaces: libbfd-dev, libc5-dev +Description: The GNU binary utilities (BFD development files) + This package includes header files and static libraries necessary to build + programs which use the GNU BFD library, which is part of binutils. Note + that building Debian packages which depend on the shared libbfd is Not + Allowed. + +Package: binutils-multiarch +Architecture: any +Priority: extra +Depends: ${shlibs:Depends}, binutils (= ${binary:Version}) +Provides: multiarch-binutils +Description: Binary utilities that support multi-arch targets + The programs in this package are used to manipulate binary and object + files that may have been created on other architectures. This package + is primarily for multi-architecture developers and cross-compilers and + is not needed by normal users or developers. Note that a cross-assembling + version of gas is not included in this package, just the binary utilities. + NORMAL USERS SHOULD NOT INSTALL THIS PACKAGE. It's meant only for those + requiring support for reading info from binaries from other architectures. + +Package: binutils-gold +Architecture: amd64 armel i386 lpia sparc +Priority: extra +Depends: ${shlibs:Depends}, binutils (= ${binary:Version}) +Description: The (experimental) GNU gold linker utility + Gold is a new linker, still in development, which is faster than the + current linker included in binutils. It currently fails to link some + applications and libraries (i.e. won't link usable kernels). + . + This package diverts the GNU linker (ld) with the experimental gold + linker. + +Package: binutils-static +Architecture: any +Description: statically linked binutils tools + This package contains statically linked binutils tools used + for linking kernel modules needed to mount /usr or /. At the moment, + it only contains ld. + +Package: binutils-static-udeb +Section: debian-installer +Architecture: any +Description: statically linked binutils tools for for the Debian installer + This package contains statically linked binutils tools used + for linking kernel modules needed to mount /usr or /. At the moment, + it only contains ld. + +Package: binutils-hppa64 +Architecture: hppa +Depends: ${shlibs:Depends}, binutils (= ${binary:Version}) +Recommends: libc6-dev +Suggests: binutils-doc (>= ${source:Version}) +Description: The GNU assembler, linker and binary utilities targeted for hppa64-linux + The programs in this package are used to assemble, link and manipulate + binary and object files. They may be used in conjunction with a compiler + and various libraries to build programs. + . + This package is needed to build an 64-bit kernel for 64-bit hppa machines. + +Package: binutils-spu +Architecture: powerpc ppc64 +Depends: ${shlibs:Depends}, binutils (= ${binary:Version}) +Recommends: libc6-dev +Conflicts: spu-binutils +Replaces: spu-binutils +Provides: spu-binutils +Suggests: binutils-doc (>= ${source:Version}) +Description: The GNU assembler, linker and binary utilities targeted for spu-elf + The programs in this package are used to assemble, link and manipulate + binary and object files. They may be used in conjunction with a compiler + and various libraries to build programs. + . + This package is needed to build programs for Cell Broadband Engine SPU + processors. + +Package: binutils-doc +Section: doc +Architecture: all +Priority: optional +Depends: dpkg (>= 1.15.4) | install-info +Conflicts: binutils (<< 2.9.1.0.25-3) +Suggests: binutils (= ${binary:Version}) +Description: Documentation for the GNU assembler, linker and binary utilities + This package consists of the documentation for the GNU assembler, + linker and binary utilities in info format. + +Package: binutils-source +Architecture: all +Priority: optional +Depends: texinfo, zlib1g-dev +Description: The GNU assembler, linker and binary utilities (source) + This package contains the sources and patches which are needed to + build binutils. --- binutils-2.20.1.orig/debian/binutils-gold.preinst +++ binutils-2.20.1/debian/binutils-gold.preinst @@ -0,0 +1,21 @@ +#! /bin/sh + +set -e + +if [ install = "$1" -o upgrade = "$1" ]; then + if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.20-3; then + case "$(dpkg-divert --list /usr/bin/ld)" in + *ld.single*) + rm -f /usr/bin/ld + dpkg-divert \ + --package binutils-gold \ + --remove --rename \ + --divert /usr/bin/ld.single /usr/bin/ld + esac + fi + + dpkg-divert \ + --package binutils-gold \ + --add --rename \ + --divert /usr/bin/ld.bfd-link /usr/bin/ld +fi --- binutils-2.20.1.orig/debian/binutils-hppa64.postinst +++ binutils-2.20.1/debian/binutils-hppa64.postinst @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ "$1" = "configure" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/binutils-static.preinst +++ binutils-2.20.1/debian/binutils-static.preinst @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ -L /usr/share/doc/binutils-static ]; then + # We must be upgrading from a version that depended on binutils + rm -f /usr/share/doc/binutils-static +fi + +exit 0 --- binutils-2.20.1.orig/debian/binutils-spu.postrm +++ binutils-2.20.1/debian/binutils-spu.postrm @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ "$1" = "remove" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/binutils-gold.overrides +++ binutils-2.20.1/debian/binutils-gold.overrides @@ -0,0 +1,5 @@ +# don't warn about missing man pages for diverted binaries +binutils-gold binary: binary-without-manpage + +# the API of the shared libs is not public, don't care about the name +binutils-multiarch binary: package-name-doesnt-match-sonames --- binutils-2.20.1.orig/debian/binutils-multiarch.postinst +++ binutils-2.20.1/debian/binutils-multiarch.postinst @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ "$1" = "configure" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/binutils-spu.shlibs +++ binutils-2.20.1/debian/binutils-spu.shlibs @@ -0,0 +1,2 @@ +libbfd 2.20.1-spu.20100303 binutils-spu (>= 2.20.1), binutils-spu (<< 2.20.2) +libopcodes 2.20.1-spu.20100303 binutils-spu (>= 2.20.1), binutils-spu (<< 2.20.2) --- binutils-2.20.1.orig/debian/binutils-spu.overrides +++ binutils-2.20.1/debian/binutils-spu.overrides @@ -0,0 +1,8 @@ +# don't warn about missing man pages for diverted binaries +binutils-spu binary: binary-without-manpage + +# the API of the shared libs is not public, don't care about the name +binutils-spu binary: package-name-doesnt-match-sonames + +# it's a cross toolchain +binutils-spu binary: binary-or-shlib-defines-rpath --- binutils-2.20.1.orig/debian/README.cross +++ binutils-2.20.1/debian/README.cross @@ -0,0 +1,22 @@ +Cross-binutils debian packages can be built directly from the binutils +source package. + +To build a cross-binutils package: + + o Download and unpack the binutils source package: + + apt-get source binutils + + o Ensure you have the binutils build-dependencies installed: + + apt-get build-dep binutils + + o Then build the cross-binutils package: + + TARGET= fakeroot debian/rules binary-cross + + (substitute your target name, e.g. "arm" or "m68k", instead of + "") + +--- +Nikita Youshchenko --- binutils-2.20.1.orig/debian/control.cross.in +++ binutils-2.20.1/debian/control.cross.in @@ -0,0 +1,11 @@ +Package: binutils-__TARGET__ +Architecture: any +Depends: binutils, ${shlibs:Depends} +Suggests: binutils-doc (= ${Source-Version}) +Priority: extra +Description: The GNU binary utilities, for __TARGET__ target + This package provides GNU assembler, linker and binary utilities + for __TARGET__ target, for use in a cross-compilation environment. + . + You don't need this package unless you plan to cross-compile programs + for __TARGET__. --- binutils-2.20.1.orig/debian/binutils.postrm +++ binutils-2.20.1/debian/binutils.postrm @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ "$1" = "remove" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/binutils-hppa64.overrides +++ binutils-2.20.1/debian/binutils-hppa64.overrides @@ -0,0 +1,8 @@ +# don't warn about missing man pages for diverted binaries +binutils-hppa64 binary: binary-without-manpage + +# the API of the shared libs is not public, don't care about the name +binutils-hppa64 binary: package-name-doesnt-match-sonames + +# it's a cross toolchain +binutils-hppa64 binary: binary-or-shlib-defines-rpath --- binutils-2.20.1.orig/debian/binutils-spu.postinst +++ binutils-2.20.1/debian/binutils-spu.postinst @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ "$1" = "configure" ]; then + ldconfig +fi --- binutils-2.20.1.orig/debian/binutils.shlibs +++ binutils-2.20.1/debian/binutils.shlibs @@ -0,0 +1,2 @@ +libbfd 2.20.1-system.20100303 binutils (>= 2.20.1-3ubuntu2), binutils (<< 2.20.2) +libopcodes 2.20.1-system.20100303 binutils (>= 2.20.1-3ubuntu2), binutils (<< 2.20.2) --- binutils-2.20.1.orig/debian/rules.orig +++ binutils-2.20.1/debian/rules.orig @@ -0,0 +1,1131 @@ +#!/usr/bin/make -f +# debian/rules file - for binutils (2.20) +# Based on sample debian/rules file - for GNU Hello (1.3). +# Copyright 1994,1995 by Ian Jackson. +# Copyright 1998-2007 James Troup. +# Portions Copyright 2008-2009 Canonical Ltd. +# Portions Copyright 2008-2009 Matthias Klose. +# I hereby give you perpetual unlimited permission to copy, +# modify and relicense this file, provided that you do not remove +# my name from the file itself. (I assert my moral right of +# paternity under the Copyright, Designs and Patents Act 1988.) +# This file may have to be extensively modified + +################################################################################ + +include /usr/share/dpatch/dpatch.make + +################################################################################ + +p_bin = binutils +p_dev = $(p_bin)-dev +p_mul = $(p_bin)-multiarch +p_gold = $(p_bin)-gold +p_doc = $(p_bin)-doc +p_static = $(p_bin)-static +p_udeb = $(p_static)-udeb +p_hppa64 = $(p_bin)-hppa64 +p_spu = $(p_bin)-spu +p_src = $(p_bin)-source + +pwd := $(shell pwd) +d = debian/tmp +d_bin = $(d) +d_dev = debian/$(p_dev) +d_mul = debian/$(p_mul) +d_gold = debian/$(p_gold) +d_doc = debian/$(p_doc) +d_static = debian/$(p_static) +d_udeb = debian/$(p_udeb) +d_hppa64 = debian/$(p_hppa64) +d_spu = debian/$(p_spu) +d_src = debian/$(p_src) + +install_dir = install -d -m 755 +install_file = install -m 644 +install_script = install -m 755 +install_binary = install -m 755 -s + +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +SHELL = /bin/bash + +#ifneq (,$(filter $(DEB_HOST_ARCH), amd64 armel i386 lpia powerpc sparc)) +ifneq (,$(filter $(DEB_HOST_ARCH), amd64 armel i386 lpia sparc)) + with_gold = yes +endif + +with_multiarch := yes +with_static := yes + +CC = gcc +CXX = g++ +CFLAGS = -g -O2 -Wno-format-security +STRIP = strip --remove-section=.comment --remove-section=.note +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + CC = $(DEB_HOST_GNU_TYPE)-gcc + CXX = $(DEB_HOST_GNU_TYPE)-g++ +endif + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS = -g -O0 -Wno-format-security +endif + +# see LP: #446478, would only fix the testcases +#ifeq ($(DEB_HOST_ARCH),armel) +# CFLAGS += -fno-section-anchors +#endif + +ifeq ($(DEB_HOST_ARCH),armel) + CFLAGS += -marm +endif + +DEB_VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 | sed 's/.*://') +STATIC_UDEB = $(p_udeb)_$(DEB_VERSION)_$(DEB_HOST_ARCH).udeb + +VERSION = $(shell sed -n 's/^ *VERSION=\(.*\)/\1/p' bfd/configure | head -1) +MULTI_VERSION = $(VERSION)-multiarch +HPPA64_VERSION= $(VERSION)-hppa64 +SPU_VERSION = $(VERSION)-spu + +DISTRIBUTION := $(shell lsb_release -is) +NJOBS = +# Support parallel= in DEB_BUILD_OPTIONS (see #209008) +SPACE = $(EMPTY) $(EMPTY) +COMMA = , +ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) + NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) +endif +ifneq (,$(findstring nogold,$(DEB_BUILD_OPTIONS))) + with_gold = disabled in DEB_BUILD_OPTIONS +endif +ifneq (,$(findstring nostat,$(DEB_BUILD_OPTIONS))) + with_static = disabled in DEB_BUILD_OPTIONS +endif +ifneq (,$(findstring nomult,$(DEB_BUILD_OPTIONS))) + with_multiarch = disabled in DEB_BUILD_OPTIONS +endif + +######################################## + +CONFARGS = \ + --enable-shared \ + --enable-plugins \ + --prefix=/usr \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_HOST_GNU_TYPE) \ + --with-pkgversion="GNU Binutils for $(DISTRIBUTION)" + +ifeq ($(DEB_HOST_ARCH),sparc) + CONFARGS += --enable-targets=sparc64-linux-gnu + CONFLICTS = -VextraConflicts="libc6-dev-sparc64 (<< 2.2.5-7)" +endif +ifeq ($(DEB_HOST_ARCH),sparc64) + CONFARGS += --enable-targets=sparc-linux-gnu + CONFLICTS = -VextraConflicts="libc6-dev-sparc64 (<< 2.2.5-7)" +endif +ifeq ($(DEB_HOST_ARCH),powerpc) + CONFARGS += --enable-targets=powerpc64-linux-gnu,spu +endif +ifeq ($(DEB_HOST_ARCH),ppc64) + CONFARGS += --enable-targets=powerpc-linux-gnu,spu +endif +ifeq ($(DEB_HOST_ARCH),s390) + CONFARGS += --enable-targets=s390x-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),i386) + CONFARGS += --enable-targets=x86_64-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),kfreebsd-i386) + CONFARGS += --enable-targets=x86_64-kfreebsd-gnu +endif +ifeq ($(DEB_HOST_ARCH),mips) + CONFARGS += --enable-targets=mips64-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),mipsel) + CONFARGS += --enable-targets=mips64el-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),ia64) + CONFARGS += --disable-werror +endif + +with_check := yes +ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + with_check := disabled through DEB_BUILD_OPTIONS +endif +ifneq (,$(filter $(DEB_HOST_ARCH),hppa)) + with_check := disabled for architecture $(DEB_HOST_ARCH) +endif +ifneq (,$(filter $(DEB_HOST_ARCH), armel mips mipsel)) + ignore_regressions := regressions ignored on architecture $(DEB_HOST_ARCH) +endif +with_strip := yes +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + with_strip := disabled through DEB_BUILD_OPTIONS +endif + +source_files = $(addprefix $(shell basename $(pwd))/, \ + $(filter-out %-stamp CVS debian builddir-% test-summary, $(wildcard *))) + +################################################################################ + +################ +# clean target # +################ + +clean: unpatch + $(checkdir) + -rm -fr builddir-multi builddir-single builddir-hppa64 builddir-spu builddir-gold + -find . -name \*.gmo -o -name \*~ -o -name \*.info ! -name sysroff.info | xargs rm -f + -rm -f $(pwd)/test-summary* + -rm -fr $(d_bin) $(d_dev) $(d_mul) $(d_doc) $(d_hppa64) $(d_src) $(d_spu) $(d_gold) + -rm -fr builddir-static + -rm -fr $(d_static) $(d_udeb) + -rm -rf debian/patched debian/tmp debian/files* debian/substvars + chmod 644 debian/patches/*.dpatch + -rm -f *-stamp + +################################################################################ + +####################### +# single-arch targets # +####################### + +SINGLE_CONFARGS = $(CONFARGS) +ifeq ($(with_gold),yes) + SINGLE_CONFARGS += --enable-gold=both +endif + +configure-single-stamp: patch-stamp + $(checkdir) + +ifeq ($(with_check),yes) + @if echo "spawn true" | /usr/bin/expect -f - >/dev/null; then \ + : ; \ + else \ + echo "expect is failing on your system with the above error, which means the"; \ + echo "testsuite will fail. Please resolve the above issues and retry the build."; \ + echo "-----------------------------------------------------------------------------"; \ + exit 1; \ + fi +endif + + rm -rf configure-single-stamp \ + builddir-single + mkdir builddir-single + cd builddir-single && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" \ + ../configure $(SINGLE_CONFARGS) + $(MAKE) -C builddir-single configure-host + touch configure-single-stamp + +build-single-stamp: configure-single-stamp + $(checkdir) + $(MAKE) -C builddir-single/bfd headers + $(MAKE) $(NJOBS) -C builddir-single +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +ifeq ($(with_check),yes) + -$(MAKE) -C builddir-single -k check + cat builddir-single/binutils/binutils.sum \ + builddir-single/gas/testsuite/gas.sum \ + builddir-single/ld/ld.sum >> $(pwd)/test-summary + set -e; \ + if [ -x /usr/bin/python ]; then \ + echo "Test results, compared with installed binutils:"; \ + zcat /usr/share/doc/binutils/test-summary.gz > test-summary-installed; \ + if python debian/test-suite-compare.py test-summary-installed test-summary; then \ + : ; \ + elif [ -n "$(ignore_regressions)" ]; then \ + echo "$(ignore_regressions)"; \ + else \ + false; \ + fi; \ + else \ + echo "python not installed, not comparing test results."; \ + fi +endif +endif + touch build-single-stamp + +################################################################################ + +####################### +# gold-arch targets # +####################### + +GOLD_CONFARGS = --enable-gold +ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386)) + GOLD_CONFARGS += --enable-targets=i486-linux-gnu,x86_64-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),powerpc) + GOLD_CONFARGS += --enable-targets=powerpc-linux-gnu +endif + +configure-gold-stamp: patch-stamp + $(checkdir) + rm -rf configure-gold-stamp \ + builddir-gold + mkdir builddir-gold + cd builddir-gold && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS) -Wno-error" \ + ../configure $(CONFARGS) $(GOLD_CONFARGS) + $(MAKE) -C builddir-gold configure-host + touch configure-gold-stamp + +build-gold-stamp: configure-gold-stamp + $(checkdir) + $(MAKE) -C builddir-gold/bfd headers + $(MAKE) $(NJOBS) -C builddir-gold +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +ifeq ($(with_check),yes) + -$(MAKE) $(NJOBS) -C builddir-gold/testsuite \ + && ( \ + $(MAKE) -C builddir-gold/gold -k check \ + && echo "XXX gold subdir check" \ + && $(MAKE) -C builddir-gold/gold/testsuite -k check) +endif +endif + touch build-gold-stamp + +################################################################################ + +##################### +# multiarch targets # +##################### + +multiarch_targets = \ + alpha-linux-gnu \ + arm-linux-gnu \ + armel-linux-gnu \ + hppa-linux-gnu \ + i486-gnu \ + i486-linux-gnu \ + ia64-linux-gnu \ + m68k-linux-gnu \ + m68k-rtems \ + mips-linux-gnu \ + mipsel-linux-gnu \ + mips64-linux-gnu \ + mips64el-linux-gnu \ + powerpc-linux-gnu \ + powerpc64-linux-gnu \ + s390-linux-gnu \ + s390x-linux-gnu \ + sh-linux-gnu \ + sh64-linux-gnu \ + sparc-linux-gnu \ + sparc64-linux-gnu \ + x86_64-linux-gnu \ + m32r-linux-gnu \ + spu + +configure-multi-stamp: patch-stamp + $(checkdir) + rm -rf configure-multi-stamp \ + builddir-multi + mkdir builddir-multi + cd builddir-multi \ + && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" ../configure $(CONFARGS) \ + --enable-targets=$(subst $(SPACE),$(COMMA),$(multiarch_targets)) + $(MAKE) -C builddir-multi configure-host + touch configure-multi-stamp + +build-multi-stamp: configure-multi-stamp + $(checkdir) + $(MAKE) -C builddir-multi/bfd headers + env MAKE="$(MAKE) VERSION=$(MULTI_VERSION)" \ + $(MAKE) $(NJOBS) -C builddir-multi + touch build-multi-stamp + +################################################################################ + +################# +# static target # +################# + +configure-static-stamp: patch-stamp + $(checkdir) + rm -rf configure-static-stamp \ + builddir-static + mkdir builddir-static + cd builddir-static \ + && env CC="$(CC)" CXX="$(CXX)" CFLAGS="-g0 -Os" ../configure \ + --prefix=/usr \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_HOST_GNU_TYPE) \ + --with-pkgversion="GNU Binutils for $(DISTRIBUTION)" + $(MAKE) -C builddir-static configure-bfd + $(MAKE) -C builddir-static configure-ld + touch configure-static-stamp + +build-static-stamp: configure-static-stamp + $(checkdir) + $(MAKE) $(NJOBS) -C builddir-static/libiberty CCLD='$(CC) -all-static' + $(MAKE) $(NJOBS) -C builddir-static/bfd CCLD='$(CC) -all-static' + $(MAKE) $(NJOBS) -C builddir-static/ld CCLD='$(CC) -all-static' + touch build-static-stamp + +################################################################################ + +################# +# hppa64 target # +################# + +configure-hppa64-stamp: patch-stamp + $(checkdir) + rm -rf configure-hppa64-stamp \ + builddir-hppa64 + mkdir builddir-hppa64 + cd builddir-hppa64 \ + && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" ../configure \ + --enable-shared \ + --prefix=/usr \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_BUILD_GNU_TYPE) \ + --target=hppa64-linux-gnu + $(MAKE) -C builddir-hppa64 configure-host + touch configure-hppa64-stamp + +build-hppa64-stamp: configure-hppa64-stamp + $(checkdir) + $(MAKE) -C builddir-hppa64/bfd headers + env MAKE="$(MAKE) VERSION=$(HPPA64_VERSION)" \ + $(MAKE) $(NJOBS) -C builddir-hppa64 + touch build-hppa64-stamp + +################################################################################ + +############## +# spu target # +############## + +configure-spu-stamp: patch-stamp + $(checkdir) + rm -rf configure-spu-stamp \ + builddir-spu + mkdir builddir-spu + cd builddir-spu \ + && env CC="$(CC)" CFLAGS="$(CFLAGS)" ../configure \ + --enable-shared \ + --prefix=/usr \ + --program-prefix=spu- \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_BUILD_GNU_TYPE) \ + --target=spu-elf + $(MAKE) -C builddir-spu configure-host + touch configure-spu-stamp + +build-spu-stamp: configure-spu-stamp + $(checkdir) + $(MAKE) -C builddir-spu/bfd headers + env MAKE="$(MAKE) VERSION=$(SPU_VERSION)" \ + $(MAKE) $(NJOBS) -C builddir-spu + touch build-spu-stamp + +################################################################################ + +pre-build: +#ifneq (,$(filter $(DEB_HOST_ARCH), armel i386 amd64)) +# @echo Build it ... +#else +# @echo Explicitely fail the build for architecture $(DEB_HOST_ARCH) +# false +#endif + +build_stamps = build-single-stamp +ifeq ($(with_multiarch),yes) + build_stamps += build-multi-stamp +endif +ifeq ($(DEB_HOST_ARCH),hppa) + build_stamps += build-hppa64-stamp +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + build_stamps += build-spu-stamp +endif +#ifeq ($(with_gold),yes) +# build_stamps += build-gold-stamp +#endif +ifeq ($(with_static),yes) + build_stamps += build-static-stamp +endif +build: pre-build build-stamp +build-stamp: $(build_stamps) + touch build-stamp + +################################################################################ + +################## +# install target # +################## + +install_stamps = install-stamp +ifeq ($(DEB_HOST_ARCH),hppa) + install_stamps += install-hppa64-stamp +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + install_stamps += install-spu-stamp +endif +#ifeq ($(with_gold),yes) +# install_stamps += install-gold-stamp +#endif +ifeq ($(with_static),yes) + install_stamps += install-static-stamp +endif +install: $(install_stamps) +install-stamp: checkroot build-stamp + $(checkdir) + + rm -fr $(d_bin) $(d_dev) $(d_mul) $(d_doc) $(d_src) + $(install_dir) $(d_bin) $(d_dev) $(d_mul) $(d_doc) $(d_src) + + : # install binutils and -dev stuff + $(MAKE) -C builddir-single \ + CFLAGS="$(CFLAGS)" prefix=$(pwd)/$(d_bin)/usr \ + mandir=$(pwd)/$(d_bin)/usr/share/man \ + infodir=$(pwd)/$(d_doc)/usr/share/info install + +ifeq ($(with_multiarch),yes) + : # now install binutils-multiarch stuff + env MAKE="$(MAKE) VERSION=$(MULTI_VERSION)" \ + $(MAKE) -C builddir-multi \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_mul)/usr \ + mandir=$(pwd)/$(d_mul)/usr/share/man \ + infodir=$(pwd)/$(d_doc)/usr/share/info install +endif + + : # copy libiberty.h ... not too keen on this, but it was requested + cp -f include/libiberty.h $(d_bin)/usr/include + + : # copy demangle.h ... not too keen on this, but it was requested + cp -f include/demangle.h $(d_bin)/usr/include + + : # We don't need to distribute everything in binutils and -dev + rm -rf $(d_bin)/usr/include/obstack.h + rm -f $(d_bin)/usr/man/man1/configure.1 + rm -f $(d_doc)/usr/share/info/configure.* $(d_doc)/usr/share/info/standards.* + : # *sigh*, bugs.debian.org/213524 + rm -f $(d_doc)/usr/share/info/dir* + +ifeq ($(with_multiarch),yes) + : # Now get rid of just about everything in binutils-multiarch + rm -rf $(d_mul)/usr/man $(d_mul)/usr/info $(d_mul)/usr/include + rm -rf $(d_mul)/usr/share/man $(d_mul)/usr/share/info $(d_mul)/usr/share/locale + + : # Get rid of ld for the time being since it's suddenly unhappy when + : # linking kernels. Also get rid of the ldscripts for good measure. + rm -f $(d_mul)/usr/bin/as $(d_mul)/usr/bin/gasp $(d_mul)/usr/bin/c++filt \ + $(d_mul)/usr/bin/ld + rm -rf $(d_mul)/usr/lib/ldscripts + ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + rm -f $(d_mul)/usr/bin/embedspu + endif +endif + + $(install_dir) $(d_dev)/usr/include/ $(d_dev)/usr/lib/ + mv $(d_bin)/usr/include/* $(d_dev)/usr/include/ + mv $(d_bin)/usr/lib/*.a $(d_bin)/usr/lib/libbfd.so $(d_bin)/usr/lib/libopcodes.so \ + $(d_dev)/usr/lib/ + +ifeq ($(with_multiarch),yes) + rm -f $(d_mul)/usr/lib/libbfd.so $(d_mul)/usr/lib/libopcodes.so + rm -f $(d_mul)/usr/lib/*.la $(d_mul)/usr/lib/*.a + rm -f $(d_mul)/usr/lib*/libiberty* +endif + + : # Get rid of .la files since libtool obviously has no idea about transient paths + rm -f $(d_bin)/usr/lib/*.la + +ifeq ($(with_strip),yes) + : # Strip shared libraries + pkg_create_dbgsym $(p_bin) $(d_bin) || true + $(STRIP) --strip-unneeded $(d_bin)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_bin)/usr/lib/libopcodes-*so + + chmod ugo-x $(d_bin)/usr/lib/*.so + + $(STRIP) $$(file $(d_bin)/usr/bin/* |awk -F: '$$0 !~ /script/ {print $$1}') + + ifeq ($(with_multiarch),yes) + pkg_create_dbgsym $(p_mul) $(d_mul) || true + $(STRIP) --strip-unneeded $(d_mul)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_mul)/usr/lib/libopcodes-*so + + chmod ugo-x $(d_mul)/usr/lib/*.so + + $(STRIP) $$(file $(d_mul)/usr/bin/* |awk -F: '$$0 !~ /script/ {print $$1}') + endif +endif + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_bin)/usr/$(DEB_HOST_GNU_TYPE) + + : # Remove windres manpages + rm -f $(d_bin)/usr/share/man/man1/windres.1 + +ifeq ($(with_multiarch),yes) + rm -rf $(d_mul)/usr/$(DEB_HOST_GNU_TYPE) + rm -f $(d_mul)/usr/share/man/man1/windres.1 +endif + +ifeq ($(with_gold),yes) + : # move gold linker to it's own package. + rm -fr $(d_gold) + $(install_dir) $(d_gold) + $(install_dir) $(d_gold)/usr/bin + + mv $(d_bin)/usr/bin/ld.gold $(d_gold)/usr/bin/ + rm -f $(d_bin)/usr/bin/ld + ln -s ld.bfd $(d_bin)/usr/bin/ld + ln -s ld.gold $(d_gold)/usr/bin/ld + + : # install a symlink for the gold linker + $(install_dir) $(d_gold)/usr/lib/gold-ld + ln -s ../../bin/ld.gold $(d_gold)/usr/lib/gold-ld/ld +endif + : # install a symlink for the old linker + $(install_dir) $(d_bin)/usr/lib/compat-ld + ln -s ../../bin/ld.bfd $(d_bin)/usr/lib/compat-ld/ld + + : # Remove empty directory + rmdir $(d_bin)/usr/include/ + + : # install libiberty PIC library + $(install_file) builddir-single/libiberty/pic/libiberty.a \ + $(d_dev)/usr/lib/libiberty_pic.a + + touch install-stamp + +install-gold-stamp: checkroot build-gold-stamp + $(checkdir) + + rm -fr $(d_gold) + $(install_dir) $(d_gold) + $(install_dir) $(d_gold)/usr/bin + + : # install binutils-gold stuff + $(MAKE) -C builddir-gold/gold \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_gold)/usr/ \ + mandir=$(pwd)/$(d_gold)/usr/share/man \ + infodir=$(pwd)/$(d_gold)/usr/share/info install + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_gold)/usr/$(DEB_HOST_GNU_TYPE) + + : # Now get rid of just about everything in binutils-gold + rm -rf $(d_gold)/usr/man + rm -rf $(d_gold)/usr/info + rm -rf $(d_gold)/usr/include + rm -rf $(d_gold)/usr/share + rm -rf $(d_gold)/usr/hppa-linux-gnu + rm -rf $(d_gold)/usr/lib/libiberty.a + +ifeq ($(with_strip),yes) + pkg_create_dbgsym $(p_gold) $(d_gold) || true + $(STRIP) $$(file $(d_gold)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + + touch install-gold-stamp + +install-hppa64-stamp: checkroot build-hppa64-stamp + $(checkdir) + + rm -fr $(d_hppa64) + $(install_dir) $(d_hppa64) + $(install_dir) $(d_hppa64)/usr/lib + + : # install binutils-hppa64 stuff + env MAKE="$(MAKE) VERSION=$(HPPA64_VERSION)" \ + $(MAKE) -C builddir-hppa64 \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_hppa64)/usr/ \ + mandir=$(pwd)/$(d_hppa64)/usr/share/man \ + infodir=$(pwd)/$(d_hppa64)/usr/share/info install + + : # move shared libs to the standard path + mv $(d_hppa64)/usr/hppa-linux-gnu/hppa64-linux-gnu/lib/lib*-*.so \ + $(d_hppa64)/usr/lib/. + + : # Now get rid of just about everything in binutils-hppa64 + rm -rf $(d_hppa64)/usr/man + rm -rf $(d_hppa64)/usr/info + rm -rf $(d_hppa64)/usr/include + rm -rf $(d_hppa64)/usr/share + rm -rf $(d_hppa64)/usr/hppa-linux-gnu + rm -rf $(d_hppa64)/usr/lib/libiberty.a + +ifeq ($(with_strip),yes) + : # Strip shared libraries + pkg_create_dbgsym $(p_hppa64) $(d_hppa64) || true + $(STRIP) --strip-unneeded $(d_hppa64)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_hppa64)/usr/lib/libopcodes-*so + $(STRIP) $$(file $(d_hppa64)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + + chmod ugo-x $(d_hppa64)/usr/lib/*.so + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_hppa64)/usr/hppa64-linux-gnu + + touch install-hppa64-stamp + +install-static-stamp: checkroot build-static-stamp + $(checkdir) + + rm -fr $(d_static) $(d_udeb) + $(install_dir) $(d_static) $(d_udeb) + + : # Copy static ld-new into /bin for both -static and -static-udeb + $(install_dir) $(d_static)/bin + $(install_binary) builddir-static/ld/ld-new $(d_static)/bin/ld_static + $(install_dir) $(d_udeb)/bin + $(install_binary) builddir-static/ld/ld-new $(d_udeb)/bin/ld_static +ifeq ($(with_strip),yes) + pkg_create_dbgsym $(p_static) $(d_static) || true + $(STRIP) --strip-unneeded $(d_static)/bin/ld_static $(d_udeb)/bin/ld_static +endif + + touch install-static-stamp + +install-spu-stamp: checkroot build-spu-stamp + $(checkdir) + + rm -fr $(d_spu) + $(install_dir) $(d_spu) + $(install_dir) $(d_spu)/usr/lib + + : # install binutils-spu stuff + env MAKE="$(MAKE) VERSION=$(SPU_VERSION)" \ + $(MAKE) -C builddir-spu \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_spu)/usr/ \ + mandir=$(pwd)/$(d_spu)/usr/share/man \ + infodir=$(pwd)/$(d_spu)/usr/share/info install + + : # move shared libs to the standard path + mv $(d_spu)/usr/$(DEB_HOST_GNU_TYPE)/spu-elf/lib/lib*-*.so \ + $(d_spu)/usr/lib/. + + : # Now get rid of just about everything in binutils-spu + rm -rf $(d_spu)/usr/man + rm -rf $(d_spu)/usr/info + rm -rf $(d_spu)/usr/include + rm -rf $(d_spu)/usr/share + rm -rf $(d_spu)/usr/$(DEB_HOST_GNU_TYPE) + rm -rf $(d_spu)/usr/lib/libiberty.a + rm -rf $(d_spu)/usr/lib/ldscripts + +ifeq ($(with_strip),yes) + : # Strip shared libraries + pkg_create_dbgsym $(p_spu) $(d_spu) || true + $(STRIP) --strip-unneeded $(d_spu)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_spu)/usr/lib/libopcodes-*so + $(STRIP) $$(file $(d_spu)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + + chmod ugo-x $(d_spu)/usr/lib/*.so + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_spu)/usr/spu-elf + + touch install-spu-stamp + +################################################################################ + +####################### +# binary-indep target # +####################### + +binary-indep: checkroot build install + $(checkdir) + + rm -f debian/files debian/substvars + + $(install_dir) $(d_doc)/DEBIAN + + $(install_dir) $(d_doc)/usr/share/doc/$(p_doc)/ + $(install_file) debian/changelog $(d_doc)/usr/share/doc/$(p_doc)/changelog.Debian + $(install_file) debian/copyright $(d_doc)/usr/share/doc/$(p_doc)/ + for i in bfd gas gprof ld; do \ + ln -sf ../$(p_bin)/$$i $(d_doc)/usr/share/doc/$(p_doc)/$$i; \ + done + find $(d_doc)/usr/share/doc/$(p_doc) -maxdepth 1 -type f ! -name copyright | xargs gzip -9 + gzip -9 $(d_doc)/usr/share/info/* + + dpkg-gencontrol -isp -P$(d_doc) -p$(p_doc) + chown -R root:root $(d_doc) + chmod -R go=rX $(d_doc) + dpkg --build $(d_doc) .. + + $(install_dir) $(d_src)/usr/share/doc/$(p_src)/ + $(install_file) debian/changelog $(d_src)/usr/share/doc/$(p_src)/changelog.Debian + $(install_file) debian/copyright $(d_src)/usr/share/doc/$(p_src)/ + find $(d_src)/usr/share/doc/$(p_src) -maxdepth 1 -type f ! -name copyright | xargs gzip -9 + + $(install_dir) $(d_src)/DEBIAN + $(install_dir) $(d_src)/usr/src/binutils/patches + $(install_file) debian/patches/* $(d_src)/usr/src/binutils/patches/ + chmod 755 $(d_src)/usr/src/binutils/patches/*.dpatch + tar -c --bzip2 -C .. --exclude=CVS \ + -f $(pwd)/$(d_src)/usr/src/binutils/binutils-$(VERSION).tar.bz2 \ + $(source_files) + + dpkg-gencontrol -isp -P$(d_src) -p$(p_src) + chown -R root:root $(d_src) + chmod -R go=rX $(d_src) + dpkg --build $(d_src) .. + + +################################################################################ + +####################### +# binary-arch target # +####################### + +binary-arch: checkroot build install + $(checkdir) + + : # make lintian happy + $(install_file) -D debian/$(p_bin).overrides \ + $(d_bin)/usr/share/lintian/overrides/$(p_bin) +ifeq ($(with_multiarch),yes) + $(install_file) -D debian/$(p_mul).overrides \ + $(d_mul)/usr/share/lintian/overrides/$(p_mul) +endif +ifeq ($(DEB_HOST_ARCH),hppa) + $(install_file) -D debian/$(p_hppa64).overrides \ + $(d_hppa64)/usr/share/lintian/overrides/$(p_hppa64) +endif +ifeq ($(with_gold),yes) + $(install_file) -D debian/$(p_gold).overrides \ + $(d_gold)/usr/share/lintian/overrides/$(p_gold) +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + $(install_file) -D debian/$(p_spu).overrides \ + $(d_spu)/usr/share/lintian/overrides/$(p_spu) +endif + + : # install maintainer scrtips + $(install_dir) $(d_bin)/DEBIAN + $(install_script) debian/binutils.postinst $(d_bin)/DEBIAN/postinst + $(install_script) debian/binutils.postrm $(d_bin)/DEBIAN/postrm + $(install_file) debian/binutils.shlibs $(d_bin)/DEBIAN/shlibs + + $(install_dir) $(d_dev)/DEBIAN + +ifeq ($(with_multiarch),yes) + $(install_dir) $(d_mul)/DEBIAN + $(install_script) debian/binutils-multiarch.postinst $(d_mul)/DEBIAN/postinst + $(install_script) debian/binutils-multiarch.postrm $(d_mul)/DEBIAN/postrm + $(install_script) debian/binutils-multiarch.preinst $(d_mul)/DEBIAN/preinst + $(install_file) debian/binutils-multiarch.shlibs $(d_mul)/DEBIAN/shlibs +endif + +ifeq ($(with_static),yes) + $(install_dir) $(d_static)/DEBIAN + $(install_script) debian/binutils-static.preinst $(d_static)/DEBIAN/preinst + $(install_dir) $(d_udeb)/DEBIAN +endif + +ifeq ($(with_gold),yes) + $(install_dir) $(d_gold)/DEBIAN + $(install_script) debian/binutils-gold.postrm $(d_gold)/DEBIAN/postrm + $(install_script) debian/binutils-gold.preinst $(d_gold)/DEBIAN/preinst +endif + +ifeq ($(DEB_HOST_ARCH),hppa) + $(install_dir) $(d_hppa64)/DEBIAN + $(install_script) debian/binutils-hppa64.postinst $(d_hppa64)/DEBIAN/postinst + $(install_script) debian/binutils-hppa64.postrm $(d_hppa64)/DEBIAN/postrm + $(install_file) debian/binutils-hppa64.shlibs $(d_hppa64)/DEBIAN/shlibs +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + $(install_dir) $(d_spu)/DEBIAN + $(install_script) debian/binutils-spu.postinst $(d_spu)/DEBIAN/postinst + $(install_script) debian/binutils-spu.postrm $(d_spu)/DEBIAN/postrm + $(install_file) debian/binutils-spu.shlibs $(d_spu)/DEBIAN/shlibs +endif + + : # install docs + $(install_dir) $(d_bin)/usr/share/doc/$(p_bin)/ + $(install_file) debian/changelog $(d_bin)/usr/share/doc/$(p_bin)/changelog.Debian + $(install_file) debian/copyright $(d_bin)/usr/share/doc/$(p_bin)/ + +ifeq ($(with_static),yes) + $(install_dir) $(d_static)/usr/share/doc/$(p_static)/ + $(install_file) debian/changelog $(d_static)/usr/share/doc/$(p_static)/changelog.Debian + $(install_file) debian/copyright $(d_static)/usr/share/doc/$(p_static)/ +endif + + $(install_dir) $(d_dev)/usr/share/doc/ + ln -sf $(p_bin) $(d_dev)/usr/share/doc/$(p_dev) +ifeq ($(with_multiarch),yes) + $(install_dir) $(d_mul)/usr/share/doc/ + ln -sf $(p_bin) $(d_mul)/usr/share/doc/$(p_mul) +endif +ifeq ($(with_gold),yes) + $(install_dir) $(d_gold)/usr/share/doc/ + ln -sf $(p_bin) $(d_gold)/usr/share/doc/$(p_gold) +endif +ifeq ($(DEB_HOST_ARCH),hppa) + $(install_dir) $(d_hppa64)/usr/share/doc/ + ln -sf $(p_bin) $(d_hppa64)/usr/share/doc/$(p_hppa64) +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + $(install_dir) $(d_spu)/usr/share/doc/ + ln -sf $(p_bin) $(d_spu)/usr/share/doc/$(p_spu) +endif + +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +ifeq ($(with_check),yes) + $(install_file) $(pwd)/test-summary $(d_bin)/usr/share/doc/$(p_bin)/ +endif +endif + $(install_file) binutils/NEWS debian/README.cross \ + $(d_bin)/usr/share/doc/$(p_bin)/ + + $(install_file) binutils/ChangeLog $(d_bin)/usr/share/doc/$(p_bin)/changelog + + for pkg in bfd gas gprof ld; do \ + $(install_dir) $(d_bin)/usr/share/doc/$(p_bin)/$$pkg; \ + done + $(install_file) bfd/ChangeLog bfd/PORTING bfd/TODO \ + $(d_bin)/usr/share/doc/$(p_bin)/bfd/ + $(install_file) gas/ChangeLog gas/NEWS $(d_bin)/usr/share/doc/$(p_bin)/gas/ + $(install_file) gprof/ChangeLog gprof/TODO gprof/TEST \ + $(d_bin)/usr/share/doc/$(p_bin)/gprof/ + $(install_file) ld/ChangeLog ld/TODO ld/NEWS \ + $(d_bin)/usr/share/doc/$(p_bin)/ld/ + + : # These only exist in H. J. Lu releases not GNU ones. + for dir in binutils bfd gas gprof ld; do \ + if [ -f $$dir/ChangeLog.linux ]; then \ + $(install_file) $$dir/ChangeLog.linux $(d_bin)/usr/share/doc/$(p_bin)/$$dir/; \ + fi; \ + done + + : # Copy bbconv.pl to the doc dir for use by interested people + $(install_file) gprof/bbconv.pl $(d_bin)/usr/share/doc/$(p_bin)/gprof/. + + : # Compress stuff that needs it + gzip -9 $(d_bin)/usr/share/man/man1/* + find $(d_bin)/usr/share/doc/$(p_bin)/ -type f ! -name copyright -a ! -name bbconv.pl | xargs gzip -9 +ifeq ($(with_static),yes) + find $(d_static)/usr/share/doc/$(p_static)/ -type f ! -name copyright | xargs gzip -9 +endif + + : # Finish it all up + find $(d_bin) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_bin) -p$(p_bin) $(CONFLICTS) + + rm -f debian/substvars + dpkg-gencontrol -isp -P$(d_dev) -p$(p_dev) + +ifeq ($(with_multiarch),yes) + rm -f debian/substvars + find $(d_mul) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_mul) -p$(p_mul) +endif + +ifeq ($(with_static),yes) + dpkg-gencontrol -isp -P$(d_static) -p$(p_static) + dpkg-gencontrol -isp -P$(d_udeb) -p$(p_udeb) -fdebian/files~ + dpkg-distaddfile $(STATIC_UDEB) debian-installer optional +endif + +ifeq ($(with_gold),yes) + rm -f debian/substvars + find $(d_gold) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_gold) -p$(p_gold) +endif +ifeq ($(DEB_HOST_ARCH),hppa) + rm -f debian/substvars + find $(d_hppa64) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_hppa64) -p$(p_hppa64) +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + rm -f debian/substvars + find $(d_spu) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_spu) -p$(p_spu) +endif + + chown -R root:root $(d_bin) $(d_dev) + chmod -R go=rX $(d_bin) $(d_dev) + dpkg --build $(d_bin) .. + dpkg --build $(d_dev) .. +ifeq ($(with_multiarch),yes) + chown -R root:root $(d_mul) + chmod -R go=rX $(d_mul) + dpkg --build $(d_mul) .. +endif +ifeq ($(with_static),yes) + chown -R root:root $(d_static) $(d_udeb) + chmod -R go=rX $(d_static) $(d_udeb) + dpkg --build $(d_static) .. + dpkg --build $(d_udeb) ../$(STATIC_UDEB) +endif +ifeq ($(with_gold),yes) + chown -R root:root $(d_gold) + chmod -R go=rX $(d_gold) + dpkg --build $(d_gold) .. +endif +ifeq ($(DEB_HOST_ARCH),hppa) + chown -R root:root $(d_hppa64) + chmod -R go=rX $(d_hppa64) + dpkg --build $(d_hppa64) .. +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + chown -R root:root $(d_spu) + chmod -R go=rX $(d_spu) + dpkg --build $(d_spu) .. +endif + +################################################################################ + +################# +# cross targets # +################# + +# If $(TARGET) is not set, try reading debian/target +ifeq ($(TARGET),) +TARGET := $(shell cat debian/target 2>/dev/null) +endif + +# Process the following only if $(TARGET) is set +ifneq ($(TARGET),) + +# Support TARGET both as Debian architecture specification (e.g. arm), +# and as the target name (e.g. arm-linux-gnu). +try_convert := $(shell dpkg-architecture -f -a$(TARGET) -qDEB_HOST_GNU_TYPE 2>/dev/null) +ifneq ($(try_convert),) +override TARGET := $(try_convert) +endif + +p_cross = $(subst _,-,binutils-$(TARGET)) +d_cross = debian/$(p_cross) + +ifneq ($(filter sparc-linux-gnu powerpc-linux-gnu mips-linux-gnu, $(TARGET)),) +ADDITIONAL_TARGETS = --enable-targets=$(TARGET:%-linux-gnu=%64-linux-gnu) +endif +ifneq ($(filter i386-linux-gnu i486-linux-gnu i586-linux-gnu x86-linux-gnu, $(TARGET)),) +ADDITIONAL_TARGETS = --enable-targets=x86_64-linux-gnu +endif +ifneq ($(filter i386-kfreebsd-gnu i486-kfreebsd-gnu i586-kfreebsd-gnu x86-kfreebsd-gnu, $(TARGET)),) +ADDITIONAL_TARGETS = --enable-targets=x86_64-linux-gnu +endif +ifeq ($(TARGET), x86_64-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=i486-linux-gnu +endif +ifeq ($(TARGET), x86_64-kfreebsd-gnu) +ADDITIONAL_TARGETS = --enable-targets=i486-kfreebsd-gnu +endif +ifeq ($(TARGET), mipsel-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=mips64el-linux-gnu +endif +ifeq ($(TARGET), sparc64-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=sparc-linux-gnu +endif +ifeq ($(TARGET), s390-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=s390x-linux-gnu +endif +ifeq ($(TARGET), s390x-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=s390-linux-gnu +endif + +#----------------------------------------------------------------- +# sysroot options +ifdef WITH_SYSROOT + with_sysroot = $(WITH_SYSROOT) +endif +ifdef WITH_BUILD_SYSROOT + with_build_sysroot = $(WITH_BUILD_SYSROOT) +endif + +ifneq ($(with_sysroot),) + CONFARGS += --with-sysroot=$(with_sysroot) +endif +ifneq ($(with_build_sysroot),) + CONFARGS += --with-build-sysroot=$(with_build_sysroot) +endif + +configure-$(TARGET)-stamp: patch-stamp + $(checkdir) + test "" != "$(TARGET)" + rm -rf configure-$(TARGET)-stamp builddir-$(TARGET) + mkdir builddir-$(TARGET) + cd builddir-$(TARGET) \ + && env CC="$(CC)" CXX="$(CXX)" ../configure --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) --target=$(TARGET) --prefix=/usr \ + $(ADDITIONAL_TARGETS) $(CONFARGS) + touch $@ + +build-$(TARGET)-stamp: configure-$(TARGET)-stamp + $(checkdir) + test "" != "$(TARGET)" + $(MAKE) -C builddir-$(TARGET) $(NJOBS) CFLAGS="$(CFLAGS)" + touch $@ + +install-$(TARGET)-stamp: build-$(TARGET)-stamp + $(checkdir) + test "" != "$(TARGET)" + rm -rf $(d_cross) + $(MAKE) -C builddir-$(TARGET) prefix=$(pwd)/$(d_cross)/usr \ + mandir=$(pwd)/$(d_cross)/usr/share/man \ + infodir=$(pwd)/$(d_cross)/usr/share/info install + rm -rf $(d_cross)/usr/lib* $(d_cross)/usr/share/info $(d_cross)/usr/share/locale +ifeq ($(with_strip),yes) + $(STRIP) $$(file $(d_cross)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + gzip -9 $(d_cross)/usr/share/man/man1/* + touch $@ + +binary-cross: checkroot install-$(TARGET)-stamp + $(checkdir) + test "" != "$(TARGET)" + + sed "/^$$/ q" < debian/control > debian/control.$(TARGET) + sed -e "s/__TARGET__/$$(echo -n $(TARGET) | sed s/_/-/g)/" \ + < debian/control.cross.in >> debian/control.$(TARGET) + + $(install_dir) $(d_cross)/DEBIAN + + $(install_dir) $(d_cross)/usr/share/doc/$(p_cross)/ + $(install_file) debian/changelog $(d_cross)/usr/share/doc/$(p_cross)/changelog.Debian + $(install_file) debian/copyright debian/README.cross $(d_cross)/usr/share/doc/$(p_cross)/ + gzip -9f $(d_cross)/usr/share/doc/$(p_cross)/changelog.Debian + + for pkg in bfd gas gprof ld; do \ + ln -sf ../binutils/$$pkg $(d_cross)/usr/share/doc/$(p_cross)/$$pkg; \ + done + + rm -f debian/substvars + dpkg-shlibdeps $(d_cross)/usr/bin/* + dpkg-gencontrol -isp -cdebian/control.$(TARGET) -P$(d_cross) -p$(p_cross) + dpkg --build $(d_cross) .. + +clean-cross: unpatch + $(checkdir) + test "" != "$(TARGET)" + rm -rf $(d_cross) debian/control.$(TARGET) debian/files debian/substvars \ + builddir-$(TARGET) {configure,build,install}-$(TARGET)-stamp + +.PHONY: binary-cross clean-cross + +endif + +################################################################################ + +define checkdir + test -f bfd/elf32.c -a -f debian/rules +endef + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot --- binutils-2.20.1.orig/debian/rules +++ binutils-2.20.1/debian/rules @@ -0,0 +1,1140 @@ +#!/usr/bin/make -f +# debian/rules file - for binutils (2.20) +# Based on sample debian/rules file - for GNU Hello (1.3). +# Copyright 1994,1995 by Ian Jackson. +# Copyright 1998-2007 James Troup. +# Portions Copyright 2008-2009 Canonical Ltd. +# Portions Copyright 2008-2009 Matthias Klose. +# I hereby give you perpetual unlimited permission to copy, +# modify and relicense this file, provided that you do not remove +# my name from the file itself. (I assert my moral right of +# paternity under the Copyright, Designs and Patents Act 1988.) +# This file may have to be extensively modified + +################################################################################ + +include /usr/share/dpatch/dpatch.make + +################################################################################ + +p_bin = binutils +p_dev = $(p_bin)-dev +p_mul = $(p_bin)-multiarch +p_gold = $(p_bin)-gold +p_doc = $(p_bin)-doc +p_static = $(p_bin)-static +p_udeb = $(p_static)-udeb +p_hppa64 = $(p_bin)-hppa64 +p_spu = $(p_bin)-spu +p_src = $(p_bin)-source + +pwd := $(shell pwd) +d = debian/tmp +d_bin = $(d) +d_dev = debian/$(p_dev) +d_mul = debian/$(p_mul) +d_gold = debian/$(p_gold) +d_doc = debian/$(p_doc) +d_static = debian/$(p_static) +d_udeb = debian/$(p_udeb) +d_hppa64 = debian/$(p_hppa64) +d_spu = debian/$(p_spu) +d_src = debian/$(p_src) + +install_dir = install -d -m 755 +install_file = install -m 644 +install_script = install -m 755 +install_binary = install -m 755 -s + +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +SHELL = /bin/bash + +#ifneq (,$(filter $(DEB_HOST_ARCH), amd64 armel i386 lpia powerpc sparc)) +ifneq (,$(filter $(DEB_HOST_ARCH), amd64 armel i386 lpia sparc)) + with_gold = yes +endif + +with_multiarch := yes +with_static := yes + +CC = gcc +CXX = g++ +CFLAGS = -g -O2 -Wno-format-security +STRIP = strip --remove-section=.comment --remove-section=.note +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + CC = $(DEB_HOST_GNU_TYPE)-gcc + CXX = $(DEB_HOST_GNU_TYPE)-g++ +endif + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS = -g -O0 -Wno-format-security +endif + +# see LP: #446478, would only fix the testcases +#ifeq ($(DEB_HOST_ARCH),armel) +# CFLAGS += -fno-section-anchors +#endif + +ifeq ($(DEB_HOST_ARCH),armel) + CFLAGS += -marm +endif + +DEB_VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2 | sed 's/.*://') +STATIC_UDEB = $(p_udeb)_$(DEB_VERSION)_$(DEB_HOST_ARCH).udeb + +VERSION = $(shell sed -n 's/^ *VERSION=\(.*\)/\1/p' bfd/configure | head -1) +SINGLE_VERSION= $(VERSION)-system +MULTI_VERSION = $(VERSION)-multiarch +HPPA64_VERSION= $(VERSION)-hppa64 +SPU_VERSION = $(VERSION)-spu + +DISTRIBUTION := $(shell lsb_release -is) +NJOBS = +# Support parallel= in DEB_BUILD_OPTIONS (see #209008) +SPACE = $(EMPTY) $(EMPTY) +COMMA = , +ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) + NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) +endif +ifneq (,$(findstring nogold,$(DEB_BUILD_OPTIONS))) + with_gold = disabled in DEB_BUILD_OPTIONS +endif +ifneq (,$(findstring nostat,$(DEB_BUILD_OPTIONS))) + with_static = disabled in DEB_BUILD_OPTIONS +endif +ifneq (,$(findstring nomult,$(DEB_BUILD_OPTIONS))) + with_multiarch = disabled in DEB_BUILD_OPTIONS +endif + +######################################## + +CONFARGS = \ + --enable-shared \ + --enable-plugins \ + --prefix=/usr \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_HOST_GNU_TYPE) \ + --with-pkgversion="GNU Binutils for $(DISTRIBUTION)" + +ifeq ($(DEB_HOST_ARCH),sparc) + CONFARGS += --enable-targets=sparc64-linux-gnu + CONFLICTS = -VextraConflicts="libc6-dev-sparc64 (<< 2.2.5-7)" +endif +ifeq ($(DEB_HOST_ARCH),sparc64) + CONFARGS += --enable-targets=sparc-linux-gnu + CONFLICTS = -VextraConflicts="libc6-dev-sparc64 (<< 2.2.5-7)" +endif +ifeq ($(DEB_HOST_ARCH),powerpc) + CONFARGS += --enable-targets=powerpc64-linux-gnu,spu +endif +ifeq ($(DEB_HOST_ARCH),ppc64) + CONFARGS += --enable-targets=powerpc-linux-gnu,spu +endif +ifeq ($(DEB_HOST_ARCH),s390) + CONFARGS += --enable-targets=s390x-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),i386) + CONFARGS += --enable-targets=x86_64-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),kfreebsd-i386) + CONFARGS += --enable-targets=x86_64-kfreebsd-gnu +endif +ifeq ($(DEB_HOST_ARCH),mips) + CONFARGS += --enable-targets=mips64-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),mipsel) + CONFARGS += --enable-targets=mips64el-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),ia64) + CONFARGS += --disable-werror +endif + +with_check := yes +ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + with_check := disabled through DEB_BUILD_OPTIONS +endif +ifneq (,$(filter $(DEB_HOST_ARCH),hppa)) + with_check := disabled for architecture $(DEB_HOST_ARCH) +endif +ifneq (,$(filter $(DEB_HOST_ARCH), armel mips mipsel)) + ignore_regressions := regressions ignored on architecture $(DEB_HOST_ARCH) +endif +with_strip := yes +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + with_strip := disabled through DEB_BUILD_OPTIONS +endif + +source_files = $(addprefix $(shell basename $(pwd))/, \ + $(filter-out %-stamp CVS debian builddir-% test-summary, $(wildcard *))) + +################################################################################ + +################ +# clean target # +################ + +clean: unpatch + $(checkdir) + -rm -fr builddir-multi builddir-single builddir-hppa64 builddir-spu builddir-gold + -find . -name \*.gmo -o -name \*~ -o -name \*.info ! -name sysroff.info | xargs rm -f + -rm -f $(pwd)/test-summary* + -rm -fr $(d_bin) $(d_dev) $(d_mul) $(d_doc) $(d_hppa64) $(d_src) $(d_spu) $(d_gold) + -rm -fr builddir-static + -rm -fr $(d_static) $(d_udeb) + -rm -rf debian/patched debian/tmp debian/files* debian/substvars + chmod 644 debian/patches/*.dpatch + -rm -f *-stamp + +################################################################################ + +####################### +# single-arch targets # +####################### + +SINGLE_CONFARGS = $(CONFARGS) +ifeq ($(with_gold),yes) + SINGLE_CONFARGS += --enable-gold=both +endif + +configure-single-stamp: patch-stamp + $(checkdir) + +ifeq ($(with_check),yes) + @if echo "spawn true" | /usr/bin/expect -f - >/dev/null; then \ + : ; \ + else \ + echo "expect is failing on your system with the above error, which means the"; \ + echo "testsuite will fail. Please resolve the above issues and retry the build."; \ + echo "-----------------------------------------------------------------------------"; \ + exit 1; \ + fi +endif + + rm -rf configure-single-stamp \ + builddir-single + mkdir builddir-single + cd builddir-single && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" \ + ../configure $(SINGLE_CONFARGS) + $(MAKE) -C builddir-single configure-host + touch configure-single-stamp + +build-single-stamp: configure-single-stamp + $(checkdir) + env MAKE="$(MAKE) VERSION=$(SINGLE_VERSION)" \ + $(MAKE) -C builddir-single/bfd headers + env MAKE="$(MAKE) VERSION=$(SINGLE_VERSION)" \ + $(MAKE) $(NJOBS) -C builddir-single +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +ifeq ($(with_check),yes) + -env MAKE="$(MAKE) VERSION=$(SINGLE_VERSION)" \ + $(MAKE) -C builddir-single -k check + cat builddir-single/binutils/binutils.sum \ + builddir-single/gas/testsuite/gas.sum \ + builddir-single/ld/ld.sum >> $(pwd)/test-summary + set -e; \ + if [ -x /usr/bin/python ]; then \ + echo "Test results, compared with installed binutils:"; \ + zcat /usr/share/doc/binutils/test-summary.gz > test-summary-installed; \ + if python debian/test-suite-compare.py test-summary-installed test-summary; then \ + : ; \ + elif [ -n "$(ignore_regressions)" ]; then \ + echo "$(ignore_regressions)"; \ + else \ + false; \ + fi; \ + else \ + echo "python not installed, not comparing test results."; \ + fi +endif +endif + touch build-single-stamp + +################################################################################ + +####################### +# gold-arch targets # +####################### + +GOLD_CONFARGS = --enable-gold +ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386)) + GOLD_CONFARGS += --enable-targets=i486-linux-gnu,x86_64-linux-gnu +endif +ifeq ($(DEB_HOST_ARCH),powerpc) + GOLD_CONFARGS += --enable-targets=powerpc-linux-gnu +endif + +configure-gold-stamp: patch-stamp + $(checkdir) + rm -rf configure-gold-stamp \ + builddir-gold + mkdir builddir-gold + cd builddir-gold && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS) -Wno-error" \ + ../configure $(CONFARGS) $(GOLD_CONFARGS) + $(MAKE) -C builddir-gold configure-host + touch configure-gold-stamp + +build-gold-stamp: configure-gold-stamp + $(checkdir) + $(MAKE) -C builddir-gold/bfd headers + $(MAKE) $(NJOBS) -C builddir-gold +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +ifeq ($(with_check),yes) + -$(MAKE) $(NJOBS) -C builddir-gold/testsuite \ + && ( \ + $(MAKE) -C builddir-gold/gold -k check \ + && echo "XXX gold subdir check" \ + && $(MAKE) -C builddir-gold/gold/testsuite -k check) +endif +endif + touch build-gold-stamp + +################################################################################ + +##################### +# multiarch targets # +##################### + +multiarch_targets = \ + alpha-linux-gnu \ + arm-linux-gnu \ + armel-linux-gnu \ + hppa-linux-gnu \ + i486-gnu \ + i486-linux-gnu \ + ia64-linux-gnu \ + m68k-linux-gnu \ + m68k-rtems \ + mips-linux-gnu \ + mipsel-linux-gnu \ + mips64-linux-gnu \ + mips64el-linux-gnu \ + powerpc-linux-gnu \ + powerpc64-linux-gnu \ + s390-linux-gnu \ + s390x-linux-gnu \ + sh-linux-gnu \ + sh64-linux-gnu \ + sparc-linux-gnu \ + sparc64-linux-gnu \ + x86_64-linux-gnu \ + m32r-linux-gnu \ + spu + +configure-multi-stamp: patch-stamp + $(checkdir) + rm -rf configure-multi-stamp \ + builddir-multi + mkdir builddir-multi + cd builddir-multi \ + && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" ../configure $(CONFARGS) \ + --enable-targets=$(subst $(SPACE),$(COMMA),$(multiarch_targets)) + $(MAKE) -C builddir-multi configure-host + touch configure-multi-stamp + +build-multi-stamp: configure-multi-stamp + $(checkdir) + $(MAKE) -C builddir-multi/bfd headers + env MAKE="$(MAKE) VERSION=$(MULTI_VERSION)" \ + $(MAKE) $(NJOBS) -C builddir-multi + touch build-multi-stamp + +################################################################################ + +################# +# static target # +################# + +configure-static-stamp: patch-stamp + $(checkdir) + rm -rf configure-static-stamp \ + builddir-static + mkdir builddir-static + cd builddir-static \ + && env CC="$(CC)" CXX="$(CXX)" CFLAGS="-g0 -Os" ../configure \ + --prefix=/usr \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_HOST_GNU_TYPE) \ + --with-pkgversion="GNU Binutils for $(DISTRIBUTION)" + $(MAKE) -C builddir-static configure-bfd + $(MAKE) -C builddir-static configure-ld + touch configure-static-stamp + +build-static-stamp: configure-static-stamp + $(checkdir) + $(MAKE) $(NJOBS) -C builddir-static/libiberty CCLD='$(CC) -all-static' + $(MAKE) $(NJOBS) -C builddir-static/bfd CCLD='$(CC) -all-static' + $(MAKE) $(NJOBS) -C builddir-static/ld CCLD='$(CC) -all-static' + touch build-static-stamp + +################################################################################ + +################# +# hppa64 target # +################# + +configure-hppa64-stamp: patch-stamp + $(checkdir) + rm -rf configure-hppa64-stamp \ + builddir-hppa64 + mkdir builddir-hppa64 + cd builddir-hppa64 \ + && env CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" ../configure \ + --enable-shared \ + --prefix=/usr \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_BUILD_GNU_TYPE) \ + --target=hppa64-linux-gnu + $(MAKE) -C builddir-hppa64 configure-host + touch configure-hppa64-stamp + +build-hppa64-stamp: configure-hppa64-stamp + $(checkdir) + $(MAKE) -C builddir-hppa64/bfd headers + env MAKE="$(MAKE) VERSION=$(HPPA64_VERSION)" \ + $(MAKE) $(NJOBS) -C builddir-hppa64 + touch build-hppa64-stamp + +################################################################################ + +############## +# spu target # +############## + +configure-spu-stamp: patch-stamp + $(checkdir) + rm -rf configure-spu-stamp \ + builddir-spu + mkdir builddir-spu + cd builddir-spu \ + && env CC="$(CC)" CFLAGS="$(CFLAGS)" ../configure \ + --enable-shared \ + --prefix=/usr \ + --program-prefix=spu- \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --host=$(DEB_BUILD_GNU_TYPE) \ + --target=spu-elf + $(MAKE) -C builddir-spu configure-host + touch configure-spu-stamp + +build-spu-stamp: configure-spu-stamp + $(checkdir) + $(MAKE) -C builddir-spu/bfd headers + env MAKE="$(MAKE) VERSION=$(SPU_VERSION)" \ + $(MAKE) $(NJOBS) -C builddir-spu + touch build-spu-stamp + +################################################################################ + +pre-build: +#ifneq (,$(filter $(DEB_HOST_ARCH), armel i386 amd64)) +# @echo Build it ... +#else +# @echo Explicitely fail the build for architecture $(DEB_HOST_ARCH) +# false +#endif + +build_stamps = build-single-stamp +ifeq ($(with_multiarch),yes) + build_stamps += build-multi-stamp +endif +ifeq ($(DEB_HOST_ARCH),hppa) + build_stamps += build-hppa64-stamp +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + build_stamps += build-spu-stamp +endif +#ifeq ($(with_gold),yes) +# build_stamps += build-gold-stamp +#endif +ifeq ($(with_static),yes) + build_stamps += build-static-stamp +endif +build: pre-build build-stamp +build-stamp: $(build_stamps) + touch build-stamp + +################################################################################ + +################## +# install target # +################## + +install_stamps = install-stamp +ifeq ($(DEB_HOST_ARCH),hppa) + install_stamps += install-hppa64-stamp +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + install_stamps += install-spu-stamp +endif +#ifeq ($(with_gold),yes) +# install_stamps += install-gold-stamp +#endif +ifeq ($(with_static),yes) + install_stamps += install-static-stamp +endif +install: $(install_stamps) +install-stamp: checkroot build-stamp + $(checkdir) + + rm -fr $(d_bin) $(d_dev) $(d_mul) $(d_doc) $(d_src) + $(install_dir) $(d_bin) $(d_dev) $(d_mul) $(d_doc) $(d_src) + + : # install binutils and -dev stuff + env MAKE="$(MAKE) VERSION=$(SINGLE_VERSION)" \ + $(MAKE) -C builddir-single \ + CFLAGS="$(CFLAGS)" prefix=$(pwd)/$(d_bin)/usr \ + mandir=$(pwd)/$(d_bin)/usr/share/man \ + infodir=$(pwd)/$(d_doc)/usr/share/info install + +ifeq ($(with_multiarch),yes) + : # now install binutils-multiarch stuff + env MAKE="$(MAKE) VERSION=$(MULTI_VERSION)" \ + $(MAKE) -C builddir-multi \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_mul)/usr \ + mandir=$(pwd)/$(d_mul)/usr/share/man \ + infodir=$(pwd)/$(d_doc)/usr/share/info install +endif + + : # copy libiberty.h ... not too keen on this, but it was requested + cp -f include/libiberty.h $(d_bin)/usr/include + + : # copy demangle.h ... not too keen on this, but it was requested + cp -f include/demangle.h $(d_bin)/usr/include + + : # We don't need to distribute everything in binutils and -dev + rm -rf $(d_bin)/usr/include/obstack.h + rm -f $(d_bin)/usr/man/man1/configure.1 + rm -f $(d_doc)/usr/share/info/configure.* $(d_doc)/usr/share/info/standards.* + : # *sigh*, bugs.debian.org/213524 + rm -f $(d_doc)/usr/share/info/dir* + +ifeq ($(with_multiarch),yes) + : # Now get rid of just about everything in binutils-multiarch + rm -rf $(d_mul)/usr/man $(d_mul)/usr/info $(d_mul)/usr/include + rm -rf $(d_mul)/usr/share/man $(d_mul)/usr/share/info $(d_mul)/usr/share/locale + + : # Get rid of ld for the time being since it's suddenly unhappy when + : # linking kernels. Also get rid of the ldscripts for good measure. + rm -f $(d_mul)/usr/bin/as $(d_mul)/usr/bin/gasp $(d_mul)/usr/bin/c++filt \ + $(d_mul)/usr/bin/ld + rm -rf $(d_mul)/usr/lib/ldscripts + ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + rm -f $(d_mul)/usr/bin/embedspu + endif +endif + + $(install_dir) $(d_dev)/usr/include/ $(d_dev)/usr/lib/ + mv $(d_bin)/usr/include/* $(d_dev)/usr/include/ + mv $(d_bin)/usr/lib/*.a $(d_bin)/usr/lib/libbfd.so $(d_bin)/usr/lib/libopcodes.so \ + $(d_dev)/usr/lib/ + +ifeq ($(with_multiarch),yes) + rm -f $(d_mul)/usr/lib/libbfd.so $(d_mul)/usr/lib/libopcodes.so + rm -f $(d_mul)/usr/lib/*.la $(d_mul)/usr/lib/*.a + rm -f $(d_mul)/usr/lib*/libiberty* +endif + + : # Get rid of .la files since libtool obviously has no idea about transient paths + rm -f $(d_bin)/usr/lib/*.la + +ifeq ($(with_strip),yes) + : # Strip shared libraries + pkg_create_dbgsym $(p_bin) $(d_bin) || true + $(STRIP) --strip-unneeded $(d_bin)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_bin)/usr/lib/libopcodes-*so + + chmod ugo-x $(d_bin)/usr/lib/*.so + + $(STRIP) $$(file $(d_bin)/usr/bin/* |awk -F: '$$0 !~ /script/ {print $$1}') + + ifeq ($(with_multiarch),yes) + pkg_create_dbgsym $(p_mul) $(d_mul) || true + $(STRIP) --strip-unneeded $(d_mul)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_mul)/usr/lib/libopcodes-*so + + chmod ugo-x $(d_mul)/usr/lib/*.so + + $(STRIP) $$(file $(d_mul)/usr/bin/* |awk -F: '$$0 !~ /script/ {print $$1}') + endif +endif + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_bin)/usr/$(DEB_HOST_GNU_TYPE) + + : # Remove windres manpages + rm -f $(d_bin)/usr/share/man/man1/windres.1 + +ifeq ($(with_multiarch),yes) + rm -rf $(d_mul)/usr/$(DEB_HOST_GNU_TYPE) + rm -f $(d_mul)/usr/share/man/man1/windres.1 +endif + +ifeq ($(with_gold),yes) + : # move gold linker to it's own package. + rm -fr $(d_gold) + $(install_dir) $(d_gold) + $(install_dir) $(d_gold)/usr/bin + + mv $(d_bin)/usr/bin/ld.gold $(d_gold)/usr/bin/ + rm -f $(d_bin)/usr/bin/ld + ln -s ld.bfd $(d_bin)/usr/bin/ld + ln -s ld.gold $(d_gold)/usr/bin/gold + ln -s ld.gold $(d_gold)/usr/bin/ld + mv $(d_bin)/usr/share/man/man1/ld.1 \ + $(d_bin)/usr/share/man/man1/ld.bfd.1 + ln -s ld.bfd.1.gz $(d_bin)/usr/share/man/man1/ld.1.gz + + : # install a symlink for the gold linker + $(install_dir) $(d_gold)/usr/lib/gold-ld + ln -s ../../bin/ld.gold $(d_gold)/usr/lib/gold-ld/ld +endif + : # install a symlink for the old linker + $(install_dir) $(d_bin)/usr/lib/compat-ld + ln -s ../../bin/ld.bfd $(d_bin)/usr/lib/compat-ld/ld + + : # Remove empty directory + rmdir $(d_bin)/usr/include/ + + : # install libiberty PIC library + $(install_file) builddir-single/libiberty/pic/libiberty.a \ + $(d_dev)/usr/lib/libiberty_pic.a + + touch install-stamp + +install-gold-stamp: checkroot build-gold-stamp + $(checkdir) + + rm -fr $(d_gold) + $(install_dir) $(d_gold) + $(install_dir) $(d_gold)/usr/bin + + : # install binutils-gold stuff + $(MAKE) -C builddir-gold/gold \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_gold)/usr/ \ + mandir=$(pwd)/$(d_gold)/usr/share/man \ + infodir=$(pwd)/$(d_gold)/usr/share/info install + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_gold)/usr/$(DEB_HOST_GNU_TYPE) + + : # Now get rid of just about everything in binutils-gold + rm -rf $(d_gold)/usr/man + rm -rf $(d_gold)/usr/info + rm -rf $(d_gold)/usr/include + rm -rf $(d_gold)/usr/share + rm -rf $(d_gold)/usr/hppa-linux-gnu + rm -rf $(d_gold)/usr/lib/libiberty.a + +ifeq ($(with_strip),yes) + pkg_create_dbgsym $(p_gold) $(d_gold) || true + $(STRIP) $$(file $(d_gold)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + + touch install-gold-stamp + +install-hppa64-stamp: checkroot build-hppa64-stamp + $(checkdir) + + rm -fr $(d_hppa64) + $(install_dir) $(d_hppa64) + $(install_dir) $(d_hppa64)/usr/lib + + : # install binutils-hppa64 stuff + env MAKE="$(MAKE) VERSION=$(HPPA64_VERSION)" \ + $(MAKE) -C builddir-hppa64 \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_hppa64)/usr/ \ + mandir=$(pwd)/$(d_hppa64)/usr/share/man \ + infodir=$(pwd)/$(d_hppa64)/usr/share/info install + + : # move shared libs to the standard path + mv $(d_hppa64)/usr/hppa-linux-gnu/hppa64-linux-gnu/lib/lib*-*.so \ + $(d_hppa64)/usr/lib/. + + : # Now get rid of just about everything in binutils-hppa64 + rm -rf $(d_hppa64)/usr/man + rm -rf $(d_hppa64)/usr/info + rm -rf $(d_hppa64)/usr/include + rm -rf $(d_hppa64)/usr/share + rm -rf $(d_hppa64)/usr/hppa-linux-gnu + rm -rf $(d_hppa64)/usr/lib/libiberty.a + +ifeq ($(with_strip),yes) + : # Strip shared libraries + pkg_create_dbgsym $(p_hppa64) $(d_hppa64) || true + $(STRIP) --strip-unneeded $(d_hppa64)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_hppa64)/usr/lib/libopcodes-*so + $(STRIP) $$(file $(d_hppa64)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + + chmod ugo-x $(d_hppa64)/usr/lib/*.so + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_hppa64)/usr/hppa64-linux-gnu + + touch install-hppa64-stamp + +install-static-stamp: checkroot build-static-stamp + $(checkdir) + + rm -fr $(d_static) $(d_udeb) + $(install_dir) $(d_static) $(d_udeb) + + : # Copy static ld-new into /bin for both -static and -static-udeb + $(install_dir) $(d_static)/bin + $(install_binary) builddir-static/ld/ld-new $(d_static)/bin/ld_static + $(install_dir) $(d_udeb)/bin + $(install_binary) builddir-static/ld/ld-new $(d_udeb)/bin/ld_static +ifeq ($(with_strip),yes) + pkg_create_dbgsym $(p_static) $(d_static) || true + $(STRIP) --strip-unneeded $(d_static)/bin/ld_static $(d_udeb)/bin/ld_static +endif + + touch install-static-stamp + +install-spu-stamp: checkroot build-spu-stamp + $(checkdir) + + rm -fr $(d_spu) + $(install_dir) $(d_spu) + $(install_dir) $(d_spu)/usr/lib + + : # install binutils-spu stuff + env MAKE="$(MAKE) VERSION=$(SPU_VERSION)" \ + $(MAKE) -C builddir-spu \ + CFLAGS="$(CFLAGS)" \ + prefix=$(pwd)/$(d_spu)/usr/ \ + mandir=$(pwd)/$(d_spu)/usr/share/man \ + infodir=$(pwd)/$(d_spu)/usr/share/info install + + : # move shared libs to the standard path + mv $(d_spu)/usr/$(DEB_HOST_GNU_TYPE)/spu-elf/lib/lib*-*.so \ + $(d_spu)/usr/lib/. + + : # Now get rid of just about everything in binutils-spu + rm -rf $(d_spu)/usr/man + rm -rf $(d_spu)/usr/info + rm -rf $(d_spu)/usr/include + rm -rf $(d_spu)/usr/share + rm -rf $(d_spu)/usr/$(DEB_HOST_GNU_TYPE) + rm -rf $(d_spu)/usr/lib/libiberty.a + rm -rf $(d_spu)/usr/lib/ldscripts + +ifeq ($(with_strip),yes) + : # Strip shared libraries + pkg_create_dbgsym $(p_spu) $(d_spu) || true + $(STRIP) --strip-unneeded $(d_spu)/usr/lib/libbfd-*so + $(STRIP) --strip-unneeded $(d_spu)/usr/lib/libopcodes-*so + $(STRIP) $$(file $(d_spu)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + + chmod ugo-x $(d_spu)/usr/lib/*.so + + : # Don't want /usr/-linux to exist in any package + rm -rf $(d_spu)/usr/spu-elf + + touch install-spu-stamp + +################################################################################ + +####################### +# binary-indep target # +####################### + +binary-indep: checkroot build install + $(checkdir) + + rm -f debian/files debian/substvars + + $(install_dir) $(d_doc)/DEBIAN + + $(install_dir) $(d_doc)/usr/share/doc/$(p_doc)/ + $(install_file) debian/changelog $(d_doc)/usr/share/doc/$(p_doc)/changelog.Debian + $(install_file) debian/copyright $(d_doc)/usr/share/doc/$(p_doc)/ + for i in bfd gas gprof ld; do \ + ln -sf ../$(p_bin)/$$i $(d_doc)/usr/share/doc/$(p_doc)/$$i; \ + done + find $(d_doc)/usr/share/doc/$(p_doc) -maxdepth 1 -type f ! -name copyright | xargs gzip -9 + gzip -9 $(d_doc)/usr/share/info/* + + dpkg-gencontrol -isp -P$(d_doc) -p$(p_doc) + chown -R root:root $(d_doc) + chmod -R go=rX $(d_doc) + dpkg --build $(d_doc) .. + + $(install_dir) $(d_src)/usr/share/doc/$(p_src)/ + $(install_file) debian/changelog $(d_src)/usr/share/doc/$(p_src)/changelog.Debian + $(install_file) debian/copyright $(d_src)/usr/share/doc/$(p_src)/ + find $(d_src)/usr/share/doc/$(p_src) -maxdepth 1 -type f ! -name copyright | xargs gzip -9 + + $(install_dir) $(d_src)/DEBIAN + $(install_dir) $(d_src)/usr/src/binutils/patches + $(install_file) debian/patches/* $(d_src)/usr/src/binutils/patches/ + chmod 755 $(d_src)/usr/src/binutils/patches/*.dpatch + tar -c --bzip2 -C .. --exclude=CVS \ + -f $(pwd)/$(d_src)/usr/src/binutils/binutils-$(VERSION).tar.bz2 \ + $(source_files) + + dpkg-gencontrol -isp -P$(d_src) -p$(p_src) + chown -R root:root $(d_src) + chmod -R go=rX $(d_src) + dpkg --build $(d_src) .. + + +################################################################################ + +####################### +# binary-arch target # +####################### + +binary-arch: checkroot build install + $(checkdir) + + : # make lintian happy + $(install_file) -D debian/$(p_bin).overrides \ + $(d_bin)/usr/share/lintian/overrides/$(p_bin) +ifeq ($(with_multiarch),yes) + $(install_file) -D debian/$(p_mul).overrides \ + $(d_mul)/usr/share/lintian/overrides/$(p_mul) +endif +ifeq ($(DEB_HOST_ARCH),hppa) + $(install_file) -D debian/$(p_hppa64).overrides \ + $(d_hppa64)/usr/share/lintian/overrides/$(p_hppa64) +endif +ifeq ($(with_gold),yes) + $(install_file) -D debian/$(p_gold).overrides \ + $(d_gold)/usr/share/lintian/overrides/$(p_gold) +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + $(install_file) -D debian/$(p_spu).overrides \ + $(d_spu)/usr/share/lintian/overrides/$(p_spu) +endif + + : # install maintainer scrtips + $(install_dir) $(d_bin)/DEBIAN + $(install_script) debian/binutils.postinst $(d_bin)/DEBIAN/postinst + $(install_script) debian/binutils.postrm $(d_bin)/DEBIAN/postrm + $(install_file) debian/binutils.shlibs $(d_bin)/DEBIAN/shlibs + + $(install_dir) $(d_dev)/DEBIAN + +ifeq ($(with_multiarch),yes) + $(install_dir) $(d_mul)/DEBIAN + $(install_script) debian/binutils-multiarch.postinst $(d_mul)/DEBIAN/postinst + $(install_script) debian/binutils-multiarch.postrm $(d_mul)/DEBIAN/postrm + $(install_script) debian/binutils-multiarch.preinst $(d_mul)/DEBIAN/preinst + $(install_file) debian/binutils-multiarch.shlibs $(d_mul)/DEBIAN/shlibs +endif + +ifeq ($(with_static),yes) + $(install_dir) $(d_static)/DEBIAN + $(install_script) debian/binutils-static.preinst $(d_static)/DEBIAN/preinst + $(install_dir) $(d_udeb)/DEBIAN +endif + +ifeq ($(with_gold),yes) + $(install_dir) $(d_gold)/DEBIAN + $(install_script) debian/binutils-gold.postrm $(d_gold)/DEBIAN/postrm + $(install_script) debian/binutils-gold.preinst $(d_gold)/DEBIAN/preinst +endif + +ifeq ($(DEB_HOST_ARCH),hppa) + $(install_dir) $(d_hppa64)/DEBIAN + $(install_script) debian/binutils-hppa64.postinst $(d_hppa64)/DEBIAN/postinst + $(install_script) debian/binutils-hppa64.postrm $(d_hppa64)/DEBIAN/postrm + $(install_file) debian/binutils-hppa64.shlibs $(d_hppa64)/DEBIAN/shlibs +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + $(install_dir) $(d_spu)/DEBIAN + $(install_script) debian/binutils-spu.postinst $(d_spu)/DEBIAN/postinst + $(install_script) debian/binutils-spu.postrm $(d_spu)/DEBIAN/postrm + $(install_file) debian/binutils-spu.shlibs $(d_spu)/DEBIAN/shlibs +endif + + : # install docs + $(install_dir) $(d_bin)/usr/share/doc/$(p_bin)/ + $(install_file) debian/changelog $(d_bin)/usr/share/doc/$(p_bin)/changelog.Debian + $(install_file) debian/copyright $(d_bin)/usr/share/doc/$(p_bin)/ + +ifeq ($(with_static),yes) + $(install_dir) $(d_static)/usr/share/doc/$(p_static)/ + $(install_file) debian/changelog $(d_static)/usr/share/doc/$(p_static)/changelog.Debian + $(install_file) debian/copyright $(d_static)/usr/share/doc/$(p_static)/ +endif + + $(install_dir) $(d_dev)/usr/share/doc/ + ln -sf $(p_bin) $(d_dev)/usr/share/doc/$(p_dev) +ifeq ($(with_multiarch),yes) + $(install_dir) $(d_mul)/usr/share/doc/ + ln -sf $(p_bin) $(d_mul)/usr/share/doc/$(p_mul) +endif +ifeq ($(with_gold),yes) + $(install_dir) $(d_gold)/usr/share/doc/ + ln -sf $(p_bin) $(d_gold)/usr/share/doc/$(p_gold) +endif +ifeq ($(DEB_HOST_ARCH),hppa) + $(install_dir) $(d_hppa64)/usr/share/doc/ + ln -sf $(p_bin) $(d_hppa64)/usr/share/doc/$(p_hppa64) +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + $(install_dir) $(d_spu)/usr/share/doc/ + ln -sf $(p_bin) $(d_spu)/usr/share/doc/$(p_spu) +endif + +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +ifeq ($(with_check),yes) + $(install_file) $(pwd)/test-summary $(d_bin)/usr/share/doc/$(p_bin)/ +endif +endif + $(install_file) binutils/NEWS debian/README.cross \ + $(d_bin)/usr/share/doc/$(p_bin)/ + + $(install_file) binutils/ChangeLog $(d_bin)/usr/share/doc/$(p_bin)/changelog + + for pkg in bfd gas gprof ld; do \ + $(install_dir) $(d_bin)/usr/share/doc/$(p_bin)/$$pkg; \ + done + $(install_file) bfd/ChangeLog bfd/PORTING bfd/TODO \ + $(d_bin)/usr/share/doc/$(p_bin)/bfd/ + $(install_file) gas/ChangeLog gas/NEWS $(d_bin)/usr/share/doc/$(p_bin)/gas/ + $(install_file) gprof/ChangeLog gprof/TODO gprof/TEST \ + $(d_bin)/usr/share/doc/$(p_bin)/gprof/ + $(install_file) ld/ChangeLog ld/TODO ld/NEWS \ + $(d_bin)/usr/share/doc/$(p_bin)/ld/ + + : # These only exist in H. J. Lu releases not GNU ones. + for dir in binutils bfd gas gprof ld; do \ + if [ -f $$dir/ChangeLog.linux ]; then \ + $(install_file) $$dir/ChangeLog.linux $(d_bin)/usr/share/doc/$(p_bin)/$$dir/; \ + fi; \ + done + + : # Copy bbconv.pl to the doc dir for use by interested people + $(install_file) gprof/bbconv.pl $(d_bin)/usr/share/doc/$(p_bin)/gprof/. + + : # Compress stuff that needs it + gzip -9 $(d_bin)/usr/share/man/man1/*.1 + find $(d_bin)/usr/share/doc/$(p_bin)/ -type f ! -name copyright -a ! -name bbconv.pl | xargs gzip -9 +ifeq ($(with_static),yes) + find $(d_static)/usr/share/doc/$(p_static)/ -type f ! -name copyright | xargs gzip -9 +endif + + : # Finish it all up + find $(d_bin) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_bin) -p$(p_bin) $(CONFLICTS) + + rm -f debian/substvars + dpkg-gencontrol -isp -P$(d_dev) -p$(p_dev) + +ifeq ($(with_multiarch),yes) + rm -f debian/substvars + find $(d_mul) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_mul) -p$(p_mul) +endif + +ifeq ($(with_static),yes) + dpkg-gencontrol -isp -P$(d_static) -p$(p_static) + dpkg-gencontrol -isp -P$(d_udeb) -p$(p_udeb) -fdebian/files~ + dpkg-distaddfile $(STATIC_UDEB) debian-installer optional +endif + +ifeq ($(with_gold),yes) + rm -f debian/substvars + find $(d_gold) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_gold) -p$(p_gold) +endif +ifeq ($(DEB_HOST_ARCH),hppa) + rm -f debian/substvars + find $(d_hppa64) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_hppa64) -p$(p_hppa64) +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + rm -f debian/substvars + find $(d_spu) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps + dpkg-gencontrol -isp -P$(d_spu) -p$(p_spu) +endif + + chown -R root:root $(d_bin) $(d_dev) + chmod -R go=rX $(d_bin) $(d_dev) + dpkg --build $(d_bin) .. + dpkg --build $(d_dev) .. +ifeq ($(with_multiarch),yes) + chown -R root:root $(d_mul) + chmod -R go=rX $(d_mul) + dpkg --build $(d_mul) .. +endif +ifeq ($(with_static),yes) + chown -R root:root $(d_static) $(d_udeb) + chmod -R go=rX $(d_static) $(d_udeb) + dpkg --build $(d_static) .. + dpkg --build $(d_udeb) ../$(STATIC_UDEB) +endif +ifeq ($(with_gold),yes) + chown -R root:root $(d_gold) + chmod -R go=rX $(d_gold) + dpkg --build $(d_gold) .. +endif +ifeq ($(DEB_HOST_ARCH),hppa) + chown -R root:root $(d_hppa64) + chmod -R go=rX $(d_hppa64) + dpkg --build $(d_hppa64) .. +endif +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc ppc64)) + chown -R root:root $(d_spu) + chmod -R go=rX $(d_spu) + dpkg --build $(d_spu) .. +endif + +################################################################################ + +################# +# cross targets # +################# + +# If $(TARGET) is not set, try reading debian/target +ifeq ($(TARGET),) +TARGET := $(shell cat debian/target 2>/dev/null) +endif + +# Process the following only if $(TARGET) is set +ifneq ($(TARGET),) + +# Support TARGET both as Debian architecture specification (e.g. arm), +# and as the target name (e.g. arm-linux-gnu). +try_convert := $(shell dpkg-architecture -f -a$(TARGET) -qDEB_HOST_GNU_TYPE 2>/dev/null) +ifneq ($(try_convert),) +override TARGET := $(try_convert) +endif + +p_cross = $(subst _,-,binutils-$(TARGET)) +d_cross = debian/$(p_cross) + +ifneq ($(filter sparc-linux-gnu powerpc-linux-gnu mips-linux-gnu, $(TARGET)),) +ADDITIONAL_TARGETS = --enable-targets=$(TARGET:%-linux-gnu=%64-linux-gnu) +endif +ifneq ($(filter i386-linux-gnu i486-linux-gnu i586-linux-gnu x86-linux-gnu, $(TARGET)),) +ADDITIONAL_TARGETS = --enable-targets=x86_64-linux-gnu +endif +ifneq ($(filter i386-kfreebsd-gnu i486-kfreebsd-gnu i586-kfreebsd-gnu x86-kfreebsd-gnu, $(TARGET)),) +ADDITIONAL_TARGETS = --enable-targets=x86_64-linux-gnu +endif +ifeq ($(TARGET), x86_64-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=i486-linux-gnu +endif +ifeq ($(TARGET), x86_64-kfreebsd-gnu) +ADDITIONAL_TARGETS = --enable-targets=i486-kfreebsd-gnu +endif +ifeq ($(TARGET), mipsel-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=mips64el-linux-gnu +endif +ifeq ($(TARGET), sparc64-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=sparc-linux-gnu +endif +ifeq ($(TARGET), s390-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=s390x-linux-gnu +endif +ifeq ($(TARGET), s390x-linux-gnu) +ADDITIONAL_TARGETS = --enable-targets=s390-linux-gnu +endif + +#----------------------------------------------------------------- +# sysroot options +ifdef WITH_SYSROOT + with_sysroot = $(WITH_SYSROOT) +endif +ifdef WITH_BUILD_SYSROOT + with_build_sysroot = $(WITH_BUILD_SYSROOT) +endif + +ifneq ($(with_sysroot),) + CONFARGS += --with-sysroot=$(with_sysroot) +endif +ifneq ($(with_build_sysroot),) + CONFARGS += --with-build-sysroot=$(with_build_sysroot) +endif + +configure-$(TARGET)-stamp: patch-stamp + $(checkdir) + test "" != "$(TARGET)" + rm -rf configure-$(TARGET)-stamp builddir-$(TARGET) + mkdir builddir-$(TARGET) + cd builddir-$(TARGET) \ + && env CC="$(CC)" CXX="$(CXX)" ../configure --host=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) --target=$(TARGET) --prefix=/usr \ + $(ADDITIONAL_TARGETS) $(CONFARGS) + touch $@ + +build-$(TARGET)-stamp: configure-$(TARGET)-stamp + $(checkdir) + test "" != "$(TARGET)" + $(MAKE) -C builddir-$(TARGET) $(NJOBS) CFLAGS="$(CFLAGS)" + touch $@ + +install-$(TARGET)-stamp: build-$(TARGET)-stamp + $(checkdir) + test "" != "$(TARGET)" + rm -rf $(d_cross) + $(MAKE) -C builddir-$(TARGET) prefix=$(pwd)/$(d_cross)/usr \ + mandir=$(pwd)/$(d_cross)/usr/share/man \ + infodir=$(pwd)/$(d_cross)/usr/share/info install + rm -rf $(d_cross)/usr/lib* $(d_cross)/usr/share/info $(d_cross)/usr/share/locale +ifeq ($(with_strip),yes) + $(STRIP) $$(file $(d_cross)/usr/bin/* | awk -F: '$$0 !~ /script/ {print $$1}') +endif + gzip -9 $(d_cross)/usr/share/man/man1/* + touch $@ + +binary-cross: checkroot install-$(TARGET)-stamp + $(checkdir) + test "" != "$(TARGET)" + + sed "/^$$/ q" < debian/control > debian/control.$(TARGET) + sed -e "s/__TARGET__/$$(echo -n $(TARGET) | sed s/_/-/g)/" \ + < debian/control.cross.in >> debian/control.$(TARGET) + + $(install_dir) $(d_cross)/DEBIAN + + $(install_dir) $(d_cross)/usr/share/doc/$(p_cross)/ + $(install_file) debian/changelog $(d_cross)/usr/share/doc/$(p_cross)/changelog.Debian + $(install_file) debian/copyright debian/README.cross $(d_cross)/usr/share/doc/$(p_cross)/ + gzip -9f $(d_cross)/usr/share/doc/$(p_cross)/changelog.Debian + + for pkg in bfd gas gprof ld; do \ + ln -sf ../binutils/$$pkg $(d_cross)/usr/share/doc/$(p_cross)/$$pkg; \ + done + + rm -f debian/substvars + dpkg-shlibdeps $(d_cross)/usr/bin/* + dpkg-gencontrol -isp -cdebian/control.$(TARGET) -P$(d_cross) -p$(p_cross) + dpkg --build $(d_cross) .. + +clean-cross: unpatch + $(checkdir) + test "" != "$(TARGET)" + rm -rf $(d_cross) debian/control.$(TARGET) debian/files debian/substvars \ + builddir-$(TARGET) {configure,build,install}-$(TARGET)-stamp + +.PHONY: binary-cross clean-cross + +endif + +################################################################################ + +define checkdir + test -f bfd/elf32.c -a -f debian/rules +endef + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot --- binutils-2.20.1.orig/debian/copyright +++ binutils-2.20.1/debian/copyright @@ -0,0 +1,43 @@ +This is the Debian GNU/Linux prepackaged version of the GNU assembler, +linker, and binary utilities. + +This package was put together by me, James Troup , +from sources, which I obtained from: + + ftp://ftp.gnu.org/pub/gnu/binutils/ + +and: + + cvs://:pserver:anoncvs@sources.redhat.com:/cvs/src + +It was previously maintained by Christopher C. Chimelis + +GNU Binutils is Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, +1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 3 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL' +and `/usr/share/common-licenses/LGPL'. + +The binutils manuals and associated documentation are also Copyright +(C) Free Software Foundation, Inc. They are distributed under the GNU +Free Documentation License Version 1.1 or any later version published +by the Free Software Foundation; with no Invariant Sections, with no +n Debian GNU/Linux systems, the complete text of the GFDL can be found +in `/usr/share/common-licenses/GFDL'. --- binutils-2.20.1.orig/debian/binutils-hppa64.shlibs +++ binutils-2.20.1/debian/binutils-hppa64.shlibs @@ -0,0 +1,2 @@ +libbfd 2.20.1-hppa64.20100303 binutils-hppa64 (>= 2.20.1), binutils-hppa64 (<< 2.20.2) +libopcodes 2.20.1-hppa64.20100303 binutils-hppa64 (>= 2.20.1), binutils-hppa64 (<< 2.20.2) --- binutils-2.20.1.orig/debian/binutils-gold.postrm +++ binutils-2.20.1/debian/binutils-gold.postrm @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +if [ "$1" = "remove" -o "$1" = "abort-install" ]; then + dpkg-divert \ + --package binutils-gold \ + --remove --rename \ + --divert /usr/bin/ld.bfd-link /usr/bin/ld +fi --- binutils-2.20.1.orig/debian/binutils-multiarch.overrides +++ binutils-2.20.1/debian/binutils-multiarch.overrides @@ -0,0 +1,10 @@ +# don't warn about missing man pages for diverted binaries +binutils-multiarch binary: binary-without-manpage + +# the API of the shared libs is not public, don't care about the name +binutils-multiarch binary: package-name-doesnt-match-sonames + +# not in binutils-multiarch, just move these away +binutils-multiarch: diversion-for-unknown-file usr/lib/libopcodes.a preinst:19 +binutils-multiarch: diversion-for-unknown-file usr/lib/libbfd.a preinst:16 + --- binutils-2.20.1.orig/debian/README.source +++ binutils-2.20.1/debian/README.source @@ -0,0 +1,2 @@ +The package uses dpatch to apply patches on top of the upstream source. +See /usr/share/doc/dpatch/README.source.gz. --- binutils-2.20.1.orig/debian/changelog +++ binutils-2.20.1/debian/changelog @@ -0,0 +1,3652 @@ +binutils (2.20.1-3ubuntu7.3) lucid-proposed; urgency=medium + + * gold: Add -fuse-ld= for GCC linker option compatibility. LP: #1438244. + + -- Matthias Klose Mon, 30 Mar 2015 17:08:48 +0200 + +binutils (2.20.1-3ubuntu7.2) lucid-security; urgency=medium + + * SECURITY UPDATE: integer overflow in objalloc_alloc + - debian/patches/300-CVE-2012-3509.dpatch: Add overflow check + covering alignment and CHUNK_HEADER_SIZE addition. + - CVE-2012-3509 + * SECURITY UPDATE: out-of-bounds read in srec_scan of bfd/srec.c + - debian/patches/301-CVE-2014-8484.dpatch: report an error for + S-records with less than the miniumum size + - CVE-2014-8484 + * SECURITY UPDATE: incorrect memory handling around corrupt group + section headers + - debian/patches/302-CVE-2014-8485.dpatch: Improve handling of + corrupt group sections + - CVE-2014-8485 + * SECURITY UPDATE: out-of-bounds write in _bfd_XXi_swap_aouthdr_in + - debian/patches/303-CVE-2014-8501.dpatch: Handle corrupt binaries + with an invalid value for NumberOfRvaAndSizes. + - CVE-2014-8501 + * SECURITY UPDATE: pe_print_edata buffer overflow + - debian/patches/304-CVE-2014-8502.dpatch: Detect out of + range and truncated rvas or entry counts + - CVE-2014-8502 + * SECURITY UPDATE: ihex_scan buffer overflow + - debian/patches/305-CVE-2014-8503.dpatch: Fix typo in + invocation of ihex_bad_byte. + - CVE-2014-8503 + * SECURITY UPDATE: srec_scan buffer overflow + - debian/patches/306-CVE-2014-8504.dpatch: Increase size of buf + - CVE-2014-8504 + * SECURITY UPDATE: directory traversal vulnerabilities + - debian/patches/307-CVE-2014-8737.dpatch: disallow paths that + include ../ + - CVE-2014-8737 + * SECURITY UPDATE: _bfd_slurp_extended_name_table out-of-bounds write + - debian/patches/308-CVE-2014-8738.dpatch: Handle archives + with corrupt extended name tables. + - CVE-2014-8738 + * SECURITY UPDATE: multiple miscellaneous overflows and out-of-bounds + reads and writes + - debian/patches/309-bz17512-misc.dpatch: fix invalid memory + accesses. + * Security hardening: don't use libbfd by default in strings(1) + - debian/patches/310-harden_strings.dpatch: Add new command + line option --data to only scan the initialized, loadable data + sections of binaries, using libbfd; make --all the default. + + -- Steve Beattie Mon, 09 Feb 2015 02:27:20 -0800 + +binutils (2.20.1-3ubuntu7.1) lucid-security; urgency=low + + * No change rebuild to pull binutils into lucid-security to fix + upcoming openjdk-6b18 update build failure. + + -- Steve Beattie Thu, 03 Mar 2011 18:55:04 -0800 + +binutils (2.20.1-3ubuntu7) lucid-proposed; urgency=low + + * Fix --no-add-needed with weak symbols (Kirill Smelkov). LP: #619878. + + -- Matthias Klose Wed, 18 Aug 2010 16:47:29 +0200 + +binutils (2.20.1-3ubuntu6) lucid-proposed; urgency=low + + * Apply proposed patch for ARM: Add option to disable merging of adjacent + exidx unwinder entries. Addresses PR libgcj/40860. LP: #593564. + * Fix PR gold/10893, IFUNC support for gold backported from the trunk. + LP: #582754. + + -- Matthias Klose Mon, 14 Jun 2010 10:18:35 +0200 + +binutils (2.20.1-3ubuntu5) lucid; urgency=low + + * Rebuild statically linked ld.static binary against recent libc. + + -- Matthias Klose Sun, 18 Apr 2010 23:50:53 +0200 + +binutils (2.20.1-3ubuntu4) lucid; urgency=low + + * Apply patch for PR gas/11456: Use memcpy to copy overlap memory. + + -- Matthias Klose Wed, 31 Mar 2010 19:10:39 +0200 + +binutils (2.20.1-3ubuntu3) lucid; urgency=low + + * Fix versioned dependency in binutils shlibs file. + + -- Matthias Klose Wed, 31 Mar 2010 04:02:51 +0200 + +binutils (2.20.1-3ubuntu2) lucid; urgency=low + + * Mangle the soname of the binutils libraries to be different than + the default name. Closes: #557620. LP: #548451. + Packaged cross builds should do the same. + * Apply fix for PR ld/11426, taken from the trunk. + + -- Matthias Klose Tue, 30 Mar 2010 23:46:50 +0200 + +binutils (2.20.1-3ubuntu1) lucid; urgency=low + + * Merge with Debian; remaining changes: + - Build binutils-static. + + -- Matthias Klose Sun, 21 Mar 2010 13:42:52 +0100 + +binutils (2.20.1-3) unstable; urgency=low + + * binutils-gold: Install the gold binary as `gold' as well, as proposed + by a patch to enable both gold and ld in a single toolchain. + + -- Matthias Klose Sun, 21 Mar 2010 06:43:48 +0100 + +binutils (2.20.1-2ubuntu1) lucid; urgency=low + + * Merge with Debian; remaining changes: + - Build binutils-static. + + -- Matthias Klose Mon, 08 Mar 2010 18:25:25 +0100 + +binutils (2.20.1-2) unstable; urgency=low + + * Fix version in debian/*shlibs to match the release version; + the 2.20.1 upstream release identifies as 2.20.1.20100303. + + -- Matthias Klose Mon, 08 Mar 2010 18:01:22 +0100 + +binutils (2.20.1-1ubuntu1) lucid; urgency=low + + * Merge with Debian; remaining changes: + - Build binutils-static. + + -- Matthias Klose Mon, 08 Mar 2010 13:11:53 +0100 + +binutils (2.20.1-1) unstable; urgency=low + + * New upstream release. + * Don't set has_ifunc_symbols if the symbol comes from a shared library + (backport from the trunk). + * Don't include documentation files in the -cross packages. + Closes: #571522. LP: #514509. + * Fix typo in ld documentation. LP: #497923. + * Add readelf --unwind support for ARM. + + -- Matthias Klose Mon, 08 Mar 2010 04:47:46 +0100 + +binutils (2.20-6ubuntu3) lucid; urgency=low + + * Apply updates from the 2.20 branch up to 20100216 + - Apply patch to fix R_ARM_THM_JUMP24 relocation truncated bug. + * Don't set has_ifunc_symbols if the symbol comes from a shared library + (backport from the trunk). + + -- Matthias Klose Fri, 19 Feb 2010 17:19:09 +0100 + +binutils (2.20-6ubuntu2) lucid; urgency=low + + * Apply updates from the 2.20 branch up to 20100216 + - Fix broken global Thumb to ARM branches. + + -- Matthias Klose Tue, 16 Feb 2010 18:32:35 +0100 + +binutils (2.20-6ubuntu1) lucid; urgency=low + + * Merge with Debian; remaining changes: + - Build binutils-static. + + -- Matthias Klose Fri, 05 Feb 2010 20:30:59 +0100 + +binutils (2.20-6) unstable; urgency=low + + * Apply updates from the 2.20 branch up to 20100205 + - 135_arm_dis_thumb2.dpatch: Remove, applied upstream. + - 136_gold_gnu_debuglink.dpatch: Remove, applied upstream. + * armel: Fix ld-shared/shared.exp and ld-elfvsb/elfvsb.exp failures + (proposed patch, Matthew Gretton-Dann). Closes: #564685. LP: #446478. + * Fix PR other/42602: demangling a global constructors symbol. + Closes: #561150. + + -- Matthias Klose Fri, 05 Feb 2010 20:01:20 +0100 + +binutils (2.20-5ubuntu1) lucid; urgency=low + + * Merge with Debian; remaining changes: + - Build binutils-static. + + -- Matthias Klose Sat, 09 Jan 2010 12:13:43 +0100 + +binutils (2.20-5) unstable; urgency=low + + * Apply updates from the 2.20 branch up to 20100109 + * Apply patches from the trunk: + - [arm] Prevent disassembler from aborting on an invalid Thumb2 instruction. + - Fix PR gold/11072: Discard .gnu_debuglink sections. Closes: #563366. + - Fix PR ld/11138: internal error when DSO is before object files. + Closes: #562822. + - Fix PR gold/11042: COPY relocs need for the dynamic object. + Closes: #559183. + - Fix PR gold/10916: Fix --exclude-libs with undefined symbol. + Closes: #555012. + - Fix PR gold/10979: gold linker crashes. Closes: #553916. + - Fix PR gas/10740: Intel syntax far jumps broken. Closes: #541535. + + -- Matthias Klose Sat, 09 Jan 2010 10:43:04 +0100 + +binutils (2.20-4ubuntu4) lucid; urgency=low + + * ARM - Fix b / bl ranges for Thumb2 (Ramana Radhakrishnan). + + -- Matthias Klose Mon, 21 Dec 2009 13:38:09 +0100 + +binutils (2.20-4ubuntu3) lucid; urgency=low + + * [arm] Prevent disassembler from aborting on an invalid Thumb2 instruction, + taken from the trunk. + + -- Matthias Klose Thu, 19 Nov 2009 18:48:28 +0100 + +binutils (2.20-4ubuntu1) lucid; urgency=low + + * On armel build with -marm; the testsuite is not ready to be run with + -mthumb. + + -- Matthias Klose Thu, 12 Nov 2009 01:10:33 +0100 + +binutils (2.20-4) unstable; urgency=low + + * Fix binutils-gold update. Closes: #555734. + * Don't configure gold for spu on powerpc. + + -- Matthias Klose Wed, 11 Nov 2009 23:33:20 +0100 + +binutils (2.20-3ubuntu1) lucid; urgency=low + + * Merge with Debian; remaining changes: + - Build binutils-static. + + -- Matthias Klose Tue, 10 Nov 2009 11:14:38 +0100 + +binutils (2.20-3) unstable; urgency=low + + * Apply updates from the 2.20 branch up to 20091108: + - Fix PR gold/10876 (closes: #553435), PR gold/10910, PR gold/10860, + PR gold/10880 (closes: #553512, #553436), PR gold/10887, + PR gold/10893, PR gold/10895 (thanks to Peter Fritzsche for tracking + the gold reports). + * Fix libiberty build failure on sh4 (Nobuhiro Iwamatsu). Closes: #550810. + * PR ld/10858: Fix pie on mips/mipsel. Closes: #526961. + * Ignore regressions on sparc; the proper fix is to fix the testcases + for v9. + * Remove the conflict between binutils-multiarch and binutils-gold. + Closes: #521106. + + -- Matthias Klose Tue, 10 Nov 2009 02:15:41 +0100 + +binutils (2.20-2) unstable; urgency=high + + * Apply updates from the 2.20 branch up to 20091028: + - Fix PR binutils/10802, PR binutils/10793, PR binutils/10792, + PR gas/10856. + - Remove local patches now in the branch. + * Ignore regressions on armel when building with gcc-4.4; the proper fix + is to build the testcases using -fno-section-anchors. + + -- Matthias Klose Thu, 29 Oct 2009 22:17:42 +0100 + +binutils (2.20-1ubuntu3) lucid; urgency=low + + * Work around build failure on powerpc, disable the gold build; re-enable + it later with a proper fix. + * Ignore regressions on sparc; the proper fix is to fix the testcases + for v9. + + -- Matthias Klose Sat, 31 Oct 2009 12:21:59 +0100 + +binutils (2.20-1ubuntu2) lucid; urgency=low + + * Don't build just on armel and i386. + + -- Matthias Klose Fri, 30 Oct 2009 14:51:13 +0100 + +binutils (2.20-1ubuntu1) lucid; urgency=low + + * Apply updates from the 2.20 branch up to 20091028: + - Fix PR binutils/10802, PR binutils/10793, PR binutils/10792, + PR gas/10856. + - Remove local patches now in the branch. + * Ignore regressions on armel; the proper fix is to build the + testcases using -fno-section-anchors. + + -- Matthias Klose Fri, 30 Oct 2009 01:27:43 +0100 + +binutils (2.20-1) unstable; urgency=low + + * binutils 2.20 final release. + - Fix PR binutils/10785, memory corruptions. + - PR ld/10749, ia64 linker failure. + - PR gas/2117, ia64 assembler fix. + - gold updates. + * Configure with --enable-plugins. Closes: #550088. + * debian/test-suite-compare.py: Don't count untested test cases as + regressions. + * binutils-gold: Install /usr/lib/compat-ld/ld to point to the + old linker. To use the old linker when gold is installed, use + gcc -B/usr/lib/compat-ld/ (including the trailing slash). + + -- Matthias Klose Sat, 17 Oct 2009 12:22:30 +0200 + +binutils (2.20-0ubuntu2) karmic-proposed; urgency=low + + * Fix PR gas/10856, wrong code with assembler files in intel syntax. + Patch taken from the 2.20 branch. LP: #461303. + + -- Matthias Klose Wed, 28 Oct 2009 09:46:50 +0100 + +binutils (2.20-0ubuntu1) karmic; urgency=low + + * binutils 2.20 final release. + - Fix PR binutils/10785, memory corruptions. + - gold updates. LP: #453278. + * debian/*.shlibs: Update to the release version. LP: #452526. + * Fix build failure on arm, building from the release tarball. + + -- Matthias Klose Sat, 17 Oct 2009 11:14:00 +0200 + +binutils (2.19.91.20091014-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20091014. + - PR ld/10749, ia64 linker failure. + - PR gas/2117, ia64 assembler fix. + * debian/*.shlibs: Update to the version from the branch. + * Fix build failures for cross build. + + -- Matthias Klose Wed, 14 Oct 2009 14:55:40 +0200 + +binutils (2.19.91.20091006-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20091006. + - cfi_sections changes applied, remove 129_cfi_sections.dpatch. + * debian/*.shlibs: Update to the version from the branch. + * binutils-gold: Build the testsuite as part of the check target + instead of the build target to avoid build failures when the + installed binutils soname is the same as the one which is built + (gas is segfaulting). Just a workaround, not a solution. + + -- Matthias Klose Tue, 06 Oct 2009 18:14:37 +0200 + +binutils (2.19.91.20091005-0ubuntu2) karmic; urgency=low + + * Really re-enable the binutils-gold build on powerpc. + + -- Matthias Klose Tue, 06 Oct 2009 13:53:22 +0200 + +binutils (2.19.91.20091005-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20091005. + - no changes, bump the soname only. + * debian/*.shlibs: Update to the version from the branch. + * Re-enable the binutils-gold build on powerpc. + * Add 129_cfi_sections.dpatch, support for .cfi_sections, taken + from the trunk. LP: #440172. + * Add 150_gold_copyrelocs.dpatch, add -z copyrelocs option for gold. + + -- Matthias Klose Tue, 06 Oct 2009 10:31:58 +0200 + +binutils (2.19.91.20091003-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20091003. + - powerpc fixes. + * debian/*.shlibs: Update to the version from the branch. + * Reenable binutils-gold build on armel (build failures on just + one buildd). + * Disable binutils-gold build on powerpc, fails to build with the + version in the archive. + * binutils-source: Depend on texinfo, zlib1g-dev. + + -- Matthias Klose Tue, 06 Oct 2009 10:16:47 +0200 + +binutils (2.19.91.20091001-0ubuntu2) karmic; urgency=low + + * Don't build binutils-gold for armel, currently ftbfs. + + -- Matthias Klose Thu, 01 Oct 2009 23:54:41 +0200 + +binutils (2.19.91.20091001-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20091001. + - Fix PR ld/9863, regression in testsuite on armel. + - Fix regressions seen in the GCC/libjava testsuite. + * debian/*.shlibs: Update to the version from the branch. + * No need to build libiberty_pic.a twice. + + -- Matthias Klose Thu, 01 Oct 2009 16:53:04 +0200 + +binutils (2.19.91.20090923-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20090923 (last upload + was taken from the trunk).. + * debian/*.shlibs: Update to the version from the branch. + + -- Matthias Klose Wed, 23 Sep 2009 09:44:40 +0200 + +binutils (2.19.91.20090922-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20090922. + * debian/*.shlibs: Update to the version from the branch. + + -- Matthias Klose Tue, 22 Sep 2009 22:01:19 +0200 + +binutils (2.19.91.20090910-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20090910, corresponding + to the 2.19.90 upstream snapshot. + * Fix Thumb-2 shared libraries (Daniel Jacobowitz), patch taken + from the trunk. + * Update binutils-sec64k patch (H.J. Lu). + + -- Matthias Klose Thu, 10 Sep 2009 17:21:56 +0200 + +binutils (2.19.90.20090909-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the 2.20 release branch 20090909. + * debian/*.shlibs: Update to the version from the branch. + + -- Matthias Klose Wed, 09 Sep 2009 10:01:29 +0200 + +binutils (2.19.51.20090827-1ubuntu1) karmic; urgency=low + + * Merge with Debian unstable; remaining changes: + - Build binutils-static and binutils-static-udeb packages. + - Apply patches derived from the binutils HJL release. + + -- Matthias Klose Fri, 28 Aug 2009 13:49:57 +0200 + +binutils (2.19.51.20090827-1) unstable; urgency=low + + * Snapshot, taken from the trunk 20090827. + - Fix PR ld/10518: In linker scripts override a "*" match by any other + wildcard match. Closes: #540751. + * debian/*.shlibs: Update to the version from the trunk. Closes: #540800. + * Add sysroot support for cross builds (Hector Oron). Closes: #522480. + * Update long description of binutils-doc. Closes: #428764. + * Update build-dependency on autoconf. + * Fix some lintian warnings. + + -- Matthias Klose Thu, 27 Aug 2009 17:09:28 +0200 + +binutils (2.19.51.20090805-1ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090805. + * debian/*.shlibs: Update to the version from the trunk. + - Fix PR binutils/10364, strip not failing on unwritable files. + Closes: #276428. + - Fix PR binutils/10363, objdump -T crashing on corrupted file. + Closes: #487963. + * 129_cortex_a8.dpatch: Fix a couple of cortex-a8 erratum bugs. + + -- Matthias Klose Wed, 05 Aug 2009 10:29:44 +0200 + +binutils (2.19.51.20090723-1ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090723. + * debian/*.shlibs: Update to the version from the trunk. + * Apply build-id patch to avoid memory corruption (taken from Fedora). + + -- Matthias Klose Thu, 23 Jul 2009 13:47:19 +0200 + +binutils (2.19.51.20090714-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090714. + - Fix PR gas/10387 (branch instruction with no operand causes gas + to segfault on armel). LP: #396049. + - 128_arm_eabi_align64.dpatch: Remove, integrated upstream. + * debian/*.shlibs: Update to the version from the trunk. + + -- Matthias Klose Tue, 14 Jul 2009 12:48:09 -0400 + +binutils (2.19.51.20090713-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090713. + * debian/*.shlibs: Update to the version from the trunk. + * 128_arm_eabi_align64.dpatch: Adjust expected output to changed objdump + output. LP: #398732. + + -- Matthias Klose Mon, 13 Jul 2009 13:21:56 -0400 + +binutils (2.19.51.20090704-1ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090704. + * debian/*.shlibs: Update to the version from the trunk. + + -- Matthias Klose Sat, 04 Jul 2009 11:46:03 +0200 + +binutils (2.19.51.20090704-1) unstable; urgency=low + + * Snapshot, taken from the trunk 20090704. + - debian/patches/128_arm_eabi_auto_it.dpatch: Remove, applied upstream. + * debian/*.shlibs: Update to the version from the trunk. + * Bump standards version. + + -- Matthias Klose Sat, 04 Jul 2009 10:37:18 +0200 + +binutils (2.19.51.20090622-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090622. + - debian/patches/128_arm_eabi_auto_it.dpatch: Remove, applied upstream. + * debian/*.shlibs: Update to the version from the trunk. + + -- Matthias Klose Tue, 23 Jun 2009 01:36:34 +0200 + +binutils (2.19.51.20090620-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090620. + * debian/*.shlibs: Update to the version from the trunk. + * Build the binutils-gold package on armel. + * Update hjl patches from the binutils-2.19.51.0.10 release. + + -- Matthias Klose Sat, 20 Jun 2009 22:56:32 +0200 + +binutils (2.19.51.20090616reallz0515-0ubuntu1) karmic; urgency=low + + * Reupload snapshot from trunk 20090515. + * Apply proposed patch to augment maximum alignment size to 64 (ARM gas). + * Apply proposed patch for new option for automatically generating IT blocks. + + -- Matthias Klose Wed, 17 Jun 2009 23:02:25 +0000 + +binutils (2.19.51.20090515-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090515. + - Fix PR ld/10152. LP: #375991. + * Revert work-around from last upload. + * debian/*.shlibs: Update to the version from the trunk. + * Build the binutils-gold package again. + + -- Matthias Klose Fri, 15 May 2009 16:34:56 +0200 + +binutils (2.19.51.20090508-0ubuntu2) karmic; urgency=low + + * Revert change for ARM unwind table linker processing. Addresses #375991. + + -- Matthias Klose Wed, 13 May 2009 17:46:20 +0200 + +binutils (2.19.51.20090508-0ubuntu1) karmic; urgency=low + + * Snapshot, taken from the trunk 20090508. + * debian/*.shlibs: Update to the version from the trunk. + + -- Matthias Klose Fri, 08 May 2009 11:22:40 +0200 + +binutils (2.19.51.20090423-0ubuntu2) karmic; urgency=low + + * Snapshot, taken from the trunk 20090423. + * debian/*.shlibs: Update to the version from the trunk. + * Fix build failure when building with -Os. + * debian/patches/013_bash_in_ld_testsuite.dpatch: Update. + + -- Matthias Klose Fri, 24 Apr 2009 12:29:23 +0200 + +binutils (2.19.1-0ubuntu3) jaunty; urgency=low + + * Re-add -a to dpkg-architecture call; the addition of -f is all what's + needed to ignore the dpkg-architecture env set by dpkg-buildpackage (since + we don't care about the DEB_BUILD_* or DEB_HOST_* arches but only about + the TARGET arch). + + -- Loic Minier Tue, 10 Feb 2009 16:42:28 +0100 + +binutils (2.19.1-0ubuntu2) jaunty; urgency=low + + * binutils-source: Make .dpatch files executable. + * Use dpkg-architecture -f instead of -a for cross builds. + * Call pkg_create_dbgsym explicitly to build debug symbols packages. + LP: #322243. + + -- Matthias Klose Tue, 10 Feb 2009 12:05:51 +0100 + +binutils (2.19.1-0ubuntu1) jaunty; urgency=low + + * Binutils 2.19.1 release. + - 128_arm_relocs_against_weak.dpatch 129_scale-DW_CFA_advance_loc.dpatch: + Remove, applied upstream. + * debian/*.shlibs: Update to the release version. + + -- Matthias Klose Wed, 04 Feb 2009 10:14:33 +0100 + +binutils (2.19.0.20090110-0ubuntu1) jaunty; urgency=low + + * Update to the binutils-2_19-branch 20090110. + - Fix PR binutils/7011. LP: #254790. + * debian/*.shlibs: Update to the version from the branch. + + -- Matthias Klose Sat, 10 Jan 2009 13:47:35 +0100 + +binutils (2.19-0ubuntu3) jaunty; urgency=low + + * debian/patches/129_scale-DW_CFA_advance_loc.dpatch: Scale + DW_CFA_advance_loc[124] output values. + * debian/patches/128_arm_relocs_against_weak.dpatch: Fix R_ARM_THM_CALL + relocations against undefined weak symbols in shared libraries. + + -- Matthias Klose Sat, 29 Nov 2008 11:25:22 +0100 + +binutils (2.19-0ubuntu2) jaunty; urgency=low + + * No-change rebuild to remove translations from the binary package, + accidentally included due to a misbuild. + + -- Steve Langasek Fri, 21 Nov 2008 04:35:45 +0000 + +binutils (2.19-0ubuntu1) jaunty; urgency=low + + * Binutils 2.19 release. + * debian/*.shlibs: Update to the release version. + * debian/control: Update to GPL3, reference the GFDL. + * Make lintian more happy. + + -- Matthias Klose Thu, 30 Oct 2008 15:37:05 +0100 + +binutils (2.18.93.20081009-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the 2.19 branch 20081009 (corresponding to the + 2.18.93 upstream snapshot. + * debian/*.shlibs: Update to the version from the branch. + * In gprof(1), remove references to monitor(3) and profil(2). + + -- Matthias Klose Wed, 08 Oct 2008 15:27:50 +0200 + +binutils (2.18.92.20081003-0ubuntu2) intrepid; urgency=low + + * Add build dependency on zlib1g-dev. + + -- Matthias Klose Tue, 07 Oct 2008 12:52:33 +0200 + +binutils (2.18.92.20081003-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the 2.19 branch 20081003 (corresponding to the + 2.18.92 upstream snapshot. + * Stop building binutils-gold for the intrepid release (still + experimental). + * debian/*.shlibs: Update to the version from the branch. + + -- Matthias Klose Fri, 03 Oct 2008 11:16:43 +0000 + +binutils (2.18.91.20080923-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the 2.19 branch 20080923 (corresponding to the + 2.18.91 upstream snapshot. + * debian/*.shlibs: Update to the version from the branch. + * debian/patches/201-hjl-bfd-ref_addr.dpatch: Remove, integrated upstream. + * Fail the build if the testsuite shows regressions compared to the + last (installed) build. + + -- Matthias Klose Tue, 23 Sep 2008 13:22:34 +0200 + +binutils (2.18.90.20080910-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the 2.19 branch 20080910. + - No testsuite regressions on amd64, i386, lpia, sparc. + * debian/*.shlibs: Update to the version from the branch. + * debian/patches/201-hjl-bfd-ref_addr.dpatch: Update. + + -- Matthias Klose Sat, 13 Sep 2008 19:40:31 +0200 + +binutils (2.18.50.20080814-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the trunk 20080814. + * debian/*.shlibs: Update to the version from the trunk. + * debian/patches/201-hjl-bfd-ref_addr.dpatch: Update. + * debian/patches/209-hjl-binutils-error.dpatch: Likewise. + + -- Matthias Klose Thu, 14 Aug 2008 16:37:01 +0000 + +binutils (2.18.50.20080806-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the trunk 20080806. + - Fix PR ld/6656, disable gas generated debug info if compiler generated + debug info is seen. LP: #240884. Closes: #481592. + * debian/*.shlibs: Update to the version from the trunk. + * Build binutils-gold for powerpc. + + -- Matthias Klose Wed, 06 Aug 2008 08:39:52 +0200 + +binutils (2.18.50.20080707-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the trunk 20080707. + * debian/*.shlibs: Update to the version from the trunk. + * include/safe-ctype.h: Add #include of ctype.h before redefining + the ctype.h macros (proposed for the trunk). + + -- Matthias Klose Mon, 07 Jul 2008 10:21:30 +0000 + +binutils (2.18.50.20080610-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the trunk 20080610. + * debian/*.shlibs: Update to the version from the trunk. LP: #237461. + + -- Matthias Klose Tue, 10 Jun 2008 17:18:50 +0200 + +binutils (2.18.50.20080530-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the trunk 20080530. + - gold recognizes -z relro and -z norelro. + * debian/rules: Explicitely set SHELL to /bin/bash, build-depend on bash. + * debian/rules: Fix setting of TARGET for cross builds. + * binutils-static: Remove dependency on libc6. LP: #184582. + + -- Matthias Klose Fri, 30 May 2008 23:55:07 +0200 + +binutils (2.18.50.20080509-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the trunk 20080509. + * Add -Wno-format-security to CFLAGS, CXXFLAGS, due to picky default + hardening options. + * Let gold ignore -z relro and -z norelro for now. + * Build gold with -Wno-error. + + -- Matthias Klose Fri, 09 May 2008 11:09:24 +0200 + +binutils (2.18.50.20080507-0ubuntu1) intrepid; urgency=low + + * Snapshot, taken from the trunk 20080507. + * Remove patches applied upstream: 304_pr4476.dpatch, 305_arm-dis.dpatch, + 306_pr4453.dpatch, 307_ld-pic.dpatch, 308_mips-pic.dpatch, + 311_pr5006.dpatch, 312_pr5011.dpatch, 313_pr5025.dpatch. + * Update patches from the hjl releases: 200-hjl-ld-env (not applied), + 206-hjl-binutils-shr.dpatch (not applied), + * Remove patches from the hjl release: 204-hjl-binutils-tls-relro.dpatch, + 208-hjl-libtool-relink.dpatch, 209-hjl-binutils-error.dpatch, + 210-hjl-binutils-signed.dpatch, + * New patches from the hjl release: 212-hjl-bfd-64k.dpatch. + * debian/*.shlibs: Update to the version from the trunk. + * On amd64, i386, lpia and sparc, build a binutils-gold package, + diverting /usr/bin/ld. + + -- Matthias Klose Wed, 07 May 2008 17:41:05 +0200 + +binutils (2.18.1~cvs20080103-4ubuntu1) hardy; urgency=low + + * Merge with Debian unstable; remaining changes: + - Build binutils-static and binutils-static-udeb packages. + + -- Matthias Klose Tue, 22 Apr 2008 12:02:51 +0200 + +binutils (2.18.1~cvs20080103-4) unstable; urgency=medium + + * debian-rules: Remove libiberty in /usr/lib64; workaround for + `gcc -print-multi-os-directory' printing the symlink. + Closes: #473665, #473591. + * Don't include development fiiles in binutils-spu. + * Fix binutils-spu build on ppc64 (Andreas Jochens). Closes: #474116. + * Build libiberty with -fPIC on mips/mipsel (Aurelian Jarno). + + -- Matthias Klose Sat, 05 Apr 2008 11:21:08 +0200 + +binutils (2.18.1~cvs20080103-3) unstable; urgency=low + + [ Arthur Loiret ] + * Build a binutils for spu-elf target on powerpc and ppc64. + - debian/control: Add a binutils-spu package. + - debian/binutils-spu.{postinst,postrm,shlibs}: Add. + * Add sh64-linux-gnu to multiarch targets. + * Fix cross-compilation support. + * Make lintian happier: + - Use ${source:Version}, ${binary:Version} variables. + - Remove -1 from Build-Depends revisions. + - Bump Standards-Version to 3.7.3. + + [ Matthias Klose ] + * Keep the spu elfscripts in bintutils, remove them from binutils-spu. + * debian/patches/307_ld-pic.dpatch: Fix failing ld-shared tests when built + with gcc-4.3. + + -- Matthias Klose Sat, 29 Mar 2008 20:32:35 +0100 + +binutils (2.18.1~cvs20080103-2) unstable; urgency=low + + * debian/patches/306_pr4453.dpatch: Fix PR binutils/4453, taken from + the trunk (Aurelian Jarno). Closes: #363423. + + -- Matthias Klose Fri, 21 Mar 2008 20:49:17 +0100 + +binutils (2.18.1~cvs20080103-0ubuntu1) hardy; urgency=low + + * Update to 20080103 from the binutils-2_18-branch. + - Set version number to 2.18.0 (smaller than the one from the trunk). + * debian/*.shlibs: Update to version from the branch. + * debian/patches/305_arm-dis.dpatch: Fix segfault when disassembling ARM + code. Closes: #438956. + + -- Matthias Klose Thu, 03 Jan 2008 21:26:56 +0000 + +binutils (2.18.1~cvs20071027-1ubuntu2) hardy; urgency=low + + * Do not include static libraries in the multiarch package. + * Install a libiberty compiled with -fPIC as libiberty_pic.a. + LP: #50512. + * Don't include /usr/lib64 for cross packages. Closes: #450429. + + -- Matthias Klose Fri, 23 Nov 2007 12:14:31 +0000 + +binutils (2.18.1~cvs20071027-1ubuntu1) hardy; urgency=low + + * Update to 20071027 from the binutils-2_18-branch. + - Fix PR ld/4988, assertion failures in ld. Closes: #440015. + * debian/*.shlibs: Update to version from the branch. + * Drop the build dependency on expect-tcl8.3, don't run the + testsuite on hppa. + + -- Matthias Klose Sat, 27 Oct 2007 17:33:13 +0000 + +binutils (2.18-1ubuntu1) hardy; urgency=low + + * Rebuild using gcc-4.2. + + -- Matthias Klose Sun, 21 Oct 2007 08:31:26 +0000 + +binutils (2.18-1) unstable; urgency=low + + [ Matthias Klose ] + * New upstream release. + - Remove patches applied upstream: 100_warning_arm, 400_gcc42_fix, + 401_builddoc. + * debian/*.shlibs: Update to release version. + + -- Matthias Klose Wed, 29 Aug 2007 01:07:31 +0200 + +binutils (2.18-0ubuntu3) gutsy; urgency=low + + * Apply patches for: + - PR binutils/5011, readelf reads past end of buffer. + - PR ld/5025, downgrade error to a warning if .note.gnu.build-id + has been discarded. + + -- Matthias Klose Wed, 19 Sep 2007 00:31:23 +0200 + +binutils (2.18-0ubuntu2) gutsy; urgency=low + + * Apply fix for PR ld/5008, taken from the trunk. + + -- Matthias Klose Sun, 09 Sep 2007 22:08:19 +0200 + +binutils (2.18-0ubuntu1) gutsy; urgency=low + + * Final 2.18 release. + * debian/*.shlibs: Update to release version. + + -- Matthias Klose Wed, 29 Aug 2007 13:22:09 +0200 + +binutils (2.18~cvs20070827-0ubuntu1) gutsy; urgency=low + + * New upstream CVS snapshot, taken from the binutils-2_18-branch. + - Remove patches applied upstream: 311_sse4_intel_mode, 400_gcc42_fix, + 401_builddoc. + * debian/*.shlibs: Update to snapshot version. + + -- Matthias Klose Mon, 27 Aug 2007 19:30:21 +0200 + +binutils (2.18~cvs20070812-0ubuntu1) gutsy; urgency=low + + * New upstream CVS snapshot, taken from the binutils-2_18-branch. + * debian/rules: Support parallel= with comma separated keywords + in DEB_BUILD_OPTIONS. + * debian/rules (clean): Remove stamp files. + * debian/*.shlibs: Update to snapshot version. + * debian/patches/401_builddoc.dpatch: Fix doc build failure on the branch. + * debian/patches/311_sse4_intel_mode.dpatch: Fix SSE4 for Intel mode. + * Update patches: 200-hjl-ld-env (not applied), 203-hjl-binutils-indirect, + 204-hjl-binutils-tls-relro, 209-hjl-binutils-error, + * Remove patches: 201-hjl-bfd-dwarf-dup.dpatch, 201-hjl-bfd-dwarf-dup, + 205-hjl-bfd-kept, 208-hjl-libtool-relink. + * New patches: 210-hjl-binutils-signed, 211-hjl-binutils-weakdef. + + -- Matthias Klose Sun, 12 Aug 2007 12:42:57 +0200 + +binutils (2.17.20070804cvs-0ubuntu1) gutsy; urgency=low + + * New upstream CVS snapshot. + - PR binutils/4888, fixes objcopy --only-keep-debug. Closes: #435444. + * debian/rules: Support parallel= in DEB_BUILD_OPTIONS (see #209008). + * debian/*.shlibs: Update to snapshot version. + * Build using the default compiler on all architectures. + + -- Matthias Klose Sat, 04 Aug 2007 11:29:10 +0000 + +binutils (2.17.20070801cvs-0ubuntu2) gutsy; urgency=low + + * Build-depend on gcc-4.1 on lpia, since we're calling it explicitly. + + -- Adam Conrad Fri, 3 Aug 2007 13:24:26 +1000 + +binutils (2.17.20070801cvs-0ubuntu1) gutsy; urgency=low + + * CVS snapshot 20070801, taken from the trunk. + - Fixes objcopy --only-keep-debug on amd64. + + -- Matthias Klose Wed, 01 Aug 2007 18:46:10 +0200 + +binutils (2.17.20070718cvs-0ubuntu2) gutsy; urgency=low + + * debian/patches/305_ungetc.dpatch: Allow UNGETC to work with empty buffer, + taken from CVS HEAD. + + -- Matthias Klose Fri, 20 Jul 2007 12:47:44 +0200 + +binutils (2.17.20070718cvs-0ubuntu1) gutsy; urgency=low + + * CVS snapshot 20070718, taken from the trunk. + * Fix cross build failure while stripping binaries. Closes: #432907. + + -- Matthias Klose Wed, 18 Jul 2007 15:19:15 +0000 + +binutils (2.17.20070713cvs-0ubuntu2) gutsy; urgency=low + + * Fix build failure with gcc-4.2. + + -- Matthias Klose Tue, 17 Jul 2007 11:09:25 +0000 + +binutils (2.17.20070713cvs-0ubuntu1) gutsy; urgency=low + + * CVS snapshot 20070713, taken from the trunk. + - Remove patches applied upstream: 301_pr4436.dpatch, 302_pr4448.dpatch, + 303_pr4454.dpatch, 305_pr4497.dpatch, 306_ld_demangler_segfault.dpatch, + 307_pr4558.dpatch. + * Update hjl patches: + - Remove 207-hjl-libtool-archive.dpatch. + - Add 201-hjl-bfd-dwarf-dup.dpatch, 209-hjl-binutils-error.dpatch. + - Update 200-hjl-ld-env.dpatch, 201-hjl-bfd-ref_addr.dpatch, + 204-hjl-binutils-tls-relro.dpatch, hjl-binutils-shr.dpatch. + * debian/copyright: Include GPL-3. + * debian/rules: Fix version extraction. + * debian/rules: Honor `noopt' in DEB_BUILD_OPTIONS. Closes LP: #65607. + * debian/patches/013_bash_in_ld_testsuite.dpatch: Use bash in the ld + testsuite. Closes LP: #124435. + + -- Matthias Klose Fri, 13 Jul 2007 15:43:07 +0200 + +binutils (2.17.20070426cvs-7ubuntu2) gutsy; urgency=low + + * Fix PR gas/4558. + + -- Matthias Klose Mon, 28 May 2007 08:48:33 +0000 + +binutils (2.17.20070426cvs-7ubuntu1) gutsy; urgency=low + + * Merge with Debian. + + -- Matthias Klose Fri, 25 May 2007 08:24:08 +0200 + +binutils (2.17cvs20070426-7) unstable; urgency=low + + * 306_ld_demangler_segfault.dpatch: new CVS patch from Alan Modra to fix + segfaults in ld seen when building, e.g. openipmi. + + * debian/copyright: update source location and copyright years. + * debian/rules: idem. + + -- James Troup Wed, 23 May 2007 02:19:09 +0100 + +binutils (2.17cvs20070426-6) unstable; urgency=low + + * Fix PR ld/4497, regression introduced with the fix for PR ld/4454. + Closes: #423496. + * Fix binutils/4476, readelf support for --hash-style=gnu. Closes: #421790. + + -- Matthias Klose Mon, 14 May 2007 10:51:40 +0200 + +binutils (2.17cvs20070426-5) unstable; urgency=low + + * Fix PR ld/4454. + + -- Matthias Klose Sun, 06 May 2007 09:50:29 +0200 + +binutils (2.17cvs20070426-4) unstable; urgency=low + + * Fix PR gas/4448, overstrict check for powerpc lswi. Closes: #421799. + + -- Matthias Klose Wed, 2 May 2007 18:26:03 +0200 + +binutils (2.17cvs20070426-3) unstable; urgency=low + + * Update debian/*.shlibs files. Closes: #421454. + * Fix PR gas/4436, wrong reject in powerpc opcode table checks. + Closes: #421455. + * Fix build failure on arm (Aurelian Jarno). Closes: #421365. + * Compare testsuite results of the installed binutils with the built one. + + -- Matthias Klose Mon, 30 Apr 2007 07:47:09 +0200 + +binutils (2.17.20070426cvs-2ubuntu7) gutsy; urgency=low + + * Fix PR ld/4497, regression introduced with the fix for PR ld/4454. + + -- Matthias Klose Mon, 14 May 2007 08:13:50 +0000 + +binutils (2.17.20070426cvs-2ubuntu6) gutsy; urgency=low + + * Fix binutils/4476, readelf support for --hash-style=gnu. + + -- Matthias Klose Thu, 10 May 2007 07:32:28 +0000 + +binutils (2.17.20070426cvs-2ubuntu5) gutsy; urgency=low + + * Fix PR ld/4454. + + -- Matthias Klose Sun, 06 May 2007 13:02:11 +0000 + +binutils (2.17.20070426cvs-2ubuntu4) gutsy; urgency=low + + * Fix PR gas/4448, overstrict check for powerpc lswi. + + -- Matthias Klose Wed, 2 May 2007 13:42:10 +0200 + +binutils (2.17.20070426cvs-2ubuntu3) gutsy; urgency=low + + * Update debian/*.shlibs files. + * Fix PR gas/4436, wrong reject in powerpc opcode table checks. + + -- Matthias Klose Mon, 30 Apr 2007 08:02:30 +0200 + +binutils (2.17.20070426cvs-2ubuntu2) gutsy; urgency=low + + * Add binutils-udeb as a dist file with priority optional. + + -- Matthias Klose Fri, 27 Apr 2007 17:27:23 +0200 + +binutils (2.17.20070426cvs-2ubuntu1) gutsy; urgency=low + + * Merge with Debian. + + -- Matthias Klose Fri, 27 Apr 2007 10:16:54 +0200 + +binutils (2.17cvs20070426-2) unstable; urgency=low + + * Fix typo preparing the binutils-hppa64 package. Closes: #421199. + * Compare testsuite results of the installed binutils with the built one. + + -- Matthias Klose Fri, 27 Apr 2007 08:06:49 +0200 + +binutils (2.17cvs20070426-1) unstable; urgency=low + + [ James Troup ] + * New upstream CVS snapshot. + * debian/test-suite-compare.py: simplistic comparator for binutils test + suite runs. + + [ Matthias Klose ] + * Merge changes from the experimental uploads: + * debian/patches/121_i386_x86_64_biarch.dpatch: Remove, applied upstream. + * Build a binutils-source package (containing the patched sources). + * Check for a working expect before building the package. + * Configure the multiarch build for x86_64-linux-gnu instead of + x86_64-linux. + * debian/rules: Don't strip binaries if nostrip is in DEB_BUILD_OPTIONS. + * debian/rules: Don't try to strip shell scripts. + * Configure --with-pkgversion to include the distribution name. + * debian/patches/000_print_debian_version.dpatch: Remove. + * debian/control: Build-depend on lsb-release. + * Enable spu target in powerpc and binutils-multiarch build. + * Don't include embedspu in binutils-multiarch on powerpc. + * debian/control: Set priority for source package to optional. + + -- James Troup Fri, 27 Apr 2007 01:29:57 +0100 + +binutils (2.17.20070420cvs-0ubuntu1) gutsy; urgency=low + + * CVS snapshot 20070420, taken from the trunk. + - debian/patches/007_binutils_soversion.dpatch: Remove, applied upstream. + + -- Matthias Klose Fri, 20 Apr 2007 13:46:05 +0200 + +binutils (2.17.20070406cvs-0ubuntu1) toolchain-test; urgency=low + + * CVS snapshot 20070406, taken from the trunk. + * Do not apply: 200-hjl-ld-env. + * Enable spu target in powerpc, ppc64 builds and in the + binutils-multiarch build. + * Don't include embedspu in binutils-multiarch on powerpc, ppc64. + Closes: #411486. + + -- Matthias Klose Fri, 6 Apr 2007 06:57:41 +0200 + +binutils (2.17.20070329cvs-0ubuntu1) toolchain-test; urgency=low + + * CVS snapshot 20070329, taken from the trunk. + * Patches from the hjl 2.17.50.0.13 release: + - 202-hjl-binutils-check-phdr: Remove, applied upstream. + - 205-hjl-bfd-kept.dpatch: Address the link speed issue by caching + the result of _bfd_elf_check_kept_section. + - 206-hjl-binutils-shr.dpatch: Implementation of ELF sharable section + proposal (not applied by default). + - 208-hjl-libtool-relink.dpatch: Avoid unnecessary linker messages + when running "make check". + + -- Matthias Klose Thu, 29 Mar 2007 07:16:28 +0200 + +binutils (2.17.20070321cvs-0ubuntu2) toolchain-test; urgency=low + + * Configure --with-pkgversion, not including the package version, + which may break ld version detection in configure scripts. + * debian/patches/000_cvs_version_string.dpatch: Remove. + * debian/patches/007_binutils_soversion.dpatch: Use date for non-release + builds in soversion. + + -- Matthias Klose Thu, 22 Mar 2007 07:01:14 +0100 + +binutils (2.17.20070321cvs-0ubuntu1) toolchain-test; urgency=low + + * CVS snapshot 20070321, taken from the trunk. + * debian/patches/000_print_{debian,ubuntu}_version.dpatch: Remove. + * debian/control: Build-depend on lsb-release. + * Configure --with-pkgversion to include the distribution name. + * Apply patches from the hjl 2.17.50.0.13 release: + - 200-hjl-ld-env.dpatch: Handle LD_SYMBOLIC and LD_SYMBOLIC_FUNCTIONS + env vars. + - 201-hjl-bfd-ref_addr.dpatch: Support DW_FORM_ref_addr in Dwarf 2 reader + in linker. + - 202-hjl-binutils-check-phdr.dpatch: Fix PR ld/4007: Linker failed + to issue an error on bad section in segment. + - 203-hjl-binutils-indirect.dpatch: PR ld/3351; avoid linker crash on ia64. + - 204-hjl-binutils-tls-relro.dpatch: PR binutils/3281; objcopy changes + PT_GNU_RELRO when there is PT_TLS. + - 207-hjl-libtool-archive.dpatch: Allow linking against an archive when + building a shared library. + * Set Ubuntu maintainer address. + + -- Matthias Klose Wed, 21 Mar 2007 09:17:21 +0100 + +binutils (2.17.20070210cvs-1ubuntu1) toolchain-test; urgency=low + + * Merge with Debian experimental; remaining changes: + - Build binutils-static and binutils-static-udeb packages. + + -- Matthias Klose Mon, 12 Feb 2007 16:03:23 +0100 + +binutils (2.17.20070210cvs-1) experimental; urgency=low + + * CVS snapshot 20070210, taken from the trunk. + * debian/rules: Don't try to strip shell scripts. + + -- Matthias Klose Sat, 10 Feb 2007 15:59:45 +0100 + +binutils (2.17.20070103cvs-2) experimental; urgency=low + + * Overwrite the VERSION string (date) from the snapshot with + a parsable version string (2.17.50), as found on the trunk. + + -- Matthias Klose Fri, 5 Jan 2007 10:06:09 +0100 + +binutils (2.17.20070103cvs-1) experimental; urgency=low + + * binutils snapshot 20070103, taken from + ftp://sourceware.org/pub/binutils/snapshots/ + * Build a binutils-source package (containing the patched sources). + * Check for a working expect before building the package. + * Configure binutils-multiarch for i486-gnu as well. + * Configure the multiarch build for x86_64-linux-gnu instead of + x86_64-linux. + * debian/rules: Don't strip binaries if nostrip is in DEB_BUILD_OPTIONS. + + -- Matthias Klose Thu, 4 Jan 2007 22:13:54 +0100 + +binutils (2.17.20070103cvs-0ubuntu1) feisty; urgency=low + + * binutils snapshot 20070103, taken from + ftp://sourceware.org/pub/binutils/snapshots/ + * Merge with Debian experimental; remaining changes: + - Build binutils-static and binutils-static-udeb packages. + - Build a binutils-source package (containing the patched + sources). + - Check for a working expect before building the package. + - Configure binutils-multiarch for i486-gnu as well. + * Configure the multiarch build for x86_64-linux-gnu instead of + x86_64-linux. + * debian/rules: Don't strip binaries if nostrip is in DEB_BUILD_OPTIONS. + * Strip binaries in binutils-static and in the binutils udeb. + + -- Matthias Klose Thu, 4 Jan 2007 15:17:45 +0100 + +binutils (2.17.20061210cvs-1) experimental; urgency=low + + * CVS snapshot 20061210, taken from the trunk. + * debian/patches/121_i386_x86_64_biarch.dpatch: Remove, applied upstream. + + -- Matthias Klose Sun, 10 Dec 2006 20:43:41 +0100 + +binutils (2.17.20070103cvs-0ubuntu2) feisty; urgency=low + + * Overwrite the VERSION string (date) from the snapshot with + a parsable version string (2.17.50), as found on the trunk. + + -- Matthias Klose Fri, 5 Jan 2007 09:02:06 +0000 + +binutils (2.17.50.0.6-0ubuntu1) feisty; urgency=low + + [Fabio M. Di Nitto] + + * we are supposed to upload to feisty, aren't we? ;) + + [Jeff Bailey] + + * New upstream snapshot from HJ Lu. + * debian/patches/121_i386_x86_64_biarch: Drop, merged upstream. + + -- Fabio M. Di Nitto Tue, 31 Oct 2006 15:43:58 +0100 + +binutils (2.17-3) unstable; urgency=low + + * debian/rules (configure-multi-stamp): drop i486-kfreebsd-gnu again as + it breaks objdump for i386 on amd64. Closes: #380539 + + -- James Troup Tue, 3 Oct 2006 00:53:17 +0100 + +binutils (2.17-2) unstable; urgency=low + + * The "Laisse le Wookie gagner" release. + + * 127_x86_64_i386_biarch.dpatch: new patch from Aurelien Jarno + to add (/usr)/lib32 to the search paths on + amd64. Closes: #369052 + + * debian/rules (configure-multi-stamp): add i486-kfreebsd-gnu at request + of Aurelien Jarno. Closes: #315306 + + -- James Troup Wed, 26 Jul 2006 20:33:13 +0100 + +binutils (2.17-1ubuntu1) edgy; urgency=low + + * New upstream release. + - ld checks for libs in the same order as ld.so does. Ubuntu #40214. + * Synchronise with Debian unstable. + * Remove patch 122_sparc64_UA2005_instruction_set.dpatch, integrated + upstream. + * Remove patch 130_tekhex_buffer_overflow.dpatch, integrated upstream. + * 122_x86_64_i386_biarch.dpatch: New, search libraries in (/usr)/lib32 on + amd64. Closes: #369052. + * Build a binutils-source package; obsoletes toolchain-source package. + + -- Matthias Klose Wed, 28 Jun 2006 10:29:16 +0200 + +binutils (2.17-1) unstable; urgency=low + + * New upstream release. + * 120_mips_xgot_multigot_workaround.dpatch: removed - superseded by a + proper fix upstream. Closes: #274738 + * debian/binutils.shlibs, debian/binutils-multiarch.shlibs, + debian/binutils-hppa64.shlibs: updated SONAME to 2.17. + + -- James Troup Mon, 26 Jun 2006 13:17:36 +0100 + +binutils (2.16.1cvs20060507-1) unstable; urgency=low + + * New upstream CVS snapshot of 'binutils-2_17-branch'. + + * debian/control (Standards-Version): bump to 3.7.2.0. + + -- James Troup Sun, 7 May 2006 19:57:08 +0100 + +binutils (2.16.1cvs20060413-1) unstable; urgency=low + + * New upstream CVS snapshot. + * 120_mips_xgot_multigot_workaround.dpatch: updated to work with CVS + r1.163 of bfd/elfxx-mips.c, pass 'info' instead of 'output_bfd' to + MIPS_ELF_GOT_MAX_SIZE(). + + * Patch from NIIBE Yutaka in #280884: + * debian/rules (configure-multi-stamp): Support m32r-linux. Closes: + #340264 + * debian/rules: Run 'make check' only if build == host. + + * debian/rules: Also don't run 'make check' if nocheck is in + DEB_BUILD_OPTIONS. Based on a patch from Michael Banck + . Closes: #315290 + + * Integrate most of a patch to build arbitrary binutils-$TARGET + cross-packages from #231707. Thanks to Nikita V. Youshchenko + and Josh Triplett . + + * debian/copyright: update to include GFDL. Closes: #81950 + * debian/copyright: update FSF address. + + * debian/rules: move non-architecture specific conflicts (gas, + elf-binutils, modutils (<< 2.4.19-1)) out of a substitued variable and + into the control file. Rename variable to extraConflicts. + * debian/control: likewise. + + -- James Troup Sat, 15 Apr 2006 03:05:41 +0100 + +binutils (2.16.1cvs20060117-1ubuntu2.1) dapper-security; urgency=low + + * SECURITY UPDATE: Crash and possible arbitrary code execution in apps using + libbfd (such as 'strings'). + * Add debian/patches/130_tekhex_buffer_overflow.dpatch: + - Fix buffer overflow on hexadecimal number parsing in the Tektronix Hex + Format BFD library backend. + - Patch ported from CVS HEAD. + * CVE-2006-2362 + + -- Martin Pitt Tue, 6 Jun 2006 11:35:55 +0200 + +binutils (2.16.1cvs20060117-1ubuntu2) dapper; urgency=low + + * [SPARC64] Add support for new UA2005 instruction set: + - Add patch 122_sparc64_UA2005_instruction_set.dpatch. + (Thanks David S. Miller for providing the patch) + + NOTE: the patch is sparc specific and does NOT touch any other code. + It is a plain rebuild on all other arches. + + -- Fabio M. Di Nitto Sat, 25 Feb 2006 07:11:28 +0100 + +binutils (2.16.1cvs20060117-1ubuntu1) dapper; urgency=low + + * Synchronise with Debian untstable. + + -- Matthias Klose Thu, 19 Jan 2006 09:21:47 +0100 + +binutils (2.16.1cvs20060117-1) unstable; urgency=low + + * New upstream CVS snapshot. + + * 118_arm_pass_all.dpatch, 125_fix_tc_arm_cast.dpatch: merged upstream - + removed. + + -- James Troup Wed, 18 Jan 2006 02:25:25 +0000 + +binutils (2.16.1cvs20051214-1ubuntu1) dapper; urgency=low + + * Synchronise with Debian unstable. + + -- Matthias Klose Thu, 15 Dec 2005 00:11:16 +0000 + +binutils (2.16.1cvs20051214-1) unstable; urgency=low + + * New upstream CVS snapshot. + * Fix ld segfaults on ia64. Closes: #342777 + + * 126_fix_PROVIDE_HIDDEN.dpatch: merged upstream - removed. + + -- James Troup Wed, 14 Dec 2005 08:06:37 +0000 + +binutils (2.16.1cvs20051206-1) unstable; urgency=low + + * New upstream CVS snapshot. + * Fixes linking of qemu. Closes: #340328 + + * 126_fix_PROVIDE_HIDDEN.dpatch: new patch from Thiemo Seufer to fix + handling of hidden symbols which were provided by a linker + script. Closes: #342307 + + * debian/control (Standards-Version): updated to 3.6.2.1. + + -- James Troup Sat, 10 Dec 2005 05:23:34 +0000 + +binutils (2.16.1cvs20051117-1ubuntu1) dapper; urgency=low + + * Synchronise with Debian unstable. + + -- Matthias Klose Fri, 18 Nov 2005 14:09:29 +0100 + +binutils (2.16.1cvs20051117-1) unstable; urgency=low + + * New upstream CVS snapshot. + * Fixes c++filt's flushing of stdout which broke gcj. Closes: #339287 + + * debian/control (Build-Depends): switch from expect to expect-tcl8.3 + since tcl8.4's broken threading causes the testsuite to fail entirely + on hppa. Closes: #339509 + + -- James Troup Thu, 17 Nov 2005 13:15:15 +0000 + +binutils (2.16.1cvs20051109-1ubuntu1) dapper; urgency=low + + * Synchronise with Debian unstable. + * Reenable the testsuite on hppa and sparc. + * debian/control: + - Set standards version to 3.6.2 (no changes). + - Add alternative build dependency on expect-tcl8.3. + + -- Matthias Klose Mon, 14 Nov 2005 10:52:27 +0100 + +binutils (2.16.1cvs20051109-1) unstable; urgency=low + + * New upstream CVS snapshot. + * Fixes broken PLT handling on m68k. Closes: #327780 + * Don't compile flex files with -Werror, fixing mips builds. + Closes: #333980 + * Don't check undefined symbols introduced by "ld -u" for TLS. Closes: + #326103 + + * 117_mips_symbolic_link.dpatch: merged upstream - removed. + + * debian/rules: pass --disable-werror on ia64 as current gcc generates + too many false positives. Closes: #336939 + + * 125_fix_tc_arm_cast.dpatch: new patch from Lennert Buytenhek to fix + cast warning and arm builds. Closes: #336175 + + * 121_i386_x86_64_biarch.dpatch: imported from Ubuntu at request of + Daniel Jacobwitz to fix biarch linking on i386/amd64. Closes: + #334626, #334673 + + * debian/rules: remove any reference to pkgstriptranslations - an + Ubuntu-ism that shouldn't have been in the Debian package in the first + place but that isn't needed in Ubuntu any more in any event. + + * debian/rules: MAKEOVERRIDES is now clobbered by the top level + Makefile, so switch to overriding MAKE itself (sic) to pass the + customized VERSION variable/string down to sub-directories for + -multiarch and -hppa64 builds. Thanks to Daniel Silverstone for the + suggestion. + + -- James Troup Fri, 11 Nov 2005 20:38:22 +0000 + +binutils (2.16.1cvs20050902-1) unstable; urgency=low + + * New upstream CVS snapshot. + * Fixes --as-needed on sparc and hppa. Closes: #320697 + * Fixes buffer overflows and other crashes. Closes: #311975 + + * 124_readelf_robustify.dpatch: merged upstream - removed. + * 001_ld_makefile_patch: regenerated with help of wiggle. + + * debian/*.shlibs: update to version 2.16.91. + + * debian/copyright: use canonical GNU URL. Update copyright years. + * debian/rules: update version and copyright. + + * debian/rules (pre-build): not relevant with a CVS snapshot which + doesn't have pre-generated info files - removed. + * debian/rules (clean): don't save info files for the same reason, in + fact explicitly remove them. + * debian/rules (build_stamps): drop pre-build. + + -- James Troup Sat, 3 Sep 2005 00:30:56 +0100 + +binutils (2.16.1-3) unstable; urgency=low + + * debian/rules: remove powerpc libc header hack. + * debian/include/sys/procfs.h: remove. + + * 124_readelf_robustify.dpatch: new patch from Jakub Jelinek to + robustify readelf. Thanks to Thiemo Seufer . + Closes: #318344 + + -- James Troup Wed, 31 Aug 2005 05:03:11 +0100 + +binutils (2.16.1-2ubuntu7) dapper; urgency=low + + * debian/rules: Stop calling pkgstriptranslations, we now get it + for free with the new and improved dpkg-deb diversion hack. + + -- Adam Conrad Wed, 26 Oct 2005 10:39:15 +1000 + +binutils (2.16.1-2ubuntu6) breezy; urgency=low + + * debian/control: Create a new binutils-static-udeb udeb for d-i. + * debian/rules: Copy stuff from -static to -static-udeb for above. + * debian/rules: compress changelog in /usr/share/doc/binutils-static + + -- Adam Conrad Tue, 4 Oct 2005 16:51:06 +1000 + +binutils (2.16.1-2ubuntu5) breezy; urgency=low + + [ Jeff Bailey ] + * debian/control: binutils-static no longer depends on binutils. + * debian/rules: Install the copyright and changelog into + /usr/share/doc/binutils-static. + + [ Adam Conrad ] + * debian/binutils-static.preinst: Make sure that we lose our doc + symlink before we upgrade, or some Very Bad Things could happen. + * debian/rules: Make the above get installed to the right location. + + -- Adam Conrad Tue, 4 Oct 2005 15:45:12 +1000 + +binutils (2.16.1-2ubuntu4) breezy; urgency=low + + The " jbailey: how soon should I expect an upload?" release. + + * debian/patches/122_sparc_hppa_got.dpatch: New patch to allow + --as-needed on sparc, and to avoid issues with duplicate + GLOBAL_OFFSET_TABLES on hppa. + + * debian/patches/00list.sparc: New file, add this patch there. + + * debian/patches/00list.hppa: New file, add this patch there. + + -- Jeff Bailey Wed, 31 Aug 2005 16:46:13 -0400 + +binutils (2.16.1-2ubuntu3) breezy; urgency=low + + * debian/patches/121_i386_x86_64_biarch: New patch to allow + ld to work in an i386/x86_64 biarch configuration. + + -- Jeff Bailey Fri, 5 Aug 2005 16:24:23 +0000 + +binutils (2.16.1-2ubuntu2) breezy; urgency=low + + * debian/rules: Call it /bin/ld_static, not /bin/ld to avoid + confusion. + + -- Jeff Bailey Tue, 26 Jul 2005 01:34:43 +0000 + +binutils (2.16.1-2ubuntu1) breezy; urgency=low + + * debian/rules: Add binutils-static pass. This provides /bin/ld + for use in linking objects that might be needed at boot time + for mounting /usr or /. + Also remove stamps when cleaning. + + -- Jeff Bailey Tue, 26 Jul 2005 00:12:07 +0000 + +binutils (2.16.1-2) unstable; urgency=low + + * debian/include/sys/procfs.h: Include fixed powerpc libc header, to fix + FTBFS on powerpc. Temporary fix, to be removed with glibc-2.3.5. + + -- Matthias Klose Sun, 10 Jul 2005 16:35:17 +0200 + +binutils (2.16.1-1) unstable; urgency=medium + + * New upstream version. + * debian/patches/117_mips_symbolic_link.dpatch: Updated, apply it again. + (Thiemo Seufer). + * debian/patches/130_bfd_doc_makefile.dpatch: Remove, applied upstream. + * debian/control: Build depend on dpkg-dev (>= 1.13.9), needed to determine + the GNU architecture type. + * The symlinks for the tools change to the the new output of + dpkg-architecture -qDEB_HOST_GNU_TYPE (i.e. i386-linux-ld becomes + i486-linux-gnu-ld). + * Change the values for --enable-targets according to the dpkg-architecture + update. + * Configure the hppa64 cross compiler for hppa64-linux-gnu. Adjust + the hppa64 install target. + * debian/*shlibs: Update to version 2.16.1. + * Make restoring of saved pregenerated info files more robust. + + -- Matthias Klose Sat, 9 Jul 2005 14:58:49 +0200 + +binutils (2.16-1) unstable; urgency=low + + * Update to CVS 2.16 branch 20050612. + * debian/patches/130_bfd_doc_makefile.dpatch: New patch to fix + build failure in bfd/doc. + * debian/watch: New file. + + -- Matthias Klose Sun, 12 Jun 2005 12:29:12 +0200 + +binutils (2.16-0) experimental; urgency=low + + * New upstream release. + - Fixes build failure using gcc-4.0 (closes: #299671). + * debian/patches: + - 000_print_debian_version.dpatch: Updated. + - 001_ld_makefile_patch.dpatch, 002_gprof_profile_arcs.dpatch, + 002_gprof_profile_arcs.dpatch: Regenerated. + - 012_check_ldrunpath_length.dpatch: Updated. + - 112_fix_reloc_sizing.dpatch, 113_elf_backend_hide_symbol.dpatch, + 114_mips_delay_slots_in_branch.dpatch, 115_fix_sparc_fmov.dpatch, + 116_ar_nonexistent_files.dpatch: Removed, applied upstream. + - 117_mips_symbolic_link.dpatch: Disabled. Needs an update. + - 118_arm_pass_all.dpatch: Regenerated. + - 119_fix_gas_double_negative.dpatch: Removed, applied upstream. + - 120_mips_xgot_multigot_workaround.dpatch: Updated. + - 121_ia64_unwind_fixes.dpatch, 122_m68k_undefweak_symbols.dpatch: + Removed, applied upstream. + * Merge Ubuntu changes: + - debian/patches: + - 123_dont_add_to_undefs_twice.dpatch: Removed, applied upstream. + - debian/rules: Call pkgstriptranslations if present. + * debian/rules: + - Fix VERSION extraction. + - Save info files before build and restore them in clean target. + * debian/control: + - Add me as an uploader. + + -- Matthias Klose Fri, 6 May 2005 18:43:09 +0200 + +binutils (2.15-6) unstable; urgency=low + + * 123_bfd_overflow_fix.dpatch: new patch from Alan Modra to fix BFD + overflows. Closes: #308625 + + -- James Troup Sat, 21 May 2005 20:20:01 +0100 + +binutils (2.15-5ubuntu2) hoary; urgency=low + + * debian/rules: Call pkgstriptranslations if present (the package does not + use debhelper, thus it does not happen automatically). + + -- Martin Pitt Fri, 18 Mar 2005 13:07:52 +0000 + +binutils (2.15-5ubuntu1) hoary; urgency=low + + * 123_dont_add_to_undefs_twice.dpatch: new patch from Alan Modra (PR338) to + not add symbols to the undefined list twice, causing an assertion failure + in ld when building the kernel on amd64. + + -- Daniel Stone Tue, 7 Dec 2004 09:29:31 +0100 + +binutils (2.15-5) unstable; urgency=low + + * 121_ia64_unwind_fixes.dpatch: new patch from David Mosberger to fix + unwind related bugs. Closes: #278836 + * 122_m68k_undefweak_symbols: new patch from Andreas Schwab to fix undef + weak symbols with non-default visibilty on m68k. Closes: #278388 + + -- James Troup Thu, 25 Nov 2004 00:13:28 +0000 + +binutils (2.15-4) unstable; urgency=low + + * 120_mips_xgot_multigot_workaround.dpatch: new patch from Thiemo Seufer + to make multigot/xgot handling exclusive and fix mozilla builds on + mipsen. Closes: #272149 + + -- James Troup Thu, 23 Sep 2004 22:44:03 +0100 + +binutils (2.15-3) unstable; urgency=low + + * 112_fix_reloc_sizing.dpatch: update patch based on revised change from + Alan Modra. + + * 116_ar_nonexistent_files.dpatch: new patch from Nick Clifton to fix + ar's handling of non-existent files. Closes: #267139 + + * 117_mips_symbolic_link.dpatch: new patch from Thiemo Seufer to fix the + "final link failed: Bad value" error on mips. Closes: #270619 + + * 118_arm_pass_all.dpatch: new kludge patch to fix broken libtool pass_all + handling on arm and other arches. + + * 119_fix_gas_double_negative.dpatch: new patch from Alan Modra via + Daniel Jacobowitz to fix gas' handling of -- and ++. Closes: #266772 + + -- James Troup Thu, 9 Sep 2004 22:24:08 +0100 + +binutils (2.15-2) unstable; urgency=low + + * 112_fix_reloc_sizing.dpatch: new patch from Daniel Jacobowitz to fix + objcopy relocation sections. Closes: #252719 + + * 113_elf_backend_hide_symbol.dpatch: new patch from Alan Modra to fix + ld internal error on hppa. Closes: #254549 + + * 114_mips_delay_slots_in_branch.dpatch: new patch from Thiemo Seufer to + handle delay slots in branch correctly on mips. Closes: #266660 + + * 115_fix_sparc_fmov.dpatch: new patch from Jakub Jelinek via Dave + Miller to fix bogus fmov* SPARC opcodes. Closes: #267824 + + -- James Troup Tue, 31 Aug 2004 22:45:13 +0100 + +binutils (2.15-1) unstable; urgency=low + + * New upstream release. Closes: #248990, #259458 + * Fixes -Wl,-z,defs to correctly abort builds with unresolved + symbols. Closes: #256481 + * Better error message for truncation of bignums in as. + Closes: #219933 + * strip(1) no longer corrupts binaries for architectures it doesn't + recognise. Closes: #211052 + * nm -C /usr/lib/libcrypto++.a no longer segfaults. Closes: #247917 + + * 105_alpha_rpcc_opcode_fix.dpatch, 106_arm_pic.dpatch, + 107_powerpc_ld_segfault.dpatch, 108_m68k_fmoveml_fix.dpatch, + 109_objcopy_keep_debug.dpatch, 110_hppa64_local_symbols.dpatch, + 111_objcopy_vs_unstripped.dpatch, 906_hjl_libtool_dso.dpatch: merged + upstream - removed. + * 012_check_ldrunpath_length.dpatch: resynced with wiggle(1). + + * debian/binutils.shlibs, debian/binutils-hppa64.shlibs, + debian/binutils-multiarch.shlibs: update for 2.15. + + * debian/rules (install): remove gas.info hack as no longer needed + (fixed properly upstream). + * debian/rules (clean): remove gas/doc/as.info which doesn't seem to be + in the upstream tar ball. + + * debian/rules (binary-arch): install $pkg/ChangeLog.linux only if they + exist (because they don't in GNU releases). + + -- James Troup Thu, 29 Jul 2004 22:44:04 +0100 + +binutils (2.14.90.0.7-8) unstable; urgency=low + + * debian/rules: don't use gcc-2.95 on m68k. Thanks to Adam Conrad for + pointing this out. + + -- James Troup Wed, 19 May 2004 10:35:44 +0100 + +binutils (2.14.90.0.7-7) unstable; urgency=low + + * 111_objcopy_vs_unstripped.dpatch: new patch from Alan Modra via Daniel + Jacobowitz to fix objcopy on unstripped libraries on alpha and arm. + Closes: #234021 + + * debian/control (Build-Depends): remove m68k specific build-depends on + gcc-2.95 and libc6-dev (<< 2.3). Many thanks to Michael Schmitz for + testing this. + + -- James Troup Tue, 30 Mar 2004 18:00:54 +0100 + +binutils (2.14.90.0.7-6) unstable; urgency=low + + * 110_hppa64_local_symbols.dpatch: new patch from Randolph Chung to fix + dynamic name generation of local symbols on hppa64 - needed to build + 64-bit hppa kernels. Closes: #238176 + + -- James Troup Fri, 26 Mar 2004 15:52:27 +0000 + +binutils (2.14.90.0.7-5) unstable; urgency=low + + * 109_objcopy_keep_debug.dpatch: new patch from Daniel Jacobowitz + , objcopy --only-keep-debug and readelf SHT_NOBITS + fixes. + + -- James Troup Mon, 26 Jan 2004 16:25:25 +0000 + +binutils (2.14.90.0.7-4) unstable; urgency=low + + * debian/control: add binutils-hppa64 package. + * debian/rules: add support for binutils-hppa64 package and don't enable + hppa64-linux for binutils or binutils-multiarch. + * debian/binutils-hppa64.postinst: new file. + * debian/binutils-hppa64.postrm: likewise. + * debian/binutils-hppa64.shlibs: likewise. + * Above changes largely based on a patch from Matthias Klose + . Closes: #225892 + + * debian/control (Build-Depends): drop bzip2. + + * debian/rules (install-stamp): remove empty /usr/include directory in + binutils. + * debian/rules (install-stamp): remove /usr/share/info/dir* to + workaround install-info brain damage (cf #213524). + + -- James Troup Thu, 22 Jan 2004 21:32:44 +0000 + +binutils (2.14.90.0.7-3) unstable; urgency=low + + * 108_m68k_fmoveml_fix.dpatch: new patch from H.J. Lu + to fix fmoveml disassembly and associated + testsuite regression on m68k. + + -- James Troup Tue, 18 Nov 2003 14:35:23 +0000 + +binutils (2.14.90.0.7-2) unstable; urgency=low + + * 107_powerpc_ld_segfault.dpatch: new patch from Alan Modra + to fix ld segfault on powerpc. Thanks to + Josselin Mouette for the report. Closes: #219187 + + -- James Troup Wed, 5 Nov 2003 13:32:17 +0000 + +binutils (2.14.90.0.7-1) unstable; urgency=low + + * New upstream release. + * 100_null_owner_ld_fix.dpatch, 101_ppc_as_shf_and_rel_fix.dpatch, + 102_alpha_null_got_ld_fix.dpatch, + 103_static_linking_elf_eh_frame.dpatch, + 104_elf_eh_frame_alpha_fix.dpatch: removed; merged upstream. + * debian/rules: update version number. + * debian/binutils.shlibs: likewise. + * debian/binutils-multiarch.shlibs: likewise. + + * 009_signed_char_fix.dpatch: removed; this was fixed upstream correctly + (http://sources.redhat.com/ml/binutils/2003-05/msg00304.html) and this + patch is breaking that fix. Thanks to Daniel Jacobowitz + . + + * 003_gmon_manpage_fix.dpatch -> 002_gprof_profile_arcs.dpatch. + * 014_gprof_manpage_fix.dpatch -> 003_gprof_see_also_monitor.dpatch. + + * 300_alpha_rpcc_opcode_fix.dpatch -> 105_alpha_rpcc_opcode_fix.dpatch + (committed to trunk). + + * debian/rules (configure-multi-stamp): also enable mips64{el,}-linux + for binutils-multiarch. Alphabetize target list. + + * 106_arm_pic: new patch from Phil Blundell and Daniel + Jacobowitz which implements GC for GOT and PLT relocs + in the elf32-arm backend. + + * debian/rules (install-stamp): work around upstream bug which causes + as.info and as.1 to disappear by explicitly calling "make + install-info-am install-am" in builddir-single/gas/doc. + + -- James Troup Sat, 1 Nov 2003 18:14:04 +0000 + +binutils (2.14.90.0.6-5) unstable; urgency=low + + * 104_elf_eh_frame_alpha_fix.dpatch: new patch from H.J. Lu + to fix regressions on alpha caused by + 103_static_linking_elf_eh_frame. Thanks to Thimo Neubauer + for the original report. Closes: #215636 + + -- James Troup Fri, 17 Oct 2003 00:02:09 +0100 + +binutils (2.14.90.0.6-4) unstable; urgency=low + + * 103_static_linking_elf_eh_frame.dpatch: new patch from H.J. Lu + to fix static linking of C++ binaries. + + * 200_alpha_null_got_ld_fix.dpatch: renamed... + * 102_alpha_null_got_ld_fix.dpatch: to this. + + * debian/rules: patch from Guido Guenther to enable + mips64 support. Closes: #213448 + + -- James Troup Sun, 12 Oct 2003 14:26:26 +0100 + +binutils (2.14.90.0.6-3) unstable; urgency=low + + * 100_null_owner_ld_fix.dpatch: new patch from Alan Modra + to fix an ld crash with null owner sections. + Closes: #212029 + + * debian/rules: don't compile with gcc-2.95 on arm; the only failures + are a) testsuite-only (i.e. don't appear to affect real world + applications) and b) fixed by upcoming gcc patches by Phil Blundell + in any event. + * debian/control (Build-Depends): likewise don't build-depend on + gcc-2.95 for arm. + + * 101_ppc_as_shf_and_rel_fix.dpatch: new patch from Alan Modra + to fix an as regression where it refused to + compile utils.S from Linux/PPC 2.6. Closes: #211668 + + -- James Troup Tue, 23 Sep 2003 01:32:08 +0100 + +binutils (2.14.90.0.6-2) unstable; urgency=low + + * debian/rules (CONFLICTS): remove spurious "--", left over from + debhelper based-rules. Fixes build failure on sparc. + + * 200_alpha_null_got_ld_fix.dpatch: new patch from Daniel Jacobowitz + to fix an ld crash on alpha with null .got sections. + Closes: #204615 + + * scripts/dpkg-arch.mk: remove. + * debian/rules: define DEB_BUILD_GNU_TYPE, DEB_HOST_ARCH and + DEB_HOST_GNU_TYPE here instead. + + * debian/rules (binary-indep): use ':' as a separator to chown, rather + than '.' which is a legal character for a username. + * debian/rules (binary-arch): likewise. + + * debian/rules: further trivial cleanups. + + -- James Troup Thu, 18 Sep 2003 22:13:36 +0100 + +binutils (2.14.90.0.6-1) unstable; urgency=low + + * New "upstream" release. + * Fixes core dump of nm -C on certain object files. Closes: #205616 + + * New maintainer. + * debian/control (Maintainer): adjust accordingly. + * debian/copyright: likewise. Update copyright years, URL. + * debian/control (Standards-Version): bump to 3.6.1.0. + + * 011_disable_combreloc_ARM_ONLY.diff: dropped on request of Phil + Blundell - this is obsolete, it was working around a + bug in ld since fixed by Daniel Jacobowitz upstream. + + * 890-elf64_alpha_segfault.diff: dropped as bogus + (http://sources.redhat.com/ml/binutils/2003-04/msg00399.html); rth's + correct fix is already in the upstream source. + + * debian/README.Debian: migrate nearly-obsolete debconf notes to here. + * debian/control (Depends): drop debconf. + * binutils.config, binutils.templates, binutils.templates.ca, + binutils.templates.fr, binutils.templates.ja, + binutils.templates.pt_BR, postrm.debhelper: obsolete, removed. + Closes: #189641, #198222 + + * Migrated from dbs... + * debian/README.build: obsolete; removed. + * debian/rules: remove $(BUILD_TREE)/, $(STAMP_DIR)/, $(unpacked), $(patched) and other references + to DBS. + * debian/rules (clean): remove build tree directories. + * debian/scripts/dbs-build.mk: unused, remove. + * debian/scripts/file2cat: likewise. + + * ... to dpatch. + * debian/rules: include /usr/share/dpatch/dpatch.make. + * debian/rules (configure-single-stamp): depend on patch-stamp. + * debian/rules (configure-multi-stamp): likewise. + * debian/rules (clean): depend on unpatch. Remove debian/patched. + * debian/control (Build-Depends): add dpatch. + + * binutils-doc.postinst, binutils-doc.prerm, + binutils-multiarch.postinst, binutils-multiarch.postrm, + binutils-multiarch.preinst, binutils-multiarch.shlibs, + binutils.postinst, binutils.postrm, binutils.shlibs: new files based + on .deb and packages.d/. + * scripts/dh_split: obsolete, removed. + * debian/packages.d/binutils-dev.in, debian/packages.d/binutils-doc.in, + debian/packages.d/binutils-multiarch.in, + debian/packages.d/binutils.in: likewise. + + * debian/rules: rewritten, de-debhelper-ized. + * debian/control (Build-Depends): drop debhelper and add file. + + -- James Troup Thu, 11 Sep 2003 22:08:18 +0100 + +binutils (2.14.90.0.5-0.2) unstable; urgency=low + + * NMU. + * Rebuild using fixed gcc on sparc (closes: #202924). + + -- Matthias Klose Mon, 28 Jul 2003 20:12:00 +0200 + +binutils (2.14.90.0.5-0.1) unstable; urgency=low + + * NMU. + * New upstream version. + * Remove patches applied upstream: + - debian/patches/500_s390_gas.diff + - debian/patches/905-hppa_visibility.diff + - debian/patches/906-mips_ld_fix.diff + * Updated patch: + - debian/patches/906-hjl_libtool_dso.diff + + -- Matthias Klose Wed, 23 Jul 2003 20:09:51 +0200 + +binutils (2.14.90.0.4-0.1) unstable; urgency=low + + * NMU + * New upstream version. + 1. Work around the brain dead libtool. + * New patches: + - debian/patches/500_s390_gas.diff (closes: #194929). + - debian/patches/905-hppa_visibility.diff (closes: #195203). + - debian/patches/906-mips_ld_fix.diff (closes: #195207). + - debian/patches/906-hjl_libtool_dso.diff + + -- Matthias Klose Sat, 31 May 2003 12:12:10 +0200 + +binutils (2.14.90.0.3-0.1) unstable; urgency=low + + * NMU + * New upstream version. + 1. Update from binutils 2003 0523. + 2. Fix 2 ELF visibility bugs. + 3. Fix ELF/ppc linker bugs. + * Remove patches applied upstream: + - debian/patches/903-hjl_ld-dso-test.diff + - debian/patches/904_hjl_hppa_whitespace.diff + + -- Matthias Klose Sat, 24 May 2003 09:02:54 +0200 + +binutils (2.14.90.0.2-0.1) unstable; urgency=low + + * NMU + * New upstream version. + 1. Update from binutils 2003 0515. + 2. Fix various ELF visibility bugs. + 3. Fix some ia64 linker bugs. + 4. Add more IAS compatibilities to ia64 assembler. + * New patches: + - debian/patches/903-hjl_ld-dso-test.diff (closes: #193505). + - debian/patches/904_hjl_hppa_whitespace.diff. + * Remove patches applied upstream: + - debian/patches/900_binutils-2.14.90.0.1-empty-test.diff + - debian/patches/901-hjl_weaksymfix.diff + + -- Matthias Klose Sun, 18 May 2003 10:50:00 +0200 + +binutils (2.14.90.0.1-0.1) unstable; urgency=low + + * NMU + * New upstream version. + - Fix: MIPS branch-to-global bug (closes: #189031). + - Fix: Crash on alpha with --gdwarf2 and bad file number (closes: #187211). + - Fix: objdump -R BFD ICE on prelinked binaries (closes: #180088). + * New patches: + - debian/patches/900_binutils-2.14.90.0.1-empty-test.diff + - debian/patches/901-hjl_weaksymfix.diff + * Remove patches applied upstream: + - debian/patches/002_ldlex_inflexible_transition.diff + - debian/patches/013_objdump_doc_fix.diff + - debian/patches/850_hppa_stub_fix.diff + - debian/patches/860_m68k_elf.diff + - debian/patches/861_m68k_elf.diff + - debian/patches/870-sparc64-update.diff + - debian/patches/880-alpha-update.diff + * Remove obsolete patch: + - debian/patches/patches/800_hjl_mips_fixes.diff + * Add x86_64 for the i386 binutils package and the binutils-multiarch + package (closes: #189350). + * Set CFLAGS to -g -O2 for build (closes: #181268). + + -- Matthias Klose Tue, 6 May 2003 09:58:14 +0200 + +binutils (2.13.90.0.18-1.7) unstable; urgency=high + + * NMU + * Fixed ld segv (replaced yy_current_buffer by YY_CURRENT_BUFFER) + (Closes: #188876, 188900, 188912) + + -- Julien LEMOINE Mon, 14 Apr 2003 04:45:03 +0200 + +binutils (2.13.90.0.18-1.6) unstable; urgency=high + + * NMU + * [002_ldlex_inflexible_transition.diff] New. Make ld buildable again with + sid's current flex. + + -- J.H.M. Dassen (Ray) Sun, 13 Apr 2003 16:54:46 +0200 + +binutils (2.13.90.0.18-1.5) unstable; urgency=medium + + * NMU + * [890-elf64_alpha_segfault.diff] Patch from Julien LEMOINE + to fix the segfault encountered while building + gal on alpha. (Closes: #185556) + * sid's current flex breaks the building of several packages, including this + one; see #188665. The i386 upload is built using a pbuilder sid chroot + with flex downgraded to the sarge version. + + -- J.H.M. Dassen (Ray) Sun, 13 Apr 2003 13:44:17 +0200 + +binutils (2.13.90.0.18-1.4) unstable; urgency=low + + * NMU + * ld/emulparams/elf64_sparc.sh: Set LIBPATH_SUFFIX instead of suffix + for emulation. Patch from current CVS suggested by Clint Adams, + needed for sparc64 glibc build. + * bfd/elf64-alpha.c: Patch from current CVS suggested by Falk Hueffner, + needed to build xstow, kdegames (#181623), sfs. + * Explicitely fail, when trying to build with glibc-2.3 on arm and + m68k. See #184048 for m68k ld failures. + + -- Matthias Klose Tue, 8 Apr 2003 23:27:46 +0200 + +binutils (2.13.90.0.18-1.3) unstable; urgency=low + + * NMU + * Another fix for ELF/m68k (__bb_exit_func initialization). + + -- Matthias Klose Tue, 18 Mar 2003 00:05:47 +0100 + +binutils (2.13.90.0.18-1.2) unstable; urgency=high + + * NMU + * Apply upstream fix for ELF/m68k. Closes: #182313. + * Use gcc-2.95 on m68k-linux. Built on testing (glibc-2.2). + + -- Matthias Klose Sun, 9 Mar 2003 01:02:39 +0100 + +binutils (2.13.90.0.18-1.1) unstable; urgency=low + + * NMU + * Apply upstream fix for hppa stubs. Closes: #181397 + + -- LaMont Jones Wed, 19 Feb 2003 12:34:58 -0700 + +binutils (2.13.90.0.18-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-01-21) + * Upstream: Fix an ia64 gas bug + * Upstream: Fix some TLS bugs + * Upstream: Fix ELF/ppc bugs + * Upstream: Fix an ELF/m68k bug + * Corrected ARM combreloc disabling patch + (closes: Bug#175204) + * Upstream fixes take care of TEXTREL bug + on powerpc (closes: Bug#176084) + * Fixed shellutils dependency problem + (closes: Bug#175673) + * Removed mention of the monitor manpage + from the gprof manpage (closes: Bug#160654) + + -- Christopher C. Chimelis Sun, 2 Feb 2003 23:17:29 -0500 + +binutils (2.13.90.0.16-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-11-26) + * Upstream: Include /usr/bin/c++filt + * Upstream: Fix "ld -r" with exception handling + + -- Christopher C. Chimelis Mon, 9 Dec 2002 19:14:02 -0500 + +binutils (2.13.90.0.14-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-11-14) + * Upstream: Fix ELF/alpha bugs + * Upstream: Fix an ELF/i386 assembler bug + * Updated package MIPS patch from HJ Lu + * Added s390 patches from Gerhard Tonn. + Actually, the patches to support s390x were + already included upstream, so I just enabled + it in the rules script (closes: Bug#168074, Bug#168974) + * Since powerpc64-linux support was already + added in a prior upload, I'm closing the + wishlist bug for it (closes: Bug#156955) + + -- Christopher C. Chimelis Tue, 20 Nov 2002 05:36:21 -0500 + +binutils (2.13.90.0.10-2) unstable; urgency=low + + * Added two patches from upstream to fix alpha BFD. + (closes: Bug#165633) + + -- Christopher C. Chimelis Sun, 27 Oct 2002 14:21:51 -0400 + +binutils (2.13.90.0.10-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-10-10) + * Upstream: More ELF/PPC linker bug fixes. + * Upstream: Fix an ELF/alpha linker bug. + * Upstream: Fix an ELF/sparc linker bug to support + Solaris. + * Upstream: More TLS updates. + * Updated m68k gcc 3.1 patch since it wasn't applying + cleanly. Is this still needed? + * Added patches to allow building with new bison + (closes: Bug#164436, Bug#164042) + * Should be better for prelink support, which is coming + soon (closes: Bug#161427) + * Removed windres manpage from all packages + (closes: Bug#157415) + * Fixed download location in copyright file + (closes: Bug#158028) + * Added i386-gnu to multiarch build targets + (closes: Bug#157057) + * Add alpha opcode patch from Falk Hueffner + (closes: Bug#164201) + * Remove .la files from packages + (closes: Bug#160455) + + -- Christopher C. Chimelis Mon, 15 Oct 2002 20:22:29 -0400 + +binutils (2.13.90.0.4-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-08-) + * Upstream: Update from binutils 2002 0814 + * Upstream: Fix symbol versioning bugs for gcc 3.2 + * Upstream: Fix mips gas + * Upstream: Fix an x86 TLS bfd bug + * Upstream: Fix an x86 PIC gas bug + + -- Christopher C. Chimelis Thu, 15 Aug 2002 20:13:44 -0400 + +binutils (2.12.90.0.15-2) unstable; urgency=low + + * Fix combreloc disabling patch for ARM + (closes: Bug#156315) + * Remove S390 patch since it is no longer + needed (thanks to Gerhard Tonn for checking + this out) + * Fix BFD version string escaping + (closes: Bug#154989) + * Add SH patch from Yaegashi Takeshi + (closes: Bug#156230) + * Added conflicts for older modutils + (closes: Bug#155324) + * Forgot to apply MIPS patch from HJ Lu + (apologies to MIPS folks) + + -- Christopher C. Chimelis Wed, 14 Aug 2002 13:09:12 -0400 + +binutils (2.12.90.0.15-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-07-17) + * Upstream: Fix an ia64 assembler bug + * Upstream: Fix a symbol versioning bug + * Upstream: You have to apply the modutils patch + enclosed here in order to support System.map + generated by the new nm (bug filed) + * The symbol visibility patch is included + upstream, as is the alpha PLT/GOT patch, so + both removed from my packaging. + * Included patch from upstream to fix RELA targets + (closes: Bug#153729) + + -- Christopher C. Chimelis Thu, 2 Aug 2002 02:24:29 -0400 + +binutils (2.12.90.0.14-2) unstable; urgency=low + + * The "Let's Get This Party Started Right" upload + (since I'm closing as many old bugs as possible) + * Removed sparc patch altogether + * Added a small alpha patch from upstream to fix + some obscure PLT/GOT issues. + * Manpages are now fixed finally -- no more + I (closes: Bug#108369) + * Have not gotten another report of the + debconf message being cut off, so I'm closing + the debconf-related bug. I suspect this may + have been a problem in the debconf front-end + being used, but I have not been able to reproduce + it (closes: Bug#149045) + * Closing a bug report that I had tagged moreinfo + a LONG time ago (over one year), but never got + more info on. I have not heard of this kind + of problem since, nor have I been able to + reproduce it at any time since (closes: Bug#105986). + For interested parties, it revolved around + allowing gcc to show a linker error, but the + reporter didn't know about the -v option for + gcc. There was a linker problem, but it appeared + to be either hardware failure or user error. + * Closing a demangler 'bug' that revolved around + stripping @PLT from symbol names. Since the + PLT suffix is documented, I'm going to close + this bug. Also, it doesn't help that the symbol + in the bug report uses an obsolete mangling style, + so I can't test this even if I wanted to + (closes: Bug#45889) + + -- Christopher C. Chimelis Mon, 22 Jul 2002 12:54:01 -0400 + +binutils (2.12.90.0.14-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-06-27) + * Upstream: Fix a mips assembler bug + * Upstream: Fix an ELF/mips SHF_MERGE bug + * Upstream: Fix a linker bug which leads to the + incorrect Linux 2.2 kernel. + * PE patch removed since it is included + in upstream source now + * Includes some patches which allow for + more true testsuite results from gcc-3.1 + * Fix sparc ld emulation script patches to get + rid of the lib/64 silliness (now uses lib64) + * Removed the L word from the package description + since Debian is no longer linux-only + (closes: Bug#150575) + * The strings dereferencing problem with + some Windows binaries seems to also be fixed now + (closes: Bug#121366) + * Added a patch to only generate an RPATH entry + if LD_RUN_PATH is not empty, for cases where + -rpath isn't specified (closes: Bug#151024) + * Fixed arch detection problem in the build + scripts. + * Fixed bad capitalisation of -g in the objdump + manpage (closes: Bug#152697) + * Added patch from HJ Lu to fix a symbol + visibility issue. + + -- Christopher C. Chimelis Wed, 17 Jul 2002 14:23:42 -0400 + +binutils (2.12.90.0.9-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-05-26). + * Upstream: Supports "-z muldefs" + * Updated PE bfd from CVS to fix auto-import + segfaults (closes: Bug#131407) + * Remove the PE-removing patch for i386 targets + due to the above + + -- Christopher C. Chimelis Thu, 6 Jun 2002 15:52:29 -0400 + +binutils (2.12.90.0.7-1) unstable; urgency=low + + * New upstream version (synced with CVS 2002-04-23). + * Upstream: ELF EH frame bug fix + * Upstream: MIPS ELF visibility bug fix + * Upstream: Bug fixes for ELF/sparc + * Upstream: Bug fixes for ELF/cris + * Upstream: Fix linking a.out relocatable files + with ELF + * Upstream: Fix a PPC altivec assembler bug + * Numerous upstream changes since I have + deliberately not updated in awhile so that + I could stabilise the package for woody + release + * Fixed a glaring typo in the Debian additions + to the version string. + * Upstream incorporated --oformat + documentation patch; removed. + * Added a patch from upstream involving + relative relocs on Alpha + * Removed configure.info-[1-3] from -doc + (closes: Bug#146205) + + -- Christopher C. Chimelis Sun, 5 Apr 2002 04:52:33 -0400 + +binutils (2.12.90.0.1-5) unstable; urgency=high + + * Added a patch to m68k bits for gas to allow + gcc 3.1 to build + * Added Brazilian Portuguese translation for + debconf (closes: Bug#144677) + * Removed unneeded gasp manpage since gasp + was eliminated as a distinct binary + (closes: Bug#144583) + + -- Christopher C. Chimelis Mon, 29 Apr 2002 14:40:21 -0400 + +binutils (2.12.90.0.1-4) unstable; urgency=low + + * Added patch from Gerhardt Tonn + to fix s390 merge problem (closes: Bug#143187) + * Corrected DOW of my last changelog entry :-P + + -- Christopher C. Chimelis Thu, 18 Apr 2002 13:03:49 -0400 + +binutils (2.12.90.0.1-3) unstable; urgency=low + + * Oops...I used dpkg-architecture from dpkg-dev + in the postinst and didn't add a dependency + for it. It was a bad choice anyway and I'm + going to use uname -s instead + (closes: Bug#142744, Bug#142915) + + -- Christopher C. Chimelis Mon, 15 Apr 2002 12:41:10 -0400 + +binutils (2.12.90.0.1-2) unstable; urgency=low + + * Added Catalan debconf translation + (closes: Bug#139740) + * Ensure that info entries are removed from the + texinfo dirfile when binutils-doc is removed + (closes: Bug#126557) + * Ensure that the kernel link debconf warning + only shows up on linux systems + (closes: Bug#142360) + + -- Christopher C. Chimelis Thu, 13 Mar 2002 01:30:22 -0400 + +binutils (2.12.90.0.1-1) unstable; urgency=high + + * New upstream version (synced with CVS 2002-03-07). + * Upstream: Add the .preinit_array/.init_array/.fini_array + support. + * Upstream: Fix eh_frame. + * Upstream: Turn on combreloc by default. + * Upstream: Enable gprof for Linux/mips. + * Turn combreloc off for ARM explicitly until + I can confirm that PIC is not still broken + by using it. + * Remove IA-64 unwind patch and objcopy fix + since they are included in the upstream sources + now. + * Re-enable testsuite run since Randolph did the NMU + on dejagnu (thank you!). + * Appears to fix sparc64 linking problems. I'm + still looking into exactly what was going on with + that (closes: Bug#137850) + * Enabled hppa64-linux support in main binutils + package (closes: Bug#137955) + * Added Japanese debconf template. Thanks to + Tomohiro KUBOTA for supplying that + (closes: Bug#138112) + * Added patch for ld to fix dosemu problems + (closes: Bug#126863) + + -- Christopher C. Chimelis Mon, 11 Mar 2002 14:02:45 -0500 + +binutils (2.11.93.0.2-3) unstable; urgency=high + + * Split translated debconf templates out. + I apparently misunderstood the instructions + on integrating the French translation since + this is my first real attempt at using + debconf (closes: Bug#136295) + * Disable combreloc default on ARM since it + breaks PIC, apparently (closes: Bug#134241) + Please test other ARM bugs against this + version and inform me of the results! + + -- Christopher C. Chimelis Fri, 8 Mar 2002 19:10:10 -0500 + +binutils (2.11.93.0.2-2) unstable; urgency=high + + * Include a patch from upstream to fix stripping + archives containing multiple files with the + same name (like libgcj, unfortunately). + (closes: Bug#107812) + * Include IA64 unwind fix from CVS to fix kernel + linking on IA64. (closes: Bug#135143) + * Added French translation of the debconf + bits. Thanks to Denis Barbier for the + work on that. (closes: Bug#134626) + * Disabled testsuite run until dejagnu is + fixed. I'm leaving the build-dep for dejagnu + in, though, since I know I'll forget to + reinsert it when I do re-enable the testsuite + run. + + -- Christopher C. Chimelis Fri, 22 Feb 2002 14:05:22 -0500 + +binutils (2.11.93.0.2-1) unstable; urgency=high + + * New upstream version (synced with CVS 2002-02-07). + * Upstream: Fix a weak symbol alpha linker bug for glibc. + * Upstream: More support for gcc 3.1. + * Keep on disabling efi-app-ia32 type targets + since the segfault is still unfixed in CVS and + I haven't had the time to go back and really + debug and fix this. + * Updated standards version. + * Corrected some of the lintian problems (all except + the ones involving Changelog.linux, the .comment + section, and the missing manpages for + binutils-multiarch's binaries since that package + depends on binutils, which provides those). + + -- Christopher C. Chimelis Wed, 13 Feb 2002 13:41:47 -0500 + +binutils (2.11.92.0.12.3-7) unstable; urgency=high + + * The "Remind Me To Think Next Time" upload. + * Fix the postinst to only compare versions on + upgrade rather than during configure. + (closes: Bug#133349, Bug#133514) + * Still working on the other bugs...if only + I could get a day off of work... + + -- Christopher C. Chimelis Tue, 12 Feb 2002 06:15:02 -0500 + +binutils (2.11.92.0.12.3-6) unstable; urgency=high + + * The "Make The Bad Man Stop" upload. + * Revert patch to bfd/elf32-sparc.c (already + reverted upstream) that broke UA32 relocs on sparc + and caused bus errors with C++/Java binaries + (closes: Bug#126162) + * Remove i486-mingw32 target from the enabled + in multiarch and removed efi-app-ia32 from the + BFD config for Intel linux targets until I can find + and fixthe segfaults that seem to keep coming up when + reading Windows files and viruses with objdump or + strings. This is only temporary, so I'm not closing + the bugs until the problem gets fixed, but + I am going to bump them down to wishlist, merge + them, and note the above in them. + (debian/patches/010_disable_efi_app_ia32_TEMPORARY.diff + disables the efi-app-ia32 BFD in case someone + wants to revert this change easily) + * Added debconf warning about the kernel linking + situation since it keeps coming up and people + keep initially disagreeing with me about this + being a kernel bug. Also, merged prior warning + about -oformat change into the same debconf warning + (it's two, two, two warnings in one). This makes + the DEBIAN_FRONTEND case bug moot (closes: Bug#131801) + * Added powerpc64-linux target to multiarch since + work is progressing on that target and the machines + are due to hit the shelves Very Soon(TM). + + -- Christopher C. Chimelis Fri, 1 Feb 2002 17:06:29 -0500 + +binutils (2.11.92.0.12.3-5) unstable; urgency=high + + * Fix signed char assumption in i386 disassembly bits + (closes: Bug#126993) + + -- Christopher C. Chimelis Mon, 8 Jan 2002 17:27:17 -0500 + +binutils (2.11.92.0.12.3-4) unstable; urgency=high + + * Go back to enabling archs by enumeration for + multiarch. Apparently, a few aren't enabled + with --enable-targets=all (sparc64-linux, namely). + Besides, multiarch was incredibly large, which + was probably unneeded. + + -- Christopher C. Chimelis Wed, 26 Dec 2001 13:53:49 -0500 + +binutils (2.11.92.0.12.3-3) unstable; urgency=high + + * Include patch from Alan Modra to fix more + refcount problems on hppa. + + -- Christopher C. Chimelis Fri, 7 Dec 2001 05:42:04 -0500 + +binutils (2.11.92.0.12.3-2) unstable; urgency=high + + * Include patch from Alan Modra to fix hppa linking + woes wrt undefined symbols (closes: Bug#121993) + + -- Christopher C. Chimelis Wed, 5 Dec 2001 04:14:51 -0500 + +binutils (2.11.92.0.12.3-1) unstable; urgency=high + + * New upstream version (synced with CVS 2001-11-21) + * Upstream: Fix a linker symbol version bug + for common symbols. + * Upstream: Update handling relocations against + the discarded sections. You may need to apply + the kernel patch enclosed here to your kernel + source. + * Upstream: Support "-march=xxx -mipsN" for mips + gas if they are compatible. + * Upstream: Fix a regression when linking with + non-ELF object files. + * Includes Alan Modra's patch to reduce stub sizes + on HPPA. Should help C++ on HPPA. + * Once again includes a mips patch from HJ Lu. + * My documentation changes were cleaned up and + accepted upstream, so the gas manpage fixes go + away (hurray!). + * Stopped iterating targets for binutils-multiarch + and started enabling all of them. This saves + maintenance time since new targets will be + automatically supported in future uploads + and existing targets that I didn't include + before will be supported from now on. This may + grow build time and the libbfd in the multiarch + package, but it's worth it. + * Also, started using the --enable-64-bit-bfd + flag for configuring multiarch. I don't know + why I didn't realise this wasn't there before + since I test with it all of the time. + + -- Christopher C. Chimelis Fri, 30 Nov 2001 20:11:42 -0500 + +binutils (2.11.92.0.10-4) unstable; urgency=high + + * The "Fingers crossed" upload. + * Enable combreloc by default for s390 again. + Rumour has it that it worked before, but there + was a misunderstanding in the s390 developer + community, hence the disabling in the past. + * Fix the ld texinfo file to not mention the old + oformat invocation (closes: Bug#116182) + * Next upload should include the mips updates and + some powerpc updates. I just need time to test + those out first. + + -- Christopher C. Chimelis Fri, 23 Nov 2001 23:23:22 -0500 + +binutils (2.11.92.0.10-3) unstable; urgency=high + + * Replace HPPA reloc patch with patches from Alan + Modra upstream. + * Add upstream patch to fix quoted -rpath bug + (closes: Bug#107214) + + -- Christopher C. Chimelis Sat, 10 Nov 2001 18:19:05 -0400 + +binutils (2.11.92.0.10-2) unstable; urgency=high + + * Disable -z combreloc enable patch on S/390 + since it's not supported there yet + (closes: Bug#117087) + + -- Christopher C. Chimelis Fri, 26 Oct 2001 00:07:01 -0400 + +binutils (2.11.92.0.10-1) unstable; urgency=high + + * New upstream version (synced with CVS 2001-10-21) + * Upstream: Fix the ELF/PPC linker. + * Upstream: Fix the ELF/cris linker. + * Upstream: Fix ELF strip. + * Includes beginnings of Altivec support + (closes: Bug#98617) + * Fixes use of BookE instruction format on 4xx + PowerPC (closes: Bug#116627) + * Includes patches from Alan Modra to fix hppa + relocations. + * Forgot to close the previous PPC bug with last + upload (closes: Bug#116454) + * Moved to enclosing a bzipped tarball rather than + a gzipped one to save download time for everyone + involved. Build-deps adjusted accordingly. + + -- Christopher C. Chimelis Tue, 23 Oct 2001 03:29:49 -0400 + +binutils (2.11.92.0.7-2) unstable; urgency=high + + * Include a patch from H.J Lu to fix a powerpc + issue not shown in the testsuite results. + + -- Christopher C. Chimelis Fri, 19 Oct 2001 00:49:04 -0400 + +binutils (2.11.92.0.7-1) unstable; urgency=high + + * New upstream release (synced with CVS 2001-10-16) + * Upstream: Fix all breakages introduced in 2.11.92.0.5 + * No mips/ dir patches need to be applied with this one. + Woohoo! + * Removed patches from debian/patches that are already + applied upstream. + * Patched version strings to reflect that this is a + Debian release at the request of upstream (to prevent + confusion, apparently). + * Applied patch from H.J. Lu to fix mips section + misalignment. + * Applied patch from Jakub Jelinek to fix kernel linking + on i386 and possibly other archs (closes: Bug#116041) + * Fixed postinst and prerm for binutils-doc to test that + the files exist before calling install-info. This should + fix the odd circumstance when binutils-doc is packaged on + an arch that doesn't support gprof (or any other dir for + that matter) and, therefore, the docs that are usually + made in that dir aren't made. This is particularly true + with gprof on mips. + + -- Christopher C. Chimelis Wed, 17 Oct 2001 18:56:51 -0400 + +binutils (2.11.92.0.5-3) unstable; urgency=high + + * Enable -z combreloc on all targets. This will make + prelinking possible with the prelink package. Please + test this on all archs prior to upload. If it fails, file + a bug immediately and I'll disable the patch for that + platform. + * Added patches from Alan Modra (from CVS) to fix other + archs after the refcount patch broke them. This supercedes + the powerpc patch, so I replaced that with this. + (closes: Bug#115218) + * Added patch from H.J. Lu (from CVS) to fix IA64 linker + problems as well. + * Added patch from David Kimdon to specify which filename is + causing an error if that filename is a dir (closes: Bug#45832). + * Removed workaround patch for stabs problem on Alpha since + it appears to be causing problems on mips and is no longer + needed on Alpha anyway. + * Now runs the testsuite and includes the results in the + binutils package for reference. + + -- Christopher C. Chimelis Sat, 13 Oct 2001 15:10:20 -0400 + +binutils (2.11.92.0.5-2) unstable; urgency=high + + * Applied fix from H.J. Lu to fix PowerPC target + (closes: Bug#115285). Thanks to Jack Howarth + for forcing the issue upstream. + + -- Christopher C. Chimelis Fri, 12 Oct 2001 23:14:51 -0400 + +binutils (2.11.92.0.5-1) unstable; urgency=high + + * New upstream release (synced with CVS 2001-10-05) + * Upstream: Support gcc 3.1 for IA64. + * Upstream: Support prelink for ELF/PPC. + * Upstream: Fix an ELF/x86 linker bug for Oracle + (closes: Bug#113614) + * Upstream: Fix a weak symbol bug. + * Upstream: Support locale. + + -- Christopher C. Chimelis Tue, 9 Oct 2001 19:53:49 -0400 + +binutils (2.11.90.0.31-2) unstable; urgency=high + + * Applied IA64 patch from CVS to fix gcc issues + on IA64. + + -- Christopher C. Chimelis Mon, 24 Sep 2001 12:45:29 -0400 + +binutils (2.11.90.0.31-1) unstable; urgency=high + + * New upstream source (synced with CVS 2001-08-30) + * Upstream: Fix a MIPS linker bug. + * Now applying mips diffs from H.J. Lu (upstream) + for better MIPS and MIPS64 support. + * Applied patch from Christopher Cramer to fix + gasp .REG issue (closes: Bug#110560) + + -- Christopher C. Chimelis Sat, 1 Sep 2001 23:42:22 -0400 + +binutils (2.11.90.0.29-1) unstable; urgency=high + + * New upstream source (synced with CVS 2001-08-27) + * Upstream: Fix an Alpha assembler bug. + * Upstream: Fix an IA64 linker bug. + * Upstream: Fix a MIPS linker bug. + * Upstream: Support '-z combreloc|nocombreloc' in linker. + + -- Christopher C. Chimelis Thu, 30 Aug 2001 04:48:04 -0400 + +binutils (2.11.90.0.27-4) unstable; urgency=high + + * Argh. Really remove the manpages from multiarch + this time (closes: Bug#110410) + + -- Christopher C. Chimelis Tue, 28 Aug 2001 14:32:34 -0400 + +binutils (2.11.90.0.27-3) unstable; urgency=high + + * Include hppa patch to force error + (closes: Bug#109173) + * Fix manpages - seems that I accidentally included + the multiarch manpages rather than the target + manpages (sorry). + * Partial update to as manpage to denote arch options + and added options for the rest of the targets + Still need to elaborate on them, though. More + changes are forthcoming (closes: Bug#110127) + + -- Christopher C. Chimelis Mon, 27 Aug 2001 10:13:27 -0400 + +binutils (2.11.90.0.27-2) unstable; urgency=high + + * Remove bash dependency...ash's behaviour has + already been modified, so it should be able + to build binutils now (closes: Bug#106992) + * Includes new S/390 patch (closes: Bug#109300) + * Could never reproduce objdump segfault and + never got a reply on the bug report + (closes: Bug#93884) + * Can't reproduce m68k segfault either + (closes: Bug#87714) + + -- Christopher C. Chimelis Mon, 20 Aug 2001 23:07:30 -0400 + +binutils (2.11.90.0.27-1) unstable; urgency=high + + * New upstream source (synced with 20010810 CVS) + * Upstream: Fixed x86 linker bug. + * Reverted a patch to gas to dodge a bug in STABS output + on Alpha using gcc 2.95.4, so alpha can be in sync + with the rest of the archs now. + * Fixes strip problems with busybox (closes: Bug#106593) + * Kernels should compile ok again on i386 + (closes: Bug#107190) + + -- Christopher C. Chimelis Thu, 16 Aug 2001 08:24:49 -0400 + +binutils (2.11.90.0.25-1) unstable; urgency=high + + * New upstream source (synced with 20010726 CVS) + * Upstream: fix i386 assembler bug. + * Upstream: "make check" has 2 failures in the + ld-selective test in ld on Linux/alpha. They + should be marked xfail. Fixed in the next release. + * Removed m68k patch (closes: Bug#106431) + * Man pages appear to be correctly generated now + (closes: Bug#98569, Bug# 98938) + * Added bash build dependency (closes: Bug#106992) + * Should compile ok on powerpc (the last one did + also...don't know why voltaire's build daemon failed). + I won't close this bug until I build it myself + on voltaire or hear back from the autobuilder folks + on PPC. + * Looking into the whole LD_LIBRARY_PATH issue that + keeps being brought up. I think the docs are wrong + because the templates say that it shouldn't obey that + at all. Can we please stop filing duplicate bugs for + this? I would greatly appreciate it... + + -- Christopher C. Chimelis Wed, 1 Aug 2001 07:06:52 -0400 + +binutils (2.11.90.0.24-1) unstable; urgency=high + + * New upstream source (synced with 20010714 CVS) + * DO NOT COMPILE FOR ALPHA. I need to fix gcc 2.95.4 + prior to this release working on Alpha correctly + (long story). + * Upstream: Avoid COPY relocs on i386 + * Upstream: Fix IA64 assembler (please try this and let me know) + * Upstream: Fix a static linking the PIC object files on ia32 + * Upstream: Add the version script support for --export-dynamic + * Upstream: Fix sparc/elf for linux/sparc + * Upstream: Fix alpha/elf for gcc 3.0 + * Supposedly required for gcc-3.0 usage on many platforms + * Add s390 to multiarch list (closes: Bug#98095) + * Supposedly good on mips, but please check. I emailed Ryan + to see if bug 98095 still happens, but never got a reply. + If I get around it, I'll check it myself since my mips + lives once again. + * Retake my package from Matt (next time we agree to an NMU, + please don't change the maintainer name...no wonder I didn't + get any bug reports!) + * Cross-compilation support will be added in the next upload + (I'll be uploading alpha debs with the next release as well, + the alpha problem outweighs cross-compilation support in + priority right now). + + -- Christopher C. Chimelis Thu, 19 Jul 2001 05:12:05 -0400 + +binutils (2.11.90.0.7-2) unstable; urgency=high + + * Applied patch from Alan Modra to fix m68k + assertion problems (closes: Bug#96352) + * Applied srec patch from Richard Henderson for + alpha. + + -- Christopher C. Chimelis Wed, 9 May 2001 03:11:19 -0400 + +binutils (2.11.90.0.7-1) unstable; urgency=high + + * New upstream source (synced with 20010425 CVS) + * Upstream: Fix the -Bsymbolic bug introduced in + binutils 2.11.90.0.5 (closes: Bug#95168) + + -- Christopher C. Chimelis Sun, 29 Apr 2001 20:03:22 -0400 + +binutils (2.11.90.0.5-1) unstable; urgency=high + + * New upstream source (synced with 20010414 CVS) + * Upstream: Fix in IA64 assembler + * Upstream: Change Linux/MIPS to use SVR4 MIPS ABI + rather than IRIX ABI. + * The above change may cause problems for MIPS. + If so, please file a bug and I'll revert those + changes if need be. I suspect that glibc, gcc, + and the kernel may eventually follow suit, though + to fit in with this change (it makes sense... + see the symbol ordering problems threads on the + binutils list for more info). + * Upstream: IA32 gas bug fixed...no further details + provided, unfortunately. + * Reportedly fixes core dumping when trying to link + object files from other platforms (now warns) + (closes: Bug#60502) + * Includes Philip Blundell's ARM PLT patch finally... + sorry for the delay (closes: Bug#94181) + * m68k problems should be fixed by now. Wish I had + gotten more feedback, but I didn't so I'm assuming it + works at this point (closes: Bug#74396) + * Stopped compiling cross-compiler packages until we + work out a better system for the entire toolchain. + Sorry, but it was taking far too long on even fast + machines and I've gotten more complaints about the + current arrangement than I have positive feedback. + (closes: Bug#91120, Bug#91119, Bug#91118, Bug#91117, + Bug#91116, Bug#88311, Bug#78028, Bug#90177) + * Fixed readelf manpage so that it no longer says that + it is a preprocessor for assembly programs + (closes: Bug#90798) + + -- Christopher C. Chimelis Tue, 17 Apr 2001 20:07:14 -0400 + +binutils (2.11.90.0.1-1) unstable; urgency=high + + * New upstream source (synced with 20010309 + CVS). + * Fixed misapplied m68k ld patch. + I am hoping that this almost totally fixes + m68k ELF for now. + * Fixed typo in mips patch and applied another + mips patch from Daniel Jacobowitz. + * Should no longer build same-arch cross + packages. Please let me know if this fix + worked so that I can close the bugs (I have + no access to such an arch at the moment) + * Made urgency high since m68k really needs + this if the bugs are truly fixed. Even if + not, this version is infinitely better on + at least two platforms than prior ones were. + + -- Christopher C. Chimelis Thu, 15 Mar 2001 16:29:32 -0500 + +binutils (2.10.91.0.2-4) unstable; urgency=low + + * Applied m68k ld and bfd patches from + Michael Fedrowitz to hopefully make things + better on m68k. + + -- Christopher C. Chimelis Sun, 11 Mar 2001 20:16:44 -0500 + +binutils (2.10.91.0.2-3) unstable; urgency=low + + * Adjusted the priority of binutils-doc to + optional. + * Added debhelper build-depends (closes: Bug#87690) + * Fixed postinst problem for new binutils + installations (closes: Bug#87911) + + -- Christopher C. Chimelis Thu, 1 Mar 2001 15:06:50 -0500 + +binutils (2.10.91.0.2-2) unstable; urgency=low + + * Add support for SH and IA64 to binutils-multiarch. + * Applied m68k gas patch from Michael Fedrowitz + in hopes that this will fix the grave bug that + has been such a pain to m68k folks. I'll leave + the bug open until it's verified that it works + ok. + * Applied IA-64 printf patch (closes: Bug#82702) + * Kernels appear to be building fine with this + release on all archs available to me + (closes: Bug#77610) + * Added text during postinst that informs users + to modify their i386 kernel Makefiles for the + --oformat change (closes: Bug#86995) + * Incorporated remaining mips diffs that weren't + already applied upstream (closes: Bug#81280) + * Sparc/sparc64 patch seems to be doing fine, so + closing the bug (closes: Bug#86781) + * Added non-linux cross- package support to rules + (closes: Bug#79948) + * Close misc bugs: + Missing info file in binutils-doc (closes: Bug#78754) + + -- Christopher C. Chimelis Thu, 22 Feb 2001 19:36:12 -0500 + +binutils (2.10.91.0.2-1) unstable; urgency=low + + * New upstream version. + * Added weak symbol relocation patch for sparc/sparc64. + * Included m68k ELF fix from Michael Fedrowitz. + * BIG NOTE: any i386 kernels compiled with this will need + to be patched to change the ld option '-oformat' to + '--oformat' (extra hyphen). + + -- Christopher C. Chimelis Tue, 20 Feb 2001 21:32:44 -0500 + +binutils (2.10.1.0.2-1) unstable; urgency=low + + * New upstream release (really prerel, but better than + using a CVS version). + * Should re-add Compaq demangling style to all + tools (alpha-only). + * Again, hopefully fixes m68k ELF support...still have + no idea why or how this was broken before. + + -- Christopher C. Chimelis Mon, 20 Nov 2000 16:25:44 -0500 + +binutils (2.10.0.27-0.cvs20001011.2) unstable; urgency=low + + * Applied another PowerPC patch to correct the + implementation of .protected and .hidden in the + linker. This should also aid in the glibc + transition on PowerPC. + + -- Christopher C. Chimelis Tue, 17 Oct 2000 13:23:40 -0400 + +binutils (2.10.0.27-0.cvs20001011.1) unstable; urgency=low + + * Applied PowerPC weak symbol patch from CVS to aid + in glibc transition on that platform. + + -- Christopher C. Chimelis Sun, 15 Oct 2000 19:12:22 -0400 + +binutils (2.10.0.27-0.cvs20001011) unstable; urgency=low + + * Grabbed a new CVS version since it backs out a + change that prevented current gcc snapshots from + linking properly to libstdc++v3. This may also + solve some other problems related to global + section symbols (feedback appreciated). + * Finally changed my email address in the control + file (how I overlooked this after all of this + time I'll never know). + + -- Christopher C. Chimelis Wed, 11 Oct 2000 08:59:36 -0400 + +binutils (2.10.0.27-0.cvs20001008) unstable; urgency=low + + * Removed configure.info.gz from binutils-doc since + it didn't really belong there. (closes: Bug#72746) + * Update for hppa/hppa64 targets (included testsuite + changes committed on 07-Oct-2000). (closes: Bug#71524) + * Upstream change to elflink.h to hopefully stop + segfaults on some archs when linking binaries to + shared libs. + + -- Christopher C. Chimelis Sun, 8 Oct 2000 16:14:08 -0400 + +binutils (2.10.0.27-0.cvs20000923.1) unstable; urgency=low + + * Fixed rules file so that builds don't fail when compiling the + binary-arch target (added binary-cross to binary-arch). + * Fixed harmless attempt at removing builddir-avr twice. + + -- Christopher C. Chimelis Thu, 28 Sep 2000 10:39:12 -0400 + +binutils (2.10.0.27-0.cvs20000923) unstable; urgency=low + + * CVS snapshot from 2000-09-23. + * Should fix some (most) HPPA issues. + * Adds binutils-m68k cross-assembler. + + -- Christopher C. Chimelis Sun, 24 Sep 2000 10:19:20 -0400 + +binutils (2.10.0.26-2) unstable; urgency=low + + * Added the avr target for Amtel's AVR MCU's + * Applied Frank I. Smith to generate packages for + multiple cross targets: + + Bump rev number, NOP. + + Testing out bumping up the rev number. + + Added powerpc, arm, mipsel cross binutils packages. + + -- Christopher C. Chimelis Fri, 22 Sep 2000 17:31:44 -0400 + +binutils (2.10.0.26-1) unstable; urgency=low + + * New upstream source. + * Added mips-linux, hppa-linux, and hppa64-linux to multiarch targets + + -- Christopher C. Chimelis Sun, 17 Sep 2000 01:05:49 -0400 + +binutils (2.10.0.24-1) unstable; urgency=low + + * New upstream source. + * Fixes ia32 assembler buglet. + * (Hopefully) fixes PPC visibility problems with + glibc 2.2 + + -- Christopher C. Chimelis Thu, 24 Aug 2000 16:52:44 -0400 + +binutils (2.10.0.18-3) unstable; urgency=low + + * Added build depends stuff. + + -- Christopher C. Chimelis Sat, 5 Aug 2000 21:09:04 -0400 + +binutils (2.10.0.18-2) unstable; urgency=low + + * Added proviso to control file saying that -multiarch + should not be installed by the average user. + + -- Christopher C. Chimelis Sat, 29 Jul 2000 20:07:15 -0400 + +binutils (2.10.0.18-1) unstable; urgency=low + + * New upstream source. + * Should address some needed things for glibc 2.2 + (added new DT_XXXX dynamic tags and fixes DT_NEEDED + link bug) + * Reapplied the now-infamous "ObjC patch" until + we can figure out why we still have this problem + (hint hint hint...we really need to do this). + + -- Christopher C. Chimelis Sat, 22 Jul 2000 13:18:27 -0400 + +binutils (2.10.0.9-4) unstable; urgency=low + + * Applied a patch from Ben Collins to fix sparc64 + linker scripts + + -- Christopher C. Chimelis Sat, 8 Jul 2000 07:24:10 -0400 + +binutils (2.10.0.9-3) unstable; urgency=low + + * Applied a patch from the libstdc++ mailing list to + make sure that the linker doesn't eat the eh_frame + section. + + -- Christopher C. Chimelis Fri, 7 Jul 2000 10:26:59 -0400 + +binutils (2.10.0.9-2) unstable; urgency=low + + * Wow, already a bug fix. + * binutils-dev now provides libiberty.h + + -- Christopher C. Chimelis Fri, 23 Jun 2000 19:54:39 -0400 + +binutils (2.10.0.9-1) unstable; urgency=low + + * New upstream version (more linux-specific). + + -- Christopher C. Chimelis Fri, 23 Jun 2000 14:31:04 -0400 + +binutils (2.10-1) unstable; urgency=low + + * New upstream version (finally, a real release!) + + -- Christopher C. Chimelis Wed, 21 Jun 2000 19:08:14 -0400 + +binutils (2.9.5.0.46-1) unstable; urgency=low + + * New upstream source. + * ELF visibility attribute should work correctly now. + * ia32 "jmp" instructions are now assembled differently + to use relocation for global jumps (affects PIC asm + code). + + -- Christopher C. Chimelis Thu, 8 Jun 2000 21:34:42 -0400 + +binutils (2.9.5.0.42-1) unstable; urgency=low + + * New upstream source. + * Includes a testcase for hidden symbol support. + + -- Christopher C. Chimelis Fri, 19 May 2000 20:48:52 -0400 + +binutils (2.9.5.0.41-1) unstable; urgency=high + + * New upstream source. + * Now includes patch to enable hidden symbol support + needed for gcc 3.0 testing. + + -- Christopher C. Chimelis Fri, 5 May 2000 20:38:41 -0400 + +binutils (2.9.5.0.37-1) frozen unstable; urgency=high + + * Was forced to bring the current frozen version up to + upstream 2.9.5.0.37 in order to fix a rather nasty + i386 gas bug and also since the existing ARM patch + applied in 2.9.5.0.31-3 has been superceded upstream + (closes:Bug#62119) + * Includes proper demangler support for Compaq compiler + usage on Alpha (may be superceded upstream shortly, + but is good enough for potato and for Compaq's usage) + (closes:Bug#62079) + * Added cross-compilation support for individual use. + Please note that the binary packages do not support + this. If you require this feature, you need to compile + the source package changing debian/rules. Also, if + you do this, YMMV since things on this front are changing + rapidly upstream and also because cross-compiling from + certain platforms to others may not work (i386->alpha, + for example). (closes:Bug#59246) + * Fixed replaces statement in binutils-multiarch + (closes:Bug#62496) + * Release Manager: I once again beg that this be included + in potato. I've freed up some time to deal with bug + reports quickly if needed. + + -- Christopher C. Chimelis Sat, 29 Apr 2000 04:03:39 -0400 + +binutils (2.9.5.0.31-3) frozen unstable; urgency=high + + * Applied patch to fix broken ARM code generation (closes:Bug#61977) + + -- Christopher C. Chimelis Fri, 7 Apr 2000 15:50:42 -0400 + +binutils (2.9.5.0.31-2) frozen unstable; urgency=high + + * Remove ld from binutils-multiarch since it doesn't want to + link kernels on several archs properly (fixes severity:important bug) + (closes: Bug#61719, Bug#61615, Bug#51625) + + -- Christopher C. Chimelis Mon, 3 Apr 2000 22:48:55 -0400 + +binutils (2.9.5.0.31-1) frozen unstable; urgency=high + + * Yet another patch (this time from H.J. Lu upstream) to fix + the unlink race condition bug. This is VERY important and + needs to be in potato. It also fixes the temp file creation + problem with objcopy on PPC (closes: Bug#60934) + * New upstream release. Fixes a serious Alpha bug along + with a demangler bug and several others (closes: Bug#61121) + * Should fix apt-get upgrade problem...please test + (closes: Bug#56175) + * Release manager: can we squeeze this in? I know it's a + new version, but the ELF bug on Alpha really needs to + be fixed along with the rest of the above and some others + not mentioned here. + + -- Christopher C. Chimelis Wed, 22 Mar 2000 05:05:12 -0500 + +binutils (2.9.5.0.22-5) frozen unstable; urgency=high + + * Applied fixed patch from Colin Phipps to seal the unlink + race condition in bfd/cache.c (closes: Bug#58865, Bug#57831) + * Installed a proper changelog in binutils-doc + (closes: Bug#58522) + * Closes other older bug (closes: Bug#55801) + * Included bbconv.pl in binutils main package in the doc dir + under the gprof subdir (closes: Bug#57521) + + -- Christopher C. Chimelis Tue, 14 Mar 2000 10:32:52 -0500 + +binutils (2.9.5.0.22-4) frozen unstable; urgency=high + + * Patched gprof/hertz.h to allow binutils to actually + build and work on Hurd (closes: Bug#57564) + * Patched bfd/cache.c to avoid a rare, but possible + security problem when as is creating/opening temp + files (closes: Bug#57831) + + -- Christopher C. Chimelis Thu, 17 Feb 2000 10:31:05 -0500 + +binutils (2.9.5.0.22-3) frozen unstable; urgency=high + + * Removed standards.info...do we really need seven + bugs filed for the same problem + (closes: Bug#54521, Bug#54546, Bug#54614, Bug#54682, Bug#55402, Bug#55582, Bug#55602) + * Changed binutils-multiarch extended description + to mention that a cross-assembling gas is not + included (closes: Bug#49308) + * Closing a bug because it related to lack of disk space + (closes: Bug#52714) + + -- Christopher C. Chimelis Wed, 19 Jan 2000 19:28:09 -0500 + +binutils (2.9.5.0.22-2) unstable; urgency=high + + * Added getopt.h include that was omitted in the -taso patch + (closes: Bug#52380) + * Fixed table misalignment when calling objdump --info + (closes: Bug#51517) + * Added Debian changelog to binutils-doc (closes: Bug#52574) + + -- Christopher C. Chimelis Wed, 15 Dec 1999 19:14:05 -0500 + +binutils (2.9.5.0.22-1) unstable; urgency=high + + * New upstream version. + * More MIPS fixes. + * Added support for -taso linker flag for Alpha. + * Reapplied all previous patches. + + -- Christopher C. Chimelis Wed, 7 Dec 1999 01:08:51 -0600 + +binutils (2.9.5.0.19-1) unstable; urgency=high + + * New upstream version + * Fixes some MIPS problems + * Reapplied the ObjC patch (is this ever going to be fixed upstream) + since it's badly needed right now + + -- Christopher C. Chimelis Thu, 4 Nov 1999 15:00:35 -0400 + +binutils (2.9.5.0.16-3) unstable; urgency=low + + * Added support for mipsel-linux in binutils-multiarch + + -- Christopher C. Chimelis Thu, 4 Nov 1999 15:00:35 -0400 + +binutils (2.9.5.0.16-2) unstable; urgency=low + + * Added a replaces field in the control file to fix + previous file overwrite problems (closes: Bug#47518, Bug#47938) + * Verified manpages are up to date (closes: Bug#18483) + * Added m68k-rtems to targets in -multiarch in hopes + that it will actually work as advertised (closes: Bug#47468) + + -- Christopher C. Chimelis Mon, 25 Oct 1999 15:58:55 -0400 + +binutils (2.9.5.0.16-1) unstable; urgency=low + + * New upstream version. + * Massive bugfix upload on the Debian side: + * Fixes changelog problems between all of the binutils + debs (closes: Bug#47133, Bug#47208, Bug#47211) + * Fixes other overwrite problems (closes: Bug#46991, Bug#47024, Bug#46074) + * Multiarch should now make good diversions when + upgrading (closes: Bug#47359) + * Applied patch from Kevin Buhr to fix ld segfaults with + empty archives (closes: Bug#47019) + * Should have fixed info install problems by now + (closes: Bug#35935) + + -- Christopher C. Chimelis Fri, 15 Oct 1999 03:18:55 -0400 + +binutils (2.9.5.0.14-1) unstable; urgency=low + + * New upstream version. + * Thanks to Matthias Klose for the following: + * Separate documentation to binutils-doc package. + * debian/rules: + - Remove extra /usr/share/doc/binutils/changelog.gz file. + - Move bfd docs to binutils-dev package. + - Move upstream changelogs to binutils-doc package. + - Remove standard GNU info files left in /usr/share/info. + - Call dh_installdocs for all packages. + * debian/*{dirs,files}: Remove. Mention explicitly in debian/rules. + + -- Christopher C. Chimelis Wed, 6 Oct 1999 03:18:55 -0400 + +binutils (2.9.5.0.12-2) unstable; urgency=low + + * Applied patch from Matthias Klose to fix many issues including architecture detection. + * Rules file is now much prettier and easier to manage. + * Binutils is now built for i386 rather than i486 in the rules file (oops). + * Added diversion for readelf in binutils-multiarch. + + -- Christopher C. Chimelis Tue, 21 Sep 1999 03:39:08 -0400 + +binutils (2.9.5.0.12-1) unstable; urgency=low + + * Massive bugfix release. + * New upstream source (finally) (closes: Bug#44934) + * Fixes upstream bugs on many platforms. + * Gives powerpc a working binutils again. (closes: Bug#45052) + * Now provides .code16 support on i386 (please test) + * Manpage for objdump should now be complete (closes: Bug#27039) + * Put together manpages for gasp and the new binary readelf (closes: Bug#21918) + * Fixes nm core dump problem (closes: Bug#41999) + * Applied patches from Ben Collins to add sparc64 support (closes: Bug#44426) + * Update Standards version + * FHS compliance + + -- Christopher C. Chimelis Sat, 18 Sept 1999 01:21:05 -0400 + +binutils (2.9.5.0.12-0.2) experimental; urgency=low + + * Added Sparc/Sparc64 changes from Ben Collins (I really need a Sparc one of these days). + * Again, this should be the last experimental before a new release. + + -- Christopher C. Chimelis Fri, 17 Aug 1999 16:32:05 -0400 + +binutils (2.9.5.0.12-0.1) experimental; urgency=low + + * New upstream version. + * Should be the last experimental before a new release. + + -- Christopher C. Chimelis Thu, 9 Aug 1999 23:12:52 -0400 + +binutils (2.9.5.0.10-0.1) experimental; urgency=low + + * New upstream version. + * Didn't apply PPC patches...let me know if still needed + + -- Christopher C. Chimelis Thu, 9 Aug 1999 23:12:52 -0400 + +binutils (2.9.5.0.6-0.1) experimental; urgency=low + + * New upstream version. + * Didn't apply PPC patches...let me know if still needed + + -- Christopher C. Chimelis Thu, 9 Aug 1999 23:12:52 -0400 + +binutils (2.9.4.0.8-0.1) unstable; urgency=low + + * New upstream version. + * Applied as much of the PPC patches as I could. + + -- Christopher C. Chimelis Thu, 15 Jul 1999 12:46:45 -0400 + +binutils (2.9.4.0.3-0.1) unstable; urgency=low + + * New upstream version. + * Apply patch from Richard Henderson to fix PPC's libpath. + * Apply patch from Franz Sirl to fix Richard Henderson. + + -- Daniel Jacobowitz Sun, 6 Jun 1999 01:27:10 -0400 + +binutils (2.9.4.0.2-0.1) unstable; urgency=low + + * New upstream version. 2.9.4.0.1 was hurriedly recalled. + + -- Daniel Jacobowitz Sun, 6 Jun 1999 01:27:10 -0400 + +binutils (2.9.4.0.1-0.1) unstable; urgency=low + + * New upstream version. + + -- Daniel Jacobowitz Sun, 6 Jun 1999 01:27:10 -0400 + +binutils (2.9.1.0.25-2) unstable; urgency=low + + * Added ObjC patch AGAIN...sorry about that + + -- Christopher C. Chimelis Sun, 23 May 1999 15:14:35 -0400 + +binutils (2.9.1.0.25-1) unstable; urgency=low + + * New upstream version - Fixes a PIII asm optimisation bug + + -- Christopher C. Chimelis Sun, 23 May 1999 00:36:55 -0400 + +binutils (2.9.1.0.24-2) unstable; urgency=low + + * Reapplied ObjC patch...apparently it's still needed. + + -- Christopher C. Chimelis Mon, 10 May 1999 19:53:15 -0400 + +binutils (2.9.1.0.24-1) unstable; urgency=low + + * New upstream release - fixes too many little things to mention. + + -- Christopher C. Chimelis Tue, 3 May 1999 16:35:08 -0400 + +binutils (2.9.1.0.23-1) unstable; urgency=low + + * New upstream release - incorporates sparc64 and arm patches. + * Added RPATH patch from Joel Klecker since my last upload failed. + * Removed ObjC patch. Let me know if it is still needed (doubtful, but + still might be). + + -- Christopher C. Chimelis Mon, 5 Apr 1999 13:26:55 -0500 + +binutils (2.9.1.0.22b-2) unstable; urgency=low + + * Added patch from Joel Klecker to finally (properly) fix the rpath issue + (Thanks, Joel!). + + -- Christopher C. Chimelis Fri, 2 Apr 1999 18:14:05 -0600 + +binutils (2.9.1.0.22b-1) unstable; urgency=low + + * Converted package to CVS (so bear with any delays in handling + bug fixes; I'm new to CVS ironically) + * New upstream version (sparc64 and ARM patches again added). + * Added support for mingw32 target in binutils-multiarch + + -- Christopher C. Chimelis Fri, 12 Mar 1999 03:51:44 -0600 + +binutils (2.9.1.0.19a-4) frozen unstable; urgency=high + * Added sparc64 patches from Steve Dunham to fix sparc64 targets + * Modified rules to add support for gcc/egcs by arch. + + -- Christopher C. Chimelis Mon, 1 Feb 1999 15:51:19 -0600 + +binutils (2.9.1.0.19a-3) frozen unstable; urgency=high + + * Reverted a patch to elflink.h that caused problems for + Obj-C code (symbols weren't exported with a size or + type). + + -- Christopher C. Chimelis Thu, 21 Jan 1999 19:25:17 -0600 + +binutils (2.9.1.0.19a-2) frozen unstable; urgency=low + + * Added arm-linux as multiarch target (sorry Jim). + * Uploaded to frozen to fix strange intermittant kernel + compilation problems (Fixes #31434). + * Fixed multiarch's postinst script to check for + c++filt.single before trying to remove it to prevent + warning messages if using g++ from egcs. + * Fixed typo in multiarch's postrm (addr2line) (Fixes: #31533) + * Added links to .so's for clean removal in the future (Fixes: #31536) + + -- Christopher C. Chimelis Fri, 8 Jan 1999 15:28:32 -0600 + +binutils (2.9.1.0.19a-1) unstable; urgency=low + + * New upstream version; fixes some Alpha problems and other archs + should benefit also. + * Added ARM target patch from Corel again (still not in upstream). + + -- Christopher C. Chimelis Mon, 4 Jan 1999 20:24:36 -0600 + +binutils (2.9.1.0.16-1) unstable; urgency=low + + * New upstream version; merges some ARM patches for Netwinders + * Added patch for ARM target from Corel (thanks Jim Pick) + + -- Christopher C. Chimelis Mon, 30 Nov 1998 16:59:25 -0600 + +binutils (2.9.1.0.15-5) frozen unstable; urgency=low + + * Reuploaded to frozen (why it wasn't there earlier....) + + -- Christopher C. Chimelis Mon, 30 Nov 1998 16:37:08 -0600 + +binutils (2.9.1.0.15-4) unstable frozen; urgency=low + + * Removed c++filt diversion in -multiarch to prevent conflicting + diversions when using egcs' g++ (which also wants to divert c++filt) + + -- Christopher C. Chimelis Wed, 25 Nov 1998 18:06:17 -0600 + +binutils (2.9.1.0.15-3) unstable frozen; urgency=low + + * Made Roman's changes "official" (thanks Roman). + + -- Christopher C. Chimelis Mon, 2 Nov 1998 05:46:56 -0600 + +binutils (2.9.1.0.15-2.1) unstable; urgency=low + + * Non-maintainer upload with agreement from Chris. + * Use a different soname for multi-arch libbfd and libopcodes; this + fixes the problem that the single-arch binaries (as and the diverted + ones) will all dump core because they're runtime-linked against the + multi-arch libs. (Fixes: #28656) + * Due to the above, binutils-multiarch also needs ldconfig in postinst + now. + * Fixup diversions once again: Do not even package the ldscripts for the + native architecture, so diversions for files in /usr/lib/ldscripts + aren't necessary. + * Also remove diversions on abort-install. + * Remove now obsolete diversions in preinst. + * Also symlink /usr/doc/binutils-multiarch to binutils, and do not + put /usr/doc/binutils in the package again. + * Put the symlinks libbfd.so and libopcode.so into binutils-dev, so one + can link to them. + + -- Roman Hodek Sat, 31 Oct 1998 11:31:14 +0100 + +binutils (2.9.1.0.15-2) unstable; urgency=low + + * Fixed binutils-multiarch diversions + * Reverted elf.c to .13 version to fix bug in strip + + -- Christopher C. Chimelis Tue, 27 Oct 1998 05:26:28 -0600 + +binutils (2.9.1.0.15-1) unstable; urgency=low + + * New upstream version. + * Moved over to debhelper and updated standards version to 2.4.1.4. + * Adds 3DNow instruction support for AMD processors. + * Fixes MANY Alpha bugs and a few for Sparc, PPC, and m68k reportedly. + * Added binutils-multiarch package to allow for multiple-arch support + (fixes bug #19471). + + -- Christopher C. Chimelis Thu, 14 Oct 1998 19:30:10 -0500 + +binutils (2.9.1.0.13-1) unstable; urgency=low + + * New upstream version, fixes bug #25354. + * Hopefully, all requested docs are included, fixes bug #21325. + * Fixes MANY Alpha problems. + * Reportedly may fix MIPS and Sparc problems also...see changelogs. + * Has been tested on x86's with great success. + + -- Christopher C. Chimelis Mon, 5 Oct 1998 23:02:08 -0500 + +binutils (2.9.1-0.2) frozen unstable; urgency=low + + * Fixed binutils-dev dependencies. + + -- Joel Klecker Tue, 05 May 1998 09:24:04 -0700 + +binutils (2.9.1-0.1) frozen unstable; urgency=medium + + * Non-maintainer release. + * New upstream release. + * Moved docs into subdirs where appropriate. + * Integrated the following changes from J.H.M. Dassen: + * Updated FSF address in copyright file. (lintian). + * Reported lack of "gasp" manpage (# ....), and link it to + undocumented(7). (lintian). + * Added a TODO list. + + -- Joel Klecker Thu, 30 Apr 1998 10:43:42 -0700 + +binutils (2.9-0.3) frozen unstable; urgency=medium + + * Added upstream patch which fixes a problem with strip + and netscape (#17971). + + -- Joel Klecker Tue, 28 Apr 1998 08:58:27 -0700 + +binutils (2.9-0.2) frozen unstable; urgency=low + + * Added more of the upstream docs (#21325). + * Put a changelog.gz symlink in /usr/doc/binutils + to satisfy policy. + + -- Joel Klecker Tue, 21 Apr 1998 09:02:22 -0700 + +binutils (2.9-0.1) frozen unstable; urgency=low + + * Non-maintainer release. + * New upstream release (bugfixes only). + + -- Joel Klecker Sun, 12 Apr 1998 04:11:07 -0700 + +binutils (2.8.1.0.23-1) unstable; urgency=low + + * New upstream version + * -dev replaces libc5-dev (#17840) + * No longer possible to link against shared libbbfd/opcodes (#18121) + + -- Galen Hazelwood Sat, 14 Mar 1998 18:19:10 -0700 + +binutils (2.8.1.0.19-1) unstable; urgency=low + + * New upstream version (#17296) + * Fixed typo in description (#16481) + * Fully replaces libbfd-dev (#16619) + + -- Galen Hazelwood Sun, 25 Jan 1998 15:37:03 -0700 + +binutils (2.8.1.0.17-1) unstable; urgency=low + + * New upstream version + * Rejoined libbfd and binutils packages (#15486) + * Added "SHELL=bash" to rules file (#14528) + * bfd info docs seem to be broken, don't install for now + + -- Galen Hazelwood Sat, 6 Dec 1997 14:55:26 -0700 + +binutils (2.8.1.0.15-1) unstable; urgency=low + + * New upstream version (#14250) + * Updated to Standard 2.3.0.0 + * Restored ansidecl.h to libbfd-dev (#14116) + + -- Galen Hazelwood Thu, 30 Oct 1997 20:04:24 -0700 + +binutils (2.8.1-2) unstable; urgency=low + + * Added 2.8.1.0.4 patch + + -- Galen Hazelwood Thu, 12 Jun 1997 20:49:57 -0600 + +binutils (2.8.1-1) unstable; urgency=low + + * New upstream version + * Added 2.8.1.0.1 patch + + -- Galen Hazelwood Fri, 30 May 1997 14:48:42 -0600 + +binutils (2.8-1) unstable; urgency=low + + * New upstream version + * Smarter debian build environment (automatic version handling) + * Added 2.8.0.3 patch + * Built with libc6 + + -- Galen Hazelwood Sun, 4 May 1997 11:16:12 -0600 + +binutils (2.7.0.9-3) frozen unstable; urgency=low + + * Patched for alpha support + * Distribute libiberty.a with -dev package (#8376) + * libbfd[x]-dev now has standard Provides/Conflicts behavior (#8377) + + -- Galen Hazelwood Fri, 28 Mar 1997 11:45:58 -0700 + +binutils (2.7.0.9-2) unstable; urgency=low + + * Moved 2.7.0.9 out of experimental (no longer unreleased beta) + + -- Galen Hazelwood Sun, 9 Mar 1997 23:43:19 -0700 + +binutils (2.7.0.9-1) experimental; urgency=low + + * New upstream beta version (fixes bug #7336) + * Split shared libraries (bfd) out of binutils (fixes bug #7244) + * No longer builds aout-binutils + + -- Galen Hazelwood Thu, 13 Feb 1997 00:27:18 -0700 + +binutils (2.7-6) unstable; urgency=low + + * Uses dpkg --print-gnu-build-architecture for build + * Demoted aout-binutils to priority "extra" + + -- Galen Hazelwood Mon, 27 Jan 1997 13:34:08 -0700 + +binutils (2.7-5) unstable; urgency=low (HIGH for m68k) + + * Added patch for m68k, will now compile X68 and kernel 2.1.15 + + -- Galen Hazelwood Tue, 31 Dec 1996 22:15:03 -0700 + +binutils (2.7-4) unstable; urgency=low + + * New maintainer + * Updated to new source format + * Fixed typo in script.1 (Fixes bug #4558) + * Fixed typo in as.1 (Fixes bug #5567) + * Postinst now calls ldconfig without explicit pathname (Fixes bug #6151) + + -- Galen Hazelwood Mon, 30 Dec 1996 12:10:25 -0700 + +binutils (2.7-3): + +Remove lib*.so links so the libs are not used for develpment. +gzip manpages + +Changes made by Michael Meskes in consent with David Engel. + +binutils (2.7-2): + +Include shared libraries +Strip shared libraries +Also update AOUT version +Minor changes to debian.rules + +binutils (2.7-1): + +Updated to new upstream version. + +Added a simple extended description (Bug#3574). + +Don't call ldconfig from postrm script (Bug#4246). + + LocalWords: Aurelien Jarno + --- binutils-2.20.1.orig/debian/binutils-multiarch.shlibs +++ binutils-2.20.1/debian/binutils-multiarch.shlibs @@ -0,0 +1,2 @@ +libbfd 2.20.1-multiarch.20100303 binutils-multiarch (>= 2.20.1), binutils-multiarch (<< 2.20.2) +libopcodes 2.20.1-multiarch.20100303 binutils-multiarch (>= 2.20.1), binutils-multiarch (<< 2.20.2) --- binutils-2.20.1.orig/debian/watch +++ binutils-2.20.1/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://ftp.gnu.org/gnu/binutils/binutils-([\d\.]*).tar.gz --- binutils-2.20.1.orig/debian/source/format +++ binutils-2.20.1/debian/source/format @@ -0,0 +1 @@ +1.0 --- binutils-2.20.1.orig/debian/patches/137_pr11138.dpatch +++ binutils-2.20.1/debian/patches/137_pr11138.dpatch @@ -0,0 +1,169 @@ +#!/bin/sh -e +## 137_pr11138.dpatch.dpatch +## +## DP: Description: PR ld/11138: internal error when DSO is before object files + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +bfd/ + +2010-01-07 H.J. Lu + + PR ld/11138 + * elflink.c (elf_link_check_versioned_symbol): Don't abort if + a symbol referenced by DSO is is defined in a non-shared object + and forced local. + +ld/testsuite/ + +2010-01-07 H.J. Lu + + PR ld/11138 + * ld-elf/pr11138-1.c: New. + * ld-elf/pr11138-1.map: Likewise. + * ld-elf/pr11138-2.c: Likewise. + * ld-elf/pr11138-2.map: Likewise. + * ld-elf/pr11138.out: Likewise. + + * ld-elf/shared.exp (build_tests): Add libpr11138-1.so and + libpr11138-2.o. + (run_tests): Add 2 tests for PR ld/11138. + +@DPATCH@ +diff --git a/bfd/elflink.c b/bfd/elflink.c +index 297d46b..a27dc50 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -8492,10 +8492,14 @@ elf_link_check_versioned_symbol (struct bfd_link_info *info, + + _bfd_elf_swap_versym_in (input, ever, &iver); + +- if ((iver.vs_vers & VERSYM_HIDDEN) == 0) ++ if ((iver.vs_vers & VERSYM_HIDDEN) == 0 ++ && !(h->def_regular ++ && h->forced_local)) + { + /* If we have a non-hidden versioned sym, then it should +- have provided a definition for the undefined sym. */ ++ have provided a definition for the undefined sym unless ++ it is defined in a non-shared object and forced local. ++ */ + abort (); + } + +diff --git a/ld/testsuite/ld-elf/pr11138-1.c b/ld/testsuite/ld-elf/pr11138-1.c +new file mode 100644 +index 0000000..2aab815 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr11138-1.c +@@ -0,0 +1,13 @@ ++#include ++ ++void ++bar (void) ++{ ++ printf ("DSO bar\n"); ++} ++ ++void ++foo (void) ++{ ++ bar (); ++} +diff --git a/ld/testsuite/ld-elf/pr11138-1.map b/ld/testsuite/ld-elf/pr11138-1.map +new file mode 100644 +index 0000000..8676b1f +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr11138-1.map +@@ -0,0 +1,4 @@ ++VERS_1 { ++ global: bar; foo; ++ local: *; ++}; +diff --git a/ld/testsuite/ld-elf/pr11138-2.c b/ld/testsuite/ld-elf/pr11138-2.c +new file mode 100644 +index 0000000..ccca280 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr11138-2.c +@@ -0,0 +1,17 @@ ++#include ++ ++extern void foo (void); ++ ++void ++bar (void) ++{ ++ printf ("MAIN bar\n"); ++} ++ ++int ++main (void) ++{ ++ bar (); ++ foo (); ++ return 0; ++} +diff --git a/ld/testsuite/ld-elf/pr11138-2.map b/ld/testsuite/ld-elf/pr11138-2.map +new file mode 100644 +index 0000000..1f8fb15 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr11138-2.map +@@ -0,0 +1,4 @@ ++{ ++ global: main; ++ local: *; ++}; +diff --git a/ld/testsuite/ld-elf/pr11138.out b/ld/testsuite/ld-elf/pr11138.out +new file mode 100644 +index 0000000..6dbdc49 +--- /dev/null ++++ b/ld/testsuite/ld-elf/pr11138.out +@@ -0,0 +1,2 @@ ++MAIN bar ++DSO bar +diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp +index 3128e05..d0c3478 100644 +--- a/ld/testsuite/ld-elf/shared.exp ++++ b/ld/testsuite/ld-elf/shared.exp +@@ -148,6 +148,12 @@ set build_tests { + {"Build libpr9679.so" + "-shared" "-fPIC -O0" + {pr9679-1.c pr9679-2.c} {{readelf {-s} pr9679.rd}} "libpr9679.so"} ++ {"Build libpr11138-1.so" ++ "-shared -Wl,--version-script=pr11138-1.map" "-fPIC" ++ {pr11138-1.c} {} "libpr11138-1.so"} ++ {"Build libpr11138-2.o" ++ "-r -nostdlib" "" ++ {pr11138-2.c} {} "libpr11138-2.o"} + } + + set run_tests { +@@ -266,6 +272,12 @@ set run_tests { + {"Run with comm1.o libfunc1.so" + "tmpdir/comm1.o tmpdir/libfunc1.so" "" + {dummy.c} "comm1" "pass.out"} ++ {"Run with pr11138-2.c libpr11138-1.so" ++ "--version-script=pr11138-2.map tmpdir/pr11138-2.o tmpdir/libpr11138-1.so" "" ++ {dummy.c} "pr11138a" "pr11138.out"} ++ {"Run with libpr11138-1.so pr11138-2.c" ++ "--version-script=pr11138-2.map tmpdir/libpr11138-1.so tmpdir/pr11138-2.o" "" ++ {dummy.c} "pr11138b" "pr11138.out"} + } + + run_cc_link_tests $build_tests --- binutils-2.20.1.orig/debian/patches/212-hjl-bfd-64k.dpatch +++ binutils-2.20.1/debian/patches/212-hjl-bfd-64k.dpatch @@ -0,0 +1,70 @@ +#!/bin/sh -e +## 212-hjl-bfd-64k.dpatch +## +## DP: Description: elf.c (assign_section_numbers): Check if number of sections +## DP: Description: >= SHN_LORESERVE. +## DP: Description: elfcode.h (elf_object_p): Likewise. +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.18.50.0.5 +## DP: Original patch: bfd-64k-2.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p0 < $0;; + -unpatch) patch $patch_opts -p0 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2008-03-12 H.J. Lu + + * elf.c (assign_section_numbers): Check if number of sections + >= SHN_LORESERVE. + * elfcode.h (elf_object_p): Likewise. + +@DPATCH@ +--- bfd/elf.c.64k 2008-03-12 12:32:53.000000000 -0700 ++++ bfd/elf.c 2008-03-12 14:06:17.000000000 -0700 +@@ -2831,6 +2831,13 @@ assign_section_numbers (bfd *abfd, struc + _bfd_elf_strtab_addref (elf_shstrtab (abfd), t->strtab_hdr.sh_name); + } + ++ if (section_number >= SHN_LORESERVE) ++ { ++ _bfd_error_handler (_("%B: too many sections: %u"), ++ abfd, section_number); ++ return FALSE; ++ } ++ + _bfd_elf_strtab_finalize (elf_shstrtab (abfd)); + t->shstrtab_hdr.sh_size = _bfd_elf_strtab_size (elf_shstrtab (abfd)); + +--- bfd/elfcode.h.64k 2008-03-12 12:32:05.000000000 -0700 ++++ bfd/elfcode.h 2008-03-12 15:30:51.000000000 -0700 +@@ -684,8 +684,14 @@ elf_object_p (bfd *abfd) + if (i_ehdrp->e_shnum == SHN_UNDEF) + { + i_ehdrp->e_shnum = i_shdr.sh_size; +- if (i_ehdrp->e_shnum != i_shdr.sh_size +- || i_ehdrp->e_shnum == 0) ++ if (i_ehdrp->e_shnum >= SHN_LORESERVE) ++ { ++ _bfd_error_handler (_("%B: too many sections: %u"), ++ abfd, i_ehdrp->e_shnum); ++ abort (); ++ } ++ else if (i_ehdrp->e_shnum != i_shdr.sh_size ++ || i_ehdrp->e_shnum == 0) + goto got_wrong_format_error; + } + --- binutils-2.20.1.orig/debian/patches/303-CVE-2014-8501.dpatch +++ binutils-2.20.1/debian/patches/303-CVE-2014-8501.dpatch @@ -0,0 +1,61 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 303-CVE-2014-8501.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: _bfd_XXi_swap_aouthdr_in out-of-bounds write [CVE-2014-8501] + +@DPATCH@ + +From: Kai Tietz +Date: Thu, 21 Mar 2013 14:07:08 +0000 (+0000) +Subject: * coffgen.c (coff_real_object_p): Make global. +X-Git-Tag: sid-snapshot-20130401~137 +X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=ce63b7b388b808bf574fe2d1de675b038857312e + + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Just handle amount + of directory-entiries as specified in pe-header. + +From 7e1e19887abd24aeb15066b141cdff5541e0ec8e Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Mon, 27 Oct 2014 14:45:06 +0000 +Subject: [PATCH] Fix a seg-fault in strings and other binutuils when parsing a corrupt PE + executable with an invalid value in the NumberOfRvaAndSizes field of the + AOUT header. + + PR binutils/17512 + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries + with an invalid value for NumberOfRvaAndSizes. + +[Ubuntu note: patch differs from upstream commit in that it drops the +changelog update to reduce patch conflicts and incorporates the +bfd/peXXigen.c fix from the first commit. --sbeattie] + +CVE-2014-8501 +--- + bfd/peXXigen.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +Index: b/bfd/peXXigen.c +=================================================================== +--- a/bfd/peXXigen.c ++++ b/bfd/peXXigen.c +@@ -461,7 +461,18 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, + { + int idx; + +- for (idx = 0; idx < 16; idx++) ++ /* PR 17512: Corrupt PE binaries can cause seg-faults. */ ++ if (a->NumberOfRvaAndSizes > 16) ++ { ++ (*_bfd_error_handler) ++ (_("%B: aout header specifies an invalid number of data-directory entries: %d"), ++ abfd, a->NumberOfRvaAndSizes); ++ /* Paranoia: If the number is corrupt, then assume that the ++ actual entries themselves might be corrupt as well. */ ++ a->NumberOfRvaAndSizes = 0; ++ } ++ ++ for (idx = 0; idx < a->NumberOfRvaAndSizes; idx++) + { + /* If data directory is empty, rva also should be 0. */ + int size = --- binutils-2.20.1.orig/debian/patches/147_arm_linking_time.dpatch +++ binutils-2.20.1/debian/patches/147_arm_linking_time.dpatch @@ -0,0 +1,220 @@ +#!/bin/sh -e +## 147_arm_linking_time.dpatch +## +## DP: Description: Reduce ARM linking time (backport from trunk) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2010-03-19 Jie Zhang + + * elf32-arm.c (struct section_list): Remove. + (section_list): Remove typedef. + (record_section_with_arm_elf_section_data): Remove. + (find_arm_elf_section_entry): Remove. + (get_arm_elf_section_data): Use is_arm_elf. + (unrecord_section_with_arm_elf_section_data): Remove. + (elf32_arm_new_section_hook): Don't call + record_section_with_arm_elf_section_data. + (elf32_arm_write_section): Set mapcount to -1 when + the map has been used. Don't call + unrecord_section_with_arm_elf_section_data. + (unrecord_section_via_map_over_sections): Remove. + (elf32_arm_close_and_cleanup): Remove. + (elf32_arm_bfd_free_cached_info): Remove. + (bfd_elf32_close_and_cleanup): Don't define. + (bfd_elf32_bfd_free_cached_info): Don't define. + +@DPATCH@ +--- ./bfd/elf32-arm.c.orig 2010-02-22 09:06:48.000000000 +0100 ++++ ./bfd/elf32-arm.c 2010-03-30 13:51:24.754836445 +0200 +@@ -12736,108 +12736,15 @@ + return TRUE; + } + +-/* A structure used to record a list of sections, independently +- of the next and prev fields in the asection structure. */ +-typedef struct section_list +-{ +- asection * sec; +- struct section_list * next; +- struct section_list * prev; +-} +-section_list; +- +-/* Unfortunately we need to keep a list of sections for which +- an _arm_elf_section_data structure has been allocated. This +- is because it is possible for functions like elf32_arm_write_section +- to be called on a section which has had an elf_data_structure +- allocated for it (and so the used_by_bfd field is valid) but +- for which the ARM extended version of this structure - the +- _arm_elf_section_data structure - has not been allocated. */ +-static section_list * sections_with_arm_elf_section_data = NULL; +- +-static void +-record_section_with_arm_elf_section_data (asection * sec) +-{ +- struct section_list * entry; +- +- entry = bfd_malloc (sizeof (* entry)); +- if (entry == NULL) +- return; +- entry->sec = sec; +- entry->next = sections_with_arm_elf_section_data; +- entry->prev = NULL; +- if (entry->next != NULL) +- entry->next->prev = entry; +- sections_with_arm_elf_section_data = entry; +-} +- +-static struct section_list * +-find_arm_elf_section_entry (asection * sec) +-{ +- struct section_list * entry; +- static struct section_list * last_entry = NULL; +- +- /* This is a short cut for the typical case where the sections are added +- to the sections_with_arm_elf_section_data list in forward order and +- then looked up here in backwards order. This makes a real difference +- to the ld-srec/sec64k.exp linker test. */ +- entry = sections_with_arm_elf_section_data; +- if (last_entry != NULL) +- { +- if (last_entry->sec == sec) +- entry = last_entry; +- else if (last_entry->next != NULL +- && last_entry->next->sec == sec) +- entry = last_entry->next; +- } +- +- for (; entry; entry = entry->next) +- if (entry->sec == sec) +- break; +- +- if (entry) +- /* Record the entry prior to this one - it is the entry we are most +- likely to want to locate next time. Also this way if we have been +- called from unrecord_section_with_arm_elf_section_data() we will not +- be caching a pointer that is about to be freed. */ +- last_entry = entry->prev; +- +- return entry; +-} +- + static _arm_elf_section_data * + get_arm_elf_section_data (asection * sec) + { +- struct section_list * entry; +- +- entry = find_arm_elf_section_entry (sec); +- +- if (entry) +- return elf32_arm_section_data (entry->sec); ++ if (sec && sec->owner && is_arm_elf (sec->owner)) ++ return elf32_arm_section_data (sec); + else + return NULL; + } + +-static void +-unrecord_section_with_arm_elf_section_data (asection * sec) +-{ +- struct section_list * entry; +- +- entry = find_arm_elf_section_entry (sec); +- +- if (entry) +- { +- if (entry->prev != NULL) +- entry->prev->next = entry->next; +- if (entry->next != NULL) +- entry->next->prev = entry->prev; +- if (entry == sections_with_arm_elf_section_data) +- sections_with_arm_elf_section_data = entry->next; +- free (entry); +- } +-} +- +- + typedef struct + { + void *finfo; +@@ -13230,8 +13137,6 @@ + sec->used_by_bfd = sdata; + } + +- record_section_with_arm_elf_section_data (sec); +- + return _bfd_elf_new_section_hook (abfd, sec); + } + +@@ -13659,44 +13564,13 @@ + } + + free (map); +- arm_data->mapcount = 0; ++ arm_data->mapcount = -1; + arm_data->mapsize = 0; + arm_data->map = NULL; +- unrecord_section_with_arm_elf_section_data (sec); + + return FALSE; + } + +-static void +-unrecord_section_via_map_over_sections (bfd * abfd ATTRIBUTE_UNUSED, +- asection * sec, +- void * ignore ATTRIBUTE_UNUSED) +-{ +- unrecord_section_with_arm_elf_section_data (sec); +-} +- +-static bfd_boolean +-elf32_arm_close_and_cleanup (bfd * abfd) +-{ +- if (abfd->sections) +- bfd_map_over_sections (abfd, +- unrecord_section_via_map_over_sections, +- NULL); +- +- return _bfd_elf_close_and_cleanup (abfd); +-} +- +-static bfd_boolean +-elf32_arm_bfd_free_cached_info (bfd * abfd) +-{ +- if (abfd->sections) +- bfd_map_over_sections (abfd, +- unrecord_section_via_map_over_sections, +- NULL); +- +- return _bfd_free_cached_info (abfd); +-} +- + /* Display STT_ARM_TFUNC symbols as functions. */ + + static void +@@ -13882,8 +13756,6 @@ + #define bfd_elf32_find_inliner_info elf32_arm_find_inliner_info + #define bfd_elf32_new_section_hook elf32_arm_new_section_hook + #define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol +-#define bfd_elf32_close_and_cleanup elf32_arm_close_and_cleanup +-#define bfd_elf32_bfd_free_cached_info elf32_arm_bfd_free_cached_info + #define bfd_elf32_bfd_final_link elf32_arm_final_link + + #define elf_backend_get_symbol_type elf32_arm_get_symbol_type --- binutils-2.20.1.orig/debian/patches/302-CVE-2014-8485.dpatch +++ binutils-2.20.1/debian/patches/302-CVE-2014-8485.dpatch @@ -0,0 +1,98 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 302-CVE-2014-8485.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: setup_group poor memory handling [CVE-2014-8485] + +@DPATCH@ + +From 493a33860c71cac998f1a56d6d87d6faa801fbaa Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Mon, 27 Oct 2014 12:43:16 +0000 +Subject: [PATCH] This patch closes a potential security hole in applications that use + the bfd library to parse binaries containing maliciously corrupt section + group headers. + + PR binutils/17510 + * elf.c (setup_group): Improve handling of corrupt group + sections. + +[Ubuntu note: this patch differs from upstream by dropping the Changelog +entry to reduce patch conflicts. -- sbeattie] + +CVE-2014-8485 + +--- + bfd/elf.c | 34 ++++++++++++++++++++++++++++++---- + 2 files changed, 36 insertions(+), 4 deletions(-) + +diff --git a/bfd/elf.c b/bfd/elf.c +index c884d1d..c8ac826 100644 +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -608,9 +608,10 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) + if (shdr->contents == NULL) + { + _bfd_error_handler +- (_("%B: Corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size); ++ (_("%B: corrupt size field in group section header: 0x%lx"), abfd, shdr->sh_size); + bfd_set_error (bfd_error_bad_value); +- return FALSE; ++ -- num_group; ++ continue; + } + + memset (shdr->contents, 0, amt); +@@ -618,8 +619,17 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) + if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 + || (bfd_bread (shdr->contents, shdr->sh_size, abfd) + != shdr->sh_size)) +- return FALSE; +- ++ { ++ _bfd_error_handler ++ (_("%B: invalid size field in group section header: 0x%lx"), abfd, shdr->sh_size); ++ bfd_set_error (bfd_error_bad_value); ++ -- num_group; ++ /* PR 17510: If the group contents are even partially ++ corrupt, do not allow any of the contents to be used. */ ++ memset (shdr->contents, 0, amt); ++ continue; ++ } ++ + /* Translate raw contents, a flag word followed by an + array of elf section indices all in target byte order, + to the flag word followed by an array of elf section +@@ -651,6 +661,21 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) + } + } + } ++ ++ /* PR 17510: Corrupt binaries might contain invalid groups. */ ++ if (num_group != (unsigned) elf_tdata (abfd)->num_group) ++ { ++ elf_tdata (abfd)->num_group = num_group; ++ ++ /* If all groups are invalid then fail. */ ++ if (num_group == 0) ++ { ++ elf_tdata (abfd)->group_sect_ptr = NULL; ++ elf_tdata (abfd)->num_group = num_group = -1; ++ (*_bfd_error_handler) (_("%B: no valid group sections found"), abfd); ++ bfd_set_error (bfd_error_bad_value); ++ } ++ } + } + } + +@@ -716,6 +741,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) + { + (*_bfd_error_handler) (_("%B: no group info for section %A"), + abfd, newsect); ++ return FALSE; + } + return TRUE; + } +-- +1.7.1 + --- binutils-2.20.1.orig/debian/patches/301-CVE-2014-8484.dpatch +++ binutils-2.20.1/debian/patches/301-CVE-2014-8484.dpatch @@ -0,0 +1,60 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 301-CVE-2014-8484.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: out-of-bounds read in srec_scan [CVE-2014-8484] + +@DPATCH@ + +From bd25671c6f202c4a5108883caa2adb24ff6f361f Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Fri, 29 Aug 2014 10:36:29 +0930 +Subject: [PATCH] Report an error for S-records with less than the miniumum size + + * srec.c (srec_scan): Revert last change. Report an error for + S-records with less than the miniumum byte count. + +[Ubuntu note: patch differs from upstream by removing the changelog +update, and the reversion of the previous svn commit. -- sbeattie] + +CVE-2014-8484 +--- + bfd/srec.c | 18 +++++++++++++++--- + 2 files changed, 20 insertions(+), 3 deletions(-) + +diff --git a/bfd/srec.c b/bfd/srec.c +index d979bf5..42143c7 100644 +--- a/bfd/srec.c ++++ b/bfd/srec.c +@@ -453,7 +453,7 @@ srec_scan (bfd *abfd) + { + file_ptr pos; + char hdr[3]; +- unsigned int bytes; ++ unsigned int bytes, min_bytes; + bfd_vma address; + bfd_byte *data; + unsigned char check_sum; +@@ -476,6 +476,19 @@ srec_scan (bfd *abfd) + } + + check_sum = bytes = HEX (hdr + 1); ++ min_bytes = 3; ++ if (hdr[0] == '2' || hdr[0] == '8') ++ min_bytes = 4; ++ else if (hdr[0] == '3' || hdr[0] == '7') ++ min_bytes = 5; ++ if (bytes < min_bytes) ++ { ++ (*_bfd_error_handler) (_("%B:%d: byte count %d too small\n"), ++ abfd, lineno, bytes); ++ bfd_set_error (bfd_error_bad_value); ++ goto error_return; ++ } ++ + if (bytes * 2 > bufsize) + { + if (buf != NULL) +-- +1.7.1 + --- binutils-2.20.1.orig/debian/patches/211-hjl-binutils-weakdef.dpatch +++ binutils-2.20.1/debian/patches/211-hjl-binutils-weakdef.dpatch @@ -0,0 +1,127 @@ +#!/bin/sh -e +## 211-hjl-binutils-weakdef.dpatch +## +## DP: Description: elflink.c (elf_link_add_object_symbols): Check symbol type +## DP: Description: for symbol alias in a dynamic object. +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.19.51.0.3 +## DP: Original patch: binutils-weakdef-2.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +bfd/ + +2007-07-19 H.J. Lu + + * elflink.c (elf_link_add_object_symbols): Check symbol type + for symbol alias in a dynamic object. + +ld/testsuite/ + +2007-07-19 H.J. Lu + + * ld-elf/data2.c: New. + * ld-elf/weakdef1.c: Likewise. + + * ld-elf/shared.exp: Add tests for libdata2 and weakdef1. + +@DPATCH@ +--- binutils/bfd/elflink.c.weakdef 2008-09-16 07:11:39.000000000 -0700 ++++ binutils/bfd/elflink.c 2008-09-16 07:11:41.000000000 -0700 +@@ -4641,6 +4641,7 @@ elf_link_add_object_symbols (bfd *abfd, + asection *slook; + bfd_vma vlook; + long ilook; ++ int tlook; + size_t i, j, idx; + + hlook = weaks; +@@ -4653,6 +4654,7 @@ elf_link_add_object_symbols (bfd *abfd, + || hlook->root.type == bfd_link_hash_indirect); + slook = hlook->root.u.def.section; + vlook = hlook->root.u.def.value; ++ tlook = hlook->type; + + ilook = -1; + i = 0; +@@ -4690,9 +4692,10 @@ elf_link_add_object_symbols (bfd *abfd, + { + h = sorted_sym_hash [i]; + +- /* Stop if value or section doesn't match. */ ++ /* Stop if value, section or type doesn't match. */ + if (h->root.u.def.value != vlook +- || h->root.u.def.section != slook) ++ || h->root.u.def.section != slook ++ || h->type != tlook) + break; + else if (h != hlook) + { +--- binutils/ld/testsuite/ld-elf/data2.c.weakdef 2008-09-16 07:11:41.000000000 -0700 ++++ binutils/ld/testsuite/ld-elf/data2.c 2008-09-16 07:11:41.000000000 -0700 +@@ -0,0 +1,9 @@ ++int foo = 0; ++extern int foo_alias __attribute__ ((weak, alias ("foo"))); ++ ++void ++bar (void) ++{ ++ foo = -1; ++} ++ +--- binutils/ld/testsuite/ld-elf/shared.exp.weakdef 2008-09-16 07:10:01.000000000 -0700 ++++ binutils/ld/testsuite/ld-elf/shared.exp 2008-09-16 07:12:43.000000000 -0700 +@@ -123,6 +123,9 @@ set build_tests { + {"Build libdata1.so" + "-shared" "-fPIC" + {data1.c} {} "libdata1.so"} ++ {"Build libdata2.so" ++ "-shared" "-fPIC" ++ {data2.c} {} "libdata2.so"} + {"Build libcomm1.o" + "-r -nostdlib" "" + {comm1.c} {} "libcomm1.o"} +@@ -241,6 +244,9 @@ set run_tests { + {"Run with libdata1.so" + "tmpdir/libdata1.so" "" + {dynbss1.c} "dynbss1" "pass.out"} ++ {"Run with libdata2.so" ++ "tmpdir/libdata2.so" "" ++ {weakdef1.c} "weakdef1" "pass.out"} + {"Run with libfunc1.so comm1.o" + "tmpdir/libfunc1.so tmpdir/comm1.o" "" + {dummy.c} "comm1" "pass.out"} +--- binutils/ld/testsuite/ld-elf/weakdef1.c.weakdef 2008-09-16 07:11:41.000000000 -0700 ++++ binutils/ld/testsuite/ld-elf/weakdef1.c 2008-09-16 07:11:41.000000000 -0700 +@@ -0,0 +1,15 @@ ++#include ++#include ++ ++extern int foo_alias; ++extern void bar (void); ++ ++int ++main (void) ++{ ++ bar (); ++ if (foo_alias != -1) ++ abort (); ++ printf ("PASS\n"); ++ return 0; ++} --- binutils-2.20.1.orig/debian/patches/153_gold_pr10893.dpatch +++ binutils-2.20.1/debian/patches/153_gold_pr10893.dpatch @@ -0,0 +1,140 @@ +#!/bin/sh -e +## 153_gold_pr10893.dpatch +## +## DP: Description: PR gold/10893: Add support for ifunc + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2009-12-07 H.J. Lu + + PR gold/10893 + * i386.cc (Target_i386::Scan::globa): Use is_func instead of + checking elfcpp::STT_FUNC. + (Target_i386::Relocate::relocate): Likewise. + * x86_64.cc (Target_x86_64::Scan::global): Likewise. + + * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC + symbols from shared libraries into normal FUNC symbols. + + * symtab.h (Symbol): Add is_func and use it. +--- a/gold/i386.cc ++++ b/gold/i386.cc +@@ -1248,7 +1248,7 @@ Target_i386::Scan::global(Symbol_table* symtab, + } + // Make a dynamic relocation if necessary. + int flags = Symbol::NON_PIC_REF; +- if (gsym->type() == elfcpp::STT_FUNC) ++ if (gsym->is_func()) + flags |= Symbol::FUNCTION_CALL; + if (gsym->needs_dynamic_reloc(flags)) + { +@@ -1727,7 +1727,7 @@ Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo, + case elfcpp::R_386_PC32: + { + int ref_flags = Symbol::NON_PIC_REF; +- if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC) ++ if (gsym != NULL && gsym->is_func()) + ref_flags |= Symbol::FUNCTION_CALL; + if (should_apply_static_reloc(gsym, ref_flags, true, output_section)) + Relocate_functions<32, false>::pcrel32(view, object, psymval, address); +@@ -1743,7 +1743,7 @@ Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo, + case elfcpp::R_386_PC16: + { + int ref_flags = Symbol::NON_PIC_REF; +- if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC) ++ if (gsym != NULL && gsym->is_func()) + ref_flags |= Symbol::FUNCTION_CALL; + if (should_apply_static_reloc(gsym, ref_flags, false, output_section)) + Relocate_functions<32, false>::pcrel16(view, object, psymval, address); +@@ -1759,7 +1759,7 @@ Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo, + case elfcpp::R_386_PC8: + { + int ref_flags = Symbol::NON_PIC_REF; +- if (gsym != NULL && gsym->type() == elfcpp::STT_FUNC) ++ if (gsym != NULL && gsym->is_func()) + ref_flags |= Symbol::FUNCTION_CALL; + if (should_apply_static_reloc(gsym, ref_flags, false, + output_section)) +--- a/gold/symtab.cc ++++ b/gold/symtab.cc +@@ -2810,11 +2810,16 @@ Symbol_table::sized_write_symbol( + osym.put_st_size(0); + else + osym.put_st_size(sym->symsize()); ++ elfcpp::STT type = sym->type(); ++ // Turn IFUNC symbols from shared libraries into normal FUNC symbols. ++ if (type == elfcpp::STT_GNU_IFUNC ++ && sym->is_from_dynobj()) ++ type = elfcpp::STT_FUNC; + // A version script may have overridden the default binding. + if (sym->is_forced_local()) +- osym.put_st_info(elfcpp::elf_st_info(elfcpp::STB_LOCAL, sym->type())); ++ osym.put_st_info(elfcpp::elf_st_info(elfcpp::STB_LOCAL, type)); + else +- osym.put_st_info(elfcpp::elf_st_info(sym->binding(), sym->type())); ++ osym.put_st_info(elfcpp::elf_st_info(sym->binding(), type)); + osym.put_st_other(elfcpp::elf_st_other(sym->visibility(), sym->nonvis())); + osym.put_st_shndx(shndx); + } +--- a/gold/symtab.h ++++ b/gold/symtab.h +@@ -205,6 +205,14 @@ class Symbol + type() const + { return this->type_; } + ++ // Return true for function symbol. ++ bool ++ is_func() const ++ { ++ return (this->type_ == elfcpp::STT_FUNC ++ || this->type_ == elfcpp::STT_GNU_IFUNC); ++ } ++ + // Return the symbol visibility. + elfcpp::STV + visibility() const +@@ -543,7 +551,7 @@ class Symbol + + return (!parameters->doing_static_link() + && !parameters->options().pie() +- && this->type() == elfcpp::STT_FUNC ++ && this->is_func() + && (this->is_from_dynobj() + || this->is_undefined() + || this->is_preemptible())); +@@ -734,7 +742,7 @@ class Symbol + return (!parameters->options().shared() + && parameters->options().copyreloc() + && this->is_from_dynobj() +- && this->type() != elfcpp::STT_FUNC); ++ && !this->is_func()); + } + + protected: +--- a/gold/x86_64.cc ++++ b/gold/x86_64.cc +@@ -1352,7 +1352,7 @@ Target_x86_64::Scan::global(Symbol_table* symtab, + target->make_plt_entry(symtab, layout, gsym); + // Make a dynamic relocation if necessary. + int flags = Symbol::NON_PIC_REF; +- if (gsym->type() == elfcpp::STT_FUNC) ++ if (gsym->is_func()) + flags |= Symbol::FUNCTION_CALL; + if (gsym->needs_dynamic_reloc(flags)) + { --- binutils-2.20.1.orig/debian/patches/149_pr11456.dpatch +++ binutils-2.20.1/debian/patches/149_pr11456.dpatch @@ -0,0 +1,48 @@ +#!/bin/sh -e +## 149_pr11456.dpatch +## +## DP: Description: PR gas/11456: Use memcpy to copy overlap memory. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2010-03-30 H.J. Lu + + PR gas/11456 + * input-scrub.c (input_scrub_next_buffer): Use memmove instead + of memcpy to copy overlap memory. + +@DPATCH@ +=================================================================== +RCS file: /cvs/src/src/gas/input-scrub.c,v +retrieving revision 1.22 +retrieving revision 1.23 +diff -u -r1.22 -r1.23 +--- src/gas/input-scrub.c 2009/09/11 15:27:33 1.22 ++++ src/gas/input-scrub.c 2010/03/30 23:20:25 1.23 +@@ -343,8 +343,8 @@ + + if (partial_size) + { +- memcpy (buffer_start + BEFORE_SIZE, partial_where, +- (unsigned int) partial_size); ++ memmove (buffer_start + BEFORE_SIZE, partial_where, ++ (unsigned int) partial_size); + memcpy (buffer_start + BEFORE_SIZE, save_source, AFTER_SIZE); + } + limit = input_file_give_next_buffer (buffer_start --- binutils-2.20.1.orig/debian/patches/200-hjl-ld-env.dpatch +++ binutils-2.20.1/debian/patches/200-hjl-ld-env.dpatch @@ -0,0 +1,88 @@ +#!/bin/sh -e +## 200-hjl-ld-env.dpatch +## +## DP: Description: Handle LD_SYMBOLIC and LD_SYMBOLIC_FUNCTIONS env vars +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.19.51.0.3 +## DP: Original patch: ld-env-11.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p0 < $0;; + -unpatch) patch $patch_opts -p0 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2007-01-24 H.J. Lu + + * NEWS: Mention LD_SYMBOLIC and LD_SYMBOLIC_FUNCTIONS. + + * ld.texinfo: Document LD_SYMBOLIC and LD_SYMBOLIC_FUNCTIONS. + + * ldmain.c (main): Handle LD_SYMBOLIC and + LD_SYMBOLIC_FUNCTIONS. + +@DPATCH@ + +--- ld/NEWS.env 2008-09-08 09:34:53.000000000 -0700 ++++ ld/NEWS 2008-09-08 09:36:43.000000000 -0700 +@@ -1,5 +1,8 @@ + -*- text -*- + ++* ELF: Support environment variables, LD_SYMBOLIC for -Bsymbolic and ++ LD_SYMBOLIC_FUNCTIONS for -Bsymbolic-functions. ++ + Changes in 2.19: + + * Linker scripts support a new INSERT command that makes it easier to +--- ld/ld.texinfo.env 2008-07-22 07:19:39.000000000 -0700 ++++ ld/ld.texinfo 2008-09-08 09:35:29.000000000 -0700 +@@ -1147,14 +1147,21 @@ When creating a shared library, bind ref + definition within the shared library, if any. Normally, it is possible + for a program linked against a shared library to override the definition + within the shared library. This option is only meaningful on ELF +-platforms which support shared libraries. ++platforms which support shared libraries. If @option{-Bsymbolic} is not ++used when linking a shared library, the linker will also turn on this ++option if the environment variable @code{LD_SYMBOLIC} is set. + + @kindex -Bsymbolic-functions + @item -Bsymbolic-functions + When creating a shared library, bind references to global function + symbols to the definition within the shared library, if any. + This option is only meaningful on ELF platforms which support shared +-libraries. ++libraries. If @option{-Bsymbolic-functions} is not used when linking a ++shared library, the linker will also turn on this option if the ++environment variable @code{LD_SYMBOLIC_FUNCTIONS} is set. When ++both environment variables @code{LD_SYMBOLIC} and ++@code{LD_SYMBOLIC_FUNCTIONS} are set, @code{LD_SYMBOLIC} will take ++precedent. + + @kindex --dynamic-list=@var{dynamic-list-file} + @item --dynamic-list=@var{dynamic-list-file} +--- ld/ldmain.c.env 2008-09-08 09:35:29.000000000 -0700 ++++ ld/ldmain.c 2008-09-08 09:35:29.000000000 -0700 +@@ -253,6 +253,11 @@ main (int argc, char **argv) + command_line.warn_search_mismatch = TRUE; + command_line.check_section_addresses = TRUE; + ++ if (getenv ("LD_SYMBOLIC") != NULL) ++ command_line.symbolic = symbolic; ++ else if (getenv ("LD_SYMBOLIC_FUNCTIONS") != NULL) ++ command_line.symbolic = symbolic_functions; ++ + /* We initialize DEMANGLING based on the environment variable + COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the + output of the linker, unless COLLECT_NO_DEMANGLE is set in the --- binutils-2.20.1.orig/debian/patches/305-CVE-2014-8503.dpatch +++ binutils-2.20.1/debian/patches/305-CVE-2014-8503.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 305-CVE-2014-8503.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: ihex_scan buffer overflow [CVE-2014-8503] + +@DPATCH@ + +From 0102ea8cec5fc509bba6c91df61b7ce23a799d32 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Thu, 30 Oct 2014 17:16:17 +0000 +Subject: [PATCH] Fixes a seg-fault in the ihex parser when it encounters a malformed ihex file. + + PR binutils/17512 + * ihex.c (ihex_scan): Fix typo in invocation of ihex_bad_byte. + +[Ubuntu note: patch differs from upstream commit in that it drops the +changelog entry to reduce patch conflicts. -- sbeattie] + +CVE-2014-8503 +--- + bfd/ChangeLog | 1 + + bfd/ihex.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/bfd/ihex.c b/bfd/ihex.c +index 8d3590d..9b3b813 100644 +--- a/bfd/ihex.c ++++ b/bfd/ihex.c +@@ -321,7 +321,7 @@ ihex_scan (bfd *abfd) + { + if (! ISHEX (buf[i])) + { +- ihex_bad_byte (abfd, lineno, hdr[i], error); ++ ihex_bad_byte (abfd, lineno, buf[i], error); + goto error_return; + } + } +-- +1.7.1 + --- binutils-2.20.1.orig/debian/patches/304-CVE-2014-8502.dpatch +++ binutils-2.20.1/debian/patches/304-CVE-2014-8502.dpatch @@ -0,0 +1,618 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 304-CVE-2014-8502.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: pe_print_edata heap-based overflow [CVE-2014-8502] + +@DPATCH@ + +From b69c87280595b7ce4e956cb2a62278412f0722f7 Mon Sep 17 00:00:00 2001 +From: Jon Turney +Date: Thu, 3 Apr 2014 12:26:27 +0100 +Subject: [PATCH] * peXXigen.c (pe_print_edata): Verify edt.name lies inside + section before dereferencing. + (pe_print_idata, pe_print_edata, pe_print_reloc) + (rsrc_print_section): Don't bother interpreting the contents + of sections which have no contents. + +From b2f93c5011cab00f31669363577b938697752e43 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Tue, 28 Oct 2014 10:50:17 +0000 +Subject: [PATCH] Import patches from the master branch which prevent seg-faults when parsing + corrupt binaries. + + 2014-10-27 Nick Clifton + PR binutils/17512 + * elf.c (bfd_section_from_shdr): Detect and warn about ELF + binaries with a group of sections linked by the string table + indicies. + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries + with an invalid value for NumberOfRvaAndSizes. + (pe_print_edata): Detect out of range rvas and entry counts for + the Export Address table, Name Pointer table and Ordinal table. + + PR binutils/17510 + * elf.c (setup_group): Improve handling of corrupt group + sections. + +From 5a4b0ccc20ba30caef53b01bee2c0aaa5b855339 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Tue, 28 Oct 2014 15:42:56 +0000 +Subject: [PATCH] More fixes for corrupt binaries crashing the binutils. + + PR binutils/17512 + * elf.c (bfd_section_from_shdr): Allocate and free the recursion + detection table on a per-bfd basis. + * peXXigen.c (pe_print_edata): Handle binaries with a truncated + export table. + +From e5b470e24ce448a56230137a37d3b17299593041 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Wed, 29 Oct 2014 20:58:13 +0000 +Subject: [PATCH] Fixes another memory corruption bug introduced by patches for PR 17512. + + * elf.c (bfd_section_from_shdr): Fix heap use after free memory + leak. + +[Ubuntu note: patch differs from upstream commits in that it drops +the changelog entry to reduce patch conflicts, the first patches +fix to rsrc_print_section as it doesn't exist yet, and the second +commit's fixes to handle srec, as that's already covered by the +binutils-CVE-2014-8504.patch. -- sbeattie] + +Third commit fixes CVE-2014-8502, but first two commits are needed as +prerequisites, and the last one fixes a use-after-free introduced by +earlier patches. + +--- + bfd/elf.c | 204 ++++++++++++++++++++++++++++++++++++++------------------- + bfd/peXXigen.c | 55 ++++++++++++--- + 2 files changed, 185 insertions(+), 74 deletions(-) + +Index: b/bfd/peXXigen.c +=================================================================== +--- a/bfd/peXXigen.c ++++ b/bfd/peXXigen.c +@@ -1115,6 +1115,13 @@ pe_print_idata (bfd * abfd, void * vfile + _("\nThere is an import table, but the section containing it could not be found\n")); + return TRUE; + } ++ else if (!(section->flags & SEC_HAS_CONTENTS)) ++ { ++ fprintf (file, ++ _("\nThere is an import table in %s, but that section has no contents\n"), ++ section->name); ++ return TRUE; ++ } + } + + fprintf (file, _("\nThere is an import table in %s at 0x%lx\n"), +@@ -1376,7 +1383,7 @@ pe_print_edata (bfd * abfd, void * vfile + bfd_size_type datasize = 0; + bfd_size_type dataoff; + bfd_size_type i; +- bfd_signed_vma adj; ++ bfd_vma adj; + struct EDT_type + { + long export_flags; /* Reserved - should be zero. */ +@@ -1426,6 +1433,13 @@ pe_print_edata (bfd * abfd, void * vfile + _("\nThere is an export table, but the section containing it could not be found\n")); + return TRUE; + } ++ else if (!(section->flags & SEC_HAS_CONTENTS)) ++ { ++ fprintf (file, ++ _("\nThere is an export table in %s, but that section has no contents\n"), ++ section->name); ++ return TRUE; ++ } + + dataoff = addr - section->vma; + datasize = extra->DataDirectory[PE_EXPORT_TABLE].Size; +@@ -1438,6 +1452,15 @@ pe_print_edata (bfd * abfd, void * vfile + } + } + ++ /* PR 17512: Handle corrupt PE binaries. */ ++ if (datasize < 36) ++ { ++ fprintf (file, ++ _("\nThere is an export table in %s, but it is too small (%d)\n"), ++ section->name, (int) datasize); ++ return TRUE; ++ } ++ + fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"), + section->name, (unsigned long) addr); + +@@ -1481,8 +1504,11 @@ pe_print_edata (bfd * abfd, void * vfile + fprintf (file, + _("Name \t\t\t\t")); + bfd_fprintf_vma (abfd, file, edt.name); +- fprintf (file, +- " %s\n", data + edt.name - adj); ++ ++ if ((edt.name >= adj) && (edt.name < adj + datasize)) ++ fprintf (file, " %s\n", data + edt.name - adj); ++ else ++ fprintf (file, "(outside .edata section)\n"); + + fprintf (file, + _("Ordinal Base \t\t\t%ld\n"), edt.base); +@@ -1528,7 +1554,12 @@ pe_print_edata (bfd * abfd, void * vfile + _("\nExport Address Table -- Ordinal Base %ld\n"), + edt.base); + +- for (i = 0; i < edt.num_functions; ++i) ++ /* PR 17512: Handle corrupt PE binaries. */ ++ if (edt.eat_addr + (edt.num_functions * 4) - adj >= datasize) ++ fprintf (file, _("\tInvalid Export Address Table rva (0x%lx) or entry count (0x%lx)\n"), ++ (long) edt.eat_addr, ++ (long) edt.num_functions); ++ else for (i = 0; i < edt.num_functions; ++i) + { + bfd_vma eat_member = bfd_get_32 (abfd, + data + edt.eat_addr + (i * 4) - adj); +@@ -1564,7 +1595,16 @@ pe_print_edata (bfd * abfd, void * vfile + fprintf (file, + _("\n[Ordinal/Name Pointer] Table\n")); + +- for (i = 0; i < edt.num_names; ++i) ++ /* PR 17512: Handle corrupt PE binaries. */ ++ if (edt.npt_addr + (edt.num_names * 4) - adj >= datasize) ++ fprintf (file, _("\tInvalid Name Pointer Table rva (0x%lx) or entry count (0x%lx)\n"), ++ (long) edt.npt_addr, ++ (long) edt.num_names); ++ else if (edt.ot_addr + (edt.num_names * 2) - adj >= datasize) ++ fprintf (file, _("\tInvalid Ordinal Table rva (0x%lx) or entry count (0x%lx)\n"), ++ (long) edt.ot_addr, ++ (long) edt.num_names); ++ else for (i = 0; i < edt.num_names; ++i) + { + bfd_vma name_ptr = bfd_get_32 (abfd, + data + +@@ -1930,10 +1970,7 @@ pe_print_reloc (bfd * abfd, void * vfile + bfd_size_type i; + bfd_size_type start, stop; + +- if (section == NULL) +- return TRUE; +- +- if (section->size == 0) ++ if (section == NULL || section->size == 0 || !(section->flags & SEC_HAS_CONTENTS)) + return TRUE; + + fprintf (file, +Index: b/bfd/elf.c +=================================================================== +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -1574,38 +1574,74 @@ bfd_section_from_shdr (bfd *abfd, unsign + Elf_Internal_Ehdr *ehdr; + const struct elf_backend_data *bed; + const char *name; ++ bfd_boolean ret = TRUE; ++ static bfd_boolean * sections_being_created = NULL; ++ static bfd * sections_being_created_abfd = NULL; ++ static unsigned int nesting = 0; + + if (shindex >= elf_numsections (abfd)) + return FALSE; + ++ if (++ nesting > 3) ++ { ++ /* PR17512: A corrupt ELF binary might contain a recursive group of ++ sections, each the string indicies pointing to the next in the ++ loop. Detect this here, by refusing to load a section that we are ++ already in the process of loading. We only trigger this test if ++ we have nested at least three sections deep as normal ELF binaries ++ can expect to recurse at least once. ++ ++ FIXME: It would be better if this array was attached to the bfd, ++ rather than being held in a static pointer. */ ++ ++ if (sections_being_created_abfd != abfd) ++ sections_being_created = NULL; ++ if (sections_being_created == NULL) ++ { ++ /* FIXME: It would be more efficient to attach this array to the bfd somehow. */ ++ sections_being_created = (bfd_boolean *) ++ bfd_zalloc (abfd, elf_numsections (abfd) * sizeof (bfd_boolean)); ++ sections_being_created_abfd = abfd; ++ } ++ if (sections_being_created [shindex]) ++ { ++ (*_bfd_error_handler) ++ (_("%B: warning: loop in section dependencies detected"), abfd); ++ return FALSE; ++ } ++ sections_being_created [shindex] = TRUE; ++ } ++ + hdr = elf_elfsections (abfd)[shindex]; + ehdr = elf_elfheader (abfd); + name = bfd_elf_string_from_elf_section (abfd, ehdr->e_shstrndx, + hdr->sh_name); + if (name == NULL) +- return FALSE; ++ goto fail; + + bed = get_elf_backend_data (abfd); + switch (hdr->sh_type) + { + case SHT_NULL: + /* Inactive section. Throw it away. */ +- return TRUE; ++ goto success; + +- case SHT_PROGBITS: /* Normal section with contents. */ +- case SHT_NOBITS: /* .bss section. */ +- case SHT_HASH: /* .hash section. */ +- case SHT_NOTE: /* .note section. */ ++ case SHT_PROGBITS: /* Normal section with contents. */ ++ case SHT_NOBITS: /* .bss section. */ ++ case SHT_HASH: /* .hash section. */ ++ case SHT_NOTE: /* .note section. */ + case SHT_INIT_ARRAY: /* .init_array section. */ + case SHT_FINI_ARRAY: /* .fini_array section. */ + case SHT_PREINIT_ARRAY: /* .preinit_array section. */ + case SHT_GNU_LIBLIST: /* .gnu.liblist section. */ + case SHT_GNU_HASH: /* .gnu.hash section. */ +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ goto success; + + case SHT_DYNAMIC: /* Dynamic linking information. */ + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) +- return FALSE; ++ goto fail; ++ + if (hdr->sh_link > elf_numsections (abfd)) + { + /* PR 10478: Accept Solaris binaries with a sh_link +@@ -1619,11 +1655,11 @@ bfd_section_from_shdr (bfd *abfd, unsign + break; + /* Otherwise fall through. */ + default: +- return FALSE; ++ goto fail; + } + } + else if (elf_elfsections (abfd)[hdr->sh_link] == NULL) +- return FALSE; ++ goto fail; + else if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_STRTAB) + { + Elf_Internal_Shdr *dynsymhdr; +@@ -1652,16 +1688,18 @@ bfd_section_from_shdr (bfd *abfd, unsign + } + } + } +- break; ++ goto success; + +- case SHT_SYMTAB: /* A symbol table */ ++ case SHT_SYMTAB: /* A symbol table. */ + if (elf_onesymtab (abfd) == shindex) +- return TRUE; ++ goto success; + + if (hdr->sh_entsize != bed->s->sizeof_sym) +- return FALSE; ++ goto fail; ++ + if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size) +- return FALSE; ++ goto fail; ++ + BFD_ASSERT (elf_onesymtab (abfd) == 0); + elf_onesymtab (abfd) = shindex; + elf_tdata (abfd)->symtab_hdr = *hdr; +@@ -1686,7 +1724,7 @@ bfd_section_from_shdr (bfd *abfd, unsign + && (abfd->flags & DYNAMIC) != 0 + && ! _bfd_elf_make_section_from_shdr (abfd, hdr, name, + shindex)) +- return FALSE; ++ goto fail; + + /* Go looking for SHT_SYMTAB_SHNDX too, since if there is one we + can't read symbols without that section loaded as well. It +@@ -1712,16 +1750,20 @@ bfd_section_from_shdr (bfd *abfd, unsign + break; + } + if (i != shindex) +- return bfd_section_from_shdr (abfd, i); ++ ret = bfd_section_from_shdr (abfd, i); + } +- return TRUE; ++ goto success; + +- case SHT_DYNSYM: /* A dynamic symbol table */ ++ case SHT_DYNSYM: /* A dynamic symbol table. */ + if (elf_dynsymtab (abfd) == shindex) +- return TRUE; ++ goto success; + + if (hdr->sh_entsize != bed->s->sizeof_sym) +- return FALSE; ++ goto fail; ++ ++ if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size) ++ goto fail; ++ + BFD_ASSERT (elf_dynsymtab (abfd) == 0); + elf_dynsymtab (abfd) = shindex; + elf_tdata (abfd)->dynsymtab_hdr = *hdr; +@@ -1740,34 +1781,38 @@ bfd_section_from_shdr (bfd *abfd, unsign + + /* Besides being a symbol table, we also treat this as a regular + section, so that objcopy can handle it. */ +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ goto success; + +- case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections */ ++ case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections. */ + if (elf_symtab_shndx (abfd) == shindex) +- return TRUE; ++ goto success; + + BFD_ASSERT (elf_symtab_shndx (abfd) == 0); + elf_symtab_shndx (abfd) = shindex; + elf_tdata (abfd)->symtab_shndx_hdr = *hdr; + elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->symtab_shndx_hdr; +- return TRUE; ++ goto success; + +- case SHT_STRTAB: /* A string table */ ++ case SHT_STRTAB: /* A string table. */ + if (hdr->bfd_section != NULL) +- return TRUE; ++ goto success; ++ + if (ehdr->e_shstrndx == shindex) + { + elf_tdata (abfd)->shstrtab_hdr = *hdr; + elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->shstrtab_hdr; +- return TRUE; ++ goto success; + } ++ + if (elf_elfsections (abfd)[elf_onesymtab (abfd)]->sh_link == shindex) + { + symtab_strtab: + elf_tdata (abfd)->strtab_hdr = *hdr; + elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->strtab_hdr; +- return TRUE; ++ goto success; + } ++ + if (elf_elfsections (abfd)[elf_dynsymtab (abfd)]->sh_link == shindex) + { + dynsymtab_strtab: +@@ -1776,8 +1821,9 @@ bfd_section_from_shdr (bfd *abfd, unsign + elf_elfsections (abfd)[shindex] = hdr; + /* We also treat this as a regular section, so that objcopy + can handle it. */ +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, +- shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, ++ shindex); ++ goto success; + } + + /* If the string table isn't one of the above, then treat it as a +@@ -1795,9 +1841,9 @@ bfd_section_from_shdr (bfd *abfd, unsign + { + /* Prevent endless recursion on broken objects. */ + if (i == shindex) +- return FALSE; ++ goto fail; + if (! bfd_section_from_shdr (abfd, i)) +- return FALSE; ++ goto fail; + if (elf_onesymtab (abfd) == i) + goto symtab_strtab; + if (elf_dynsymtab (abfd) == i) +@@ -1805,7 +1851,8 @@ bfd_section_from_shdr (bfd *abfd, unsign + } + } + } +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ goto success; + + case SHT_REL: + case SHT_RELA: +@@ -1820,7 +1867,7 @@ bfd_section_from_shdr (bfd *abfd, unsign + if (hdr->sh_entsize + != (bfd_size_type) (hdr->sh_type == SHT_REL + ? bed->s->sizeof_rel : bed->s->sizeof_rela)) +- return FALSE; ++ goto fail; + + /* Check for a bogus link to avoid crashing. */ + if (hdr->sh_link >= num_sec) +@@ -1828,8 +1875,9 @@ bfd_section_from_shdr (bfd *abfd, unsign + ((*_bfd_error_handler) + (_("%B: invalid link %lu for reloc section %s (index %u)"), + abfd, hdr->sh_link, name, shindex)); +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, +- shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, ++ shindex); ++ goto success; + } + + /* For some incomprehensible reason Oracle distributes +@@ -1870,7 +1918,7 @@ bfd_section_from_shdr (bfd *abfd, unsign + if ((elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_SYMTAB + || elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_DYNSYM) + && ! bfd_section_from_shdr (abfd, hdr->sh_link)) +- return FALSE; ++ goto fail; + + /* If this reloc section does not use the main symbol table we + don't treat it as a reloc section. BFD can't adequately +@@ -1885,14 +1933,18 @@ bfd_section_from_shdr (bfd *abfd, unsign + || hdr->sh_info >= num_sec + || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL + || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA) +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, +- shindex); ++ { ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, ++ shindex); ++ goto success; ++ } + + if (! bfd_section_from_shdr (abfd, hdr->sh_info)) +- return FALSE; ++ goto fail; ++ + target_sect = bfd_section_from_elf_index (abfd, hdr->sh_info); + if (target_sect == NULL) +- return FALSE; ++ goto fail; + + esdt = elf_section_data (target_sect); + if (hdr->sh_type == SHT_RELA) +@@ -1904,7 +1956,7 @@ bfd_section_from_shdr (bfd *abfd, unsign + amt = sizeof (*hdr2); + hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); + if (hdr2 == NULL) +- return FALSE; ++ goto fail; + elf_section_data (target_sect)->rel_hdr2 = hdr2; + } + *hdr2 = *hdr; +@@ -1920,34 +1972,40 @@ bfd_section_from_shdr (bfd *abfd, unsign + target_sect->use_rela_p = 1; + } + abfd->flags |= HAS_RELOC; +- return TRUE; ++ goto success; + } + + case SHT_GNU_verdef: + elf_dynverdef (abfd) = shindex; + elf_tdata (abfd)->dynverdef_hdr = *hdr; +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ goto success; + + case SHT_GNU_versym: + if (hdr->sh_entsize != sizeof (Elf_External_Versym)) +- return FALSE; ++ goto fail; ++ + elf_dynversym (abfd) = shindex; + elf_tdata (abfd)->dynversym_hdr = *hdr; +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ goto success; + + case SHT_GNU_verneed: + elf_dynverref (abfd) = shindex; + elf_tdata (abfd)->dynverref_hdr = *hdr; +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ goto success; + + case SHT_SHLIB: +- return TRUE; ++ goto success; + + case SHT_GROUP: + if (! IS_VALID_GROUP_SECTION_HEADER (hdr)) +- return FALSE; ++ goto fail; ++ + if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) +- return FALSE; ++ goto fail; ++ + if (hdr->contents != NULL) + { + Elf_Internal_Group *idx = (Elf_Internal_Group *) hdr->contents; +@@ -1973,7 +2031,7 @@ bfd_section_from_shdr (bfd *abfd, unsign + } + } + } +- break; ++ goto success; + + default: + /* Possibly an attributes section. */ +@@ -1981,14 +2039,14 @@ bfd_section_from_shdr (bfd *abfd, unsign + || hdr->sh_type == bed->obj_attrs_section_type) + { + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) +- return FALSE; ++ goto fail; + _bfd_elf_parse_attributes (abfd, hdr); +- return TRUE; ++ goto success; + } + + /* Check for any processor-specific section types. */ + if (bed->elf_backend_section_from_shdr (abfd, hdr, name, shindex)) +- return TRUE; ++ goto success; + + if (hdr->sh_type >= SHT_LOUSER && hdr->sh_type <= SHT_HIUSER) + { +@@ -2000,9 +2058,12 @@ bfd_section_from_shdr (bfd *abfd, unsign + "specific section `%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else +- /* Allow sections reserved for applications. */ +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, +- shindex); ++ { ++ /* Allow sections reserved for applications. */ ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, ++ shindex); ++ goto success; ++ } + } + else if (hdr->sh_type >= SHT_LOPROC + && hdr->sh_type <= SHT_HIPROC) +@@ -2023,8 +2084,11 @@ bfd_section_from_shdr (bfd *abfd, unsign + "`%s' [0x%8x]"), + abfd, name, hdr->sh_type); + else +- /* Otherwise it should be processed. */ +- return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ { ++ /* Otherwise it should be processed. */ ++ ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); ++ goto success; ++ } + } + else + /* FIXME: We should handle this section. */ +@@ -2032,10 +2096,20 @@ bfd_section_from_shdr (bfd *abfd, unsign + (_("%B: don't know how to handle section `%s' [0x%8x]"), + abfd, name, hdr->sh_type); + +- return FALSE; ++ goto fail; + } + +- return TRUE; ++ fail: ++ ret = FALSE; ++ success: ++ if (sections_being_created && sections_being_created_abfd == abfd) ++ sections_being_created [shindex] = FALSE; ++ if (-- nesting == 0) ++ { ++ sections_being_created = NULL; ++ sections_being_created_abfd = abfd; ++ } ++ return ret; + } + + /* Return the local symbol specified by ABFD, R_SYMNDX. */ --- binutils-2.20.1.orig/debian/patches/209-hjl-binutils-error.dpatch +++ binutils-2.20.1/debian/patches/209-hjl-binutils-error.dpatch @@ -0,0 +1,1001 @@ +#!/bin/sh -e +## 209-hjl-binutils-error.dpatch +## +## DP: Description: Avoid unnecessary linker messages when running "make check" +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.18.51.0.3 +## DP: Original patch: binutils-error-7.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +bfd/ + +2007-07-03 H.J. Lu + + PR ld/4409 + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for + error ignored. + * elf-m10200.c (mn10200_elf_relocate_section): Updated. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.c (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-bfin.c (bfinfdpic_relocate_section): Likewise. + (bfin_relocate_section): Likewise. + * elf32-cr16.c (elf32_cr16_relocate_section): Likewise. + * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-crx.c (elf32_crx_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-mep.c (mep_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-mt.c (mt_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Skip if error + from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored. + +ld/ + +2007-07-03 H.J. Lu + + PR ld/4409 + * ldmain.c (how_to_report_unresolved_symbols): New. + (main): Set link_info.unresolved_syms_in_objects and + link_info.unresolved_syms_in_shared_libs if they aren't set + yet. + + * ldmain.h (how_to_report_unresolved_symbols): New. + + * lexsup.c (how_to_report_unresolved_symbols): Removed. + (parse_args): Set link_info.pie to FALSE for -shared. Don't + set default values for link_info.unresolved_syms_in_objects nor + link_info.unresolved_syms_in_shared_libs. + +ld/testsuite/ + +2007-07-03 H.J. Lu + + PR ld/4409 + * ld-ia64/error1.d: New file. + * ld-ia64/error1.s: Likewise. + * ld-ia64/error2.d: Likewise. + * ld-ia64/error3.d: Likewise. + * ld-ia64/error4.d: Likewise. + +@DPATCH@ +--- binutils/bfd/elf-bfd.h.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/bfd/elf-bfd.h 2009-03-05 05:57:51.000000000 -0800 +@@ -2174,7 +2174,7 @@ extern asection _bfd_elf_large_com_secti + #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel, \ + r_symndx, symtab_hdr, sym_hashes, \ + h, sec, relocation, \ +- unresolved_reloc, warned) \ ++ unresolved_reloc, warned, ignored) \ + do \ + { \ + /* It seems this can happen with erroneous or unsupported \ +@@ -2189,6 +2189,7 @@ extern asection _bfd_elf_large_com_secti + h = (struct elf_link_hash_entry *) h->root.u.i.link; \ + \ + warned = FALSE; \ ++ ignored = FALSE; \ + unresolved_reloc = FALSE; \ + relocation = 0; \ + if (h->root.type == bfd_link_hash_defined \ +@@ -2211,7 +2212,7 @@ extern asection _bfd_elf_large_com_secti + ; \ + else if (info->unresolved_syms_in_objects == RM_IGNORE \ + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \ +- ; \ ++ ignored = TRUE; \ + else if (!info->relocatable) \ + { \ + bfd_boolean err; \ +--- binutils/bfd/elf-m10200.c.error 2007-10-30 11:48:32.000000000 -0700 ++++ binutils/bfd/elf-m10200.c 2009-03-05 05:57:51.000000000 -0800 +@@ -392,12 +392,12 @@ mn10200_elf_relocate_section (output_bfd + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf-m10300.c.error 2008-11-29 12:07:44.000000000 -0800 ++++ binutils/bfd/elf-m10300.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1465,13 +1465,13 @@ mn10300_elf_relocate_section (bfd *outpu + else + { + bfd_boolean unresolved_reloc; +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + struct elf_link_hash_entry *hh; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + hh, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + h = (struct elf32_mn10300_link_hash_entry *) hh; + +--- binutils/bfd/elf32-arm.c.error 2009-02-27 12:06:08.000000000 -0800 ++++ binutils/bfd/elf32-arm.c 2009-03-05 05:57:51.000000000 -0800 +@@ -8000,12 +8000,12 @@ elf32_arm_relocate_section (bfd * + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + sym_type = h->type; + } +--- binutils/bfd/elf32-avr.c.error 2009-02-20 09:01:14.000000000 -0800 ++++ binutils/bfd/elf32-avr.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1202,12 +1202,12 @@ elf32_avr_relocate_section (bfd *output_ + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + name = h->root.root.string; + } +--- binutils/bfd/elf32-bfin.c.error 2008-11-29 12:07:45.000000000 -0800 ++++ binutils/bfd/elf32-bfin.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1419,12 +1419,12 @@ bfin_relocate_section (bfd * output_bfd, + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +@@ -2630,13 +2630,13 @@ bfinfdpic_relocate_section (bfd * output + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + bfd_boolean unresolved_reloc; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + osec = sec; + } + +--- binutils/bfd/elf32-cr16.c.error 2008-11-29 12:07:45.000000000 -0800 ++++ binutils/bfd/elf32-cr16.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1450,12 +1450,12 @@ elf32_cr16_relocate_section (bfd *output + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd, +--- binutils/bfd/elf32-cr16c.c.error 2007-10-30 11:48:32.000000000 -0700 ++++ binutils/bfd/elf32-cr16c.c 2009-03-05 05:57:51.000000000 -0800 +@@ -718,12 +718,12 @@ elf32_cr16c_relocate_section (bfd *outpu + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-cris.c.error 2009-02-03 11:30:04.000000000 -0800 ++++ binutils/bfd/elf32-cris.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1103,13 +1103,13 @@ cris_elf_relocate_section (output_bfd, i + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + bfd_boolean unresolved_reloc; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + symname = h->root.root.string; + +--- binutils/bfd/elf32-crx.c.error 2007-10-30 11:48:32.000000000 -0700 ++++ binutils/bfd/elf32-crx.c 2009-03-05 05:57:51.000000000 -0800 +@@ -869,12 +869,12 @@ elf32_crx_relocate_section (bfd *output_ + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-d10v.c.error 2007-10-30 11:48:32.000000000 -0700 ++++ binutils/bfd/elf32-d10v.c 2009-03-05 05:57:51.000000000 -0800 +@@ -455,12 +455,12 @@ elf32_d10v_relocate_section (bfd *output + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-fr30.c.error 2008-01-09 06:17:24.000000000 -0800 ++++ binutils/bfd/elf32-fr30.c 2009-03-05 05:57:51.000000000 -0800 +@@ -567,12 +567,12 @@ fr30_elf_relocate_section (output_bfd, i + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + name = h->root.root.string; + } +--- binutils/bfd/elf32-frv.c.error 2008-08-12 07:24:02.000000000 -0700 ++++ binutils/bfd/elf32-frv.c 2009-03-05 05:57:51.000000000 -0800 +@@ -2798,13 +2798,13 @@ elf32_frv_relocate_section (output_bfd, + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + bfd_boolean unresolved_reloc; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + osec = sec; + } + +--- binutils/bfd/elf32-h8300.c.error 2007-10-30 11:48:32.000000000 -0700 ++++ binutils/bfd/elf32-h8300.c 2009-03-05 05:57:51.000000000 -0800 +@@ -452,12 +452,12 @@ elf32_h8_relocate_section (bfd *output_b + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-hppa.c.error 2009-03-05 05:49:31.000000000 -0800 ++++ binutils/bfd/elf32-hppa.c 2009-03-05 05:57:51.000000000 -0800 +@@ -3674,13 +3674,14 @@ elf32_hppa_relocate_section (bfd *output + else + { + struct elf_link_hash_entry *eh; +- bfd_boolean unresolved_reloc; ++ bfd_boolean unresolved_reloc, ignored; + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rela, + r_symndx, symtab_hdr, sym_hashes, + eh, sym_sec, relocation, +- unresolved_reloc, warned_undef); ++ unresolved_reloc, warned_undef, ++ ignored); + + if (!info->relocatable + && relocation == 0 +--- binutils/bfd/elf32-i386.c.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/bfd/elf32-i386.c 2009-03-05 05:57:51.000000000 -0800 +@@ -2679,12 +2679,12 @@ elf_i386_relocate_section (bfd *output_b + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-i860.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf32-i860.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1120,12 +1120,12 @@ elf32_i860_relocate_section (bfd *output + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-ip2k.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf32-ip2k.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1449,13 +1449,13 @@ ip2k_elf_relocate_section (bfd *output_b + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + bfd_boolean unresolved_reloc; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + name = h->root.root.string; + } +--- binutils/bfd/elf32-iq2000.c.error 2008-08-12 07:24:02.000000000 -0700 ++++ binutils/bfd/elf32-iq2000.c 2009-03-05 05:57:51.000000000 -0800 +@@ -623,12 +623,12 @@ iq2000_elf_relocate_section (bfd * + else + { + bfd_boolean unresolved_reloc; +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + name = h->root.root.string; + } +--- binutils/bfd/elf32-lm32.c.error 2008-12-23 11:10:18.000000000 -0800 ++++ binutils/bfd/elf32-lm32.c 2009-03-05 06:05:24.000000000 -0800 +@@ -887,12 +887,12 @@ lm32_elf_relocate_section (bfd *output_b + { + /* It's a global symbol. */ + bfd_boolean unresolved_reloc; +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + osec = sec; + name = h->root.root.string; + } +--- binutils/bfd/elf32-m68hc1x.c.error 2008-03-12 12:32:03.000000000 -0700 ++++ binutils/bfd/elf32-m68hc1x.c 2009-03-05 05:57:51.000000000 -0800 +@@ -947,12 +947,12 @@ elf32_m68hc11_relocate_section (bfd *out + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, unresolved_reloc, +- warned); ++ warned, ignored); + + is_far = (h && (h->other & STO_M68HC12_FAR)); + stub_name = h->root.root.string; +--- binutils/bfd/elf32-m68k.c.error 2009-02-03 11:30:04.000000000 -0800 ++++ binutils/bfd/elf32-m68k.c 2009-03-05 05:57:51.000000000 -0800 +@@ -3518,12 +3518,12 @@ elf_m68k_relocate_section (output_bfd, i + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-mcore.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf32-mcore.c 2009-03-05 05:57:51.000000000 -0800 +@@ -458,12 +458,12 @@ mcore_elf_relocate_section (bfd * output + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-mep.c.error 2009-02-03 11:30:04.000000000 -0800 ++++ binutils/bfd/elf32-mep.c 2009-03-05 05:57:51.000000000 -0800 +@@ -489,12 +489,12 @@ mep_elf_relocate_section + } + else + { +- bfd_boolean warned, unresolved_reloc; ++ bfd_boolean warned, unresolved_reloc, ignored; + + RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + name = h->root.root.string; + } +--- binutils/bfd/elf32-msp430.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf32-msp430.c 2009-03-05 05:57:51.000000000 -0800 +@@ -446,12 +446,12 @@ elf32_msp430_relocate_section (bfd * out + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-mt.c.error 2008-08-12 07:24:02.000000000 -0700 ++++ binutils/bfd/elf32-mt.c 2009-03-05 05:57:51.000000000 -0800 +@@ -344,12 +344,12 @@ mt_elf_relocate_section + else + { + bfd_boolean unresolved_reloc; +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + name = h->root.root.string; + } +--- binutils/bfd/elf32-openrisc.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf32-openrisc.c 2009-03-05 05:57:51.000000000 -0800 +@@ -365,12 +365,12 @@ openrisc_elf_relocate_section (bfd *outp + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-ppc.c.error 2009-03-05 05:49:31.000000000 -0800 ++++ binutils/bfd/elf32-ppc.c 2009-03-05 05:57:51.000000000 -0800 +@@ -6262,10 +6262,12 @@ ppc_elf_relocate_section (bfd *output_bf + } + else + { ++ bfd_boolean ignored; ++ + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + sym_name = h->root.root.string; + } +--- binutils/bfd/elf32-s390.c.error 2008-11-29 12:07:45.000000000 -0800 ++++ binutils/bfd/elf32-s390.c 2009-03-05 05:57:51.000000000 -0800 +@@ -2289,11 +2289,12 @@ elf_s390_relocate_section (output_bfd, i + else + { + bfd_boolean warned ATTRIBUTE_UNUSED; ++ bfd_boolean ignored ATTRIBUTE_UNUSED; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-v850.c.error 2008-11-29 12:07:45.000000000 -0800 ++++ binutils/bfd/elf32-v850.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1624,7 +1624,7 @@ v850_elf_relocate_section (bfd *output_b + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + /* Note - this check is delayed until now as it is possible and + valid to have a file without any symbols but with relocs that +@@ -1641,7 +1641,7 @@ v850_elf_relocate_section (bfd *output_b + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-vax.c.error 2008-11-29 12:07:45.000000000 -0800 ++++ binutils/bfd/elf32-vax.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1398,12 +1398,12 @@ elf_vax_relocate_section (bfd *output_bf + else + { + bfd_boolean unresolved_reloc; +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) +--- binutils/bfd/elf32-xc16x.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf32-xc16x.c 2009-03-05 05:57:51.000000000 -0800 +@@ -374,12 +374,12 @@ elf32_xc16x_relocate_section (bfd *outpu + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-xstormy16.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf32-xstormy16.c 2009-03-05 05:57:51.000000000 -0800 +@@ -823,12 +823,12 @@ xstormy16_elf_relocate_section (bfd * + } + else + { +- bfd_boolean unresolved_reloc, warned; ++ bfd_boolean unresolved_reloc, warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf32-xtensa.c.error 2009-02-25 10:36:15.000000000 -0800 ++++ binutils/bfd/elf32-xtensa.c 2009-03-05 05:57:51.000000000 -0800 +@@ -2625,10 +2625,12 @@ elf_xtensa_relocate_section (bfd *output + } + else + { ++ bfd_boolean ignored; ++ + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + if (relocation == 0 + && !unresolved_reloc +--- binutils/bfd/elf64-alpha.c.error 2008-11-29 12:07:45.000000000 -0800 ++++ binutils/bfd/elf64-alpha.c 2009-03-05 05:57:51.000000000 -0800 +@@ -4168,7 +4168,7 @@ elf64_alpha_relocate_section (bfd *outpu + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + bfd_boolean unresolved_reloc; + struct elf_link_hash_entry *hh; + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); +@@ -4176,7 +4176,7 @@ elf64_alpha_relocate_section (bfd *outpu + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + hh, sec, value, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + if (warned) + continue; +--- binutils/bfd/elf64-mmix.c.error 2007-10-30 11:48:33.000000000 -0700 ++++ binutils/bfd/elf64-mmix.c 2009-03-05 05:57:51.000000000 -0800 +@@ -1402,12 +1402,13 @@ mmix_elf_relocate_section (output_bfd, i + } + else + { +- bfd_boolean unresolved_reloc; ++ bfd_boolean unresolved_reloc, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, undefined_signalled); ++ unresolved_reloc, undefined_signalled, ++ ignored); + name = h->root.root.string; + } + +--- binutils/bfd/elf64-ppc.c.error 2009-03-05 05:49:31.000000000 -0800 ++++ binutils/bfd/elf64-ppc.c 2009-03-05 05:57:51.000000000 -0800 +@@ -10327,10 +10327,12 @@ ppc64_elf_relocate_section (bfd *output_ + } + else + { ++ bfd_boolean ignored; ++ + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h_elf, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + sym_name = h_elf->root.root.string; + sym_type = h_elf->type; + } +--- binutils/bfd/elf64-s390.c.error 2008-12-04 06:17:01.000000000 -0800 ++++ binutils/bfd/elf64-s390.c 2009-03-05 05:57:51.000000000 -0800 +@@ -2263,11 +2263,12 @@ elf_s390_relocate_section (output_bfd, i + else + { + bfd_boolean warned ATTRIBUTE_UNUSED; ++ bfd_boolean ignored ATTRIBUTE_UNUSED; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elf64-x86-64.c.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/bfd/elf64-x86-64.c 2009-03-05 05:57:51.000000000 -0800 +@@ -2382,12 +2382,12 @@ elf64_x86_64_relocate_section (bfd *outp + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + } + + if (sec != NULL && elf_discarded_section (sec)) +--- binutils/bfd/elfxx-ia64.c.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/bfd/elfxx-ia64.c 2009-03-05 05:57:51.000000000 -0800 +@@ -4544,17 +4544,17 @@ elfNN_ia64_relocate_section (bfd *output + else + { + bfd_boolean unresolved_reloc; +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sym_sec, value, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + + if (h->root.type == bfd_link_hash_undefweak) + undef_weak_ref = TRUE; +- else if (warned) ++ else if (warned || (ignored && info->executable)) + continue; + } + +--- binutils/bfd/elfxx-sparc.c.error 2008-11-29 12:07:46.000000000 -0800 ++++ binutils/bfd/elfxx-sparc.c 2009-03-05 05:57:51.000000000 -0800 +@@ -2569,12 +2569,12 @@ _bfd_sparc_elf_relocate_section (bfd *ou + } + else + { +- bfd_boolean warned; ++ bfd_boolean warned, ignored; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, +- unresolved_reloc, warned); ++ unresolved_reloc, warned, ignored); + if (warned) + { + /* To avoid generating warning messages about truncated +--- binutils/ld/ldmain.c.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/ld/ldmain.c 2009-03-05 05:57:51.000000000 -0800 +@@ -104,6 +104,9 @@ bfd_boolean add_needed = TRUE; + /* TRUE if we should demangle symbol names. */ + bfd_boolean demangling; + ++/* How to report unresolved symbols. */ ++enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR; ++ + args_type command_line; + + ld_config_type config; +@@ -388,6 +391,27 @@ main (int argc, char **argv) + if (! link_info.shared || link_info.pie) + link_info.executable = TRUE; + ++ /* When creating a shared library, the default behaviour is to ++ ignore any unresolved references. */ ++ ++ if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET) ++ { ++ if (link_info.shared && !link_info.pie) ++ link_info.unresolved_syms_in_objects = RM_IGNORE; ++ else ++ link_info.unresolved_syms_in_objects ++ = how_to_report_unresolved_symbols; ++ } ++ ++ if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET) ++ { ++ if (link_info.shared && !link_info.pie) ++ link_info.unresolved_syms_in_shared_libs = RM_IGNORE; ++ else ++ link_info.unresolved_syms_in_shared_libs ++ = how_to_report_unresolved_symbols; ++ } ++ + /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols). I + don't see how else this can be handled, since in this case we + must preserve all externally visible symbols. */ +--- binutils/ld/ldmain.h.error 2008-02-15 09:03:46.000000000 -0800 ++++ binutils/ld/ldmain.h 2009-03-05 05:57:51.000000000 -0800 +@@ -37,6 +37,7 @@ extern bfd_boolean whole_archive; + extern bfd_boolean as_needed; + extern bfd_boolean add_needed; + extern bfd_boolean demangling; ++extern enum report_method how_to_report_unresolved_symbols; + extern int g_switch_value; + extern const char *output_filename; + extern struct bfd_link_info link_info; +--- binutils/ld/lexsup.c.error 2009-02-03 11:30:15.000000000 -0800 ++++ binutils/ld/lexsup.c 2009-03-05 05:57:51.000000000 -0800 +@@ -581,7 +581,6 @@ parse_args (unsigned argc, char **argv) + struct option *longopts; + struct option *really_longopts; + int last_optind; +- enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR; + + shortopts = xmalloc (OPTION_COUNT * 3 + 2); + longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1)); +@@ -1127,12 +1126,7 @@ parse_args (unsigned argc, char **argv) + if (config.has_shared) + { + link_info.shared = TRUE; +- /* When creating a shared library, the default +- behaviour is to ignore any unresolved references. */ +- if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET) +- link_info.unresolved_syms_in_objects = RM_IGNORE; +- if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET) +- link_info.unresolved_syms_in_shared_libs = RM_IGNORE; ++ link_info.pie = FALSE; + } + else + einfo (_("%P%F: -shared not supported\n")); +@@ -1473,14 +1467,6 @@ parse_args (unsigned argc, char **argv) + set_default_dirlist (default_dirlist); + free (default_dirlist); + } +- +- if (link_info.unresolved_syms_in_objects == RM_NOT_YET_SET) +- /* FIXME: Should we allow emulations a chance to set this ? */ +- link_info.unresolved_syms_in_objects = how_to_report_unresolved_symbols; +- +- if (link_info.unresolved_syms_in_shared_libs == RM_NOT_YET_SET) +- /* FIXME: Should we allow emulations a chance to set this ? */ +- link_info.unresolved_syms_in_shared_libs = how_to_report_unresolved_symbols; + } + + /* Add the (colon-separated) elements of DIRLIST_PTR to the +--- binutils/ld/testsuite/ld-ia64/error1.d.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/ld/testsuite/ld-ia64/error1.d 2009-03-05 05:57:51.000000000 -0800 +@@ -0,0 +1,7 @@ ++#source: error1.s ++#ld: -unresolved-symbols=ignore-all ++#readelf: -s ++ ++#... ++[ ]+[0-9]+:[ ]+[0]+[ ]+0[ ]+NOTYPE[ ]+GLOBAL DEFAULT[ ]+UND[ ]+foo ++#pass +--- binutils/ld/testsuite/ld-ia64/error1.s.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/ld/testsuite/ld-ia64/error1.s 2009-03-05 05:57:51.000000000 -0800 +@@ -0,0 +1,30 @@ ++ .explicit ++ .pred.safe_across_calls p1-p5,p16-p63 ++ .text ++ .align 16 ++ .global _start# ++ .proc _start# ++_start: ++ .prologue 12, 32 ++ .mii ++ .save ar.pfs, r33 ++ alloc r33 = ar.pfs, 0, 3, 0, 0 ++ .save rp, r32 ++ mov r32 = b0 ++ mov r34 = r1 ++ .body ++ ;; ++ .bbb ++ nop 0 ++ nop 0 ++ br.call.sptk.many b0 = foo# ++ ;; ++ .mmi ++ nop 0 ++ mov r1 = r34 ++ mov b0 = r32 ++ .mib ++ nop 0 ++ mov ar.pfs = r33 ++ br.ret.sptk.many b0 ++ .endp _start# +--- binutils/ld/testsuite/ld-ia64/error2.d.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/ld/testsuite/ld-ia64/error2.d 2009-03-05 05:57:51.000000000 -0800 +@@ -0,0 +1,7 @@ ++#source: error1.s ++#ld: -pie -unresolved-symbols=ignore-all ++#readelf: -s ++ ++#... ++[ ]+[0-9]+:[ ]+[0]+[ ]+0[ ]+NOTYPE[ ]+GLOBAL DEFAULT[ ]+UND[ ]+foo ++#pass +--- binutils/ld/testsuite/ld-ia64/error3.d.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/ld/testsuite/ld-ia64/error3.d 2009-03-05 05:57:51.000000000 -0800 +@@ -0,0 +1,7 @@ ++#source: error1.s ++#ld: -pie -shared ++#readelf: -s ++ ++#... ++[ ]+[0-9]+:[ ]+[0]+[ ]+0[ ]+NOTYPE[ ]+GLOBAL DEFAULT[ ]+UND[ ]+foo ++#pass +--- binutils/ld/testsuite/ld-ia64/error4.d.error 2009-03-05 05:57:51.000000000 -0800 ++++ binutils/ld/testsuite/ld-ia64/error4.d 2009-03-05 05:57:51.000000000 -0800 +@@ -0,0 +1,3 @@ ++#source: error1.s ++#ld: -shared -pie ++#error: .*undefined reference to `foo' --- binutils-2.20.1.orig/debian/patches/311-gold-fuse-ld.dpatch +++ binutils-2.20.1/debian/patches/311-gold-fuse-ld.dpatch @@ -0,0 +1,44 @@ +#!/bin/sh -e +## gold-fuse-ld.dpatch +## DP: gold: Add -fuse-ld= for GCC linker option compatibility. +## +## DP: Description: add --enable-gold configure option + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +gold/ + +2013-01-07 H.J. Lu + + * options.h (General_options): Add -fuse-ld= for GCC linker + option compatibility. + +--- a/gold/options.h ++++ b/gold/options.h +@@ -1199,6 +1199,10 @@ class General_options + DEFINE_special(end_lib, options::TWO_DASHES, '\0', + N_("End a library "), NULL); + ++ DEFINE_string(fuse_ld, options::ONE_DASH, '\0', "", ++ N_("Ignored for GCC linker option compatibility"), ++ ""); ++ + // The -z options. + + DEFINE_bool(combreloc, options::DASH_Z, '\0', true, --- binutils-2.20.1.orig/debian/patches/134_gold_no_spu.dpatch +++ binutils-2.20.1/debian/patches/134_gold_no_spu.dpatch @@ -0,0 +1,35 @@ +#!/bin/sh -e +## 134_gold_no_spu.dpatch +## +## DP: Description: Don't configure gold for spu target. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- ./Makefile.in.orig 2009-10-16 11:50:46.000000000 +0000 ++++ ./Makefile.in 2009-11-11 23:01:20.000000000 +0000 +@@ -20958,7 +20958,7 @@ + srcdiroption="--srcdir=$${topdir}/gold"; \ + libsrcdir="$$s/gold"; \ + $(SHELL) $${libsrcdir}/configure \ +- $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ ++ $$(echo $(HOST_CONFIGARGS) |sed 's/,spu//') --build=${build_alias} --host=${host_alias} \ + --target=${target_alias} $${srcdiroption} \ + || exit 1 + @endif gold --- binutils-2.20.1.orig/debian/patches/145_ld_man_typo.dpatch +++ binutils-2.20.1/debian/patches/145_ld_man_typo.dpatch @@ -0,0 +1,46 @@ +#!/bin/sh -e +## 145_ld_man_typo.dpatch +## +## DP: Description: Fix typo in ld documentation. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- ./ld/ld.texinfo~ 2010-03-08 13:42:15.301086114 +0100 ++++ ./ld/ld.texinfo 2010-03-08 13:45:15.141094088 +0100 +@@ -1340,7 +1340,7 @@ + relocations. See @samp{--entry} and @samp{--undefined}. + + This option can be set when doing a partial link (enabled with option +-@samp{-r}). In this case the root of symbols kept must be explicitely ++@samp{-r}). In this case the root of symbols kept must be explicitly + specified either by an @samp{--entry} or @samp{--undefined} option or by + a @code{ENTRY} command in the linker script. + +--- ./ld/ld.1~ 2009-10-16 13:52:15.000000000 +0200 ++++ ./ld/ld.1 2010-03-08 13:46:21.222335894 +0100 +@@ -1199,7 +1199,7 @@ + relocations. See \fB\-\-entry\fR and \fB\-\-undefined\fR. + .Sp + This option can be set when doing a partial link (enabled with option +-\&\fB\-r\fR). In this case the root of symbols kept must be explicitely ++\&\fB\-r\fR). In this case the root of symbols kept must be explicitly + specified either by an \fB\-\-entry\fR or \fB\-\-undefined\fR option or by + a \f(CW\*(C`ENTRY\*(C'\fR command in the linker script. + .IP "\fB\-\-print\-gc\-sections\fR" 4 --- binutils-2.20.1.orig/debian/patches/000_branch_updates.dpatch +++ binutils-2.20.1/debian/patches/000_branch_updates.dpatch @@ -0,0 +1,24 @@ +#!/bin/sh -e +## 000_branch_updates.dpatch +## +## DP: Description: updates from the binutils 2.20 branch (2010xxyy) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ --- binutils-2.20.1.orig/debian/patches/201_elflink_improve_noaddneeded_errors.dpatch +++ binutils-2.20.1/debian/patches/201_elflink_improve_noaddneeded_errors.dpatch @@ -0,0 +1,70 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 201_elflink_improve_errors.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Improves error messages regarding -no-add-needed cases; needed for +## DP: later elflink patches +## DP: Upstream status: submitted upstream for binutils-2_20-branch + +2010-08-07 Kirill Smelkov + + Backport from mainline: + 2009-11-05 Nick Clifton + + * elflink.c (elf_link_add_object_symbols): Improve error + message generated when a symbol is left unresolved because a + --no-add-needed command line option has prevented the + inclusion of the DSO defining it. + +@DPATCH@ +diff --git a/bfd/elflink.c b/bfd/elflink.c +index 4a348de..10eee8c 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -3866,6 +3866,7 @@ error_free_dyn: + bfd_boolean common; + unsigned int old_alignment; + bfd *old_bfd; ++ bfd * undef_bfd = NULL; + + override = FALSE; + +@@ -4097,6 +4098,20 @@ error_free_dyn: + name = newname; + } + ++ /* If this is a definition of a previously undefined symbol ++ make a note of the bfd that contained the reference in ++ case we need to refer to it later on in error messages. */ ++ if (! bfd_is_und_section (sec)) ++ { ++ h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE, FALSE); ++ ++ if (h != NULL ++ && (h->root.type == bfd_link_hash_undefined ++ || h->root.type == bfd_link_hash_undefweak) ++ && h->root.u.undef.abfd) ++ undef_bfd = h->root.u.undef.abfd; ++ } ++ + if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, + &value, &old_alignment, + sym_hash, &skip, &override, +@@ -4437,9 +4452,12 @@ error_free_dyn: + if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) + { + (*_bfd_error_handler) +- (_("%B: invalid DSO for symbol `%s' definition"), ++ (_("%B: undefined reference to symbol '%s'"), ++ undef_bfd == NULL ? info->output_bfd : undef_bfd, name); ++ (*_bfd_error_handler) ++ (_("note: '%s' is defined in DSO %B so try adding it to the linker command line"), + abfd, name); +- bfd_set_error (bfd_error_bad_value); ++ bfd_set_error (bfd_error_invalid_operation); + goto error_free_vers; + } + +-- +1.7.2.1.44.g721e7 + --- binutils-2.20.1.orig/debian/patches/129_dir_section.dpatch +++ binutils-2.20.1/debian/patches/129_dir_section.dpatch @@ -0,0 +1,154 @@ +#!/bin/sh -e +## 129_dir_section.dpatch +## +## DP: Description: Add directory section for info documents. +## DP: Author: Matthias Klose +## DP: Upstream status: submitted upstream + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +bfd/ +2009-08-27 Matthias Klose + + * bfd.texinfo: Add directory section for info document. + +gas/ +2009-08-27 Matthias Klose + + * doc/as.texinfo: Add directory section for info document. + +gprof/ +2009-08-27 Matthias Klose + + * gprof.texi: Add directory section for info document. + +ld/ +2009-08-27 Matthias Klose + + * ld.texinfo, ldint.texinfo: Add directory section for info document. + +@DPATCH@ +--- ./bfd/doc/bfd.texinfo~ 2008-11-19 17:22:46.000000000 +0100 ++++ ./bfd/doc/bfd.texinfo 2009-08-27 15:59:58.000000000 +0200 +@@ -6,13 +6,12 @@ + @c + @synindex fn cp + +-@ifinfo +-@format +-START-INFO-DIR-ENTRY ++@ifnottex ++@dircategory Software development ++@direntry + * Bfd: (bfd). The Binary File Descriptor library. +-END-INFO-DIR-ENTRY +-@end format +-@end ifinfo ++@end direntry ++@end ifnottex + + @copying + This file documents the BFD library. +--- ./gas/doc/as.texinfo~ 2009-08-06 19:38:02.000000000 +0200 ++++ ./gas/doc/as.texinfo 2009-08-27 15:59:27.000000000 +0200 +@@ -84,14 +84,13 @@ + @c might as well show 'em anyways. + @end ifinfo + +-@ifinfo +-@format +-START-INFO-DIR-ENTRY ++@ifnottex ++@dircategory Software development ++@direntry + * As: (as). The GNU assembler. + * Gas: (as). The GNU assembler. +-END-INFO-DIR-ENTRY +-@end format +-@end ifinfo ++@end direntry ++@end ifnottex + + @finalout + @syncodeindex ky cp +--- ./gprof/gprof.texi~ 2009-08-27 15:26:11.000000000 +0200 ++++ ./gprof/gprof.texi 2009-08-27 16:00:58.000000000 +0200 +@@ -10,15 +10,14 @@ + @include bfdver.texi + @c man end + +-@ifinfo ++@ifnottex + @c This is a dir.info fragment to support semi-automated addition of + @c manuals to an info tree. zoo@cygnus.com is developing this facility. +-@format +-START-INFO-DIR-ENTRY ++@dircategory Software development ++@direntry + * gprof: (gprof). Profiling your program's execution +-END-INFO-DIR-ENTRY +-@end format +-@end ifinfo ++@end direntry ++@end ifnottex + + @copying + This file documents the gprof profiler of the GNU system. +--- ./ld/ld.texinfo~ 2009-07-06 15:48:51.000000000 +0200 ++++ ./ld/ld.texinfo 2009-08-27 15:57:09.000000000 +0200 +@@ -39,13 +39,12 @@ + @end ifset + @c man end + +-@ifinfo +-@format +-START-INFO-DIR-ENTRY ++@ifnottex ++@dircategory Software development ++@direntry + * Ld: (ld). The GNU linker. +-END-INFO-DIR-ENTRY +-@end format +-@end ifinfo ++@end direntry ++@end ifnottex + + @copying + This file documents the @sc{gnu} linker LD +--- ./ld/ldint.texinfo~ 2007-10-01 11:54:57.000000000 +0200 ++++ ./ld/ldint.texinfo 2009-08-27 15:58:50.000000000 +0200 +@@ -4,13 +4,12 @@ + @c 2003, 2007 + @c Free Software Foundation, Inc. + +-@ifinfo +-@format +-START-INFO-DIR-ENTRY ++@ifnottex ++@dircategory Software development ++@direntry + * Ld-Internals: (ldint). The GNU linker internals. +-END-INFO-DIR-ENTRY +-@end format +-@end ifinfo ++@end direntry ++@end ifnottex + + @copying + This file documents the internals of the GNU linker ld. --- binutils-2.20.1.orig/debian/patches/012_check_ldrunpath_length.dpatch +++ binutils-2.20.1/debian/patches/012_check_ldrunpath_length.dpatch @@ -0,0 +1,47 @@ +#!/bin/sh -e +## 012_check_ldrunpath_length.dpatch by Chris Chimelis +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for +## DP: cases where -rpath isn't specified. (#151024) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad binutils-2.16/ld/emultempl/elf32.em /tmp/dpep.u3SQkH/binutils-2.16/ld/emultempl/elf32.em +--- binutils-2.16/ld/emultempl/elf32.em 2005-04-13 19:59:07.000000000 +0200 ++++ /tmp/dpep.u3SQkH/binutils-2.16/ld/emultempl/elf32.em 2005-05-06 19:18:08.236669718 +0200 +@@ -885,6 +885,8 @@ + && command_line.rpath == NULL) + { + lib_path = (const char *) getenv ("LD_RUN_PATH"); ++ if ((lib_path) && (strlen (lib_path) == 0)) ++ lib_path = NULL; + if (gld${EMULATION_NAME}_search_needed (lib_path, &n, + force)) + break; +@@ -1059,6 +1061,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (strlen (rpath) == 0)) ++ rpath = NULL; + if (! (bfd_elf_size_dynamic_sections + (output_bfd, command_line.soname, rpath, + command_line.filter_shlib, --- binutils-2.20.1.orig/debian/patches/202_elflink_noaddneeded_vs_weak.dpatch +++ binutils-2.20.1/debian/patches/202_elflink_noaddneeded_vs_weak.dpatch @@ -0,0 +1,87 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 202_elflink_noaddneeded_vs_weak.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fixes '-no-add-needed breaks linking with weak symbols' +## DP: Upstream status: submitted upstream for binutils-2_20-branch + + +2010-08-07 Kirill Smelkov + + Backport from mainline: + 2010-01-21 Nick Clifton + + * elflink.c (elf_link_add_object_symbols): Look up name of + undefined symbol both before and after versioning has been + applied. Do not bother with symbols that are weakly undefined. + + +@DPATCH@ +diff --git a/bfd/elflink.c b/bfd/elflink.c +index 10eee8c..e058064 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -3991,6 +3991,20 @@ error_free_dyn: + unsigned int vernum = 0; + bfd_boolean skip; + ++ /* If this is a definition of a symbol which was previously ++ referenced in a non-weak manner then make a note of the bfd ++ that contained the reference. This is used if we need to ++ refer to the source of the reference later on. */ ++ if (! bfd_is_und_section (sec)) ++ { ++ h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE, FALSE); ++ ++ if (h != NULL ++ && h->root.type == bfd_link_hash_undefined ++ && h->root.u.undef.abfd) ++ undef_bfd = h->root.u.undef.abfd; ++ } ++ + if (ever == NULL) + { + if (info->default_imported_symver) +@@ -4098,16 +4112,15 @@ error_free_dyn: + name = newname; + } + +- /* If this is a definition of a previously undefined symbol +- make a note of the bfd that contained the reference in +- case we need to refer to it later on in error messages. */ +- if (! bfd_is_und_section (sec)) ++ /* If necessary, make a second attempt to locate the bfd ++ containing an unresolved, non-weak reference to the ++ current symbol. */ ++ if (! bfd_is_und_section (sec) && undef_bfd == NULL) + { + h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE, FALSE); + + if (h != NULL +- && (h->root.type == bfd_link_hash_undefined +- || h->root.type == bfd_link_hash_undefweak) ++ && h->root.type == bfd_link_hash_undefined + && h->root.u.undef.abfd) + undef_bfd = h->root.u.undef.abfd; + } +@@ -4448,12 +4461,14 @@ error_free_dyn: + /* A symbol from a library loaded via DT_NEEDED of some + other library is referenced by a regular object. + Add a DT_NEEDED entry for it. Issue an error if +- --no-add-needed is used. */ +- if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) ++ --no-add-needed is used and the reference was not ++ a weak one. */ ++ if (undef_bfd != NULL ++ && (elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) + { + (*_bfd_error_handler) + (_("%B: undefined reference to symbol '%s'"), +- undef_bfd == NULL ? info->output_bfd : undef_bfd, name); ++ undef_bfd, name); + (*_bfd_error_handler) + (_("note: '%s' is defined in DSO %B so try adding it to the linker command line"), + abfd, name); +-- +1.7.2.1.44.g721e7 + --- binutils-2.20.1.orig/debian/patches/144_no_infunc_symbols_from_shlib.dpatch +++ binutils-2.20.1/debian/patches/144_no_infunc_symbols_from_shlib.dpatch @@ -0,0 +1,134 @@ +#!/bin/sh -e +## 144_no_infunc_symbols_from_shlib.dpatch +## +## DP: Description: Don't set has_ifunc_symbols if the symbol comes from +## DP: a shared library (http://sourceware.org/ml/binutils/2010-02/msg00369.html). + + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +bfd/ + +2010-02-18 H.J. Lu + + * elf32-i386.c (elf_i386_add_symbol_hook): Don't set + has_ifunc_symbols if the symbol comes from a shared library. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. + * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_add_symbol_hook): Likewise. + +ld/testsuite/ + +2010-02-18 H.J. Lu + + * ld-ifunc/ifunc.exp: Expect System V OSABI in dynamic + ifunc-using executable. + +@DPATCH@ +diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c +index e2cdbf7..6ec2c2e 100644 +--- a/bfd/elf32-i386.c ++++ b/bfd/elf32-i386.c +@@ -4620,7 +4620,7 @@ elf_i386_hash_symbol (struct elf_link_hash_entry *h) + file. */ + + static bfd_boolean +-elf_i386_add_symbol_hook (bfd * abfd ATTRIBUTE_UNUSED, ++elf_i386_add_symbol_hook (bfd * abfd, + struct bfd_link_info * info ATTRIBUTE_UNUSED, + Elf_Internal_Sym * sym, + const char ** namep ATTRIBUTE_UNUSED, +@@ -4628,7 +4628,8 @@ elf_i386_add_symbol_hook (bfd * abfd ATTRIBUTE_UNUSED, + asection ** secp ATTRIBUTE_UNUSED, + bfd_vma * valp ATTRIBUTE_UNUSED) + { +- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) ++ if ((abfd->flags & DYNAMIC) == 0 ++ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) + elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE; + + return TRUE; +diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c +index 3667413..6e4cbc1 100644 +--- a/bfd/elf32-ppc.c ++++ b/bfd/elf32-ppc.c +@@ -3113,7 +3113,8 @@ ppc_elf_add_symbol_hook (bfd *abfd, + *valp = sym->st_size; + } + +- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) ++ if ((abfd->flags & DYNAMIC) == 0 ++ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) + elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE; + + return TRUE; +diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c +index 90d1b9f..ffd37dd 100644 +--- a/bfd/elf64-ppc.c ++++ b/bfd/elf64-ppc.c +@@ -4557,7 +4557,7 @@ make_fdh (struct bfd_link_info *info, + function type. */ + + static bfd_boolean +-ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED, ++ppc64_elf_add_symbol_hook (bfd *ibfd, + struct bfd_link_info *info, + Elf_Internal_Sym *isym, + const char **name ATTRIBUTE_UNUSED, +@@ -4566,7 +4566,10 @@ ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED, + bfd_vma *value ATTRIBUTE_UNUSED) + { + if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) +- elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE; ++ { ++ if ((ibfd->flags & DYNAMIC) == 0) ++ elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE; ++ } + else if (ELF_ST_TYPE (isym->st_info) == STT_FUNC) + ; + else if (*sec != NULL +diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c +index 9459b9c..373a8da 100644 +--- a/bfd/elf64-x86-64.c ++++ b/bfd/elf64-x86-64.c +@@ -4257,7 +4257,8 @@ elf64_x86_64_add_symbol_hook (bfd *abfd, + break; + } + +- if (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) ++ if ((abfd->flags & DYNAMIC) == 0 ++ && ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) + elf_tdata (info->output_bfd)->has_ifunc_symbols = TRUE; + + return TRUE; +diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp +index be519ce..38fe2d3 100644 +--- a/ld/testsuite/ld-ifunc/ifunc.exp ++++ b/ld/testsuite/ld-ifunc/ifunc.exp +@@ -258,8 +258,8 @@ if {! [check_osabi tmpdir/static_prog {UNIX - Linux}]} { + fail "Static ifunc-using executable does not have an OS/ABI field of LINUX" + set fails [expr $fails + 1] + } +-if {! [check_osabi tmpdir/dynamic_prog {UNIX - Linux}]} { +- fail "Dynamic ifunc-using executable does not have an OS/ABI field of LINUX" ++if {! [check_osabi tmpdir/dynamic_prog {UNIX - System V}]} { ++ fail "Dynamic ifunc-using executable does not have an OS/ABI field of System V" + set fails [expr $fails + 1] + } + if {! [check_osabi tmpdir/static_nonifunc_prog {UNIX - System V}]} { --- binutils-2.20.1.orig/debian/patches/139_gold_pr10916.dpatch +++ binutils-2.20.1/debian/patches/139_gold_pr10916.dpatch @@ -0,0 +1,58 @@ +#!/bin/sh -e +## 139_gold_pr10916.dpatch +## +## DP: Description: PR gold/10916: Fix --exclude-libs with undefined symbol + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- ./gold/symtab.cc 29 Dec 2009 00:31:48 -0000 1.134 ++++ ./gold/symtab.cc 31 Dec 2009 01:12:48 -0000 +@@ -1151,7 +1151,8 @@ Symbol_table::add_from_relobj( + } + + // Fix up visibility if object has no-export set. +- if (relobj->no_export()) ++ if (relobj->no_export() ++ && (orig_st_shndx != elfcpp::SHN_UNDEF || !is_ordinary)) + { + // We may have copied symbol already above. + if (psym != &sym2) +diff -p -u -r1.1 exclude_libs_test_1.c +--- ./gold/testsuite/exclude_libs_test_1.c 19 May 2009 22:14:17 -0000 1.1 ++++ ./gold/testsuite/exclude_libs_test_1.c 31 Dec 2009 01:12:48 -0000 +@@ -2,6 +2,8 @@ void lib1_default (void); + void lib1_hidden (void); + void lib1_internal (void); + void lib1_protected (void); ++void lib1_ref (void); ++extern void lib2_default (void); + + void __attribute__((visibility ("default"))) + lib1_default (void) +@@ -22,3 +24,9 @@ void __attribute__((visibility ("protect + lib1_protected (void) + { + } ++ ++void ++lib1_ref (void) ++{ ++ lib2_default (); ++} --- binutils-2.20.1.orig/debian/patches/307-CVE-2014-8737.dpatch +++ binutils-2.20.1/debian/patches/307-CVE-2014-8737.dpatch @@ -0,0 +1,216 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 307-CVE-2014-8737.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: directory traversal vulnerabilities [CVE-2014-8737] + +@DPATCH@ + +From dd9b91de2149ee81d47f708e7b0bbf57da10ad42 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Thu, 6 Nov 2014 14:49:10 +0000 +Subject: [PATCH] Prevent archive memebers with illegal pathnames from being extracted from an archive. + + PR binutils/17552, binutils/17533 + * bucomm.c (is_valid_archive_path): New function. Returns false + for absolute pathnames and pathnames that include /../. + * bucomm.h (is_valid_archive_path): Add prototype. + * ar.c (extract_file): Use new function to check for valid + pathnames when extracting files from an archive. + * objcopy.c (copy_archive): Likewise. + * doc/binutils.texi: Update documentation to mention the + limitation on pathname of archive members. + +From 5e186ece2feebb46e63ff6bb2d2490aad0d5a724 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Mon, 10 Nov 2014 14:28:43 +0000 +Subject: [PATCH] Fix objcopy and strip so that they remove their temporary files even if an error occurs. + + PR binutils/17552 + * (copy_archive): Clean up temporary files even if an error + occurs. + +[Ubuntu note: patches differ from upstream commit by dropping the +changelog updates to reduce patch conflicts. -- sbeattie] + +CVE-2014-8737 + fix to clean up temporary files on error +--- + binutils/ar.c | 9 +++++++++ + binutils/bucomm.c | 26 ++++++++++++++++++++++++++ + binutils/bucomm.h | 12 ++++++++---- + binutils/doc/binutils.texi | 3 ++- + binutils/objcopy.c | 23 ++++++++++++++++++----- + 5 files changed, 63 insertions(+), 10 deletions(-) + +Index: b/binutils/ar.c +=================================================================== +--- a/binutils/ar.c ++++ b/binutils/ar.c +@@ -938,6 +938,15 @@ extract_file (bfd *abfd) + bfd_size_type size; + struct stat buf; + ++ /* PR binutils/17533: Do not allow directory traversal ++ outside of the current directory tree. */ ++ if (! is_valid_archive_path (bfd_get_filename (abfd))) ++ { ++ non_fatal (_("illegal pathname found in archive member: %s"), ++ bfd_get_filename (abfd)); ++ return; ++ } ++ + if (bfd_stat_arch_elt (abfd, &buf) != 0) + /* xgettext:c-format */ + fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); +Index: b/binutils/bucomm.c +=================================================================== +--- a/binutils/bucomm.c ++++ b/binutils/bucomm.c +@@ -623,3 +623,29 @@ bfd_get_archive_filename (const bfd *abf + bfd_get_filename (abfd)); + return buf; + } ++ ++/* Returns TRUE iff PATHNAME, a filename of an archive member, ++ is valid for writing. For security reasons absolute paths ++ and paths containing /../ are not allowed. See PR 17533. */ ++ ++bfd_boolean ++is_valid_archive_path (char const * pathname) ++{ ++ const char * n = pathname; ++ ++ if (IS_ABSOLUTE_PATH (n)) ++ return FALSE; ++ ++ while (*n) ++ { ++ if (*n == '.' && *++n == '.' && ( ! *++n || IS_DIR_SEPARATOR (*n))) ++ return FALSE; ++ ++ while (*n && ! IS_DIR_SEPARATOR (*n)) ++ n++; ++ while (IS_DIR_SEPARATOR (*n)) ++ n++; ++ } ++ ++ return TRUE; ++} +Index: b/binutils/bucomm.h +=================================================================== +--- a/binutils/bucomm.h ++++ b/binutils/bucomm.h +@@ -23,6 +23,8 @@ + #ifndef _BUCOMM_H + #define _BUCOMM_H + ++/* In bucomm.c. */ ++ + /* Return the filename in a static buffer. */ + const char *bfd_get_archive_filename (const bfd *); + +@@ -58,20 +60,22 @@ bfd_vma parse_vma (const char *, const c + + off_t get_file_size (const char *); + ++bfd_boolean is_valid_archive_path (char const *); ++ + extern char *program_name; + +-/* filemode.c */ ++/* In filemode.c. */ + void mode_string (unsigned long, char *); + +-/* version.c */ ++/* In version.c. */ + extern void print_version (const char *); + +-/* rename.c */ ++/* In rename.c. */ + extern void set_times (const char *, const struct stat *); + + extern int smart_rename (const char *, const char *, int); + +-/* libiberty. */ ++/* In libiberty. */ + void *xmalloc (size_t); + + void *xrealloc (void *, size_t); +Index: b/binutils/doc/binutils.texi +=================================================================== +--- a/binutils/doc/binutils.texi ++++ b/binutils/doc/binutils.texi +@@ -227,7 +227,8 @@ contents of each object would only waste + are also @emph{flattened}, so that adding one or more archives to a + thin archive will add the elements of the nested archive individually. + The paths to the elements of the archive are stored relative to the +-archive itself. ++archive itself. For security reasons absolute paths and paths with a ++@code{/../} component are not allowed. + + @cindex compatibility, @command{ar} + @cindex @command{ar} compatibility +Index: b/binutils/objcopy.c +=================================================================== +--- a/binutils/objcopy.c ++++ b/binutils/objcopy.c +@@ -2051,6 +2051,16 @@ copy_archive (bfd *ibfd, bfd *obfd, cons + bfd_boolean del = TRUE; + bfd_boolean ok_object; + ++ /* PR binutils/17533: Do not allow directory traversal ++ outside of the current directory tree by archive members. */ ++ if (! is_valid_archive_path (bfd_get_filename (this_element))) ++ { ++ non_fatal (_("illegal pathname found in archive member: %s"), ++ bfd_get_filename (this_element)); ++ status = 1; ++ goto cleanup_and_exit; ++ } ++ + /* Create an output file for this member. */ + output_name = concat (dir, "/", + bfd_get_filename (this_element), (char *) 0); +@@ -2060,8 +2070,12 @@ copy_archive (bfd *ibfd, bfd *obfd, cons + { + output_name = make_tempdir (output_name); + if (output_name == NULL) +- fatal (_("cannot create tempdir for archive copying (error: %s)"), +- strerror (errno)); ++ { ++ non_fatal (_("cannot create tempdir for archive copying (error: %s)"), ++ strerror (errno)); ++ status = 1; ++ goto cleanup_and_exit; ++ } + + l = (struct name_list *) xmalloc (sizeof (struct name_list)); + l->name = output_name; +@@ -2103,7 +2117,7 @@ copy_archive (bfd *ibfd, bfd *obfd, cons + { + bfd_nonfatal_message (output_name, NULL, NULL, NULL); + status = 1; +- return; ++ goto cleanup_and_exit; + } + + del = ! copy_object (this_element, output_bfd); +@@ -2164,7 +2178,6 @@ copy_archive (bfd *ibfd, bfd *obfd, cons + { + status = 1; + bfd_nonfatal_message (filename, NULL, NULL, NULL); +- return; + } + + filename = bfd_get_filename (ibfd); +@@ -2172,9 +2185,9 @@ copy_archive (bfd *ibfd, bfd *obfd, cons + { + status = 1; + bfd_nonfatal_message (filename, NULL, NULL, NULL); +- return; + } + ++ cleanup_and_exit: + /* Delete all the files that we opened. */ + for (l = list; l != NULL; l = l->next) + { --- binutils-2.20.1.orig/debian/patches/002_gprof_profile_arcs.dpatch +++ binutils-2.20.1/debian/patches/002_gprof_profile_arcs.dpatch @@ -0,0 +1,51 @@ +#!/bin/sh -e +## 003_gmon_manpage_fix.dpatch by Chris Chimelis +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add more documentation about profiling and -fprofile-arcs. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad binutils-2.16/gprof/gprof.texi /tmp/dpep.NHuhql/binutils-2.16/gprof/gprof.texi +--- binutils-2.16/gprof/gprof.texi 2005-03-03 13:05:12.000000000 +0100 ++++ /tmp/dpep.NHuhql/binutils-2.16/gprof/gprof.texi 2005-05-06 19:14:10.038173569 +0200 +@@ -138,6 +138,10 @@ + If more than one profile file is specified, the @code{gprof} + output shows the sum of the profile information in the given profile files. + ++If you use gcc 2.95.x or 3.0 to compile your binaries, you may need ++to add the @samp{-fprofile-arcs} to the compile command line in order ++for the call graphs to be properly stored in gmon.out. ++ + @code{Gprof} calculates the amount of time spent in each routine. + Next, these times are propagated along the edges of the call graph. + Cycles are discovered, and calls into a cycle are made to share the time +@@ -268,6 +272,11 @@ + options. The same option, @samp{-pg}, alters either compilation or linking + to do what is necessary for profiling. Here are examples: + ++If you use gcc 2.95.x or 3.0.x, you may need to add the ++@samp{-fprofile-arcs} option to the compile line along with @samp{-pg} ++in order to allow the call-graphs to be properly included in the gmon.out ++file. ++ + @example + cc -g -c myprog.c utils.c -pg + cc -o myprog myprog.o utils.o -pg --- binutils-2.20.1.orig/debian/patches/310-harden_strings.dpatch +++ binutils-2.20.1/debian/patches/310-harden_strings.dpatch @@ -0,0 +1,282 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 309-harden_strings.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Dont use libbfd in strings by default + +@DPATCH@ + +From b0b93f3592f3d165896e8dc8186a7ba285f0f3e4 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Fri, 31 Oct 2014 10:21:57 +0000 +Subject: [PATCH] Import a security patch from the mainline which changes the default behaviour + of the strings program to be --all rather then --data. This avoids using the + BFD library by default, and so avoids exposing strings to any memory bugs + present in BFD. + + * strings.c: Add new command line option --data to only scan the + initialized, loadable data secions of binaries. Choose the + default behaviour of --all or --data based upon a configure + option. + * doc/binutils.texi (strings): Update documentation. Include + description of why the --data option might be unsafe. + * configure.ac: Add new option --disable-default-strings-all which + restores the old behaviour of strings using --data by default. If + the option is not used make strings use --all by default. + * NEWS: Mention the new behaviour of strings. + * configure: Regenerate. + * config.in: Regenerate. + +[Ubuntu note: patch differs from upstream commit in that it drops the +update to the changelog to avoid patch conflicts. -- sbeattie] + +diff --git a/binutils/NEWS b/binutils/NEWS +index 126219b..9054494 100644 +--- a/binutils/NEWS ++++ b/binutils/NEWS +@@ -1,5 +1,12 @@ + -*- text -*- + ++Changes in 2.20.1-3ubuntu7.2: ++ ++* Add --data option to strings to only print strings in loadable, initialized ++ data sections. Change the default behaviour to be --all, but add a new ++ configure time option of --disable-default-strings-all to restore the old ++ default behaviour. ++ + Changes in 2.20: + + * Add support for delay importing to dlltool. Use the --output-delaylib +diff --git a/binutils/config.in b/binutils/config.in +index d43b748..076f514 100644 +--- a/binutils/config.in ++++ b/binutils/config.in +@@ -18,6 +18,9 @@ + /* Define to 1 if using `alloca.c'. */ + #undef C_ALLOCA + ++/* Should strings use -a behavior by default? */ ++#undef DEFAULT_STRINGS_ALL ++ + /* Define to 1 if translation of program messages to the user's native + language is requested. */ + #undef ENABLE_NLS +diff --git a/binutils/configure b/binutils/configure +index 063ad72..07551c3 100755 +--- a/binutils/configure ++++ b/binutils/configure +@@ -772,6 +772,7 @@ enable_plugins + with_gnu_ld + enable_libtool_lock + enable_targets ++enable_default_strings_all + enable_werror + enable_build_warnings + enable_nls +@@ -1423,6 +1424,8 @@ Optional Features: + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-targets alternative target configurations ++ --disable-default-strings-all ++ strings defaults to --data behavior + --enable-werror treat compile warnings as errors + --enable-build-warnings enable build-time compiler warnings + --disable-nls do not use Native Language Support +@@ -11681,6 +11684,25 @@ cat >>confdefs.h <<_ACEOF + esac + fi + ++# Check whether --enable-default-strings-all was given. ++if test "${enable_default_strings_all+set}" = set; then : ++ enableval=$enable_default_strings_all; ++if test "${enableval}" = no; then ++ default_strings_all=0 ++else ++ default_strings_all=1 ++fi ++else ++ default_strings_all=1 ++fi ++ ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define DEFAULT_STRINGS_ALL $default_strings_all ++_ACEOF ++ ++ + + GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +diff --git a/binutils/configure.ac b/binutils/configure.in +index c5da20d..c5aadd8 100644 +--- a/binutils/configure.in ++++ b/binutils/configure.in +@@ -55,6 +55,18 @@ fi], [default_ar_deterministic=0]) + *) enable_targets=$enableval ;; + esac])dnl + ++AC_ARG_ENABLE(default-strings-all, ++[AS_HELP_STRING([--disable-default-strings-all], ++ [strings defaults to --data behavior])], [ ++if test "${enableval}" = no; then ++ default_strings_all=0 ++else ++ default_strings_all=1 ++fi], [default_strings_all=1]) ++ ++AC_DEFINE_UNQUOTED(DEFAULT_STRINGS_ALL, $default_strings_all, ++ [Should strings use -a behavior by default?]) ++ + AM_BINUTILS_WARNINGS + + AC_CONFIG_HEADERS(config.h:config.in) +diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi +index 3874f25..eee77b1 100644 +--- a/binutils/doc/binutils.texi ++++ b/binutils/doc/binutils.texi +@@ -2672,15 +2672,24 @@ strings [@option{-afovV}] [@option{-}@var{min-len}] + + @c man begin DESCRIPTION strings + +-For each @var{file} given, @sc{gnu} @command{strings} prints the printable +-character sequences that are at least 4 characters long (or the number +-given with the options below) and are followed by an unprintable +-character. By default, it only prints the strings from the initialized +-and loaded sections of object files; for other types of files, it prints +-the strings from the whole file. ++For each @var{file} given, @sc{gnu} @command{strings} prints the ++printable character sequences that are at least 4 characters long (or ++the number given with the options below) and are followed by an ++unprintable character. + +-@command{strings} is mainly useful for determining the contents of non-text +-files. ++Depending upon how the strings program was configured it will default ++to either displaying all the printable sequences that it can find in ++each file, or only those sequences that are in loadable, initialized ++data sections. If the file type in unrecognizable, or if strings is ++reading from stdin then it will always display all of the printable ++sequences that it can find. ++ ++For backwards compatibility any file that occurs after a command line ++option of just @option{-} will also be scanned in full, regardless of ++the presence of any @option{-d} option. ++ ++@command{strings} is mainly useful for determining the contents of ++non-text files. + + @c man end + +@@ -2690,8 +2699,25 @@ files. + @item -a + @itemx --all + @itemx - +-Do not scan only the initialized and loaded sections of object files; +-scan the whole files. ++Scan the whole file, regardless of what sections it contains or ++whether those sections are loaded or initialized. Normally this is ++the default behaviour, but strings can be configured so that the ++@option{-d} is the default instead. ++ ++The @option{-} option is position dependent and forces strings to ++perform full scans of any file that is mentioned after the @option{-} ++on the command line, even if the @option{-d} option has been ++specified. ++ ++@item -d ++@itemx --data ++Only print strings from initialized, loaded data sections in the ++file. This may reduce the amount of garbage in the output, but it ++also exposes the strings program to any security flaws that may be ++present in the BFD library used to scan and load sections. Strings ++can be configured so that this option is the default behaviour. In ++such cases the @option{-a} option can be used to avoid using the BFD ++library and instead just print all of the strings found in the file. + + @item -f + @itemx --print-file-name +diff --git a/binutils/strings.c b/binutils/strings.c +index f92132b..2cf046f 100644 +--- a/binutils/strings.c ++++ b/binutils/strings.c +@@ -21,7 +21,10 @@ + Options: + --all + -a +- - Do not scan only the initialized data section of object files. ++ - Scan each file in its entirety. ++ ++ --data ++ -d Scan only the initialized data section(s) of object files. + + --print-file-name + -f Print the name of the file before each string. +@@ -114,6 +117,7 @@ static int encoding_bytes; + static struct option long_options[] = + { + {"all", no_argument, NULL, 'a'}, ++ {"data", no_argument, NULL, 'd'}, + {"print-file-name", no_argument, NULL, 'f'}, + {"bytes", required_argument, NULL, 'n'}, + {"radix", required_argument, NULL, 't'}, +@@ -136,7 +140,7 @@ typedef struct + + static void strings_a_section (bfd *, asection *, void *); + static bfd_boolean strings_object_file (const char *); +-static bfd_boolean strings_file (char *file); ++static bfd_boolean strings_file (char *); + static void print_strings (const char *, FILE *, file_off, int, int, char *); + static void usage (FILE *, int); + static long get_char (FILE *, file_off *, int *, char **); +@@ -167,11 +171,14 @@ main (int argc, char **argv) + string_min = 4; + print_addresses = FALSE; + print_filenames = FALSE; +- datasection_only = TRUE; ++ if (DEFAULT_STRINGS_ALL) ++ datasection_only = FALSE; ++ else ++ datasection_only = TRUE; + target = NULL; + encoding = 's'; + +- while ((optc = getopt_long (argc, argv, "afhHn:ot:e:T:Vv0123456789", ++ while ((optc = getopt_long (argc, argv, "adfhHn:ot:e:T:Vv0123456789", + long_options, (int *) 0)) != EOF) + { + switch (optc) +@@ -180,6 +187,10 @@ main (int argc, char **argv) + datasection_only = FALSE; + break; + ++ case 'd': ++ datasection_only = TRUE; ++ break; ++ + case 'f': + print_filenames = TRUE; + break; +@@ -648,8 +659,18 @@ usage (FILE *stream, int status) + { + fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); + fprintf (stream, _(" Display printable strings in [file(s)] (stdin by default)\n")); +- fprintf (stream, _(" The options are:\n\ ++ fprintf (stream, _(" The options are:\n")); ++ ++ if (DEFAULT_STRINGS_ALL) ++ fprintf (stream, _("\ ++ -a - --all Scan the entire file, not just the data section [default]\n\ ++ -d --data Only scan the data sections in the file\n")); ++ else ++ fprintf (stream, _("\ + -a - --all Scan the entire file, not just the data section\n\ ++ -d --data Only scan the data sections in the file [default]\n")); ++ ++ fprintf (stream, _("\ + -f --print-file-name Print the name of the file before each string\n\ + -n --bytes=[number] Locate & print any NUL-terminated sequence of at\n\ + - least [number] characters (default 4).\n\ +-- +1.7.1 + --- binutils-2.20.1.orig/debian/patches/146_arm_readelf_unwind.dpatch +++ binutils-2.20.1/debian/patches/146_arm_readelf_unwind.dpatch @@ -0,0 +1,771 @@ +#!/bin/sh -e +## 146_arm_readelf_unwind.dpatch +## +## DP: Description: Add readelf --unwind support for ARM + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2010-03-02 Daniel Jacobowitz + + * NEWS: Document .ARM.exidx / .ARM.extab support. + + * dwarf.c (read_leb128): Make non-static. + * dwarf.h (read_leb128): Declare. + * readelf.c (REMOVE_ARCH_BITS): Define. + (find_section_by_address): New. + (read_uleb128): Move higher. Use read_leb128 from dwarf.c. + (find_symbol_for_address): Handle the Thumb bit for ARM, by + using REMOVE_ARCH_BITS. + (struct arm_section, struct arm_unw_aux_info, arm_print_vma_and_name) + (arm_free_section, arm_section_get_word, decode_arm_unwind) + (dump_arm_unwind, arm_process_unwind): New. + (process_unwind): Handle ARM. + +@DPATCH@ +Index: dwarf.c +=================================================================== +RCS file: /cvs/src/src/binutils/dwarf.c,v +retrieving revision 1.62 +diff -u -p -r1.62 dwarf.c +--- ./binutils/dwarf.c 8 Feb 2010 19:27:34 -0000 1.62 ++++ ./binutils/dwarf.c 2 Mar 2010 16:42:56 -0000 +@@ -227,7 +227,7 @@ print_dwarf_vma (dwarf_vma val, unsigned + fputs (buff + (byte_size == 4 ? 8 : 0), stdout); + } + +-static unsigned long int ++unsigned long int + read_leb128 (unsigned char *data, unsigned int *length_return, int sign) + { + unsigned long int result = 0; +Index: dwarf.h +=================================================================== +RCS file: /cvs/src/src/binutils/dwarf.h,v +retrieving revision 1.13 +diff -u -p -r1.13 dwarf.h +--- ./binutils/dwarf.h 3 Dec 2009 12:28:36 -0000 1.13 ++++ ./binutils/dwarf.h 2 Mar 2010 16:42:56 -0000 +@@ -133,3 +133,6 @@ void *xcrealloc (void *, size_t, size_t) + + void error (const char *, ...) ATTRIBUTE_PRINTF_1; + void warn (const char *, ...) ATTRIBUTE_PRINTF_1; ++ ++unsigned long int read_leb128 (unsigned char *data, ++ unsigned int *length_return, int sign); +Index: readelf.c +=================================================================== +RCS file: /cvs/src/src/binutils/readelf.c,v +retrieving revision 1.486 +diff -u -p -r1.486 readelf.c +--- ./binutils/readelf.c 19 Feb 2010 01:36:39 -0000 1.486 ++++ ./binutils/readelf.c 2 Mar 2010 16:42:57 -0000 +@@ -285,6 +285,11 @@ static void (* byte_put) (unsigned char + #define streq(a,b) (strcmp ((a), (b)) == 0) + #define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0) + #define const_strneq(a,b) (strncmp ((a), (b), sizeof (b) - 1) == 0) ++ ++#define REMOVE_ARCH_BITS(ADDR) do { \ ++ if (elf_header.e_machine == EM_ARM) \ ++ (ADDR) &= ~1; \ ++ } while (0) + + static void * + get_data (void * var, FILE * file, long offset, size_t size, size_t nmemb, +@@ -544,6 +549,33 @@ find_section (const char * name) + return NULL; + } + ++/* Return a pointer to a section containing ADDR, or NULL if no such ++ section exists. */ ++ ++static Elf_Internal_Shdr * ++find_section_by_address (bfd_vma addr) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < elf_header.e_shnum; i++) ++ { ++ Elf_Internal_Shdr *sec = section_headers + i; ++ if (addr >= sec->sh_addr && addr < sec->sh_addr + sec->sh_size) ++ return sec; ++ } ++ ++ return NULL; ++} ++ ++/* Read an unsigned LEB128 encoded value from p. Set *PLEN to the number of ++ bytes read. */ ++ ++static unsigned long ++read_uleb128 (unsigned char *data, unsigned int *length_return) ++{ ++ return read_leb128 (data, length_return, 0); ++} ++ + /* Guess the relocation size commonly used by the specific machines. */ + + static int +@@ -5089,16 +5121,22 @@ find_symbol_for_address (Elf_Internal_Sy + Elf_Internal_Sym * best = NULL; + unsigned long i; + ++ REMOVE_ARCH_BITS (addr.offset); ++ + for (i = 0, sym = symtab; i < nsyms; ++i, ++sym) + { ++ bfd_vma value = sym->st_value; ++ ++ REMOVE_ARCH_BITS (value); ++ + if (ELF_ST_TYPE (sym->st_info) == STT_FUNC + && sym->st_name != 0 + && (addr.section == SHN_UNDEF || addr.section == sym->st_shndx) +- && addr.offset >= sym->st_value +- && addr.offset - sym->st_value < dist) ++ && addr.offset >= value ++ && addr.offset - value < dist) + { + best = sym; +- dist = addr.offset - sym->st_value; ++ dist = addr.offset - value; + if (!dist) + break; + } +@@ -5761,6 +5799,579 @@ hppa_process_unwind (FILE * file) + return 1; + } + ++struct arm_section ++{ ++ unsigned char *data; ++ ++ Elf_Internal_Shdr *sec; ++ Elf_Internal_Rela *rela; ++ unsigned long nrelas; ++ unsigned int rel_type; ++ ++ Elf_Internal_Rela *next_rela; ++}; ++ ++struct arm_unw_aux_info ++{ ++ FILE *file; ++ ++ Elf_Internal_Sym *symtab; /* The symbol table. */ ++ unsigned long nsyms; /* Number of symbols. */ ++ char *strtab; /* The string table. */ ++ unsigned long strtab_size; /* Size of string table. */ ++}; ++ ++static const char * ++arm_print_vma_and_name (struct arm_unw_aux_info *aux, ++ bfd_vma fn, struct absaddr addr) ++{ ++ const char *procname; ++ bfd_vma sym_offset; ++ ++ if (addr.section == SHN_UNDEF) ++ addr.offset = fn; ++ ++ find_symbol_for_address (aux->symtab, aux->nsyms, aux->strtab, ++ aux->strtab_size, addr, &procname, ++ &sym_offset); ++ ++ print_vma (fn, PREFIX_HEX); ++ ++ if (procname) ++ { ++ fputs (" <", stdout); ++ fputs (procname, stdout); ++ ++ if (sym_offset) ++ printf ("+0x%lx", (unsigned long) sym_offset); ++ fputc ('>', stdout); ++ } ++ ++ return procname; ++} ++ ++static void ++arm_free_section (struct arm_section *arm_sec) ++{ ++ if (arm_sec->data != NULL) ++ free (arm_sec->data); ++ ++ if (arm_sec->rela != NULL) ++ free (arm_sec->rela); ++} ++ ++static int ++arm_section_get_word (struct arm_unw_aux_info *aux, ++ struct arm_section *arm_sec, ++ Elf_Internal_Shdr *sec, bfd_vma word_offset, ++ unsigned int *wordp, struct absaddr *addr) ++{ ++ Elf_Internal_Rela *rp; ++ Elf_Internal_Sym *sym; ++ const char * relname; ++ unsigned int word; ++ bfd_boolean wrapped; ++ ++ addr->section = SHN_UNDEF; ++ addr->offset = 0; ++ ++ if (sec != arm_sec->sec) ++ { ++ Elf_Internal_Shdr *relsec; ++ ++ arm_free_section (arm_sec); ++ ++ arm_sec->sec = sec; ++ arm_sec->data = get_data (NULL, aux->file, sec->sh_offset, 1, ++ sec->sh_size, _("unwind data")); ++ ++ arm_sec->rela = NULL; ++ arm_sec->nrelas = 0; ++ ++ for (relsec = section_headers; ++ relsec < section_headers + elf_header.e_shnum; ++ ++relsec) ++ { ++ if (relsec->sh_info >= elf_header.e_shnum ++ || section_headers + relsec->sh_info != sec) ++ continue; ++ ++ if (relsec->sh_type == SHT_REL) ++ { ++ if (!slurp_rel_relocs (aux->file, relsec->sh_offset, ++ relsec->sh_size, ++ & arm_sec->rela, & arm_sec->nrelas)) ++ return 0; ++ break; ++ } ++ else if (relsec->sh_type == SHT_RELA) ++ { ++ if (!slurp_rela_relocs (aux->file, relsec->sh_offset, ++ relsec->sh_size, ++ & arm_sec->rela, & arm_sec->nrelas)) ++ return 0; ++ break; ++ } ++ } ++ ++ arm_sec->next_rela = arm_sec->rela; ++ } ++ ++ if (arm_sec->data == NULL) ++ return 0; ++ ++ word = byte_get (arm_sec->data + word_offset, 4); ++ ++ wrapped = FALSE; ++ for (rp = arm_sec->next_rela; rp != arm_sec->rela + arm_sec->nrelas; rp++) ++ { ++ bfd_vma prelval, offset; ++ ++ if (rp->r_offset > word_offset && !wrapped) ++ { ++ rp = arm_sec->rela; ++ wrapped = TRUE; ++ } ++ if (rp->r_offset > word_offset) ++ break; ++ ++ if (rp->r_offset & 3) ++ { ++ warn (_("Skipping unexpected relocation at offset 0x%lx\n"), ++ (unsigned long) rp->r_offset); ++ continue; ++ } ++ ++ if (rp->r_offset < word_offset) ++ continue; ++ ++ relname = elf_arm_reloc_type (ELF32_R_TYPE (rp->r_info)); ++ ++ if (streq (relname, "R_ARM_NONE")) ++ continue; ++ ++ if (! streq (relname, "R_ARM_PREL31")) ++ { ++ warn (_("Skipping unexpected relocation type %s\n"), relname); ++ continue; ++ } ++ ++ sym = aux->symtab + ELF32_R_SYM (rp->r_info); ++ ++ if (arm_sec->rel_type == SHT_REL) ++ { ++ offset = word & 0x7fffffff; ++ if (offset & 0x40000000) ++ offset |= ~ (bfd_vma) 0x7fffffff; ++ } ++ else ++ offset = rp->r_addend; ++ ++ offset += sym->st_value; ++ prelval = offset - (arm_sec->sec->sh_addr + rp->r_offset); ++ ++ word = (word & ~ (bfd_vma) 0x7fffffff) | (prelval & 0x7fffffff); ++ addr->section = sym->st_shndx; ++ addr->offset = offset; ++ break; ++ } ++ ++ *wordp = word; ++ arm_sec->next_rela = rp; ++ ++ return 1; ++} ++ ++static void ++decode_arm_unwind (struct arm_unw_aux_info *aux, ++ unsigned int word, unsigned int remaining, ++ bfd_vma data_offset, Elf_Internal_Shdr *data_sec, ++ struct arm_section *data_arm_sec) ++{ ++ int per_index; ++ unsigned int more_words; ++ struct absaddr addr; ++ ++#define ADVANCE \ ++ if (remaining == 0 && more_words) \ ++ { \ ++ data_offset += 4; \ ++ if (!arm_section_get_word (aux, data_arm_sec, data_sec, \ ++ data_offset, &word, &addr)) \ ++ return; \ ++ remaining = 4; \ ++ more_words--; \ ++ } \ ++ ++#define GET_OP(OP) \ ++ ADVANCE; \ ++ if (remaining) \ ++ { \ ++ remaining--; \ ++ (OP) = word >> 24; \ ++ word <<= 8; \ ++ } \ ++ else \ ++ { \ ++ printf ("[Truncated opcode]\n"); \ ++ return; \ ++ } \ ++ printf (_("0x%02x "), OP) ++ ++ if (remaining == 0) ++ { ++ /* Fetch the first word. */ ++ if (!arm_section_get_word (aux, data_arm_sec, data_sec, data_offset, ++ &word, &addr)) ++ return; ++ remaining = 4; ++ } ++ ++ if ((word & 0x80000000) == 0) ++ { ++ /* Expand prel31 for personality routine. */ ++ bfd_vma fn; ++ const char *procname; ++ ++ fn = word; ++ if (fn & 0x40000000) ++ fn |= ~ (bfd_vma) 0x7fffffff; ++ fn = fn + data_sec->sh_addr + data_offset; ++ ++ printf (_(" Personality routine: ")); ++ procname = arm_print_vma_and_name (aux, fn, addr); ++ fputc ('\n', stdout); ++ ++ /* The GCC personality routines use the standard compact ++ encoding, starting with one byte giving the number of ++ words. */ ++ if (procname != NULL ++ && (const_strneq (procname, "__gcc_personality_v0") ++ || const_strneq (procname, "__gxx_personality_v0") ++ || const_strneq (procname, "__gcj_personality_v0") ++ || const_strneq (procname, "__gnu_objc_personality_v0"))) ++ { ++ remaining = 0; ++ more_words = 1; ++ ADVANCE; ++ if (!remaining) ++ { ++ printf (_(" [Truncated data]\n")); ++ return; ++ } ++ more_words = word >> 24; ++ word <<= 8; ++ remaining--; ++ } ++ else ++ return; ++ } ++ else ++ { ++ ++ per_index = (word >> 24) & 0x7f; ++ if (per_index != 0 && per_index != 1 && per_index != 2) ++ { ++ printf (_(" [reserved compact index %d]\n"), per_index); ++ return; ++ } ++ ++ printf (_(" Compact model %d\n"), per_index); ++ if (per_index == 0) ++ { ++ more_words = 0; ++ word <<= 8; ++ remaining--; ++ } ++ else ++ { ++ more_words = (word >> 16) & 0xff; ++ word <<= 16; ++ remaining -= 2; ++ } ++ } ++ ++ /* Decode the unwinding instructions. */ ++ while (1) ++ { ++ unsigned int op, op2; ++ ++ ADVANCE; ++ if (remaining == 0) ++ break; ++ remaining--; ++ op = word >> 24; ++ word <<= 8; ++ ++ printf (_(" 0x%02x "), op); ++ ++ if ((op & 0xc0) == 0x00) ++ { ++ int offset = ((op & 0x3f) << 2) + 4; ++ printf (_(" vsp = vsp + %d"), offset); ++ } ++ else if ((op & 0xc0) == 0x40) ++ { ++ int offset = ((op & 0x3f) << 2) + 4; ++ printf (_(" vsp = vsp - %d"), offset); ++ } ++ else if ((op & 0xf0) == 0x80) ++ { ++ GET_OP (op2); ++ if (op == 0x80 && op2 == 0) ++ printf (_("Refuse to unwind")); ++ else ++ { ++ unsigned int mask = ((op & 0x0f) << 8) | op2; ++ int first = 1; ++ int i; ++ printf ("pop {"); ++ for (i = 0; i < 12; i++) ++ if (mask & (1 << i)) ++ { ++ if (first) ++ first = 0; ++ else ++ printf (", "); ++ printf ("r%d", 4 + i); ++ } ++ printf ("}"); ++ } ++ } ++ else if ((op & 0xf0) == 0x90) ++ { ++ if (op == 0x9d || op == 0x9f) ++ printf (_(" [Reserved]")); ++ else ++ printf (_(" vsp = r%d"), op & 0x0f); ++ } ++ else if ((op & 0xf0) == 0xa0) ++ { ++ int end = 4 + (op & 0x07); ++ int first = 1; ++ int i; ++ printf (" pop {"); ++ for (i = 4; i <= end; i++) ++ { ++ if (first) ++ first = 0; ++ else ++ printf (", "); ++ printf ("r%d", i); ++ } ++ if (op & 0x08) ++ { ++ if (first) ++ printf (", "); ++ printf ("r14"); ++ } ++ printf ("}"); ++ } ++ else if (op == 0xb0) ++ printf (_(" finish")); ++ else if (op == 0xb1) ++ { ++ GET_OP (op2); ++ if (op2 == 0 || (op2 & 0xf0) != 0) ++ printf (_("[Spare]")); ++ else ++ { ++ unsigned int mask = op2 & 0x0f; ++ int first = 1; ++ int i; ++ printf ("pop {"); ++ for (i = 0; i < 12; i++) ++ if (mask & (1 << i)) ++ { ++ if (first) ++ first = 0; ++ else ++ printf (", "); ++ printf ("r%d", i); ++ } ++ printf ("}"); ++ } ++ } ++ else if (op == 0xb2) ++ { ++ unsigned char buf[5]; ++ unsigned int i, len; ++ unsigned long offset; ++ for (i = 0; i < 9; i++) ++ { ++ GET_OP (buf[i]); ++ if ((buf[i] & 0x80) == 0) ++ break; ++ } ++ assert (i < sizeof (buf)); ++ offset = read_uleb128 (buf, &len); ++ assert (len == i + 1); ++ offset = offset * 4 + 0x204; ++ printf (_("vsp = vsp + %ld"), offset); ++ } ++ else ++ { ++ if (op == 0xb3 || op == 0xc6 || op == 0xc7 || op == 0xc8 || op == 0xc9) ++ { ++ GET_OP (op2); ++ printf (_("[unsupported two-byte opcode]")); ++ } ++ else ++ { ++ printf (_(" [unsupported opcode]")); ++ } ++ } ++ printf ("\n"); ++ } ++ ++ /* Decode the descriptors. Not implemented. */ ++} ++ ++static void ++dump_arm_unwind (struct arm_unw_aux_info *aux, Elf_Internal_Shdr *exidx_sec) ++{ ++ struct arm_section exidx_arm_sec, extab_arm_sec; ++ unsigned int i, exidx_len; ++ ++ memset (&exidx_arm_sec, 0, sizeof (exidx_arm_sec)); ++ memset (&extab_arm_sec, 0, sizeof (extab_arm_sec)); ++ exidx_len = exidx_sec->sh_size / 8; ++ ++ for (i = 0; i < exidx_len; i++) ++ { ++ unsigned int exidx_fn, exidx_entry; ++ struct absaddr fn_addr, entry_addr; ++ bfd_vma fn; ++ ++ fputc ('\n', stdout); ++ ++ if (!arm_section_get_word (aux, &exidx_arm_sec, exidx_sec, ++ 8 * i, &exidx_fn, &fn_addr) ++ || !arm_section_get_word (aux, &exidx_arm_sec, exidx_sec, ++ 8 * i + 4, &exidx_entry, &entry_addr)) ++ { ++ arm_free_section (&exidx_arm_sec); ++ arm_free_section (&extab_arm_sec); ++ return; ++ } ++ ++ fn = exidx_fn & 0x7fffffff; ++ if (fn & 0x40000000) ++ fn |= ~ (bfd_vma) 0x7fffffff; ++ fn = fn + exidx_sec->sh_addr + 8 * i; ++ ++ arm_print_vma_and_name (aux, fn, entry_addr); ++ fputs (": ", stdout); ++ ++ if (exidx_entry == 1) ++ { ++ print_vma (exidx_entry, PREFIX_HEX); ++ fputs (" [cantunwind]\n", stdout); ++ } ++ else if (exidx_entry & 0x80000000) ++ { ++ print_vma (exidx_entry, PREFIX_HEX); ++ fputc ('\n', stdout); ++ decode_arm_unwind (aux, exidx_entry, 4, 0, NULL, NULL); ++ } ++ else ++ { ++ bfd_vma table, table_offset; ++ Elf_Internal_Shdr *table_sec; ++ ++ fputs ("@", stdout); ++ table = exidx_entry; ++ if (table & 0x40000000) ++ table |= ~ (bfd_vma) 0x7fffffff; ++ table = table + exidx_sec->sh_addr + 8 * i + 4; ++ print_vma (table, PREFIX_HEX); ++ printf ("\n"); ++ ++ /* Locate the matching .ARM.extab. */ ++ if (entry_addr.section != SHN_UNDEF ++ && entry_addr.section < elf_header.e_shnum) ++ { ++ table_sec = section_headers + entry_addr.section; ++ table_offset = entry_addr.offset; ++ } ++ else ++ { ++ table_sec = find_section_by_address (table); ++ if (table_sec != NULL) ++ table_offset = table - table_sec->sh_addr; ++ } ++ if (table_sec == NULL) ++ { ++ warn (_("Could not locate .ARM.extab section containing 0x%lx.\n"), ++ (unsigned long) table); ++ continue; ++ } ++ decode_arm_unwind (aux, 0, 0, table_offset, table_sec, ++ &extab_arm_sec); ++ } ++ } ++ ++ printf ("\n"); ++ ++ arm_free_section (&exidx_arm_sec); ++ arm_free_section (&extab_arm_sec); ++} ++ ++static int ++arm_process_unwind (FILE *file) ++{ ++ struct arm_unw_aux_info aux; ++ Elf_Internal_Shdr *unwsec = NULL; ++ Elf_Internal_Shdr *strsec; ++ Elf_Internal_Shdr *sec; ++ unsigned long i; ++ ++ memset (& aux, 0, sizeof (aux)); ++ aux.file = file; ++ ++ if (string_table == NULL) ++ return 1; ++ ++ for (i = 0, sec = section_headers; i < elf_header.e_shnum; ++i, ++sec) ++ { ++ if (sec->sh_type == SHT_SYMTAB && sec->sh_link < elf_header.e_shnum) ++ { ++ aux.nsyms = sec->sh_size / sec->sh_entsize; ++ aux.symtab = GET_ELF_SYMBOLS (file, sec); ++ ++ strsec = section_headers + sec->sh_link; ++ aux.strtab = get_data (NULL, file, strsec->sh_offset, ++ 1, strsec->sh_size, _("string table")); ++ aux.strtab_size = aux.strtab != NULL ? strsec->sh_size : 0; ++ } ++ else if (sec->sh_type == SHT_ARM_EXIDX) ++ unwsec = sec; ++ } ++ ++ if (!unwsec) ++ printf (_("\nThere are no unwind sections in this file.\n")); ++ ++ for (i = 0, sec = section_headers; i < elf_header.e_shnum; ++i, ++sec) ++ { ++ if (sec->sh_type == SHT_ARM_EXIDX) ++ { ++ printf (_("\nUnwind table index '%s' at offset 0x%lx contains %lu entries:\n"), ++ SECTION_NAME (sec), ++ (unsigned long) sec->sh_offset, ++ (unsigned long) (sec->sh_size / (2 * eh_addr_size))); ++ ++ dump_arm_unwind (&aux, sec); ++ } ++ } ++ ++ if (aux.symtab) ++ free (aux.symtab); ++ if (aux.strtab) ++ free ((char *) aux.strtab); ++ ++ return 1; ++} ++ + static int + process_unwind (FILE * file) + { +@@ -5770,6 +6381,7 @@ process_unwind (FILE * file) + int (* handler)(FILE *); + } handlers[] = + { ++ { EM_ARM, arm_process_unwind }, + { EM_IA_64, ia64_process_unwind }, + { EM_PARISC, hppa_process_unwind }, + { 0, 0 } +@@ -9177,33 +9789,6 @@ static arm_attr_public_tag arm_attr_publ + }; + #undef LOOKUP + +-/* Read an unsigned LEB128 encoded value from p. Set *PLEN to the number of +- bytes read. */ +- +-static unsigned int +-read_uleb128 (unsigned char * p, unsigned int * plen) +-{ +- unsigned char c; +- unsigned int val; +- int shift; +- int len; +- +- val = 0; +- shift = 0; +- len = 0; +- do +- { +- c = *(p++); +- len++; +- val |= ((unsigned int)c & 0x7f) << shift; +- shift += 7; +- } +- while (c & 0x80); +- +- *plen = len; +- return val; +-} +- + static unsigned char * + display_arm_attribute (unsigned char * p) + { --- binutils-2.20.1.orig/debian/patches/130_gold_disable_testsuite_build.dpatch +++ binutils-2.20.1/debian/patches/130_gold_disable_testsuite_build.dpatch @@ -0,0 +1,48 @@ +#!/bin/sh -e +## 130_gold_disable_testsuite_build.dpatch +## +## DP: Description: Disable build of gold/testsuite +## DP: Author: Matthias Klose +## DP: Upstream status: local + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- ./gold/Makefile.am~ 2009-10-06 14:35:04.000000000 +0000 ++++ ./gold/Makefile.am 2009-08-24 05:55:55.000000000 +0000 +@@ -2,7 +2,7 @@ + + AUTOMAKE_OPTIONS = foreign + +-SUBDIRS = po testsuite ++SUBDIRS = po + + tooldir = $(exec_prefix)/$(target_alias) + +--- ./gold/Makefile.in~ 2009-10-06 14:35:19.000000000 +0000 ++++ ./gold/Makefile.in 2009-08-24 05:55:55.000000000 +0000 +@@ -327,7 +327,7 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign +-SUBDIRS = po testsuite ++SUBDIRS = po + tooldir = $(exec_prefix)/$(target_alias) + ACLOCAL_AMFLAGS = -I ../bfd -I ../config + AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) --- binutils-2.20.1.orig/debian/patches/003_gprof_see_also_monitor.dpatch +++ binutils-2.20.1/debian/patches/003_gprof_see_also_monitor.dpatch @@ -0,0 +1,37 @@ +#!/bin/sh -e +## 014_gprof_manpage_fix.dpatch by Chris Chimelis +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Don't mention monitor(3) which doesn't exist in Debian. (#160654) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/gprof/gprof.texi binutils-2.14.90.0.6/gprof/gprof.texi +--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/gprof/gprof.texi 2002-08-02 01:49:32.000000000 +0100 ++++ binutils-2.14.90.0.6/gprof/gprof.texi 2003-09-10 22:42:37.000000000 +0100 +@@ -181,7 +181,7 @@ + @c man end + + @c man begin SEEALSO +-monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}. ++cc(1), prof(1), and the Info entry for @file{gprof}. + + ``An Execution Profiler for Modular Programs'', + by S. Graham, P. Kessler, M. McKusick; --- binutils-2.20.1.orig/debian/patches/206-hjl-binutils-shr.dpatch +++ binutils-2.20.1/debian/patches/206-hjl-binutils-shr.dpatch @@ -0,0 +1,1216 @@ +#!/bin/sh -e +## 206-hjl-binutils-shr.dpatch +## +## DP: Description: implementation of ELF sharable section proposal +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.18.50.0.10 +## DP: Original patch: binutils-shr-89.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +http://groups.google.com/group/generic-abi/browse_thread/thread/f7b3e06417ead85a +http://groups.google.com/group/generic-abi/browse_thread/thread/bca08f6560f61b0d + +bfd/ + +2007-01-23 H.J. Lu + + * elf-bfd.h (_bfd_elf_sharable_com_section): New. + (_bfd_elf_add_sharable_symbol): Likewise. + (_bfd_elf_sharable_section_from_bfd_section): Likewise. + (_bfd_elf_sharable_symbol_processing): Likewise. + (_bfd_elf_sharable_common_definition): Likewise. + (_bfd_elf_sharable_common_section_index): Likewise. + (_bfd_elf_sharable_common_section): Likewise. + (_bfd_elf_sharable_merge_symbol): Likewise. + + * elf.c (special_sections_g): Add ".gnu.linkonce.shrb" and + ".gnu.linkonce.shrd". + (special_sections_s): Add ".sharable_bss" and ".sharable_data". + (get_program_header_size): Handle PT_GNU_SHR segment. + (_bfd_elf_map_sections_to_segments): Likewise. + (assign_file_positions_for_load_sections): Likewise. + + * elf32-i386.c (elf_i386_link_hash_table): Add sdynsharablebss + and srelsharablebss fields. + (elf_i386_link_hash_table_create): Initialize sdynsharablebss + and srelsharablebss. + (elf_i386_create_dynamic_sections): Handle sdynsharablebss and + srelsharablebss. + (elf_i386_adjust_dynamic_symbol): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + (elf_backend_add_symbol_hook): Defined. + (elf_backend_section_from_bfd_section): Likewise. + (elf_backend_symbol_processing): Likewise. + (elf_backend_common_section_index): Likewise. + (elf_backend_common_section): Likewise. + (elf_backend_common_definition): Likewise. + (elf_backend_merge_symbol): Likewise. + + * elf64-x86-64.c (elf64_x86_64_link_hash_table): Add + sdynsharablebss and srelsharablebss fields. + (elf64_x86_64_link_hash_table_create): Initialize sdynsharablebss + and srelsharablebss. + (elf64_x86_64_create_dynamic_sections): Handle sdynsharablebss + and srelsharablebss. + (elf64_x86_64_adjust_dynamic_symbol): Likewise. + (elf64_x86_64_size_dynamic_sections): Likewise. + (elf64_x86_64_finish_dynamic_symbol): Likewise. + (elf64_x86_64_add_symbol_hook): Handle sharable symbols. + (elf64_x86_64_elf_section_from_bfd_section): Likewise. + (elf64_x86_64_symbol_processing): Likewise. + (elf64_x86_64_merge_symbol): Likewise. + (elf64_x86_64_common_definition): Handle sharable sections. + (elf64_x86_64_common_section_index): Likewise. + (elf64_x86_64_common_section): Likewise. + + * elflink.c (_bfd_elf_create_dynamic_sections): Handle + .dynsharablebss section. + (_bfd_elf_sharable_com_section): New. + (get_sharable_common_section): Likewise. + (_bfd_elf_add_sharable_symbol): Likewise. + (_bfd_elf_sharable_section_from_bfd_section): Likewise. + (_bfd_elf_sharable_symbol_processing): Likewise. + (_bfd_elf_sharable_common_definition): Likewise. + (_bfd_elf_sharable_common_section_index): Likewise. + (_bfd_elf_sharable_common_section): Likewise. + (_bfd_elf_sharable_merge_symbol): Likewise. + + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Handle sharable + symbols. + (elf_backend_add_symbol_hook): Defined. + (elf_backend_section_from_bfd_section): Likewise. + (elf_backend_symbol_processing): Likewise. + (elf_backend_common_section_index): Likewise. + (elf_backend_common_section): Likewise. + (elf_backend_common_definition): Likewise. + (elf_backend_merge_symbol): Likewise. + +binutils/ + +2007-01-04 H.J. Lu + + * readelf.c (dump_relocations): Handle sharable sections. + (get_segment_type): Handle sharable segment. + (get_symbol_index_type): Handle sharable sections. + +gas/ + +2007-01-04 H.J. Lu + + * config/obj-elf.c (obj_elf_sharable_common): New. + (elf_pseudo_table): Add "sharable_common". + (obj_elf_change_section): Handle sharable sections. + +include/ + +2007-01-23 H.J. Lu + + * bfdlink.h (bfd_link_info): Add sharable_sections. + +include/elf/ + +2007-01-04 H.J. Lu + + * common.h (PT_GNU_SHR): New. + (SHF_GNU_SHARABLE): Likewise. + (SHN_GNU_SHARABLE_COMMON): Likewise. + +ld/ + +2007-01-04 H.J. Lu + + * emulparams/elf64_ia64.sh (SHARABLE_SECTIONS): Set to yes. + * emulparams/elf_i386.sh (SHARABLE_SECTIONS): Likewise. + * emulparams/elf_x86_64.sh (SHARABLE_SECTIONS): Likewise. + + * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set + link_info.sharable_sections based on $SHARABLE_SECTIONS. + (gld${EMULATION_NAME}_place_orphan): Don't allow orphaned + sharable sections. + + * ldmain.c (main): Initialize link_info.sharable_sections. + * scripttempl/elf.sc: Support sharable sections. + +@DPATCH@ +--- binutils/bfd/elf-bfd.h.shr 2007-06-02 07:39:38.000000000 -0700 ++++ binutils/bfd/elf-bfd.h 2007-06-02 07:39:38.000000000 -0700 +@@ -1856,6 +1856,28 @@ extern bfd_boolean bfd_elf_link_add_symb + (bfd *, struct bfd_link_info *); + extern bfd_boolean _bfd_elf_add_dynamic_entry + (struct bfd_link_info *, bfd_vma, bfd_vma); ++extern asection _bfd_elf_sharable_com_section; ++extern bfd_boolean _bfd_elf_add_sharable_symbol ++ (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, ++ flagword *, asection **, bfd_vma *); ++extern bfd_boolean _bfd_elf_sharable_section_from_bfd_section ++ (bfd *, asection *, int *); ++extern void _bfd_elf_sharable_symbol_processing ++ (bfd *, asymbol *); ++extern bfd_boolean _bfd_elf_sharable_common_definition ++ (Elf_Internal_Sym *); ++extern unsigned int _bfd_elf_sharable_common_section_index ++ (asection *); ++extern asection *_bfd_elf_sharable_common_section ++ (asection *); ++extern bfd_boolean _bfd_elf_sharable_merge_symbol ++ (struct bfd_link_info *, struct elf_link_hash_entry **, ++ struct elf_link_hash_entry *, Elf_Internal_Sym *, asection **, ++ bfd_vma *, unsigned int *, bfd_boolean *, bfd_boolean *, ++ bfd_boolean *, bfd_boolean *, bfd_boolean *, bfd_boolean *, ++ bfd_boolean *, bfd_boolean *, bfd *, asection **, ++ bfd_boolean *, bfd_boolean *, bfd_boolean *, bfd_boolean *, ++ bfd *, asection **); + + extern bfd_boolean bfd_elf_link_record_dynamic_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *); +--- binutils/bfd/elf.c.shr 2007-06-02 07:39:38.000000000 -0700 ++++ binutils/bfd/elf.c 2007-06-02 07:39:38.000000000 -0700 +@@ -2343,6 +2343,8 @@ static const struct bfd_elf_special_sect + { STRING_COMMA_LEN (".gnu.liblist"), 0, SHT_GNU_LIBLIST, SHF_ALLOC }, + { STRING_COMMA_LEN (".gnu.conflict"), 0, SHT_RELA, SHF_ALLOC }, + { STRING_COMMA_LEN (".gnu.hash"), 0, SHT_GNU_HASH, SHF_ALLOC }, ++ { STRING_COMMA_LEN (".gnu.linkonce.shrb"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_GNU_SHARABLE}, ++ { STRING_COMMA_LEN (".gnu.linkonce.shrd"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_GNU_SHARABLE}, + { NULL, 0, 0, 0, 0 } + }; + +@@ -2397,6 +2399,8 @@ static const struct bfd_elf_special_sect + /* See struct bfd_elf_special_section declaration for the semantics of + this special case where .prefix_length != strlen (.prefix). */ + { ".stabstr", 5, 3, SHT_STRTAB, 0 }, ++ { STRING_COMMA_LEN (".sharable_bss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_GNU_SHARABLE}, ++ { STRING_COMMA_LEN (".sharable_data"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_GNU_SHARABLE}, + { NULL, 0, 0, 0, 0 } + }; + +@@ -3694,6 +3698,32 @@ get_program_header_size (bfd *abfd, stru + } + } + ++ /* Check to see if we need a PT_GNU_SHR segment for sharable data ++ sections. */ ++ for (s = abfd->sections; s != NULL; s = s->next) ++ { ++ if ((elf_section_flags (s) & SHF_GNU_SHARABLE) != 0 ++ && elf_section_type (s) == SHT_PROGBITS) ++ { ++ /* We need a PT_GNU_SHR segment. */ ++ ++segs; ++ break; ++ } ++ } ++ ++ /* Check to see if we need a PT_GNU_SHR segment for sharable bss ++ sections. */ ++ for (s = abfd->sections; s != NULL; s = s->next) ++ { ++ if ((elf_section_flags (s) & SHF_GNU_SHARABLE) != 0 ++ && elf_section_type (s) == SHT_NOBITS) ++ { ++ /* We need a PT_GNU_SHR segment. */ ++ ++segs; ++ break; ++ } ++ } ++ + /* Let the backend count up any program headers it might need. */ + bed = get_elf_backend_data (abfd); + if (bed->elf_backend_additional_program_headers) +@@ -3834,6 +3864,8 @@ _bfd_elf_map_sections_to_segments (bfd * + bfd_boolean phdr_in_segment = TRUE; + bfd_boolean writable; + int tls_count = 0; ++ int sharable_data_count = 0, sharable_bss_count = 0; ++ asection *first_sharable_data = NULL, *first_sharable_bss = NULL; + asection *first_tls = NULL; + asection *dynsec, *eh_frame_hdr; + bfd_size_type amt; +@@ -4083,6 +4115,22 @@ _bfd_elf_map_sections_to_segments (bfd * + first_tls = s; + tls_count++; + } ++ if (elf_section_flags (s) & SHF_GNU_SHARABLE) ++ { ++ if (elf_section_type (s) == SHT_PROGBITS) ++ { ++ if (! sharable_data_count) ++ first_sharable_data = s; ++ sharable_data_count++; ++ } ++ else ++ { ++ BFD_ASSERT (elf_section_type (s) == SHT_NOBITS); ++ if (! sharable_bss_count) ++ first_sharable_bss = s; ++ sharable_bss_count++; ++ } ++ } + } + + /* If there are any SHF_TLS output sections, add PT_TLS segment. */ +@@ -4112,6 +4160,60 @@ _bfd_elf_map_sections_to_segments (bfd * + pm = &m->next; + } + ++ /* If there are any output SHF_GNU_SHARABLE data sections, add a ++ PT_GNU_SHR segment. */ ++ if (sharable_data_count > 0) ++ { ++ int i; ++ ++ amt = sizeof (struct elf_segment_map); ++ amt += (sharable_data_count - 1) * sizeof (asection *); ++ m = bfd_zalloc (abfd, amt); ++ if (m == NULL) ++ goto error_return; ++ m->next = NULL; ++ m->p_type = PT_GNU_SHR; ++ m->count = sharable_data_count; ++ /* Mandated PF_R. */ ++ m->p_flags = PF_R; ++ m->p_flags_valid = 1; ++ for (i = 0; i < sharable_data_count; ++i) ++ { ++ m->sections[i] = first_sharable_data; ++ first_sharable_data = first_sharable_data->next; ++ } ++ ++ *pm = m; ++ pm = &m->next; ++ } ++ ++ /* If there are any output SHF_GNU_SHARABLE bss sections, add a ++ PT_GNU_SHR segment. */ ++ if (sharable_bss_count > 0) ++ { ++ int i; ++ ++ amt = sizeof (struct elf_segment_map); ++ amt += (sharable_bss_count - 1) * sizeof (asection *); ++ m = bfd_zalloc (abfd, amt); ++ if (m == NULL) ++ goto error_return; ++ m->next = NULL; ++ m->p_type = PT_GNU_SHR; ++ m->count = sharable_bss_count; ++ /* Mandated PF_R. */ ++ m->p_flags = PF_R; ++ m->p_flags_valid = 1; ++ for (i = 0; i < sharable_bss_count; ++i) ++ { ++ m->sections[i] = first_sharable_bss; ++ first_sharable_bss = first_sharable_bss->next; ++ } ++ ++ *pm = m; ++ pm = &m->next; ++ } ++ + /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME + segment. */ + eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; +@@ -4531,6 +4633,7 @@ assign_file_positions_for_load_sections + align = (bfd_size_type) 1 << bfd_get_section_alignment (abfd, sec); + + if (p->p_type == PT_LOAD ++ || p->p_type == PT_GNU_SHR + || p->p_type == PT_TLS) + { + bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_memsz); +--- binutils/bfd/elf32-i386.c.shr 2007-05-15 07:35:03.000000000 -0700 ++++ binutils/bfd/elf32-i386.c 2007-06-02 07:39:38.000000000 -0700 +@@ -660,6 +660,8 @@ struct elf_i386_link_hash_table + asection *srelplt; + asection *sdynbss; + asection *srelbss; ++ asection *sdynsharablebss; ++ asection *srelsharablebss; + + /* The (unloaded but important) .rel.plt.unloaded section on VxWorks. */ + asection *srelplt2; +@@ -752,6 +754,8 @@ elf_i386_link_hash_table_create (bfd *ab + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; ++ ret->sdynsharablebss = NULL; ++ ret->srelsharablebss = NULL; + ret->tls_ldm_got.refcount = 0; + ret->next_tls_desc_index = 0; + ret->sgotplt_jump_table_size = 0; +@@ -812,10 +816,19 @@ elf_i386_create_dynamic_sections (bfd *d + htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt"); + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + if (!info->shared) +- htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss"); ++ { ++ htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss"); ++ htab->sdynsharablebss ++ = bfd_get_section_by_name (dynobj, ".dynsharablebss"); ++ htab->srelsharablebss ++ = bfd_get_section_by_name (dynobj, ".rel.sharable_bss"); ++ } + + if (!htab->splt || !htab->srelplt || !htab->sdynbss +- || (!info->shared && !htab->srelbss)) ++ || (!info->shared ++ && (!htab->srelbss ++ || !htab->sdynsharablebss ++ || !htab->srelsharablebss))) + abort (); + + if (htab->is_vxworks +@@ -1529,17 +1542,23 @@ elf_i386_adjust_dynamic_symbol (struct b + both the dynamic object and the regular object will refer to the + same memory location for the variable. */ + ++ s = htab->sdynbss; ++ + /* We must generate a R_386_COPY reloc to tell the dynamic linker to + copy the initial value out of the dynamic object and into the + runtime process image. */ + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) + { +- htab->srelbss->size += sizeof (Elf32_External_Rel); ++ if (elf_section_flags (h->root.u.def.section) & SHF_GNU_SHARABLE) ++ { ++ htab->srelsharablebss->size += sizeof (Elf32_External_Rel); ++ s = htab->sdynsharablebss; ++ } ++ else ++ htab->srelbss->size += sizeof (Elf32_External_Rel); + h->needs_copy = 1; + } + +- s = htab->sdynbss; +- + return _bfd_elf_adjust_dynamic_copy (h, s); + } + +@@ -1993,7 +2012,8 @@ elf_i386_size_dynamic_sections (bfd *out + if (s == htab->splt + || s == htab->sgot + || s == htab->sgotplt +- || s == htab->sdynbss) ++ || s == htab->sdynbss ++ || s == htab->sdynsharablebss) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -3531,21 +3551,27 @@ elf_i386_finish_dynamic_symbol (bfd *out + { + Elf_Internal_Rela rel; + bfd_byte *loc; ++ asection *s; ++ ++ if (h->root.u.def.section == htab->sdynsharablebss) ++ s = htab->srelsharablebss; ++ else ++ s = htab->srelbss; + + /* This symbol needs a copy reloc. Set it up. */ + + if (h->dynindx == -1 + || (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) +- || htab->srelbss == NULL) ++ || s == NULL) + abort (); + + rel.r_offset = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + rel.r_info = ELF32_R_INFO (h->dynindx, R_386_COPY); +- loc = htab->srelbss->contents; +- loc += htab->srelbss->reloc_count++ * sizeof (Elf32_External_Rel); ++ loc = s->contents; ++ loc += s->reloc_count++ * sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); + } + +@@ -3833,6 +3859,21 @@ elf_i386_hash_symbol (struct elf_link_ha + #define elf_backend_plt_sym_val elf_i386_plt_sym_val + #define elf_backend_hash_symbol elf_i386_hash_symbol + ++#define elf_backend_add_symbol_hook \ ++ _bfd_elf_add_sharable_symbol ++#define elf_backend_section_from_bfd_section \ ++ _bfd_elf_sharable_section_from_bfd_section ++#define elf_backend_symbol_processing \ ++ _bfd_elf_sharable_symbol_processing ++#define elf_backend_common_section_index \ ++ _bfd_elf_sharable_common_section_index ++#define elf_backend_common_section \ ++ _bfd_elf_sharable_common_section ++#define elf_backend_common_definition \ ++ _bfd_elf_sharable_common_definition ++#define elf_backend_merge_symbol \ ++ _bfd_elf_sharable_merge_symbol ++ + #include "elf32-target.h" + + /* FreeBSD support. */ +--- binutils/bfd/elf64-x86-64.c.shr 2007-05-15 07:35:03.000000000 -0700 ++++ binutils/bfd/elf64-x86-64.c 2007-06-02 07:39:38.000000000 -0700 +@@ -469,6 +469,8 @@ struct elf64_x86_64_link_hash_table + asection *srelplt; + asection *sdynbss; + asection *srelbss; ++ asection *sdynsharablebss; ++ asection *srelsharablebss; + + /* The offset into splt of the PLT entry for the TLS descriptor + resolver. Special values are 0, if not necessary (or not found +@@ -556,6 +558,8 @@ elf64_x86_64_link_hash_table_create (bfd + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; ++ ret->sdynsharablebss = NULL; ++ ret->srelsharablebss = NULL; + ret->sym_sec.abfd = NULL; + ret->tlsdesc_plt = 0; + ret->tlsdesc_got = 0; +@@ -614,10 +618,19 @@ elf64_x86_64_create_dynamic_sections (bf + htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + if (!info->shared) +- htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); ++ { ++ htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); ++ htab->sdynsharablebss ++ = bfd_get_section_by_name (dynobj, ".dynsharablebss"); ++ htab->srelsharablebss ++ = bfd_get_section_by_name (dynobj, ".rela.sharable_bss"); ++ } + + if (!htab->splt || !htab->srelplt || !htab->sdynbss +- || (!info->shared && !htab->srelbss)) ++ || (!info->shared ++ && (!htab->srelbss ++ || !htab->sdynsharablebss ++ || !htab->srelsharablebss))) + abort (); + + return TRUE; +@@ -1395,17 +1408,23 @@ elf64_x86_64_adjust_dynamic_symbol (stru + + htab = elf64_x86_64_hash_table (info); + ++ s = htab->sdynbss; ++ + /* We must generate a R_X86_64_COPY reloc to tell the dynamic linker + to copy the initial value out of the dynamic object and into the + runtime process image. */ + if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) + { +- htab->srelbss->size += sizeof (Elf64_External_Rela); ++ if (elf_section_flags (h->root.u.def.section) & SHF_GNU_SHARABLE) ++ { ++ htab->srelsharablebss->size += sizeof (Elf64_External_Rela); ++ s = htab->sdynsharablebss; ++ } ++ else ++ htab->srelbss->size += sizeof (Elf64_External_Rela); + h->needs_copy = 1; + } + +- s = htab->sdynbss; +- + return _bfd_elf_adjust_dynamic_copy (h, s); + } + +@@ -1853,7 +1872,8 @@ elf64_x86_64_size_dynamic_sections (bfd + if (s == htab->splt + || s == htab->sgot + || s == htab->sgotplt +- || s == htab->sdynbss) ++ || s == htab->sdynbss ++ || s == htab->sdynsharablebss) + { + /* Strip this section if we don't need it; see the + comment below. */ +@@ -3192,13 +3212,19 @@ elf64_x86_64_finish_dynamic_symbol (bfd + { + Elf_Internal_Rela rela; + bfd_byte *loc; ++ asection *s; ++ ++ if (h->root.u.def.section == htab->sdynsharablebss) ++ s = htab->srelsharablebss; ++ else ++ s = htab->srelbss; + + /* This symbol needs a copy reloc. Set it up. */ + + if (h->dynindx == -1 + || (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) +- || htab->srelbss == NULL) ++ || s == NULL) + abort (); + + rela.r_offset = (h->root.u.def.value +@@ -3206,8 +3232,8 @@ elf64_x86_64_finish_dynamic_symbol (bfd + + h->root.u.def.section->output_offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_COPY); + rela.r_addend = 0; +- loc = htab->srelbss->contents; +- loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela); ++ loc = s->contents; ++ loc += s->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); + } + +@@ -3471,9 +3497,12 @@ elf64_x86_64_add_symbol_hook (bfd *abfd, + } + *secp = lcomm; + *valp = sym->st_size; ++ return TRUE; + break; + } +- return TRUE; ++ ++ return _bfd_elf_add_sharable_symbol (abfd, info, sym, namep, flagsp, ++ secp, valp); + } + + +@@ -3489,7 +3518,7 @@ elf64_x86_64_elf_section_from_bfd_sectio + *index = SHN_X86_64_LCOMMON; + return TRUE; + } +- return FALSE; ++ return _bfd_elf_sharable_section_from_bfd_section (abfd, sec, index); + } + + /* Process a symbol. */ +@@ -3507,22 +3536,26 @@ elf64_x86_64_symbol_processing (bfd *abf + asym->value = elfsym->internal_elf_sym.st_size; + /* Common symbol doesn't set BSF_GLOBAL. */ + asym->flags &= ~BSF_GLOBAL; ++ return; + break; + } ++ ++ _bfd_elf_sharable_symbol_processing (abfd, asym); + } + + static bfd_boolean + elf64_x86_64_common_definition (Elf_Internal_Sym *sym) + { + return (sym->st_shndx == SHN_COMMON +- || sym->st_shndx == SHN_X86_64_LCOMMON); ++ || sym->st_shndx == SHN_X86_64_LCOMMON ++ || _bfd_elf_sharable_common_definition (sym)); + } + + static unsigned int + elf64_x86_64_common_section_index (asection *sec) + { + if ((elf_section_flags (sec) & SHF_X86_64_LARGE) == 0) +- return SHN_COMMON; ++ return _bfd_elf_sharable_common_section_index (sec); + else + return SHN_X86_64_LCOMMON; + } +@@ -3531,7 +3564,7 @@ static asection * + elf64_x86_64_common_section (asection *sec) + { + if ((elf_section_flags (sec) & SHF_X86_64_LARGE) == 0) +- return bfd_com_section_ptr; ++ return _bfd_elf_sharable_common_section (sec); + else + return &_bfd_elf_large_com_section; + } +@@ -3568,7 +3601,8 @@ elf64_x86_64_merge_symbol (struct bfd_li + && h->root.type == bfd_link_hash_common + && !*newdyn + && bfd_is_com_section (*sec) +- && *oldsec != *sec) ++ && *oldsec != *sec ++ && _bfd_elf_sharable_common_section_index (*oldsec) == SHN_COMMON) + { + if (sym->st_shndx == SHN_COMMON + && (elf_section_flags (*oldsec) & SHF_X86_64_LARGE) != 0) +@@ -3576,13 +3610,26 @@ elf64_x86_64_merge_symbol (struct bfd_li + h->root.u.c.p->section + = bfd_make_section_old_way (oldbfd, "COMMON"); + h->root.u.c.p->section->flags = SEC_ALLOC; ++ return TRUE; + } + else if (sym->st_shndx == SHN_X86_64_LCOMMON + && (elf_section_flags (*oldsec) & SHF_X86_64_LARGE) == 0) +- *psec = *sec = bfd_com_section_ptr; ++ { ++ *psec = *sec = bfd_com_section_ptr; ++ return TRUE; ++ } + } + +- return TRUE; ++ return _bfd_elf_sharable_merge_symbol (info, sym_hash, h, sym, ++ psec, pvalue, pold_alignment, ++ skip, override, ++ type_change_ok, size_change_ok, ++ newdyn, newdef, ++ newdyncommon, newweak, ++ abfd, sec, ++ olddyn, olddef, ++ olddyncommon, oldweak, ++ oldbfd, oldsec); + } + + static int +--- binutils/bfd/elflink.c.shr 2007-06-02 07:39:38.000000000 -0700 ++++ binutils/bfd/elflink.c 2007-06-02 07:39:38.000000000 -0700 +@@ -352,6 +352,27 @@ _bfd_elf_create_dynamic_sections (bfd *a + if (s == NULL + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; ++ ++ if (info->sharable_sections) ++ { ++ s = bfd_make_section (abfd, ".dynsharablebss"); ++ if (s == NULL ++ || ! bfd_set_section_flags (abfd, s, ++ (SEC_ALLOC ++ | SEC_LINKER_CREATED))) ++ return FALSE; ++ ++ s = bfd_make_section (abfd, ++ (bed->default_use_rela_p ++ ? ".rela.sharable_bss" ++ : ".rel.sharable_bss")); ++ if (s == NULL ++ || ! bfd_set_section_flags (abfd, s, ++ flags | SEC_READONLY) ++ || ! bfd_set_section_alignment (abfd, s, ++ bed->s->log_file_align)) ++ return FALSE; ++ } + } + } + +@@ -11533,3 +11554,219 @@ _bfd_elf_common_section (asection *sec A + { + return bfd_com_section_ptr; + } ++ ++asection _bfd_elf_sharable_com_section ++ = BFD_FAKE_SECTION (_bfd_elf_sharable_com_section, SEC_IS_COMMON, ++ NULL, "SHARABLE_COMMON", 0); ++ ++static asection * ++get_sharable_common_section (bfd *abfd) ++{ ++ asection *scomm = bfd_get_section_by_name (abfd, "SHARABLE_COMMON"); ++ ++ if (scomm == NULL) ++ { ++ scomm = bfd_make_section_with_flags (abfd, ++ "SHARABLE_COMMON", ++ (SEC_ALLOC ++ | SEC_IS_COMMON ++ | SEC_LINKER_CREATED)); ++ if (scomm == NULL) ++ return scomm; ++ elf_section_flags (scomm) |= SHF_GNU_SHARABLE; ++ } ++ ++ return scomm; ++} ++ ++bfd_boolean ++_bfd_elf_add_sharable_symbol (bfd *abfd ATTRIBUTE_UNUSED, ++ struct bfd_link_info *info ATTRIBUTE_UNUSED, ++ Elf_Internal_Sym *sym, ++ const char **namep ATTRIBUTE_UNUSED, ++ flagword *flagsp ATTRIBUTE_UNUSED, ++ asection **secp, ++ bfd_vma *valp) ++{ ++ asection *scomm; ++ ++ switch (sym->st_shndx) ++ { ++ case SHN_GNU_SHARABLE_COMMON: ++ scomm = get_sharable_common_section (abfd); ++ if (scomm == NULL) ++ return FALSE; ++ *secp = scomm; ++ *valp = sym->st_size; ++ break; ++ } ++ return TRUE; ++} ++ ++bfd_boolean ++_bfd_elf_sharable_section_from_bfd_section ++ (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, int *index) ++{ ++ if (sec == &_bfd_elf_sharable_com_section) ++ { ++ *index = SHN_GNU_SHARABLE_COMMON; ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++void ++_bfd_elf_sharable_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, ++ asymbol *asym) ++{ ++ elf_symbol_type *elfsym = (elf_symbol_type *) asym; ++ ++ switch (elfsym->internal_elf_sym.st_shndx) ++ { ++ case SHN_GNU_SHARABLE_COMMON: ++ asym->section = &_bfd_elf_sharable_com_section; ++ asym->value = elfsym->internal_elf_sym.st_size; ++ asym->flags &= ~BSF_GLOBAL; ++ break; ++ } ++} ++ ++bfd_boolean ++_bfd_elf_sharable_common_definition (Elf_Internal_Sym *sym) ++{ ++ return (sym->st_shndx == SHN_COMMON ++ || sym->st_shndx == SHN_GNU_SHARABLE_COMMON); ++} ++ ++unsigned int ++_bfd_elf_sharable_common_section_index (asection *sec) ++{ ++ if ((elf_section_flags (sec) & SHF_GNU_SHARABLE) == 0) ++ return SHN_COMMON; ++ else ++ return SHN_GNU_SHARABLE_COMMON; ++} ++ ++asection * ++_bfd_elf_sharable_common_section (asection *sec) ++{ ++ if ((elf_section_flags (sec) & SHF_GNU_SHARABLE) == 0) ++ return bfd_com_section_ptr; ++ else ++ return &_bfd_elf_sharable_com_section; ++} ++ ++bfd_boolean ++_bfd_elf_sharable_merge_symbol ++ (struct bfd_link_info *info ATTRIBUTE_UNUSED, ++ struct elf_link_hash_entry **sym_hash ATTRIBUTE_UNUSED, ++ struct elf_link_hash_entry *h, ++ Elf_Internal_Sym *sym ATTRIBUTE_UNUSED, ++ asection **psec, ++ bfd_vma *pvalue ATTRIBUTE_UNUSED, ++ unsigned int *pold_alignment ATTRIBUTE_UNUSED, ++ bfd_boolean *skip ATTRIBUTE_UNUSED, ++ bfd_boolean *override ATTRIBUTE_UNUSED, ++ bfd_boolean *type_change_ok ATTRIBUTE_UNUSED, ++ bfd_boolean *size_change_ok ATTRIBUTE_UNUSED, ++ bfd_boolean *newdef ATTRIBUTE_UNUSED, ++ bfd_boolean *newdyn, ++ bfd_boolean *newdyncommon ATTRIBUTE_UNUSED, ++ bfd_boolean *newweak ATTRIBUTE_UNUSED, ++ bfd *abfd, ++ asection **sec, ++ bfd_boolean *olddef ATTRIBUTE_UNUSED, ++ bfd_boolean *olddyn, ++ bfd_boolean *olddyncommon ATTRIBUTE_UNUSED, ++ bfd_boolean *oldweak ATTRIBUTE_UNUSED, ++ bfd *oldbfd, ++ asection **oldsec) ++{ ++ /* Check sharable symbol. If one is undefined, it is OK. */ ++ if (*oldsec && !bfd_is_und_section (*sec)) ++ { ++ bfd_boolean sharable, oldsharable; ++ ++ sharable = (elf_section_data (*sec) ++ && (elf_section_flags (*sec) & SHF_GNU_SHARABLE)); ++ oldsharable = (elf_section_data (*oldsec) ++ && (elf_section_flags (*oldsec) ++ & SHF_GNU_SHARABLE)); ++ ++ if (sharable != oldsharable) ++ { ++ bfd *nsbfd, *sbfd; ++ asection *nssec, *ssec; ++ bfd_boolean nsdyn, sdyn, nsdef, sdef; ++ ++ if (oldsharable) ++ { ++ sbfd = oldbfd; ++ nsbfd = abfd; ++ ssec = *oldsec; ++ nssec = *sec; ++ sdyn = *olddyn; ++ nsdyn = *newdyn; ++ sdef = *olddef; ++ nsdef = *newdef; ++ } ++ else ++ { ++ sbfd = abfd; ++ nsbfd = oldbfd; ++ ssec = *sec; ++ nssec = *oldsec; ++ sdyn = *newdyn; ++ nsdyn = *olddyn; ++ sdef = *newdef; ++ nsdef = *olddef; ++ } ++ ++ if (sdef && !sdyn) ++ { ++ /* If the sharable definition comes from a relocatable ++ file, it will override the non-sharable one in DSO. */ ++ return TRUE; ++ } ++ else if (!nsdef ++ && !nsdyn ++ && (h->root.type == bfd_link_hash_common ++ || bfd_is_com_section (nssec))) ++ { ++ asection *scomm; ++ ++ /* When the non-sharable common symbol in a relocatable ++ file, we can turn it into sharable. If the sharable ++ symbol isn't common, the non-sharable common symbol ++ will be overidden. We only need to handle the ++ sharable common symbol and the non-sharable common ++ symbol. We just turn the non-sharable common symbol ++ into the sharable one. */ ++ if (sym->st_shndx == SHN_GNU_SHARABLE_COMMON) ++ { ++ scomm = get_sharable_common_section (oldbfd); ++ if (scomm == NULL) ++ return FALSE; ++ h->root.u.c.p->section = scomm; ++ } ++ else ++ { ++ scomm = get_sharable_common_section (abfd); ++ if (scomm == NULL) ++ return FALSE; ++ *psec = *sec = scomm; ++ } ++ ++ return TRUE; ++ } ++ ++ (*_bfd_error_handler) ++ (_("%s: sharable symbol in %B section %A mismatches non-shrable symbol in %B section %A"), ++ sbfd, ssec, nsbfd, nssec, h->root.root.string); ++ bfd_set_error (bfd_error_bad_value); ++ return FALSE; ++ } ++ } ++ ++ return TRUE; ++} +--- binutils/bfd/elfxx-ia64.c.shr 2007-04-27 05:25:13.000000000 -0700 ++++ binutils/bfd/elfxx-ia64.c 2007-06-02 07:39:38.000000000 -0700 +@@ -1636,7 +1636,8 @@ elfNN_ia64_add_symbol_hook (abfd, info, + *valp = sym->st_size; + } + +- return TRUE; ++ return _bfd_elf_add_sharable_symbol (abfd, info, sym, namep, flagsp, ++ secp, valp); + } + + /* Return the number of additional phdrs we will need. */ +@@ -5822,6 +5823,19 @@ elfNN_hpux_backend_symbol_processing (bf + #define elf_backend_special_sections elfNN_ia64_special_sections + #define elf_backend_default_execstack 0 + ++#define elf_backend_section_from_bfd_section \ ++ _bfd_elf_sharable_section_from_bfd_section ++#define elf_backend_symbol_processing \ ++ _bfd_elf_sharable_symbol_processing ++#define elf_backend_common_section_index \ ++ _bfd_elf_sharable_common_section_index ++#define elf_backend_common_section \ ++ _bfd_elf_sharable_common_section ++#define elf_backend_common_definition \ ++ _bfd_elf_sharable_common_definition ++#define elf_backend_merge_symbol \ ++ _bfd_elf_sharable_merge_symbol ++ + /* FIXME: PR 290: The Intel C compiler generates SHT_IA_64_UNWIND with + SHF_LINK_ORDER. But it doesn't set the sh_link or sh_info fields. + We don't want to flood users with so many error messages. We turn +--- binutils/binutils/readelf.c.shr 2007-06-02 07:38:12.000000000 -0700 ++++ binutils/binutils/readelf.c 2007-06-02 07:39:38.000000000 -0700 +@@ -1262,6 +1262,8 @@ dump_relocations (FILE *file, + sec_name = "ABS"; + else if (psym->st_shndx == SHN_COMMON) + sec_name = "COMMON"; ++ else if (psym->st_shndx == SHN_GNU_SHARABLE_COMMON) ++ sec_name = "GNU_SHARABLE_COMMON"; + else if (elf_header.e_machine == EM_MIPS + && psym->st_shndx == SHN_MIPS_SCOMMON) + sec_name = "SCOMMON"; +@@ -2459,6 +2461,7 @@ get_segment_type (unsigned long p_type) + case PT_SHLIB: return "SHLIB"; + case PT_PHDR: return "PHDR"; + case PT_TLS: return "TLS"; ++ case PT_GNU_SHR: return "GNU_SHR"; + + case PT_GNU_EH_FRAME: + return "GNU_EH_FRAME"; +@@ -6966,6 +6969,8 @@ get_symbol_index_type (unsigned int type + case SHN_UNDEF: return "UND"; + case SHN_ABS: return "ABS"; + case SHN_COMMON: return "COM"; ++ case SHN_GNU_SHARABLE_COMMON: ++ return "GNU_SHARABLE_COM"; + default: + if (type == SHN_IA_64_ANSI_COMMON + && elf_header.e_machine == EM_IA_64 +--- binutils/gas/config/obj-elf.c.shr 2007-03-01 15:11:20.000000000 -0800 ++++ binutils/gas/config/obj-elf.c 2007-06-02 07:39:38.000000000 -0700 +@@ -72,6 +72,7 @@ static void obj_elf_symver (int); + static void obj_elf_subsection (int); + static void obj_elf_popsection (int); + static void obj_elf_tls_common (int); ++static void obj_elf_sharable_common (int); + static void obj_elf_lcomm (int); + static void obj_elf_struct (int); + +@@ -129,6 +130,8 @@ static const pseudo_typeS elf_pseudo_tab + + {"tls_common", obj_elf_tls_common, 0}, + ++ {"sharable_common", obj_elf_sharable_common, 0}, ++ + /* End sentinel. */ + {NULL, NULL, 0}, + }; +@@ -373,6 +376,39 @@ obj_elf_tls_common (int ignore ATTRIBUTE + } + + static void ++obj_elf_sharable_common (int ignore ATTRIBUTE_UNUSED) ++{ ++ static segT sharable_bss_section; ++ asection *saved_com_section_ptr = elf_com_section_ptr; ++ asection *saved_bss_section = bss_section; ++ ++ if (sharable_bss_section == NULL) ++ { ++ flagword applicable; ++ segT seg = now_seg; ++ subsegT subseg = now_subseg; ++ ++ /* The .sharable_bss section is for local .sharable_common ++ symbols. */ ++ sharable_bss_section = subseg_new (".sharable_bss", 0); ++ applicable = bfd_applicable_section_flags (stdoutput); ++ bfd_set_section_flags (stdoutput, sharable_bss_section, ++ applicable & SEC_ALLOC); ++ seg_info (sharable_bss_section)->bss = 1; ++ ++ subseg_set (seg, subseg); ++ } ++ ++ elf_com_section_ptr = &_bfd_elf_sharable_com_section; ++ bss_section = sharable_bss_section; ++ ++ s_comm_internal (0, elf_common_parse); ++ ++ elf_com_section_ptr = saved_com_section_ptr; ++ bss_section = saved_bss_section; ++} ++ ++static void + obj_elf_lcomm (int ignore ATTRIBUTE_UNUSED) + { + symbolS *symbolP = s_comm_internal (0, s_lcomm_internal); +@@ -586,11 +622,17 @@ obj_elf_change_section (const char *name + + .section .lbss,"aw",@progbits + ++ "@progbits" is incorrect. Also for sharable bss ++ sections, gcc, as of 2005-07-06, will emit ++ ++ .section .sharable_bss,"aw",@progbits ++ + "@progbits" is incorrect. */ + #ifdef TC_I386 + && (bed->s->arch_size != 64 + || !(ssect->attr & SHF_X86_64_LARGE)) + #endif ++ && !(ssect->attr & SHF_GNU_SHARABLE) + && ssect->type != SHT_INIT_ARRAY + && ssect->type != SHT_FINI_ARRAY + && ssect->type != SHT_PREINIT_ARRAY) +--- binutils/include/bfdlink.h.shr 2007-06-02 07:38:14.000000000 -0700 ++++ binutils/include/bfdlink.h 2007-06-02 07:39:38.000000000 -0700 +@@ -347,6 +347,9 @@ struct bfd_link_info + --dynamic-list command line options. */ + unsigned int dynamic: 1; + ++ /* TRUE if sharables sections may be created. */ ++ unsigned int sharable_sections: 1; ++ + /* What to do with unresolved symbols in an object file. + When producing executables the default is GENERATE_ERROR. + When producing shared libraries the default is IGNORE. The +--- binutils/include/elf/common.h.shr 2007-04-27 05:25:14.000000000 -0700 ++++ binutils/include/elf/common.h 2007-06-02 07:39:38.000000000 -0700 +@@ -308,6 +308,7 @@ + #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME /* Solaris uses the same value */ + #define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */ + #define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */ ++#define PT_GNU_SHR (PT_LOOS + 0x474e554) /* Sharable segment */ + + /* Program segment permissions, in program header p_flags field. */ + +@@ -379,6 +380,8 @@ + #define SHF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */ + #define SHF_MASKPROC 0xF0000000 /* Processor-specific semantics */ + ++#define SHF_GNU_SHARABLE 0x01000000 /* sharable section */ ++ + /* Values of note segment descriptor types for core files. */ + + #define NT_PRSTATUS 1 /* Contains copy of prstatus struct */ +@@ -499,6 +502,9 @@ + #define SHN_HIRESERVE 0xFFFF /* End range of reserved indices */ + #define SHN_BAD ((unsigned) -1) /* Used internally by bfd */ + ++/* Associated symbol is in common sharable */ ++#define SHN_GNU_SHARABLE_COMMON (SHN_LOOS + 10) ++ + /* The following constants control how a symbol may be accessed once it has + become part of an executable or shared library. */ + +--- binutils/ld/emulparams/elf64_ia64.sh.shr 2006-09-18 10:08:08.000000000 -0700 ++++ binutils/ld/emulparams/elf64_ia64.sh 2007-06-02 07:39:38.000000000 -0700 +@@ -37,3 +37,4 @@ OTHER_READONLY_SECTIONS="${OTHER_READONL + # .dtors. They have to be next to .sbss/.sbss2/.sdata/.sdata2. + SMALL_DATA_CTOR=" " + SMALL_DATA_DTOR=" " ++SHARABLE_SECTIONS=yes +--- binutils/ld/emulparams/elf_i386.sh.shr 2006-09-18 10:08:08.000000000 -0700 ++++ binutils/ld/emulparams/elf_i386.sh 2007-06-02 07:39:38.000000000 -0700 +@@ -12,3 +12,4 @@ GENERATE_SHLIB_SCRIPT=yes + GENERATE_PIE_SCRIPT=yes + NO_SMALL_DATA=yes + SEPARATE_GOTPLT=12 ++SHARABLE_SECTIONS=yes +--- binutils/ld/emulparams/elf_x86_64.sh.shr 2006-10-18 20:47:43.000000000 -0700 ++++ binutils/ld/emulparams/elf_x86_64.sh 2007-06-02 07:39:38.000000000 -0700 +@@ -14,6 +14,7 @@ GENERATE_PIE_SCRIPT=yes + NO_SMALL_DATA=yes + LARGE_SECTIONS=yes + SEPARATE_GOTPLT=24 ++SHARABLE_SECTIONS=yes + + if [ "x${host}" = "x${target}" ]; then + case " $EMULATION_LIBPATH " in +--- binutils/ld/emultempl/elf32.em.shr 2007-04-27 05:25:14.000000000 -0700 ++++ binutils/ld/emultempl/elf32.em 2007-06-02 07:39:38.000000000 -0700 +@@ -97,6 +97,7 @@ gld${EMULATION_NAME}_before_parse (void) + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); + config.dynamic_link = ${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`; + } + + EOF +@@ -1456,6 +1457,12 @@ gld${EMULATION_NAME}_place_orphan (asect + + secname = bfd_get_section_name (s->owner, s); + ++ /* Orphaned sharable sections won't have correct page ++ requirements. */ ++ if (elf_section_flags (s) & SHF_GNU_SHARABLE) ++ einfo ("%F%P: unable to place orphaned sharable section %A (%B)\n", ++ s, s->owner); ++ + if (! link_info.relocatable + && link_info.combreloc + && (s->flags & SEC_ALLOC)) +--- binutils/ld/ldmain.c.shr 2007-06-02 07:38:14.000000000 -0700 ++++ binutils/ld/ldmain.c 2007-06-02 07:40:46.000000000 -0700 +@@ -275,6 +275,7 @@ main (int argc, char **argv) + link_info.relax_pass = 1; + link_info.pei386_auto_import = -1; + link_info.spare_dynamic_tags = 5; ++ link_info.sharable_sections = FALSE; + + ldfile_add_arch (""); + emulation = get_emulation (argc, argv); +--- binutils/ld/scripttempl/elf.sc.shr 2007-05-03 20:14:32.000000000 -0700 ++++ binutils/ld/scripttempl/elf.sc 2007-06-02 07:39:38.000000000 -0700 +@@ -236,6 +236,40 @@ STACK=" .stack ${RELOCATING-0}${ + ${RELOCATING+_stack = .;} + *(.stack) + }" ++test "${SHARABLE_SECTIONS}" = "yes" && OTHER_READWRITE_SECTIONS=" ++ ${OTHER_READWRITE_SECTIONS} ++ /* Sharable data sections. */ ++ .sharable_data ${RELOCATING-0} : ${RELOCATING+ALIGN(${MAXPAGESIZE})} ++ { ++ ${RELOCATING+PROVIDE_HIDDEN (__sharable_data_start = .);} ++ *(.sharable_data${RELOCATING+ .sharable_data.* .gnu.linkonce.shrd.*}) ++ /* Align here to ensure that the sharable data section ends at the ++ page boundary. */ ++ ${RELOCATING+. = ALIGN(. != 0 ? ${MAXPAGESIZE} : 1);} ++ ${RELOCATING+PROVIDE_HIDDEN (__sharable_data_end = .);} ++ } ++" ++test "${SHARABLE_SECTIONS}" = "yes" && OTHER_BSS_SECTIONS=" ++ ${OTHER_BSS_SECTIONS} ++ /* Sharable bss sections */ ++ .sharable_bss ${RELOCATING-0} : ${RELOCATING+ALIGN(${MAXPAGESIZE})} ++ { ++ ${RELOCATING+PROVIDE_HIDDEN (__sharable_bss_start = .);} ++ *(.dynsharablebss) ++ *(.sharable_bss${RELOCATING+ .sharable_bss.* .gnu.linkonce.shrb.*}) ++ *(SHARABLE_COMMON) ++ /* Align here to ensure that the sharable bss section ends at the ++ page boundary. */ ++ ${RELOCATING+. = ALIGN(. != 0 ? ${MAXPAGESIZE} : 1);} ++ ${RELOCATING+PROVIDE_HIDDEN (__sharable_bss_end = .);} ++ } ++" ++test "${SHARABLE_SECTIONS}" = "yes" && REL_SHARABLE=" ++ .rel.sharable_data ${RELOCATING-0} : { *(.rel.sharable_data${RELOCATING+ .rel.sharable_data.* .rel.gnu.linkonce.shrd.*}) } ++ .rela.sharable_data ${RELOCATING-0} : { *(.rela.sharable_data${RELOCATING+ .rela.sharable_data.* .rela.gnu.linkonce.shrd.*}) } ++ .rel.sharable_bss ${RELOCATING-0} : { *(.rel.sharable_bss${RELOCATING+ .rel.sharable_bss.* .rel.gnu.linkonce.shrb.*}) } ++ .rela.sharable_bss ${RELOCATING-0} : { *(.rela.sharable_bss${RELOCATING+ .rela.sharable_bss.* .rela.gnu.linkonce.shrb.*}) } ++" + + # if this is for an embedded system, don't add SIZEOF_HEADERS. + if [ -z "$EMBEDDED" ]; then +@@ -305,6 +339,7 @@ eval $COMBRELOCCAT <&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2009-12-30 Ian Lance Taylor + + PR 10979 + * layout.cc (Layout::relaxation_loop_body): If -Ttext was used, + don't put the file header and segment headers in the text + segment. + +@DPATCH@ +=================================================================== +RCS file: /cvs/src/src/gold/layout.cc,v +retrieving revision 1.154 +retrieving revision 1.155 +diff -u -r1.154 -r1.155 +--- src/gold/layout.cc 2009/12/31 03:48:46 1.154 ++++ src/gold/layout.cc 2009/12/31 05:43:29 1.155 +@@ -1482,6 +1482,12 @@ + != General_options::OBJECT_FORMAT_ELF) + load_seg = NULL; + ++ // If the user set the address of the text segment, that may not be ++ // compatible with putting the segment headers and file headers into ++ // that segment. ++ if (parameters->options().user_set_Ttext()) ++ load_seg = NULL; ++ + gold_assert(phdr_seg == NULL + || load_seg != NULL + || this->script_options_->saw_sections_clause()); --- binutils-2.20.1.orig/debian/patches/200_elflink_%B_fixes.dpatch +++ binutils-2.20.1/debian/patches/200_elflink_%B_fixes.dpatch @@ -0,0 +1,65 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 200_elflink_%B_fixes.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Description: Fixes several msgs; needed for later elflink patches +## DP: Upstream status: submitted upstream for binutils-2_20-branch + +2010-08-07 Kirill Smelkov + + Backport from mainline: + 2009-10-12 Roland McGrath + + * elflink.c (elf_link_add_object_symbols, _bfd_elf_merge_symbol): + Fix %s that should be %B in several message formats. + +@DPATCH@ +diff --git a/bfd/elflink.c b/bfd/elflink.c +index c42c6e1..4a348de 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -1110,19 +1110,19 @@ _bfd_elf_merge_symbol (bfd *abfd, + + if (tdef && ntdef) + (*_bfd_error_handler) +- (_("%s: TLS definition in %B section %A mismatches non-TLS definition in %B section %A"), ++ (_("%B: TLS definition in %B section %A mismatches non-TLS definition in %B section %A"), + tbfd, tsec, ntbfd, ntsec, h->root.root.string); + else if (!tdef && !ntdef) + (*_bfd_error_handler) +- (_("%s: TLS reference in %B mismatches non-TLS reference in %B"), ++ (_("%B: TLS reference in %B mismatches non-TLS reference in %B"), + tbfd, ntbfd, h->root.root.string); + else if (tdef) + (*_bfd_error_handler) +- (_("%s: TLS definition in %B section %A mismatches non-TLS reference in %B"), ++ (_("%B: TLS definition in %B section %A mismatches non-TLS reference in %B"), + tbfd, tsec, ntbfd, h->root.root.string); + else + (*_bfd_error_handler) +- (_("%s: TLS reference in %B mismatches non-TLS definition in %B section %A"), ++ (_("%B: TLS reference in %B mismatches non-TLS definition in %B section %A"), + tbfd, ntbfd, ntsec, h->root.root.string); + + bfd_set_error (bfd_error_bad_value); +@@ -4437,7 +4437,7 @@ error_free_dyn: + if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) + { + (*_bfd_error_handler) +- (_("%s: invalid DSO for symbol `%s' definition"), ++ (_("%B: invalid DSO for symbol `%s' definition"), + abfd, name); + bfd_set_error (bfd_error_bad_value); + goto error_free_vers; +@@ -12495,7 +12495,7 @@ _bfd_elf_get_dynamic_reloc_section (bfd * abfd, + section does not exist it is created and attached to the DYNOBJ + bfd and stored in the SRELOC field of SEC's elf_section_data + structure. +- ++ + ALIGNMENT is the alignment for the newly created section and + IS_RELA defines whether the name should be .rela. + or .rel.. The section name is looked up in the +-- +1.7.2.1.44.g721e7 + --- binutils-2.20.1.orig/debian/patches/300-CVE-2012-3509.dpatch +++ binutils-2.20.1/debian/patches/300-CVE-2012-3509.dpatch @@ -0,0 +1,92 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 300-CVE-2012-3509.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: integer overflow in objalloc_alloc [CVE-2012-3509] + +@DPATCH@ + +From 63d6cef520317622e38fb04be409db9ee43f9807 Mon Sep 17 00:00:00 2001 +From: fw +Date: Tue, 18 Sep 2012 08:34:05 +0000 +Subject: [PATCH] PR other/54411: integer overflow in objalloc_alloc + +2012-09-18 Florian Weimer + + PR other/54411 + * objalloc.h (objalloc_alloc): Do not use fast path on wraparound. + +2012-09-18 Florian Weimer + + PR other/54411 + * objalloc.c (_objalloc_alloc): Add overflow check covering + alignment and CHUNK_HEADER_SIZE addition. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191413 138bc75d-0d04-0410-961f-82ee72b054a4 + +[Ubuntu note: patch differs from upstream commit in that the Changelog +entries have dropped to avoid patch conflicts. --sbeattie] + +CVE-2012-3509 + +--- + include/objalloc.h | 4 ++-- + libiberty/objalloc.c | 11 +++++++++-- + 2 files changed, 11 insertions(+), 4 deletions(-) + +Index: b/include/objalloc.h +=================================================================== +--- a/include/objalloc.h ++++ b/include/objalloc.h +@@ -1,5 +1,5 @@ + /* objalloc.h -- routines to allocate memory for objects +- Copyright 1997, 2001 Free Software Foundation, Inc. ++ Copyright 1997-2012 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Cygnus Solutions. + + This program is free software; you can redistribute it and/or modify it +@@ -91,7 +91,7 @@ extern void *_objalloc_alloc (struct obj + if (__len == 0) \ + __len = 1; \ + __len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \ +- (__len <= __o->current_space \ ++ (__len != 0 && __len <= __o->current_space \ + ? (__o->current_ptr += __len, \ + __o->current_space -= __len, \ + (void *) (__o->current_ptr - __len)) \ +Index: b/libiberty/objalloc.c +=================================================================== +--- a/libiberty/objalloc.c ++++ b/libiberty/objalloc.c +@@ -1,5 +1,5 @@ + /* objalloc.c -- routines to allocate memory for objects +- Copyright 1997 Free Software Foundation, Inc. ++ Copyright 1997-2012 Free Software Foundation, Inc. + Written by Ian Lance Taylor, Cygnus Solutions. + + This program is free software; you can redistribute it and/or modify it +@@ -112,8 +112,10 @@ objalloc_create (void) + /* Allocate space from an objalloc structure. */ + + PTR +-_objalloc_alloc (struct objalloc *o, unsigned long len) ++_objalloc_alloc (struct objalloc *o, unsigned long original_len) + { ++ unsigned long len = original_len; ++ + /* We avoid confusion from zero sized objects by always allocating + at least 1 byte. */ + if (len == 0) +@@ -121,6 +123,11 @@ _objalloc_alloc (struct objalloc *o, uns + + len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); + ++ /* Check for overflow in the alignment operation above and the ++ malloc argument below. */ ++ if (len + CHUNK_HEADER_SIZE < original_len) ++ return NULL; ++ + if (len <= o->current_space) + { + o->current_ptr += len; --- binutils-2.20.1.orig/debian/patches/142_arm_fix_arm_failures.dpatch +++ binutils-2.20.1/debian/patches/142_arm_fix_arm_failures.dpatch @@ -0,0 +1,178 @@ +#!/bin/sh -e +## 142_arm_fix_arm_failures.dpatch +## +## DP: Description: [arm] Fix ld-shared/shared.exp and ld-elfvsb/elfvsb.exp failures + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +Index: ld/testsuite/ld-elfvsb/elfvsb.exp +=================================================================== +RCS file: /cvs/src/src/ld/testsuite/ld-elfvsb/elfvsb.exp,v +retrieving revision 1.32 +diff -u -p -r1.32 elfvsb.exp +--- ./ld/testsuite/ld-elfvsb/elfvsb.exp 2 Sep 2009 07:25:39 -0000 1.32 ++++ ./ld/testsuite/ld-elfvsb/elfvsb.exp 5 Feb 2010 15:54:46 -0000 +@@ -60,6 +60,7 @@ if ![isnative] then {return} + + set tmpdir tmpdir + set SHCFLAG "" ++set shared_needs_pic "no" + + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + +@@ -91,6 +92,27 @@ if { [istarget rs6000*-*-aix*] || [istar + close $file + } + ++if [istarget arm*-*-linux*] { ++ # On ARM section anchors can change the symbol pre-emptability for ++ # non-PIC shared libraries, causing these tests to fail. Turn section ++ # anchors off. ++ set SHCFLAG "-fno-section-anchors" ++ ++ # On targets that have MOVW the compiler will emit relocations which ++ # the linker doesn't support when compiling -shared without -fpic. The ++ # test to find out whether we want to XFAIL the non-PIC tests requires ++ # a compile - so we pre-calculate it here. We also note that this can ++ # only affect arm*-*-*eabi targets as the old ABI doesn't support v7. ++ if [istarget arm*-*-*eabi] { ++ set file [open $tmpdir/movw-detect.c w] ++ puts $file "void foo(void) { __asm (\"movw r0, #0\"); }" ++ close $file ++ if [run_host_cmd_yesno "$CC" "$CFLAGS -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] { ++ set shared_needs_pic "yes" ++ } ++ } ++} ++ + set support_protected "no" + + if [istarget *-*-linux*] { +@@ -201,6 +223,7 @@ proc visibility_run {visibility} { + global picflag + global target_triplet + global support_protected ++ global shared_needs_pic + + if [ string match $visibility "hidden" ] { + set VSBCFLAG "-DHIDDEN_TEST" +@@ -273,6 +296,9 @@ proc visibility_run {visibility} { + if { ![istarget hppa*64*-*-linux*] } { + setup_xfail "hppa*-*-linux*" + } ++ if [ string match $shared_needs_pic "yes" ] { ++ setup_xfail "arm*-*-linux*" ++ } + + visibility_test $visibility vnp "visibility ($visibility) (non PIC)" mainnp.o sh1np.o sh2np.o elfvsb + +@@ -311,6 +337,9 @@ proc visibility_run {visibility} { + if { ![istarget hppa*64*-*-linux*] } { + setup_xfail "hppa*-*-linux*" + } ++ if [ string match $shared_needs_pic "yes" ] { ++ setup_xfail "arm*-*-linux*" ++ } + + visibility_test $visibility vnp "visibility ($visibility) (non PIC, load offset)" \ + mainnp.o sh1np.o sh2np.o elfvsb \ +@@ -377,6 +406,9 @@ proc visibility_run {visibility} { + if { ![istarget hppa*64*-*-linux*] } { + setup_xfail "hppa*-*-linux*" + } ++ if [ string match $shared_needs_pic "yes" ] { ++ setup_xfail "arm*-*-linux*" ++ } + + visibility_test $visibility vmpnp "visibility ($visibility) (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o elfvsb + } +Index: ld/testsuite/ld-shared/shared.exp +=================================================================== +RCS file: /cvs/src/src/ld/testsuite/ld-shared/shared.exp,v +retrieving revision 1.23 +diff -u -p -r1.23 shared.exp +--- ./ld/testsuite/ld-shared/shared.exp 2 Sep 2009 07:25:42 -0000 1.23 ++++ ./ld/testsuite/ld-shared/shared.exp 5 Feb 2010 15:54:47 -0000 +@@ -66,6 +66,7 @@ if { [istarget *-*-linux*aout*] \ + + set tmpdir tmpdir + set SHCFLAG "" ++set shared_needs_pic "no" + + if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } { + +@@ -97,6 +98,27 @@ if { [istarget rs6000*-*-aix*] || [istar + close $file + } + ++if [istarget arm*-*-linux*] { ++ # On ARM section anchors can change the symbol pre-emptability for ++ # non-PIC shared libraries, causing these tests to fail. Turn section ++ # anchors off. ++ set SHCFLAG "-fno-section-anchors" ++ ++ # On targets that have MOVW the compiler will emit relocations which ++ # the linker doesn't support when compiling -shared without -fpic. The ++ # test to find out whether we want to XFAIL the non-PIC tests requires ++ # a compile - so we pre-calculate it here. We also note that this can ++ # only affect arm*-*-*eabi targets as the old ABI doesn't support v7. ++ if [istarget arm*-*-*eabi] { ++ set file [open $tmpdir/movw-detect.c w] ++ puts $file "void foo(void) { __asm (\"movw r0, #0\"); }" ++ close $file ++ if [run_host_cmd_yesno "$CC" "$CFLAGS -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] { ++ set shared_needs_pic "yes" ++ } ++ } ++} ++ + # The test procedure. + proc shared_test { progname testname main sh1 sh2 dat args } { + global CC +@@ -212,6 +234,9 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ + } + setup_xfail "x86_64-*-linux*" + setup_xfail "s390x-*-linux*" ++ if [ string match $shared_needs_pic "yes" ] { ++ setup_xfail "arm*-*-linux*" ++ } + shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared + + # Test ELF shared library relocations with a non-zero load +@@ -232,6 +257,9 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG" $ + } + setup_xfail "x86_64-*-linux*" + setup_xfail "s390x-*-linux*" ++ if [ string match $shared_needs_pic "yes" ] { ++ setup_xfail "arm*-*-linux*" ++ } + shared_test shnp "shared (non PIC, load offset)" \ + mainnp.o sh1np.o sh2np.o shared \ + "-T $srcdir/$subdir/elf-offset.ld" +@@ -281,6 +309,9 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $p + } + setup_xfail "x86_64-*-linux*" + setup_xfail "s390x-*-linux*" ++ if [ string match $shared_needs_pic "yes" ] { ++ setup_xfail "arm*-*-linux*" ++ } + shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared + } + } else { --- binutils-2.20.1.orig/debian/patches/148_pr11426.dpatch +++ binutils-2.20.1/debian/patches/148_pr11426.dpatch @@ -0,0 +1,125 @@ +#!/bin/sh -e +## 148_pr11426.dpatch +## +## DP: Description: PR ld/11426 am33, arm, ia64 + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + + PR ld/11426 + * configure.host (many linux targets ): Remove edits. + (m68*-motorola-sysv ): Use here doc, not echo. + + +@DPATCH@ +Index: ld/configure.host +=================================================================== +RCS file: /cvs/src/src/ld/configure.host,v +retrieving revision 1.47 +diff -u -p -r1.47 configure.host +--- ./ld/configure.host 17 Mar 2009 05:32:59 -0000 1.47 ++++ ./ld/configure.host 25 Mar 2010 03:37:47 -0000 +@@ -85,12 +85,8 @@ case "${host}" in + # No further tweaking needed + ;; + +-am33_2.0-*-linux*) +- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` +- ;; +- + arm*-*-linux-*) +- HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"` ++ HOSTING_CRT0='-p '"$HOSTING_CRT0" + ;; + + hppa*64*-*-hpux11*) +@@ -153,10 +149,6 @@ i[3-7]86-*-mingw*) + HOSTING_LIBS='-L/mingw/lib -lmingw32 -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lmoldname -lmingwex -lmsvcrt `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' + ;; + +-ia64-*-linux-*) +- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"` +- ;; +- + mips*-sgi-irix4* | mips*-sgi-irix5*) + HOSTING_CRT0=/usr/lib/crt1.o + HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o' +@@ -167,17 +159,11 @@ mips*-sgi-irix6*) + HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors' + ;; + +-mips*-*-linux-*) +- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` +- ;; +- +-m68*-*-linux-*) +- HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"` +- ;; +- + m68*-motorola-sysv) + HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`${CC} -print-file-name=\`crt0.o ]; then echo \`${CC} -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`' +- HOSTING_LIBS=`echo "$HOSTING_LIBS" | sed -e "s,-lc,-lc881,"` ++ HOSTING_LIBS=`sed -e 's,-lc,-lc881,' <&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +Index: ld/testsuite/ld-bootstrap/bootstrap.exp +=================================================================== +RCS file: /cvs/src/src/ld/testsuite/ld-bootstrap/bootstrap.exp,v +retrieving revision 1.18 +diff -u -r1.18 bootstrap.exp +--- ./ld/testsuite/ld-bootstrap/bootstrap.exp 2 Sep 2009 07:25:38 -0000 1.18 ++++ ./ld/testsuite/ld-bootstrap/bootstrap.exp 9 Oct 2009 15:38:50 -0000 +@@ -30,6 +30,15 @@ + return + } + ++remote_exec host "$nm --help" "" "/dev/null" "plugin-support" ++set tmp [file_contents "plugin-support"] ++regexp ".*\(--plugin\).*\n" $tmp foo plugins ++if [info exists plugins] then { ++ set plugins "yes" ++} else { ++ set plugins "no" ++} ++ + # Bootstrap ld. First link the object files together using -r, in + # order to test -r. Then link the result into an executable, ld1, to + # really test -r. Use ld1 to link a fresh ld, ld2. Use ld2 to link a +@@ -61,6 +70,11 @@ + continue + } + ++ if { $flags == "--static" && $plugins == "yes" } then { ++ untested $testname ++ continue ++ } ++ + # If we only have a shared libbfd, we probably can't run the + # --static test. + if { $flags == "--static" && ! [string match "*libbfd.a*" $BFDLIB] } then { +@@ -91,6 +105,10 @@ + } + } + ++ if { $plugins == "yes" } { ++ set extralibs "$extralibs -ldl" ++ } ++ + # On Irix 5, linking with --static only works if all the files are + # compiled using -non_shared. + if {"$flags" == "--static"} { --- binutils-2.20.1.orig/debian/patches/151_arm_opt_merge_exidx_entries.dpatch +++ binutils-2.20.1/debian/patches/151_arm_opt_merge_exidx_entries.dpatch @@ -0,0 +1,201 @@ +#!/bin/sh -e +## 151_arm_opt_merge_exidx_entries.dpatch +## +## DP: Description: ARM: Add option to disable merging of adjacent exidx +## DP: Description: unwinder entries. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p0 < $0;; + -unpatch) patch $patch_opts -p0 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +Subject: Patch: ARM disable merging of adjacent exidx unwinder entries + +Merging exidx unwinder entries makes stack unwinding in gcj impossible. +This patch adds a new linker switch, --no-merge-exidx-entries, which +turns it off. I've been quite careful not to affect the anything in +elf32_arm_fix_exidx_coverage except this one thing. + +OK to apply? + +More info at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40860 + +Andrew. + + +2010-04-15 Andrew Haley + + * emultempl/armelf.em (merge_exidx_entries): New variable. + (OPTION_NO_MERGE_EXIDX_ENTRIES): New definition. + ("no-merge-exidx-entries"): New option. + * ld.texinfo (merge-exidx-entries): Document this option. + +2010-04-15 Andrew Haley + + * bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag: + merge_exidx_entries. + * bfd-in2.h: Likewise. + * elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise. Use it to + control merging of exidx entries. + +@DPATCH@ +Index: bfd/bfd-in.h +=================================================================== +RCS file: /cvs/src/src/bfd/bfd-in.h,v +retrieving revision 1.150 +diff -u -r1.150 bfd-in.h +--- bfd/bfd-in.h 26 Mar 2010 08:34:24 -0000 1.150 ++++ bfd/bfd-in.h 15 Apr 2010 17:48:44 -0000 +@@ -906,7 +906,7 @@ + + /* ARM unwind section editing support. */ + extern bfd_boolean elf32_arm_fix_exidx_coverage +- (struct bfd_section **, unsigned int, struct bfd_link_info *); ++(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); + + /* PowerPC @tls opcode transform/validate. */ + extern unsigned int _bfd_elf_ppc_at_tls_transform +Index: bfd/bfd-in2.h +=================================================================== +RCS file: /cvs/src/src/bfd/bfd-in2.h,v +retrieving revision 1.511 +diff -u -r1.511 bfd-in2.h +--- bfd/bfd-in2.h 1 Apr 2010 09:47:13 -0000 1.511 ++++ bfd/bfd-in2.h 15 Apr 2010 17:48:45 -0000 +@@ -913,7 +913,7 @@ + + /* ARM unwind section editing support. */ + extern bfd_boolean elf32_arm_fix_exidx_coverage +- (struct bfd_section **, unsigned int, struct bfd_link_info *); ++ (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); + + /* PowerPC @tls opcode transform/validate. */ + extern unsigned int _bfd_elf_ppc_at_tls_transform +Index: bfd/elf32-arm.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-arm.c,v +retrieving revision 1.231 +diff -u -r1.231 elf32-arm.c +--- bfd/elf32-arm.c 29 Mar 2010 20:42:55 -0000 1.231 ++++ bfd/elf32-arm.c 15 Apr 2010 17:48:46 -0000 +@@ -9215,6 +9215,8 @@ + 2. Duplicate entries are merged together (EXIDX_CANTUNWIND, or unwind + codes which have been inlined into the index). + ++ If MERGE_EXIDX_ENTRIES is false, duplicate entries are not merged. ++ + The edits are applied when the tables are written + (in elf32_arm_write_section). + */ +@@ -9222,7 +9224,8 @@ + bfd_boolean + elf32_arm_fix_exidx_coverage (asection **text_section_order, + unsigned int num_text_sections, +- struct bfd_link_info *info) ++ struct bfd_link_info *info, ++ bfd_boolean merge_exidx_entries) + { + bfd *inp; + unsigned int last_second_word = 0, i; +@@ -9334,7 +9337,8 @@ + /* Inlined unwinding data. Merge if equal to previous. */ + else if ((second_word & 0x80000000) != 0) + { +- if (last_second_word == second_word && last_unwind_type == 1) ++ if (merge_exidx_entries ++ && last_second_word == second_word && last_unwind_type == 1) + elide = 1; + unwind_type = 1; + last_second_word = second_word; +Index: ld/ld.texinfo +=================================================================== +RCS file: /cvs/src/src/ld/ld.texinfo,v +retrieving revision 1.258 +diff -u -r1.258 ld.texinfo +--- ld/ld.texinfo 5 Apr 2010 09:04:08 -0000 1.258 ++++ ld/ld.texinfo 15 Apr 2010 17:48:50 -0000 +@@ -5939,6 +5939,10 @@ + + The erratum only affects Thumb-2 code. Please contact ARM for further details. + ++@kindex --merge-exidx-entries ++@kindex --no-merge-exidx-entries ++The @samp{--no-merge-exidx-entries} switch disables the merging of adjacent exidx entries in debuginfo. ++ + @ifclear GENERIC + @lowersections + @end ifclear +Index: ld/emultempl/armelf.em +=================================================================== +RCS file: /cvs/src/src/ld/emultempl/armelf.em,v +retrieving revision 1.78 +diff -u -r1.78 armelf.em +--- ld/emultempl/armelf.em 5 Feb 2010 13:57:47 -0000 1.78 ++++ ld/emultempl/armelf.em 15 Apr 2010 17:48:50 -0000 +@@ -41,6 +41,7 @@ + static int no_enum_size_warning = 0; + static int no_wchar_size_warning = 0; + static int pic_veneer = 0; ++static int merge_exidx_entries = -1; + + static void + gld${EMULATION_NAME}_before_parse (void) +@@ -314,7 +315,8 @@ + + qsort (sec_list, sec_count, sizeof (asection *), &compare_output_sec_vma); + +- if (elf32_arm_fix_exidx_coverage (sec_list, sec_count, &link_info)) ++ if (elf32_arm_fix_exidx_coverage (sec_list, sec_count, &link_info, ++ merge_exidx_entries)) + need_laying_out = 1; + + free (sec_list); +@@ -526,6 +528,7 @@ + #define OPTION_NO_WCHAR_SIZE_WARNING 313 + #define OPTION_FIX_CORTEX_A8 314 + #define OPTION_NO_FIX_CORTEX_A8 315 ++#define OPTION_NO_MERGE_EXIDX_ENTRIES 316 + ' + + PARSE_AND_LIST_SHORTOPTS=p +@@ -547,6 +550,7 @@ + { "no-wchar-size-warning", no_argument, NULL, OPTION_NO_WCHAR_SIZE_WARNING}, + { "fix-cortex-a8", no_argument, NULL, OPTION_FIX_CORTEX_A8 }, + { "no-fix-cortex-a8", no_argument, NULL, OPTION_NO_FIX_CORTEX_A8 }, ++ { "no-merge-exidx-entries", no_argument, NULL, OPTION_NO_MERGE_EXIDX_ENTRIES }, + ' + + PARSE_AND_LIST_OPTIONS=' +@@ -574,6 +578,8 @@ + the linker should choose suitable defaults.\n" + )); + fprintf (file, _(" --[no-]fix-cortex-a8 Disable/enable Cortex-A8 Thumb-2 branch erratum fix\n")); ++ fprintf (file, _(" --no-merge-exidx-entries Disable merging exidx entries\n")); ++ + ' + + PARSE_AND_LIST_ARGS_CASES=' +@@ -653,6 +659,10 @@ + case OPTION_NO_FIX_CORTEX_A8: + fix_cortex_a8 = 0; + break; ++ ++ case OPTION_NO_MERGE_EXIDX_ENTRIES: ++ merge_exidx_entries = 0; ++ + ' + + # We have our own before_allocation etc. functions, but they call --- binutils-2.20.1.orig/debian/patches/203-hjl-binutils-indirect.dpatch +++ binutils-2.20.1/debian/patches/203-hjl-binutils-indirect.dpatch @@ -0,0 +1,559 @@ +#!/bin/sh -e +## 203-hjl-binutils-indirect.dpatch +## +## DP: Description: PR ld/3351; avoid linker crash on ia64 +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.19.50.0.10 +## DP: Original patch: binutils-indirect-2.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +bfd/ + +2006-10-17 H.J. Lu + + PR ld/3351 + * elflink.c (_bfd_elf_update_dynamic_flags): New. + (_bfd_elf_merge_symbol): Update both real and indirect symbol + dynamic flags. + (_bfd_elf_add_default_symbol): Make the real symbol dynamic if + the indirect symbol is defined in a shared library. + (elf_link_add_object_symbols): Likewise. If the indirect + symbol has been forced local, don't make the real symbol + dynamic. + (elf_link_check_versioned_symbol): Check indirect symbol. + (elf_link_output_extsym): Use real symbol definition when + reporting indirect symbol error. Check version info for + dynamic versioned symbol. + +ld/testsuite/ + +2006-10-17 H.J. Lu + + PR ld/3351 + * ld-elf/indirect.exp: New file. + * ld-elf/indirect1a.c: Likewise. + * ld-elf/indirect1b.c: Likewise. + * ld-elf/indirect1c.c: Likewise. + * ld-elf/indirect2.c: Likewise. + * ld-elf/indirect3.out: Likewise. + * ld-elf/indirect3a.c: Likewise. + * ld-elf/indirect3b.c: Likewise. + * ld-elf/indirect3c.c: Likewise. + * ld-elf/indirect4.out: Likewise. + * ld-elf/indirect4a.c: Likewise. + * ld-elf/indirect4b.c: Likewise. + * ld-elf/indirect4c.c: Likewise. + +@DPATCH@ +--- binutils/bfd/elflink.c.indirect 2009-01-02 08:48:16.000000000 -0800 ++++ binutils/bfd/elflink.c 2009-01-02 09:07:14.000000000 -0800 +@@ -822,6 +822,33 @@ _bfd_elf_link_renumber_dynsyms (bfd *out + return dynsymcount; + } + ++/* Mark if a symbol has a definition in a dynamic object or is ++ weak in all dynamic objects. */ ++ ++static void ++_bfd_elf_mark_dynamic_def_weak (struct elf_link_hash_entry *h, ++ asection *sec, int bind) ++{ ++ if (!h->dynamic_def) ++ { ++ if (!bfd_is_und_section (sec)) ++ 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->ref_dynamic) ++ { ++ if (bind == STB_WEAK) ++ h->dynamic_weak = 1; ++ } ++ else if (bind != STB_WEAK) ++ h->dynamic_weak = 0; ++ } ++ } ++} ++ + /* This function is called when we want to define a new symbol. It + handles the various cases which arise when we find a definition in + a dynamic object, or when there is already a definition in a +@@ -850,6 +877,7 @@ _bfd_elf_merge_symbol (bfd *abfd, + { + asection *sec, *oldsec; + struct elf_link_hash_entry *h; ++ struct elf_link_hash_entry *hi; + struct elf_link_hash_entry *flip; + int bind; + bfd *oldbfd; +@@ -888,8 +916,9 @@ _bfd_elf_merge_symbol (bfd *abfd, + if (!(*bed->relocs_compatible) (abfd->xvec, info->output_bfd->xvec)) + return TRUE; + +- /* For merging, we only care about real symbols. */ +- ++ /* For merging, we only care about real symbols. But we need to make ++ sure that indirect symbol dynamic flags are updated. */ ++ hi = h; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; +@@ -1055,23 +1084,11 @@ _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->dynamic_def) ++ if (newdyn) + { +- if (!bfd_is_und_section (sec)) +- 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->ref_dynamic) +- { +- if (bind == STB_WEAK) +- h->dynamic_weak = 1; +- } +- else if (bind != STB_WEAK) +- h->dynamic_weak = 0; +- } ++ _bfd_elf_mark_dynamic_def_weak (h, sec, bind); ++ if (h != hi) ++ _bfd_elf_mark_dynamic_def_weak (hi, sec, bind); + } + + /* If the old symbol has non-default visibility, we ignore the new +@@ -1083,6 +1100,7 @@ _bfd_elf_merge_symbol (bfd *abfd, + *skip = TRUE; + /* Make sure this symbol is dynamic. */ + h->ref_dynamic = 1; ++ hi->ref_dynamic = 1; + /* A protected symbol has external availability. Make sure it is + recorded as dynamic. + +@@ -1624,6 +1642,7 @@ _bfd_elf_add_default_symbol (bfd *abfd, + if (! dynamic) + { + if (info->shared ++ || hi->def_dynamic + || hi->ref_dynamic) + *dynsym = TRUE; + } +@@ -3807,6 +3826,7 @@ elf_link_add_object_symbols (bfd *abfd, + flagword flags; + const char *name; + struct elf_link_hash_entry *h; ++ struct elf_link_hash_entry *hi; + bfd_boolean definition; + bfd_boolean size_change_ok; + bfd_boolean type_change_ok; +@@ -4091,6 +4111,9 @@ elf_link_add_object_symbols (bfd *abfd, + goto error_free_vers; + + h = *sym_hash; ++ /* We need to make sure that indirect symbol dynamic flags are ++ updated. */ ++ hi = h; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; +@@ -4305,22 +4328,36 @@ elf_link_add_object_symbols (bfd *abfd, + h->dynamic_def = 1; + } + } +- if (! info->executable +- || h->def_dynamic +- || h->ref_dynamic) ++ ++ /* If the indirect symbol has been forced local, don't ++ make the real symbol dynamic. */ ++ if ((h == hi || !hi->forced_local) ++ && (! info->executable ++ || h->def_dynamic ++ || h->ref_dynamic)) + dynsym = TRUE; + } + else + { + if (! definition) +- h->ref_dynamic = 1; ++ { ++ h->ref_dynamic = 1; ++ hi->ref_dynamic = 1; ++ } + else +- h->def_dynamic = 1; +- if (h->def_regular +- || h->ref_regular +- || (h->u.weakdef != NULL +- && ! new_weakdef +- && h->u.weakdef->dynindx != -1)) ++ { ++ h->def_dynamic = 1; ++ hi->def_dynamic = 1; ++ } ++ ++ /* If the indirect symbol has been forced local, don't ++ make the real symbol dynamic. */ ++ if ((h == hi || !hi->forced_local) ++ && (h->def_regular ++ || h->ref_regular ++ || (h->u.weakdef != NULL ++ && ! new_weakdef ++ && h->u.weakdef->dynindx != -1))) + dynsym = TRUE; + } + +@@ -8280,6 +8317,10 @@ elf_link_check_versioned_symbol (struct + if (!is_elf_hash_table (info->hash)) + return FALSE; + ++ /* Check indirect symbol. */ ++ while (h->root.type == bfd_link_hash_indirect) ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ + switch (h->root.type) + { + default: +@@ -8488,11 +8529,17 @@ elf_link_output_extsym (struct elf_link_ + && !h->dynamic_weak + && ! elf_link_check_versioned_symbol (finfo->info, bed, h)) + { ++ struct elf_link_hash_entry *hi = h; ++ ++ /* Check indirect symbol. */ ++ while (hi->root.type == bfd_link_hash_indirect) ++ hi = (struct elf_link_hash_entry *) hi->root.u.i.link; ++ + (*_bfd_error_handler) + (_("%B: %s symbol `%s' in %B is referenced by DSO"), + finfo->output_bfd, +- h->root.u.def.section == bfd_abs_section_ptr +- ? finfo->output_bfd : h->root.u.def.section->owner, ++ hi->root.u.def.section == bfd_abs_section_ptr ++ ? finfo->output_bfd : hi->root.u.def.section->owner, + ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + ? "internal" + : ELF_ST_VISIBILITY (h->other) == STV_HIDDEN +@@ -8702,6 +8749,23 @@ elf_link_output_extsym (struct elf_link_ + { + bfd_byte *esym; + ++ /* Since there is no version information in the dynamic string, ++ if there is no version info in symbol version section, we will ++ have a run-time problem. */ ++ if (h->verinfo.verdef == NULL) ++ { ++ char *p = strrchr (h->root.root.string, ELF_VER_CHR); ++ ++ if (p && p [1] != '\0') ++ { ++ (*_bfd_error_handler) ++ (_("%B: No symbol version section for versioned symbol `%s'"), ++ finfo->output_bfd, h->root.root.string); ++ eoinfo->failed = TRUE; ++ return FALSE; ++ } ++ } ++ + sym.st_name = h->dynstr_index; + esym = finfo->dynsym_sec->contents + h->dynindx * bed->s->sizeof_sym; + if (! check_dynsym (finfo->output_bfd, &sym)) +--- binutils/ld/testsuite/ld-elf/indirect.exp.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect.exp 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,126 @@ ++# Expect script for various indirect symbol tests. ++# Copyright 2006 Free Software Foundation, Inc. ++# ++# This file 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 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. ++# ++ ++# ++# Written by H.J. Lu (hongjiu.lu@intel.com) ++# ++ ++# Exclude non-ELF targets. ++ ++if ![is_elf_format] { ++ return ++} ++ ++# Check if compiler works ++if { [which $CC] == 0 } { ++ return ++} ++ ++proc check_link_message { cmd string testname } { ++ send_log "$cmd\n" ++ verbose "$cmd" ++ catch "exec $cmd" exec_output ++ send_log "$exec_output\n" ++ verbose "$exec_output" ++ ++ foreach str $string { ++ if [string match "*$str*" $exec_output] { ++ pass "$testname: $str" ++ } else { ++ fail "$testname: $str" ++ } ++ } ++} ++ ++if { ![ld_compile $CC $srcdir/$subdir/indirect1a.c tmpdir/indirect1a.o] ++ || ![ld_compile $CC $srcdir/$subdir/indirect1b.c tmpdir/indirect1b.o] ++ || ![ld_compile "$CC -fPIC" $srcdir/$subdir/indirect2.c tmpdir/indirect2.o] ++ || ![ld_compile $CC $srcdir/$subdir/indirect3a.c tmpdir/indirect3a.o] ++ || ![ld_compile $CC $srcdir/$subdir/indirect3b.c tmpdir/indirect3b.o] ++ || ![ld_compile $CC $srcdir/$subdir/indirect4a.c tmpdir/indirect4a.o] ++ || ![ld_compile $CC $srcdir/$subdir/indirect4b.c tmpdir/indirect4b.o] } { ++ unresolved "Indirect symbol tests" ++ return ++} ++ ++set build_tests { ++ {"Build libindirect1c.so" ++ "-shared" "-fPIC" ++ {indirect1c.c} {} "libindirect1c.so"} ++ {"Build libindirect3c.so" ++ "-shared" "-fPIC" ++ {indirect3c.c} {} "libindirect3c.so"} ++ {"Build libindirect4c.so" ++ "-shared" "-fPIC" ++ {indirect4c.c} {} "libindirect4c.so"} ++} ++ ++run_cc_link_tests $build_tests ++ ++global ld ++ ++set string ": final link failed: Nonrepresentable section on output" ++ ++set string1 ": local symbol \`foo\' in tmpdir/indirect1b.o is referenced by DSO" ++ ++set testname "Indirect symbol 1a" ++set cmd "$ld -e start -o tmpdir/indirect1 tmpdir/indirect1a.o tmpdir/indirect1b.o tmpdir/libindirect1c.so" ++check_link_message "$cmd" [list $string1 $string] "$testname" ++ ++set testname "Indirect symbol 1b" ++set cmd "$ld -e start -o tmpdir/indirect1 tmpdir/indirect1a.o tmpdir/libindirect1c.so tmpdir/indirect1b.o" ++check_link_message "$cmd" [list $string1 $string] "$testname" ++ ++set string2 ": No symbol version section for versioned symbol \`foo@FOO\'" ++set testname "Indirect symbol 2" ++set cmd "$ld -shared -o tmpdir/indirect2.so tmpdir/indirect2.o" ++check_link_message "$cmd" [list $string2 $string] "$testname" ++ ++# The following tests require running the executable generated by ld. ++if ![isnative] { ++ return ++} ++ ++set run_tests { ++ {"Run with libindirect3c.so 1" ++ "tmpdir/indirect3a.o tmpdir/indirect3b.o tmpdir/libindirect3c.so" "" ++ {dummy.c} "indirect3a" "indirect3.out"} ++ {"Run with libindirect3c.so 2" ++ "tmpdir/indirect3a.o tmpdir/libindirect3c.so tmpdir/indirect3b.o" "" ++ {dummy.c} "indirect3b" "indirect3.out"} ++ {"Run with libindirect3c.so 3" ++ "tmpdir/indirect3b.o tmpdir/libindirect3c.so tmpdir/indirect3a.o" "" ++ {dummy.c} "indirect3c" "indirect3.out"} ++ {"Run with libindirect3c.so 4" ++ "tmpdir/libindirect3c.so tmpdir/indirect3b.o tmpdir/indirect3a.o" "" ++ {dummy.c} "indirect3d" "indirect3.out"} ++ {"Run with libindirect4c.so 1" ++ "tmpdir/indirect4a.o tmpdir/indirect4b.o tmpdir/libindirect4c.so" "" ++ {dummy.c} "indirect4a" "indirect4.out"} ++ {"Run with libindirect4c.so 2" ++ "tmpdir/indirect4a.o tmpdir/libindirect4c.so tmpdir/indirect4b.o" "" ++ {dummy.c} "indirect4b" "indirect4.out"} ++ {"Run with libindirect4c.so 3" ++ "tmpdir/indirect4b.o tmpdir/libindirect4c.so tmpdir/indirect4a.o" "" ++ {dummy.c} "indirect4c" "indirect4.out"} ++ {"Run with libindirect4c.so 4" ++ "tmpdir/libindirect4c.so tmpdir/indirect4b.o tmpdir/indirect4a.o" "" ++ {dummy.c} "indirect4d" "indirect4.out"} ++} ++ ++run_ld_link_exec_tests [] $run_tests +--- binutils/ld/testsuite/ld-elf/indirect1a.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect1a.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,8 @@ ++extern void bar (void); ++ ++int ++start (void) ++{ ++ bar (); ++ return 0; ++} +--- binutils/ld/testsuite/ld-elf/indirect1b.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect1b.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,6 @@ ++void ++foo (void) ++{ ++} ++ ++asm (".symver foo,foo@FOO"); +--- binutils/ld/testsuite/ld-elf/indirect1c.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect1c.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,7 @@ ++extern void foo (void); ++ ++void ++bar (void) ++{ ++ foo (); ++} +--- binutils/ld/testsuite/ld-elf/indirect2.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect2.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,9 @@ ++extern void foo (void); ++ ++asm (".symver foo,foo@@@FOO"); ++ ++void ++bar (void) ++{ ++ foo (); ++} +--- binutils/ld/testsuite/ld-elf/indirect3.out.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect3.out 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,2 @@ ++MAIN ++DSO +--- binutils/ld/testsuite/ld-elf/indirect3a.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect3a.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,10 @@ ++extern void bar (void); ++extern void foo (void); ++ ++int ++main (void) ++{ ++ foo (); ++ bar (); ++ return 0; ++} +--- binutils/ld/testsuite/ld-elf/indirect3b.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect3b.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,9 @@ ++#include ++ ++void ++foo (void) ++{ ++ printf ("MAIN\n"); ++} ++ ++asm (".symver foo,foo@FOO"); +--- binutils/ld/testsuite/ld-elf/indirect3c.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect3c.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,15 @@ ++#include ++ ++extern void foo (void); ++ ++void ++foo (void) ++{ ++ printf ("DSO\n"); ++} ++ ++void ++bar (void) ++{ ++ foo (); ++} +--- binutils/ld/testsuite/ld-elf/indirect4.out.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect4.out 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,2 @@ ++MAIN2 ++MAIN2 +--- binutils/ld/testsuite/ld-elf/indirect4a.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect4a.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,10 @@ ++extern void bar (void); ++extern void foo (void); ++ ++int ++main (void) ++{ ++ foo (); ++ bar (); ++ return 0; ++} +--- binutils/ld/testsuite/ld-elf/indirect4b.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect4b.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,17 @@ ++#include ++ ++void ++foo2 (void) ++{ ++ printf ("MAIN2\n"); ++} ++ ++asm (".symver foo2,foo@@FOO2"); ++ ++void ++foo1 (void) ++{ ++ printf ("MAIN1\n"); ++} ++ ++asm (".symver foo1,foo@FOO1"); +--- binutils/ld/testsuite/ld-elf/indirect4c.c.indirect 2009-01-02 09:06:01.000000000 -0800 ++++ binutils/ld/testsuite/ld-elf/indirect4c.c 2009-01-02 09:06:01.000000000 -0800 +@@ -0,0 +1,15 @@ ++#include ++ ++extern void foo (void); ++ ++void ++foo (void) ++{ ++ printf ("DSO\n"); ++} ++ ++void ++bar (void) ++{ ++ foo (); ++} --- binutils-2.20.1.orig/debian/patches/127_x86_64_i386_biarch.dpatch +++ binutils-2.20.1/debian/patches/127_x86_64_i386_biarch.dpatch @@ -0,0 +1,42 @@ +#!/bin/sh -e +## 127_x86_64_i386_biarch.dpatch +## +## DP: Description: Add (/usr)/lib32 to the search paths on x86_64. +## DP: Author: Aurelien Jarno +## DP: Upstream status: Debian specific + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- ./ld/emulparams/elf_i386.sh~ 2009-07-29 16:59:23.000000000 +0200 ++++ ./ld/emulparams/elf_i386.sh 2009-08-05 10:38:57.000000000 +0200 +@@ -13,3 +13,13 @@ + NO_SMALL_DATA=yes + SEPARATE_GOTPLT=12 + IREL_IN_PLT= ++ ++# Linux modify the default library search path to first include ++# a 32-bit specific directory. ++case "$target" in ++ x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu) ++ case "$EMULATION_NAME" in ++ *i386*) LIBPATH_SUFFIX=32 ;; ++ esac ++ ;; ++esac --- binutils-2.20.1.orig/debian/patches/143_pr42602.dpatch +++ binutils-2.20.1/debian/patches/143_pr42602.dpatch @@ -0,0 +1,89 @@ +#!/bin/sh -e +## 143_pr42602.dpatch +## +## DP: Description: Fix PR other/42602: demangling a global constructors symbol + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2010-01-09 H.J. Lu + + PR other/42602 + * cp-demangle.c (d_make_demangle_mangled_name): New. + (d_demangle_callback): Use it on DCT_GLOBAL_XTORS. + + * testsuite/demangle-expected: Updated. + +@DPATCH@ +diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c +index 43cf34a..878aeae 100644 +--- a/libiberty/cp-demangle.c ++++ b/libiberty/cp-demangle.c +@@ -320,6 +320,9 @@ static struct demangle_component * + d_make_name (struct d_info *, const char *, int); + + static struct demangle_component * ++d_make_demangle_mangled_name (struct d_info *, const char *, int); ++ ++static struct demangle_component * + d_make_builtin_type (struct d_info *, + const struct demangle_builtin_type_info *); + +@@ -864,6 +867,17 @@ d_make_comp (struct d_info *di, enum demangle_component_type type, + return p; + } + ++/* Add a new demangle mangled name component. */ ++ ++static struct demangle_component * ++d_make_demangle_mangled_name (struct d_info *di, const char *s, int len) ++{ ++ if (d_peek_char (di) != '_' || d_peek_next_char (di) != 'Z') ++ return d_make_name (di, s, len); ++ d_advance (di, 2); ++ return d_encoding (di, 0); ++} ++ + /* Add a new name component. */ + + static struct demangle_component * +@@ -4728,7 +4742,8 @@ d_demangle_callback (const char *mangled, int options, + (type == DCT_GLOBAL_CTORS + ? DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS + : DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS), +- d_make_name (&di, d_str (&di), strlen (d_str (&di))), ++ d_make_demangle_mangled_name (&di, d_str (&di), ++ strlen (d_str (&di))), + NULL); + d_advance (&di, strlen (d_str (&di))); + break; +diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected +index 6798154..578da62 100644 +--- a/libiberty/testsuite/demangle-expected ++++ b/libiberty/testsuite/demangle-expected +@@ -3595,8 +3595,8 @@ std::_Alloc_traits, libcw: + # + --format=gnu-v3 --no-params + _GLOBAL__I__Z2fnv +-global constructors keyed to _Z2fnv +-global constructors keyed to _Z2fnv ++global constructors keyed to fn() ++global constructors keyed to fn() + # + --format=gnu-v3 --no-params + _Z1rM1GFivEMS_KFivES_M1HFivES1_4whatIKS_E5what2IS8_ES3_ --- binutils-2.20.1.orig/debian/patches/213-hjl-binutils-sec64k.dpatch +++ binutils-2.20.1/debian/patches/213-hjl-binutils-sec64k.dpatch @@ -0,0 +1,523 @@ +#!/bin/sh -e +## 213-hjl-binutils-sec64k.dpatch +## +## DP: Description: Proposed patch for PR binutils/6412 +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.20.51.0.1 +## DP: Original patch: binutils-sec64k-6.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +bfd/ + +2008-04-21 H.J. Lu + + PR binutils/6412 + * bfd.c (bfd): Add has_gap_in_elf_shndx. + * bfd-in2.h: Regenerated. + + * bfd-in.h (bfd_has_gap_in_elf_shndx): New. + + * elf.c (setup_group): Handle gap in section indices. + * elfcode.h (elf_swap_symbol_in): Likewise. + (elf_object_p): Likewise. Use %B where reporting corrupt + string table index. + +include/elf/ + +2008-04-21 H.J. Lu + + PR binutils/6412 + * internal.h (ELF_SECTION_HEADER_INDEX_GAP): New. + +2008-04-21 H.J. Lu + + PR binutils/6412 + * readelf.c (hole_in_shndx): New. + (original_shndx_info): Likewise. + (original_shndx): Likewise. + (process_file_header): Move ELF magic bytes check to ... + (get_file_header): Here. + (get_32bit_section_headers): Set hole_in_shndx if sh_link + >= number of sections. + (get_64bit_section_headers): Likewise. + (get_32bit_elf_symbols): Adjust st_shndx if hole_in_shndx + isn't 0. + (get_64bit_elf_symbols): Likewise. + (process_section_headers): Adjust elf_header.e_shstrndx, + sh_link and sh_info, save original sh_link and sh_info, + display adjustment for sh_link and sh_info if hole_in_shndx + isn't 0. + (process_section_groups): Adjust member section index if + hole_in_shndx isn't 0. + (process_object): Free original_shndx if needed. + +@DPATCH@ +--- binutils/bfd/bfd-in.h.sec64k 2009-09-04 17:51:38.000000000 -0700 ++++ binutils/bfd/bfd-in.h 2009-09-10 09:47:27.000000000 -0700 +@@ -497,6 +497,7 @@ extern void warn_deprecated (const char + #define bfd_my_archive(abfd) ((abfd)->my_archive) + #define bfd_has_map(abfd) ((abfd)->has_armap) + #define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) ++#define bfd_has_gap_in_elf_shndx(abfd) ((abfd)->has_gap_in_elf_shndx) + + #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) + #define bfd_usrdata(abfd) ((abfd)->usrdata) +--- binutils/bfd/bfd-in2.h.sec64k 2009-09-10 09:29:36.000000000 -0700 ++++ binutils/bfd/bfd-in2.h 2009-09-10 09:47:27.000000000 -0700 +@@ -504,6 +504,7 @@ extern void warn_deprecated (const char + #define bfd_my_archive(abfd) ((abfd)->my_archive) + #define bfd_has_map(abfd) ((abfd)->has_armap) + #define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) ++#define bfd_has_gap_in_elf_shndx(abfd) ((abfd)->has_gap_in_elf_shndx) + + #define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) + #define bfd_usrdata(abfd) ((abfd)->usrdata) +@@ -5034,6 +5035,9 @@ struct bfd + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; ++ ++ /* Set if there is a gap in ELF section index. */ ++ unsigned int has_gap_in_elf_shndx : 1; + }; + + typedef enum bfd_error +--- binutils/bfd/bfd.c.sec64k 2009-09-10 09:29:40.000000000 -0700 ++++ binutils/bfd/bfd.c 2009-09-10 09:47:27.000000000 -0700 +@@ -286,6 +286,9 @@ CODE_FRAGMENT + . + . {* Set if this is a thin archive. *} + . unsigned int is_thin_archive : 1; ++. ++. {* Set if there is a gap in ELF section index. *} ++. unsigned int has_gap_in_elf_shndx : 1; + .}; + . + */ +--- binutils/bfd/elf.c.sec64k 2009-09-10 09:47:27.000000000 -0700 ++++ binutils/bfd/elf.c 2009-09-10 09:47:27.000000000 -0700 +@@ -627,6 +627,12 @@ setup_group (bfd *abfd, Elf_Internal_Shd + |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; + break; + } ++ ++ /* Handle gap in section indices. */ ++ if (bfd_has_gap_in_elf_shndx (abfd) ++ && idx > (SHN_HIRESERVE & 0xffff)) ++ idx -= ELF_SECTION_HEADER_INDEX_GAP; ++ + if (idx >= shnum) + { + ((*_bfd_error_handler) +--- binutils/bfd/elfcode.h.sec64k 2009-09-10 09:47:27.000000000 -0700 ++++ binutils/bfd/elfcode.h 2009-09-10 09:47:27.000000000 -0700 +@@ -194,6 +194,10 @@ elf_swap_symbol_in (bfd *abfd, + if (shndx == NULL) + return FALSE; + dst->st_shndx = H_GET_32 (abfd, shndx->est_shndx); ++ /* Handle gap in section indices. */ ++ if (bfd_has_gap_in_elf_shndx (abfd) ++ && dst->st_shndx > (SHN_HIRESERVE & 0xffff)) ++ dst->st_shndx -= ELF_SECTION_HEADER_INDEX_GAP; + } + else if (dst->st_shndx >= (SHN_LORESERVE & 0xffff)) + dst->st_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff); +@@ -800,6 +804,28 @@ elf_object_p (bfd *abfd) + != 0)) + abfd->flags &= ~D_PAGED; + } ++ ++ /* To support files generated by the older linker, we adjust ++ section indices if there is a gap. */ ++ if (bfd_has_gap_in_elf_shndx (abfd)) ++ { ++ BFD_ASSERT (i_ehdrp->e_shstrndx == i_shdrp->sh_link); ++ ++ for (; num_sec > 0; num_sec--, i_shdrp++) ++ { ++ if (i_shdrp->sh_link > (SHN_HIRESERVE & 0xffff)) ++ i_shdrp->sh_link -= ELF_SECTION_HEADER_INDEX_GAP; ++ ++ if (i_shdrp->sh_info > (SHN_HIRESERVE & 0xffff) ++ && ((i_shdrp->sh_flags & SHF_INFO_LINK) ++ || i_shdrp->sh_type == SHT_RELA ++ || i_shdrp->sh_type == SHT_REL)) ++ i_shdrp->sh_info -= ELF_SECTION_HEADER_INDEX_GAP; ++ } ++ ++ if (i_ehdrp->e_shstrndx > (SHN_HIRESERVE & 0xffff)) ++ i_ehdrp->e_shstrndx -= ELF_SECTION_HEADER_INDEX_GAP; ++ } + } + + /* A further sanity check. */ +@@ -814,7 +840,8 @@ elf_object_p (bfd *abfd) + So we are kind, and reset the string index value to 0 + so that at least some processing can be done. */ + i_ehdrp->e_shstrndx = SHN_UNDEF; +- _bfd_error_handler (_("warning: %s has a corrupt string table index - ignoring"), abfd->filename); ++ _bfd_error_handler (_("warning: %B has a corrupt string table index - ignoring"), ++ abfd); + } + } + else if (i_ehdrp->e_shstrndx != SHN_UNDEF) +--- binutils/binutils/readelf.c.sec64k 2009-09-10 09:47:25.000000000 -0700 ++++ binutils/binutils/readelf.c 2009-09-10 10:05:27.000000000 -0700 +@@ -193,6 +193,15 @@ static int do_notes; + static int do_archive_index; + static int is_32bit_elf; + ++struct original_shndx_info ++{ ++ unsigned int sh_link; ++ unsigned int sh_info; ++}; ++static struct original_shndx_info *original_shndx; ++/* The largest section index in sh_link if it isn't 0. */ ++static unsigned int hole_in_shndx; ++ + struct group_list + { + struct group_list * next; +@@ -3198,16 +3207,6 @@ get_data_encoding (unsigned int encoding + static int + process_file_header (void) + { +- if ( elf_header.e_ident[EI_MAG0] != ELFMAG0 +- || elf_header.e_ident[EI_MAG1] != ELFMAG1 +- || elf_header.e_ident[EI_MAG2] != ELFMAG2 +- || elf_header.e_ident[EI_MAG3] != ELFMAG3) +- { +- error +- (_("Not an ELF file - it has the wrong magic bytes at the start\n")); +- return 0; +- } +- + init_dwarf_regnames (elf_header.e_machine); + + if (do_header) +@@ -3694,6 +3693,10 @@ get_32bit_section_headers (FILE * file, + internal->sh_info = BYTE_GET (shdrs[i].sh_info); + internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign); + internal->sh_entsize = BYTE_GET (shdrs[i].sh_entsize); ++ /* The older linker generates section header indices with ++ hole. */ ++ if (i > 0 && internal->sh_link >= elf_header.e_shnum) ++ hole_in_shndx = internal->sh_link; + } + + free (shdrs); +@@ -3737,6 +3740,10 @@ get_64bit_section_headers (FILE * file, + internal->sh_info = BYTE_GET (shdrs[i].sh_info); + internal->sh_offset = BYTE_GET (shdrs[i].sh_offset); + internal->sh_addralign = BYTE_GET (shdrs[i].sh_addralign); ++ /* The older linker generates section header indices with ++ hole. */ ++ if (i > 0 && internal->sh_link >= elf_header.e_shnum) ++ hole_in_shndx = internal->sh_link; + } + + free (shdrs); +@@ -3796,8 +3803,12 @@ get_32bit_elf_symbols (FILE * file, Elf_ + psym->st_size = BYTE_GET (esyms[j].st_size); + psym->st_shndx = BYTE_GET (esyms[j].st_shndx); + if (psym->st_shndx == (SHN_XINDEX & 0xffff) && shndx != NULL) +- psym->st_shndx +- = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); ++ { ++ psym->st_shndx ++ = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); ++ if (hole_in_shndx && psym->st_shndx > (SHN_HIRESERVE & 0xffff)) ++ psym->st_shndx -= ELF_SECTION_HEADER_INDEX_GAP; ++ } + else if (psym->st_shndx >= (SHN_LORESERVE & 0xffff)) + psym->st_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff); + psym->st_info = BYTE_GET (esyms[j].st_info); +@@ -3863,8 +3874,12 @@ get_64bit_elf_symbols (FILE * file, Elf_ + psym->st_other = BYTE_GET (esyms[j].st_other); + psym->st_shndx = BYTE_GET (esyms[j].st_shndx); + if (psym->st_shndx == (SHN_XINDEX & 0xffff) && shndx != NULL) +- psym->st_shndx +- = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); ++ { ++ psym->st_shndx ++ = byte_get ((unsigned char *) &shndx[j], sizeof (shndx[j])); ++ if (hole_in_shndx && psym->st_shndx > (SHN_HIRESERVE & 0xffff)) ++ psym->st_shndx -= ELF_SECTION_HEADER_INDEX_GAP; ++ } + else if (psym->st_shndx >= (SHN_LORESERVE & 0xffff)) + psym->st_shndx += SHN_LORESERVE - (SHN_LORESERVE & 0xffff); + psym->st_value = BYTE_GET (esyms[j].st_value); +@@ -4106,6 +4121,7 @@ process_section_headers (FILE * file) + unsigned int i; + + section_headers = NULL; ++ original_shndx = NULL; + + if (elf_header.e_shnum == 0) + { +@@ -4127,6 +4143,44 @@ process_section_headers (FILE * file) + else if (! get_64bit_section_headers (file, elf_header.e_shnum)) + return 0; + ++ if (hole_in_shndx ++ && ((hole_in_shndx - ELF_SECTION_HEADER_INDEX_GAP) ++ < elf_header.e_shnum)) ++ { ++ Elf_Internal_Shdr *internal; ++ struct original_shndx_info *p; ++ ++ if (elf_header.e_shstrndx > (SHN_HIRESERVE & 0xffff)) ++ elf_header.e_shstrndx -= ELF_SECTION_HEADER_INDEX_GAP; ++ ++ original_shndx = cmalloc (elf_header.e_shnum, ++ sizeof (*original_shndx)); ++ if (original_shndx == NULL) ++ { ++ error (_("Out of memory\n")); ++ return 0; ++ } ++ ++ internal = section_headers; ++ p = original_shndx; ++ for (i = elf_header.e_shnum; ++ i > 0; ++ i--, internal++, p++) ++ { ++ p->sh_link = internal->sh_link; ++ p->sh_info = internal->sh_info; ++ ++ if (internal->sh_link > (SHN_HIRESERVE & 0xffff)) ++ internal->sh_link -= ELF_SECTION_HEADER_INDEX_GAP; ++ ++ if (internal->sh_info > (SHN_HIRESERVE & 0xffff) ++ && (internal->sh_flags & SHF_INFO_LINK ++ || internal->sh_type == SHT_REL ++ || internal->sh_type == SHT_RELA)) ++ internal->sh_info -= ELF_SECTION_HEADER_INDEX_GAP; ++ } ++ } ++ + /* Read in the string table, so that we have names to display. */ + if (elf_header.e_shstrndx != SHN_UNDEF + && elf_header.e_shstrndx < elf_header.e_shnum) +@@ -4402,7 +4456,23 @@ process_section_headers (FILE * file) + } + } + +- if (do_section_details) ++ if (hole_in_shndx && original_shndx) ++ { ++ if (original_shndx[i].sh_link != section->sh_link) ++ printf ("%2u/-%3u ", ++ original_shndx[i].sh_link, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf ("%2u ", section->sh_link); ++ if (original_shndx[i].sh_info != section->sh_info) ++ printf ("%3u/-%3u ", ++ original_shndx[i].sh_info, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf ("%3u ", section->sh_info); ++ printf ("%2lu\n", (unsigned long) section->sh_addralign); ++ } ++ else if (do_section_details) + { + if (link_too_big != NULL && * link_too_big) + printf ("<%s> ", link_too_big); +@@ -4454,7 +4524,23 @@ process_section_headers (FILE * file) + else + printf (" %3s ", get_elf_section_flags (section->sh_flags)); + +- printf ("%2u %3u ", section->sh_link, section->sh_info); ++ if (hole_in_shndx) ++ { ++ if (original_shndx[i].sh_link != section->sh_link) ++ printf ("%2u/-%3u ", ++ original_shndx[i].sh_link, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf ("%2u ", section->sh_link); ++ if (original_shndx[i].sh_info != section->sh_info) ++ printf ("%3u/-%3u ", ++ original_shndx[i].sh_info, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf ("%3u ", section->sh_info); ++ } ++ else ++ printf ("%2u %3u ", section->sh_link, section->sh_info); + + if ((unsigned long) section->sh_addralign == section->sh_addralign) + printf ("%2lu\n", (unsigned long) section->sh_addralign); +@@ -4476,14 +4562,35 @@ process_section_headers (FILE * file) + printf (" "); + print_vma (section->sh_offset, LONG_HEX); + } +- printf (" %u\n ", section->sh_link); ++ if (hole_in_shndx) ++ { ++ if (original_shndx[i].sh_link != section->sh_link) ++ printf (" %u/-%3u\n ", ++ original_shndx[i].sh_link, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf (" %u\n ", section->sh_link); ++ } ++ else ++ printf (" %u\n ", section->sh_link); + print_vma (section->sh_size, LONG_HEX); + putchar (' '); + print_vma (section->sh_entsize, LONG_HEX); + +- printf (" %-16u %lu\n", +- section->sh_info, +- (unsigned long) section->sh_addralign); ++ if (hole_in_shndx) ++ { ++ if (original_shndx[i].sh_info != section->sh_info) ++ printf (" %-11u/-%3u", ++ original_shndx[i].sh_info, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf (" %-16u", section->sh_info); ++ printf (" %lu\n", (unsigned long) section->sh_addralign); ++ } ++ else ++ printf (" %-16u %lu\n", ++ section->sh_info, ++ (unsigned long) section->sh_addralign); + } + else + { +@@ -4503,10 +4610,28 @@ process_section_headers (FILE * file) + + printf (" %3s ", get_elf_section_flags (section->sh_flags)); + +- printf (" %2u %3u %lu\n", +- section->sh_link, +- section->sh_info, +- (unsigned long) section->sh_addralign); ++ if (hole_in_shndx) ++ { ++ if (original_shndx[i].sh_link != section->sh_link) ++ printf (" %2u/-%3u", ++ original_shndx[i].sh_link, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf (" %2u", section->sh_link); ++ if (original_shndx[i].sh_info != section->sh_info) ++ printf (" %3u/-%3u", ++ original_shndx[i].sh_info, ++ ELF_SECTION_HEADER_INDEX_GAP); ++ else ++ printf (" %3u", section->sh_info); ++ printf (" %lu\n", ++ (unsigned long) section->sh_addralign); ++ } ++ else ++ printf (" %2u %3u %lu\n", ++ section->sh_link, ++ section->sh_info, ++ (unsigned long) section->sh_addralign); + } + + if (do_section_details) +@@ -4703,10 +4828,15 @@ process_section_groups (FILE * file) + for (j = 0; j < size; j++) + { + struct group_list * g; ++ unsigned int orig; + + entry = byte_get (indices, 4); + indices += 4; + ++ orig = entry; ++ if (hole_in_shndx && entry > (SHN_HIRESERVE & 0xffff)) ++ entry -= ELF_SECTION_HEADER_INDEX_GAP; ++ + if (entry >= elf_header.e_shnum) + { + error (_("section [%5u] in group section [%5u] > maximum section [%5u]\n"), +@@ -4743,7 +4873,13 @@ process_section_groups (FILE * file) + if (do_section_groups) + { + sec = section_headers + entry; +- printf (" [%5u] %s\n", entry, SECTION_NAME (sec)); ++ if (orig != entry) ++ printf (" [%5u/-%3u] %s\n", ++ orig, ELF_SECTION_HEADER_INDEX_GAP, ++ SECTION_NAME (sec)); ++ else ++ printf (" [%5u] %s\n", ++ entry, SECTION_NAME (sec)); + } + + g = (struct group_list *) xmalloc (sizeof (struct group_list)); +@@ -10622,6 +10758,15 @@ get_file_header (FILE * file) + if (fread (elf_header.e_ident, EI_NIDENT, 1, file) != 1) + return 0; + ++ if (elf_header.e_ident[EI_MAG0] != ELFMAG0 ++ || elf_header.e_ident[EI_MAG1] != ELFMAG1 ++ || elf_header.e_ident[EI_MAG2] != ELFMAG2 ++ || elf_header.e_ident[EI_MAG3] != ELFMAG3) ++ { ++ error (_("Not an ELF file - it has the wrong magic bytes at the start\n")); ++ return 0; ++ } ++ + /* Determine how to read the rest of the header. */ + switch (elf_header.e_ident[EI_DATA]) + { +@@ -10717,6 +10862,8 @@ process_object (char * file_name, FILE * + { + unsigned int i; + ++ hole_in_shndx = 0; ++ + if (! get_file_header (file)) + { + error (_("%s: Failed to read file header\n"), file_name); +@@ -10804,6 +10951,12 @@ process_object (char * file_name, FILE * + section_headers = NULL; + } + ++ if (original_shndx) ++ { ++ free (original_shndx); ++ original_shndx = NULL; ++ } ++ + if (string_table) + { + free (string_table); +--- binutils/include/elf/internal.h.sec64k 2009-05-05 10:56:16.000000000 -0700 ++++ binutils/include/elf/internal.h 2009-09-10 09:47:27.000000000 -0700 +@@ -330,4 +330,8 @@ struct elf_segment_map + (ELF_SECTION_SIZE(sec_hdr, segment) > 0 \ + && ELF_IS_SECTION_IN_SEGMENT (sec_hdr, segment)) + ++/* The gap in section indices created by the older linker before ++ bug fix for PR ld/5900. */ ++#define ELF_SECTION_HEADER_INDEX_GAP (SHN_HIRESERVE + 1 - SHN_LORESERVE) ++ + #endif /* _ELF_INTERNAL_H */ --- binutils-2.20.1.orig/debian/patches/140_gold_pr10979_2.dpatch +++ binutils-2.20.1/debian/patches/140_gold_pr10979_2.dpatch @@ -0,0 +1,212 @@ +#!/bin/sh -e +## 140_gold_pr10979_2.dpatch +## +## DP: Description: PR gold/10979: Fix internal errors + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2009-12-30 Ian Lance Taylor + + PR 10979 + * common.cc (Sort_commons::operator()): Stabilize sort when both + entries are NULL. + (Symbol_table::do_allocate_commons_list): When allocating common + symbols, skip a symbol which is no longer common. + * symtab.h (Symbol::is_common): Test whether the symbol comes from + an object before checking its type. + * testsuite/common_test_2.c: New file. + * testsuite/common_test_3.c: New file. + * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2. + (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define. + (common_test_2_LDFLAGS, common_test_2_LDADD): Define. + (common_test_2_pic.o, common_test_2.so): New targets. + (common_test_3_pic.o, common_test_3.so): New targets. + * testsuite/Makefile.in: Rebuild. + +@DPATCH@ +Index: common.cc +=================================================================== +RCS file: /cvs/src/src/gold/common.cc,v +retrieving revision 1.21 +diff -p -u -r1.21 common.cc +--- ./gold/common.cc 31 Dec 2009 01:57:55 -0000 1.21 ++++ ./gold/common.cc 31 Dec 2009 05:04:24 -0000 +@@ -91,7 +91,16 @@ bool + Sort_commons::operator()(const Symbol* pa, const Symbol* pb) const + { + if (pa == NULL) +- return false; ++ { ++ if (pb == NULL) ++ { ++ // Stabilize sort. The order really doesn't matter, because ++ // these entries will be discarded, but we want to return ++ // the same result every time we compare pa and pb. ++ return pa < pb; ++ } ++ return false; ++ } + if (pb == NULL) + return true; + +@@ -312,6 +321,17 @@ Symbol_table::do_allocate_commons_list( + Symbol* sym = *p; + if (sym == NULL) + break; ++ ++ // Because we followed forwarding symbols above, but we didn't ++ // do it reliably before adding symbols to the list, it is ++ // possible for us to have the same symbol on the list twice. ++ // This can happen in the horrible case where a program defines ++ // a common symbol with the same name as a versioned libc ++ // symbol. That will show up here as a symbol which has already ++ // been allocated and is therefore no longer a common symbol. ++ if (!sym->is_common()) ++ continue; ++ + Sized_symbol* ssym = this->get_sized_symbol(sym); + + // Record the symbol in the map file now, before we change its +Index: symtab.h +=================================================================== +RCS file: /cvs/src/src/gold/symtab.h,v +retrieving revision 1.102 +diff -p -u -r1.102 symtab.h +--- ./gold/symtab.h 31 Dec 2009 01:57:55 -0000 1.102 ++++ ./gold/symtab.h 31 Dec 2009 05:04:24 -0000 +@@ -478,10 +478,10 @@ class Symbol + bool + is_common() const + { +- if (this->type_ == elfcpp::STT_COMMON) +- return true; + if (this->source_ != FROM_OBJECT) + return false; ++ if (this->type_ == elfcpp::STT_COMMON) ++ return true; + bool is_ordinary; + unsigned int shndx = this->shndx(&is_ordinary); + return !is_ordinary && Symbol::is_common_shndx(shndx); +Index: testsuite/Makefile.am +=================================================================== +RCS file: /cvs/src/src/gold/testsuite/Makefile.am,v +retrieving revision 1.114 +diff -p -u -r1.114 Makefile.am +--- ./gold/testsuite/Makefile.am 30 Dec 2009 22:35:48 -0000 1.114 ++++ ./gold/testsuite/Makefile.am 31 Dec 2009 05:04:24 -0000 +@@ -407,6 +407,20 @@ common_test_1_DEPENDENCIES = gcctestdir/ + common_test_1_LDFLAGS = -Bgcctestdir/ + common_test_1_LDADD = + ++check_PROGRAMS += common_test_2 ++common_test_2_SOURCES = common_test_1.c ++common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld ++common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. ++common_test_2_LDADD = common_test_2.so common_test_3.so ++common_test_2_pic.o: common_test_2.c ++ $(COMPILE) -c -fpic -o $@ $< ++common_test_2.so: common_test_2_pic.o common_test_3.so gcctestdir/ld ++ $(LINK) -Bgcctestdir/ -shared common_test_2_pic.o common_test_3.so ++common_test_3_pic.o: common_test_3.c ++ $(COMPILE) -c -fpic -o $@ $< ++common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld ++ $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script ++ + check_PROGRAMS += exception_test + check_PROGRAMS += exception_static_test + check_PROGRAMS += exception_shared_1_test +Index: testsuite/common_test_2.c +=================================================================== +RCS file: testsuite/common_test_2.c +diff -N testsuite/common_test_2.c +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ ./gold/testsuite/common_test_2.c 31 Dec 2009 05:04:25 -0000 +@@ -0,0 +1,33 @@ ++/* common_test_2.c -- test common symbol name conflicts ++ ++ Copyright 2009 Free Software Foundation, Inc. ++ Written by Ian Lance Taylor ++ ++ This file is part of gold. ++ ++ 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 3 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++/* Call a function. The function will come from a shared library. */ ++ ++extern void c1 (void); ++ ++void fn (void); ++ ++void ++fn (void) ++{ ++ c1 (); ++} +Index: testsuite/common_test_3.c +=================================================================== +RCS file: testsuite/common_test_3.c +diff -N testsuite/common_test_3.c +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ ./gold/testsuite/common_test_3.c 31 Dec 2009 05:04:25 -0000 +@@ -0,0 +1,32 @@ ++/* common_test_3.c -- test common symbol name conflicts ++ ++ Copyright 2009 Free Software Foundation, Inc. ++ Written by Ian Lance Taylor ++ ++ This file is part of gold. ++ ++ 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 3 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++/* Define a function with a default version whose name is the same as ++ a common symbol. This file will wind up in a shared library. */ ++ ++void c1_v1 (void); ++ ++void ++c1_v1 (void) ++{ ++} ++__asm__ (".symver c1_v1,c1@@VER1"); --- binutils-2.20.1.orig/debian/patches/210-hjl-binutils-signed.dpatch +++ binutils-2.20.1/debian/patches/210-hjl-binutils-signed.dpatch @@ -0,0 +1,704 @@ +#!/bin/sh -e +## 210-hjl-binutils-signed.dpatch +## +## DP: Description: objdump.c (disassemble_bytes,dump_reloc_set): Print addend as signed. +## DP: Author: H.J. Lu +## DP: Upstream status: hjl 2.18.50.0.5 +## DP: Original patch: binutils-signed-3.patch + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +binutils/ + +2007-06-22 H.J. Lu + + * objdump.c (disassemble_bytes): Print addend as signed. + (dump_reloc_set): Likewise. + +gas/testsuite/ + +2007-06-22 H.J. Lu + + * gas/alpha/elf-reloc-1.d: Expect addend as signed. + * gas/i386/mixed-mode-reloc64.d: Likewise. + * gas/i386/reloc64.d: Likewise. + * gas/ia64/pcrel.d: Likewise. + * gas/mips/branch-misc-2-64.d: Likewise. + * gas/mips/branch-misc-2pic-64.d: Likewise. + * gas/mips/ldstla-n64-sym32.d: Likewise. + * gas/mips/mips16-hilo-n32.d: Likewise. + * gas/ppc/astest.d: Likewise. + * gas/ppc/astest2.d: Likewise. + * gas/ppc/astest2_64.d: Likewise. + * gas/ppc/astest64.d: Likewise. + * gas/ppc/test1elf32.d: Likewise. + * gas/ppc/test1elf64.d: Likewise. + * gas/sparc/reloc64.d: Likewise. + +@DPATCH@ +--- binutils/binutils/objdump.c.signed 2007-07-24 15:03:40.000000000 -0700 ++++ binutils/binutils/objdump.c 2007-09-26 09:51:38.000000000 -0700 +@@ -1650,8 +1650,15 @@ disassemble_bytes (struct disassemble_in + + if (q->addend) + { +- printf ("+0x"); +- objdump_print_value (q->addend, info, TRUE); ++ bfd_signed_vma addend = q->addend; ++ if (addend < 0) ++ { ++ printf ("-0x"); ++ addend = -addend; ++ } ++ else ++ printf ("+0x"); ++ objdump_print_value (addend, info, TRUE); + } + + printf ("\n"); +@@ -2710,8 +2717,15 @@ dump_reloc_set (bfd *abfd, asection *sec + + if (q->addend) + { +- printf ("+0x"); +- bfd_printf_vma (abfd, q->addend); ++ bfd_signed_vma addend = q->addend; ++ if (addend < 0) ++ { ++ printf ("-0x"); ++ addend = -addend; ++ } ++ else ++ printf ("+0x"); ++ bfd_printf_vma (abfd, addend); + } + + printf ("\n"); +--- binutils/gas/testsuite/gas/alpha/elf-reloc-1.d.signed 2003-06-17 04:16:16.000000000 -0700 ++++ binutils/gas/testsuite/gas/alpha/elf-reloc-1.d 2007-09-26 09:51:38.000000000 -0700 +@@ -16,6 +16,6 @@ OFFSET TYPE VALUE + 0*000001c GPRELHIGH d + 0*0000020 GPRELLOW e + 0*0000024 GPDISP \.text\+0x0*0000008 +-0*0000030 GPDISP \.text\+0xf*ffffff8 ++0*0000030 GPDISP \.text-0x0*0000008 + + +--- binutils/gas/testsuite/gas/i386/mixed-mode-reloc64.d.signed 2005-09-28 08:31:21.000000000 -0700 ++++ binutils/gas/testsuite/gas/i386/mixed-mode-reloc64.d 2007-09-26 09:51:38.000000000 -0700 +@@ -7,8 +7,8 @@ + RELOCATION RECORDS FOR \[.text\]: + OFFSET[ ]+TYPE[ ]+VALUE[ ]* + [0-9a-f]+[ ]+R_X86_64_GOT32[ ]+xtrn[ ]* +-[0-9a-f]+[ ]+R_X86_64_PLT32[ ]+xtrn\+0xf+c[ ]* ++[0-9a-f]+[ ]+R_X86_64_PLT32[ ]+xtrn-0x0*4[ ]* + [0-9a-f]+[ ]+R_X86_64_GOT32[ ]+xtrn[ ]* +-[0-9a-f]+[ ]+R_X86_64_PLT32[ ]+xtrn\+0xf+c[ ]* ++[0-9a-f]+[ ]+R_X86_64_PLT32[ ]+xtrn-0x0*4[ ]* + [0-9a-f]+[ ]+R_X86_64_GOT32[ ]+xtrn[ ]* +-[0-9a-f]+[ ]+R_X86_64_PLT32[ ]+xtrn\+0xf+c[ ]* ++[0-9a-f]+[ ]+R_X86_64_PLT32[ ]+xtrn-0x0*4[ ]* +--- binutils/gas/testsuite/gas/i386/reloc64.d.signed 2007-09-26 09:51:26.000000000 -0700 ++++ binutils/gas/testsuite/gas/i386/reloc64.d 2007-09-26 09:59:15.000000000 -0700 +@@ -16,33 +16,33 @@ Disassembly of section \.text: + .*[ ]+R_X86_64_PC32[ ]+xtrn\+0x0*2 + .*[ ]+R_X86_64_PC16[ ]+xtrn\+0x0*2 + .*[ ]+R_X86_64_PC8[ ]+xtrn\+0x0*1 +-.*[ ]+R_X86_64_PC32[ ]+xtrn\+0xf+c +-.*[ ]+R_X86_64_PC32[ ]+xtrn\+0xf+c +-.*[ ]+R_X86_64_PC32[ ]+xtrn\+0xf+c +-.*[ ]+R_X86_64_PC8[ ]+xtrn\+0xf+f ++.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4 ++.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4 ++.*[ ]+R_X86_64_PC32[ ]+xtrn-0x0*4 ++.*[ ]+R_X86_64_PC8[ ]+xtrn-0x0*1 + .*[ ]+R_X86_64_GOT64[ ]+xtrn + .*[ ]+R_X86_64_GOT32[ ]+xtrn + .*[ ]+R_X86_64_GOT32[ ]+xtrn + .*[ ]+R_X86_64_GOTOFF64[ ]+xtrn + .*[ ]+R_X86_64_GOTPCREL[ ]+xtrn + .*[ ]+R_X86_64_GOTPCREL[ ]+xtrn +-.*[ ]+R_X86_64_GOTPCREL[ ]+xtrn\+0xf+c ++.*[ ]+R_X86_64_GOTPCREL[ ]+xtrn-0x0*4 + .*[ ]+R_X86_64_GOTPC32[ ]+_GLOBAL_OFFSET_TABLE_\+0x0*2 +-.*[ ]+R_X86_64_GOTPC32[ ]+_GLOBAL_OFFSET_TABLE_\+0xf+c +-.*[ ]+R_X86_64_GOTPC32[ ]+_GLOBAL_OFFSET_TABLE_\+0xf+c ++.*[ ]+R_X86_64_GOTPC32[ ]+_GLOBAL_OFFSET_TABLE_-0x0*4 ++.*[ ]+R_X86_64_GOTPC32[ ]+_GLOBAL_OFFSET_TABLE_-0x0*4 + .*[ ]+R_X86_64_GOTPC32[ ]+_GLOBAL_OFFSET_TABLE_\+0x0*2 + .*[ ]+R_X86_64_PLT32[ ]+xtrn + .*[ ]+R_X86_64_PLT32[ ]+xtrn +-.*[ ]+R_X86_64_PLT32[ ]+xtrn\+0xf+c ++.*[ ]+R_X86_64_PLT32[ ]+xtrn-0x0*4 + .*[ ]+R_X86_64_TLSGD[ ]+xtrn + .*[ ]+R_X86_64_TLSGD[ ]+xtrn +-.*[ ]+R_X86_64_TLSGD[ ]+xtrn\+0xf+c ++.*[ ]+R_X86_64_TLSGD[ ]+xtrn-0x0*4 + .*[ ]+R_X86_64_GOTTPOFF[ ]+xtrn + .*[ ]+R_X86_64_GOTTPOFF[ ]+xtrn +-.*[ ]+R_X86_64_GOTTPOFF[ ]+xtrn\+0xf+c ++.*[ ]+R_X86_64_GOTTPOFF[ ]+xtrn-0x0*4 + .*[ ]+R_X86_64_TLSLD[ ]+xtrn + .*[ ]+R_X86_64_TLSLD[ ]+xtrn +-.*[ ]+R_X86_64_TLSLD[ ]+xtrn\+0xf+c ++.*[ ]+R_X86_64_TLSLD[ ]+xtrn-0x0*4 + .*[ ]+R_X86_64_DTPOFF64[ ]+xtrn + .*[ ]+R_X86_64_DTPOFF32[ ]+xtrn + .*[ ]+R_X86_64_DTPOFF32[ ]+xtrn +--- binutils/gas/testsuite/gas/ia64/pcrel.d.signed 2005-03-28 14:34:20.000000000 -0800 ++++ binutils/gas/testsuite/gas/ia64/pcrel.d 2007-09-26 09:51:38.000000000 -0700 +@@ -9,28 +9,28 @@ OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[ + 0+10[[:space:]]+PCREL22[[:space:]]+esym + 0+20[[:space:]]+PCREL22[[:space:]]+esym\+0x0+20 + 0+30[[:space:]]+PCREL22[[:space:]]+esym +-0+40[[:space:]]+PCREL22[[:space:]]+esym\+0xf+e0 ++0+40[[:space:]]+PCREL22[[:space:]]+esym-0x0+20 + + RELOCATION RECORDS FOR \[\.movl\]: + OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]* + 0+12[[:space:]]+PCREL64I[[:space:]]+esym + 0+22[[:space:]]+PCREL64I[[:space:]]+esym\+0x0+20 + 0+32[[:space:]]+PCREL64I[[:space:]]+esym +-0+42[[:space:]]+PCREL64I[[:space:]]+esym\+0xf+e0 ++0+42[[:space:]]+PCREL64I[[:space:]]+esym-0x0+20 + + RELOCATION RECORDS FOR \[\.data8\]: + OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]* + 0+10[[:space:]]+PCREL64[LM]SB[[:space:]]+esym + 0+20[[:space:]]+PCREL64[LM]SB[[:space:]]+esym\+0x0+20 + 0+30[[:space:]]+PCREL64[LM]SB[[:space:]]+esym +-0+40[[:space:]]+PCREL64[LM]SB[[:space:]]+esym\+0xf+e0 ++0+40[[:space:]]+PCREL64[LM]SB[[:space:]]+esym-0x0+20 + + RELOCATION RECORDS FOR \[\.data4\]: + OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]* + 0+10[[:space:]]+PCREL32[LM]SB[[:space:]]+esym + 0+20[[:space:]]+PCREL32[LM]SB[[:space:]]+esym\+0x0+20 + 0+30[[:space:]]+PCREL32[LM]SB[[:space:]]+esym +-0+40[[:space:]]+PCREL32[LM]SB[[:space:]]+esym\+0xf+e0 ++0+40[[:space:]]+PCREL32[LM]SB[[:space:]]+esym-0x0+20 + + + Contents of section \.mov: +--- binutils/gas/testsuite/gas/mips/branch-misc-2-64.d.signed 2005-11-23 06:04:18.000000000 -0800 ++++ binutils/gas/testsuite/gas/mips/branch-misc-2-64.d 2007-09-26 09:51:38.000000000 -0700 +@@ -12,51 +12,51 @@ Disassembly of section .text: + \.\.\. + \.\.\. + 0+003c <[^>]*> 04110000 bal 0000000000000040 +-[ ]*3c: R_MIPS_PC16 g1\+0xfffffffffffffffc +-[ ]*3c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*3c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*3c: R_MIPS_PC16 g1-0x4 ++[ ]*3c: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*3c: R_MIPS_NONE \*ABS\*-0x4 + 0+0040 <[^>]*> 00000000 nop + 0+0044 <[^>]*> 04110000 bal 0000000000000048 +-[ ]*44: R_MIPS_PC16 g2\+0xfffffffffffffffc +-[ ]*44: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*44: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*44: R_MIPS_PC16 g2-0x4 ++[ ]*44: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*44: R_MIPS_NONE \*ABS\*-0x4 + 0+0048 <[^>]*> 00000000 nop + 0+004c <[^>]*> 04110000 bal 0000000000000050 +-[ ]*4c: R_MIPS_PC16 g3\+0xfffffffffffffffc +-[ ]*4c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*4c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*4c: R_MIPS_PC16 g3-0x4 ++[ ]*4c: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*4c: R_MIPS_NONE \*ABS\*-0x4 + 0+0050 <[^>]*> 00000000 nop + 0+0054 <[^>]*> 04110000 bal 0000000000000058 +-[ ]*54: R_MIPS_PC16 g4\+0xfffffffffffffffc +-[ ]*54: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*54: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*54: R_MIPS_PC16 g4-0x4 ++[ ]*54: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*54: R_MIPS_NONE \*ABS\*-0x4 + 0+0058 <[^>]*> 00000000 nop + 0+005c <[^>]*> 04110000 bal 0000000000000060 +-[ ]*5c: R_MIPS_PC16 g5\+0xfffffffffffffffc +-[ ]*5c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*5c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*5c: R_MIPS_PC16 g5-0x4 ++[ ]*5c: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*5c: R_MIPS_NONE \*ABS\*-0x4 + 0+0060 <[^>]*> 00000000 nop + 0+0064 <[^>]*> 04110000 bal 0000000000000068 +-[ ]*64: R_MIPS_PC16 g6\+0xfffffffffffffffc +-[ ]*64: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*64: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*64: R_MIPS_PC16 g6-0x4 ++[ ]*64: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*64: R_MIPS_NONE \*ABS\*-0x4 + 0+0068 <[^>]*> 00000000 nop + \.\.\. + \.\.\. + \.\.\. + 0+00a8 <[^>]*> 10000000 b 00000000000000ac +-[ ]*a8: R_MIPS_PC16 x1\+0xfffffffffffffffc +-[ ]*a8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*a8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*a8: R_MIPS_PC16 x1-0x4 ++[ ]*a8: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*a8: R_MIPS_NONE \*ABS\*-0x4 + 0+00ac <[^>]*> 00000000 nop + 0+00b0 <[^>]*> 10000000 b 00000000000000b4 +-[ ]*b0: R_MIPS_PC16 x2\+0xfffffffffffffffc +-[ ]*b0: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*b0: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*b0: R_MIPS_PC16 x2-0x4 ++[ ]*b0: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*b0: R_MIPS_NONE \*ABS\*-0x4 + 0+00b4 <[^>]*> 00000000 nop + 0+00b8 <[^>]*> 10000000 b 00000000000000bc +-[ ]*b8: R_MIPS_PC16 \.data\+0xfffffffffffffffc +-[ ]*b8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*b8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*b8: R_MIPS_PC16 \.data-0x4 ++[ ]*b8: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*b8: R_MIPS_NONE \*ABS\*-0x4 + 0+00bc <[^>]*> 00000000 nop + \.\.\. +--- binutils/gas/testsuite/gas/mips/branch-misc-2pic-64.d.signed 2005-11-23 06:04:18.000000000 -0800 ++++ binutils/gas/testsuite/gas/mips/branch-misc-2pic-64.d 2007-09-26 09:51:38.000000000 -0700 +@@ -12,51 +12,51 @@ Disassembly of section .text: + \.\.\. + \.\.\. + 0+003c <[^>]*> 04110000 bal 0000000000000040 +-[ ]*3c: R_MIPS_PC16 g1\+0xfffffffffffffffc +-[ ]*3c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*3c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*3c: R_MIPS_PC16 g1-0x4 ++[ ]*3c: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*3c: R_MIPS_NONE \*ABS\*-0x4 + 0+0040 <[^>]*> 00000000 nop + 0+0044 <[^>]*> 04110000 bal 0000000000000048 +-[ ]*44: R_MIPS_PC16 g2\+0xfffffffffffffffc +-[ ]*44: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*44: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*44: R_MIPS_PC16 g2-0x4 ++[ ]*44: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*44: R_MIPS_NONE \*ABS\*-0x4 + 0+0048 <[^>]*> 00000000 nop + 0+004c <[^>]*> 04110000 bal 0000000000000050 +-[ ]*4c: R_MIPS_PC16 g3\+0xfffffffffffffffc +-[ ]*4c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*4c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*4c: R_MIPS_PC16 g3-0x4 ++[ ]*4c: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*4c: R_MIPS_NONE \*ABS\*-0x4 + 0+0050 <[^>]*> 00000000 nop + 0+0054 <[^>]*> 04110000 bal 0000000000000058 +-[ ]*54: R_MIPS_PC16 g4\+0xfffffffffffffffc +-[ ]*54: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*54: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*54: R_MIPS_PC16 g4-0x4 ++[ ]*54: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*54: R_MIPS_NONE \*ABS\*-0x4 + 0+0058 <[^>]*> 00000000 nop + 0+005c <[^>]*> 04110000 bal 0000000000000060 +-[ ]*5c: R_MIPS_PC16 g5\+0xfffffffffffffffc +-[ ]*5c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*5c: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*5c: R_MIPS_PC16 g5-0x4 ++[ ]*5c: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*5c: R_MIPS_NONE \*ABS\*-0x4 + 0+0060 <[^>]*> 00000000 nop + 0+0064 <[^>]*> 04110000 bal 0000000000000068 +-[ ]*64: R_MIPS_PC16 g6\+0xfffffffffffffffc +-[ ]*64: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*64: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*64: R_MIPS_PC16 g6-0x4 ++[ ]*64: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*64: R_MIPS_NONE \*ABS\*-0x4 + 0+0068 <[^>]*> 00000000 nop + \.\.\. + \.\.\. + \.\.\. + 0+00a8 <[^>]*> 10000000 b 00000000000000ac +-[ ]*a8: R_MIPS_PC16 x1\+0xfffffffffffffffc +-[ ]*a8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*a8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*a8: R_MIPS_PC16 x1-0x4 ++[ ]*a8: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*a8: R_MIPS_NONE \*ABS\*-0x4 + 0+00ac <[^>]*> 00000000 nop + 0+00b0 <[^>]*> 10000000 b 00000000000000b4 +-[ ]*b0: R_MIPS_PC16 x2\+0xfffffffffffffffc +-[ ]*b0: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*b0: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*b0: R_MIPS_PC16 x2-0x4 ++[ ]*b0: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*b0: R_MIPS_NONE \*ABS\*-0x4 + 0+00b4 <[^>]*> 00000000 nop + 0+00b8 <[^>]*> 10000000 b 00000000000000bc +-[ ]*b8: R_MIPS_PC16 \.data\+0xfffffffffffffffc +-[ ]*b8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc +-[ ]*b8: R_MIPS_NONE \*ABS\*\+0xfffffffffffffffc ++[ ]*b8: R_MIPS_PC16 \.data-0x4 ++[ ]*b8: R_MIPS_NONE \*ABS\*-0x4 ++[ ]*b8: R_MIPS_NONE \*ABS\*-0x4 + 0+00bc <[^>]*> 00000000 nop + \.\.\. +--- binutils/gas/testsuite/gas/mips/ldstla-n64-sym32.d.signed 2005-03-04 01:51:11.000000000 -0800 ++++ binutils/gas/testsuite/gas/mips/ldstla-n64-sym32.d 2007-09-26 09:51:38.000000000 -0700 +@@ -196,19 +196,19 @@ Disassembly .*: + .*: R_MIPS_NONE .* + .* daddu a0,a0,v1 + .* lui a0,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* d?addiu a0,a0,0 +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* lui a0,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* d?addiu a0,a0,0 +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* daddu a0,a0,v1 +@@ -406,20 +406,20 @@ Disassembly .*: + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* lui a0,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* lw a0,0\(a0\) +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* lui a0,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* daddu a0,a0,v1 + .* lw a0,0\(a0\) +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + # +@@ -616,20 +616,20 @@ Disassembly .*: + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* lui at,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* sw a0,0\(at\) +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* lui at,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* daddu at,at,v1 + .* sw a0,0\(at\) +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + # +@@ -880,21 +880,21 @@ Disassembly .*: + .* swl a0,0\(at\) + .* swr a0,3\(at\) + .* lui at,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* d?addiu at,at,0 +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* swl a0,0\(at\) + .* swr a0,3\(at\) + .* lui at,0x0 +-.*: R_MIPS_HI16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_HI16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* d?addiu at,at,0 +-.*: R_MIPS_LO16 extern\+0xfffffffffffcc000 ++.*: R_MIPS_LO16 extern-0x34000 + .*: R_MIPS_NONE .* + .*: R_MIPS_NONE .* + .* daddu at,at,v1 +--- binutils/gas/testsuite/gas/mips/mips16-hilo-n32.d.signed 2005-02-15 11:57:53.000000000 -0800 ++++ binutils/gas/testsuite/gas/mips/mips16-hilo-n32.d 2007-09-26 09:51:38.000000000 -0700 +@@ -141,45 +141,45 @@ Disassembly of section \.text: + 13c: f400 3480 sll a0,16 + 140: f010 4c00 addiu a0,-32768 + 144: f000 6c00 li a0,0 +- 144: R_MIPS16_HI16 \.data\+0xffff8000 ++ 144: R_MIPS16_HI16 \.data-0x8000 + 148: f400 3480 sll a0,16 + 14c: f000 4c00 addiu a0,0 +- 14c: R_MIPS16_LO16 \.data\+0xffff8000 ++ 14c: R_MIPS16_LO16 \.data-0x8000 + 150: f000 6c00 li a0,0 +- 150: R_MIPS16_HI16 \.data\+0xffff8004 ++ 150: R_MIPS16_HI16 \.data-0x7ffc + 154: f400 3480 sll a0,16 + 158: f000 4c00 addiu a0,0 +- 158: R_MIPS16_LO16 \.data\+0xffff8004 ++ 158: R_MIPS16_LO16 \.data-0x7ffc + 15c: f000 6c00 li a0,0 +- 15c: R_MIPS16_HI16 big_external_data_label\+0xffff8000 ++ 15c: R_MIPS16_HI16 big_external_data_label-0x8000 + 160: f400 3480 sll a0,16 + 164: f000 4c00 addiu a0,0 +- 164: R_MIPS16_LO16 big_external_data_label\+0xffff8000 ++ 164: R_MIPS16_LO16 big_external_data_label-0x8000 + 168: f000 6c00 li a0,0 +- 168: R_MIPS16_HI16 small_external_data_label\+0xffff8000 ++ 168: R_MIPS16_HI16 small_external_data_label-0x8000 + 16c: f400 3480 sll a0,16 + 170: f000 4c00 addiu a0,0 +- 170: R_MIPS16_LO16 small_external_data_label\+0xffff8000 ++ 170: R_MIPS16_LO16 small_external_data_label-0x8000 + 174: f000 6c00 li a0,0 +- 174: R_MIPS16_HI16 big_external_common\+0xffff8000 ++ 174: R_MIPS16_HI16 big_external_common-0x8000 + 178: f400 3480 sll a0,16 + 17c: f000 4c00 addiu a0,0 +- 17c: R_MIPS16_LO16 big_external_common\+0xffff8000 ++ 17c: R_MIPS16_LO16 big_external_common-0x8000 + 180: f000 6c00 li a0,0 +- 180: R_MIPS16_HI16 small_external_common\+0xffff8000 ++ 180: R_MIPS16_HI16 small_external_common-0x8000 + 184: f400 3480 sll a0,16 + 188: f000 4c00 addiu a0,0 +- 188: R_MIPS16_LO16 small_external_common\+0xffff8000 ++ 188: R_MIPS16_LO16 small_external_common-0x8000 + 18c: f000 6c00 li a0,0 +- 18c: R_MIPS16_HI16 \.bss\+0xffff8000 ++ 18c: R_MIPS16_HI16 \.bss-0x8000 + 190: f400 3480 sll a0,16 + 194: f000 4c00 addiu a0,0 +- 194: R_MIPS16_LO16 \.bss\+0xffff8000 ++ 194: R_MIPS16_LO16 \.bss-0x8000 + 198: f000 6c00 li a0,0 +- 198: R_MIPS16_HI16 \.sbss\+0xffff8000 ++ 198: R_MIPS16_HI16 \.sbss-0x8000 + 19c: f400 3480 sll a0,16 + 1a0: f000 4c00 addiu a0,0 +- 1a0: R_MIPS16_LO16 \.sbss\+0xffff8000 ++ 1a0: R_MIPS16_LO16 \.sbss-0x8000 + 1a4: 6c01 li a0,1 + 1a6: f400 3480 sll a0,16 + 1aa: 4c00 addiu a0,0 +@@ -399,45 +399,45 @@ Disassembly of section \.text: + 3b4: f400 35a0 sll a1,16 + 3b8: f010 9d80 lw a0,-32768\(a1\) + 3bc: f000 6d00 li a1,0 +- 3bc: R_MIPS16_HI16 \.data\+0xffff8000 ++ 3bc: R_MIPS16_HI16 \.data-0x8000 + 3c0: f400 35a0 sll a1,16 + 3c4: f000 9d80 lw a0,0\(a1\) +- 3c4: R_MIPS16_LO16 \.data\+0xffff8000 ++ 3c4: R_MIPS16_LO16 \.data-0x8000 + 3c8: f000 6d00 li a1,0 +- 3c8: R_MIPS16_HI16 \.data\+0xffff8004 ++ 3c8: R_MIPS16_HI16 \.data-0x7ffc + 3cc: f400 35a0 sll a1,16 + 3d0: f000 9d80 lw a0,0\(a1\) +- 3d0: R_MIPS16_LO16 \.data\+0xffff8004 ++ 3d0: R_MIPS16_LO16 \.data-0x7ffc + 3d4: f000 6d00 li a1,0 +- 3d4: R_MIPS16_HI16 big_external_data_label\+0xffff8000 ++ 3d4: R_MIPS16_HI16 big_external_data_label-0x8000 + 3d8: f400 35a0 sll a1,16 + 3dc: f000 9d80 lw a0,0\(a1\) +- 3dc: R_MIPS16_LO16 big_external_data_label\+0xffff8000 ++ 3dc: R_MIPS16_LO16 big_external_data_label-0x8000 + 3e0: f000 6d00 li a1,0 +- 3e0: R_MIPS16_HI16 small_external_data_label\+0xffff8000 ++ 3e0: R_MIPS16_HI16 small_external_data_label-0x8000 + 3e4: f400 35a0 sll a1,16 + 3e8: f000 9d80 lw a0,0\(a1\) +- 3e8: R_MIPS16_LO16 small_external_data_label\+0xffff8000 ++ 3e8: R_MIPS16_LO16 small_external_data_label-0x8000 + 3ec: f000 6d00 li a1,0 +- 3ec: R_MIPS16_HI16 big_external_common\+0xffff8000 ++ 3ec: R_MIPS16_HI16 big_external_common-0x8000 + 3f0: f400 35a0 sll a1,16 + 3f4: f000 9d80 lw a0,0\(a1\) +- 3f4: R_MIPS16_LO16 big_external_common\+0xffff8000 ++ 3f4: R_MIPS16_LO16 big_external_common-0x8000 + 3f8: f000 6d00 li a1,0 +- 3f8: R_MIPS16_HI16 small_external_common\+0xffff8000 ++ 3f8: R_MIPS16_HI16 small_external_common-0x8000 + 3fc: f400 35a0 sll a1,16 + 400: f000 9d80 lw a0,0\(a1\) +- 400: R_MIPS16_LO16 small_external_common\+0xffff8000 ++ 400: R_MIPS16_LO16 small_external_common-0x8000 + 404: f000 6d00 li a1,0 +- 404: R_MIPS16_HI16 \.bss\+0xffff8000 ++ 404: R_MIPS16_HI16 \.bss-0x8000 + 408: f400 35a0 sll a1,16 + 40c: f000 9d80 lw a0,0\(a1\) +- 40c: R_MIPS16_LO16 \.bss\+0xffff8000 ++ 40c: R_MIPS16_LO16 \.bss-0x8000 + 410: f000 6d00 li a1,0 +- 410: R_MIPS16_HI16 \.sbss\+0xffff8000 ++ 410: R_MIPS16_HI16 \.sbss-0x8000 + 414: f400 35a0 sll a1,16 + 418: f000 9d80 lw a0,0\(a1\) +- 418: R_MIPS16_LO16 \.sbss\+0xffff8000 ++ 418: R_MIPS16_LO16 \.sbss-0x8000 + 41c: 6d01 li a1,1 + 41e: f400 35a0 sll a1,16 + 422: 9d80 lw a0,0\(a1\) +--- binutils/gas/testsuite/gas/ppc/astest.d.signed 2005-03-02 05:25:01.000000000 -0800 ++++ binutils/gas/testsuite/gas/ppc/astest.d 2007-09-26 09:51:38.000000000 -0700 +@@ -52,11 +52,11 @@ Disassembly of section \.text: + 60: 00 00 00 00 \.long 0x0 + 60: R_PPC_ADDR32 z + 64: ff ff ff fc fnmsub f31,f31,f31,f31 +- 64: R_PPC_ADDR32 x\+0xf+ffffffc ++ 64: R_PPC_ADDR32 x-0x4 + 68: 00 00 00 00 \.long 0x0 + 68: R_PPC_ADDR32 \.data + 6c: ff ff ff fc fnmsub f31,f31,f31,f31 +- 6c: R_PPC_ADDR32 z\+0xf+ffffffc ++ 6c: R_PPC_ADDR32 z-0x4 + 70: ff ff ff 9c \.long 0xffffff9c + 74: ff ff ff 9c \.long 0xffffff9c + 78: 00 00 00 00 \.long 0x0 +--- binutils/gas/testsuite/gas/ppc/astest2.d.signed 2005-03-02 05:25:01.000000000 -0800 ++++ binutils/gas/testsuite/gas/ppc/astest2.d 2007-09-26 09:51:38.000000000 -0700 +@@ -48,11 +48,11 @@ Disassembly of section \.text: + 60: 00 00 00 00 \.long 0x0 + 60: R_PPC_ADDR32 z + 64: ff ff ff fc fnmsub f31,f31,f31,f31 +- 64: R_PPC_ADDR32 x\+0xf+ffffffc ++ 64: R_PPC_ADDR32 x-0x4 + 68: 00 00 00 00 \.long 0x0 + 68: R_PPC_ADDR32 \.data + 6c: ff ff ff fc fnmsub f31,f31,f31,f31 +- 6c: R_PPC_ADDR32 z\+0xf+ffffffc ++ 6c: R_PPC_ADDR32 z-0x4 + 70: 00 00 00 08 \.long 0x8 + 74: 00 00 00 08 \.long 0x8 + +--- binutils/gas/testsuite/gas/ppc/astest2_64.d.signed 2005-03-02 05:25:01.000000000 -0800 ++++ binutils/gas/testsuite/gas/ppc/astest2_64.d 2007-09-26 09:51:38.000000000 -0700 +@@ -45,11 +45,11 @@ Disassembly of section \.text: + 58: 00 00 00 00 \.long 0x0 + 58: R_PPC64_ADDR32 z + 5c: ff ff ff fc fnmsub f31,f31,f31,f31 +- 5c: R_PPC64_ADDR32 x\+0xfffffffffffffffc ++ 5c: R_PPC64_ADDR32 x-0x4 + 60: 00 00 00 00 \.long 0x0 + 60: R_PPC64_ADDR32 \.data + 64: ff ff ff fc fnmsub f31,f31,f31,f31 +- 64: R_PPC64_ADDR32 z\+0xfffffffffffffffc ++ 64: R_PPC64_ADDR32 z-0x4 + 68: 00 00 00 08 \.long 0x8 + 6c: 00 00 00 08 \.long 0x8 + +--- binutils/gas/testsuite/gas/ppc/astest64.d.signed 2005-03-02 05:25:01.000000000 -0800 ++++ binutils/gas/testsuite/gas/ppc/astest64.d 2007-09-26 09:51:38.000000000 -0700 +@@ -49,11 +49,11 @@ Disassembly of section \.text: + 58: 00 00 00 00 \.long 0x0 + 58: R_PPC64_ADDR32 z + 5c: ff ff ff fc fnmsub f31,f31,f31,f31 +- 5c: R_PPC64_ADDR32 x\+0xfffffffffffffffc ++ 5c: R_PPC64_ADDR32 x-0x4 + 60: 00 00 00 00 \.long 0x0 + 60: R_PPC64_ADDR32 \.data + 64: ff ff ff fc fnmsub f31,f31,f31,f31 +- 64: R_PPC64_ADDR32 z\+0xfffffffffffffffc ++ 64: R_PPC64_ADDR32 z-0x4 + 68: ff ff ff a4 \.long 0xffffffa4 + 6c: ff ff ff a4 \.long 0xffffffa4 + 70: 00 00 00 00 \.long 0x0 +--- binutils/gas/testsuite/gas/ppc/test1elf32.d.signed 2005-03-02 05:25:01.000000000 -0800 ++++ binutils/gas/testsuite/gas/ppc/test1elf32.d 2007-09-26 09:51:38.000000000 -0700 +@@ -79,7 +79,7 @@ Disassembly of section \.data: + + 0+000c : + c: ff ff ff fc fnmsub f31,f31,f31,f31 +- c: R_PPC_REL32 jk\+0xf+fffc ++ c: R_PPC_REL32 jk-0x4 + + 0+0010 : + 10: 00 00 00 00 \.long 0x0 +--- binutils/gas/testsuite/gas/ppc/test1elf64.d.signed 2005-03-02 05:25:01.000000000 -0800 ++++ binutils/gas/testsuite/gas/ppc/test1elf64.d 2007-09-26 09:51:38.000000000 -0700 +@@ -114,7 +114,7 @@ Disassembly of section \.data: + + 0000000000000014 : + 14: ff ff ff fc fnmsub f31,f31,f31,f31 +- 14: R_PPC64_REL32 jk\+0xfffffffffffffffc ++ 14: R_PPC64_REL32 jk-0x4 + + 0000000000000018 : + 18: 00 00 00 00 \.long 0x0 +--- binutils/gas/testsuite/gas/sparc/reloc64.d.signed 1999-06-10 14:08:04.000000000 -0700 ++++ binutils/gas/testsuite/gas/sparc/reloc64.d 2007-09-26 09:51:38.000000000 -0700 +@@ -35,13 +35,13 @@ Disassembly of section .text: + 44: R_SPARC_LO10 .text + 48: 01 00 00 00 nop + 4c: 03 00 00 00 sethi %hi\((0x|)0\), %g1 +- 4c: R_SPARC_HH22 .text\+0xfedcba9876543210 ++ 4c: R_SPARC_HH22 .text\-0x123456789abcdf0 + 50: 82 10 60 00 mov %g1, %g1 ! 0 +- 50: R_SPARC_HM10 .text\+0xfedcba9876543210 ++ 50: R_SPARC_HM10 .text\-0x123456789abcdf0 + 54: 05 00 00 00 sethi %hi\((0x|)0\), %g2 +- 54: R_SPARC_LM22 .text\+0xfedcba9876543210 ++ 54: R_SPARC_LM22 .text\-0x123456789abcdf0 + 58: 84 10 60 00 mov %g1, %g2 +- 58: R_SPARC_LO10 .text\+0xfedcba9876543210 ++ 58: R_SPARC_LO10 .text\-0x123456789abcdf0 + 5c: 01 00 00 00 nop + 60: 03 2a 61 d9 sethi %hi\(0xa9876400\), %g1 + 64: 82 10 61 43 or %g1, 0x143, %g1.* +@@ -70,7 +70,7 @@ Disassembly of section .text: + a0: R_SPARC_LOX10 .text + a4: 01 00 00 00 nop + a8: 03 00 00 00 sethi %hi\((0x|)0\), %g1 +- a8: R_SPARC_HIX22 .text\+0xffffffff76543210 ++ a8: R_SPARC_HIX22 .text-0x89abcdf0 + ac: 82 18 60 00 xor %g1, 0, %g1 +- ac: R_SPARC_LOX10 .text\+0xffffffff76543210 ++ ac: R_SPARC_LOX10 .text-0x89abcdf0 + b0: 01 00 00 00 nop --- binutils-2.20.1.orig/debian/patches/140_gold_pr10979_1.dpatch +++ binutils-2.20.1/debian/patches/140_gold_pr10979_1.dpatch @@ -0,0 +1,110 @@ +#!/bin/sh -e +## 140_gold_pr10979_1.dpatch +## +## DP: Description: PR gold/10979: Fix internal errors + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2009-12-30 Ian Lance Taylor + + PR 10979 + * script.cc (read_input_script): If we see a new SECTIONS clause, + and we have added an input section, give an error. + * layout.h (class Layout): Add have_added_input_section function. + Add have_added_input_section_ field. + * layout.cc (Layout::Layout): Initialize + have_added_input_section_. + (Layout::layout): Set have_added_input_section_. + (Layout::layout_eh_frame): Likewise. + +@DPATCH@ +--- ./gold/layout.cc 30 Dec 2009 07:45:32 -0000 1.153 ++++ ./gold/layout.cc 31 Dec 2009 03:46:57 -0000 +@@ -192,6 +192,7 @@ Layout::Layout(int number_of_input_files + debug_info_(NULL), + group_signatures_(), + output_file_size_(-1), ++ have_added_input_section_(false), + sections_are_attached_(false), + input_requires_executable_stack_(false), + input_with_gnu_stack_note_(false), +@@ -610,6 +611,7 @@ Layout::layout(Sized_relobjadd_input_section(object, shndx, name, shdr, reloc_shndx, + this->script_options_->saw_sections_clause()); ++ this->have_added_input_section_ = true; + + return os; + } +@@ -818,6 +820,7 @@ Layout::layout_eh_frame(Sized_relobjscript_options_->saw_sections_clause(); + *off = os->add_input_section(object, shndx, name, shdr, reloc_shndx, + saw_sections_clause); ++ this->have_added_input_section_ = true; + } + + return os; +--- ./gold/layout.h 30 Dec 2009 06:57:17 -0000 1.75 ++++ ./gold/layout.h 31 Dec 2009 03:46:57 -0000 +@@ -433,6 +433,11 @@ class Layout + is_linkonce(const char* name) + { return strncmp(name, ".gnu.linkonce", sizeof(".gnu.linkonce") - 1) == 0; } + ++ // Whether we have added an input section. ++ bool ++ have_added_input_section() const ++ { return this->have_added_input_section_; } ++ + // Return true if a section is a debugging section. + static inline bool + is_debug_info_section(const char* name) +@@ -990,6 +995,8 @@ class Layout + Group_signatures group_signatures_; + // The size of the output file. + off_t output_file_size_; ++ // Whether we have added an input section to an output section. ++ bool have_added_input_section_; + // Whether we have attached the sections to the segments. + bool sections_are_attached_; + // Whether we have seen an object file marked to require an +--- ./gold/script.cc 30 Dec 2009 22:35:48 -0000 1.63 ++++ ./gold/script.cc 31 Dec 2009 03:46:58 -0000 +@@ -1398,6 +1398,9 @@ read_input_script(Workqueue* workqueue, + &lex, + input_file->will_search_for()); + ++ bool old_saw_sections_clause = ++ layout->script_options()->saw_sections_clause(); ++ + if (yyparse(&closure) != 0) + { + if (closure.found_incompatible_target()) +@@ -1411,6 +1414,12 @@ read_input_script(Workqueue* workqueue, + return false; + } + ++ if (!old_saw_sections_clause ++ && layout->script_options()->saw_sections_clause() ++ && layout->have_added_input_section()) ++ gold_error(_("%s: SECTIONS seen after other input files; try -T/--script"), ++ input_file->filename().c_str()); ++ + if (!closure.saw_inputs()) + return true; + --- binutils-2.20.1.orig/debian/patches/133_enable_gold.dpatch +++ binutils-2.20.1/debian/patches/133_enable_gold.dpatch @@ -0,0 +1,607 @@ +#!/bin/sh -e +## 133_enable_gold.dpatch +## +## DP: Description: add --enable-gold configure option + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2009-11-03 Roland McGrath + H.J. Lu + + * configure.ac (--enable-gold): Accept --enable-gold=both to + add gold to configdirs without removing ld. + * configure: Regenerated. + +gold/ + +2009-11-03 H.J. Lu + + * Makefile.am (install-exec-local): Install as @installed_linker@. + Install as ld if "@linker@" == "ld.gold" and @installed_linker@ + != "ld". + * Makefile.in: Regenerated. + + * configure.ac (installed_linker): New substituted variable. Set + by --enable-gold. + (linker): New substituted variable. Set by --enable-gold and + --enable-linker. + * configure: Regenerated. + +ld/ + +2009-11-03 H.J. Lu + + * Makefile.am (transform): Install as @installed_linker@. + (install-exec-local): Depend on install-binPROGRAMS. Install + as @installed_linker@. Install as ld if "@linker@" == "ld.bfd" + and @installed_linker@ != "ld". + * Makefile.in: Regenerated. + + * configure.ac (installed_linker): New substituted variable. Set + by --enable-gold. + (linker): New substituted variable. Set by --enable-gold and + --enable-linker. + * configure: Regenerated. + +@DPATCH@ +diff --git a/configure b/configure +index 1ece75c..e353f63 100755 +--- a/configure ++++ b/configure +@@ -1482,7 +1482,7 @@ Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] +- --enable-gold use gold instead of ld ++ --enable-gold[=ARG] build gold [ARG={yes,both}] + --enable-libada build libada directory + --enable-libssp build libssp directory + --enable-build-with-cxx build with C++ compiler instead of C compiler +@@ -3076,7 +3076,8 @@ else + ENABLE_GOLD=no + fi + +-if test "${ENABLE_GOLD}" = "yes"; then ++case "${ENABLE_GOLD}" in ++yes|both) + # Check for ELF target. + is_elf=no + case "${target}" in +@@ -3096,11 +3097,17 @@ if test "${ENABLE_GOLD}" = "yes"; then + # Check for target supported by gold. + case "${target}" in + i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*) +- configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" ++ if test "${ENABLE_GOLD}" = both; then ++ configdirs="$configdirs gold" ++ else ++ configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" ++ fi + ;; + esac + fi +-fi ++ ENABLE_GOLD=yes ++ ;; ++esac + + # Configure extra directories which are host specific + +diff --git a/configure.ac b/configure.ac +index 407ab59..b349633 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -311,10 +311,11 @@ esac + # Handle --enable-gold. + + AC_ARG_ENABLE(gold, +-[ --enable-gold use gold instead of ld], ++[ --enable-gold[[=ARG]] build gold [[ARG={yes,both}]]], + ENABLE_GOLD=$enableval, + ENABLE_GOLD=no) +-if test "${ENABLE_GOLD}" = "yes"; then ++case "${ENABLE_GOLD}" in ++yes|both) + # Check for ELF target. + is_elf=no + case "${target}" in +@@ -334,11 +335,17 @@ if test "${ENABLE_GOLD}" = "yes"; then + # Check for target supported by gold. + case "${target}" in + i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*) +- configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" ++ if test "${ENABLE_GOLD}" = both; then ++ configdirs="$configdirs gold" ++ else ++ configdirs="`echo " ${configdirs} " | sed -e 's/ ld / gold /'`" ++ fi + ;; + esac + fi +-fi ++ ENABLE_GOLD=yes ++ ;; ++esac + + # Configure extra directories which are host specific + +diff --git a/gold/Makefile.am b/gold/Makefile.am +index 8d8b617..85b103b 100644 +--- a/gold/Makefile.am ++++ b/gold/Makefile.am +@@ -163,12 +163,20 @@ check: libgold.a + + install-exec-local: ld-new$(EXEEXT) + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin +- n=`echo ld | sed '$(transform)'`; \ ++ n=`echo @installed_linker@ | sed '$(transform)'`; \ + $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \ +- if test "$(bindir)" != "$(tooldir)/bin"; then \ +- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ +- ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ ++ if test "@linker@" = "ld.gold"; then \ ++ if test "@installed_linker@" != "ld"; then \ ++ ld=`echo ld | sed '$(transform)'`; \ ++ rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \ ++ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ ++ fi; \ ++ if test "$(bindir)" != "$(tooldir)/bin"; then \ ++ rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ + || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ fi; \ + fi + + # We want install to imply install-info as per GNU standards, despite +diff --git a/gold/Makefile.in b/gold/Makefile.in +index d4c689b..9b5c860 100644 +--- a/gold/Makefile.in ++++ b/gold/Makefile.in +@@ -303,8 +303,10 @@ htmldir = @htmldir@ + includedir = @includedir@ + infodir = @infodir@ + install_sh = @install_sh@ ++installed_linker = @installed_linker@ + libdir = @libdir@ + libexecdir = @libexecdir@ ++linker = @linker@ + localedir = @localedir@ + localstatedir = @localstatedir@ + mandir = @mandir@ +@@ -1200,12 +1202,20 @@ check: libgold.a + + install-exec-local: ld-new$(EXEEXT) + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin +- n=`echo ld | sed '$(transform)'`; \ ++ n=`echo @installed_linker@ | sed '$(transform)'`; \ + $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \ +- if test "$(bindir)" != "$(tooldir)/bin"; then \ +- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ +- ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ ++ if test "@linker@" = "ld.gold"; then \ ++ if test "@installed_linker@" != "ld"; then \ ++ ld=`echo ld | sed '$(transform)'`; \ ++ rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \ ++ || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ ++ fi; \ ++ if test "$(bindir)" != "$(tooldir)/bin"; then \ ++ rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ + || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ fi; \ + fi + + # We want install to imply install-info as per GNU standards, despite +diff --git a/gold/configure b/gold/configure +index e4eb9fb..407e580 100755 +--- a/gold/configure ++++ b/gold/configure +@@ -682,6 +682,8 @@ PLUGINS_FALSE + PLUGINS_TRUE + THREADS_FALSE + THREADS_TRUE ++linker ++installed_linker + am__untar + am__tar + AMTAR +@@ -759,6 +761,8 @@ ac_subst_files='' + ac_user_opts=' + enable_option_checking + with_sysroot ++enable_gold ++enable_linker + enable_threads + enable_plugins + enable_targets +@@ -1403,6 +1407,8 @@ Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --enable-gold[=ARG] build gold [ARG={yes,both}] ++ --enable-linker=[ARG] specify the default linker [ARG={bfd,gold}] + --enable-threads multi-threaded linking + --enable-plugins linker plugins + --enable-targets alternative target configurations +@@ -3227,6 +3233,35 @@ cat >>confdefs.h <<_ACEOF + _ACEOF + + ++# Check whether --enable-gold was given. ++if test "${enable_gold+set}" = set; then : ++ enableval=$enable_gold; if test "${enableval}" = "both"; then ++ bfd_linker=ld.bfd ++ installed_linker=ld.gold ++ else ++ bfd_linker=ld.gold ++ installed_linker=ld ++ fi ++else ++ bfd_linker=ld.bfd ++ installed_linker=ld ++fi ++ ++ ++ ++# Check whether --enable-linker was given. ++if test "${enable_linker+set}" = set; then : ++ enableval=$enable_linker; if test "${enableval}" = "gold"; then ++ linker=ld.gold ++ else ++ linker=$bfd_linker ++ fi ++else ++ linker=$bfd_linker ++fi ++ ++ ++ + # Check whether --enable-threads was given. + if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; case "${enableval}" in +diff --git a/gold/configure.ac b/gold/configure.ac +index 85e23f9..10389a9 100644 +--- a/gold/configure.ac ++++ b/gold/configure.ac +@@ -38,6 +38,29 @@ AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT, "$sysroot", + AC_DEFINE_UNQUOTED(TARGET_SYSTEM_ROOT_RELOCATABLE, $sysroot_relocatable, + [Whether the system root can be relocated]) + ++AC_ARG_ENABLE(gold, ++[ --enable-gold[[=ARG]] build gold [[ARG={yes,both}]]], ++[if test "${enableval}" = "both"; then ++ bfd_linker=ld.bfd ++ installed_linker=ld.gold ++ else ++ bfd_linker=ld.gold ++ installed_linker=ld ++ fi], ++[bfd_linker=ld.bfd ++ installed_linker=ld]) ++AC_SUBST(installed_linker) ++ ++AC_ARG_ENABLE(linker, ++[ --enable-linker=[[ARG]] specify the default linker [[ARG={bfd,gold}]]], ++[if test "${enableval}" = "gold"; then ++ linker=ld.gold ++ else ++ linker=$bfd_linker ++ fi], ++[linker=$bfd_linker]) ++AC_SUBST(linker) ++ + dnl For now threads are a configure time option. + AC_ARG_ENABLE([threads], + [ --enable-threads multi-threaded linking], +diff --git a/ld/Makefile.am b/ld/Makefile.am +index c1d3dbf..1930a8b 100644 +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -95,7 +95,7 @@ CXX_FOR_TARGET = ` \ + fi; \ + fi` + +-transform = s/^ld-new$$/ld/;@program_transform_name@ ++transform = s/^ld-new$$/@installed_linker@/;$(program_transform_name) + bin_PROGRAMS = ld-new + info_TEXINFOS = ld.texinfo + ld_TEXINFOS = configdoc.texi +@@ -1959,13 +1959,21 @@ CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 spu_ovl.s spu_ovl.o spu_icache.s spu_ica + + .PHONY: install-exec-local install-data-local + +-install-exec-local: ld-new$(EXEEXT) ++install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS + $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin +- n=`echo ld | sed '$(transform)'`; \ +- if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \ +- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ +- ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ +- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ n=`echo @installed_linker@ | sed '$(transform)'`; \ ++ if test "@linker@" = "ld.bfd"; then \ ++ if test "@installed_linker@" != "ld"; then \ ++ ld=`echo ld | sed '$(transform)'`; \ ++ rm -f $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \ ++ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ ++ fi; \ ++ if test "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)"; then \ ++ rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ ++ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ fi; \ + fi + + install-data-local: +diff --git a/ld/Makefile.in b/ld/Makefile.in +index 0da0fff..2c5ab4a 100644 +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -152,7 +152,7 @@ CTAGS = ctags + DEJATOOL = $(PACKAGE) + RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir + DIST_SUBDIRS = $(SUBDIRS) +-transform = s/^ld-new$$/ld/;@program_transform_name@ ++transform = s/^ld-new$$/@installed_linker@/;$(program_transform_name) + ACLOCAL = @ACLOCAL@ + AMTAR = @AMTAR@ + AR = @AR@ +@@ -293,8 +293,10 @@ htmldir = @htmldir@ + includedir = @includedir@ + infodir = @infodir@ + install_sh = @install_sh@ ++installed_linker = @installed_linker@ + libdir = @libdir@ + libexecdir = @libexecdir@ ++linker = @linker@ + localedir = @localedir@ + localstatedir = @localstatedir@ + lt_ECHO = @lt_ECHO@ +@@ -3274,13 +3276,21 @@ mostlyclean-local: + + .PHONY: install-exec-local install-data-local + +-install-exec-local: ld-new$(EXEEXT) ++install-exec-local: ld-new$(EXEEXT) install-binPROGRAMS + $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin +- n=`echo ld | sed '$(transform)'`; \ +- if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \ +- rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ +- ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ +- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ n=`echo @installed_linker@ | sed '$(transform)'`; \ ++ if test "@linker@" = "ld.bfd"; then \ ++ if test "@installed_linker@" != "ld"; then \ ++ ld=`echo ld | sed '$(transform)'`; \ ++ rm -f $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \ ++ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \ ++ fi; \ ++ if test "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)"; then \ ++ rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ ++ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ ++ fi; \ + fi + + install-data-local: +diff --git a/ld/configure b/ld/configure +index 9eb6a17..088a24d 100755 +--- a/ld/configure ++++ b/ld/configure +@@ -797,6 +797,8 @@ GREP + CPP + NO_WERROR + WARN_CFLAGS ++linker ++installed_linker + TARGET_SYSTEM_ROOT_DEFINE + TARGET_SYSTEM_ROOT + use_sysroot +@@ -901,6 +903,8 @@ with_lib_path + enable_targets + enable_64_bit_bfd + with_sysroot ++enable_gold ++enable_linker + enable_got + enable_werror + enable_build_warnings +@@ -1548,6 +1552,8 @@ Optional Features: + (and sometimes confusing) to the casual installer + --enable-targets alternative target configurations + --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) ++ --enable-gold[=ARG] build gold [ARG={yes,both}] ++ --enable-linker=[ARG] specify the default linker [ARG={bfd,gold}] + --enable-got= GOT handling scheme (target, single, negative, + multigot) + --enable-werror treat compile warnings as errors +@@ -4302,6 +4308,35 @@ fi + + + ++# Check whether --enable-gold was given. ++if test "${enable_gold+set}" = set; then : ++ enableval=$enable_gold; if test "${enableval}" = "both"; then ++ gold_linker=ld.gold ++ installed_linker=ld.bfd ++else ++ gold_linker=ld.bfd ++ installed_linker=ld ++fi ++else ++ gold_linker=ld.bfd ++ installed_linker=ld ++fi ++ ++ ++ ++# Check whether --enable-linker was given. ++if test "${enable_linker+set}" = set; then : ++ enableval=$enable_linker; if test "${enableval}" = "gold"; then ++ linker=$gold_linker ++ else ++ linker=ld.bfd ++ fi ++else ++ linker=ld.bfd ++fi ++ ++ ++ + # Check whether --enable-got was given. + if test "${enable_got+set}" = set; then : + enableval=$enable_got; case "${enableval}" in +@@ -6087,13 +6122,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : + else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext +- (eval echo "\"\$as_me:6090: $ac_compile\"" >&5) ++ (eval echo "\"\$as_me:6125: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 +- (eval echo "\"\$as_me:6093: $NM \\\"conftest.$ac_objext\\\"\"" >&5) ++ (eval echo "\"\$as_me:6128: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 +- (eval echo "\"\$as_me:6096: output\"" >&5) ++ (eval echo "\"\$as_me:6131: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" +@@ -7298,7 +7333,7 @@ ia64-*-hpux*) + ;; + *-*-irix6*) + # Find out which ABI we are using. +- echo '#line 7301 "configure"' > conftest.$ac_ext ++ echo '#line 7336 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +@@ -8560,11 +8595,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8563: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8598: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:8567: \$? = $ac_status" >&5 ++ echo "$as_me:8602: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -8899,11 +8934,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8902: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8937: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:8906: \$? = $ac_status" >&5 ++ echo "$as_me:8941: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -9004,11 +9039,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:9007: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:9042: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:9011: \$? = $ac_status" >&5 ++ echo "$as_me:9046: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -9059,11 +9094,11 @@ else + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:9062: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:9097: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:9066: \$? = $ac_status" >&5 ++ echo "$as_me:9101: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -11441,7 +11476,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11444 "configure" ++#line 11479 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11537,7 +11572,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11540 "configure" ++#line 11575 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +diff --git a/ld/configure.in b/ld/configure.in +index c4655f5..9786953 100644 +--- a/ld/configure.in ++++ b/ld/configure.in +@@ -69,6 +69,29 @@ AC_SUBST(use_sysroot) + AC_SUBST(TARGET_SYSTEM_ROOT) + AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) + ++AC_ARG_ENABLE(gold, ++[ --enable-gold[[=ARG]] build gold [[ARG={yes,both}]]], ++[if test "${enableval}" = "both"; then ++ gold_linker=ld.gold ++ installed_linker=ld.bfd ++else ++ gold_linker=ld.bfd ++ installed_linker=ld ++fi], ++[gold_linker=ld.bfd ++ installed_linker=ld]) ++AC_SUBST(installed_linker) ++ ++AC_ARG_ENABLE(linker, ++[ --enable-linker=[[ARG]] specify the default linker [[ARG={bfd,gold}]]], ++[if test "${enableval}" = "gold"; then ++ linker=$gold_linker ++ else ++ linker=ld.bfd ++ fi], ++[linker=ld.bfd]) ++AC_SUBST(linker) ++ + AC_ARG_ENABLE([got], + AS_HELP_STRING([--enable-got=], + [GOT handling scheme (target, single, negative, multigot)]), --- binutils-2.20.1.orig/debian/patches/309-pr17512-misc.dpatch +++ binutils-2.20.1/debian/patches/309-pr17512-misc.dpatch @@ -0,0 +1,935 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 309-pr17512-misc.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: misc crasher fixes + +@DPATCH@ + +From 513ea82edf8533e3483073561c06be97de035c83 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Thu, 14 Aug 2014 15:53:19 +0930 +Subject: [PATCH] Fix for objdump segfault on broken PE executable + + * peXXigen.c (pe_print_reloc): Protect against access past end + of .reloc section. + +From 32a9d621c3c480aa093a089a36e36c35f68a4010 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Mon, 17 Nov 2014 16:59:09 +0000 +Subject: [PATCH] Applies a series of patches for PR 17512 and 17533 +which fix invalid memory accesses. +Origin: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=32a9d621c3c480aa093a089a36e36c35f68a4010 +Bug-Upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=17512#c95 + +[Cherrypicked fixes] + + * aoutx.h (aout_get_external_symbols): Tidy allocation of symbol buffer. + + * coff-i386.c (NUM_HOWTOS): New define. + (RTYPE2HOWTO): Use it. + (coff_i386_rtype_to_howto): Likewise. + (coff_i386_reloc_name_lookup): Likewise. + (CALC_ADDEND): Check that reloc r_type field is valid. + + * coff-x86_64.c (NUM_HOWTOS): New define. + (RTYPE2HOWTO): Use it. + (coff_amd64_rtype_to_howto): Likewise. + (coff_amd64_reloc_name_lookup): Likewise. + (CALC_ADDEND): Check that reloc r_type field is valid. + + * ieee.c (ieee_archive_p) Skip processing if no bytes are read at + all. + (ieee_object_p): Likewise. + + * opncls.c (bfd_alloc): Catch the case where a small negative size + can result in only 1 byte being allocated. + * opncls.c (bfd_get_debug_link_info): Avoid reading off the end of + the section. + (bfd_get_alt_debug_link_info): Likewise. + + * pe-mips.c (NUM_HOWTOS): New define. + (coff_mips_reloc_name_lookup): Use it. + (CALC_ADDEND): Check that reloc r_type field is valid. + * pe-mips.c (NUM_HOWTOS): Typo fix. + + * peXXigen.c (pe_print_idata): Add range checking displaying + member names. + * peXXigen.c (_bfd_XXi_swap_sym_in): Replace abort()'s with + error messages. + * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Initialise unused entries + in the DataDirectory. + * peXXigen.c (pe_print_idata): Add range checks. + (pe_print_edata): Likewise. + + * objdump.c (slurp_symtab): Fail gracefully if the table could not + be read. + (dump_relocs_in_section): Likewise. + * objdump.c (dump_dwarf): Replace abort with a warning message. + (print_section_stabs): Improve range checks. + + * rdcoff.c (coff_get_slot): Use long for indx parameter type. + Add check for an excesively large index. + * rddbg.c (read_section_stabs_debugging_info): Zero terminate the + string table. Avoid walking off the end of the stabs data. + + * stabs.c (parse_stab_string): Add check for a NULL name. + +--- a/bfd/aoutx.h ++++ b/bfd/aoutx.h +@@ -1296,14 +1296,14 @@ aout_get_external_symbols (bfd *abfd) + { + bfd_size_type count; + struct external_nlist *syms; ++ bfd_size_type amt = exec_hdr (abfd)->a_syms; + +- count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE; ++ count = amt / EXTERNAL_NLIST_SIZE; + if (count == 0) + return TRUE; /* Nothing to do. */ + + #ifdef USE_MMAP +- if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), +- exec_hdr (abfd)->a_syms, ++ if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), amt, + &obj_aout_sym_window (abfd), TRUE)) + return FALSE; + syms = (struct external_nlist *) obj_aout_sym_window (abfd).data; +@@ -1311,20 +1311,16 @@ aout_get_external_symbols (bfd *abfd) + /* We allocate using malloc to make the values easy to free + later on. If we put them on the objalloc it might not be + possible to free them. */ +- syms = (struct external_nlist *) bfd_malloc (count * EXTERNAL_NLIST_SIZE); ++ syms = (struct external_nlist *) bfd_malloc (amt); + if (syms == NULL) + return FALSE; + +- { +- bfd_size_type amt; +- amt = exec_hdr (abfd)->a_syms; +- if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 +- || bfd_bread (syms, amt, abfd) != amt) +- { +- free (syms); +- return FALSE; +- } +- } ++ if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 ++ || bfd_bread (syms, amt, abfd) != amt) ++ { ++ free (syms); ++ return FALSE; ++ } + #endif + + obj_aout_external_syms (abfd) = syms; +--- a/bfd/coff-i386.c ++++ b/bfd/coff-i386.c +@@ -349,16 +349,18 @@ static reloc_howto_type howto_table[] = + PCRELOFFSET) /* pcrel_offset */ + }; + ++#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0])) ++ + /* Turn a howto into a reloc nunmber */ + + #define SELECT_RELOC(x,howto) { x.r_type = howto->type; } + #define BADMAG(x) I386BADMAG(x) + #define I386 1 /* Customize coffcode.h */ + +-#define RTYPE2HOWTO(cache_ptr, dst) \ +- ((cache_ptr)->howto = \ +- ((dst)->r_type < sizeof (howto_table) / sizeof (howto_table[0]) \ +- ? howto_table + (dst)->r_type \ ++#define RTYPE2HOWTO(cache_ptr, dst) \ ++ ((cache_ptr)->howto = \ ++ ((dst)->r_type < NUM_HOWTOS \ ++ ? howto_table + (dst)->r_type \ + : NULL)) + + /* For 386 COFF a STYP_NOLOAD | STYP_BSS section is part of a shared +@@ -395,7 +397,8 @@ static reloc_howto_type howto_table[] = + cache_ptr->addend = - (ptr->section->vma + ptr->value); \ + else \ + cache_ptr->addend = 0; \ +- if (ptr && howto_table[reloc.r_type].pc_relative) \ ++ if (ptr && reloc.r_type < NUM_HOWTOS \ ++ && howto_table[reloc.r_type].pc_relative) \ + cache_ptr->addend += asect->vma; \ + } + +@@ -455,7 +458,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel + { + reloc_howto_type *howto; + +- if (rel->r_type >= sizeof (howto_table) / sizeof (howto_table[0])) ++ if (rel->r_type >= NUM_HOWTOS) + { + bfd_set_error (bfd_error_bad_value); + return NULL; +@@ -592,7 +595,7 @@ coff_i386_reloc_name_lookup (bfd *abfd A + { + unsigned int i; + +- for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) ++ for (i = 0; i < NUM_HOWTOS; i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; +--- a/bfd/coff-x86_64.c ++++ b/bfd/coff-x86_64.c +@@ -449,6 +449,8 @@ static reloc_howto_type howto_table[] = + PCRELOFFSET) /* pcrel_offset */ + }; + ++#define NUM_HOWTOS ARRAY_SIZE (howto_table) ++ + /* Turn a howto into a reloc nunmber */ + + #define SELECT_RELOC(x,howto) { x.r_type = howto->type; } +@@ -457,7 +459,7 @@ static reloc_howto_type howto_table[] = + + #define RTYPE2HOWTO(cache_ptr, dst) \ + ((cache_ptr)->howto = \ +- ((dst)->r_type < ARRAY_SIZE (howto_table)) \ ++ ((dst)->r_type < NUM_HOWTOS) \ + ? howto_table + (dst)->r_type \ + : NULL) + +@@ -497,7 +499,8 @@ static reloc_howto_type howto_table[] = + cache_ptr->addend = - (ptr->section->vma + ptr->value); \ + else \ + cache_ptr->addend = 0; \ +- if (ptr && howto_table[reloc.r_type].pc_relative) \ ++ if (ptr && reloc.r_type < NUM_HOWTOS \ ++ && howto_table[reloc.r_type].pc_relative) \ + cache_ptr->addend += asect->vma; \ + } + +@@ -547,7 +550,7 @@ coff_amd64_rtype_to_howto (bfd *abfd ATT + { + reloc_howto_type *howto; + +- if (rel->r_type > ARRAY_SIZE (howto_table)) ++ if (rel->r_type >= NUM_HOWTOS) + { + bfd_set_error (bfd_error_bad_value); + return NULL; +@@ -689,7 +692,7 @@ coff_amd64_reloc_name_lookup (bfd *abfd + { + unsigned int i; + +- for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++) ++ for (i = 0; i < NUM_HOWTOS; i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; +--- a/bfd/ieee.c ++++ b/bfd/ieee.c +@@ -1313,7 +1313,8 @@ ieee_archive_p (bfd *abfd) + + /* Ignore the return value here. It doesn't matter if we don't read + the entire buffer. We might have a very small ieee file. */ +- bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd); ++ if (bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd) <= 0) ++ goto got_wrong_format_error; + + ieee->h.first_byte = buffer; + ieee->h.input_p = buffer; +@@ -1802,7 +1803,8 @@ ieee_object_p (bfd *abfd) + goto fail; + /* Read the first few bytes in to see if it makes sense. Ignore + bfd_bread return value; The file might be very small. */ +- bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd); ++ if (bfd_bread ((void *) buffer, (bfd_size_type) sizeof (buffer), abfd) <= 0) ++ goto got_wrong_format; + + ieee->h.input_p = buffer; + if (this_byte_and_next (&(ieee->h)) != Module_Beginning) +--- a/bfd/opncls.c ++++ b/bfd/opncls.c +@@ -916,14 +916,19 @@ void * + bfd_alloc (bfd *abfd, bfd_size_type size) + { + void *ret; ++ unsigned long ul_size = (unsigned long) size; + +- if (size != (unsigned long) size) ++ if (size != ul_size ++ /* A small negative size can result in objalloc_alloc allocating just ++ 1 byte of memory, but the caller will be expecting more. So catch ++ this case here. */ ++ || (size != 0 && (((ul_size + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1)) == 0))) + { + bfd_set_error (bfd_error_no_memory); + return NULL; + } +- +- ret = objalloc_alloc ((struct objalloc *) abfd->memory, (unsigned long) size); ++ ++ ret = objalloc_alloc ((struct objalloc *) abfd->memory, ul_size); + if (ret == NULL) + bfd_set_error (bfd_error_no_memory); + return ret; +@@ -944,8 +949,6 @@ DESCRIPTION + void * + bfd_alloc2 (bfd *abfd, bfd_size_type nmemb, bfd_size_type size) + { +- void *ret; +- + if ((nmemb | size) >= HALF_BFD_SIZE_TYPE + && size != 0 + && nmemb > ~(bfd_size_type) 0 / size) +@@ -954,18 +957,7 @@ bfd_alloc2 (bfd *abfd, bfd_size_type nme + return NULL; + } + +- size *= nmemb; +- +- if (size != (unsigned long) size) +- { +- bfd_set_error (bfd_error_no_memory); +- return NULL; +- } +- +- ret = objalloc_alloc ((struct objalloc *) abfd->memory, (unsigned long) size); +- if (ret == NULL) +- bfd_set_error (bfd_error_no_memory); +- return ret; ++ return bfd_alloc (abfd, size * nmemb); + } + + /* +@@ -1154,7 +1146,7 @@ get_debug_link_info (bfd *abfd, unsigned + asection *sect; + unsigned long crc32; + bfd_byte *contents; +- int crc_offset; ++ unsigned int crc_offset; + char *name; + + BFD_ASSERT (abfd); +@@ -1172,10 +1164,13 @@ get_debug_link_info (bfd *abfd, unsigned + return NULL; + } + +- /* Crc value is stored after the filename, aligned up to 4 bytes. */ ++ /* CRC value is stored after the filename, aligned up to 4 bytes. */ + name = (char *) contents; +- crc_offset = strlen (name) + 1; ++ /* PR 17597: avoid reading off the end of the buffer. */ ++ crc_offset = strnlen (name, bfd_get_section_size (sect)) + 1; + crc_offset = (crc_offset + 3) & ~3; ++ if (crc_offset >= bfd_get_section_size (sect)) ++ return NULL; + + crc32 = bfd_get_32 (abfd, contents + crc_offset); + +--- a/bfd/pe-mips.c ++++ b/bfd/pe-mips.c +@@ -341,6 +341,8 @@ static reloc_howto_type howto_table[] = + FALSE), /* Pcrel_offset. */ + }; + ++#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0])) ++ + /* Turn a howto into a reloc nunmber. */ + + #define SELECT_RELOC(x, howto) { x.r_type = howto->type; } +@@ -381,7 +383,8 @@ static reloc_howto_type howto_table[] = + cache_ptr->addend = - (ptr->section->vma + ptr->value); \ + else \ + cache_ptr->addend = 0; \ +- if (ptr && howto_table[reloc.r_type].pc_relative) \ ++ if (ptr && reloc.r_type < NUM_HOWTOS \ ++ && howto_table[reloc.r_type].pc_relative) \ + cache_ptr->addend += asect->vma; \ + } + +@@ -511,9 +514,7 @@ coff_mips_reloc_name_lookup (bfd *abfd A + { + unsigned int i; + +- for (i = 0; +- i < sizeof (howto_table) / sizeof (howto_table[0]); +- i++) ++ for (i = 0; i < NUM_HOWTOS; i++) + if (howto_table[i].name != NULL + && strcasecmp (howto_table[i].name, r_name) == 0) + return &howto_table[i]; +--- a/bfd/peXXigen.c ++++ b/bfd/peXXigen.c +@@ -142,8 +142,13 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * + + name = _bfd_coff_internal_syment_name (abfd, in, namebuf); + if (name == NULL) +- /* FIXME: Return error. */ +- abort (); ++ { ++ _bfd_error_handler (_("%B: unable to find name for empty section"), ++ abfd); ++ bfd_set_error (bfd_error_invalid_target); ++ return; ++ } ++ + sec = bfd_get_section_by_name (abfd, name); + if (sec != NULL) + in->n_scnum = sec->target_index; +@@ -163,15 +168,22 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * + { + name = (const char *) bfd_alloc (abfd, strlen (namebuf) + 1); + if (name == NULL) +- /* FIXME: Return error. */ +- abort (); ++ { ++ _bfd_error_handler (_("%B: out of memory creating name for empty section"), ++ abfd); ++ return; ++ } + strcpy ((char *) name, namebuf); + } ++ + flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_DATA | SEC_LOAD; + sec = bfd_make_section_anyway_with_flags (abfd, name, flags); + if (sec == NULL) +- /* FIXME: Return error. */ +- abort (); ++ { ++ _bfd_error_handler (_("%B: unable to create fake empty section"), ++ abfd); ++ return; ++ } + + sec->vma = 0; + sec->lma = 0; +@@ -240,6 +252,9 @@ _bfd_XXi_swap_aux_in (bfd * abfd, + AUXENT *ext = (AUXENT *) ext1; + union internal_auxent *in = (union internal_auxent *) in1; + ++ /* PR 17521: Make sure that all fields in the aux structure ++ are initialised. */ ++ memset (in, 0, sizeof * in); + switch (in_class) + { + case C_FILE: +@@ -415,6 +430,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, + aouthdr_int->entry = GET_AOUTHDR_ENTRY (abfd, aouthdr_ext->entry); + aouthdr_int->text_start = + GET_AOUTHDR_TEXT_START (abfd, aouthdr_ext->text_start); ++ + #if !defined(COFF_WITH_pep) && !defined(COFF_WITH_pex64) + /* PE32+ does not have data_start member! */ + aouthdr_int->data_start = +@@ -462,7 +478,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, + int idx; + + /* PR 17512: Corrupt PE binaries can cause seg-faults. */ +- if (a->NumberOfRvaAndSizes > 16) ++ if (a->NumberOfRvaAndSizes > IMAGE_NUMBEROF_DIRECTORY_ENTRIES) + { + (*_bfd_error_handler) + (_("%B: aout header specifies an invalid number of data-directory entries: %d"), +@@ -486,6 +502,13 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, + else + a->DataDirectory[idx].VirtualAddress = 0; + } ++ ++ while (idx < IMAGE_NUMBEROF_DIRECTORY_ENTRIES) ++ { ++ a->DataDirectory[idx].Size = 0; ++ a->DataDirectory[idx].VirtualAddress = 0; ++ idx ++; ++ } + } + + if (aouthdr_int->entry) +@@ -732,7 +755,7 @@ _bfd_XXi_swap_aouthdr_out (bfd * abfd, v + { + int idx; + +- for (idx = 0; idx < 16; idx++) ++ for (idx = 0; idx < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; idx++) + { + H_PUT_32 (abfd, extra->DataDirectory[idx].VirtualAddress, + aouthdr_out->DataDirectory[idx][0]); +@@ -1233,7 +1256,9 @@ pe_print_idata (bfd * abfd, void * vfile + break; + + dll = (char *) data + dll_name - adj; +- fprintf (file, _("\n\tDLL Name: %s\n"), dll); ++ /* PR 17512 file: 078-12277-0.004. */ ++ bfd_size_type maxlen = (char *)(data + datasize) - dll - 1; ++ fprintf (file, _("\n\tDLL Name: %.*s\n"), (int) maxlen, dll); + + if (hint_addr != 0) + { +@@ -1298,23 +1323,30 @@ pe_print_idata (bfd * abfd, void * vfile + #ifdef COFF_WITH_pex64 + for (j = 0; idx + j + 8 <= datasize; j += 8) + { ++ bfd_size_type amt; + unsigned long member = bfd_get_32 (abfd, data + idx + j); + unsigned long member_high = bfd_get_32 (abfd, data + idx + j + 4); + + if (!member && !member_high) + break; + ++ amt = member - adj; ++ + if (member_high & 0x80000000) + fprintf (file, "\t%lx%08lx\t %4lx%08lx ", + member_high,member, member_high & 0x7fffffff, member); ++ /* PR binutils/17512: Handle corrupt PE data. */ ++ else if (amt + 2 >= datasize) ++ fprintf (file, _("\t"), member); + else + { + int ordinal; + char *member_name; + +- ordinal = bfd_get_16 (abfd, data + member - adj); +- member_name = (char *) data + member - adj + 2; +- fprintf (file, "\t%04lx\t %4d %s",member, ordinal, member_name); ++ ordinal = bfd_get_16 (abfd, data + amt); ++ member_name = (char *) data + amt + 2; ++ fprintf (file, "\t%04lx\t %4d %.*s",member, ordinal, ++ (int) (datasize - (amt + 2)), member_name); + } + + /* If the time stamp is not zero, the import address +@@ -1330,24 +1362,30 @@ pe_print_idata (bfd * abfd, void * vfile + #else + for (j = 0; j < datasize; j += 4) + { ++ bfd_size_type amt; + unsigned long member = bfd_get_32 (abfd, data + idx + j); + + /* Print single IMAGE_IMPORT_BY_NAME vector. */ + if (member == 0) + break; + ++ amt = member - adj; + if (member & 0x80000000) + fprintf (file, "\t%04lx\t %4lu ", + member, member & 0x7fffffff); ++ /* PR binutils/17512: Handle corrupt PE data. */ ++ else if (amt + 2 >= datasize) ++ fprintf (file, _("\t"), member); + else + { + int ordinal; + char *member_name; + +- ordinal = bfd_get_16 (abfd, data + member - adj); +- member_name = (char *) data + member - adj + 2; +- fprintf (file, "\t%04lx\t %4d %s", +- member, ordinal, member_name); ++ ordinal = bfd_get_16 (abfd, data + amt); ++ member_name = (char *) data + amt + 2; ++ fprintf (file, "\t%04lx\t %4d %.*s", ++ member, ordinal, ++ (int) (datasize - (amt + 2)), member_name); + } + + /* If the time stamp is not zero, the import address +@@ -1506,7 +1544,9 @@ pe_print_edata (bfd * abfd, void * vfile + bfd_fprintf_vma (abfd, file, edt.name); + + if ((edt.name >= adj) && (edt.name < adj + datasize)) +- fprintf (file, " %s\n", data + edt.name - adj); ++ fprintf (file, " %.*s\n", ++ (int) (datasize - (edt.name - adj)), ++ data + edt.name - adj); + else + fprintf (file, "(outside .edata section)\n"); + +@@ -1555,7 +1595,9 @@ pe_print_edata (bfd * abfd, void * vfile + edt.base); + + /* PR 17512: Handle corrupt PE binaries. */ +- if (edt.eat_addr + (edt.num_functions * 4) - adj >= datasize) ++ if (edt.eat_addr + (edt.num_functions * 4) - adj >= datasize ++ /* PR 17512 file: 140-165018-0.004. */ ++ || data + edt.eat_addr - adj < data) + fprintf (file, _("\tInvalid Export Address Table rva (0x%lx) or entry count (0x%lx)\n"), + (long) edt.eat_addr, + (long) edt.num_functions); +@@ -1571,11 +1613,12 @@ pe_print_edata (bfd * abfd, void * vfile + /* This rva is to a name (forwarding function) in our section. */ + /* Should locate a function descriptor. */ + fprintf (file, +- "\t[%4ld] +base[%4ld] %04lx %s -- %s\n", ++ "\t[%4ld] +base[%4ld] %04lx %s -- %.*s\n", + (long) i, + (long) (i + edt.base), + (unsigned long) eat_member, + _("Forwarder RVA"), ++ (int)(datasize - (eat_member - adj)), + data + eat_member - adj); + } + else +@@ -1596,29 +1639,37 @@ pe_print_edata (bfd * abfd, void * vfile + _("\n[Ordinal/Name Pointer] Table\n")); + + /* PR 17512: Handle corrupt PE binaries. */ +- if (edt.npt_addr + (edt.num_names * 4) - adj >= datasize) ++ if (edt.npt_addr + (edt.num_names * 4) - adj >= datasize ++ || (data + edt.npt_addr - adj) < data) + fprintf (file, _("\tInvalid Name Pointer Table rva (0x%lx) or entry count (0x%lx)\n"), + (long) edt.npt_addr, + (long) edt.num_names); +- else if (edt.ot_addr + (edt.num_names * 2) - adj >= datasize) ++ /* PR 17512: file: 140-147171-0.004. */ ++ else if (edt.ot_addr + (edt.num_names * 2) - adj >= datasize ++ || data + edt.ot_addr - adj < data) + fprintf (file, _("\tInvalid Ordinal Table rva (0x%lx) or entry count (0x%lx)\n"), + (long) edt.ot_addr, + (long) edt.num_names); + else for (i = 0; i < edt.num_names; ++i) + { +- bfd_vma name_ptr = bfd_get_32 (abfd, +- data + +- edt.npt_addr +- + (i*4) - adj); +- +- char *name = (char *) data + name_ptr - adj; +- +- bfd_vma ord = bfd_get_16 (abfd, +- data + +- edt.ot_addr +- + (i*2) - adj); +- fprintf (file, +- "\t[%4ld] %s\n", (long) ord, name); ++ bfd_vma name_ptr; ++ bfd_vma ord; ++ ++ ord = bfd_get_16 (abfd, data + edt.ot_addr + (i * 2) - adj); ++ name_ptr = bfd_get_32 (abfd, data + edt.npt_addr + (i * 4) - adj); ++ ++ if ((name_ptr - adj) >= datasize) ++ { ++ fprintf (file, _("\t[%4ld] \n"), ++ (long) ord, (long) name_ptr); ++ } ++ else ++ { ++ char * name = (char *) data + name_ptr - adj; ++ ++ fprintf (file, "\t[%4ld] %.*s\n", (long) ord, ++ (int)((char *)(data + datasize) - name), name); ++ } + } + + free (data); +@@ -1967,8 +2018,7 @@ pe_print_reloc (bfd * abfd, void * vfile + bfd_byte *data = 0; + asection *section = bfd_get_section_by_name (abfd, ".reloc"); + bfd_size_type datasize; +- bfd_size_type i; +- bfd_size_type start, stop; ++ bfd_byte *p, *end; + + if (section == NULL || section->size == 0 || !(section->flags & SEC_HAS_CONTENTS)) + return TRUE; +@@ -1983,20 +2033,20 @@ pe_print_reloc (bfd * abfd, void * vfile + return FALSE; + } + +- start = 0; +- +- stop = section->size; +- +- for (i = start; i < stop;) ++ p = data; ++ end = data + section->size; ++ while (p + 8 <= end) + { + int j; + bfd_vma virtual_address; + long number, size; ++ bfd_byte *chunk_end; + + /* The .reloc section is a sequence of blocks, with a header consisting + of two 32 bit quantities, followed by a number of 16 bit entries. */ +- virtual_address = bfd_get_32 (abfd, data+i); +- size = bfd_get_32 (abfd, data+i+4); ++ virtual_address = bfd_get_32 (abfd, p); ++ size = bfd_get_32 (abfd, p + 4); ++ p += 8; + number = (size - 8) / 2; + + if (size == 0) +@@ -2006,9 +2056,13 @@ pe_print_reloc (bfd * abfd, void * vfile + _("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"), + (unsigned long) virtual_address, size, (unsigned long) size, number); + +- for (j = 0; j < number; ++j) ++ chunk_end = p + size; ++ if (chunk_end > end) ++ chunk_end = end; ++ j = 0; ++ while (p + 2 <= chunk_end) + { +- unsigned short e = bfd_get_16 (abfd, data + i + 8 + j * 2); ++ unsigned short e = bfd_get_16 (abfd, p); + unsigned int t = (e & 0xF000) >> 12; + int off = e & 0x0FFF; + +@@ -2019,20 +2073,20 @@ pe_print_reloc (bfd * abfd, void * vfile + _("\treloc %4d offset %4x [%4lx] %s"), + j, off, (unsigned long) (off + virtual_address), tbl[t]); + ++ p += 2; ++ j++; ++ + /* HIGHADJ takes an argument, - the next record *is* the + low 16 bits of addend. */ +- if (t == IMAGE_REL_BASED_HIGHADJ) ++ if (t == IMAGE_REL_BASED_HIGHADJ && p + 2 <= chunk_end) + { +- fprintf (file, " (%4x)", +- ((unsigned int) +- bfd_get_16 (abfd, data + i + 8 + j * 2 + 2))); ++ fprintf (file, " (%4x)", (unsigned int) bfd_get_16 (abfd, p)); ++ p += 2; + j++; + } + + fprintf (file, "\n"); + } +- +- i += size; + } + + free (data); +--- a/binutils/objdump.c ++++ b/binutils/objdump.c +@@ -560,7 +560,10 @@ slurp_symtab (bfd *abfd) + + storage = bfd_get_symtab_upper_bound (abfd); + if (storage < 0) +- bfd_fatal (bfd_get_filename (abfd)); ++ { ++ non_fatal (_("failed to read symbol table from: %s"), bfd_get_filename (abfd)); ++ bfd_fatal (_("error message was")); ++ } + if (storage) + sy = (asymbol **) xmalloc (storage); + +@@ -2370,7 +2373,12 @@ dump_dwarf (bfd *abfd) + else if (bfd_little_endian (abfd)) + byte_get = byte_get_little_endian; + else +- abort (); ++ /* PR 17512: file: objdump-s-endless-loop.tekhex. */ ++ { ++ warn (_("File %s does not contain any dwarf debug information\n"), ++ bfd_get_filename (abfd)); ++ return; ++ } + + switch (bfd_get_arch (abfd)) + { +@@ -2470,7 +2478,7 @@ print_section_stabs (bfd *abfd, + + We start the index at -1 because there is a dummy symbol on + the front of stabs-in-{coff,elf} sections that supplies sizes. */ +- for (i = -1; stabp < stabs_end; stabp += STABSIZE, i++) ++ for (i = -1; stabp <= stabs_end - STABSIZE; stabp += STABSIZE, i++) + { + const char *name; + unsigned long strx; +@@ -2508,10 +2516,13 @@ print_section_stabs (bfd *abfd, + } + else + { ++ bfd_size_type amt = strx + file_string_table_offset; ++ + /* Using the (possibly updated) string table offset, print the + string (if any) associated with this symbol. */ +- if ((strx + file_string_table_offset) < stabstr_size) +- printf (" %s", &strtab[strx + file_string_table_offset]); ++ if (amt < stabstr_size) ++ /* PR 17512: file: 079-79389-0.001:0.1. */ ++ printf (" %.*s", (int)(stabstr_size - amt), strtab + amt); + else + printf (" *"); + } +@@ -3076,7 +3087,11 @@ dump_relocs_in_section (bfd *abfd, + relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms); + + if (relcount < 0) +- bfd_fatal (bfd_get_filename (abfd)); ++ { ++ printf ("\n"); ++ non_fatal (_("failed to read relocs in: %s"), bfd_get_filename (abfd)); ++ bfd_fatal (_("error message was")); ++ } + else if (relcount == 0) + printf (" (none)\n\n"); + else +--- a/binutils/rdcoff.c ++++ b/binutils/rdcoff.c +@@ -84,7 +84,7 @@ struct coff_types + debug_type basic[T_MAX + 1]; + }; + +-static debug_type *coff_get_slot (struct coff_types *, int); ++static debug_type *coff_get_slot (struct coff_types *, long); + static debug_type parse_coff_type + (bfd *, struct coff_symbols *, struct coff_types *, long, int, + union internal_auxent *, bfd_boolean, void *); +@@ -105,12 +105,17 @@ static bfd_boolean external_coff_symbol_ + /* Return the slot for a type. */ + + static debug_type * +-coff_get_slot (struct coff_types *types, int indx) ++coff_get_slot (struct coff_types *types, long indx) + { + struct coff_slots **pps; + + pps = &types->slots; + ++ /* PR 17512: file: 078-18333-0.001:0.1. ++ FIXME: The value of 1000 is a guess. Maybe a better heuristic is needed. */ ++ if (indx / COFF_SLOTS > 1000) ++ fatal (_("Excessively large slot index: %lx"), indx); ++ + while (indx >= COFF_SLOTS) + { + if (*pps == NULL) +--- a/binutils/rddbg.c ++++ b/binutils/rddbg.c +@@ -140,7 +140,7 @@ read_section_stabs_debugging_info (bfd * + } + + strsize = bfd_section_size (abfd, strsec); +- strings = (bfd_byte *) xmalloc (strsize); ++ strings = (bfd_byte *) xmalloc (strsize + 1); + if (! bfd_get_section_contents (abfd, strsec, strings, 0, strsize)) + { + fprintf (stderr, "%s: %s: %s\n", +@@ -148,7 +148,8 @@ read_section_stabs_debugging_info (bfd * + bfd_errmsg (bfd_get_error ())); + return FALSE; + } +- ++ /* Zero terminate the strings table, just in case. */ ++ strings [strsize] = 0; + if (shandle == NULL) + { + shandle = start_stab (dhandle, abfd, TRUE, syms, symcount); +@@ -160,7 +161,8 @@ read_section_stabs_debugging_info (bfd * + + stroff = 0; + next_stroff = 0; +- for (stab = stabs; stab < stabs + stabsize; stab += 12) ++ /* PR 17512: file: 078-60391-0.001:0.1. */ ++ for (stab = stabs; stab <= (stabs + stabsize) - 12; stab += 12) + { + unsigned int strx; + int type; +@@ -185,33 +187,43 @@ read_section_stabs_debugging_info (bfd * + } + else + { ++ size_t len; + char *f, *s; + +- f = NULL; +- +- if (stroff + strx > strsize) ++ if (stroff + strx >= strsize) + { +- fprintf (stderr, "%s: %s: stab entry %ld is corrupt, strx = 0x%x, type = %d\n", ++ fprintf (stderr, _("%s: %s: stab entry %ld is corrupt, strx = 0x%x, type = %d\n"), + bfd_get_filename (abfd), names[i].secname, + (long) (stab - stabs) / 12, strx, type); + continue; + } + + s = (char *) strings + stroff + strx; ++ f = NULL; + +- while (s[strlen (s) - 1] == '\\' ++ /* PR 17512: file: 002-87578-0.001:0.1. ++ It is possible to craft a file where, without the 'strlen (s) > 0', ++ an attempt to read the byte before 'strings' would occur. */ ++ while ((len = strlen (s)) > 0 ++ && s[len - 1] == '\\' + && stab + 12 < stabs + stabsize) + { + char *p; + + stab += 12; +- p = s + strlen (s) - 1; ++ p = s + len - 1; + *p = '\0'; +- s = concat (s, +- ((char *) strings +- + stroff +- + bfd_get_32 (abfd, stab)), +- (const char *) NULL); ++ strx = stroff + bfd_get_32 (abfd, stab); ++ if (strx >= strsize) ++ { ++ fprintf (stderr, _("%s: %s: stab entry %ld is corrupt\n"), ++ bfd_get_filename (abfd), names[i].secname, ++ (long) (stab - stabs) / 12); ++ break; ++ } ++ else ++ s = concat (s, (char *) strings + strx, ++ (const char *) NULL); + + /* We have to restore the backslash, because, if + the linker is hashing stabs strings, we may +--- a/binutils/stabs.c ++++ b/binutils/stabs.c +@@ -837,8 +837,6 @@ parse_stab_string (void *dhandle, struct + + case 'G': + { +- char leading; +- long c; + asymbol **ps; + + /* A global symbol. The value must be extracted from the +@@ -847,19 +845,27 @@ parse_stab_string (void *dhandle, struct + (debug_type **) NULL); + if (dtype == DEBUG_TYPE_NULL) + return FALSE; +- leading = bfd_get_symbol_leading_char (info->abfd); +- for (c = info->symcount, ps = info->syms; c > 0; --c, ++ps) ++ if (name != NULL) + { +- const char *n; ++ char leading; ++ long c; + +- n = bfd_asymbol_name (*ps); +- if (leading != '\0' && *n == leading) +- ++n; +- if (*n == *name && strcmp (n, name) == 0) +- break; ++ leading = bfd_get_symbol_leading_char (info->abfd); ++ for (c = info->symcount, ps = info->syms; c > 0; --c, ++ps) ++ { ++ const char *n; ++ ++ n = bfd_asymbol_name (*ps); ++ if (leading != '\0' && *n == leading) ++ ++n; ++ if (*n == *name && strcmp (n, name) == 0) ++ break; ++ } ++ ++ if (c > 0) ++ value = bfd_asymbol_value (*ps); + } +- if (c > 0) +- value = bfd_asymbol_value (*ps); ++ + if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_GLOBAL, + value)) + return FALSE; --- binutils-2.20.1.orig/debian/patches/006_better_file_error.dpatch +++ binutils-2.20.1/debian/patches/006_better_file_error.dpatch @@ -0,0 +1,43 @@ +#!/bin/sh -e +## 006_better_file_error.dpatch by David Kimdon +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Specify which filename is causing an error if the filename is a +## DP: directory. (#45832) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c +--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100 ++++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100 +@@ -150,6 +150,13 @@ + { + bfd *nbfd; + const bfd_target *target_vec; ++ struct stat s; ++ ++ if (stat (filename, &s) == 0) ++ if (S_ISDIR(s.st_mode)) { ++ bfd_set_error (bfd_error_file_not_recognized); ++ return NULL; ++ } + + nbfd = _bfd_new_bfd (); + if (nbfd == NULL) --- binutils-2.20.1.orig/debian/patches/128_build_id.dpatch +++ binutils-2.20.1/debian/patches/128_build_id.dpatch @@ -0,0 +1,64 @@ +#!/bin/sh -e +## 128_build_id.dpatch +## +## DP: Description: Fix ld corrupt build ID generation +## DP: Author: Nick Clifton +## DP: Upstream status: Taken from Fedora (BZ 501582) + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- ./bfd/section.c.orig 2009-09-09 23:40:20.000000000 +0200 ++++ ./bfd/section.c 2009-09-10 17:09:57.000000000 +0200 +@@ -1496,7 +1496,7 @@ + return TRUE; + + p = (bfd_byte *) +- bfd_malloc (sec->rawsize > sec->size ? sec->rawsize : sec->size); ++ bfd_zmalloc (sec->rawsize > sec->size ? sec->rawsize : sec->size); + if (p == NULL) + return FALSE; + *buf = p; +--- ./bfd/elfcode.h.orig 2009-09-09 23:40:19.000000000 +0200 ++++ ./bfd/elfcode.h 2009-09-10 17:08:49.000000000 +0200 +@@ -1139,6 +1139,24 @@ + + 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; --- binutils-2.20.1.orig/debian/patches/013_bash_in_ld_testsuite.dpatch +++ binutils-2.20.1/debian/patches/013_bash_in_ld_testsuite.dpatch @@ -0,0 +1,49 @@ +#!/bin/sh -e +## 013_bash_in_ld_testsuite.dpatch.dpatch by Matthias Klose +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Explicitely use bash for the ld testsuite. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- ./ld/testsuite/config/default.exp.orig 2009-04-19 21:52:33.000000000 +0200 ++++ ./ld/testsuite/config/default.exp 2009-04-19 21:54:01.000000000 +0200 +@@ -119,10 +119,10 @@ + #makefile rules, with embedded shell variable expansions. + #make wants $$shell_var, we want $shell_var ... + set cmd "host='$target_triplet' && . $srcdir/../configure.host && sed -e 's,\\\$\\\$,\$,g' <&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- a/libiberty/configure.ac ++++ b/libiberty/configure.ac +@@ -217,6 +217,7 @@ if [[ "${shared}" = "yes" ]]; then + * ) PICFLAG=-fPIC ;; + esac ;; + s390*-*-*) PICFLAG=-fpic ;; ++ sh*-*-*) PICFLAG=-fPIC ;; + esac + fi + AC_SUBST(PICFLAG) +--- a/libiberty/configure ++++ b/libiberty/configure +@@ -4860,6 +4860,7 @@ if [ "${shared}" = "yes" ]; then + * ) PICFLAG=-fPIC ;; + esac ;; + s390*-*-*) PICFLAG=-fpic ;; ++ sh*-*-*) PICFLAG=-fPIC ;; + esac + fi + --- binutils-2.20.1.orig/debian/patches/020_pie_mips.dpatch +++ binutils-2.20.1/debian/patches/020_pie_mips.dpatch @@ -0,0 +1,41 @@ +#!/bin/sh -e +## 020_pie_mips.dpatch +## +## DP: Description: Fix -pie on mips/mipsel +## DP: Author: Alan Modra +## DP: Upstream status: in BTS, not yet merged + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +--- a/bfd/elfxx-mips.c 18 Sep 2009 20:34:30 -0000 1.262 ++++ b/bfd/elfxx-mips.c 4 Nov 2009 01:50:24 -0000 +@@ -5688,9 +5688,9 @@ mips_elf_create_dynamic_relocation (bfd + + /* We must now calculate the dynamic symbol table index to use + in the relocation. */ +- if (h != NULL +- && (!h->root.def_regular +- || (info->shared && !info->symbolic && !h->root.forced_local))) ++ if (!(h == NULL ++ || (h->root.def_regular ++ && (info->executable || info->symbolic || h->root.forced_local)))) + { + indx = h->root.dynindx; + if (SGI_COMPAT (output_bfd)) --- binutils-2.20.1.orig/debian/patches/001_ld_makefile_patch.dpatch +++ binutils-2.20.1/debian/patches/001_ld_makefile_patch.dpatch @@ -0,0 +1,52 @@ +#!/bin/sh -e +## 001_ld_makefile_patch.dpatch +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Description: correct where ld scripts are installed +## DP: Author: Chris Chimelis +## DP: Upstream status: N/A +## DP: Date: ?? + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./ld/Makefile.am /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.am +--- ./ld/Makefile.am 2005-08-31 03:27:36.000000000 +0000 ++++ /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.am 2005-09-02 21:42:18.000000000 +0000 +@@ -20,7 +20,7 @@ + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +diff -urNad --exclude=CVS --exclude=.svn ./ld/Makefile.in /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.in +--- ./ld/Makefile.in 2005-08-31 03:27:36.000000000 +0000 ++++ /tmp/dpep-work.eKU2vW/binutils-2.16.1cvs20050902/ld/Makefile.in 2005-09-02 21:43:37.259127535 +0000 +@@ -268,7 +268,7 @@ + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include --- binutils-2.20.1.orig/debian/patches/306-CVE-2014-8504.dpatch +++ binutils-2.20.1/debian/patches/306-CVE-2014-8504.dpatch @@ -0,0 +1,56 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 306-CVE-2014-8504.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: srec_scan buffer overflow [CVE-2014-8504] + +@DPATCH@ + +From 708d7d0d11f0f2d776171979aa3479e8e12a38a0 Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Tue, 28 Oct 2014 10:48:14 +0000 +Subject: [PATCH] This patch fixes a flaw in the SREC parser which could cause a stack overflow + and potential secuiryt breach. + + PR binutils/17510 + * srec.c (srec_bad_byte): Increase size of buf to allow for + negative values. + (srec_scan): Use an unsigned char buffer to hold header bytes. + +[Ubuntu note: patch differs from upstream commit in that it drops the +changelog entry and the cosmetic whitespace changes to reduce patch +conflicts. -- sbeattie] + +CVE-2014-8504 +--- + bfd/ChangeLog | 8 ++++++++ + bfd/elf.c | 2 +- + bfd/peXXigen.c | 1 - + bfd/srec.c | 4 ++-- + 4 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/bfd/srec.c b/bfd/srec.c +index 9ed2080..5f9a546 100644 +--- a/bfd/srec.c ++++ b/bfd/srec.c +@@ -246,7 +246,7 @@ srec_bad_byte (bfd *abfd, + } + else + { +- char buf[10]; ++ char buf[40]; + + if (! ISPRINT (c)) + sprintf (buf, "\\%03o", (unsigned int) c); +@@ -452,7 +452,7 @@ srec_scan (bfd *abfd) + case 'S': + { + file_ptr pos; +- char hdr[3]; ++ unsigned char hdr[3]; + unsigned int bytes, min_bytes; + bfd_vma address; + bfd_byte *data; +-- +1.7.1 + --- binutils-2.20.1.orig/debian/patches/141_pr10740.dpatch +++ binutils-2.20.1/debian/patches/141_pr10740.dpatch @@ -0,0 +1,295 @@ +#!/bin/sh -e +## 141_pr10740.dpatch +## +## DP: Description: PR gas/10740: Intel syntax far jumps broken + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +gas/ + +2009-10-13 H.J. Lu + + PR gas/10740 + * config/tc-i386-intel.c (i386_intel_operand): Handle call + and jump with 2 immediate operands. + + * config/tc-i386.c (i386_finalize_immediate): Don't generate + error message if operand string is NULL. + +gas/testsuite/ + +2009-10-13 H.J. Lu + + PR gas/10740 + * gas/i386/jump.s: Add new tests. + * gas/i386/jump16.s: Likewise. + + * gas/i386/jump.d: Updated. + * gas/i386/jump16.d: Likewise. + +@DPATCH@ +diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c +index 5d5e0c1..df749b8 100644 +--- a/gas/config/tc-i386-intel.c ++++ b/gas/config/tc-i386-intel.c +@@ -721,6 +721,51 @@ i386_intel_operand (char *operand_string, int got_a_float) + if (i.mem_operands + >= 2 - !current_templates->start->opcode_modifier.isstring) + { ++ /* Handle ++ ++ call 0x9090,0x90909090 ++ lcall 0x9090,0x90909090 ++ jmp 0x9090,0x90909090 ++ ljmp 0x9090,0x90909090 ++ */ ++ ++ if ((current_templates->start->opcode_modifier.jumpintersegment ++ || current_templates->start->opcode_modifier.jumpdword ++ || current_templates->start->opcode_modifier.jump) ++ && this_operand == 1 ++ && intel_state.seg == NULL ++ && i.mem_operands == 1 ++ && i.disp_operands == 1 ++ && intel_state.op_modifier == O_absent) ++ { ++ /* Try to process the first operand as immediate, */ ++ this_operand = 0; ++ if (i386_finalize_immediate (exp_seg, i.op[0].imms, ++ intel_state.reloc_types, ++ NULL)) ++ { ++ this_operand = 1; ++ expP = &im_expressions[0]; ++ i.op[this_operand].imms = expP; ++ *expP = exp; ++ ++ /* Try to process the second operand as immediate, */ ++ if (i386_finalize_immediate (exp_seg, expP, ++ intel_state.reloc_types, ++ NULL)) ++ { ++ i.mem_operands = 0; ++ i.disp_operands = 0; ++ i.imm_operands = 2; ++ i.types[0].bitfield.mem = 0; ++ i.types[0].bitfield.disp16 = 0; ++ i.types[0].bitfield.disp32 = 0; ++ i.types[0].bitfield.disp32s = 0; ++ return 1; ++ } ++ } ++ } ++ + as_bad (_("too many memory references for `%s'"), + current_templates->start->name); + return 0; +diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c +index 5c288ea..54edb1b 100644 +--- a/gas/config/tc-i386.c ++++ b/gas/config/tc-i386.c +@@ -6287,8 +6287,9 @@ i386_finalize_immediate (segT exp_seg ATTRIBUTE_UNUSED, expressionS *exp, + { + if (exp->X_op == O_absent || exp->X_op == O_illegal || exp->X_op == O_big) + { +- as_bad (_("missing or invalid immediate expression `%s'"), +- imm_start); ++ if (imm_start) ++ as_bad (_("missing or invalid immediate expression `%s'"), ++ imm_start); + return 0; + } + else if (exp->X_op == O_constant) +@@ -6316,7 +6317,8 @@ i386_finalize_immediate (segT exp_seg ATTRIBUTE_UNUSED, expressionS *exp, + #endif + else if (!intel_syntax && exp->X_op == O_register) + { +- as_bad (_("illegal immediate register operand %s"), imm_start); ++ if (imm_start) ++ as_bad (_("illegal immediate register operand %s"), imm_start); + return 0; + } + else +diff --git a/gas/testsuite/gas/i386/jump.d b/gas/testsuite/gas/i386/jump.d +index 0802785..e53f09d 100644 +--- a/gas/testsuite/gas/i386/jump.d ++++ b/gas/testsuite/gas/i386/jump.d +@@ -36,4 +36,20 @@ Disassembly of section .text: + [ ]*[a-f0-9]+: 90 nop + [ ]*[a-f0-9]+: eb 00 jmp (0x)?7e( <.text(\+0x7e)?>)? + [ ]*[a-f0-9]+: 90 nop ++[ ]*[a-f0-9]+: 9a 90 90 90 90 90 90 lcall \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: 9a 90 90 90 90 90 90 lcall \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: 9a 00 00 00 00 90 90 lcall \$0x9090,\$0x0 8e: (R_386_)?(dir)?32 xxx ++[ ]*[a-f0-9]+: 9a 00 00 00 00 90 90 lcall \$0x9090,\$0x0 95: (R_386_)?(dir)?32 xxx ++[ ]*[a-f0-9]+: 9a 90 90 90 90 90 90 lcall \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: 9a 90 90 90 90 90 90 lcall \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: 9a 00 00 00 00 90 90 lcall \$0x9090,\$0x0 aa: (R_386_)?(dir)?32 xxx ++[ ]*[a-f0-9]+: 9a 00 00 00 00 90 90 lcall \$0x9090,\$0x0 b1: (R_386_)?(dir)?32 xxx ++[ ]*[a-f0-9]+: ea 90 90 90 90 90 90 ljmp \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: ea 90 90 90 90 90 90 ljmp \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: ea 00 00 00 00 90 90 ljmp \$0x9090,\$0x0 c6: (R_386_)?(dir)?32 xxx ++[ ]*[a-f0-9]+: ea 00 00 00 00 90 90 ljmp \$0x9090,\$0x0 cd: (R_386_)?(dir)?32 xxx ++[ ]*[a-f0-9]+: ea 90 90 90 90 90 90 ljmp \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: ea 90 90 90 90 90 90 ljmp \$0x9090,\$0x90909090 ++[ ]*[a-f0-9]+: ea 00 00 00 00 90 90 ljmp \$0x9090,\$0x0 e2: (R_386_)?(dir)?32 xxx ++[ ]*[a-f0-9]+: ea 00 00 00 00 90 90 ljmp \$0x9090,\$0x0 e9: (R_386_)?(dir)?32 xxx + #pass +diff --git a/gas/testsuite/gas/i386/jump.s b/gas/testsuite/gas/i386/jump.s +index 71693ce..8ce459f 100644 +--- a/gas/testsuite/gas/i386/jump.s ++++ b/gas/testsuite/gas/i386/jump.s +@@ -35,3 +35,20 @@ + nop + jmp .+2 + nop ++ ++ lcall 0x9090,0x90909090 ++ lcall 0x9090:0x90909090 ++ lcall 0x9090,xxx ++ lcall 0x9090:xxx ++ call 0x9090,0x90909090 ++ call 0x9090:0x90909090 ++ call 0x9090,xxx ++ call 0x9090:xxx ++ ljmp 0x9090,0x90909090 ++ ljmp 0x9090:0x90909090 ++ ljmp 0x9090,xxx ++ ljmp 0x9090:xxx ++ jmp 0x9090,0x90909090 ++ jmp 0x9090:0x90909090 ++ jmp 0x9090,xxx ++ jmp 0x9090:xxx +diff --git a/gas/testsuite/gas/i386/jump16.d b/gas/testsuite/gas/i386/jump16.d +index db5d44a..c91c8ae 100644 +--- a/gas/testsuite/gas/i386/jump16.d ++++ b/gas/testsuite/gas/i386/jump16.d +@@ -7,48 +7,64 @@ Disassembly of section .text: + + 0+ <.text>: + [ ]*[a-f0-9]+: eb fe jmp (0x0|0 <.text>) +-[ ]*[a-f0-9]+: e9 fe ff jmp 0x3 3: R_386_PC16 xxx +-[ ]*[a-f0-9]+: ff 26 00 00 jmp \*0x0 7: R_386_16 xxx ++[ ]*[a-f0-9]+: e9 f(e|b) ff jmp (0x3|0 <.text>) 3: (R_386_PC)?(DISP)?16 xxx ++[ ]*[a-f0-9]+: ff 26 00 00 jmp \*0x0 7: (R_386_)?16 xxx + [ ]*[a-f0-9]+: 66 ff e7 jmpl \*%edi + [ ]*[a-f0-9]+: 67 ff 27 addr32 jmp \*\(%edi\) + [ ]*[a-f0-9]+: 67 ff af 00 00 00 00 addr32 ljmp \*0x0\(%edi\) 12: (R_386_)?(dir)?32 xxx +-[ ]*[a-f0-9]+: ff 2e 00 00 ljmp \*0x0 18: R_386_16 xxx +-[ ]*[a-f0-9]+: ea 00 00 34 12 ljmp \$0x1234,\$0x0 1b: R_386_16 xxx +-[ ]*[a-f0-9]+: 66 e8 db ff ff ff calll 0x0 +-[ ]*[a-f0-9]+: 66 e8 fc ff ff ff calll 0x27 27: (R_386_PC)?(DISP)?32 xxx +-[ ]*[a-f0-9]+: 66 ff 16 00 00 calll \*0x0 2e: R_386_16 xxx ++[ ]*[a-f0-9]+: ff 2e 00 00 ljmp \*0x0 18: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ea 00 00 34 12 ljmp \$0x1234,\$0x0 1b: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 66 e8 db ff ff ff calll (0x0|0 <.text>) ++[ ]*[a-f0-9]+: 66 e8 (fc|d5) ff ff ff calll (0x27|0 <.text>) 27: (R_386_PC)?(DISP)?32 xxx ++[ ]*[a-f0-9]+: 66 ff 16 00 00 calll \*0x0 2e: (R_386_)?16 xxx + [ ]*[a-f0-9]+: 66 ff d7 calll \*%edi + [ ]*[a-f0-9]+: 67 66 ff 17 addr32 calll \*\(%edi\) + [ ]*[a-f0-9]+: 67 66 ff 9f 00 00 00 00 addr32 lcalll \*0x0\(%edi\) 3b: (R_386_)?(dir)?32 xxx +-[ ]*[a-f0-9]+: 66 ff 1e 00 00 lcalll \*0x0 42: R_386_16 xxx ++[ ]*[a-f0-9]+: 66 ff 1e 00 00 lcalll \*0x0 42: (R_386_)?16 xxx + [ ]*[a-f0-9]+: 66 9a 00 00 00 00 34 12 lcalll \$0x1234,\$0x0 46: (R_386_)?(dir)?32 xxx + [ ]*[a-f0-9]+: eb b2 jmp (0x0|0 <.text>) +-[ ]*[a-f0-9]+: ff 26 00 00 jmp \*0x0 50: R_386_16 xxx ++[ ]*[a-f0-9]+: ff 26 00 00 jmp \*0x0 50: (R_386_)?16 xxx + [ ]*[a-f0-9]+: ff e7 jmp \*%di + [ ]*[a-f0-9]+: ff 25 jmp \*\(%di\) +-[ ]*[a-f0-9]+: ff ad 00 00 ljmp \*0x0\(%di\) 58: R_386_16 xxx +-[ ]*[a-f0-9]+: 66 ff ad 00 00 ljmpl \*0x0\(%di\) 5d: R_386_16 xxx +-[ ]*[a-f0-9]+: ff 2e 00 00 ljmp \*0x0 61: R_386_16 xxx +-[ ]*[a-f0-9]+: 66 ff 2e 00 00 ljmpl \*0x0 66: R_386_16 xxx +-[ ]*[a-f0-9]+: ea 00 00 34 12 ljmp \$0x1234,\$0x0 69: R_386_16 xxx ++[ ]*[a-f0-9]+: ff ad 00 00 ljmp \*0x0\(%di\) 58: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 66 ff ad 00 00 ljmpl \*0x0\(%di\) 5d: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ff 2e 00 00 ljmp \*0x0 61: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 66 ff 2e 00 00 ljmpl \*0x0 66: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ea 00 00 34 12 ljmp \$0x1234,\$0x0 69: (R_386_)?16 xxx + [ ]*[a-f0-9]+: e8 90 ff call (0x0|0 <.text>) +-[ ]*[a-f0-9]+: e8 fe ff call 0x71 71: R_386_PC16 xxx +-[ ]*[a-f0-9]+: ff 16 00 00 call \*0x0 75: R_386_16 xxx ++[ ]*[a-f0-9]+: e8 (fe|8d) ff call (0x71|0 <.text>) 71: (R_386_PC)?(DISP)?16 xxx ++[ ]*[a-f0-9]+: ff 16 00 00 call \*0x0 75: (R_386_)?16 xxx + [ ]*[a-f0-9]+: ff d7 call \*%di + [ ]*[a-f0-9]+: ff 15 call \*\(%di\) +-[ ]*[a-f0-9]+: ff 9d 00 00 lcall \*0x0\(%di\) 7d: R_386_16 xxx +-[ ]*[a-f0-9]+: 66 ff 9d 00 00 lcalll \*0x0\(%di\) 82: R_386_16 xxx +-[ ]*[a-f0-9]+: ff 1e 00 00 lcall \*0x0 86: R_386_16 xxx +-[ ]*[a-f0-9]+: 66 ff 1e 00 00 lcalll \*0x0 8b: R_386_16 xxx +-[ ]*[a-f0-9]+: 9a 00 00 34 12 lcall \$0x1234,\$0x0 8e: R_386_16 xxx ++[ ]*[a-f0-9]+: ff 9d 00 00 lcall \*0x0\(%di\) 7d: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 66 ff 9d 00 00 lcalll \*0x0\(%di\) 82: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ff 1e 00 00 lcall \*0x0 86: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 66 ff 1e 00 00 lcalll \*0x0 8b: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 9a 00 00 34 12 lcall \$0x1234,\$0x0 8e: (R_386_)?16 xxx + [ ]*[a-f0-9]+: ff 17 call \*\(%bx\) + [ ]*[a-f0-9]+: ff 1f lcall \*\(%bx\) + [ ]*[a-f0-9]+: 66 ff 1f lcalll \*\(%bx\) + [ ]*[a-f0-9]+: ff 27 jmp \*\(%bx\) + [ ]*[a-f0-9]+: ff 2f ljmp \*\(%bx\) + [ ]*[a-f0-9]+: 66 ff 2f ljmpl \*\(%bx\) +-[ ]*[a-f0-9]+: eb 00 jmp 0xa2 ++[ ]*[a-f0-9]+: eb 00 jmp (0xa2|a2 <.text\+0xa2>) + [ ]*[a-f0-9]+: 90 nop +-[ ]*[a-f0-9]+: eb 00 jmp 0xa5 ++[ ]*[a-f0-9]+: eb 00 jmp (0xa5|a5 <.text\+0xa5>) + [ ]*[a-f0-9]+: 90 nop ++[ ]*[a-f0-9]+: 9a 10 10 90 90 lcall \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: 9a 10 10 90 90 lcall \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: 9a 00 00 90 90 lcall \$0x9090,\$0x0 b1: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 9a 00 00 90 90 lcall \$0x9090,\$0x0 b6: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 9a 10 10 90 90 lcall \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: 9a 10 10 90 90 lcall \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: 9a 00 00 90 90 lcall \$0x9090,\$0x0 c5: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: 9a 00 00 90 90 lcall \$0x9090,\$0x0 ca: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ea 10 10 90 90 ljmp \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: ea 10 10 90 90 ljmp \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: ea 00 00 90 90 ljmp \$0x9090,\$0x0 d9: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ea 00 00 90 90 ljmp \$0x9090,\$0x0 de: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ea 10 10 90 90 ljmp \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: ea 10 10 90 90 ljmp \$0x9090,\$0x1010 ++[ ]*[a-f0-9]+: ea 00 00 90 90 ljmp \$0x9090,\$0x0 ed: (R_386_)?16 xxx ++[ ]*[a-f0-9]+: ea 00 00 90 90 ljmp \$0x9090,\$0x0 f2: (R_386_)?16 xxx + #pass +diff --git a/gas/testsuite/gas/i386/jump16.s b/gas/testsuite/gas/i386/jump16.s +index 7ad9c6b..f8bc0ea 100644 +--- a/gas/testsuite/gas/i386/jump16.s ++++ b/gas/testsuite/gas/i386/jump16.s +@@ -54,3 +54,20 @@ + nop + jmp .+2 + nop ++ ++ lcall 0x9090,0x1010 ++ lcall 0x9090:0x1010 ++ lcall 0x9090,xxx ++ lcall 0x9090:xxx ++ call 0x9090,0x1010 ++ call 0x9090:0x1010 ++ call 0x9090,xxx ++ call 0x9090:xxx ++ ljmp 0x9090,0x1010 ++ ljmp 0x9090:0x1010 ++ ljmp 0x9090,xxx ++ ljmp 0x9090:xxx ++ jmp 0x9090,0x1010 ++ jmp 0x9090:0x1010 ++ jmp 0x9090,xxx ++ jmp 0x9090:xxx --- binutils-2.20.1.orig/debian/patches/308-CVE-2014-8738.dpatch +++ binutils-2.20.1/debian/patches/308-CVE-2014-8738.dpatch @@ -0,0 +1,57 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 308-CVE-2014-8738.dpatch by Steve Beattie +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: _bfd_slurp_extended_name_table invalid write [CVE-2014-8738] + +@DPATCH@ + +From bb0d867169d7e9743d229804106a8fbcab7f3b3f Mon Sep 17 00:00:00 2001 +From: Nick Clifton +Date: Tue, 4 Nov 2014 13:15:37 +0000 +Subject: [PATCH] Fix a seg-fault triggered by reading a mal-formed archive. + + PR binutils/17533 + * archive.c (_bfd_slurp_extended_name_table): Handle archives with + corrupt extended name tables. + +[Ubuntu note: patch differs from upstream commit in that it drops the +changelog entry and cosmetic changes to reduce patch conflicts. + -- sbeattie] + +CVE-2014-8738 +--- + bfd/archive.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +Index: b/bfd/archive.c +=================================================================== +--- a/bfd/archive.c ++++ b/bfd/archive.c +@@ -1292,6 +1292,9 @@ _bfd_slurp_extended_name_table (bfd *abf + amt = namedata->parsed_size; + if (amt + 1 == 0) + goto byebye; ++ /* PR binutils/17533: A corrupt archive can contain an invalid size. */ ++ if (amt > (bfd_size_type) bfd_get_size (abfd)) ++ goto byebye; + + bfd_ardata (abfd)->extended_names_size = amt; + bfd_ardata (abfd)->extended_names = (char *) bfd_zalloc (abfd, amt + 1); +@@ -1299,6 +1302,8 @@ _bfd_slurp_extended_name_table (bfd *abf + { + byebye: + bfd_release (abfd, namedata); ++ bfd_ardata (abfd)->extended_names = NULL; ++ bfd_ardata (abfd)->extended_names_size = 0; + return FALSE; + } + +@@ -1307,7 +1312,6 @@ _bfd_slurp_extended_name_table (bfd *abf + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_malformed_archive); + bfd_release (abfd, (bfd_ardata (abfd)->extended_names)); +- bfd_ardata (abfd)->extended_names = NULL; + goto byebye; + } + --- binutils-2.20.1.orig/debian/patches/138_gold_asneeded.dpatch +++ binutils-2.20.1/debian/patches/138_gold_asneeded.dpatch @@ -0,0 +1,42 @@ +#!/bin/sh -e +## 138_gold_asneeded.dpatch +## +## DP: Description: PR gold/11042: COPY relocs need for the dynamic object + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +2010-01-07 Ian Lance Taylor + + PR 11042 + * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic + object as needed. + +@DPATCH@ +--- ./gold/copy-relocs.cc 30 Dec 2009 06:57:17 -0000 1.7 ++++ ./gold/copy-relocs.cc 7 Jan 2010 19:32:05 -0000 +@@ -132,6 +132,9 @@ Copy_relocs:: + while ((value & (addralign - 1)) != 0) + addralign >>= 1; + ++ // Mark the dynamic object as needed for the --as-needed option. ++ sym->object()->set_is_needed(); ++ + if (this->dynbss_ == NULL) + { + this->dynbss_ = new Output_data_space(addralign, "** dynbss"); --- binutils-2.20.1.orig/debian/patches/00list +++ binutils-2.20.1/debian/patches/00list @@ -0,0 +1,65 @@ +#000_branch_updates +001_ld_makefile_patch +002_gprof_profile_arcs +003_gprof_see_also_monitor +006_better_file_error +012_check_ldrunpath_length +013_bash_in_ld_testsuite +020_pie_mips.dpatch + +127_x86_64_i386_biarch +128_build_id +129_dir_section +130_gold_disable_testsuite_build +131_ld_bootstrap_testsuite +132_libiberty_sh +133_enable_gold +134_gold_no_spu +137_pr11138 +138_gold_asneeded +139_gold_pr10916 +140_gold_pr10979_1 +140_gold_pr10979_2 +140_gold_pr10979_3 +141_pr10740 +142_arm_fix_arm_failures +143_pr42602 +144_no_infunc_symbols_from_shlib +145_ld_man_typo +146_arm_readelf_unwind +#147_arm_linking_time +148_pr11426 +149_pr11456 +151_arm_opt_merge_exidx_entries +153_gold_pr10893 + +200_elflink_%B_fixes +201_elflink_improve_noaddneeded_errors +202_elflink_noaddneeded_vs_weak + +# not applied for Ubuntu: +#200-hjl-ld-env + +203-hjl-binutils-indirect + +# not applied for Ubuntu: +#206-hjl-binutils-shr + +209-hjl-binutils-error +210-hjl-binutils-signed +211-hjl-binutils-weakdef +212-hjl-bfd-64k +213-hjl-binutils-sec64k + +300-CVE-2012-3509 +301-CVE-2014-8484 +302-CVE-2014-8485 +303-CVE-2014-8501 +304-CVE-2014-8502 +305-CVE-2014-8503 +306-CVE-2014-8504 +307-CVE-2014-8737 +308-CVE-2014-8738 +309-pr17512-misc +310-harden_strings +311-gold-fuse-ld