summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
Diffstat (limited to 'patches')
-rw-r--r--patches/binutils/2.16.1a/100-bfd-hash-tweak.patch23
-rw-r--r--patches/binutils/2.16.1a/110-psignal.patch40
-rw-r--r--patches/binutils/2.16.1a/120-skip-comments.patch95
-rw-r--r--patches/binutils/2.16.1a/130-callahan.patch693
-rw-r--r--patches/binutils/2.16.1a/140-cross-gprof.patch22
-rw-r--r--patches/binutils/2.16.1a/150-stabs-tweak.patch28
-rw-r--r--patches/binutils/2.16.1a/160-i386-no-divide-comment.patch40
-rw-r--r--patches/binutils/2.17a/100-uclibc-conf.patch149
-rw-r--r--patches/binutils/2.17a/110-arm-eabi-conf.patch24
-rw-r--r--patches/binutils/2.17a/120-makeinfo-version.patch16
-rw-r--r--patches/binutils/2.17a/130-ld_makefile_patch.patch24
-rw-r--r--patches/binutils/2.17a/140-better_file_error.patch17
-rw-r--r--patches/binutils/2.17a/150-check_ldrunpath_length.patch21
-rw-r--r--patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch28
-rw-r--r--patches/binutils/2.17a/170-bfd-hash-tweak.patch23
-rw-r--r--patches/binutils/2.17a/180-psignal.patch29
-rw-r--r--patches/binutils/2.17a/190-skip-comments.patch95
-rw-r--r--patches/binutils/2.17a/200-cross-gprof.patch22
-rw-r--r--patches/binutils/2.17a/210-i386-no-divide-comment.patch64
-rw-r--r--patches/binutils/2.18a/100-makeinfo-version.patch32
-rw-r--r--patches/binutils/2.18a/110-enable-dash-v2.patch20
-rw-r--r--patches/binutils/2.18a/120-i386-no-divide-comment.patch64
-rw-r--r--patches/binutils/2.19.1a/100-ppc64-pie.patch25
-rw-r--r--patches/binutils/2.19.1a/110-RPATH_ENVVAR-smack.patch22
-rw-r--r--patches/binutils/2.19.1a/120-sh-targets.patch57
-rw-r--r--patches/binutils/2.19.1a/130-check_ldrunpath_length.patch36
-rw-r--r--patches/binutils/2.19.1a/140-pt-pax-flags-20081101.patch254
-rw-r--r--patches/binutils/2.19.1a/150-warn-textrel.patch53
-rw-r--r--patches/binutils/2.19.1a/160-use-new-ld-dtags.patch19
-rw-r--r--patches/binutils/2.19.1a/170-use-relro.patch19
-rw-r--r--patches/binutils/2.19.1a/180-libiberty-pic.patch19
-rw-r--r--patches/binutils/2.19.1a/190-mips64-defaultemul.patch18
-rw-r--r--patches/binutils/2.20.1a/100-ppc64-pie.patch19
-rw-r--r--patches/binutils/2.20.1a/110-RPATH_ENVVAR-smack.patch14
-rw-r--r--patches/binutils/2.20.1a/120-sh-targets.patch44
-rw-r--r--patches/binutils/2.20.1a/140-check_ldrunpath_length.patch49
-rw-r--r--patches/binutils/2.20.1a/150-pt-pax-flags-20090909.patch248
-rw-r--r--patches/binutils/2.20.1a/160-amd64-32bit-path.patch19
-rw-r--r--patches/binutils/2.20.1a/170-warn-textrel.patch66
-rw-r--r--patches/binutils/2.20.1a/190-use-new-ld-dtags.patch13
-rw-r--r--patches/binutils/2.20.1a/200-document-new-dtags-behaviour.patch18
-rw-r--r--patches/binutils/2.20.1a/220-use-relro.patch13
-rw-r--r--patches/binutils/2.20.1a/230-libiberty-pic.patch13
-rw-r--r--patches/binutils/2.20.1a/240-ld_makefile.patch27
-rw-r--r--patches/binutils/2.20.1a/250-arm-eabi-conf.patch26
-rw-r--r--patches/binutils/2.20.1a/270-better_file_error.patch45
-rw-r--r--patches/binutils/2.20.1a/280-unexport_LD_LIBRARY_PATH.patch96
-rw-r--r--patches/binutils/2.20.1a/290-ld-stub-crash.patch24
-rw-r--r--patches/binutils/2.20.1a/300-mips64-defaultemul.patch21
-rw-r--r--patches/binutils/2.21.1a/110-arm-eabi-conf.patch24
-rw-r--r--patches/binutils/2.21.1a/120-sh-conf.patch42
-rw-r--r--patches/binutils/2.21.1a/300-001_ld_makefile_patch.patch24
-rw-r--r--patches/binutils/2.21.1a/300-012_check_ldrunpath_length.patch21
-rw-r--r--patches/binutils/2.22/120-sh-conf.patch31
-rw-r--r--patches/binutils/2.22/400-fix_arm_gc_sections.patch12
-rw-r--r--patches/binutils/2.22/500-fix-struct-stat.patch42
-rw-r--r--patches/binutils/2.22/999-ppc-textrels.patch72
-rw-r--r--patches/binutils/2.23.2/120-sh-conf.patch (renamed from patches/binutils/2.25/120-sh-conf.patch)16
-rw-r--r--patches/binutils/2.23.2/300-001_ld_makefile_patch.patch (renamed from patches/binutils/2.22/300-001_ld_makefile_patch.patch)16
-rw-r--r--patches/binutils/2.23.2/300-012_check_ldrunpath_length.patch (renamed from patches/binutils/2.22/300-012_check_ldrunpath_length.patch)10
-rw-r--r--patches/binutils/2.23.2/500-sysroot.patch (renamed from patches/binutils/2.20.1a/130-ld-sysroot.patch)26
-rw-r--r--patches/binutils/2.23.2/600-poison-system-directories.patch279
-rw-r--r--patches/binutils/2.23.2/900-xtensa-trampolines.patch846
-rw-r--r--patches/binutils/2.23.2/901-xtensa-gas-first-frag-alignment.patch51
-rw-r--r--patches/binutils/2.23.2/902-xtensa-gas-ld-diff-relocation-signed.patch133
-rw-r--r--patches/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch47
-rw-r--r--patches/binutils/2.23.2/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch79
-rw-r--r--patches/binutils/2.23.2/905-Fix-trampolines-search-code-for-conditional-branches.patch90
-rw-r--r--patches/binutils/2.23.2/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch57
-rw-r--r--patches/binutils/2.23.2/912-xtensa-fix-gas-segfault-with-text-section-literals.patch56
-rw-r--r--patches/binutils/2.24/001-fix-enable-install-libiberty-flag.patch46
-rw-r--r--patches/binutils/2.24/002-dont-segv-on-initial-instructions-overflow.patch66
-rw-r--r--patches/binutils/2.24/500-sysroot.patch37
-rw-r--r--patches/binutils/2.24/600-poison-system-directories.patch279
-rw-r--r--patches/binutils/2.24/900-xtensa-trampolines.patch846
-rw-r--r--patches/binutils/2.24/901-xtensa-gas-first-frag-alignment.patch51
-rw-r--r--patches/binutils/2.24/902-xtensa-gas-ld-diff-relocation-signed.patch133
-rw-r--r--patches/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch47
-rw-r--r--patches/binutils/2.24/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch79
-rw-r--r--patches/binutils/2.24/905-Fix-trampolines-search-code-for-conditional-branches.patch90
-rw-r--r--patches/binutils/2.24/906-xtensa-optimize-check_section_ebb_pcrels_fit.patch502
-rw-r--r--patches/binutils/2.24/907-xtensa-optimize-removed_by_actions.patch356
-rw-r--r--patches/binutils/2.24/908-xtensa-optimize-find_removed_literal.patch146
-rw-r--r--patches/binutils/2.24/909-xtensa-replace-action-list-with-splay-tree.patch826
-rw-r--r--patches/binutils/2.24/910-xtensa-optimize-trampolines-relaxation.patch345
-rw-r--r--patches/binutils/2.24/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch57
-rw-r--r--patches/binutils/2.24/912-xtensa-fix-gas-segfault-with-text-section-literals.patch56
-rw-r--r--patches/binutils/2.24/913-xtensa-add-auto-litpools-option.patch698
-rw-r--r--patches/binutils/2.25.1/500-sysroot.patch37
-rw-r--r--patches/binutils/2.25.1/600-poison-system-directories.patch276
-rw-r--r--patches/binutils/2.25/300-001_ld_makefile_patch.patch26
-rw-r--r--patches/binutils/2.25/300-012_check_ldrunpath_length.patch22
-rw-r--r--patches/binutils/2.25/340-Darwin-gold-binary-cc-include-string-not-cstring.patch11
-rw-r--r--patches/binutils/2.25/350-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch77
-rw-r--r--patches/cloog-ppl/0.15.10/100-add_on_libs_position.patch24
-rw-r--r--patches/cloog-ppl/0.15.11/100-add_on_libs_position.patch24
-rw-r--r--patches/cloog-ppl/0.15.6/100-add_on_libs_position.patch24
-rw-r--r--patches/cloog-ppl/0.15.7/100-add_on_libs_position.patch24
-rw-r--r--patches/cloog-ppl/0.15.8/100-add_on_libs_position.patch24
-rw-r--r--patches/cloog-ppl/0.15.9/100-add_on_libs_position.patch24
-rw-r--r--patches/gcc/4.2.4/100-uclibc-conf.patch216
-rw-r--r--patches/gcc/4.2.4/110-uclibc-conf-noupstream.patch12
-rw-r--r--patches/gcc/4.2.4/120-uclibc-locale.patch2806
-rw-r--r--patches/gcc/4.2.4/130-uclibc-locale-no__x.patch223
-rw-r--r--patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch50
-rw-r--r--patches/gcc/4.2.4/150-uclibc-locale-update.patch354
-rw-r--r--patches/gcc/4.2.4/160-libstdc++-pic.patch50
-rw-r--r--patches/gcc/4.2.4/170-missing-execinfo_h.patch12
-rw-r--r--patches/gcc/4.2.4/180-c99-snprintf.patch12
-rw-r--r--patches/gcc/4.2.4/190-c99-complex-ugly-hack.patch13
-rw-r--r--patches/gcc/4.2.4/200-index_macro.patch26
-rw-r--r--patches/gcc/4.2.4/210-libmudflap-susv3-legacy.patch48
-rw-r--r--patches/gcc/4.2.4/220-libstdc++-namespace.patch36
-rw-r--r--patches/gcc/4.2.4/230-libbackend_dep_gcov-iov.h.patch12
-rw-r--r--patches/gcc/4.2.4/240-arm-bigendian.patch64
-rw-r--r--patches/gcc/4.2.4/241-arm-bigendian2.patch33
-rw-r--r--patches/gcc/4.2.4/250-softfloat-fix.patch58
-rw-r--r--patches/gcc/4.2.4/260-flatten-switch-stmt-00.patch24
-rw-r--r--patches/gcc/4.2.4/270-soft-float.patch21
-rw-r--r--patches/gcc/4.2.4/280-eabi_fixes.patch13
-rw-r--r--patches/gcc/4.2.4/290-alpha-signal_h.patch17
-rw-r--r--patches/gcc/4.2.4/300-fortran-signed-TImode.patch43
-rw-r--r--patches/gcc/4.2.4/310-sh-without-headers.patch26
-rw-r--r--patches/gcc/4.2.4/320-libgcc_eh.a.patch32
-rw-r--r--patches/gcc/4.3.6/100-alpha-mieee-default.patch39
-rw-r--r--patches/gcc/4.3.6/110-trampolinewarn.patch40
-rw-r--r--patches/gcc/4.3.6/120-java-nomulti.patch52
-rw-r--r--patches/gcc/4.3.6/130-cross-compile.patch49
-rw-r--r--patches/gcc/4.3.6/140-netbsd-symbolic.patch19
-rw-r--r--patches/gcc/4.3.6/150-sparc64-bsd.patch35
-rw-r--r--patches/gcc/4.3.6/160-flatten-switch-stmt-00.patch81
-rw-r--r--patches/gcc/4.3.6/170-libiberty-pic.patch17
-rw-r--r--patches/gcc/4.3.6/180-superh-default-multilib.patch30
-rw-r--r--patches/gcc/4.3.6/190-libstdc++-pic.patch61
-rw-r--r--patches/gcc/4.3.6/200-pr24170.patch66
-rw-r--r--patches/gcc/4.3.6/210-noteGNUstack-00.patch101
-rw-r--r--patches/gcc/4.3.6/220-noteGNUstack-01.patch203
-rw-r--r--patches/gcc/4.3.6/230-pr34571.patch28
-rw-r--r--patches/gcc/4.3.6/240-pr25343.patch26
-rw-r--r--patches/gcc/4.3.6/250-sh-pr24836.patch33
-rw-r--r--patches/gcc/4.3.6/260-uclibc-conf-noupstream.patch18
-rw-r--r--patches/gcc/4.3.6/270-missing-execinfo_h.patch18
-rw-r--r--patches/gcc/4.3.6/280-c99-complex-ugly-hack.patch19
-rw-r--r--patches/gcc/4.3.6/290-index_macro.patch32
-rw-r--r--patches/gcc/4.3.6/300-libmudflap-susv3-legacy.patch54
-rw-r--r--patches/gcc/4.3.6/310-arm-softfloat.patch34
-rw-r--r--patches/gcc/4.3.6/320-alpha-signal_h.patch23
-rw-r--r--patches/gcc/4.3.6/330-unwind-for-uClibc.patch30
-rw-r--r--patches/gcc/4.3.6/340-make-mno-spe-work-as-expected.patch90
-rw-r--r--patches/gcc/4.3.6/350-sh-without-headers.patch29
-rw-r--r--patches/gcc/4.3.6/380-pr37436.patch86
-rw-r--r--patches/gcc/4.3.6/390-unbreak-armv4t.patch11
-rw-r--r--patches/gcc/4.3.6/400-ecjx-host-cc.patch13
-rw-r--r--patches/gcc/4.3.6/410-pr42289-fix-libffi-build-on-arm-oabi.patch11
-rw-r--r--patches/gcc/4.3.6/420-libgcc_eh.a.patch39
-rw-r--r--patches/gcc/4.4.7/100-alpha-mieee-default.patch24
-rw-r--r--patches/gcc/4.4.7/110-trampolinewarn.patch27
-rw-r--r--patches/gcc/4.4.7/120-java-nomulti.patch46
-rw-r--r--patches/gcc/4.4.7/130-cross-compile.patch39
-rw-r--r--patches/gcc/4.4.7/140-default-format-security.patch49
-rw-r--r--patches/gcc/4.4.7/150-default-fortify-source.patch26
-rw-r--r--patches/gcc/4.4.7/160-netbsd-symbolic.patch11
-rw-r--r--patches/gcc/4.4.7/170-sparc64-bsd.patch29
-rw-r--r--patches/gcc/4.4.7/180-libgomp-no-werror.patch12
-rw-r--r--patches/gcc/4.4.7/190-flatten-switch-stmt-00.patch24
-rw-r--r--patches/gcc/4.4.7/200-libiberty.h-asprintf.patch15
-rw-r--r--patches/gcc/4.4.7/210-arm-unbreak-armv4t.patch12
-rw-r--r--patches/gcc/4.4.7/220-libiberty-pic.patch11
-rw-r--r--patches/gcc/4.4.7/230-superh-default-multilib.patch12
-rw-r--r--patches/gcc/4.4.7/240-libstdc++-pic.patch53
-rw-r--r--patches/gcc/4.4.7/250-ia64-noteGNUstack.patch79
-rw-r--r--patches/gcc/4.4.7/260-sh-libgcc-stacks.patch25
-rw-r--r--patches/gcc/4.4.7/270-sh-pr24836.patch24
-rw-r--r--patches/gcc/4.4.7/280-freebsd.patch94
-rw-r--r--patches/gcc/4.4.7/290-freebsd.patch64
-rw-r--r--patches/gcc/4.4.7/300-uclibc-conf.patch35
-rw-r--r--patches/gcc/4.4.7/310-missing-execinfo_h.patch12
-rw-r--r--patches/gcc/4.4.7/320-c99-snprintf.patch12
-rw-r--r--patches/gcc/4.4.7/330-libmudflap-susv3-legacy.patch48
-rw-r--r--patches/gcc/4.4.7/340-ecjx-host-cc.patch13
-rw-r--r--patches/gcc/4.4.7/350-index_macro.patch30
-rw-r--r--patches/gcc/4.4.7/360-arm-bigendian.patch32
-rw-r--r--patches/gcc/4.4.7/370-bootstrap-target_lib_path.patch38
-rw-r--r--patches/gcc/4.4.7/380-powerpc-libgcc_s-link-libm.patch134
-rw-r--r--patches/gcc/4.4.7/390-arm-softfloat-libgcc.patch38
-rw-r--r--patches/gcc/4.4.7/400-pr42289-fix-libffi-build-on-arm-oabi.patch11
-rw-r--r--patches/gcc/4.4.7/410-libgcc_eh.a.patch39
-rw-r--r--patches/gcc/4.5.4/100-ecjx-host.patch13
-rw-r--r--patches/gcc/4.5.4/110-libgcc_eh.a.patch39
-rw-r--r--patches/gcc/4.6.4/100-libgcc_eh.a.patch39
-rw-r--r--patches/gcc/4.7.4/000-libitm-fix-definition-of-__m64.patch27
-rw-r--r--patches/gcc/4.7.4/100-fix-PR-target-58595.patch102
-rw-r--r--patches/gcc/4.7.4/100-hardfloat-ld.patch44
-rw-r--r--patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch14
-rw-r--r--patches/gcc/5.3.0/100-uclibc-conf.patch (renamed from patches/gcc/5.2.0/100-uclibc-conf.patch)0
-rw-r--r--patches/gcc/5.3.0/110-xtensa-implement-trap-pattern.patch (renamed from patches/gcc/5.2.0/110-xtensa-implement-trap-pattern.patch)0
-rw-r--r--patches/gcc/5.3.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch29
-rw-r--r--patches/gcc/5.3.0/301-missing-execinfo_h.patch (renamed from patches/gcc/5.2.0/301-missing-execinfo_h.patch)0
-rw-r--r--patches/gcc/5.3.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch160
-rw-r--r--patches/gcc/5.3.0/380-gcc-plugin-POSIX-include-sys-select-h.patch11
-rw-r--r--patches/gcc/5.3.0/810-arm-softfloat-libgcc.patch (renamed from patches/gcc/5.2.0/810-arm-softfloat-libgcc.patch)0
-rw-r--r--patches/gcc/5.3.0/830-arm_unbreak_armv4t.patch (renamed from patches/gcc/5.2.0/830-arm_unbreak_armv4t.patch)0
-rw-r--r--patches/gcc/5.3.0/840-microblaze-enable-dwarf-eh-support.patch (renamed from patches/gcc/5.2.0/840-microblaze-enable-dwarf-eh-support.patch)0
-rw-r--r--patches/gcc/5.3.0/850-libstdcxx-uclibc-c99.patch (renamed from patches/gcc/5.2.0/850-libstdcxx-uclibc-c99.patch)0
-rw-r--r--patches/gcc/5.3.0/860-cilk-wchar.patch (renamed from patches/gcc/5.2.0/860-cilk-wchar.patch)0
-rw-r--r--patches/gcc/5.3.0/870-xtensa-add-mauto-litpools-option.patch (renamed from patches/gcc/5.2.0/870-xtensa-add-mauto-litpools-option.patch)0
-rw-r--r--patches/gcc/5.3.0/871-xtensa-reimplement-register-spilling.patch (renamed from patches/gcc/5.2.0/871-xtensa-reimplement-register-spilling.patch)0
-rw-r--r--patches/gcc/5.3.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch (renamed from patches/gcc/5.2.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch)0
-rw-r--r--patches/gcc/5.3.0/873-xtensa-fix-_Unwind_GetCFA.patch (renamed from patches/gcc/5.2.0/873-xtensa-fix-_Unwind_GetCFA.patch)0
-rw-r--r--patches/gcc/5.3.0/900-libitm-fixes-for-musl-support.patch (renamed from patches/gcc/5.2.0/900-libitm-fixes-for-musl-support.patch)0
-rw-r--r--patches/gcc/5.3.0/901-fixincludes-update-for-musl-support.patch (renamed from patches/gcc/5.2.0/901-fixincludes-update-for-musl-support.patch)0
-rw-r--r--patches/gcc/5.3.0/902-unwind-fix-for-musl.patch (renamed from patches/gcc/5.2.0/902-unwind-fix-for-musl.patch)0
-rw-r--r--patches/gcc/5.3.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch (renamed from patches/gcc/5.2.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch)0
-rw-r--r--patches/gcc/5.3.0/904-musl-libc-config.patch (renamed from patches/gcc/5.2.0/904-musl-libc-config.patch)0
-rw-r--r--patches/gcc/5.3.0/905-add-musl-support-to-gcc.patch (renamed from patches/gcc/5.2.0/905-add-musl-support-to-gcc.patch)0
-rw-r--r--patches/gcc/5.3.0/906-mips-musl-support.patch (renamed from patches/gcc/5.2.0/906-mips-musl-support.patch)0
-rw-r--r--patches/gcc/5.3.0/907-x86-musl-support.patch (renamed from patches/gcc/5.2.0/907-x86-musl-support.patch)0
-rw-r--r--patches/gcc/5.3.0/908-arm-musl-support.patch (renamed from patches/gcc/5.2.0/908-arm-musl-support.patch)0
-rw-r--r--patches/gcc/5.3.0/909-aarch64-musl-support.patch (renamed from patches/gcc/5.2.0/909-aarch64-musl-support.patch)0
-rw-r--r--patches/ppl/0.10.2/100-fix-configure-with-gmp-5_0_1.patch28
-rw-r--r--patches/ppl/0.10.2/200-fix-build-with-local-gmp.patch26
-rw-r--r--patches/ppl/0.11.1/100-fix-java-test-vs-enabled-shared.patch28
-rw-r--r--patches/ppl/0.11.1/200-fix-build-with-local-gmp.patch24
-rw-r--r--patches/ppl/0.11.1/300-fix-data-dir.patch94
-rw-r--r--patches/ppl/0.11.2/100-fix-java-test-vs-enabled-shared.patch28
-rw-r--r--patches/ppl/0.11.2/200-fix-build-with-local-gmp.patch24
-rw-r--r--patches/ppl/0.11.2/300-fix-data-dir.patch94
-rw-r--r--patches/ppl/0.11.2/400-fix-build-with-gmp-5.1.patch52
-rw-r--r--patches/ppl/0.11.2/500-ptrdiff_t.patch95
-rw-r--r--patches/ppl/0.11/100-fix-java-test-vs-enabled-shared.patch28
-rw-r--r--patches/ppl/0.11/200-fix-build-with-local-gmp.patch24
-rw-r--r--patches/ppl/0.11/300-fix-data-dir.patch94
232 files changed, 6843 insertions, 11053 deletions
diff --git a/patches/binutils/2.16.1a/100-bfd-hash-tweak.patch b/patches/binutils/2.16.1a/100-bfd-hash-tweak.patch
deleted file mode 100644
index c6de93a..0000000
--- a/patches/binutils/2.16.1a/100-bfd-hash-tweak.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Signed-off-by: dank@kegel.com
-
-Raising the size of the hash table is a noticable win when linking
-at least one large app.
-
-There was a patch,
-http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
-to do this dynamically. No idea why that didn't make it in.
-So this tiny change to raise the default size is just
-a stopgap for now.
-
-
---- binutils-2.16.1/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800
-+++ binutils-2.16.1/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800
-@@ -300,7 +300,7 @@
- */
-
- /* The default number of entries to use when creating a hash table. */
--#define DEFAULT_SIZE 4051
-+#define DEFAULT_SIZE 32749
- static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
-
- /* Create a new hash table, given a number of entries. */
diff --git a/patches/binutils/2.16.1a/110-psignal.patch b/patches/binutils/2.16.1a/110-psignal.patch
deleted file mode 100644
index 98fa600..0000000
--- a/patches/binutils/2.16.1a/110-psignal.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Make psignal prototype in libiberty match that in glibc.
-
-Fixes:
-
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
-/usr/include/signal.h:131: prototype declaration
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
-/usr/include/signal.h:131: prototype declaration
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
-mprotect... make[1]: *** [strsignal.o] Error 1
-make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
-make: *** [all-libiberty] Error 2
-
-when building on red hat 7.1
-though it's a bit of a mystery why libiberty's psignal is being compiled at
-all, since red hat 7.1's glibc supports psignal (hence the error message)
-
---- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
-+++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
-@@ -544,7 +544,7 @@
-
- /*
-
--@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
-+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
-
- Print @var{message} to the standard error, followed by a colon,
- followed by the description of the signal specified by @var{signo},
-@@ -557,9 +557,7 @@
- #ifndef HAVE_PSIGNAL
-
- void
--psignal (signo, message)
-- unsigned signo;
-- char *message;
-+psignal (int signo, const char *message)
- {
- if (signal_names == NULL)
- {
diff --git a/patches/binutils/2.16.1a/120-skip-comments.patch b/patches/binutils/2.16.1a/120-skip-comments.patch
deleted file mode 100644
index 0ca9a47..0000000
--- a/patches/binutils/2.16.1a/120-skip-comments.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
-
-Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
-Fixes
-localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
-when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
-
-Paths adjusted to match crosstool's patcher.
-
-Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
-From: Andreas Schwab <schwab at suse dot de>
-To: Nathan Sidwell <nathan at codesourcery dot com>
-Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
-Date: Fri, 23 Apr 2004 22:27:19 +0200
-Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
-
-Nathan Sidwell <nathan@codesourcery.com> writes:
-
-> Index: read.c
-> ===================================================================
-> RCS file: /cvs/src/src/gas/read.c,v
-> retrieving revision 1.76
-> diff -c -3 -p -r1.76 read.c
-> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
-> --- read.c 18 Mar 2004 09:56:05 -0000
-> *************** read_a_source_file (char *name)
-> *** 1053,1059 ****
-> #endif
-> input_line_pointer--;
-> /* Report unknown char as ignored. */
-> ! ignore_rest_of_line ();
-> }
->
-> #ifdef md_after_pass_hook
-> --- 1053,1059 ----
-> #endif
-> input_line_pointer--;
-> /* Report unknown char as ignored. */
-> ! demand_empty_rest_of_line ();
-> }
->
-> #ifdef md_after_pass_hook
-
-This means that the unknown character is no longer ignored, despite the
-comment. As a side effect a line starting with a line comment character
-not followed by APP in NO_APP mode now triggers an error instead of just a
-warning, breaking builds of glibc on m68k-linux. Earlier in
-read_a_source_file where #APP is handled there is another comment that
-claims that unknown comments are ignored, when in fact they aren't (only
-the initial line comment character is skipped).
-
-Note that the presence of #APP will mess up the line counters, but
-that appears to be difficult to fix.
-
-Andreas.
-
-2004-04-23 Andreas Schwab <schwab@suse.de>
-
- * read.c (read_a_source_file): Ignore unknown text after line
- comment character. Fix misleading comment.
-
---- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
-+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
-@@ -950,10 +950,14 @@ read_a_source_file (char *name)
- unsigned int new_length;
- char *tmp_buf = 0;
-
-- bump_line_counters ();
- s = input_line_pointer;
- if (strncmp (s, "APP\n", 4))
-- continue; /* We ignore it */
-+ {
-+ /* We ignore it */
-+ ignore_rest_of_line ();
-+ continue;
-+ }
-+ bump_line_counters ();
- s += 4;
-
- sb_new (&sbuf);
-@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
- continue;
- #endif
- input_line_pointer--;
-- /* Report unknown char as ignored. */
-+ /* Report unknown char as error. */
- demand_empty_rest_of_line ();
- }
-
-
---
-Andreas Schwab, SuSE Labs, schwab@suse.de
-SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
-Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
-"And now for something completely different."
diff --git a/patches/binutils/2.16.1a/130-callahan.patch b/patches/binutils/2.16.1a/130-callahan.patch
deleted file mode 100644
index a39050f..0000000
--- a/patches/binutils/2.16.1a/130-callahan.patch
+++ /dev/null
@@ -1,693 +0,0 @@
-Signed-off-by: dank@kegel.com
-Fixes ld speed issue.
-See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
-See thread "Re: optimizations for 3x speedup in ld",
-http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
-
-Wildcard section matching enhancement, backported from the binutils CVS tree.
-Here's the CVS log comment from the original change to ldlang.c:
-
-revision 1.177
-date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51
-2005-04-06 Jakub Jelinek <jakub@redhat.com>
-
- * ldlang.c: Formatting.
- (walk_wild_consider_section): Remember return value from wildcardp.
- (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
- (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
-
-2005-04-06 Robert O'Callahan <rocallahan@novell.com>
-
- * ld.h (lean_section_userdata_type): Remove.
- (fat_section_userdata_type): Remove file field.
- (SECTION_USERDATA_SIZE): Remove.
- * ldlang.c (init_os): Eliminate initialization of unused
- lean_section_userdata_type.
-
- * ldlang.h (callback_t, walk_wild_section_handler_t): New
- typedefs.
- (struct lang_wild_statement_struct): Add walk_wild_section_handler
- and handler_data fields.
- * ldlang.c (callback_t): Removed.
- (walk_wild_consider_section, walk_wild_section_general,
- section_iterator_callback, find_section, is_simple_wild,
- match_simple_wild, walk_wild_section_specs1_wild0,
- walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
- walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
- wild_spec_can_overlap, analyze_walk_wild_section_handler): New
- functions.
- (lang_add_wild): Call analyze_walk_wild_section_handler.
- (walk_wild_section): Renamed to walk_wild_section_general and
- created a wrapper function.
- (section_iterator_callback_data): New typedef.
-
-
-Index: src/ld/ld.h
-===================================================================
-RCS file: /cvs/src/src/ld/ld.h,v
-retrieving revision 1.26
-retrieving revision 1.27
-diff -u -r1.26 -r1.27
---- binutils/ld/ld.h.old 16 Mar 2005 21:52:42 -0000 1.26
-+++ binutils/ld/ld.h 6 Apr 2005 15:33:02 -0000 1.27
-@@ -1,6 +1,6 @@
- /* ld.h -- general linker header file
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-- 2001, 2002, 2003, 2004
-+ 2001, 2002, 2003, 2004, 2005
- Free Software Foundation, Inc.
-
- This file is part of GLD, the Gnu Linker.
-@@ -89,28 +89,15 @@
- struct map_symbol_def *next;
- };
-
--/* Extra information we hold on sections */
--typedef struct lean_user_section_struct {
-- /* For output sections: pointer to the section where this data will go. */
-- struct lang_input_statement_struct *file;
--} lean_section_userdata_type;
--
- /* The initial part of fat_user_section_struct has to be idential with
- lean_user_section_struct. */
- typedef struct fat_user_section_struct {
-- /* For output sections: pointer to the section where this data will go. */
-- struct lang_input_statement_struct *file;
- /* For input sections, when writing a map file: head / tail of a linked
- list of hash table entries for symbols defined in this section. */
- struct map_symbol_def *map_symbol_def_head;
- struct map_symbol_def **map_symbol_def_tail;
- } fat_section_userdata_type;
-
--#define SECTION_USERDATA_SIZE \
-- (command_line.reduce_memory_overheads \
-- ? sizeof (lean_section_userdata_type) \
-- : sizeof (fat_section_userdata_type))
--
- #define get_userdata(x) ((x)->userdata)
-
- #define BYTE_SIZE (1)
-Index: src/ld/ldlang.c
-===================================================================
-RCS file: /cvs/src/src/ld/ldlang.c,v
-retrieving revision 1.176
-retrieving revision 1.177
-diff -u -r1.176 -r1.177
---- binutils/ld/ldlang.c.old 18 Mar 2005 13:56:26 -0000 1.176
-+++ binutils/ld/ldlang.c 6 Apr 2005 15:33:02 -0000 1.177
-@@ -84,9 +84,6 @@
- static void lang_record_phdrs (void);
- static void lang_do_version_exports_section (void);
-
--typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
-- asection *, lang_input_statement_type *, void *);
--
- /* Exported variables. */
- lang_output_section_statement_type *abs_output_section;
- lang_statement_list_type lang_output_section_statement;
-@@ -155,21 +152,71 @@
-
- /* Generic traversal routines for finding matching sections. */
-
-+/* Try processing a section against a wildcard. This just calls
-+ the callback unless the filename exclusion list is present
-+ and excludes the file. It's hardly ever present so this
-+ function is very fast. */
-+
-+static void
-+walk_wild_consider_section (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ asection *s,
-+ struct wildcard_list *sec,
-+ callback_t callback,
-+ void *data)
-+{
-+ bfd_boolean skip = FALSE;
-+ struct name_list *list_tmp;
-+
-+ /* Don't process sections from files which were
-+ excluded. */
-+ for (list_tmp = sec->spec.exclude_name_list;
-+ list_tmp;
-+ list_tmp = list_tmp->next)
-+ {
-+ bfd_boolean is_wildcard = wildcardp (list_tmp->name);
-+ if (is_wildcard)
-+ skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
-+ else
-+ skip = strcmp (list_tmp->name, file->filename) == 0;
-+
-+ /* If this file is part of an archive, and the archive is
-+ excluded, exclude this file. */
-+ if (! skip && file->the_bfd != NULL
-+ && file->the_bfd->my_archive != NULL
-+ && file->the_bfd->my_archive->filename != NULL)
-+ {
-+ if (is_wildcard)
-+ skip = fnmatch (list_tmp->name,
-+ file->the_bfd->my_archive->filename,
-+ 0) == 0;
-+ else
-+ skip = strcmp (list_tmp->name,
-+ file->the_bfd->my_archive->filename) == 0;
-+ }
-+
-+ if (skip)
-+ break;
-+ }
-+
-+ if (!skip)
-+ (*callback) (ptr, sec, s, file, data);
-+}
-+
-+/* Lowest common denominator routine that can handle everything correctly,
-+ but slowly. */
-+
- static void
--walk_wild_section (lang_wild_statement_type *ptr,
-- lang_input_statement_type *file,
-- callback_t callback,
-- void *data)
-+walk_wild_section_general (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ callback_t callback,
-+ void *data)
- {
- asection *s;
--
-- if (file->just_syms_flag)
-- return;
-+ struct wildcard_list *sec;
-
- for (s = file->the_bfd->sections; s != NULL; s = s->next)
- {
-- struct wildcard_list *sec;
--
- sec = ptr->section_list;
- if (sec == NULL)
- (*callback) (ptr, sec, s, file, data);
-@@ -177,39 +224,8 @@
- while (sec != NULL)
- {
- bfd_boolean skip = FALSE;
-- struct name_list *list_tmp;
-
-- /* Don't process sections from files which were
-- excluded. */
-- for (list_tmp = sec->spec.exclude_name_list;
-- list_tmp;
-- list_tmp = list_tmp->next)
-- {
-- if (wildcardp (list_tmp->name))
-- skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
-- else
-- skip = strcmp (list_tmp->name, file->filename) == 0;
--
-- /* If this file is part of an archive, and the archive is
-- excluded, exclude this file. */
-- if (! skip && file->the_bfd != NULL
-- && file->the_bfd->my_archive != NULL
-- && file->the_bfd->my_archive->filename != NULL)
-- {
-- if (wildcardp (list_tmp->name))
-- skip = fnmatch (list_tmp->name,
-- file->the_bfd->my_archive->filename,
-- 0) == 0;
-- else
-- skip = strcmp (list_tmp->name,
-- file->the_bfd->my_archive->filename) == 0;
-- }
--
-- if (skip)
-- break;
-- }
--
-- if (!skip && sec->spec.name != NULL)
-+ if (sec->spec.name != NULL)
- {
- const char *sname = bfd_get_section_name (file->the_bfd, s);
-
-@@ -220,13 +236,381 @@
- }
-
- if (!skip)
-- (*callback) (ptr, sec, s, file, data);
-+ walk_wild_consider_section (ptr, file, s, sec, callback, data);
-
- sec = sec->next;
- }
- }
- }
-
-+/* Routines to find a single section given its name. If there's more
-+ than one section with that name, we report that. */
-+
-+typedef struct
-+{
-+ asection *found_section;
-+ bfd_boolean multiple_sections_found;
-+} section_iterator_callback_data;
-+
-+static bfd_boolean
-+section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
-+{
-+ section_iterator_callback_data *d = data;
-+
-+ if (d->found_section != NULL)
-+ {
-+ d->multiple_sections_found = TRUE;
-+ return TRUE;
-+ }
-+
-+ d->found_section = s;
-+ return FALSE;
-+}
-+
-+static asection *
-+find_section (lang_input_statement_type *file,
-+ struct wildcard_list *sec,
-+ bfd_boolean *multiple_sections_found)
-+{
-+ section_iterator_callback_data cb_data = { NULL, FALSE };
-+
-+ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name,
-+ section_iterator_callback, &cb_data);
-+ *multiple_sections_found = cb_data.multiple_sections_found;
-+ return cb_data.found_section;
-+}
-+
-+/* Code for handling simple wildcards without going through fnmatch,
-+ which can be expensive because of charset translations etc. */
-+
-+/* A simple wild is a literal string followed by a single '*',
-+ where the literal part is at least 4 characters long. */
-+
-+static bfd_boolean
-+is_simple_wild (const char *name)
-+{
-+ size_t len = strcspn (name, "*?[");
-+ return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
-+}
-+
-+static bfd_boolean
-+match_simple_wild (const char *pattern, const char *name)
-+{
-+ /* The first four characters of the pattern are guaranteed valid
-+ non-wildcard characters. So we can go faster. */
-+ if (pattern[0] != name[0] || pattern[1] != name[1]
-+ || pattern[2] != name[2] || pattern[3] != name[3])
-+ return FALSE;
-+
-+ pattern += 4;
-+ name += 4;
-+ while (*pattern != '*')
-+ if (*name++ != *pattern++)
-+ return FALSE;
-+
-+ return TRUE;
-+}
-+
-+/* Specialized, optimized routines for handling different kinds of
-+ wildcards */
-+
-+static void
-+walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ callback_t callback,
-+ void *data)
-+{
-+ /* We can just do a hash lookup for the section with the right name.
-+ But if that lookup discovers more than one section with the name
-+ (should be rare), we fall back to the general algorithm because
-+ we would otherwise have to sort the sections to make sure they
-+ get processed in the bfd's order. */
-+ bfd_boolean multiple_sections_found;
-+ struct wildcard_list *sec0 = ptr->handler_data[0];
-+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
-+
-+ if (multiple_sections_found)
-+ walk_wild_section_general (ptr, file, callback, data);
-+ else if (s0)
-+ walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
-+}
-+
-+static void
-+walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ callback_t callback,
-+ void *data)
-+{
-+ asection *s;
-+ struct wildcard_list *wildsec0 = ptr->handler_data[0];
-+
-+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
-+ {
-+ const char *sname = bfd_get_section_name (file->the_bfd, s);
-+ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
-+
-+ if (!skip)
-+ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
-+ }
-+}
-+
-+static void
-+walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ callback_t callback,
-+ void *data)
-+{
-+ asection *s;
-+ struct wildcard_list *sec0 = ptr->handler_data[0];
-+ struct wildcard_list *wildsec1 = ptr->handler_data[1];
-+ bfd_boolean multiple_sections_found;
-+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
-+
-+ if (multiple_sections_found)
-+ {
-+ walk_wild_section_general (ptr, file, callback, data);
-+ return;
-+ }
-+
-+ /* Note that if the section was not found, s0 is NULL and
-+ we'll simply never succeed the s == s0 test below. */
-+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
-+ {
-+ /* Recall that in this code path, a section cannot satisfy more
-+ than one spec, so if s == s0 then it cannot match
-+ wildspec1. */
-+ if (s == s0)
-+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
-+ else
-+ {
-+ const char *sname = bfd_get_section_name (file->the_bfd, s);
-+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
-+
-+ if (!skip)
-+ walk_wild_consider_section (ptr, file, s, wildsec1, callback,
-+ data);
-+ }
-+ }
-+}
-+
-+static void
-+walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ callback_t callback,
-+ void *data)
-+{
-+ asection *s;
-+ struct wildcard_list *sec0 = ptr->handler_data[0];
-+ struct wildcard_list *wildsec1 = ptr->handler_data[1];
-+ struct wildcard_list *wildsec2 = ptr->handler_data[2];
-+ bfd_boolean multiple_sections_found;
-+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
-+
-+ if (multiple_sections_found)
-+ {
-+ walk_wild_section_general (ptr, file, callback, data);
-+ return;
-+ }
-+
-+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
-+ {
-+ if (s == s0)
-+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
-+ else
-+ {
-+ const char *sname = bfd_get_section_name (file->the_bfd, s);
-+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
-+
-+ if (!skip)
-+ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
-+ else
-+ {
-+ skip = !match_simple_wild (wildsec2->spec.name, sname);
-+ if (!skip)
-+ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
-+ data);
-+ }
-+ }
-+ }
-+}
-+
-+static void
-+walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ callback_t callback,
-+ void *data)
-+{
-+ asection *s;
-+ struct wildcard_list *sec0 = ptr->handler_data[0];
-+ struct wildcard_list *sec1 = ptr->handler_data[1];
-+ struct wildcard_list *wildsec2 = ptr->handler_data[2];
-+ struct wildcard_list *wildsec3 = ptr->handler_data[3];
-+ bfd_boolean multiple_sections_found;
-+ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
-+
-+ if (multiple_sections_found)
-+ {
-+ walk_wild_section_general (ptr, file, callback, data);
-+ return;
-+ }
-+
-+ s1 = find_section (file, sec1, &multiple_sections_found);
-+ if (multiple_sections_found)
-+ {
-+ walk_wild_section_general (ptr, file, callback, data);
-+ return;
-+ }
-+
-+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
-+ {
-+ if (s == s0)
-+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
-+ else
-+ if (s == s1)
-+ walk_wild_consider_section (ptr, file, s, sec1, callback, data);
-+ else
-+ {
-+ const char *sname = bfd_get_section_name (file->the_bfd, s);
-+ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
-+ sname);
-+
-+ if (!skip)
-+ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
-+ data);
-+ else
-+ {
-+ skip = !match_simple_wild (wildsec3->spec.name, sname);
-+ if (!skip)
-+ walk_wild_consider_section (ptr, file, s, wildsec3,
-+ callback, data);
-+ }
-+ }
-+ }
-+}
-+
-+static void
-+walk_wild_section (lang_wild_statement_type *ptr,
-+ lang_input_statement_type *file,
-+ callback_t callback,
-+ void *data)
-+{
-+ if (file->just_syms_flag)
-+ return;
-+
-+ (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
-+}
-+
-+/* Returns TRUE when name1 is a wildcard spec that might match
-+ something name2 can match. We're conservative: we return FALSE
-+ only if the prefixes of name1 and name2 are different up to the
-+ first wildcard character. */
-+
-+static bfd_boolean
-+wild_spec_can_overlap (const char *name1, const char *name2)
-+{
-+ size_t prefix1_len = strcspn (name1, "?*[");
-+ size_t prefix2_len = strcspn (name2, "?*[");
-+ size_t min_prefix_len;
-+
-+ /* Note that if there is no wildcard character, then we treat the
-+ terminating 0 as part of the prefix. Thus ".text" won't match
-+ ".text." or ".text.*", for example. */
-+ if (name1[prefix1_len] == '\0')
-+ prefix1_len++;
-+ if (name2[prefix2_len] == '\0')
-+ prefix2_len++;
-+
-+ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
-+
-+ return memcmp (name1, name2, min_prefix_len) == 0;
-+}
-+
-+/* Select specialized code to handle various kinds of wildcard
-+ statements. */
-+
-+static void
-+analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
-+{
-+ int sec_count = 0;
-+ int wild_name_count = 0;
-+ struct wildcard_list *sec;
-+ int signature;
-+ int data_counter;
-+
-+ ptr->walk_wild_section_handler = walk_wild_section_general;
-+
-+ /* Count how many wildcard_specs there are, and how many of those
-+ actually use wildcards in the name. Also, bail out if any of the
-+ wildcard names are NULL. (Can this actually happen?
-+ walk_wild_section used to test for it.) And bail out if any
-+ of the wildcards are more complex than a simple string
-+ ending in a single '*'. */
-+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
-+ {
-+ ++sec_count;
-+ if (sec->spec.name == NULL)
-+ return;
-+ if (wildcardp (sec->spec.name))
-+ {
-+ ++wild_name_count;
-+ if (!is_simple_wild (sec->spec.name))
-+ return;
-+ }
-+ }
-+
-+ /* The zero-spec case would be easy to optimize but it doesn't
-+ happen in practice. Likewise, more than 4 specs doesn't
-+ happen in practice. */
-+ if (sec_count == 0 || sec_count > 4)
-+ return;
-+
-+ /* Check that no two specs can match the same section. */
-+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
-+ {
-+ struct wildcard_list *sec2;
-+ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
-+ {
-+ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
-+ return;
-+ }
-+ }
-+
-+ signature = (sec_count << 8) + wild_name_count;
-+ switch (signature)
-+ {
-+ case 0x0100:
-+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
-+ break;
-+ case 0x0101:
-+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
-+ break;
-+ case 0x0201:
-+ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
-+ break;
-+ case 0x0302:
-+ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
-+ break;
-+ case 0x0402:
-+ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
-+ break;
-+ default:
-+ return;
-+ }
-+
-+ /* Now fill the data array with pointers to the specs, first the
-+ specs with non-wildcard names, then the specs with wildcard
-+ names. It's OK to process the specs in different order from the
-+ given order, because we've already determined that no section
-+ will match more than one spec. */
-+ data_counter = 0;
-+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
-+ if (!wildcardp (sec->spec.name))
-+ ptr->handler_data[data_counter++] = sec;
-+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
-+ if (wildcardp (sec->spec.name))
-+ ptr->handler_data[data_counter++] = sec;
-+}
-+
- /* Handle a wild statement for a single file F. */
-
- static void
-@@ -1175,17 +1559,12 @@
- static void
- init_os (lang_output_section_statement_type *s)
- {
-- lean_section_userdata_type *new;
--
- if (s->bfd_section != NULL)
- return;
-
- if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
- einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
-
-- new = stat_alloc (SECTION_USERDATA_SIZE);
-- memset (new, 0, SECTION_USERDATA_SIZE);
--
- s->bfd_section = bfd_get_section_by_name (output_bfd, s->name);
- if (s->bfd_section == NULL)
- s->bfd_section = bfd_make_section (output_bfd, s->name);
-@@ -1199,7 +1578,14 @@
- /* We initialize an output sections output offset to minus its own
- vma to allow us to output a section through itself. */
- s->bfd_section->output_offset = 0;
-- get_userdata (s->bfd_section) = new;
-+ if (!command_line.reduce_memory_overheads)
-+ {
-+ fat_section_userdata_type *new
-+ = stat_alloc (sizeof (fat_section_userdata_type));
-+ memset (new, 0, sizeof (fat_section_userdata_type));
-+ get_userdata (s->bfd_section) = new;
-+ }
-+
-
- /* If there is a base address, make sure that any sections it might
- mention are initialized. */
-@@ -4939,6 +5325,7 @@
- new->section_list = section_list;
- new->keep_sections = keep_sections;
- lang_list_init (&new->children);
-+ analyze_walk_wild_section_handler (new);
- }
-
- void
-Index: src/ld/ldlang.h
-===================================================================
-RCS file: /cvs/src/src/ld/ldlang.h,v
-retrieving revision 1.44
-retrieving revision 1.45
-diff -u -r1.44 -r1.45
---- binutils/ld/ldlang.h.old 3 Mar 2005 11:51:58 -0000 1.44
-+++ binutils/ld/ldlang.h 6 Apr 2005 15:33:03 -0000 1.45
-@@ -298,7 +298,17 @@
- union lang_statement_union *file;
- } lang_afile_asection_pair_statement_type;
-
--typedef struct lang_wild_statement_struct
-+typedef struct lang_wild_statement_struct lang_wild_statement_type;
-+
-+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
-+ asection *, lang_input_statement_type *, void *);
-+
-+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
-+ lang_input_statement_type *,
-+ callback_t callback,
-+ void *data);
-+
-+struct lang_wild_statement_struct
- {
- lang_statement_header_type header;
- const char *filename;
-@@ -306,7 +316,10 @@
- struct wildcard_list *section_list;
- bfd_boolean keep_sections;
- lang_statement_list_type children;
--} lang_wild_statement_type;
-+
-+ walk_wild_section_handler_t walk_wild_section_handler;
-+ struct wildcard_list *handler_data[4];
-+};
-
- typedef struct lang_address_statement_struct
- {
diff --git a/patches/binutils/2.16.1a/140-cross-gprof.patch b/patches/binutils/2.16.1a/140-cross-gprof.patch
deleted file mode 100644
index ea6c18f..0000000
--- a/patches/binutils/2.16.1a/140-cross-gprof.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700
-+++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700
-@@ -999,7 +999,7 @@
-
- # Some tools are only suitable for building in a "native" situation.
- # Remove these if host!=target.
--native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-
- # Similarly, some are only suitable for cross toolchains.
- # Remove these if host=target.
---- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700
-+++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700
-@@ -236,7 +236,7 @@
-
- # Some tools are only suitable for building in a "native" situation.
- # Remove these if host!=target.
--native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-
- # Similarly, some are only suitable for cross toolchains.
- # Remove these if host=target.
diff --git a/patches/binutils/2.16.1a/150-stabs-tweak.patch b/patches/binutils/2.16.1a/150-stabs-tweak.patch
deleted file mode 100644
index 86e3611..0000000
--- a/patches/binutils/2.16.1a/150-stabs-tweak.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Signed-off-by: dank@kegel.com
-
-See http://sourceware.org/ml/binutils/2005-12/msg00270.html
-http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
-
-STABS hash table size change, backported from the binutils CVS tree. Here's
-the CVS log comment for the original change:
-
-revision 1.25
-date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3
-(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
-bfd_hash_table_init_n(...,251) so that the size of the hash table can be
-controlled by the user.
-
---- binutils/bfd/stabs.c.old 4 May 2005 15:53:39 -0000 1.24
-+++ binutils/bfd/stabs.c 29 Dec 2005 10:29:23 -0000 1.25
-@@ -194,9 +194,8 @@
- goto error_return;
- /* Make sure the first byte is zero. */
- (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
-- if (! bfd_hash_table_init_n (&sinfo->includes,
-- stab_link_includes_newfunc,
-- 251))
-+ if (! bfd_hash_table_init (&sinfo->includes,
-+ stab_link_includes_newfunc))
- goto error_return;
- sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
- if (sinfo->stabstr == NULL)
diff --git a/patches/binutils/2.16.1a/160-i386-no-divide-comment.patch b/patches/binutils/2.16.1a/160-i386-no-divide-comment.patch
deleted file mode 100644
index 046a55f..0000000
--- a/patches/binutils/2.16.1a/160-i386-no-divide-comment.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -durN binutils-2.16.1.orig/gas/config/tc-i386.c binutils-2.16.1/gas/config/tc-i386.c
---- binutils-2.16.1.orig/gas/config/tc-i386.c 2005-04-13 19:58:42.000000000 +0200
-+++ binutils-2.16.1/gas/config/tc-i386.c 2008-09-22 09:00:09.000000000 +0200
-@@ -192,16 +192,10 @@
- #endif
- ;
-
--#if (defined (TE_I386AIX) \
-- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
-- && !defined (TE_LINUX) \
-- && !defined (TE_NETWARE) \
-- && !defined (TE_FreeBSD) \
-- && !defined (TE_NetBSD)))
- /* This array holds the chars that always start a comment. If the
- pre-processor is disabled, these aren't very useful. */
--const char comment_chars[] = "#/";
--#define PREFIX_SEPARATOR '\\'
-+const char comment_chars[] = "#";
-+#define PREFIX_SEPARATOR '/'
-
- /* This array holds the chars that only start a comment at the beginning of
- a line. If the line seems to have the form '# 123 filename'
-@@ -211,16 +205,7 @@
- #NO_APP at the beginning of its output.
- Also note that comments started like this one will always work if
- '/' isn't otherwise defined. */
--const char line_comment_chars[] = "#";
--
--#else
--/* Putting '/' here makes it impossible to use the divide operator.
-- However, we need it for compatibility with SVR4 systems. */
--const char comment_chars[] = "#";
--#define PREFIX_SEPARATOR '/'
--
--const char line_comment_chars[] = "/#";
--#endif
-+const char line_comment_chars[] = "#/";
-
- const char line_separator_chars[] = ";";
-
diff --git a/patches/binutils/2.17a/100-uclibc-conf.patch b/patches/binutils/2.17a/100-uclibc-conf.patch
deleted file mode 100644
index 267b76c..0000000
--- a/patches/binutils/2.17a/100-uclibc-conf.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-diff -dur binutils-2.17.old/bfd/configure binutils-2.17/bfd/configure
---- binutils-2.17.old/bfd/configure 2006-06-23 20:17:03.000000000 +0200
-+++ binutils-2.17/bfd/configure 2007-05-01 18:26:03.000000000 +0200
-@@ -3576,7 +3576,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux-gnu*|linux-uclibc*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -dur binutils-2.17.old/binutils/configure binutils-2.17/binutils/configure
---- binutils-2.17.old/binutils/configure 2006-04-06 23:49:29.000000000 +0200
-+++ binutils-2.17/binutils/configure 2007-05-01 18:26:03.000000000 +0200
-@@ -3411,7 +3411,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux-gnu*|linux-uclibc*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -dur binutils-2.17.old/configure binutils-2.17/configure
---- binutils-2.17.old/configure 2006-04-06 23:49:25.000000000 +0200
-+++ binutils-2.17/configure 2007-05-01 18:26:03.000000000 +0200
-@@ -1276,7 +1276,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -1584,7 +1584,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[3456789]86-*-vsta) ;; # don't add gprof back in
- i[3456789]86-*-go32*) ;; # don't add gprof back in
-diff -dur binutils-2.17.old/configure.in binutils-2.17/configure.in
---- binutils-2.17.old/configure.in 2006-06-23 20:19:53.000000000 +0200
-+++ binutils-2.17/configure.in 2007-05-01 18:26:03.000000000 +0200
-@@ -468,7 +468,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -776,7 +776,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[[3456789]]86-*-vsta) ;; # don't add gprof back in
- i[[3456789]]86-*-go32*) ;; # don't add gprof back in
-diff -dur binutils-2.17.old/gas/configure binutils-2.17/gas/configure
---- binutils-2.17.old/gas/configure 2006-04-06 23:49:31.000000000 +0200
-+++ binutils-2.17/gas/configure 2007-05-01 18:26:03.000000000 +0200
-@@ -3411,7 +3411,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux-gnu*|linux-uclibc*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -dur binutils-2.17.old/gprof/configure binutils-2.17/gprof/configure
---- binutils-2.17.old/gprof/configure 2006-04-06 23:49:33.000000000 +0200
-+++ binutils-2.17/gprof/configure 2007-05-01 18:26:03.000000000 +0200
-@@ -3414,6 +3414,11 @@
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-+linux-uclibc*)
-+ lt_cv_deplibs_check_method=pass_all
-+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
-+ ;;
-+
- netbsd* | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
-diff -dur binutils-2.17.old/ld/configure binutils-2.17/ld/configure
---- binutils-2.17.old/ld/configure 2006-04-11 12:36:26.000000000 +0200
-+++ binutils-2.17/ld/configure 2007-05-01 18:26:03.000000000 +0200
-@@ -3413,7 +3413,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux-gnu*|linux-uclibc*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -dur binutils-2.17.old/libtool.m4 binutils-2.17/libtool.m4
---- binutils-2.17.old/libtool.m4 2005-12-27 17:37:57.000000000 +0100
-+++ binutils-2.17/libtool.m4 2007-05-01 18:26:03.000000000 +0200
-@@ -739,7 +739,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux-gnu*|linux-uclibc*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -dur binutils-2.17.old/ltconfig binutils-2.17/ltconfig
---- binutils-2.17.old/ltconfig 2005-07-16 04:36:38.000000000 +0200
-+++ binutils-2.17/ltconfig 2007-05-01 18:26:03.000000000 +0200
-@@ -602,6 +602,7 @@
-
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
-+linux-uclibc*) ;;
- linux-gnu*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-@@ -1247,7 +1248,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux-gnu*|linux-uclibc*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
-diff -dur binutils-2.17.old/opcodes/configure binutils-2.17/opcodes/configure
---- binutils-2.17.old/opcodes/configure 2006-02-17 15:36:28.000000000 +0100
-+++ binutils-2.17/opcodes/configure 2007-05-01 18:26:03.000000000 +0200
-@@ -3579,7 +3579,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux-gnu*|linux-uclibc*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
diff --git a/patches/binutils/2.17a/110-arm-eabi-conf.patch b/patches/binutils/2.17a/110-arm-eabi-conf.patch
deleted file mode 100644
index 88d3a4f..0000000
--- a/patches/binutils/2.17a/110-arm-eabi-conf.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur binutils-2.17.old/configure binutils-2.17/configure
---- binutils-2.17.old/configure 2007-05-01 18:26:03.000000000 +0200
-+++ binutils-2.17/configure 2007-05-01 18:26:06.000000000 +0200
-@@ -1305,7 +1305,7 @@
- arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- ;;
-- arm*-*-linux-gnueabi)
-+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- noconfigdirs="$noconfigdirs target-libjava target-libobjc"
- ;;
-diff -dur binutils-2.17.old/configure.in binutils-2.17/configure.in
---- binutils-2.17.old/configure.in 2007-05-01 18:26:03.000000000 +0200
-+++ binutils-2.17/configure.in 2007-05-01 18:26:06.000000000 +0200
-@@ -497,7 +497,7 @@
- arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- ;;
-- arm*-*-linux-gnueabi)
-+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- noconfigdirs="$noconfigdirs target-libjava target-libobjc"
- ;;
diff --git a/patches/binutils/2.17a/120-makeinfo-version.patch b/patches/binutils/2.17a/120-makeinfo-version.patch
deleted file mode 100644
index 50ff5dd..0000000
--- a/patches/binutils/2.17a/120-makeinfo-version.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -u binutils-2.18-orig/configure binutils-2.18/configure
---- binutils-2.18-orig/configure 2007-08-06 16:29:40.000000000 -0400
-+++ binutils-2.18/configure 2007-09-27 22:41:51.000000000 -0400
-@@ -6125,10 +6125,10 @@
- *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
- *)
-
-- # For an installed makeinfo, we require it to be from texinfo 4.4 or
-+ # For an installed makeinfo, we require it to be from texinfo 4.6 or
- # higher, else we use the "missing" dummy.
- if ${MAKEINFO} --version \
-- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
-+ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
- :
- else
- MAKEINFO="$MISSING makeinfo"
diff --git a/patches/binutils/2.17a/130-ld_makefile_patch.patch b/patches/binutils/2.17a/130-ld_makefile_patch.patch
deleted file mode 100644
index b40ec67..0000000
--- a/patches/binutils/2.17a/130-ld_makefile_patch.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -dur binutils-2.17.old/ld/Makefile.am binutils-2.17/ld/Makefile.am
---- binutils-2.17.old/ld/Makefile.am 2006-06-03 06:45:50.000000000 +0200
-+++ binutils-2.17/ld/Makefile.am 2007-05-01 18:26:09.000000000 +0200
-@@ -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 -dur binutils-2.17.old/ld/Makefile.in binutils-2.17/ld/Makefile.in
---- binutils-2.17.old/ld/Makefile.in 2006-06-03 06:45:50.000000000 +0200
-+++ binutils-2.17/ld/Makefile.in 2007-05-01 18:26:09.000000000 +0200
-@@ -269,7 +269,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
diff --git a/patches/binutils/2.17a/140-better_file_error.patch b/patches/binutils/2.17a/140-better_file_error.patch
deleted file mode 100644
index 7900f17..0000000
--- a/patches/binutils/2.17a/140-better_file_error.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
---- binutils-2.17.old/bfd/opncls.c 2006-03-16 13:20:16.000000000 +0100
-+++ binutils-2.17/bfd/opncls.c 2007-05-01 18:26:11.000000000 +0200
-@@ -158,6 +158,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)
diff --git a/patches/binutils/2.17a/150-check_ldrunpath_length.patch b/patches/binutils/2.17a/150-check_ldrunpath_length.patch
deleted file mode 100644
index 7c24796..0000000
--- a/patches/binutils/2.17a/150-check_ldrunpath_length.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
---- binutils-2.17.old/ld/emultempl/elf32.em 2006-06-12 15:05:04.000000000 +0200
-+++ binutils-2.17/ld/emultempl/elf32.em 2007-05-01 18:26:13.000000000 +0200
-@@ -970,6 +970,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;
-@@ -1154,6 +1156,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,
diff --git a/patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch b/patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch
deleted file mode 100644
index 0a4980b..0000000
--- a/patches/binutils/2.17a/160-mips-ELF_MAXPAGESIZE-4K.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -dur binutils-2.17.old/bfd/elf32-mips.c binutils-2.17/bfd/elf32-mips.c
---- binutils-2.17.old/bfd/elf32-mips.c 2006-03-22 10:28:13.000000000 +0100
-+++ binutils-2.17/bfd/elf32-mips.c 2007-05-01 18:26:15.000000000 +0200
-@@ -1617,7 +1617,9 @@
-
- /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
- page sizes of up to that limit, so we need to respect it. */
--#define ELF_MAXPAGESIZE 0x10000
-+/*#define ELF_MAXPAGESIZE 0x10000*/
-+/* Use 4K to shrink the elf header. NOT for general use! */
-+#define ELF_MAXPAGESIZE 0x1000
- #define elf32_bed elf32_tradbed
-
- /* Include the target file again for this target. */
-diff -dur binutils-2.17.old/bfd/elfn32-mips.c binutils-2.17/bfd/elfn32-mips.c
---- binutils-2.17.old/bfd/elfn32-mips.c 2005-11-23 15:04:17.000000000 +0100
-+++ binutils-2.17/bfd/elfn32-mips.c 2007-05-01 18:26:15.000000000 +0200
-@@ -2402,7 +2402,9 @@
-
- /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
- page sizes of up to that limit, so we need to respect it. */
--#define ELF_MAXPAGESIZE 0x10000
-+/*#define ELF_MAXPAGESIZE 0x10000*/
-+/* Use 4K to shrink the elf header. NOT for general use! */
-+#define ELF_MAXPAGESIZE 0x1000
- #define elf32_bed elf32_tradbed
-
- /* Include the target file again for this target. */
diff --git a/patches/binutils/2.17a/170-bfd-hash-tweak.patch b/patches/binutils/2.17a/170-bfd-hash-tweak.patch
deleted file mode 100644
index c878282..0000000
--- a/patches/binutils/2.17a/170-bfd-hash-tweak.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Signed-off-by: dank@kegel.com
-
-Raising the size of the hash table is a noticable win when linking
-at least one large app.
-
-There was a patch,
-http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
-to do this dynamically. No idea why that didn't make it in.
-So this tiny change to raise the default size is just
-a stopgap for now.
-
-
---- binutils-2.17/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800
-+++ binutils-2.17/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800
-@@ -298,7 +298,7 @@
- */
-
- /* The default number of entries to use when creating a hash table. */
--#define DEFAULT_SIZE 4051
-+#define DEFAULT_SIZE 32749
- static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
-
- /* Create a new hash table, given a number of entries. */
diff --git a/patches/binutils/2.17a/180-psignal.patch b/patches/binutils/2.17a/180-psignal.patch
deleted file mode 100644
index 2506ff2..0000000
--- a/patches/binutils/2.17a/180-psignal.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Make psignal prototype in libiberty match that in glibc.
-
-Fixes:
-
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
-/usr/include/signal.h:131: prototype declaration
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
-/usr/include/signal.h:131: prototype declaration
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
-mprotect... make[1]: *** [strsignal.o] Error 1
-make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
-make: *** [all-libiberty] Error 2
-
-when building on red hat 7.1
-though it's a bit of a mystery why libiberty's psignal is being compiled at
-all, since red hat 7.1's glibc supports psignal (hence the error message)
-
---- binutils-2.17/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
-+++ binutils-2.17/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
-@@ -536,7 +536,7 @@
-
- /*
-
--@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
-+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
-
- Print @var{message} to the standard error, followed by a colon,
- followed by the description of the signal specified by @var{signo},
diff --git a/patches/binutils/2.17a/190-skip-comments.patch b/patches/binutils/2.17a/190-skip-comments.patch
deleted file mode 100644
index df49ad3..0000000
--- a/patches/binutils/2.17a/190-skip-comments.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
-
-Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
-Fixes
-localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
-when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
-
-Paths adjusted to match crosstool's patcher.
-
-Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
-From: Andreas Schwab <schwab at suse dot de>
-To: Nathan Sidwell <nathan at codesourcery dot com>
-Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
-Date: Fri, 23 Apr 2004 22:27:19 +0200
-Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
-
-Nathan Sidwell <nathan@codesourcery.com> writes:
-
-> Index: read.c
-> ===================================================================
-> RCS file: /cvs/src/src/gas/read.c,v
-> retrieving revision 1.76
-> diff -c -3 -p -r1.76 read.c
-> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
-> --- read.c 18 Mar 2004 09:56:05 -0000
-> *************** read_a_source_file (char *name)
-> *** 1053,1059 ****
-> #endif
-> input_line_pointer--;
-> /* Report unknown char as ignored. */
-> ! ignore_rest_of_line ();
-> }
->
-> #ifdef md_after_pass_hook
-> --- 1053,1059 ----
-> #endif
-> input_line_pointer--;
-> /* Report unknown char as ignored. */
-> ! demand_empty_rest_of_line ();
-> }
->
-> #ifdef md_after_pass_hook
-
-This means that the unknown character is no longer ignored, despite the
-comment. As a side effect a line starting with a line comment character
-not followed by APP in NO_APP mode now triggers an error instead of just a
-warning, breaking builds of glibc on m68k-linux. Earlier in
-read_a_source_file where #APP is handled there is another comment that
-claims that unknown comments are ignored, when in fact they aren't (only
-the initial line comment character is skipped).
-
-Note that the presence of #APP will mess up the line counters, but
-that appears to be difficult to fix.
-
-Andreas.
-
-2004-04-23 Andreas Schwab <schwab@suse.de>
-
- * read.c (read_a_source_file): Ignore unknown text after line
- comment character. Fix misleading comment.
-
---- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
-+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
-@@ -1008,10 +1008,14 @@ read_a_source_file (char *name)
- unsigned int new_length;
- char *tmp_buf = 0;
-
-- bump_line_counters ();
- s = input_line_pointer;
- if (strncmp (s, "APP\n", 4))
-- continue; /* We ignore it */
-+ {
-+ /* We ignore it */
-+ ignore_rest_of_line ();
-+ continue;
-+ }
-+ bump_line_counters ();
- s += 4;
-
- sb_new (&sbuf);
-@@ -1110,7 +1110,7 @@ read_a_source_file (char *name)
- continue;
- #endif
- input_line_pointer--;
-- /* Report unknown char as ignored. */
-+ /* Report unknown char as error. */
- demand_empty_rest_of_line ();
- }
-
-
---
-Andreas Schwab, SuSE Labs, schwab@suse.de
-SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
-Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
-"And now for something completely different."
diff --git a/patches/binutils/2.17a/200-cross-gprof.patch b/patches/binutils/2.17a/200-cross-gprof.patch
deleted file mode 100644
index eda79b3..0000000
--- a/patches/binutils/2.17a/200-cross-gprof.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- binutils-2.17/configure.old 2004-07-21 21:36:47.000000000 -0700
-+++ binutils-2.17/configure 2004-07-21 21:37:08.000000000 -0700
-@@ -1022,7 +1022,7 @@
-
- # Some tools are only suitable for building in a "native" situation.
- # Remove these if host!=target.
--native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-
- # Similarly, some are only suitable for cross toolchains.
- # Remove these if host=target.
---- binutils-2.17/configure.in.old 2004-07-21 21:37:19.000000000 -0700
-+++ binutils-2.17/configure.in 2004-07-21 21:37:34.000000000 -0700
-@@ -227,7 +227,7 @@
-
- # Some tools are only suitable for building in a "native" situation.
- # Remove these if host!=target.
--native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-
- # Similarly, some are only suitable for cross toolchains.
- # Remove these if host=target.
diff --git a/patches/binutils/2.17a/210-i386-no-divide-comment.patch b/patches/binutils/2.17a/210-i386-no-divide-comment.patch
deleted file mode 100644
index c6b3f62..0000000
--- a/patches/binutils/2.17a/210-i386-no-divide-comment.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -durN binutils-2.17.orig/gas/config/tc-i386.c binutils-2.17/gas/config/tc-i386.c
---- binutils-2.17.orig/gas/config/tc-i386.c 2006-04-07 08:40:57.000000000 +0200
-+++ binutils-2.17/gas/config/tc-i386.c 2008-09-22 09:06:07.000000000 +0200
-@@ -196,24 +196,10 @@
- #endif
- ;
-
--#if (defined (TE_I386AIX) \
-- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
-- && !defined (TE_GNU) \
-- && !defined (TE_LINUX) \
-- && !defined (TE_NETWARE) \
-- && !defined (TE_FreeBSD) \
-- && !defined (TE_NetBSD)))
- /* This array holds the chars that always start a comment. If the
-- pre-processor is disabled, these aren't very useful. The option
-- --divide will remove '/' from this list. */
--const char *i386_comment_chars = "#/";
--#define SVR4_COMMENT_CHARS 1
--#define PREFIX_SEPARATOR '\\'
--
--#else
-+ pre-processor is disabled, these aren't very useful. */
- const char *i386_comment_chars = "#";
- #define PREFIX_SEPARATOR '/'
--#endif
-
- /* This array holds the chars that only start a comment at the beginning of
- a line. If the line seems to have the form '# 123 filename'
-@@ -5486,20 +5472,6 @@
- break;
-
- case OPTION_DIVIDE:
--#ifdef SVR4_COMMENT_CHARS
-- {
-- char *n, *t;
-- const char *s;
--
-- n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
-- t = n;
-- for (s = i386_comment_chars; *s != '\0'; s++)
-- if (*s != '/')
-- *t++ = *s;
-- *t = '\0';
-- i386_comment_chars = n;
-- }
--#endif
- break;
-
- default:
-@@ -5525,13 +5497,8 @@
- fprintf (stream, _("\
- -s ignored\n"));
- #endif
--#ifdef SVR4_COMMENT_CHARS
-- fprintf (stream, _("\
-- --divide do not treat `/' as a comment character\n"));
--#else
- fprintf (stream, _("\
- --divide ignored\n"));
--#endif
- }
-
- #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
diff --git a/patches/binutils/2.18a/100-makeinfo-version.patch b/patches/binutils/2.18a/100-makeinfo-version.patch
deleted file mode 100644
index d911d62..0000000
--- a/patches/binutils/2.18a/100-makeinfo-version.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -u binutils-2.18-orig/configure binutils-2.18/configure
---- binutils-2.18-orig/configure 2007-08-06 16:29:40.000000000 -0400
-+++ binutils-2.18/configure 2007-09-27 22:41:51.000000000 -0400
-@@ -6125,10 +6125,10 @@
- *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
- *)
-
-- # For an installed makeinfo, we require it to be from texinfo 4.4 or
-+ # For an installed makeinfo, we require it to be from texinfo 4.6 or
- # higher, else we use the "missing" dummy.
- if ${MAKEINFO} --version \
-- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
-+ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
- :
- else
- MAKEINFO="$MISSING makeinfo"
-diff -u binutils-2.18-orig/configure.ac binutils-2.18/configure.ac
---- binutils-2.18-orig/configure.ac 2007-08-28 16:24:26.000000000 -0400
-+++ binutils-2.18/configure.ac 2007-09-27 22:41:00.000000000 -0400
-@@ -2400,10 +2400,10 @@
- *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
- *)
- changequote(,)
-- # For an installed makeinfo, we require it to be from texinfo 4.4 or
-+ # For an installed makeinfo, we require it to be from texinfo 4.6 or
- # higher, else we use the "missing" dummy.
- if ${MAKEINFO} --version \
-- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
-+ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
- :
- else
- MAKEINFO="$MISSING makeinfo"
diff --git a/patches/binutils/2.18a/110-enable-dash-v2.patch b/patches/binutils/2.18a/110-enable-dash-v2.patch
deleted file mode 100644
index 587082c..0000000
--- a/patches/binutils/2.18a/110-enable-dash-v2.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Enable using a shell other than bash.
-Courtesy "Martin Guy" <martinwguy@yahoo.it>
-http://sourceware.org/ml/crossgcc/2008-08/msg00037.html
-
---- binutils-2.18.orig/ld/genscripts.sh 2007-08-12 20:00:07.000000000 +0100
-+++ binutils-2.18/ld/genscripts.sh 2008-08-25 16:09:54.000000000 +0100
-@@ -398,9 +398,11 @@
- . $em_script
- em_script=$current_script
- }
-- fragment()
-+
-+ alias fragment='em_lineno=$LINENO; fragment_em'
-+ fragment_em()
- {
-- local lineno=$[${BASH_LINENO[0]} + 1]
-+ local lineno=$[$em_lineno + 1]
- echo >> e${EMULATION_NAME}.c "#line $lineno \"$em_script\""
- cat >> e${EMULATION_NAME}.c
- }
diff --git a/patches/binutils/2.18a/120-i386-no-divide-comment.patch b/patches/binutils/2.18a/120-i386-no-divide-comment.patch
deleted file mode 100644
index efbbcea..0000000
--- a/patches/binutils/2.18a/120-i386-no-divide-comment.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -durN binutils-2.18.orig/gas/config/tc-i386.c binutils-2.18/gas/config/tc-i386.c
---- binutils-2.18.orig/gas/config/tc-i386.c 2007-08-24 16:01:22.000000000 +0200
-+++ binutils-2.18/gas/config/tc-i386.c 2008-09-22 08:11:42.000000000 +0200
-@@ -180,24 +180,10 @@
- #endif
- ;
-
--#if (defined (TE_I386AIX) \
-- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
-- && !defined (TE_GNU) \
-- && !defined (TE_LINUX) \
-- && !defined (TE_NETWARE) \
-- && !defined (TE_FreeBSD) \
-- && !defined (TE_NetBSD)))
- /* This array holds the chars that always start a comment. If the
-- pre-processor is disabled, these aren't very useful. The option
-- --divide will remove '/' from this list. */
--const char *i386_comment_chars = "#/";
--#define SVR4_COMMENT_CHARS 1
--#define PREFIX_SEPARATOR '\\'
--
--#else
-+ pre-processor is disabled, these aren't very useful. */
- const char *i386_comment_chars = "#";
- #define PREFIX_SEPARATOR '/'
--#endif
-
- /* This array holds the chars that only start a comment at the beginning of
- a line. If the line seems to have the form '# 123 filename'
-@@ -6061,20 +6047,6 @@
- break;
-
- case OPTION_DIVIDE:
--#ifdef SVR4_COMMENT_CHARS
-- {
-- char *n, *t;
-- const char *s;
--
-- n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
-- t = n;
-- for (s = i386_comment_chars; *s != '\0'; s++)
-- if (*s != '/')
-- *t++ = *s;
-- *t = '\0';
-- i386_comment_chars = n;
-- }
--#endif
- break;
-
- case OPTION_MARCH:
-@@ -6142,13 +6114,8 @@
- fprintf (stream, _("\
- --32/--64 generate 32bit/64bit code\n"));
- #endif
--#ifdef SVR4_COMMENT_CHARS
-- fprintf (stream, _("\
-- --divide do not treat `/' as a comment character\n"));
--#else
- fprintf (stream, _("\
- --divide ignored\n"));
--#endif
- fprintf (stream, _("\
- -march=CPU/-mtune=CPU generate code/optimize for CPU, where CPU is one of:\n\
- i386, i486, pentium, pentiumpro, pentium4, nocona,\n\
diff --git a/patches/binutils/2.19.1a/100-ppc64-pie.patch b/patches/binutils/2.19.1a/100-ppc64-pie.patch
deleted file mode 100644
index 7b22fb9..0000000
--- a/patches/binutils/2.19.1a/100-ppc64-pie.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/100-ppc64-pie.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/03_all_binutils-2.15.92.0.2-ppc64-pie.patch
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/bfd/elf64-ppc.c binutils-2.19.1/bfd/elf64-ppc.c
---- binutils-2.19.1.orig/bfd/elf64-ppc.c 2008-10-09 14:18:24.000000000 +0200
-+++ binutils-2.19.1/bfd/elf64-ppc.c 2009-03-08 11:56:59.000000000 +0100
-@@ -11294,7 +11294,12 @@
- else if (!SYMBOL_REFERENCES_LOCAL (info, &h->elf)
- && !is_opd
- && r_type != R_PPC64_TOC)
-- outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
-+ {
-+ outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
-+ if (h->elf.dynindx == -1
-+ && h->elf.root.type == bfd_link_hash_undefweak)
-+ memset (&outrel, 0, sizeof outrel);
-+ }
- else
- {
- /* This symbol is local, or marked to become local,
diff --git a/patches/binutils/2.19.1a/110-RPATH_ENVVAR-smack.patch b/patches/binutils/2.19.1a/110-RPATH_ENVVAR-smack.patch
deleted file mode 100644
index 49e8142..0000000
--- a/patches/binutils/2.19.1a/110-RPATH_ENVVAR-smack.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/110-RPATH_ENVVAR-smack.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/08_all_binutils-RPATH_ENVVAR-smack.patch
-
-http://sourceware.org/ml/binutils/2007-07/msg00401.html
-http://sourceware.org/bugzilla/show_bug.cgi?id=4970
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/configure binutils-2.19.1/configure
---- binutils-2.19.1.orig/configure 2008-09-04 04:18:16.000000000 +0200
-+++ binutils-2.19.1/configure 2009-03-08 11:57:00.000000000 +0100
-@@ -5601,6 +5601,7 @@
- *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
- *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
- esac
-+RPATH_ENVVAR="cant_touch_this_nah_nah_nah"
-
- # On systems where the dynamic library environment variable is PATH,
- if test "$RPATH_ENVVAR" = PATH; then
diff --git a/patches/binutils/2.19.1a/120-sh-targets.patch b/patches/binutils/2.19.1a/120-sh-targets.patch
deleted file mode 100644
index 5d1ecbe..0000000
--- a/patches/binutils/2.19.1a/120-sh-targets.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/120-sh-targets.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/12_all_sh-targets.patch
-
-r10231 | lethal | 2005-05-02 09:58:00 -0400 (Mon, 02 May 2005) | 13 lines
-
-Likewise, binutils has no idea about any of these new targets either, so we
-fix that up too.. now we're able to actually build a real toolchain for
-sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
-inept targets than that one, really. Go look, I promise).
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/configure binutils-2.19.1/configure
---- binutils-2.19.1.orig/configure 2009-03-08 11:57:00.000000000 +0100
-+++ binutils-2.19.1/configure 2009-03-08 11:57:00.000000000 +0100
-@@ -2281,7 +2281,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -2606,7 +2606,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[3456789]86-*-vsta) ;; # don't add gprof back in
- i[3456789]86-*-go32*) ;; # don't add gprof back in
-diff -durN binutils-2.19.1.orig/configure.ac binutils-2.19.1/configure.ac
---- binutils-2.19.1.orig/configure.ac 2009-02-02 12:54:49.000000000 +0100
-+++ binutils-2.19.1/configure.ac 2009-03-08 11:57:00.000000000 +0100
-@@ -530,7 +530,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -855,7 +855,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[[3456789]]86-*-vsta) ;; # don't add gprof back in
- i[[3456789]]86-*-go32*) ;; # don't add gprof back in
diff --git a/patches/binutils/2.19.1a/130-check_ldrunpath_length.patch b/patches/binutils/2.19.1a/130-check_ldrunpath_length.patch
deleted file mode 100644
index 755e792..0000000
--- a/patches/binutils/2.19.1a/130-check_ldrunpath_length.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/130-check_ldrunpath_length.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/42_all_012_check_ldrunpath_length.patch
-
-Originaly from Debian:
-## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
-##
-## 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)
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/ld/emultempl/elf32.em binutils-2.19.1/ld/emultempl/elf32.em
---- binutils-2.19.1.orig/ld/emultempl/elf32.em 2008-09-07 06:02:31.000000000 +0200
-+++ binutils-2.19.1/ld/emultempl/elf32.em 2009-03-08 11:57:01.000000000 +0100
-@@ -1219,6 +1219,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;
-@@ -1404,6 +1406,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
- (link_info.output_bfd, command_line.soname, rpath,
- command_line.filter_shlib,
diff --git a/patches/binutils/2.19.1a/140-pt-pax-flags-20081101.patch b/patches/binutils/2.19.1a/140-pt-pax-flags-20081101.patch
deleted file mode 100644
index 26eac68..0000000
--- a/patches/binutils/2.19.1a/140-pt-pax-flags-20081101.patch
+++ /dev/null
@@ -1,254 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/140-pt-pax-flags-20081101.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/63_all_binutils-2.19-pt-pax-flags-20081101.patch
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/bfd/elf-bfd.h binutils-2.19.1/bfd/elf-bfd.h
---- binutils-2.19.1.orig/bfd/elf-bfd.h 2008-08-21 01:28:58.000000000 +0200
-+++ binutils-2.19.1/bfd/elf-bfd.h 2009-03-08 11:57:02.000000000 +0100
-@@ -1526,6 +1526,9 @@
- /* Segment flags for the PT_GNU_STACK segment. */
- unsigned int stack_flags;
-
-+ /* Segment flags for the PT_PAX_FLAGS segment. */
-+ unsigned int pax_flags;
-+
- /* Symbol version definitions in external objects. */
- Elf_Internal_Verdef *verdef;
-
-diff -durN binutils-2.19.1.orig/bfd/elf.c binutils-2.19.1/bfd/elf.c
---- binutils-2.19.1.orig/bfd/elf.c 2008-12-23 14:54:48.000000000 +0100
-+++ binutils-2.19.1/bfd/elf.c 2009-03-08 11:57:02.000000000 +0100
-@@ -1136,6 +1136,7 @@
- case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
- case PT_GNU_STACK: pt = "STACK"; break;
- case PT_GNU_RELRO: pt = "RELRO"; break;
-+ case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
- default: pt = NULL; break;
- }
- return pt;
-@@ -2442,6 +2443,9 @@
- case PT_GNU_RELRO:
- return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
-
-+ case PT_PAX_FLAGS:
-+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "pax_flags");
-+
- default:
- /* Check for any processor-specific program segment types. */
- bed = get_elf_backend_data (abfd);
-@@ -3404,6 +3408,11 @@
- ++segs;
- }
-
-+ {
-+ /* We need a PT_PAX_FLAGS segment. */
-+ ++segs;
-+ }
-+
- for (s = abfd->sections; s != NULL; s = s->next)
- {
- if ((s->flags & SEC_LOAD) != 0
-@@ -3983,6 +3992,20 @@
- }
- }
-
-+ {
-+ amt = sizeof (struct elf_segment_map);
-+ m = bfd_zalloc (abfd, amt);
-+ if (m == NULL)
-+ goto error_return;
-+ m->next = NULL;
-+ m->p_type = PT_PAX_FLAGS;
-+ m->p_flags = elf_tdata (abfd)->pax_flags;
-+ m->p_flags_valid = 1;
-+
-+ *pm = m;
-+ pm = &m->next;
-+ }
-+
- free (sections);
- elf_tdata (abfd)->segment_map = mfirst;
- }
-@@ -5160,7 +5183,8 @@
- 6. PT_TLS segment includes only SHF_TLS sections.
- 7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
- 8. PT_DYNAMIC should not contain empty sections at the beginning
-- (with the possible exception of .dynamic). */
-+ (with the possible exception of .dynamic).
-+ 9. PT_PAX_FLAGS segments does not include any sections. */
- #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \
- ((((segment->p_paddr \
- ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
-@@ -5168,6 +5192,7 @@
- && (section->flags & SEC_ALLOC) != 0) \
- || IS_NOTE (segment, section)) \
- && segment->p_type != PT_GNU_STACK \
-+ && segment->p_type != PT_PAX_FLAGS \
- && (segment->p_type != PT_TLS \
- || (section->flags & SEC_THREAD_LOCAL)) \
- && (segment->p_type == PT_LOAD \
-diff -durN binutils-2.19.1.orig/bfd/elflink.c binutils-2.19.1/bfd/elflink.c
---- binutils-2.19.1.orig/bfd/elflink.c 2008-08-22 10:32:39.000000000 +0200
-+++ binutils-2.19.1/bfd/elflink.c 2009-03-08 11:57:02.000000000 +0100
-@@ -5397,16 +5397,30 @@
- return TRUE;
-
- bed = get_elf_backend_data (output_bfd);
-+ elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
-+
-+ if (info->execheap)
-+ elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
-+ else if (info->noexecheap)
-+ elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
-+
- if (info->execstack)
-- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+ {
-+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+ }
- else if (info->noexecstack)
-- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+ {
-+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-+ }
- else
- {
- bfd *inputobj;
- asection *notesec = NULL;
- int exec = 0;
-
-+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
- for (inputobj = info->input_bfds;
- inputobj;
- inputobj = inputobj->link_next)
-@@ -5419,7 +5433,11 @@
- if (s)
- {
- if (s->flags & SEC_CODE)
-- exec = PF_X;
-+ {
-+ elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
-+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+ exec = PF_X;
-+ }
- notesec = s;
- }
- else if (bed->default_execstack)
-diff -durN binutils-2.19.1.orig/binutils/readelf.c binutils-2.19.1/binutils/readelf.c
---- binutils-2.19.1.orig/binutils/readelf.c 2008-09-17 11:00:44.000000000 +0200
-+++ binutils-2.19.1/binutils/readelf.c 2009-03-08 11:57:02.000000000 +0100
-@@ -2505,6 +2505,7 @@
- return "GNU_EH_FRAME";
- case PT_GNU_STACK: return "GNU_STACK";
- case PT_GNU_RELRO: return "GNU_RELRO";
-+ case PT_PAX_FLAGS: return "PAX_FLAGS";
-
- default:
- if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
-diff -durN binutils-2.19.1.orig/include/bfdlink.h binutils-2.19.1/include/bfdlink.h
---- binutils-2.19.1.orig/include/bfdlink.h 2008-08-17 05:12:50.000000000 +0200
-+++ binutils-2.19.1/include/bfdlink.h 2009-03-08 11:57:02.000000000 +0100
-@@ -319,6 +319,14 @@
- /* TRUE if PT_GNU_RELRO segment should be created. */
- unsigned int relro: 1;
-
-+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
-+ flags. */
-+ unsigned int execheap: 1;
-+
-+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
-+ flags. */
-+ unsigned int noexecheap: 1;
-+
- /* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
- unsigned int warn_shared_textrel: 1;
-
-diff -durN binutils-2.19.1.orig/include/elf/common.h binutils-2.19.1/include/elf/common.h
---- binutils-2.19.1.orig/include/elf/common.h 2008-08-04 01:20:42.000000000 +0200
-+++ binutils-2.19.1/include/elf/common.h 2009-03-08 11:57:02.000000000 +0100
-@@ -360,6 +360,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_PAX_FLAGS (PT_LOOS + 0x5041580) /* PaX flags */
-
- /* Program segment permissions, in program header p_flags field. */
-
-@@ -370,6 +371,21 @@
- #define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
- #define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
-
-+/* Flags to control PaX behavior. */
-+
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
-+
- /* Values for section header, sh_type field. */
-
- #define SHT_NULL 0 /* Section header table entry unused */
-diff -durN binutils-2.19.1.orig/ld/emultempl/elf32.em binutils-2.19.1/ld/emultempl/elf32.em
---- binutils-2.19.1.orig/ld/emultempl/elf32.em 2009-03-08 11:57:01.000000000 +0100
-+++ binutils-2.19.1/ld/emultempl/elf32.em 2009-03-08 11:57:02.000000000 +0100
-@@ -2146,6 +2146,16 @@
- link_info.noexecstack = TRUE;
- link_info.execstack = FALSE;
- }
-+ else if (strcmp (optarg, "execheap") == 0)
-+ {
-+ link_info.execheap = TRUE;
-+ link_info.noexecheap = FALSE;
-+ }
-+ else if (strcmp (optarg, "noexecheap") == 0)
-+ {
-+ link_info.noexecheap = TRUE;
-+ link_info.execheap = FALSE;
-+ }
- EOF
-
- if test -n "$COMMONPAGESIZE"; then
-@@ -2229,6 +2239,8 @@
- fprintf (file, _("\
- -z execstack Mark executable as requiring executable stack\n"));
- fprintf (file, _("\
-+ -z execheap\t\tMark executable as requiring executable heap\n"));
-+ fprintf (file, _("\
- -z initfirst Mark DSO to be initialized first at runtime\n"));
- fprintf (file, _("\
- -z interpose Mark object to interpose all DSOs but executable\n"));
-@@ -2252,6 +2264,8 @@
- -z nodump Mark DSO not available to dldump\n"));
- fprintf (file, _("\
- -z noexecstack Mark executable as not requiring executable stack\n"));
-+ fprintf (file, _("\
-+ -z noexecheap\tMark executable as not requiring executable heap\n"));
- EOF
-
- if test -n "$COMMONPAGESIZE"; then
-diff -durN binutils-2.19.1.orig/ld/ldgram.y binutils-2.19.1/ld/ldgram.y
---- binutils-2.19.1.orig/ld/ldgram.y 2008-07-06 15:38:36.000000000 +0200
-+++ binutils-2.19.1/ld/ldgram.y 2009-03-08 11:57:02.000000000 +0100
-@@ -1112,6 +1112,8 @@
- $$ = exp_intop (0x6474e550);
- else if (strcmp (s, "PT_GNU_STACK") == 0)
- $$ = exp_intop (0x6474e551);
-+ else if (strcmp (s, "PT_PAX_FLAGS") == 0)
-+ $$ = exp_intop (0x65041580);
- else
- {
- einfo (_("\
diff --git a/patches/binutils/2.19.1a/150-warn-textrel.patch b/patches/binutils/2.19.1a/150-warn-textrel.patch
deleted file mode 100644
index dab77b1..0000000
--- a/patches/binutils/2.19.1a/150-warn-textrel.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/150-warn-textrel.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/66_all_binutils-2.18.50.0.2-warn-textrel.patch
-
-textrels are bad for forcing copy-on-write (this affects everyone),
-and for security/runtime code generation, this affects security ppl.
-But in either case, it doesn't matter who needs textrels, it's
-the very fact that they're needed at all.
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/bfd/elflink.c binutils-2.19.1/bfd/elflink.c
---- binutils-2.19.1.orig/bfd/elflink.c 2009-03-08 11:57:02.000000000 +0100
-+++ binutils-2.19.1/bfd/elflink.c 2009-03-08 11:57:02.000000000 +0100
-@@ -10820,14 +10820,12 @@
- goto error_return;
-
- /* Check for DT_TEXTREL (late, in case the backend removes it). */
-- if (info->warn_shared_textrel && info->shared)
-+ o = bfd_get_section_by_name (dynobj, ".dynamic");
-+ if (info->warn_shared_textrel && o != NULL)
- {
- bfd_byte *dyncon, *dynconend;
-
- /* Fix up .dynamic entries. */
-- o = bfd_get_section_by_name (dynobj, ".dynamic");
-- BFD_ASSERT (o != NULL);
--
- dyncon = o->contents;
- dynconend = o->contents + o->size;
- for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
-@@ -10839,7 +10837,7 @@
- if (dyn.d_tag == DT_TEXTREL)
- {
- info->callbacks->einfo
-- (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
-+ (_("%P: warning: creating a DT_TEXTREL in object.\n"));
- break;
- }
- }
-diff -durN binutils-2.19.1.orig/ld/ldmain.c binutils-2.19.1/ld/ldmain.c
---- binutils-2.19.1.orig/ld/ldmain.c 2008-08-17 05:12:50.000000000 +0200
-+++ binutils-2.19.1/ld/ldmain.c 2009-03-08 11:57:02.000000000 +0100
-@@ -274,6 +274,7 @@
- link_info.relax_pass = 1;
- link_info.pei386_auto_import = -1;
- link_info.spare_dynamic_tags = 5;
-+ link_info.warn_shared_textrel = TRUE;
- link_info.path_separator = ':';
-
- ldfile_add_arch ("");
diff --git a/patches/binutils/2.19.1a/160-use-new-ld-dtags.patch b/patches/binutils/2.19.1a/160-use-new-ld-dtags.patch
deleted file mode 100644
index 35b7bc7..0000000
--- a/patches/binutils/2.19.1a/160-use-new-ld-dtags.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/160-use-new-ld-dtags.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/76_all_use-new-ld-dtags.patch
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/ld/ldmain.c binutils-2.19.1/ld/ldmain.c
---- binutils-2.19.1.orig/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
-+++ binutils-2.19.1/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
-@@ -262,6 +262,7 @@
-
- link_info.allow_undefined_version = TRUE;
- link_info.keep_memory = TRUE;
-+ link_info.new_dtags = TRUE;
- link_info.combreloc = TRUE;
- link_info.strip_discarded = TRUE;
- link_info.emit_hash = TRUE;
diff --git a/patches/binutils/2.19.1a/170-use-relro.patch b/patches/binutils/2.19.1a/170-use-relro.patch
deleted file mode 100644
index 2de47ab..0000000
--- a/patches/binutils/2.19.1a/170-use-relro.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/170-use-relro.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/78_all_use-relro.patch
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/ld/ldmain.c binutils-2.19.1/ld/ldmain.c
---- binutils-2.19.1.orig/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
-+++ binutils-2.19.1/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
-@@ -264,6 +264,7 @@
- link_info.keep_memory = TRUE;
- link_info.new_dtags = TRUE;
- link_info.combreloc = TRUE;
-+ link_info.relro = TRUE;
- link_info.strip_discarded = TRUE;
- link_info.emit_hash = TRUE;
- link_info.callbacks = &link_callbacks;
diff --git a/patches/binutils/2.19.1a/180-libiberty-pic.patch b/patches/binutils/2.19.1a/180-libiberty-pic.patch
deleted file mode 100644
index 0c6a15f..0000000
--- a/patches/binutils/2.19.1a/180-libiberty-pic.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/180-libiberty-pic.patch
-
--= BEGIN original header =-
-Original patch from Gentoo:
-gentoo/src/patchsets/binutils/2.19/91_all_libiberty-pic.patch
-
--= END original header =-
-
-diff -durN binutils-2.19.1.orig/libiberty/Makefile.in binutils-2.19.1/libiberty/Makefile.in
---- binutils-2.19.1.orig/libiberty/Makefile.in 2008-07-24 15:51:49.000000000 +0200
-+++ binutils-2.19.1/libiberty/Makefile.in 2009-03-08 11:57:03.000000000 +0100
-@@ -227,6 +227,7 @@
- $(AR) $(AR_FLAGS) $(TARGETLIB) \
- $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
- $(RANLIB) $(TARGETLIB); \
-+ cp $(TARGETLIB) ../ ; \
- cd ..; \
- else true; fi
-
diff --git a/patches/binutils/2.19.1a/190-mips64-defaultemul.patch b/patches/binutils/2.19.1a/190-mips64-defaultemul.patch
deleted file mode 100644
index 62a8493..0000000
--- a/patches/binutils/2.19.1a/190-mips64-defaultemul.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- binutils-2.20/ld/configure.tgt.orig 2010-02-20 04:05:31.000000000 -0500
-+++ binutils-2.20/ld/configure.tgt 2010-02-20 04:08:11.000000000 -0500
-@@ -400,11 +400,11 @@
- mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
- targ_extra_emuls="elf32elmipvxworks" ;;
- mips*-*-windiss) targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
-- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-+mips64*el-*-linux-*) targ_emul=elf64ltsmip
-+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
- targ_extra_libpath=$targ_extra_emuls ;;
--mips64*-*-linux-*) targ_emul=elf32btsmipn32
-- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-+mips64*-*-linux-*) targ_emul=elf64btsmip
-+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
- targ_extra_libpath=$targ_extra_emuls ;;
- mips*el-*-linux-*) targ_emul=elf32ltsmip
- targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
diff --git a/patches/binutils/2.20.1a/100-ppc64-pie.patch b/patches/binutils/2.20.1a/100-ppc64-pie.patch
deleted file mode 100644
index 133864b..0000000
--- a/patches/binutils/2.20.1a/100-ppc64-pie.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/bfd/elf64-ppc.c binutils-2.20.1/bfd/elf64-ppc.c
---- binutils-2.20.1.orig/bfd/elf64-ppc.c 2010-02-03 14:28:25.000000000 +0100
-+++ binutils-2.20.1/bfd/elf64-ppc.c 2010-08-17 19:32:04.000000000 +0200
-@@ -11991,7 +11991,12 @@
- else if (!SYMBOL_REFERENCES_LOCAL (info, &h->elf)
- && !is_opd
- && r_type != R_PPC64_TOC)
-- outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
-+ {
-+ outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
-+ if (h->elf.dynindx == -1
-+ && h->elf.root.type == bfd_link_hash_undefweak)
-+ memset (&outrel, 0, sizeof outrel);
-+ }
- else
- {
- /* This symbol is local, or marked to become local,
diff --git a/patches/binutils/2.20.1a/110-RPATH_ENVVAR-smack.patch b/patches/binutils/2.20.1a/110-RPATH_ENVVAR-smack.patch
deleted file mode 100644
index fd446a2..0000000
--- a/patches/binutils/2.20.1a/110-RPATH_ENVVAR-smack.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-http://sourceware.org/ml/binutils/2007-07/msg00401.html
-http://sourceware.org/bugzilla/show_bug.cgi?id=4970
-
-diff -durN binutils-2.20.1.orig/configure binutils-2.20.1/configure
---- binutils-2.20.1.orig/configure 2010-03-03 14:59:02.000000000 +0100
-+++ binutils-2.20.1/configure 2010-08-17 19:32:05.000000000 +0200
-@@ -6466,6 +6466,7 @@
- *-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
- *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
- esac
-+RPATH_ENVVAR="cant_touch_this_nah_nah_nah"
-
- # On systems where the dynamic library environment variable is PATH,
- # gcc/ will put dynamic libraries into a subdirectory to avoid adding
diff --git a/patches/binutils/2.20.1a/120-sh-targets.patch b/patches/binutils/2.20.1a/120-sh-targets.patch
deleted file mode 100644
index 6e772d7..0000000
--- a/patches/binutils/2.20.1a/120-sh-targets.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/configure binutils-2.20.1/configure
---- binutils-2.20.1.orig/configure 2010-08-17 19:32:05.000000000 +0200
-+++ binutils-2.20.1/configure 2010-08-17 19:32:07.000000000 +0200
-@@ -3054,7 +3054,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -3390,7 +3390,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[3456789]86-*-vsta) ;; # don't add gprof back in
- i[3456789]86-*-go32*) ;; # don't add gprof back in
-diff -durN binutils-2.20.1.orig/configure.ac binutils-2.20.1/configure.ac
---- binutils-2.20.1.orig/configure.ac 2010-03-03 15:19:08.000000000 +0100
-+++ binutils-2.20.1/configure.ac 2010-08-17 19:32:07.000000000 +0200
-@@ -541,7 +541,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -877,7 +877,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[[3456789]]86-*-vsta) ;; # don't add gprof back in
- i[[3456789]]86-*-go32*) ;; # don't add gprof back in
diff --git a/patches/binutils/2.20.1a/140-check_ldrunpath_length.patch b/patches/binutils/2.20.1a/140-check_ldrunpath_length.patch
deleted file mode 100644
index 460e66c..0000000
--- a/patches/binutils/2.20.1a/140-check_ldrunpath_length.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh -e
-## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
-##
-## 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 /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
-
-diff -durN binutils-2.20.1.orig/ld/emultempl/elf32.em binutils-2.20.1/ld/emultempl/elf32.em
---- binutils-2.20.1.orig/ld/emultempl/elf32.em 2009-09-14 13:43:30.000000000 +0200
-+++ binutils-2.20.1/ld/emultempl/elf32.em 2010-08-17 19:32:09.000000000 +0200
-@@ -1233,6 +1233,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;
-@@ -1418,6 +1420,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
- (link_info.output_bfd, command_line.soname, rpath,
- command_line.filter_shlib,
diff --git a/patches/binutils/2.20.1a/150-pt-pax-flags-20090909.patch b/patches/binutils/2.20.1a/150-pt-pax-flags-20090909.patch
deleted file mode 100644
index 46d2ef7..0000000
--- a/patches/binutils/2.20.1a/150-pt-pax-flags-20090909.patch
+++ /dev/null
@@ -1,248 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/bfd/elf-bfd.h binutils-2.20.1/bfd/elf-bfd.h
---- binutils-2.20.1.orig/bfd/elf-bfd.h 2009-09-10 13:47:12.000000000 +0200
-+++ binutils-2.20.1/bfd/elf-bfd.h 2010-08-17 19:32:11.000000000 +0200
-@@ -1531,6 +1531,9 @@
- /* Segment flags for the PT_GNU_STACK segment. */
- unsigned int stack_flags;
-
-+ /* Segment flags for the PT_PAX_FLAGS segment. */
-+ unsigned int pax_flags;
-+
- /* Symbol version definitions in external objects. */
- Elf_Internal_Verdef *verdef;
-
-diff -durN binutils-2.20.1.orig/bfd/elf.c binutils-2.20.1/bfd/elf.c
---- binutils-2.20.1.orig/bfd/elf.c 2009-09-10 13:47:12.000000000 +0200
-+++ binutils-2.20.1/bfd/elf.c 2010-08-17 19:32:11.000000000 +0200
-@@ -1083,6 +1083,7 @@
- case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
- case PT_GNU_STACK: pt = "STACK"; break;
- case PT_GNU_RELRO: pt = "RELRO"; break;
-+ case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
- default: pt = NULL; break;
- }
- return pt;
-@@ -2396,6 +2397,9 @@
- case PT_GNU_RELRO:
- return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
-
-+ case PT_PAX_FLAGS:
-+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "pax_flags");
-+
- default:
- /* Check for any processor-specific program segment types. */
- bed = get_elf_backend_data (abfd);
-@@ -3413,6 +3417,11 @@
- ++segs;
- }
-
-+ {
-+ /* We need a PT_PAX_FLAGS segment. */
-+ ++segs;
-+ }
-+
- for (s = abfd->sections; s != NULL; s = s->next)
- {
- if ((s->flags & SEC_LOAD) != 0
-@@ -3994,6 +4003,20 @@
- }
- }
-
-+ {
-+ amt = sizeof (struct elf_segment_map);
-+ m = bfd_zalloc (abfd, amt);
-+ if (m == NULL)
-+ goto error_return;
-+ m->next = NULL;
-+ m->p_type = PT_PAX_FLAGS;
-+ m->p_flags = elf_tdata (abfd)->pax_flags;
-+ m->p_flags_valid = 1;
-+
-+ *pm = m;
-+ pm = &m->next;
-+ }
-+
- free (sections);
- elf_tdata (abfd)->segment_map = mfirst;
- }
-@@ -5198,7 +5221,8 @@
- 6. PT_TLS segment includes only SHF_TLS sections.
- 7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
- 8. PT_DYNAMIC should not contain empty sections at the beginning
-- (with the possible exception of .dynamic). */
-+ (with the possible exception of .dynamic).
-+ 9. PT_PAX_FLAGS segments do not include any sections. */
- #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \
- ((((segment->p_paddr \
- ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
-@@ -5206,6 +5230,7 @@
- && (section->flags & SEC_ALLOC) != 0) \
- || IS_NOTE (segment, section)) \
- && segment->p_type != PT_GNU_STACK \
-+ && segment->p_type != PT_PAX_FLAGS \
- && (segment->p_type != PT_TLS \
- || (section->flags & SEC_THREAD_LOCAL)) \
- && (segment->p_type == PT_LOAD \
-diff -durN binutils-2.20.1.orig/bfd/elflink.c binutils-2.20.1/bfd/elflink.c
---- binutils-2.20.1.orig/bfd/elflink.c 2009-09-10 13:47:12.000000000 +0200
-+++ binutils-2.20.1/bfd/elflink.c 2010-08-17 19:32:11.000000000 +0200
-@@ -5469,16 +5469,30 @@
- return TRUE;
-
- bed = get_elf_backend_data (output_bfd);
-+
-+ elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
-+ if (info->execheap)
-+ elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
-+ else if (info->noexecheap)
-+ elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
-+
- if (info->execstack)
-- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+ {
-+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+ }
- else if (info->noexecstack)
-- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+ {
-+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-+ }
- else
- {
- bfd *inputobj;
- asection *notesec = NULL;
- int exec = 0;
-
-+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
- for (inputobj = info->input_bfds;
- inputobj;
- inputobj = inputobj->link_next)
-@@ -5491,7 +5505,11 @@
- if (s)
- {
- if (s->flags & SEC_CODE)
-- exec = PF_X;
-+ {
-+ elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
-+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+ exec = PF_X;
-+ }
- notesec = s;
- }
- else if (bed->default_execstack)
-diff -durN binutils-2.20.1.orig/binutils/readelf.c binutils-2.20.1/binutils/readelf.c
---- binutils-2.20.1.orig/binutils/readelf.c 2010-01-14 11:48:23.000000000 +0100
-+++ binutils-2.20.1/binutils/readelf.c 2010-08-17 19:32:11.000000000 +0200
-@@ -2569,6 +2569,7 @@
- return "GNU_EH_FRAME";
- case PT_GNU_STACK: return "GNU_STACK";
- case PT_GNU_RELRO: return "GNU_RELRO";
-+ case PT_PAX_FLAGS: return "PAX_FLAGS";
-
- default:
- if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
-diff -durN binutils-2.20.1.orig/include/bfdlink.h binutils-2.20.1/include/bfdlink.h
---- binutils-2.20.1.orig/include/bfdlink.h 2009-09-10 13:47:30.000000000 +0200
-+++ binutils-2.20.1/include/bfdlink.h 2010-08-17 19:32:11.000000000 +0200
-@@ -321,6 +321,14 @@
- /* TRUE if PT_GNU_RELRO segment should be created. */
- unsigned int relro: 1;
-
-+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
-+ flags. */
-+ unsigned int execheap: 1;
-+
-+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
-+ flags. */
-+ unsigned int noexecheap: 1;
-+
- /* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
- unsigned int warn_shared_textrel: 1;
-
-diff -durN binutils-2.20.1.orig/include/elf/common.h binutils-2.20.1/include/elf/common.h
---- binutils-2.20.1.orig/include/elf/common.h 2009-08-09 15:42:26.000000000 +0200
-+++ binutils-2.20.1/include/elf/common.h 2010-08-17 19:32:11.000000000 +0200
-@@ -422,6 +422,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_PAX_FLAGS (PT_LOOS + 0x5041580) /* PaX flags */
-
- /* Program segment permissions, in program header p_flags field. */
-
-@@ -432,6 +433,21 @@
- #define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
- #define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
-
-+/* Flags to control PaX behavior. */
-+
-+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
-+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
-+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
-+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
-+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
-+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
-+
- /* Values for section header, sh_type field. */
-
- #define SHT_NULL 0 /* Section header table entry unused */
-diff -durN binutils-2.20.1.orig/ld/emultempl/elf32.em binutils-2.20.1/ld/emultempl/elf32.em
---- binutils-2.20.1.orig/ld/emultempl/elf32.em 2010-08-17 19:32:09.000000000 +0200
-+++ binutils-2.20.1/ld/emultempl/elf32.em 2010-08-17 19:32:11.000000000 +0200
-@@ -2165,6 +2165,16 @@
- link_info.noexecstack = TRUE;
- link_info.execstack = FALSE;
- }
-+ else if (strcmp (optarg, "execheap") == 0)
-+ {
-+ link_info.execheap = TRUE;
-+ link_info.noexecheap = FALSE;
-+ }
-+ else if (strcmp (optarg, "noexecheap") == 0)
-+ {
-+ link_info.noexecheap = TRUE;
-+ link_info.execheap = FALSE;
-+ }
- EOF
-
- if test -n "$COMMONPAGESIZE"; then
-@@ -2243,6 +2253,8 @@
- fprintf (file, _("\
- -z execstack Mark executable as requiring executable stack\n"));
- fprintf (file, _("\
-+ -z execheap Mark executable as requiring executable heap\n"));
-+ fprintf (file, _("\
- -z initfirst Mark DSO to be initialized first at runtime\n"));
- fprintf (file, _("\
- -z interpose Mark object to interpose all DSOs but executable\n"));
-@@ -2266,6 +2278,8 @@
- -z nodump Mark DSO not available to dldump\n"));
- fprintf (file, _("\
- -z noexecstack Mark executable as not requiring executable stack\n"));
-+ fprintf (file, _("\
-+ -z noexecheap Mark executable as not requiring executable heap\n"));
- EOF
-
- if test -n "$COMMONPAGESIZE"; then
-diff -durN binutils-2.20.1.orig/ld/ldgram.y binutils-2.20.1/ld/ldgram.y
---- binutils-2.20.1.orig/ld/ldgram.y 2009-09-02 09:25:35.000000000 +0200
-+++ binutils-2.20.1/ld/ldgram.y 2010-08-17 19:32:11.000000000 +0200
-@@ -1116,6 +1116,8 @@
- $$ = exp_intop (0x6474e550);
- else if (strcmp (s, "PT_GNU_STACK") == 0)
- $$ = exp_intop (0x6474e551);
-+ else if (strcmp (s, "PT_PAX_FLAGS") == 0)
-+ $$ = exp_intop (0x65041580);
- else
- {
- einfo (_("\
diff --git a/patches/binutils/2.20.1a/160-amd64-32bit-path.patch b/patches/binutils/2.20.1a/160-amd64-32bit-path.patch
deleted file mode 100644
index d851a2a..0000000
--- a/patches/binutils/2.20.1a/160-amd64-32bit-path.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/ld/emulparams/elf_i386.sh binutils-2.20.1/ld/emulparams/elf_i386.sh
---- binutils-2.20.1.orig/ld/emulparams/elf_i386.sh 2009-07-29 16:59:23.000000000 +0200
-+++ binutils-2.20.1/ld/emulparams/elf_i386.sh 2010-08-17 19:32:12.000000000 +0200
-@@ -13,3 +13,13 @@
- NO_SMALL_DATA=yes
- SEPARATE_GOTPLT=12
- IREL_IN_PLT=
-+
-+# In Gentoo, we install 32bit libs into /lib32 in an
-+# ABI setup with amd64/x86
-+case "$target" in
-+ x86_64*-linux*)
-+ case "$EMULATION_NAME" in
-+ *i386*) LIBPATH_SUFFIX=32 ;;
-+ esac
-+ ;;
-+esac
diff --git a/patches/binutils/2.20.1a/170-warn-textrel.patch b/patches/binutils/2.20.1a/170-warn-textrel.patch
deleted file mode 100644
index 66bc46d..0000000
--- a/patches/binutils/2.20.1a/170-warn-textrel.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-textrels are bad for forcing copy-on-write (this affects everyone),
-and for security/runtime code generation, this affects security ppl.
-But in either case, it doesn't matter who needs textrels, it's
-the very fact that they're needed at all.
-
-2006-06-10 Ned Ludd <solar@gentoo.org>, Mike Frysinger <vapier@gentoo.org>
-
- * bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs.
- * ld/ldmain.c (main): Change textrel warning default to true.
- * ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL
- warnings from ld output.
-
-diff -durN binutils-2.20.1.orig/bfd/elflink.c binutils-2.20.1/bfd/elflink.c
---- binutils-2.20.1.orig/bfd/elflink.c 2010-08-17 19:32:11.000000000 +0200
-+++ binutils-2.20.1/bfd/elflink.c 2010-08-17 19:32:13.000000000 +0200
-@@ -10988,14 +10988,12 @@
- goto error_return;
-
- /* Check for DT_TEXTREL (late, in case the backend removes it). */
-- if (info->warn_shared_textrel && info->shared)
-+ o = bfd_get_section_by_name (dynobj, ".dynamic");
-+ if (info->warn_shared_textrel && o != NULL)
- {
- bfd_byte *dyncon, *dynconend;
-
- /* Fix up .dynamic entries. */
-- o = bfd_get_section_by_name (dynobj, ".dynamic");
-- BFD_ASSERT (o != NULL);
--
- dyncon = o->contents;
- dynconend = o->contents + o->size;
- for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
-@@ -11007,7 +11005,7 @@
- if (dyn.d_tag == DT_TEXTREL)
- {
- info->callbacks->einfo
-- (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
-+ (_("%P: warning: creating a DT_TEXTREL in object.\n"));
- break;
- }
- }
-diff -durN binutils-2.20.1.orig/ld/ldmain.c binutils-2.20.1/ld/ldmain.c
---- binutils-2.20.1.orig/ld/ldmain.c 2009-09-14 13:43:29.000000000 +0200
-+++ binutils-2.20.1/ld/ldmain.c 2010-08-17 19:32:13.000000000 +0200
-@@ -280,6 +280,7 @@
- emulation = get_emulation (argc, argv);
- ldemul_choose_mode (emulation);
- default_target = ldemul_choose_target (argc, argv);
-+ link_info.warn_shared_textrel = TRUE;
- config.maxpagesize = bfd_emul_get_maxpagesize (default_target);
- config.commonpagesize = bfd_emul_get_commonpagesize (default_target);
- lang_init ();
-diff -durN binutils-2.20.1.orig/ld/testsuite/lib/ld-lib.exp binutils-2.20.1/ld/testsuite/lib/ld-lib.exp
---- binutils-2.20.1.orig/ld/testsuite/lib/ld-lib.exp 2009-10-02 12:51:13.000000000 +0200
-+++ binutils-2.20.1/ld/testsuite/lib/ld-lib.exp 2010-08-17 19:32:13.000000000 +0200
-@@ -196,6 +196,10 @@
- # symbol, since the default linker script might use ENTRY.
- regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
-
-+ # Gentoo tweak:
-+ # We want to ignore TEXTREL warnings since we force enable them by default
-+ regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
-+
- if [string match "" $exec_output] then {
- return 1
- } else {
diff --git a/patches/binutils/2.20.1a/190-use-new-ld-dtags.patch b/patches/binutils/2.20.1a/190-use-new-ld-dtags.patch
deleted file mode 100644
index 9a4ea99..0000000
--- a/patches/binutils/2.20.1a/190-use-new-ld-dtags.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/ld/ldmain.c binutils-2.20.1/ld/ldmain.c
---- binutils-2.20.1.orig/ld/ldmain.c 2010-08-17 19:32:13.000000000 +0200
-+++ binutils-2.20.1/ld/ldmain.c 2010-08-17 19:32:15.000000000 +0200
-@@ -262,6 +262,7 @@
-
- link_info.allow_undefined_version = TRUE;
- link_info.keep_memory = TRUE;
-+ link_info.new_dtags = TRUE;
- link_info.combreloc = TRUE;
- link_info.strip_discarded = TRUE;
- link_info.emit_hash = TRUE;
diff --git a/patches/binutils/2.20.1a/200-document-new-dtags-behaviour.patch b/patches/binutils/2.20.1a/200-document-new-dtags-behaviour.patch
deleted file mode 100644
index 3bb5767..0000000
--- a/patches/binutils/2.20.1a/200-document-new-dtags-behaviour.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Index: binutils-2.19.51.0.5/ld/ld.texinfo
-===================================================================
-
-diff -durN binutils-2.20.1.orig/ld/ld.texinfo binutils-2.20.1/ld/ld.texinfo
---- binutils-2.20.1.orig/ld/ld.texinfo 2009-07-06 15:48:51.000000000 +0200
-+++ binutils-2.20.1/ld/ld.texinfo 2010-08-17 19:32:16.000000000 +0200
-@@ -2026,8 +2026,9 @@
- systems may not understand them. If you specify
- @option{--enable-new-dtags}, the dynamic tags will be created as needed.
- If you specify @option{--disable-new-dtags}, no new dynamic tags will be
--created. By default, the new dynamic tags are not created. Note that
--those options are only available for ELF systems.
-+created. On Gentoo, by default, the new dynamic tags are created (this
-+differs from upstream behaviour). Note that those options are only
-+available for ELF systems.
-
- @kindex --hash-size=@var{number}
- @item --hash-size=@var{number}
diff --git a/patches/binutils/2.20.1a/220-use-relro.patch b/patches/binutils/2.20.1a/220-use-relro.patch
deleted file mode 100644
index 490d0a2..0000000
--- a/patches/binutils/2.20.1a/220-use-relro.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/ld/ldmain.c binutils-2.20.1/ld/ldmain.c
---- binutils-2.20.1.orig/ld/ldmain.c 2010-08-17 19:32:17.000000000 +0200
-+++ binutils-2.20.1/ld/ldmain.c 2010-08-17 19:32:18.000000000 +0200
-@@ -264,6 +264,7 @@
- link_info.keep_memory = TRUE;
- link_info.new_dtags = TRUE;
- link_info.combreloc = TRUE;
-+ link_info.relro = TRUE;
- link_info.strip_discarded = TRUE;
- link_info.emit_hash = TRUE;
- #ifndef __mips__
diff --git a/patches/binutils/2.20.1a/230-libiberty-pic.patch b/patches/binutils/2.20.1a/230-libiberty-pic.patch
deleted file mode 100644
index 5a5a773..0000000
--- a/patches/binutils/2.20.1a/230-libiberty-pic.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/libiberty/Makefile.in binutils-2.20.1/libiberty/Makefile.in
---- binutils-2.20.1.orig/libiberty/Makefile.in 2009-08-23 21:03:58.000000000 +0200
-+++ binutils-2.20.1/libiberty/Makefile.in 2010-08-17 19:32:19.000000000 +0200
-@@ -227,6 +227,7 @@
- $(AR) $(AR_FLAGS) $(TARGETLIB) \
- $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
- $(RANLIB) $(TARGETLIB); \
-+ cp $(TARGETLIB) ../ ; \
- cd ..; \
- else true; fi
-
diff --git a/patches/binutils/2.20.1a/240-ld_makefile.patch b/patches/binutils/2.20.1a/240-ld_makefile.patch
deleted file mode 100644
index 8b40a04..0000000
--- a/patches/binutils/2.20.1a/240-ld_makefile.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Description: correct where ld scripts are installed
-Author: Chris Chimelis <chris@debian.org>
-
-diff -durN binutils-2.20.1.orig/ld/Makefile.am binutils-2.20.1/ld/Makefile.am
---- binutils-2.20.1.orig/ld/Makefile.am 2010-02-22 09:07:01.000000000 +0100
-+++ binutils-2.20.1/ld/Makefile.am 2010-08-17 19:32:21.000000000 +0200
-@@ -24,7 +24,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 -durN binutils-2.20.1.orig/ld/Makefile.in binutils-2.20.1/ld/Makefile.in
---- binutils-2.20.1.orig/ld/Makefile.in 2010-03-03 15:06:21.000000000 +0100
-+++ binutils-2.20.1/ld/Makefile.in 2010-08-17 19:32:21.000000000 +0200
-@@ -333,7 +333,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
diff --git a/patches/binutils/2.20.1a/250-arm-eabi-conf.patch b/patches/binutils/2.20.1a/250-arm-eabi-conf.patch
deleted file mode 100644
index a79a87f..0000000
--- a/patches/binutils/2.20.1a/250-arm-eabi-conf.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -u binutils-2.20.orig/configure binutils-2.20/configure
-
-diff -durN binutils-2.20.1.orig/configure binutils-2.20.1/configure
---- binutils-2.20.1.orig/configure 2010-08-17 19:32:07.000000000 +0200
-+++ binutils-2.20.1/configure 2010-08-17 19:32:22.000000000 +0200
-@@ -3086,7 +3086,7 @@
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- libgloss_dir=arm
- ;;
-- arm*-*-linux-gnueabi)
-+ arm*-*-linux-*gnueabi)
- noconfigdirs="$noconfigdirs target-qthreads"
- case ${with_newlib} in
- no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-diff -durN binutils-2.20.1.orig/configure.ac binutils-2.20.1/configure.ac
---- binutils-2.20.1.orig/configure.ac 2010-08-17 19:32:07.000000000 +0200
-+++ binutils-2.20.1/configure.ac 2010-08-17 19:32:22.000000000 +0200
-@@ -573,7 +573,7 @@
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- libgloss_dir=arm
- ;;
-- arm*-*-linux-gnueabi)
-+ arm*-*-linux-*gnueabi)
- noconfigdirs="$noconfigdirs target-qthreads"
- case ${with_newlib} in
- no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
diff --git a/patches/binutils/2.20.1a/270-better_file_error.patch b/patches/binutils/2.20.1a/270-better_file_error.patch
deleted file mode 100644
index f880466..0000000
--- a/patches/binutils/2.20.1a/270-better_file_error.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh -e
-## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
-##
-## 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
-
-diff -durN binutils-2.20.1.orig/bfd/opncls.c binutils-2.20.1/bfd/opncls.c
---- binutils-2.20.1.orig/bfd/opncls.c 2010-01-14 11:48:22.000000000 +0100
-+++ binutils-2.20.1/bfd/opncls.c 2010-08-17 19:32:23.000000000 +0200
-@@ -183,6 +183,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)
diff --git a/patches/binutils/2.20.1a/280-unexport_LD_LIBRARY_PATH.patch b/patches/binutils/2.20.1a/280-unexport_LD_LIBRARY_PATH.patch
deleted file mode 100644
index 0a9ee40..0000000
--- a/patches/binutils/2.20.1a/280-unexport_LD_LIBRARY_PATH.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-Description:
-
-This patch is needed in situations where build system is running same version of
-binutils that is intended to be built cross-native ( build != host = target)
- and has shared libraries enabled. binutils/binutils
-Makefile has some tools which are built to run on build system. Toplevel makefile
-for binutils passes HOST_EXPORTS to sub-makefiles which also include RPATH_ENVVARS
-containing LD_LIBRARY_PATH which is modified so that it also includes host libraries
-like opcodes and libbfd which are just built for the host system.
-
-Now the problem is that same LD_LIBRARY_PATH value gets set in environment even
-for the tools that are being built for build system using CC_FOR_BUILD and the tools
-like as,ld it invokes from build machine get the LD_LIBRARY_PATH set to search
-the newly build host libraries like opcodes and bfd and if host is like a big endian
-system say (mips-linux) the build system linker and assembler do not run because
-ld.so tries to load these shared libraries instead of the ones from /usr/lib for
-the build tools.
-
-This patch fixes the issue by clearing LD_LIBRARY_PATH for BUILD tools
-
-This patch would be needed on other versions of binutils. I just cared about 2.20
-May be upstream is also interested in such a patch.
-
--Khem
-
-Index: binutils-2.20/binutils/Makefile.am
-===================================================================
-
-diff -durN binutils-2.20.1.orig/binutils/Makefile.am binutils-2.20.1/binutils/Makefile.am
---- binutils-2.20.1.orig/binutils/Makefile.am 2010-01-14 11:48:22.000000000 +0100
-+++ binutils-2.20.1/binutils/Makefile.am 2010-08-17 19:32:24.000000000 +0200
-@@ -251,24 +251,24 @@
- ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
-
- sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
-- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
-
- syslex.o: syslex.c sysinfo.h config.h
- if [ -r syslex.c ]; then \
-- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
- else \
-- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
- fi
-
- sysinfo.o: sysinfo.c
- if [ -r sysinfo.c ]; then \
-- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
- else \
-- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
- fi
-
- bin2c$(EXEEXT_FOR_BUILD):
-- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
-
- embedspu: embedspu.sh
- sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
-diff -durN binutils-2.20.1.orig/binutils/Makefile.in binutils-2.20.1/binutils/Makefile.in
---- binutils-2.20.1.orig/binutils/Makefile.in 2010-03-03 14:59:46.000000000 +0100
-+++ binutils-2.20.1/binutils/Makefile.in 2010-08-17 19:32:24.000000000 +0200
-@@ -1193,24 +1193,24 @@
- ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
-
- sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
-- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
-
- syslex.o: syslex.c sysinfo.h config.h
- if [ -r syslex.c ]; then \
-- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
- else \
-- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
- fi
-
- sysinfo.o: sysinfo.c
- if [ -r sysinfo.c ]; then \
-- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
- else \
-- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
- fi
-
- bin2c$(EXEEXT_FOR_BUILD):
-- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
-+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
-
- embedspu: embedspu.sh
- sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
diff --git a/patches/binutils/2.20.1a/290-ld-stub-crash.patch b/patches/binutils/2.20.1a/290-ld-stub-crash.patch
deleted file mode 100644
index 640231c..0000000
--- a/patches/binutils/2.20.1a/290-ld-stub-crash.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -p -c -u -r1.196 elf32-arm.c
-
-diff -durN binutils-2.20.1.orig/bfd/elf32-arm.c binutils-2.20.1/bfd/elf32-arm.c
---- binutils-2.20.1.orig/bfd/elf32-arm.c 2010-02-22 09:06:48.000000000 +0100
-+++ binutils-2.20.1/bfd/elf32-arm.c 2010-08-17 19:32:25.000000000 +0200
-@@ -3194,11 +3194,15 @@
-
- /* We have an extra 2-bytes reach because of
- the mode change (bit 24 (H) of BLX encoding). */
-+ /* A stub is needed only if this call is not throught a PLT
-+ entry, because PLT stubs handle mode switching
-+ already. */
- if (branch_offset > (ARM_MAX_FWD_BRANCH_OFFSET + 2)
- || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)
-- || ((r_type == R_ARM_CALL) && !globals->use_blx)
-- || (r_type == R_ARM_JUMP24)
-- || (r_type == R_ARM_PLT32))
-+ || ( (((r_type == R_ARM_CALL) && !globals->use_blx)
-+ || (r_type == R_ARM_JUMP24)
-+ || (r_type == R_ARM_PLT32))
-+ && !use_plt))
- {
- stub_type = (info->shared | globals->pic_veneer)
- /* PIC stubs. */
diff --git a/patches/binutils/2.20.1a/300-mips64-defaultemul.patch b/patches/binutils/2.20.1a/300-mips64-defaultemul.patch
deleted file mode 100644
index 418c4fd..0000000
--- a/patches/binutils/2.20.1a/300-mips64-defaultemul.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-diff -durN binutils-2.20.1.orig/ld/configure.tgt binutils-2.20.1/ld/configure.tgt
---- binutils-2.20.1.orig/ld/configure.tgt 2009-08-06 19:38:03.000000000 +0200
-+++ binutils-2.20.1/ld/configure.tgt 2010-08-17 19:32:26.000000000 +0200
-@@ -400,11 +400,11 @@
- mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
- targ_extra_emuls="elf32elmipvxworks" ;;
- mips*-*-windiss) targ_emul=elf32mipswindiss ;;
--mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
-- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
-+mips64*el-*-linux-*) targ_emul=elf64ltsmip
-+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
- targ_extra_libpath=$targ_extra_emuls ;;
--mips64*-*-linux-*) targ_emul=elf32btsmipn32
-- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
-+mips64*-*-linux-*) targ_emul=elf64btsmip
-+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
- targ_extra_libpath=$targ_extra_emuls ;;
- mips*el-*-linux-*) targ_emul=elf32ltsmip
- targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
diff --git a/patches/binutils/2.21.1a/110-arm-eabi-conf.patch b/patches/binutils/2.21.1a/110-arm-eabi-conf.patch
deleted file mode 100644
index 1bb491e..0000000
--- a/patches/binutils/2.21.1a/110-arm-eabi-conf.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -durN binutils-2.21.1.orig/configure binutils-2.21.1/configure
---- binutils-2.21.1.orig/configure 2011-06-27 09:39:00.000000000 +0200
-+++ binutils-2.21.1/configure 2011-09-12 13:39:06.292251293 +0200
-@@ -3180,7 +3180,7 @@
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- libgloss_dir=arm
- ;;
-- arm*-*-linux-gnueabi)
-+ arm*-*-linux-*gnueabi)
- noconfigdirs="$noconfigdirs target-qthreads"
- case ${with_newlib} in
- no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-diff -durN binutils-2.21.1.orig/configure.ac binutils-2.21.1/configure.ac
---- binutils-2.21.1.orig/configure.ac 2011-06-27 11:08:53.000000000 +0200
-+++ binutils-2.21.1/configure.ac 2011-09-12 13:39:06.308917895 +0200
-@@ -652,7 +652,7 @@
- noconfigdirs="$noconfigdirs target-libffi target-qthreads"
- libgloss_dir=arm
- ;;
-- arm*-*-linux-gnueabi)
-+ arm*-*-linux-*gnueabi)
- noconfigdirs="$noconfigdirs target-qthreads"
- case ${with_newlib} in
- no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
diff --git a/patches/binutils/2.21.1a/120-sh-conf.patch b/patches/binutils/2.21.1a/120-sh-conf.patch
deleted file mode 100644
index 39d12eb..0000000
--- a/patches/binutils/2.21.1a/120-sh-conf.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -durN binutils-2.21.1.orig/configure binutils-2.21.1/configure
---- binutils-2.21.1.orig/configure 2011-09-12 13:39:06.292251293 +0200
-+++ binutils-2.21.1/configure 2011-09-12 13:39:07.135581381 +0200
-@@ -3148,7 +3148,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -3487,7 +3487,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[3456789]86-*-vsta) ;; # don't add gprof back in
- i[3456789]86-*-go32*) ;; # don't add gprof back in
-diff -durN binutils-2.21.1.orig/configure.ac binutils-2.21.1/configure.ac
---- binutils-2.21.1.orig/configure.ac 2011-09-12 13:39:06.308917895 +0200
-+++ binutils-2.21.1/configure.ac 2011-09-12 13:39:07.145581342 +0200
-@@ -620,7 +620,7 @@
- am33_2.0-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
-- sh-*-linux*)
-+ sh*-*-linux*)
- noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
- ;;
- sh*-*-pe|mips*-*-pe|*arm-wince-pe)
-@@ -959,7 +959,7 @@
- romp-*-*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${host}" in
- i[[3456789]]86-*-vsta) ;; # don't add gprof back in
- i[[3456789]]86-*-go32*) ;; # don't add gprof back in
diff --git a/patches/binutils/2.21.1a/300-001_ld_makefile_patch.patch b/patches/binutils/2.21.1a/300-001_ld_makefile_patch.patch
deleted file mode 100644
index 2ec0a3f..0000000
--- a/patches/binutils/2.21.1a/300-001_ld_makefile_patch.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -durN binutils-2.21.1.orig/ld/Makefile.am binutils-2.21.1/ld/Makefile.am
---- binutils-2.21.1.orig/ld/Makefile.am 2011-03-16 09:37:30.000000000 +0100
-+++ binutils-2.21.1/ld/Makefile.am 2011-09-12 13:39:07.962244866 +0200
-@@ -37,7 +37,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 -durN binutils-2.21.1.orig/ld/Makefile.in binutils-2.21.1/ld/Makefile.in
---- binutils-2.21.1.orig/ld/Makefile.in 2011-03-16 09:37:30.000000000 +0100
-+++ binutils-2.21.1/ld/Makefile.in 2011-09-12 13:39:07.962244866 +0200
-@@ -365,7 +365,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
diff --git a/patches/binutils/2.21.1a/300-012_check_ldrunpath_length.patch b/patches/binutils/2.21.1a/300-012_check_ldrunpath_length.patch
deleted file mode 100644
index 1c5393a..0000000
--- a/patches/binutils/2.21.1a/300-012_check_ldrunpath_length.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -durN binutils-2.21.1.orig/ld/emultempl/elf32.em binutils-2.21.1/ld/emultempl/elf32.em
---- binutils-2.21.1.orig/ld/emultempl/elf32.em 2011-06-27 09:39:14.000000000 +0200
-+++ binutils-2.21.1/ld/emultempl/elf32.em 2011-09-12 13:39:08.808908274 +0200
-@@ -1272,6 +1272,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;
-@@ -1499,6 +1501,8 @@
- rpath = command_line.rpath;
- if (rpath == NULL)
- rpath = (const char *) getenv ("LD_RUN_PATH");
-+ if ((rpath) && (strlen (rpath) == 0))
-+ rpath = NULL;
-
- for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next)
- if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
diff --git a/patches/binutils/2.22/120-sh-conf.patch b/patches/binutils/2.22/120-sh-conf.patch
deleted file mode 100644
index d5913e8..0000000
--- a/patches/binutils/2.22/120-sh-conf.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-r10231 | lethal | 2005-05-02 09:58:00 -0400 (Mon, 02 May 2005) | 13 lines
-
-Likewise, binutils has no idea about any of these new targets either, so we
-fix that up too.. now we're able to actually build a real toolchain for
-sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
-inept targets than that one, really. Go look, I promise).
-
-diff -durN binutils-2.22.orig/configure binutils-2.22/configure
---- binutils-2.22.orig/configure 2011-08-14 14:28:15.000000000 +0200
-+++ binutils-2.22/configure 2011-12-14 19:49:40.284777434 +0100
-@@ -3570,7 +3570,7 @@
- mips*-*-*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${target}" in
- sh*-*-elf)
- ;;
-diff -durN binutils-2.22.orig/configure.ac binutils-2.22/configure.ac
---- binutils-2.22.orig/configure.ac 2011-11-21 12:58:27.000000000 +0100
-+++ binutils-2.22/configure.ac 2011-12-14 19:49:40.316777436 +0100
-@@ -1006,7 +1006,7 @@
- mips*-*-*)
- noconfigdirs="$noconfigdirs gprof"
- ;;
-- sh-*-* | sh64-*-*)
-+ sh*-*-* | sh64-*-*)
- case "${target}" in
- sh*-*-elf)
- ;;
diff --git a/patches/binutils/2.22/400-fix_arm_gc_sections.patch b/patches/binutils/2.22/400-fix_arm_gc_sections.patch
deleted file mode 100644
index 04badab..0000000
--- a/patches/binutils/2.22/400-fix_arm_gc_sections.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/bfd/elf32-arm.c
-+++ b/bfd/elf32-arm.c
-@@ -12408,7 +12408,8 @@ elf32_arm_check_relocs (bfd *abfd, struc
-
- /* If the symbol is a function that doesn't bind locally,
- this relocation will need a PLT entry. */
-- root_plt->refcount += 1;
-+ if (root_plt->refcount != -1)
-+ root_plt->refcount += 1;
-
- if (!call_reloc_p)
- arm_plt->noncall_refcount++;
diff --git a/patches/binutils/2.22/500-fix-struct-stat.patch b/patches/binutils/2.22/500-fix-struct-stat.patch
deleted file mode 100644
index 5572abf..0000000
--- a/patches/binutils/2.22/500-fix-struct-stat.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -ur binutils-2.22.org/bfd/bfd-in2.h binutils-2.22/bfd/bfd-in2.h
---- binutils-2.22.org/bfd/bfd-in2.h 2011-09-16 03:15:18.000000000 +0200
-+++ binutils-2.22/bfd/bfd-in2.h 2012-11-03 18:25:20.365668349 +0100
-@@ -32,6 +32,8 @@
- #ifndef __BFD_H_SEEN__
- #define __BFD_H_SEEN__
-
-+#include <sys/stat.h>
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -308,8 +310,6 @@
- && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
- && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
-
--/* Forward define. */
--struct stat;
-
- typedef enum bfd_print_symbol
- {
-diff -ur binutils-2.22.org/bfd/bfd-in.h binutils-2.22/bfd/bfd-in.h
---- binutils-2.22.org/bfd/bfd-in.h 2011-09-16 03:15:18.000000000 +0200
-+++ binutils-2.22/bfd/bfd-in.h 2012-11-03 18:24:43.397783645 +0100
-@@ -25,6 +25,8 @@
- #ifndef __BFD_H_SEEN__
- #define __BFD_H_SEEN__
-
-+#include <sys/stat.h>
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -301,8 +303,6 @@
- && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \
- && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
-
--/* Forward define. */
--struct stat;
-
- typedef enum bfd_print_symbol
- {
diff --git a/patches/binutils/2.22/999-ppc-textrels.patch b/patches/binutils/2.22/999-ppc-textrels.patch
deleted file mode 100644
index ff0c031..0000000
--- a/patches/binutils/2.22/999-ppc-textrels.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-http://bugs.gentoo.org/392645
-http://sourceware.org/bugzilla/show_bug.cgi?id=13470
-
-2011-12-03 Alan Modra <amodra@gmail.com>
-
- PR ld/13470
- * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
- change in 2011-07-01 commit. Comment.
- * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
-
-diff -durN binutils-2.22.orig/bfd/elf32-ppc.c binutils-2.22/bfd/elf32-ppc.c
---- binutils-2.22.orig/bfd/elf32-ppc.c 2011-11-21 10:29:21.000000000 +0100
-+++ binutils-2.22/bfd/elf32-ppc.c 2011-12-14 19:52:43.308784395 +0100
-@@ -2987,10 +2987,6 @@
- edir->elf.needs_plt |= eind->elf.needs_plt;
- edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
-
-- /* If we were called to copy over info for a weak sym, that's all. */
-- if (eind->elf.root.type != bfd_link_hash_indirect)
-- return;
--
- if (eind->dyn_relocs != NULL)
- {
- if (edir->dyn_relocs != NULL)
-@@ -3022,6 +3018,16 @@
- eind->dyn_relocs = NULL;
- }
-
-+ /* If we were called to copy over info for a weak sym, that's all.
-+ You might think dyn_relocs need not be copied over; After all,
-+ both syms will be dynamic or both non-dynamic so we're just
-+ moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
-+ code in ppc_elf_adjust_dynamic_symbol needs to check for
-+ dyn_relocs in read-only sections, and it does so on what is the
-+ DIR sym here. */
-+ if (eind->elf.root.type != bfd_link_hash_indirect)
-+ return;
-+
- /* Copy over the GOT refcount entries that we may have already seen to
- the symbol which just became indirect. */
- edir->elf.got.refcount += eind->elf.got.refcount;
-diff -durN binutils-2.22.orig/bfd/elf64-ppc.c binutils-2.22/bfd/elf64-ppc.c
---- binutils-2.22.orig/bfd/elf64-ppc.c 2011-11-21 10:29:24.000000000 +0100
-+++ binutils-2.22/bfd/elf64-ppc.c 2011-12-14 19:52:43.336784395 +0100
-@@ -4435,10 +4435,6 @@
- edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
- edir->elf.needs_plt |= eind->elf.needs_plt;
-
-- /* If we were called to copy over info for a weak sym, that's all. */
-- if (eind->elf.root.type != bfd_link_hash_indirect)
-- return;
--
- /* Copy over any dynamic relocs we may have on the indirect sym. */
- if (eind->dyn_relocs != NULL)
- {
-@@ -4471,6 +4467,16 @@
- eind->dyn_relocs = NULL;
- }
-
-+ /* If we were called to copy over info for a weak sym, that's all.
-+ You might think dyn_relocs need not be copied over; After all,
-+ both syms will be dynamic or both non-dynamic so we're just
-+ moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
-+ code in ppc64_elf_adjust_dynamic_symbol needs to check for
-+ dyn_relocs in read-only sections, and it does so on what is the
-+ DIR sym here. */
-+ if (eind->elf.root.type != bfd_link_hash_indirect)
-+ return;
-+
- /* Copy over got entries that we may have already seen to the
- symbol which just became indirect. */
- if (eind->elf.got.glist != NULL)
diff --git a/patches/binutils/2.25/120-sh-conf.patch b/patches/binutils/2.23.2/120-sh-conf.patch
index c12a023..ea3d1b6 100644
--- a/patches/binutils/2.25/120-sh-conf.patch
+++ b/patches/binutils/2.23.2/120-sh-conf.patch
@@ -5,26 +5,22 @@ fix that up too.. now we're able to actually build a real toolchain for
sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
inept targets than that one, really. Go look, I promise).
-diff --git a/configure b/configure
-index 87677bc..2d916f1 100755
--- a/configure
+++ b/configure
-@@ -3812,7 +3812,7 @@ case "${target}" in
- or1k*-*-*)
- noconfigdirs="$noconfigdirs gdb"
+@@ -1495,7 +1495,7 @@
+ mips*-*-*)
+ noconfigdirs="$noconfigdirs gprof"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${target}" in
sh*-*-elf)
;;
-diff --git a/configure.ac b/configure.ac
-index 8fe0eca..b10a99f 100644
--- a/configure.ac
+++ b/configure.ac
-@@ -1140,7 +1140,7 @@ case "${target}" in
- or1k*-*-*)
- noconfigdirs="$noconfigdirs gdb"
+@@ -712,7 +712,7 @@
+ mips*-*-*)
+ noconfigdirs="$noconfigdirs gprof"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
diff --git a/patches/binutils/2.22/300-001_ld_makefile_patch.patch b/patches/binutils/2.23.2/300-001_ld_makefile_patch.patch
index 4b5888a..5cb0f61 100644
--- a/patches/binutils/2.22/300-001_ld_makefile_patch.patch
+++ b/patches/binutils/2.23.2/300-001_ld_makefile_patch.patch
@@ -1,7 +1,7 @@
-diff -durN binutils-2.22.orig/ld/Makefile.am binutils-2.22/ld/Makefile.am
---- binutils-2.22.orig/ld/Makefile.am 2011-07-22 22:22:37.000000000 +0200
-+++ binutils-2.22/ld/Makefile.am 2011-12-14 19:50:25.760779164 +0100
-@@ -37,7 +37,7 @@
+diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.am binutils-2.17.50.0.17/ld/Makefile.am
+--- binutils-2.17.50.0.17.oorig/ld/Makefile.am 2007-06-18 19:29:29.000000000 +0200
++++ binutils-2.17.50.0.17/ld/Makefile.am 2007-06-25 10:00:36.000000000 +0200
+@@ -18,7 +18,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.
@@ -10,10 +10,10 @@ diff -durN binutils-2.22.orig/ld/Makefile.am binutils-2.22/ld/Makefile.am
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
-diff -durN binutils-2.22.orig/ld/Makefile.in binutils-2.22/ld/Makefile.in
---- binutils-2.22.orig/ld/Makefile.in 2011-07-22 22:22:37.000000000 +0200
-+++ binutils-2.22/ld/Makefile.in 2011-12-14 19:50:25.784779163 +0100
-@@ -366,7 +366,7 @@
+diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.in binutils-2.17.50.0.17/ld/Makefile.in
+--- binutils-2.17.50.0.17.oorig/ld/Makefile.in 2007-06-18 19:29:29.000000000 +0200
++++ binutils-2.17.50.0.17/ld/Makefile.in 2007-06-25 10:00:36.000000000 +0200
+@@ -287,7 +287,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.
diff --git a/patches/binutils/2.22/300-012_check_ldrunpath_length.patch b/patches/binutils/2.23.2/300-012_check_ldrunpath_length.patch
index b49cc04..df78310 100644
--- a/patches/binutils/2.22/300-012_check_ldrunpath_length.patch
+++ b/patches/binutils/2.23.2/300-012_check_ldrunpath_length.patch
@@ -1,7 +1,7 @@
-diff -durN binutils-2.22.orig/ld/emultempl/elf32.em binutils-2.22/ld/emultempl/elf32.em
---- binutils-2.22.orig/ld/emultempl/elf32.em 2011-11-21 10:29:39.000000000 +0100
-+++ binutils-2.22/ld/emultempl/elf32.em 2011-12-14 19:52:12.880783238 +0100
-@@ -1273,6 +1273,8 @@
+diff -Nura binutils-2.21.orig/ld/emultempl/elf32.em binutils-2.21/ld/emultempl/elf32.em
+--- binutils-2.21.orig/ld/emultempl/elf32.em 2010-10-29 09:10:36.000000000 -0300
++++ binutils-2.21/ld/emultempl/elf32.em 2010-12-10 09:26:56.746102724 -0300
+@@ -1270,6 +1270,8 @@
&& command_line.rpath == NULL)
{
lib_path = (const char *) getenv ("LD_RUN_PATH");
@@ -10,7 +10,7 @@ diff -durN binutils-2.22.orig/ld/emultempl/elf32.em binutils-2.22/ld/emultempl/e
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
force))
break;
-@@ -1500,6 +1502,8 @@
+@@ -1497,6 +1499,8 @@
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
diff --git a/patches/binutils/2.20.1a/130-ld-sysroot.patch b/patches/binutils/2.23.2/500-sysroot.patch
index 4a40c40..e49c795 100644
--- a/patches/binutils/2.20.1a/130-ld-sysroot.patch
+++ b/patches/binutils/2.23.2/500-sysroot.patch
@@ -5,26 +5,26 @@ Always try to prepend the sysroot prefix to absolute filenames first.
http://bugs.gentoo.org/275666
http://sourceware.org/bugzilla/show_bug.cgi?id=10340
-diff -durN binutils-2.20.1.orig/ld/ldfile.c binutils-2.20.1/ld/ldfile.c
---- binutils-2.20.1.orig/ld/ldfile.c 2009-08-30 00:11:01.000000000 +0200
-+++ binutils-2.20.1/ld/ldfile.c 2010-08-17 19:32:08.000000000 +0200
-@@ -308,18 +308,24 @@
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -308,18 +308,25 @@
directory first. */
- if (! entry->is_archive)
+ if (! entry->flags.maybe_archive)
{
-- if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
+- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename))
+ /* For absolute pathnames, try to always open the file in the
+ sysroot first. If this fails, try to open the file at the
-+ given location. */
-+ entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
-+ if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
++ given location. */
++ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename);
++ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)
++ && ld_sysroot)
{
char *name = concat (ld_sysroot, entry->filename,
(const char *) NULL);
if (ldfile_try_open_bfd (name, entry))
{
entry->filename = name;
-+ entry->sysrooted = TRUE;
++ entry->flags.sysrooted = TRUE;
return TRUE;
}
free (name);
@@ -32,6 +32,6 @@ diff -durN binutils-2.20.1.orig/ld/ldfile.c binutils-2.20.1/ld/ldfile.c
- else if (ldfile_try_open_bfd (entry->filename, entry))
+
+ if (ldfile_try_open_bfd (entry->filename, entry))
- {
- entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
- && is_sysrooted_pathname (entry->filename, TRUE);
+ return TRUE;
+
+ if (IS_ABSOLUTE_PATH (entry->filename))
diff --git a/patches/binutils/2.23.2/600-poison-system-directories.patch b/patches/binutils/2.23.2/600-poison-system-directories.patch
new file mode 100644
index 0000000..780e48e
--- /dev/null
+++ b/patches/binutils/2.23.2/600-poison-system-directories.patch
@@ -0,0 +1,279 @@
+Patch adapted to binutils 2.23.2 and extended to use
+BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+
+Patch originally created by Mark Hatle, forward-ported to
+binutils 2.21 by Scott Garman.
+
+purpose: warn for uses of system directories when cross linking
+
+Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
+
+2008-07-02 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * ld.h (args_type): Add error_poison_system_directories.
+ * ld.texinfo (--error-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.error_poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.error_poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --error-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-06-13 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * config.in: Regenerate.
+ * ld.h (args_type): Add poison_system_directories.
+ * ld.texinfo (--no-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --no-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-04-20 Joseph Myers <joseph@codesourcery.com>
+
+ Merge from Sourcery G++ binutils 2.17:
+
+ 2007-03-20 Joseph Myers <joseph@codesourcery.com>
+ Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+ ld/
+ * configure.in (--enable-poison-system-directories): New option.
+ * configure, config.in: Regenerate.
+ * ldfile.c (ldfile_add_library_path): If
+ ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+ /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: b/ld/config.in
+===================================================================
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -11,6 +11,9 @@
+ language is requested. */
+ #undef ENABLE_NLS
+
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+
+Index: b/ld/configure
+===================================================================
+--- a/ld/configure
++++ b/ld/configure
+@@ -773,6 +773,7 @@
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_werror
+@@ -1428,6 +1429,8 @@
+ (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-poison-system-directories
++ warn for use of native system library directories
+ --enable-gold[=ARG] build gold [ARG={default,yes,no}]
+ --enable-got=<type> GOT handling scheme (target, single, negative,
+ multigot)
+@@ -4338,7 +4341,18 @@
+ fi
+
+
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++ enableval=$enable_poison_system_directories;
++else
++ enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
+
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
+
+ # Check whether --enable-got was given.
+ if test "${enable_got+set}" = set; then :
+Index: b/ld/configure.in
+===================================================================
+--- a/ld/configure.in
++++ b/ld/configure.in
+@@ -70,6 +70,16 @@
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system library directories]),,
++ [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++ [1],
++ [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+Index: b/ld/ldfile.c
+===================================================================
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -116,6 +116,23 @@
+ new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
+ else
+ new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (command_line.poison_system_directories
++ && ((!strncmp (name, "/lib", 4))
++ || (!strncmp (name, "/usr/lib", 8))
++ || (!strncmp (name, "/usr/local/lib", 14))
++ || (!strncmp (name, "/usr/X11R6/lib", 14))))
++ {
++ if (command_line.error_poison_system_directories)
++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ else
++ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ }
++#endif
++
+ }
+
+ /* Try to open a BFD for a lang_input_statement. */
+Index: b/ld/ld.h
+===================================================================
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -203,6 +203,14 @@
+ /* If TRUE we'll just print the default output on stdout. */
+ bfd_boolean print_output_format;
+
++ /* If TRUE (the default) warn for uses of system directories when
++ cross linking. */
++ bfd_boolean poison_system_directories;
++
++ /* If TRUE (default FALSE) give an error for uses of system
++ directories when cross linking instead of a warning. */
++ bfd_boolean error_poison_system_directories;
++
+ /* Big or little endian as set on command line. */
+ enum endian_enum endian;
+
+Index: b/ld/ldmain.c
+===================================================================
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -265,6 +265,8 @@
+ command_line.warn_search_mismatch = TRUE;
+ command_line.check_section_addresses = -1;
+ command_line.disable_target_specific_optimizations = -1;
++ command_line.poison_system_directories = TRUE;
++ command_line.error_poison_system_directories = FALSE;
+
+ /* We initialize DEMANGLING based on the environment variable
+ COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
+Index: b/ld/ld.texinfo
+===================================================================
+--- a/ld/ld.texinfo
++++ b/ld/ld.texinfo
+@@ -2154,6 +2154,18 @@
+
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking. This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+
+ @c man end
+Index: b/ld/lexsup.c
+===================================================================
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -498,6 +498,14 @@
+ TWO_DASHES },
+ { {"wrap", required_argument, NULL, OPTION_WRAP},
+ '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
++ { {"no-poison-system-directories", no_argument, NULL,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Do not warn for -L options using system directories"),
++ TWO_DASHES },
++ { {"error-poison-system-directories", no_argument, NULL,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Give an error for -L options using system directories"),
++ TWO_DASHES },
+ };
+
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -510,6 +518,7 @@
+ int ingroup = 0;
+ char *default_dirlist = NULL;
+ char *shortopts;
++ char *BR_paranoid_env;
+ struct option *longopts;
+ struct option *really_longopts;
+ int last_optind;
+@@ -1427,9 +1436,21 @@
+ einfo (_("%P%X: --hash-size needs a numeric argument\n"));
+ }
+ break;
++
++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++ command_line.poison_system_directories = FALSE;
++ break;
++
++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++ command_line.error_poison_system_directories = TRUE;
++ break;
+ }
+ }
+
++ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
++ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0)
++ command_line.error_poison_system_directories = TRUE;
++
+ while (ingroup)
+ {
+ lang_leave_group ();
+Index: b/ld/ldlex.h
+===================================================================
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -136,6 +136,8 @@
+ #endif /* ENABLE_PLUGINS */
+ OPTION_DEFAULT_SCRIPT,
+ OPTION_PRINT_OUTPUT_FORMAT,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+
+ /* The initial parser states. */
diff --git a/patches/binutils/2.23.2/900-xtensa-trampolines.patch b/patches/binutils/2.23.2/900-xtensa-trampolines.patch
new file mode 100644
index 0000000..b5b934f
--- /dev/null
+++ b/patches/binutils/2.23.2/900-xtensa-trampolines.patch
@@ -0,0 +1,846 @@
+From a82c7d9030b67a6a76a5403d0e1641f9e42141ac Mon Sep 17 00:00:00 2001
+From: David Weatherford <weath@cadence.com>
+Date: Fri, 21 Mar 2014 11:53:42 +0000
+Subject: [PATCH] Add support to the Xtensa target for creating trampolines for
+ out-of-range branches.
+
+ * tc-xtensa.c (xtensa_check_frag_count, xtensa_create_trampoline_frag)
+ (xtensa_maybe_create_trampoline_frag, init_trampoline_frag)
+ (find_trampoline_seg, search_trampolines, get_best_trampoline)
+ (check_and_update_trampolines, add_jump_to_trampoline)
+ (dump_trampolines): New function.
+ (md_parse_option): Add cases for --[no-]trampolines options.
+ (md_assemble, finish_vinsn, xtensa_end): Add call to
+ xtensa_check_frag_count.
+ (xg_assemble_vliw_tokens): Add call to
+ xtensa_maybe_create_trampoline_frag.
+ (xtensa_relax_frag): Relax fragments with RELAX_TRAMPOLINE state.
+ (relax_frag_immed): Relax jump instructions that cannot reach its
+ target.
+ * tc-xtensa.h (xtensa_relax_statesE::RELAX_TRAMPOLINE): New relax
+ state.
+
+ * as.texinfo: Document --[no-]trampolines command-line options.
+ * c-xtensa.texi: Document trampolines relaxation and command line
+ options.
+
+ * frags.c (get_frag_count, clear_frag_count): New function.
+ (frag_alloc): Increment totalfrags counter.
+ * frags.h (get_frag_count, clear_frag_count): New function.
+
+ * all.exp: Add test for trampoline relaxation.
+ * trampoline.d: Trampoline relaxation expected dump.
+ * trampoline.s: Trampoline relaxation test source.
+---
+Backported from: a82c7d9030b67a6a76a5403d0e1641f9e42141ac
+Changes to Changelog files are dropped.
+
+ gas/config/tc-xtensa.c | 558 +++++++++++++++++++++++++++++++++-
+ gas/config/tc-xtensa.h | 5 +
+ gas/frags.c | 15 +
+ gas/frags.h | 3 +
+ gas/testsuite/gas/xtensa/all.exp | 1 +
+ gas/testsuite/gas/xtensa/trampoline.d | 26 ++
+ gas/testsuite/gas/xtensa/trampoline.s | 21 ++
+ 11 files changed, 753 insertions(+), 2 deletions(-)
+ create mode 100644 gas/testsuite/gas/xtensa/trampoline.d
+ create mode 100644 gas/testsuite/gas/xtensa/trampoline.s
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index fe8ec0f..ea23c96 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -468,6 +468,12 @@ static void xtensa_set_frag_assembly_state (fragS *);
+ static void finish_vinsn (vliw_insn *);
+ static bfd_boolean emit_single_op (TInsn *);
+ static int total_frag_text_expansion (fragS *);
++static bfd_boolean use_trampolines = TRUE;
++static void xtensa_check_frag_count (void);
++static void xtensa_create_trampoline_frag (bfd_boolean);
++static void xtensa_maybe_create_trampoline_frag (void);
++struct trampoline_frag;
++static int init_trampoline_frag (struct trampoline_frag *);
+
+ /* Alignment Functions. */
+
+@@ -520,6 +526,7 @@ static void tinsn_from_chars (TInsn *, char *, int);
+ static void tinsn_immed_from_frag (TInsn *, fragS *, int);
+ static int get_num_stack_text_bytes (IStack *);
+ static int get_num_stack_literal_bytes (IStack *);
++static bfd_boolean tinsn_to_slotbuf (xtensa_format, int, TInsn *, xtensa_insnbuf);
+
+ /* vliw_insn functions. */
+
+@@ -687,7 +694,10 @@ enum
+ option_prefer_l32r,
+ option_prefer_const16,
+
+- option_target_hardware
++ option_target_hardware,
++
++ option_trampolines,
++ option_no_trampolines,
+ };
+
+ const char *md_shortopts = "";
+@@ -760,6 +770,9 @@ struct option md_longopts[] =
+
+ { "target-hardware", required_argument, NULL, option_target_hardware },
+
++ { "trampolines", no_argument, NULL, option_trampolines },
++ { "no-trampolines", no_argument, NULL, option_no_trampolines },
++
+ { NULL, no_argument, NULL, 0 }
+ };
+
+@@ -940,6 +953,14 @@ md_parse_option (int c, char *arg)
+ directive_state[directive_transform] = FALSE;
+ return 1;
+
++ case option_trampolines:
++ use_trampolines = TRUE;
++ return 1;
++
++ case option_no_trampolines:
++ use_trampolines = FALSE;
++ return 1;
++
+ default:
+ return 0;
+ }
+@@ -963,7 +984,9 @@ Xtensa options:\n\
+ flix bundles\n\
+ --no-allow-flix neither allow hand-written nor generate\n\
+ flix bundles\n\
+- --rename-section old=new Rename section 'old' to 'new'\n", stream);
++ --rename-section old=new Rename section 'old' to 'new'\n\
++ --[no-]trampolines [Do not] generate trampolines (jumps to jumps)\n\
++ when jumps do not reach their targets\n", stream);
+ }
+
+
+@@ -5568,6 +5591,8 @@ md_assemble (char *str)
+
+ /* We've just emitted a new instruction so clear the list of labels. */
+ xtensa_clear_insn_labels ();
++
++ xtensa_check_frag_count ();
+ }
+
+
+@@ -6372,6 +6397,8 @@ finish_vinsn (vliw_insn *vinsn)
+ xg_assemble_vliw_tokens (vinsn);
+
+ xg_clear_vinsn (vinsn);
++
++ xtensa_check_frag_count ();
+ }
+
+
+@@ -7140,6 +7167,7 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
+ RELAX_UNREACHABLE,
+ frag_now->fr_symbol, frag_now->fr_offset, NULL);
+ xtensa_set_frag_assembly_state (frag_now);
++ xtensa_maybe_create_trampoline_frag ();
+ }
+ else if (is_branch && do_align_targets ())
+ {
+@@ -7222,9 +7250,164 @@ xtensa_end (void)
+ xtensa_sanity_check ();
+
+ xtensa_add_config_info ();
++
++ xtensa_check_frag_count ();
++}
++
++
++struct trampoline_frag
++{
++ struct trampoline_frag *next;
++ bfd_boolean needs_jump_around;
++ fragS *fragP;
++ fixS *fixP;
++};
++
++struct trampoline_seg
++{
++ struct trampoline_seg *next;
++ asection *seg;
++ struct trampoline_frag trampoline_list;
++};
++
++static struct trampoline_seg trampoline_seg_list;
++#define J_RANGE (128 * 1024)
++
++static int unreachable_count = 0;
++
++
++static void
++xtensa_maybe_create_trampoline_frag (void)
++{
++ if (!use_trampolines)
++ return;
++
++ /* We create an area for possible trampolines every 10 unreachable frags.
++ These are preferred over the ones not preceded by an unreachable frag,
++ because we don't have to jump around them. This function is called after
++ each RELAX_UNREACHABLE frag is created. */
++
++ if (++unreachable_count > 10)
++ {
++ xtensa_create_trampoline_frag (FALSE);
++ clear_frag_count ();
++ unreachable_count = 0;
++ }
++}
++
++static void
++xtensa_check_frag_count (void)
++{
++ if (!use_trampolines || frag_now->tc_frag_data.is_no_transform)
++ return;
++
++ /* We create an area for possible trampolines every 8000 frags or so. This
++ is an estimate based on the max range of a "j" insn (+/-128K) divided
++ by a typical frag byte count (16), minus a few for safety. This function
++ is called after each source line is processed. */
++
++ if (get_frag_count () > 8000)
++ {
++ xtensa_create_trampoline_frag (TRUE);
++ clear_frag_count ();
++ unreachable_count = 0;
++ }
++}
++
++static xtensa_insnbuf trampoline_buf = NULL;
++static xtensa_insnbuf trampoline_slotbuf = NULL;
++
++#define TRAMPOLINE_FRAG_SIZE 3000
++
++static void
++xtensa_create_trampoline_frag (bfd_boolean needs_jump_around)
++{
++ /* Emit a frag where we can place intermediate jump instructions,
++ in case we need to jump farther than 128K bytes.
++ Each jump instruction takes three bytes.
++ We allocate enough for 1000 trampolines in each frag.
++ If that's not enough, oh well. */
++
++ struct trampoline_seg *ts = trampoline_seg_list.next;
++ struct trampoline_frag *tf;
++ char *varP;
++ fragS *fragP;
++ int size = TRAMPOLINE_FRAG_SIZE;
++
++ for ( ; ts; ts = ts->next)
++ {
++ if (ts->seg == now_seg)
++ break;
++ }
++
++ if (ts == NULL)
++ {
++ ts = (struct trampoline_seg *)xcalloc(sizeof (struct trampoline_seg), 1);
++ ts->next = trampoline_seg_list.next;
++ trampoline_seg_list.next = ts;
++ ts->seg = now_seg;
++ }
++
++ frag_wane (frag_now);
++ frag_new (0);
++ xtensa_set_frag_assembly_state (frag_now);
++ varP = frag_var (rs_machine_dependent, size, size, RELAX_TRAMPOLINE, NULL, 0, NULL);
++ fragP = (fragS *)(varP - SIZEOF_STRUCT_FRAG);
++ if (trampoline_buf == NULL)
++ {
++ trampoline_buf = xtensa_insnbuf_alloc (xtensa_default_isa);
++ trampoline_slotbuf = xtensa_insnbuf_alloc (xtensa_default_isa);
++ }
++ tf = (struct trampoline_frag *)xmalloc(sizeof (struct trampoline_frag));
++ tf->next = ts->trampoline_list.next;
++ ts->trampoline_list.next = tf;
++ tf->needs_jump_around = needs_jump_around;
++ tf->fragP = fragP;
++ tf->fixP = NULL;
++}
++
++
++static struct trampoline_seg *
++find_trampoline_seg (asection *seg)
++{
++ struct trampoline_seg *ts = trampoline_seg_list.next;
++
++ for ( ; ts; ts = ts->next)
++ {
++ if (ts->seg == seg)
++ return ts;
++ }
++
++ return NULL;
+ }
+
+
++void dump_trampolines (void);
++
++void
++dump_trampolines (void)
++{
++ struct trampoline_seg *ts = trampoline_seg_list.next;
++
++ for ( ; ts; ts = ts->next)
++ {
++ asection *seg = ts->seg;
++
++ if (seg == NULL)
++ continue;
++ fprintf(stderr, "SECTION %s\n", seg->name);
++ struct trampoline_frag *tf = ts->trampoline_list.next;
++ for ( ; tf; tf = tf->next)
++ {
++ if (tf->fragP == NULL)
++ continue;
++ fprintf(stderr, " 0x%08x: fix=%d, jump_around=%s\n",
++ (int)tf->fragP->fr_address, (int)tf->fragP->fr_fix,
++ tf->needs_jump_around ? "T" : "F");
++ }
++ }
++}
++
+ static void
+ xtensa_cleanup_align_frags (void)
+ {
+@@ -8708,6 +8891,149 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
+ new_stretch += relax_frag_for_align (fragP, stretch);
+ break;
+
++ case RELAX_TRAMPOLINE:
++ if (fragP->tc_frag_data.relax_seen)
++ {
++ segment_info_type *seginfo = seg_info (now_seg);
++ fragS *fP; /* The out-of-range jump. */
++ fixS *fixP;
++
++ /* Scan for jumps that will not reach. */
++ for (fixP = seginfo->fix_root; fixP ; fixP = fixP->fx_next)
++ {
++ symbolS *s = fixP->fx_addsy;
++ xtensa_opcode opcode;
++ int target;
++ int addr;
++ int delta;
++
++ if (fixP->fx_r_type < BFD_RELOC_XTENSA_SLOT0_OP ||
++ fixP->fx_r_type > BFD_RELOC_XTENSA_SLOT14_OP)
++ continue;
++ xtensa_insnbuf_from_chars (isa, trampoline_buf,
++ (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where,
++ 0);
++ fmt = xtensa_format_decode (isa, trampoline_buf);
++ gas_assert (fmt != XTENSA_UNDEFINED);
++ slot = fixP->tc_fix_data.slot;
++ xtensa_format_get_slot (isa, fmt, slot, trampoline_buf, trampoline_slotbuf);
++ opcode = xtensa_opcode_decode (isa, fmt, slot, trampoline_slotbuf);
++ if (opcode != xtensa_j_opcode)
++ continue;
++ target = S_GET_VALUE (s);
++ addr = fixP->fx_frag->fr_address;
++ delta = target - addr + stretch;
++ if (delta > J_RANGE || delta < -1 * J_RANGE)
++ { /* Found an out-of-range jump; scan the list of trampolines for the best match. */
++ struct trampoline_seg *ts = find_trampoline_seg (now_seg);
++ struct trampoline_frag *tf = ts->trampoline_list.next;
++ struct trampoline_frag *prev = &ts->trampoline_list;
++ int lower = (target < addr) ? target : addr;
++ int upper = (target > addr) ? target : addr;
++ int midpoint = lower + (upper - lower) / 2;
++
++ if ((upper - lower) > 2 * J_RANGE)
++ {
++ /* One trampoline won't suffice; we need multiple jumps.
++ Jump to the trampoline that's farthest, but still in
++ range relative to the original "j" instruction. */
++ for ( ; tf; prev = tf, tf = tf->next )
++ {
++ int this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ int next_addr = (tf->next) ? tf->next->fragP->fr_address + tf->next->fragP->fr_fix : 0 ;
++
++ if (addr == lower)
++ {
++ /* Forward jump. */
++ if (this_addr - addr < J_RANGE)
++ break;
++ }
++ else
++ {
++ /* Backward jump. */
++ if (next_addr == 0 || addr - next_addr > J_RANGE)
++ break;
++ }
++ }
++ }
++ else
++ {
++ struct trampoline_frag *best_tf = NULL;
++ int best_delta = 0;
++
++ for ( ; tf; prev = tf, tf = tf->next )
++ {
++ int this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ int this_delta = abs (this_addr - midpoint);
++
++ if (!best_tf || this_delta < best_delta)
++ {
++ best_tf = tf;
++ best_delta = this_delta;
++ }
++ }
++ tf = best_tf;
++ }
++ if (tf->fragP == fragP)
++ {
++ int trampaddr = fragP->fr_address + fragP->fr_fix;
++
++ if (abs (addr - trampaddr) < J_RANGE)
++ { /* The trampoline is in range of original; fix it! */
++ fixS *newfixP;
++ int offset;
++ TInsn insn;
++ symbolS *lsym;
++
++ new_stretch += init_trampoline_frag (tf);
++ offset = fragP->fr_fix; /* Where to assemble the j insn. */
++ lsym = fragP->fr_symbol;
++ fP = fixP->fx_frag;
++ /* Assemble a jump to the target label here. */
++ tinsn_init (&insn);
++ insn.insn_type = ITYPE_INSN;
++ insn.opcode = xtensa_j_opcode;
++ insn.ntok = 1;
++ set_expr_symbol_offset (&insn.tok[0], lsym, offset);
++ fmt = xg_get_single_format (xtensa_j_opcode);
++ tinsn_to_slotbuf (fmt, 0, &insn, trampoline_slotbuf);
++ xtensa_format_set_slot (isa, fmt, 0, trampoline_buf, trampoline_slotbuf);
++ xtensa_insnbuf_to_chars (isa, trampoline_buf, (unsigned char *)fragP->fr_literal + offset, 3);
++ fragP->fr_fix += 3;
++ fragP->fr_var -= 3;
++ /* Add a fix-up for the original j insn. */
++ newfixP = fix_new (fP, fixP->fx_where, fixP->fx_size, lsym, fragP->fr_fix - 3, TRUE, fixP->fx_r_type);
++ newfixP->fx_no_overflow = 1;
++ newfixP->tc_fix_data.X_add_symbol = lsym;
++ newfixP->tc_fix_data.X_add_number = offset;
++ newfixP->tc_fix_data.slot = slot;
++ /* Move the fix-up from the original j insn to this one. */
++ fixP->fx_frag = fragP;
++ fixP->fx_where = fragP->fr_fix - 3;
++ fixP->tc_fix_data.slot = 0;
++ /* Adjust the jump around this trampoline (if present). */
++ if (tf->fixP != NULL)
++ {
++ tf->fixP->fx_offset += 3;
++ }
++ new_stretch += 3;
++ fragP->tc_frag_data.relax_seen = FALSE; /* Need another pass. */
++ /* Do we have room for more? */
++ if (fragP->fr_var < 3)
++ { /* No, convert to fill. */
++ frag_wane (fragP);
++ fragP->fr_subtype = 0;
++ /* Remove from the trampoline_list. */
++ prev->next = tf->next;
++ break;
++ }
++ }
++ }
++ }
++ }
++ }
++ break;
++
+ default:
+ as_bad (_("bad relaxation state"));
+ }
+@@ -9146,6 +9472,200 @@ bytes_to_stretch (fragS *this_frag,
+ }
+
+
++static struct trampoline_frag *
++search_trampolines (TInsn *tinsn, fragS *fragP, bfd_boolean unreachable_only)
++{
++ struct trampoline_seg *ts = find_trampoline_seg (now_seg);
++ struct trampoline_frag *tf = (ts) ? ts->trampoline_list.next : NULL;
++ struct trampoline_frag *best_tf = NULL;
++ int best_delta = 0;
++ int best_addr = 0;
++ symbolS *sym = tinsn->tok[0].X_add_symbol;
++ offsetT target = S_GET_VALUE (sym) + tinsn->tok[0].X_add_number;
++ offsetT addr = fragP->fr_address;
++ offsetT lower = (addr < target) ? addr : target;
++ offsetT upper = (addr > target) ? addr : target;
++ int delta = upper - lower;
++ offsetT midpoint = lower + delta / 2;
++ int this_delta = -1;
++ int this_addr = -1;
++
++ if (delta > 2 * J_RANGE)
++ {
++ /* One trampoline won't do; we need multiple.
++ Choose the farthest trampoline that's still in range of the original
++ and let a later pass finish the job. */
++ for ( ; tf; tf = tf->next)
++ {
++ int next_addr = (tf->next) ? tf->next->fragP->fr_address + tf->next->fragP->fr_fix : 0;
++
++ this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ if (lower == addr)
++ {
++ /* Forward jump. */
++ if (this_addr - addr < J_RANGE)
++ break;
++ }
++ else
++ {
++ /* Backward jump. */
++ if (next_addr == 0 || addr - next_addr > J_RANGE)
++ break;
++ }
++ if (abs (addr - this_addr) < J_RANGE)
++ return tf;
++
++ return NULL;
++ }
++ }
++ for ( ; tf; tf = tf->next)
++ {
++ this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ this_delta = abs (this_addr - midpoint);
++ if (unreachable_only && tf->needs_jump_around)
++ continue;
++ if (!best_tf || this_delta < best_delta)
++ {
++ best_tf = tf;
++ best_delta = this_delta;
++ best_addr = this_addr;
++ }
++ }
++
++ if (best_tf &&
++ best_delta < J_RANGE &&
++ abs(best_addr - lower) < J_RANGE &&
++ abs(best_addr - upper) < J_RANGE)
++ return best_tf;
++
++ return NULL; /* No suitable trampoline found. */
++}
++
++
++static struct trampoline_frag *
++get_best_trampoline (TInsn *tinsn, fragS *fragP)
++{
++ struct trampoline_frag *tf = NULL;
++
++ tf = search_trampolines (tinsn, fragP, TRUE); /* Try unreachable first. */
++
++ if (tf == NULL)
++ tf = search_trampolines (tinsn, fragP, FALSE); /* Try ones needing a jump-around, too. */
++
++ return tf;
++}
++
++
++static void
++check_and_update_trampolines (void)
++{
++ struct trampoline_seg *ts = find_trampoline_seg (now_seg);
++ struct trampoline_frag *tf = ts->trampoline_list.next;
++ struct trampoline_frag *prev = &ts->trampoline_list;
++
++ for ( ; tf; prev = tf, tf = tf->next)
++ {
++ if (tf->fragP->fr_var < 3)
++ {
++ frag_wane (tf->fragP);
++ prev->next = tf->next;
++ tf->fragP = NULL;
++ }
++ }
++}
++
++
++static int
++init_trampoline_frag (struct trampoline_frag *trampP)
++{
++ fragS *fp = trampP->fragP;
++ int growth = 0;
++
++ if (fp->fr_fix == 0)
++ {
++ symbolS *lsym;
++ char label[10 + 2 * sizeof(fp)];
++ sprintf (label, ".L0_TR_%p", fp);
++
++ lsym = (symbolS *)local_symbol_make (label, now_seg, 0, fp);
++ fp->fr_symbol = lsym;
++ if (trampP->needs_jump_around)
++ {
++ /* Add a jump around this block of jumps, in case
++ control flows into this block. */
++ fixS *fixP;
++ TInsn insn;
++ xtensa_format fmt;
++ xtensa_isa isa = xtensa_default_isa;
++
++ fp->tc_frag_data.is_insn = 1;
++ /* Assemble a jump insn. */
++ tinsn_init (&insn);
++ insn.insn_type = ITYPE_INSN;
++ insn.opcode = xtensa_j_opcode;
++ insn.ntok = 1;
++ set_expr_symbol_offset (&insn.tok[0], lsym, 3);
++ fmt = xg_get_single_format (xtensa_j_opcode);
++ tinsn_to_slotbuf (fmt, 0, &insn, trampoline_slotbuf);
++ xtensa_format_set_slot (isa, fmt, 0, trampoline_buf, trampoline_slotbuf);
++ xtensa_insnbuf_to_chars (isa, trampoline_buf, (unsigned char *)fp->fr_literal, 3);
++ fp->fr_fix += 3;
++ fp->fr_var -= 3;
++ growth = 3;
++ fixP = fix_new (fp, 0, 3, lsym, 3, TRUE, BFD_RELOC_XTENSA_SLOT0_OP);
++ trampP->fixP = fixP;
++ }
++ }
++ return growth;
++}
++
++
++static int
++add_jump_to_trampoline (struct trampoline_frag *trampP, fragS *origfrag)
++{
++ fragS *tramp = trampP->fragP;
++ fixS *fixP;
++ int offset = tramp->fr_fix; /* Where to assemble the j insn. */
++ TInsn insn;
++ symbolS *lsym;
++ symbolS *tsym;
++ int toffset;
++ xtensa_format fmt;
++ xtensa_isa isa = xtensa_default_isa;
++ int growth = 0;
++
++ lsym = tramp->fr_symbol;
++ /* Assemble a jump to the target label in the trampoline frag. */
++ tsym = origfrag->tc_frag_data.slot_symbols[0];
++ toffset = origfrag-> tc_frag_data.slot_offsets[0];
++ tinsn_init (&insn);
++ insn.insn_type = ITYPE_INSN;
++ insn.opcode = xtensa_j_opcode;
++ insn.ntok = 1;
++ set_expr_symbol_offset (&insn.tok[0], tsym, toffset);
++ fmt = xg_get_single_format (xtensa_j_opcode);
++ tinsn_to_slotbuf (fmt, 0, &insn, trampoline_slotbuf);
++ xtensa_format_set_slot (isa, fmt, 0, trampoline_buf, trampoline_slotbuf);
++ xtensa_insnbuf_to_chars (isa, trampoline_buf, (unsigned char *)tramp->fr_literal + offset, 3);
++ tramp->fr_fix += 3;
++ tramp->fr_var -= 3;
++ growth = 3;
++ /* add a fix-up for the trampoline jump. */
++ fixP = fix_new (tramp, tramp->fr_fix - 3, 3, tsym, toffset, TRUE, BFD_RELOC_XTENSA_SLOT0_OP);
++ /* Modify the jump at the start of this trampoline to point past the newly-added jump. */
++ fixP = trampP->fixP;
++ if (fixP)
++ fixP->fx_offset += 3;
++ /* Modify the original j to point here. */
++ origfrag->tc_frag_data.slot_symbols[0] = lsym;
++ origfrag->tc_frag_data.slot_offsets[0] = tramp->fr_fix - 3;
++ /* If trampoline is full, remove it from the list. */
++ check_and_update_trampolines ();
++
++ return growth;
++}
++
++
+ static long
+ relax_frag_immed (segT segP,
+ fragS *fragP,
+@@ -9284,6 +9804,37 @@ relax_frag_immed (segT segP,
+ if (negatable_branch && istack.ninsn > 1)
+ update_next_frag_state (fragP);
+
++ /* If last insn is a jump, and it cannot reach its target, try to find a trampoline. */
++ if (istack.ninsn > 2 &&
++ istack.insn[istack.ninsn - 1].insn_type == ITYPE_LABEL &&
++ istack.insn[istack.ninsn - 2].insn_type == ITYPE_INSN &&
++ istack.insn[istack.ninsn - 2].opcode == xtensa_j_opcode)
++ {
++ TInsn *jinsn = &istack.insn[istack.ninsn - 2];
++
++ if (!xg_symbolic_immeds_fit (jinsn, segP, fragP, fragP->fr_offset, total_text_diff))
++ {
++ struct trampoline_frag *tf = get_best_trampoline (jinsn, fragP);
++
++ if (tf)
++ {
++ this_text_diff += init_trampoline_frag (tf);
++ this_text_diff += add_jump_to_trampoline (tf, fragP);
++ }
++ else
++ {
++ /* If target symbol is undefined, assume it will reach once linked. */
++ expressionS *exp = &istack.insn[istack.ninsn - 2].tok[0];
++
++ if (exp->X_op == O_symbol && S_IS_DEFINED (exp->X_add_symbol))
++ {
++ as_bad_where (fragP->fr_file, fragP->fr_line,
++ _("jump target out of range; no usable trampoline found"));
++ }
++ }
++ }
++ }
++
+ return this_text_diff;
+ }
+
+@@ -9404,6 +9955,9 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragp)
+ else
+ as_bad (_("invalid relaxation fragment result"));
+ break;
++
++ case RELAX_TRAMPOLINE:
++ break;
+ }
+
+ fragp->fr_var = 0;
+diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h
+index 0bf1240..4672bc6 100644
+--- a/gas/config/tc-xtensa.h
++++ b/gas/config/tc-xtensa.h
+@@ -180,6 +180,11 @@ enum xtensa_relax_statesE
+ prevent the linker from changing the size of any frag between the
+ section start and the org frag. */
+
++ RELAX_TRAMPOLINE,
++ /* Every few thousand frags, we insert one of these, just in case we may
++ need some space for a trampoline (jump to a jump) because the function
++ has gotten too big. If not needed, it disappears. */
++
+ RELAX_NONE
+ };
+
+diff --git a/gas/frags.c b/gas/frags.c
+index 5f68480..e14099d 100644
+--- a/gas/frags.c
++++ b/gas/frags.c
+@@ -24,6 +24,20 @@
+
+ extern fragS zero_address_frag;
+ extern fragS predefined_address_frag;
++
++static int totalfrags;
++
++int
++get_frag_count (void)
++{
++ return totalfrags;
++}
++
++void
++clear_frag_count (void)
++{
++ totalfrags = 0;
++}
+
+ /* Initialization for frag routines. */
+
+@@ -70,6 +84,7 @@ frag_alloc (struct obstack *ob)
+ ptr = (fragS *) obstack_alloc (ob, SIZEOF_STRUCT_FRAG);
+ obstack_alignment_mask (ob) = oalign;
+ memset (ptr, 0, SIZEOF_STRUCT_FRAG);
++ totalfrags++;
+ return ptr;
+ }
+
+diff --git a/gas/frags.h b/gas/frags.h
+index 319898f..2f9e1b5 100644
+--- a/gas/frags.h
++++ b/gas/frags.h
+@@ -155,4 +155,7 @@ char *frag_var (relax_stateT type,
+
+ bfd_boolean frag_offset_fixed_p (const fragS *, const fragS *, offsetT *);
+
++int get_frag_count (void);
++void clear_frag_count (void);
++
+ #endif /* FRAGS_H */
+diff --git a/gas/testsuite/gas/xtensa/all.exp b/gas/testsuite/gas/xtensa/all.exp
+index 2b2c294..3683b78 100644
+--- a/gas/testsuite/gas/xtensa/all.exp
++++ b/gas/testsuite/gas/xtensa/all.exp
+@@ -98,6 +98,7 @@ if [istarget xtensa*-*-*] then {
+ run_dump_test "pcrel"
+ run_dump_test "weak-call"
+ run_dump_test "jlong"
++ run_dump_test "trampoline"
+ }
+
+ if [info exists errorInfo] then {
+diff --git a/gas/testsuite/gas/xtensa/trampoline.d b/gas/testsuite/gas/xtensa/trampoline.d
+new file mode 100644
+index 0000000..b4f65dc
+--- /dev/null
++++ b/gas/testsuite/gas/xtensa/trampoline.d
+@@ -0,0 +1,26 @@
++#as:
++#objdump: -d
++#name: trampolines relaxation
++
++.*: +file format .*xtensa.*
++#...
++.*0:.*j.0x1194c
++.*3:.*j.0x1194f
++.*6:.*j.0x11952
++.*9:.*j.0x1d4e4
++#...
++.*11949:.*j.0x11955
++.*1194c:.*j.0x24a0e
++.*1194f:.*j.0x24a0e
++.*11952:.*j.0x24a11
++#...
++.*1d4e1:.*j.0x1d4e7
++.*1d4e4:.*j.0x33462
++#...
++.*24a0e:.*j.0x24a0e
++.*24a11:.*j.0x24a11
++#...
++.*3345f:.*ret
++.*33462:.*j.0x49407
++#...
++.*49407:.*j.0x49407
+diff --git a/gas/testsuite/gas/xtensa/trampoline.s b/gas/testsuite/gas/xtensa/trampoline.s
+new file mode 100644
+index 0000000..259a3bb
+--- /dev/null
++++ b/gas/testsuite/gas/xtensa/trampoline.s
+@@ -0,0 +1,21 @@
++ .text
++ j 1f
++ j 1f
++ j 2f
++ j 3f
++ .rep 25000
++99:
++ and a2, a2, a3
++ bne a2, a3, 99b
++ .endr
++1:
++ j 1b
++2:
++ j 2b
++
++ .rep 25000
++ and a2, a2, a3
++ _ret
++ .endr
++3:
++ j 3b
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.23.2/901-xtensa-gas-first-frag-alignment.patch b/patches/binutils/2.23.2/901-xtensa-gas-first-frag-alignment.patch
new file mode 100644
index 0000000..e1c2d85
--- /dev/null
+++ b/patches/binutils/2.23.2/901-xtensa-gas-first-frag-alignment.patch
@@ -0,0 +1,51 @@
+From a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Tue, 15 Apr 2014 19:12:46 +0400
+Subject: [PATCH] Fix alignment for the first section frag on xtensa
+
+Linking object files produced by partial linking with link-time
+relaxation enabled sometimes fails with the following error message:
+
+dangerous relocation: call8: misaligned call target: (.text.unlikely+0x63)
+
+This happens because no basic block with an XTENSA_PROP_ALIGN flag in the
+property table is generated for the first basic block, even if the
+.align directive is present.
+It was believed that the first frag alignment could be derived from the
+section alignment, but this was not implemented for the partial linking
+case: after partial linking first frag of a section may become not
+first, but no additional alignment frag is inserted before it.
+Basic block for such frag may be merged with previous basic block into
+extended basic block during relaxation pass losing its alignment
+restrictions.
+
+Fix this by always recording alignment for the first section frag.
+
+2014-04-22 Max Filippov <jcmvbkbc@gmail.com>
+
+gas/
+ * config/tc-xtensa.c (xtensa_handle_align): record alignment for the
+ first section frag.
+
+---
+Backported from: a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1
+Changes to Changelog files and tests are dropped.
+
+ gas/config/tc-xtensa.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index ea23c96..58ace38 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -5609,7 +5609,6 @@ xtensa_handle_align (fragS *fragP)
+ && ! fragP->tc_frag_data.is_literal
+ && (fragP->fr_type == rs_align
+ || fragP->fr_type == rs_align_code)
+- && fragP->fr_address + fragP->fr_fix > 0
+ && fragP->fr_offset > 0
+ && now_seg != bss_section)
+ {
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.23.2/902-xtensa-gas-ld-diff-relocation-signed.patch b/patches/binutils/2.23.2/902-xtensa-gas-ld-diff-relocation-signed.patch
new file mode 100644
index 0000000..ba24f4e
--- /dev/null
+++ b/patches/binutils/2.23.2/902-xtensa-gas-ld-diff-relocation-signed.patch
@@ -0,0 +1,133 @@
+From 6a17eba5358549d0d6d195bb22b34cdbc068def2 Mon Sep 17 00:00:00 2001
+From: Volodymyr Arbatov <arbatov@cadence.com>
+Date: Mon, 6 May 2013 09:43:21 -0800
+Subject: [PATCH] Use signed data type for R_XTENSA_DIFF* relocation offsets.
+
+R_XTENSA_DIFF relocation offsets are in fact signed. Treat them as such.
+Add testcase that examines ld behaviour on R_XTENSA_DIFF relocation
+changing sign during relaxation.
+
+2014-05-02 Volodymyr Arbatov <arbatov@cadence.com>
+ David Weatherford <weath@cadence.com>
+ Max Filippov <jcmvbkbc@gmail.com>
+
+bfd/
+ * elf32-xtensa.c (relax_section): treat R_XTENSA_DIFF* relocations as
+ signed.
+
+gas/
+ * config/tc-xtensa.c (md_apply_fix): mark BFD_RELOC_XTENSA_DIFF*
+ fixups as signed.
+---
+Backported from: 1058c7532d0b012ac329219264ddad59049fb6e6
+Changes to Changelog files and tests are dropped.
+
+ bfd/elf32-xtensa.c | 32 ++++++++++++-----------
+ gas/config/tc-xtensa.c | 3 +++
+ 2 files changed, 20 insertions(+), 15 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index edb04b4..8818d67 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -222,11 +222,11 @@ static reloc_howto_type elf_howto_table[] =
+ FALSE, 0, 0, FALSE),
+
+ /* Relocations for supporting difference of symbols. */
+- HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
++ HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_signed,
+ bfd_elf_xtensa_reloc, "R_XTENSA_DIFF8", FALSE, 0, 0xff, FALSE),
+- HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
++ HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_signed,
+ bfd_elf_xtensa_reloc, "R_XTENSA_DIFF16", FALSE, 0, 0xffff, FALSE),
+- HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
++ HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_signed,
+ bfd_elf_xtensa_reloc, "R_XTENSA_DIFF32", FALSE, 0, 0xffffffff, FALSE),
+
+ /* General immediate operand relocations. */
+@@ -9013,7 +9013,8 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ || r_type == R_XTENSA_DIFF16
+ || r_type == R_XTENSA_DIFF32)
+ {
+- bfd_vma diff_value = 0, new_end_offset, diff_mask = 0;
++ bfd_signed_vma diff_value = 0;
++ bfd_vma new_end_offset, diff_mask = 0;
+
+ if (bfd_get_section_limit (abfd, sec) < old_source_offset)
+ {
+@@ -9027,15 +9028,15 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ {
+ case R_XTENSA_DIFF8:
+ diff_value =
+- bfd_get_8 (abfd, &contents[old_source_offset]);
++ bfd_get_signed_8 (abfd, &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF16:
+ diff_value =
+- bfd_get_16 (abfd, &contents[old_source_offset]);
++ bfd_get_signed_16 (abfd, &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF32:
+ diff_value =
+- bfd_get_32 (abfd, &contents[old_source_offset]);
++ bfd_get_signed_32 (abfd, &contents[old_source_offset]);
+ break;
+ }
+
+@@ -9047,24 +9048,25 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ switch (r_type)
+ {
+ case R_XTENSA_DIFF8:
+- diff_mask = 0xff;
+- bfd_put_8 (abfd, diff_value,
++ diff_mask = 0x7f;
++ bfd_put_signed_8 (abfd, diff_value,
+ &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF16:
+- diff_mask = 0xffff;
+- bfd_put_16 (abfd, diff_value,
++ diff_mask = 0x7fff;
++ bfd_put_signed_16 (abfd, diff_value,
+ &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF32:
+- diff_mask = 0xffffffff;
+- bfd_put_32 (abfd, diff_value,
++ diff_mask = 0x7fffffff;
++ bfd_put_signed_32 (abfd, diff_value,
+ &contents[old_source_offset]);
+ break;
+ }
+
+- /* Check for overflow. */
+- if ((diff_value & ~diff_mask) != 0)
++ /* Check for overflow. Sign bits must be all zeroes or all ones */
++ if ((diff_value & ~diff_mask) != 0 &&
++ (diff_value & ~diff_mask) != (-1 & ~diff_mask))
+ {
+ (*link_info->callbacks->reloc_dangerous)
+ (link_info, _("overflow after relaxation"),
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index 58ace38..7547c0a0 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -5867,12 +5867,15 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
+ {
+ case BFD_RELOC_8:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF8;
++ fixP->fx_signed = 1;
+ break;
+ case BFD_RELOC_16:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF16;
++ fixP->fx_signed = 1;
+ break;
+ case BFD_RELOC_32:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF32;
++ fixP->fx_signed = 1;
+ break;
+ default:
+ break;
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch b/patches/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
new file mode 100644
index 0000000..6a0846e
--- /dev/null
+++ b/patches/binutils/2.23.2/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
@@ -0,0 +1,47 @@
+From e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 10 Jul 2014 01:47:33 +0400
+Subject: [PATCH] Fix xtensa ld segfault when linking linux modules
+
+is_inconsistent_linkonce_section makes an assumption that section name
+that starts with ".gnu.linkonce.prop." has one more dot in its suffix.
+However gas generates such section name by insertion of "prop." right
+after ".gnu.linkonce." part of the name of the original section. So, for
+section named ".gnu.linkonce.this_module" corresponding property section
+name does not satisfy the assumption. Such section names are common in
+linux modules. This bug was exposed by the patch "a35d5e8 Fix alignment
+for the first section frag on xtensa", that makes gas produce property
+section for each section that has ".align" directive in it.
+
+Use suffix that immediately follows ".gnu.linkonce.prop." when there are
+no more dots following it.
+
+2014-07-10 Max Filippov <jcmvbkbc@gmail.com>
+
+ld/
+ * emultempl/xtensaelf.em (is_inconsistent_linkonce_section):
+ correctly handle missing dot in section name after
+ ".gnu.linkonce.prop.".
+---
+Backported from: e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2
+Changes to ld/ChangeLog file are dropped.
+
+ ld/emultempl/xtensaelf.em | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
+index 151eea4..948d18d 100644
+--- a/ld/emultempl/xtensaelf.em
++++ b/ld/emultempl/xtensaelf.em
+@@ -1310,7 +1310,7 @@ is_inconsistent_linkonce_section (asection *sec)
+ for Tensilica's XCC compiler. */
+ name = sec_name + linkonce_len;
+ if (CONST_STRNEQ (name, "prop."))
+- name = strchr (name + 5, '.') + 1;
++ name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
+ else if (name[1] == '.'
+ && (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
+ name += 2;
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.23.2/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch b/patches/binutils/2.23.2/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch
new file mode 100644
index 0000000..dba7620
--- /dev/null
+++ b/patches/binutils/2.23.2/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch
@@ -0,0 +1,79 @@
+From 7fc39194f8fb48914c995f8ec3826d50086f1ec0 Mon Sep 17 00:00:00 2001
+From: Sterling Augustine <augustine.sterling@gmail.com>
+Date: Tue, 25 Jan 2011 13:59:13 -0800
+Subject: [PATCH] Fix 'call8: call target out of range' xtensa ld relaxation
+ bug
+
+During link-time relaxation distance between cross-section call site and
+its target may grow, producing 'call target out of range' error for
+relaxed calls. Be more conservative when calculating whether or not a
+callx can be converted to a straight call.
+
+2014-09-23 Sterling Augustine <augustine.sterling@gmail.com>
+
+bfd/
+ * elf32-xtensa.c (is_resolvable_asm_expansion): for cross-section
+ call relaxation use furthermost addresses where call source and
+ destination can be to check whether it's in the range of a direct
+ call.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 41 +++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 09862e3..e32496a 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -7124,10 +7124,43 @@ is_resolvable_asm_expansion (bfd *abfd,
+ || is_reloc_sym_weak (abfd, irel)))
+ return FALSE;
+
+- self_address = (sec->output_section->vma
+- + sec->output_offset + irel->r_offset + 3);
+- dest_address = (target_sec->output_section->vma
+- + target_sec->output_offset + target_offset);
++ if (target_sec->output_section != sec->output_section)
++ {
++ /* If the two sections are sufficiently far away that relaxation
++ might take the call out of range, we can't simplify. For
++ example, a positive displacement call into another memory
++ could get moved to a lower address due to literal removal,
++ but the destination won't move, and so the displacment might
++ get larger.
++
++ If the displacement is negative, assume the destination could
++ move as far back as the start of the output section. The
++ self_address will be at least as far into the output section
++ as it is prior to relaxation.
++
++ If the displacement is postive, assume the destination will be in
++ it's pre-relaxed location (because relaxation only makes sections
++ smaller). The self_address could go all the way to the beginning
++ of the output section. */
++
++ dest_address = target_sec->output_section->vma;
++ self_address = sec->output_section->vma;
++
++ if (sec->output_section->vma > target_sec->output_section->vma)
++ self_address += sec->output_offset + irel->r_offset + 3;
++ else
++ dest_address += bfd_get_section_limit (abfd, target_sec->output_section);
++ /* Call targets should be four-byte aligned. */
++ dest_address = (dest_address + 3) & ~3;
++ }
++ else
++ {
++
++ self_address = (sec->output_section->vma
++ + sec->output_offset + irel->r_offset + 3);
++ dest_address = (target_sec->output_section->vma
++ + target_sec->output_offset + target_offset);
++ }
+
+ *is_reachable_p = pcrel_reloc_fits (direct_call_opcode, 0,
+ self_address, dest_address);
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.23.2/905-Fix-trampolines-search-code-for-conditional-branches.patch b/patches/binutils/2.23.2/905-Fix-trampolines-search-code-for-conditional-branches.patch
new file mode 100644
index 0000000..8aeb064
--- /dev/null
+++ b/patches/binutils/2.23.2/905-Fix-trampolines-search-code-for-conditional-branches.patch
@@ -0,0 +1,90 @@
+From 415480d6471e67aef97c0241d451ef2423a1da9d Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Tue, 25 Nov 2014 21:33:21 +0300
+Subject: [PATCH] Fix trampolines search code for conditional branches
+
+For conditional branches that need more than one trampoline to reach its
+target assembler couldn't always find suitable trampoline because
+post-loop condition check was placed inside the loop, resulting in
+premature loop termination. Move check outside the loop.
+
+This fixes the following build errors seen when assembling huge files
+produced by gcc:
+ Error: jump target out of range; no usable trampoline found
+ Error: operand 1 of 'j' has out of range value '307307'
+
+2014-11-25 Max Filippov <jcmvbkbc@gmail.com>
+
+gas/
+ * config/tc-xtensa.c (search_trampolines): Move post-loop
+ condition check outside the search loop.
+
+gas/testsuite/
+ * gas/xtensa/trampoline.d: Add expected output for branches.
+ * gas/xtensa/trampoline.s: Add test case for branches.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: d92b6eece424f0ad35d96fdd85bf207295e8c4c3
+Changes to ChangeLogs are dropped.
+
+ gas/config/tc-xtensa.c | 8 ++++----
+ gas/testsuite/gas/xtensa/trampoline.d | 9 +++++++++
+ gas/testsuite/gas/xtensa/trampoline.s | 7 +++++++
+ 3 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index d11b0c7..f23ccf8 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -9514,11 +9514,11 @@ search_trampolines (TInsn *tinsn, fragS *fragP, bfd_boolean unreachable_only)
+ if (next_addr == 0 || addr - next_addr > J_RANGE)
+ break;
+ }
+- if (abs (addr - this_addr) < J_RANGE)
+- return tf;
+-
+- return NULL;
+ }
++ if (abs (addr - this_addr) < J_RANGE)
++ return tf;
++
++ return NULL;
+ }
+ for ( ; tf; tf = tf->next)
+ {
+diff --git a/gas/testsuite/gas/xtensa/trampoline.d b/gas/testsuite/gas/xtensa/trampoline.d
+index b4f65dc..5ae32a6 100644
+--- a/gas/testsuite/gas/xtensa/trampoline.d
++++ b/gas/testsuite/gas/xtensa/trampoline.d
+@@ -24,3 +24,12 @@
+ .*33462:.*j.0x49407
+ #...
+ .*49407:.*j.0x49407
++.*4940a:.*beqz.n.a2,.0x4940f
++.*4940c:.*j.0x693d1
++#...
++.*693d1:.*j.0x7ddd4
++#...
++.*7ddd4:.*j.0x927f5
++#...
++.*927f5:.*j.0x927f5
++#...
+diff --git a/gas/testsuite/gas/xtensa/trampoline.s b/gas/testsuite/gas/xtensa/trampoline.s
+index 259a3bb..4465786 100644
+--- a/gas/testsuite/gas/xtensa/trampoline.s
++++ b/gas/testsuite/gas/xtensa/trampoline.s
+@@ -19,3 +19,10 @@
+ .endr
+ 3:
+ j 3b
++ bnez a2, 4f
++ .rep 50000
++ and a2, a2, a3
++ _ret
++ .endr
++4:
++ j 4b
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.23.2/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch b/patches/binutils/2.23.2/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch
new file mode 100644
index 0000000..9ad6b3b
--- /dev/null
+++ b/patches/binutils/2.23.2/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch
@@ -0,0 +1,57 @@
+From 8ec76b16f62d1bf386fb2c39af5f66c3afddc5cb Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 14 May 2015 05:22:55 +0300
+Subject: [PATCH] xtensa: fix localized symbol refcounting with --gc-sections
+
+elf_xtensa_gc_sweep_hook doesn't correctly unreference symbols that were
+made local, that results in link failure with the following message:
+
+ BFD (GNU Binutils) 2.24 internal error, aborting at elf32-xtensa.c line
+ 3372 in elf_xtensa_finish_dynamic_sections
+
+elf_xtensa_gc_sweep_hook determines symbol reference type (PLT or GOT) by
+relocation type. Relocation types are not changed when symbol becomes
+local, but its PLT references are added to GOT references and
+plt.refcount is set to 0. Such symbol cannot be unreferences in the
+elf_xtensa_gc_sweep_hook and its extra references make calculated GOT
+relocations section size not match number of GOT relocations.
+
+Fix it by treating PLT reference as GOT reference when plt.refcount is
+not positive.
+
+2015-05-14 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
+ as GOT reference when plt.refcount is not positive.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: e6c9a083ec5ae7a45bd71682b26aae1939849388
+Changes to ChangeLog are dropped.
+
+ bfd/elf32-xtensa.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 53af1c6..2523670 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -1360,10 +1360,14 @@ elf_xtensa_gc_sweep_hook (bfd *abfd,
+ {
+ if (is_plt)
+ {
++ /* If the symbol has been localized its plt.refcount got moved
++ to got.refcount. Handle it as GOT. */
+ if (h->plt.refcount > 0)
+ h->plt.refcount--;
++ else
++ is_got = TRUE;
+ }
+- else if (is_got)
++ if (is_got)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.23.2/912-xtensa-fix-gas-segfault-with-text-section-literals.patch b/patches/binutils/2.23.2/912-xtensa-fix-gas-segfault-with-text-section-literals.patch
new file mode 100644
index 0000000..4a3de2c
--- /dev/null
+++ b/patches/binutils/2.23.2/912-xtensa-fix-gas-segfault-with-text-section-literals.patch
@@ -0,0 +1,56 @@
+From 2d0522e76e4afeeb2e104e0a4332d94fa0d2fbf6 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 17 May 2015 06:46:15 +0300
+Subject: [PATCH] xtensa: fix gas segfault with --text-section-literals
+
+When --text-section-literals is used and code in the .init or .fini
+emits literal in the absence of .literal_position, xtensa_move_literals
+segfaults.
+
+Check that search_frag is non-NULL in the xtensa_move_literals and
+report error otherwise.
+
+2015-05-26 Max Filippov <jcmvbkbc@gmail.com>
+gas/
+ * config/tc-xtensa.c (xtensa_move_literals): Check that
+ search_frag is non-NULL. Report error if literal frag is not
+ found.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: 4de0562a4c69fef4952aa7e19d7bda359f02e8b4
+Changes to ChangeLog are dropped.
+
+ gas/config/tc-xtensa.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index 31c0b6b..18307c1 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -10808,13 +10808,21 @@ xtensa_move_literals (void)
+ frchain_to = NULL;
+ frag_splice = &(frchain_from->frch_root);
+
+- while (!search_frag->tc_frag_data.literal_frag)
++ while (search_frag && !search_frag->tc_frag_data.literal_frag)
+ {
+ gas_assert (search_frag->fr_fix == 0
+ || search_frag->fr_type == rs_align);
+ search_frag = search_frag->fr_next;
+ }
+
++ if (!search_frag)
++ {
++ search_frag = frchain_from->frch_root;
++ as_bad_where (search_frag->fr_file, search_frag->fr_line,
++ _("literal pool location required for text-section-literals; specify with .literal_position"));
++ continue;
++ }
++
+ gas_assert (search_frag->tc_frag_data.literal_frag->fr_subtype
+ == RELAX_LITERAL_POOL_BEGIN);
+ xtensa_switch_section_emit_state (&state, segment->seg, 0);
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/001-fix-enable-install-libiberty-flag.patch b/patches/binutils/2.24/001-fix-enable-install-libiberty-flag.patch
new file mode 100644
index 0000000..e408401
--- /dev/null
+++ b/patches/binutils/2.24/001-fix-enable-install-libiberty-flag.patch
@@ -0,0 +1,46 @@
+From 369be6981b26787b2685e3b8c6da779dae8ce35f Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 6 Jan 2014 18:15:31 +0000
+Subject: [PATCH] libiberty: fix --enable-install-libiberty flag [PR 56780]
+
+Commit 199570 fixed the --disable-install-libiberty behavior, but it also
+added a bug where the enable path never works because the initial clear
+of target_header_dir wasn't deleted. So we end up initializing properly
+at the top only to reset it at the end all the time.
+
+[Arnout: adapt to match 2.24 tarball]
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ libiberty/configure | 1 -
+ libiberty/configure.ac | 1 -
+ 3 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libiberty/configure b/libiberty/configure
+index 8ea54da..7bde9b3 100755
+--- a/libiberty/configure
++++ b/libiberty/configure
+@@ -5507,7 +5507,6 @@ fi
+
+ setobjs=
+ CHECK=
+-target_header_dir=
+ if test -n "${with_target_subdir}"; then
+
+ # We are being configured as a target library. AC_REPLACE_FUNCS
+diff --git a/libiberty/configure.ac b/libiberty/configure.ac
+index 4ad88a9..d6180bc 100644
+--- a/libiberty/configure.ac
++++ b/libiberty/configure.ac
+@@ -405,7 +405,6 @@ fi
+
+ setobjs=
+ CHECK=
+-target_header_dir=
+ if test -n "${with_target_subdir}"; then
+
+ # We are being configured as a target library. AC_REPLACE_FUNCS
+--
+1.7.1
+
diff --git a/patches/binutils/2.24/002-dont-segv-on-initial-instructions-overflow.patch b/patches/binutils/2.24/002-dont-segv-on-initial-instructions-overflow.patch
new file mode 100644
index 0000000..7881646
--- /dev/null
+++ b/patches/binutils/2.24/002-dont-segv-on-initial-instructions-overflow.patch
@@ -0,0 +1,66 @@
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 20 Dec 2013 13:27:52 +0000 (+1030)
+Subject: Don't segv on cie.initial_instructions[] overflow.
+X-Git-Tag: gdb-7.7-release~148
+X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=99d190fac4d2aab238cfc798dc5c28ab41456882
+
+Don't segv on cie.initial_instructions[] overflow.
+
+Don't attempt to merge CIEs with a larger number of insns than will
+fit in the buffer.
+
+ * elf-eh-frame.c (cie_eq): Return false when initial_insn_length
+ is too large.
+ (cie_compute_hash): Don't exceed bounds of initial_instructions.
+ (_bfd_elf_parse_eh_frame): Always set initial_insn_length, and
+ save as much of insns to initial_instructions[] as will fit.
+---
+
+diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
+index 832a991..4b6e8ea 100644
+--- a/bfd/elf-eh-frame.c
++++ b/bfd/elf-eh-frame.c
+@@ -235,6 +235,7 @@ cie_eq (const void *e1, const void *e2)
+ && c1->lsda_encoding == c2->lsda_encoding
+ && c1->fde_encoding == c2->fde_encoding
+ && c1->initial_insn_length == c2->initial_insn_length
++ && c1->initial_insn_length <= sizeof (c1->initial_instructions)
+ && memcmp (c1->initial_instructions,
+ c2->initial_instructions,
+ c1->initial_insn_length) == 0)
+@@ -254,6 +255,7 @@ static hashval_t
+ cie_compute_hash (struct cie *c)
+ {
+ hashval_t h = 0;
++ size_t len;
+ h = iterative_hash_object (c->length, h);
+ h = iterative_hash_object (c->version, h);
+ h = iterative_hash (c->augmentation, strlen (c->augmentation) + 1, h);
+@@ -267,7 +269,10 @@ cie_compute_hash (struct cie *c)
+ h = iterative_hash_object (c->lsda_encoding, h);
+ h = iterative_hash_object (c->fde_encoding, h);
+ h = iterative_hash_object (c->initial_insn_length, h);
+- h = iterative_hash (c->initial_instructions, c->initial_insn_length, h);
++ len = c->initial_insn_length;
++ if (len > sizeof (c->initial_instructions))
++ len = sizeof (c->initial_instructions);
++ h = iterative_hash (c->initial_instructions, len, h);
+ c->hash = h;
+ return h;
+ }
+@@ -762,11 +767,10 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
+ cie->fde_encoding = DW_EH_PE_absptr;
+
+ initial_insn_length = end - buf;
+- if (initial_insn_length <= sizeof (cie->initial_instructions))
+- {
+- cie->initial_insn_length = initial_insn_length;
+- memcpy (cie->initial_instructions, buf, initial_insn_length);
+- }
++ cie->initial_insn_length = initial_insn_length;
++ memcpy (cie->initial_instructions, buf,
++ initial_insn_length <= sizeof (cie->initial_instructions)
++ ? initial_insn_length : sizeof (cie->initial_instructions));
+ insns = buf;
+ buf += initial_insn_length;
+ ENSURE_NO_RELOCS (buf);
diff --git a/patches/binutils/2.24/500-sysroot.patch b/patches/binutils/2.24/500-sysroot.patch
new file mode 100644
index 0000000..e49c795
--- /dev/null
+++ b/patches/binutils/2.24/500-sysroot.patch
@@ -0,0 +1,37 @@
+Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
+
+Always try to prepend the sysroot prefix to absolute filenames first.
+
+http://bugs.gentoo.org/275666
+http://sourceware.org/bugzilla/show_bug.cgi?id=10340
+
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -308,18 +308,25 @@
+ directory first. */
+ if (! entry->flags.maybe_archive)
+ {
+- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename))
++ /* For absolute pathnames, try to always open the file in the
++ sysroot first. If this fails, try to open the file at the
++ given location. */
++ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename);
++ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)
++ && ld_sysroot)
+ {
+ char *name = concat (ld_sysroot, entry->filename,
+ (const char *) NULL);
+ if (ldfile_try_open_bfd (name, entry))
+ {
+ entry->filename = name;
++ entry->flags.sysrooted = TRUE;
+ return TRUE;
+ }
+ free (name);
+ }
+- else if (ldfile_try_open_bfd (entry->filename, entry))
++
++ if (ldfile_try_open_bfd (entry->filename, entry))
+ return TRUE;
+
+ if (IS_ABSOLUTE_PATH (entry->filename))
diff --git a/patches/binutils/2.24/600-poison-system-directories.patch b/patches/binutils/2.24/600-poison-system-directories.patch
new file mode 100644
index 0000000..6a3bf6b
--- /dev/null
+++ b/patches/binutils/2.24/600-poison-system-directories.patch
@@ -0,0 +1,279 @@
+Patch adapted to binutils 2.23.2 and extended to use
+BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+
+Patch originally created by Mark Hatle, forward-ported to
+binutils 2.21 by Scott Garman.
+
+purpose: warn for uses of system directories when cross linking
+
+Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
+
+2008-07-02 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * ld.h (args_type): Add error_poison_system_directories.
+ * ld.texinfo (--error-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.error_poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.error_poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --error-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-06-13 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * config.in: Regenerate.
+ * ld.h (args_type): Add poison_system_directories.
+ * ld.texinfo (--no-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --no-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-04-20 Joseph Myers <joseph@codesourcery.com>
+
+ Merge from Sourcery G++ binutils 2.17:
+
+ 2007-03-20 Joseph Myers <joseph@codesourcery.com>
+ Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+ ld/
+ * configure.in (--enable-poison-system-directories): New option.
+ * configure, config.in: Regenerate.
+ * ldfile.c (ldfile_add_library_path): If
+ ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+ /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: b/ld/config.in
+===================================================================
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -11,6 +11,9 @@
+ language is requested. */
+ #undef ENABLE_NLS
+
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+
+Index: b/ld/configure
+===================================================================
+--- a/ld/configure
++++ b/ld/configure
+@@ -774,6 +774,7 @@
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_werror
+@@ -1429,6 +1430,8 @@
+ (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-poison-system-directories
++ warn for use of native system library directories
+ --enable-gold[=ARG] build gold [ARG={default,yes,no}]
+ --enable-got=<type> GOT handling scheme (target, single, negative,
+ multigot)
+@@ -4339,7 +4342,18 @@
+ fi
+
+
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++ enableval=$enable_poison_system_directories;
++else
++ enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
+
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
+
+ # Check whether --enable-got was given.
+ if test "${enable_got+set}" = set; then :
+Index: b/ld/configure.in
+===================================================================
+--- a/ld/configure.in
++++ b/ld/configure.in
+@@ -87,6 +87,16 @@
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system library directories]),,
++ [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++ [1],
++ [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+Index: b/ld/ldfile.c
+===================================================================
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -116,6 +116,23 @@
+ new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
+ else
+ new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (command_line.poison_system_directories
++ && ((!strncmp (name, "/lib", 4))
++ || (!strncmp (name, "/usr/lib", 8))
++ || (!strncmp (name, "/usr/local/lib", 14))
++ || (!strncmp (name, "/usr/X11R6/lib", 14))))
++ {
++ if (command_line.error_poison_system_directories)
++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ else
++ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ }
++#endif
++
+ }
+
+ /* Try to open a BFD for a lang_input_statement. */
+Index: b/ld/ld.h
+===================================================================
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -180,6 +180,14 @@
+ /* If TRUE we'll just print the default output on stdout. */
+ bfd_boolean print_output_format;
+
++ /* If TRUE (the default) warn for uses of system directories when
++ cross linking. */
++ bfd_boolean poison_system_directories;
++
++ /* If TRUE (default FALSE) give an error for uses of system
++ directories when cross linking instead of a warning. */
++ bfd_boolean error_poison_system_directories;
++
+ /* Big or little endian as set on command line. */
+ enum endian_enum endian;
+
+Index: b/ld/ldmain.c
+===================================================================
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -266,6 +266,8 @@
+ command_line.warn_mismatch = TRUE;
+ command_line.warn_search_mismatch = TRUE;
+ command_line.check_section_addresses = -1;
++ command_line.poison_system_directories = TRUE;
++ command_line.error_poison_system_directories = FALSE;
+
+ /* We initialize DEMANGLING based on the environment variable
+ COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
+Index: b/ld/ld.texinfo
+===================================================================
+--- a/ld/ld.texinfo
++++ b/ld/ld.texinfo
+@@ -2175,6 +2175,18 @@
+
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking. This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+
+ @c man end
+Index: b/ld/lexsup.c
+===================================================================
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -507,6 +507,14 @@
+ OPTION_IGNORE_UNRESOLVED_SYMBOL},
+ '\0', N_("SYMBOL"),
+ N_("Unresolved SYMBOL will not cause an error or warning"), TWO_DASHES },
++ { {"no-poison-system-directories", no_argument, NULL,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Do not warn for -L options using system directories"),
++ TWO_DASHES },
++ { {"error-poison-system-directories", no_argument, NULL,
++ + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Give an error for -L options using system directories"),
++ TWO_DASHES },
+ };
+
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -519,6 +527,7 @@
+ int ingroup = 0;
+ char *default_dirlist = NULL;
+ char *shortopts;
++ char *BR_paranoid_env;
+ struct option *longopts;
+ struct option *really_longopts;
+ int last_optind;
+@@ -1442,9 +1451,21 @@
+ einfo (_("%P%X: --hash-size needs a numeric argument\n"));
+ }
+ break;
++
++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++ command_line.poison_system_directories = FALSE;
++ break;
++
++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++ command_line.error_poison_system_directories = TRUE;
++ break;
+ }
+ }
+
++ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
++ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0)
++ command_line.error_poison_system_directories = TRUE;
++
+ while (ingroup)
+ {
+ lang_leave_group ();
+Index: b/ld/ldlex.h
+===================================================================
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -138,6 +138,8 @@
+ OPTION_DEFAULT_SCRIPT,
+ OPTION_PRINT_OUTPUT_FORMAT,
+ OPTION_IGNORE_UNRESOLVED_SYMBOL,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+
+ /* The initial parser states. */
diff --git a/patches/binutils/2.24/900-xtensa-trampolines.patch b/patches/binutils/2.24/900-xtensa-trampolines.patch
new file mode 100644
index 0000000..b5b934f
--- /dev/null
+++ b/patches/binutils/2.24/900-xtensa-trampolines.patch
@@ -0,0 +1,846 @@
+From a82c7d9030b67a6a76a5403d0e1641f9e42141ac Mon Sep 17 00:00:00 2001
+From: David Weatherford <weath@cadence.com>
+Date: Fri, 21 Mar 2014 11:53:42 +0000
+Subject: [PATCH] Add support to the Xtensa target for creating trampolines for
+ out-of-range branches.
+
+ * tc-xtensa.c (xtensa_check_frag_count, xtensa_create_trampoline_frag)
+ (xtensa_maybe_create_trampoline_frag, init_trampoline_frag)
+ (find_trampoline_seg, search_trampolines, get_best_trampoline)
+ (check_and_update_trampolines, add_jump_to_trampoline)
+ (dump_trampolines): New function.
+ (md_parse_option): Add cases for --[no-]trampolines options.
+ (md_assemble, finish_vinsn, xtensa_end): Add call to
+ xtensa_check_frag_count.
+ (xg_assemble_vliw_tokens): Add call to
+ xtensa_maybe_create_trampoline_frag.
+ (xtensa_relax_frag): Relax fragments with RELAX_TRAMPOLINE state.
+ (relax_frag_immed): Relax jump instructions that cannot reach its
+ target.
+ * tc-xtensa.h (xtensa_relax_statesE::RELAX_TRAMPOLINE): New relax
+ state.
+
+ * as.texinfo: Document --[no-]trampolines command-line options.
+ * c-xtensa.texi: Document trampolines relaxation and command line
+ options.
+
+ * frags.c (get_frag_count, clear_frag_count): New function.
+ (frag_alloc): Increment totalfrags counter.
+ * frags.h (get_frag_count, clear_frag_count): New function.
+
+ * all.exp: Add test for trampoline relaxation.
+ * trampoline.d: Trampoline relaxation expected dump.
+ * trampoline.s: Trampoline relaxation test source.
+---
+Backported from: a82c7d9030b67a6a76a5403d0e1641f9e42141ac
+Changes to Changelog files are dropped.
+
+ gas/config/tc-xtensa.c | 558 +++++++++++++++++++++++++++++++++-
+ gas/config/tc-xtensa.h | 5 +
+ gas/frags.c | 15 +
+ gas/frags.h | 3 +
+ gas/testsuite/gas/xtensa/all.exp | 1 +
+ gas/testsuite/gas/xtensa/trampoline.d | 26 ++
+ gas/testsuite/gas/xtensa/trampoline.s | 21 ++
+ 11 files changed, 753 insertions(+), 2 deletions(-)
+ create mode 100644 gas/testsuite/gas/xtensa/trampoline.d
+ create mode 100644 gas/testsuite/gas/xtensa/trampoline.s
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index fe8ec0f..ea23c96 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -468,6 +468,12 @@ static void xtensa_set_frag_assembly_state (fragS *);
+ static void finish_vinsn (vliw_insn *);
+ static bfd_boolean emit_single_op (TInsn *);
+ static int total_frag_text_expansion (fragS *);
++static bfd_boolean use_trampolines = TRUE;
++static void xtensa_check_frag_count (void);
++static void xtensa_create_trampoline_frag (bfd_boolean);
++static void xtensa_maybe_create_trampoline_frag (void);
++struct trampoline_frag;
++static int init_trampoline_frag (struct trampoline_frag *);
+
+ /* Alignment Functions. */
+
+@@ -520,6 +526,7 @@ static void tinsn_from_chars (TInsn *, char *, int);
+ static void tinsn_immed_from_frag (TInsn *, fragS *, int);
+ static int get_num_stack_text_bytes (IStack *);
+ static int get_num_stack_literal_bytes (IStack *);
++static bfd_boolean tinsn_to_slotbuf (xtensa_format, int, TInsn *, xtensa_insnbuf);
+
+ /* vliw_insn functions. */
+
+@@ -687,7 +694,10 @@ enum
+ option_prefer_l32r,
+ option_prefer_const16,
+
+- option_target_hardware
++ option_target_hardware,
++
++ option_trampolines,
++ option_no_trampolines,
+ };
+
+ const char *md_shortopts = "";
+@@ -760,6 +770,9 @@ struct option md_longopts[] =
+
+ { "target-hardware", required_argument, NULL, option_target_hardware },
+
++ { "trampolines", no_argument, NULL, option_trampolines },
++ { "no-trampolines", no_argument, NULL, option_no_trampolines },
++
+ { NULL, no_argument, NULL, 0 }
+ };
+
+@@ -940,6 +953,14 @@ md_parse_option (int c, char *arg)
+ directive_state[directive_transform] = FALSE;
+ return 1;
+
++ case option_trampolines:
++ use_trampolines = TRUE;
++ return 1;
++
++ case option_no_trampolines:
++ use_trampolines = FALSE;
++ return 1;
++
+ default:
+ return 0;
+ }
+@@ -963,7 +984,9 @@ Xtensa options:\n\
+ flix bundles\n\
+ --no-allow-flix neither allow hand-written nor generate\n\
+ flix bundles\n\
+- --rename-section old=new Rename section 'old' to 'new'\n", stream);
++ --rename-section old=new Rename section 'old' to 'new'\n\
++ --[no-]trampolines [Do not] generate trampolines (jumps to jumps)\n\
++ when jumps do not reach their targets\n", stream);
+ }
+
+
+@@ -5568,6 +5591,8 @@ md_assemble (char *str)
+
+ /* We've just emitted a new instruction so clear the list of labels. */
+ xtensa_clear_insn_labels ();
++
++ xtensa_check_frag_count ();
+ }
+
+
+@@ -6372,6 +6397,8 @@ finish_vinsn (vliw_insn *vinsn)
+ xg_assemble_vliw_tokens (vinsn);
+
+ xg_clear_vinsn (vinsn);
++
++ xtensa_check_frag_count ();
+ }
+
+
+@@ -7140,6 +7167,7 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
+ RELAX_UNREACHABLE,
+ frag_now->fr_symbol, frag_now->fr_offset, NULL);
+ xtensa_set_frag_assembly_state (frag_now);
++ xtensa_maybe_create_trampoline_frag ();
+ }
+ else if (is_branch && do_align_targets ())
+ {
+@@ -7222,9 +7250,164 @@ xtensa_end (void)
+ xtensa_sanity_check ();
+
+ xtensa_add_config_info ();
++
++ xtensa_check_frag_count ();
++}
++
++
++struct trampoline_frag
++{
++ struct trampoline_frag *next;
++ bfd_boolean needs_jump_around;
++ fragS *fragP;
++ fixS *fixP;
++};
++
++struct trampoline_seg
++{
++ struct trampoline_seg *next;
++ asection *seg;
++ struct trampoline_frag trampoline_list;
++};
++
++static struct trampoline_seg trampoline_seg_list;
++#define J_RANGE (128 * 1024)
++
++static int unreachable_count = 0;
++
++
++static void
++xtensa_maybe_create_trampoline_frag (void)
++{
++ if (!use_trampolines)
++ return;
++
++ /* We create an area for possible trampolines every 10 unreachable frags.
++ These are preferred over the ones not preceded by an unreachable frag,
++ because we don't have to jump around them. This function is called after
++ each RELAX_UNREACHABLE frag is created. */
++
++ if (++unreachable_count > 10)
++ {
++ xtensa_create_trampoline_frag (FALSE);
++ clear_frag_count ();
++ unreachable_count = 0;
++ }
++}
++
++static void
++xtensa_check_frag_count (void)
++{
++ if (!use_trampolines || frag_now->tc_frag_data.is_no_transform)
++ return;
++
++ /* We create an area for possible trampolines every 8000 frags or so. This
++ is an estimate based on the max range of a "j" insn (+/-128K) divided
++ by a typical frag byte count (16), minus a few for safety. This function
++ is called after each source line is processed. */
++
++ if (get_frag_count () > 8000)
++ {
++ xtensa_create_trampoline_frag (TRUE);
++ clear_frag_count ();
++ unreachable_count = 0;
++ }
++}
++
++static xtensa_insnbuf trampoline_buf = NULL;
++static xtensa_insnbuf trampoline_slotbuf = NULL;
++
++#define TRAMPOLINE_FRAG_SIZE 3000
++
++static void
++xtensa_create_trampoline_frag (bfd_boolean needs_jump_around)
++{
++ /* Emit a frag where we can place intermediate jump instructions,
++ in case we need to jump farther than 128K bytes.
++ Each jump instruction takes three bytes.
++ We allocate enough for 1000 trampolines in each frag.
++ If that's not enough, oh well. */
++
++ struct trampoline_seg *ts = trampoline_seg_list.next;
++ struct trampoline_frag *tf;
++ char *varP;
++ fragS *fragP;
++ int size = TRAMPOLINE_FRAG_SIZE;
++
++ for ( ; ts; ts = ts->next)
++ {
++ if (ts->seg == now_seg)
++ break;
++ }
++
++ if (ts == NULL)
++ {
++ ts = (struct trampoline_seg *)xcalloc(sizeof (struct trampoline_seg), 1);
++ ts->next = trampoline_seg_list.next;
++ trampoline_seg_list.next = ts;
++ ts->seg = now_seg;
++ }
++
++ frag_wane (frag_now);
++ frag_new (0);
++ xtensa_set_frag_assembly_state (frag_now);
++ varP = frag_var (rs_machine_dependent, size, size, RELAX_TRAMPOLINE, NULL, 0, NULL);
++ fragP = (fragS *)(varP - SIZEOF_STRUCT_FRAG);
++ if (trampoline_buf == NULL)
++ {
++ trampoline_buf = xtensa_insnbuf_alloc (xtensa_default_isa);
++ trampoline_slotbuf = xtensa_insnbuf_alloc (xtensa_default_isa);
++ }
++ tf = (struct trampoline_frag *)xmalloc(sizeof (struct trampoline_frag));
++ tf->next = ts->trampoline_list.next;
++ ts->trampoline_list.next = tf;
++ tf->needs_jump_around = needs_jump_around;
++ tf->fragP = fragP;
++ tf->fixP = NULL;
++}
++
++
++static struct trampoline_seg *
++find_trampoline_seg (asection *seg)
++{
++ struct trampoline_seg *ts = trampoline_seg_list.next;
++
++ for ( ; ts; ts = ts->next)
++ {
++ if (ts->seg == seg)
++ return ts;
++ }
++
++ return NULL;
+ }
+
+
++void dump_trampolines (void);
++
++void
++dump_trampolines (void)
++{
++ struct trampoline_seg *ts = trampoline_seg_list.next;
++
++ for ( ; ts; ts = ts->next)
++ {
++ asection *seg = ts->seg;
++
++ if (seg == NULL)
++ continue;
++ fprintf(stderr, "SECTION %s\n", seg->name);
++ struct trampoline_frag *tf = ts->trampoline_list.next;
++ for ( ; tf; tf = tf->next)
++ {
++ if (tf->fragP == NULL)
++ continue;
++ fprintf(stderr, " 0x%08x: fix=%d, jump_around=%s\n",
++ (int)tf->fragP->fr_address, (int)tf->fragP->fr_fix,
++ tf->needs_jump_around ? "T" : "F");
++ }
++ }
++}
++
+ static void
+ xtensa_cleanup_align_frags (void)
+ {
+@@ -8708,6 +8891,149 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
+ new_stretch += relax_frag_for_align (fragP, stretch);
+ break;
+
++ case RELAX_TRAMPOLINE:
++ if (fragP->tc_frag_data.relax_seen)
++ {
++ segment_info_type *seginfo = seg_info (now_seg);
++ fragS *fP; /* The out-of-range jump. */
++ fixS *fixP;
++
++ /* Scan for jumps that will not reach. */
++ for (fixP = seginfo->fix_root; fixP ; fixP = fixP->fx_next)
++ {
++ symbolS *s = fixP->fx_addsy;
++ xtensa_opcode opcode;
++ int target;
++ int addr;
++ int delta;
++
++ if (fixP->fx_r_type < BFD_RELOC_XTENSA_SLOT0_OP ||
++ fixP->fx_r_type > BFD_RELOC_XTENSA_SLOT14_OP)
++ continue;
++ xtensa_insnbuf_from_chars (isa, trampoline_buf,
++ (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where,
++ 0);
++ fmt = xtensa_format_decode (isa, trampoline_buf);
++ gas_assert (fmt != XTENSA_UNDEFINED);
++ slot = fixP->tc_fix_data.slot;
++ xtensa_format_get_slot (isa, fmt, slot, trampoline_buf, trampoline_slotbuf);
++ opcode = xtensa_opcode_decode (isa, fmt, slot, trampoline_slotbuf);
++ if (opcode != xtensa_j_opcode)
++ continue;
++ target = S_GET_VALUE (s);
++ addr = fixP->fx_frag->fr_address;
++ delta = target - addr + stretch;
++ if (delta > J_RANGE || delta < -1 * J_RANGE)
++ { /* Found an out-of-range jump; scan the list of trampolines for the best match. */
++ struct trampoline_seg *ts = find_trampoline_seg (now_seg);
++ struct trampoline_frag *tf = ts->trampoline_list.next;
++ struct trampoline_frag *prev = &ts->trampoline_list;
++ int lower = (target < addr) ? target : addr;
++ int upper = (target > addr) ? target : addr;
++ int midpoint = lower + (upper - lower) / 2;
++
++ if ((upper - lower) > 2 * J_RANGE)
++ {
++ /* One trampoline won't suffice; we need multiple jumps.
++ Jump to the trampoline that's farthest, but still in
++ range relative to the original "j" instruction. */
++ for ( ; tf; prev = tf, tf = tf->next )
++ {
++ int this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ int next_addr = (tf->next) ? tf->next->fragP->fr_address + tf->next->fragP->fr_fix : 0 ;
++
++ if (addr == lower)
++ {
++ /* Forward jump. */
++ if (this_addr - addr < J_RANGE)
++ break;
++ }
++ else
++ {
++ /* Backward jump. */
++ if (next_addr == 0 || addr - next_addr > J_RANGE)
++ break;
++ }
++ }
++ }
++ else
++ {
++ struct trampoline_frag *best_tf = NULL;
++ int best_delta = 0;
++
++ for ( ; tf; prev = tf, tf = tf->next )
++ {
++ int this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ int this_delta = abs (this_addr - midpoint);
++
++ if (!best_tf || this_delta < best_delta)
++ {
++ best_tf = tf;
++ best_delta = this_delta;
++ }
++ }
++ tf = best_tf;
++ }
++ if (tf->fragP == fragP)
++ {
++ int trampaddr = fragP->fr_address + fragP->fr_fix;
++
++ if (abs (addr - trampaddr) < J_RANGE)
++ { /* The trampoline is in range of original; fix it! */
++ fixS *newfixP;
++ int offset;
++ TInsn insn;
++ symbolS *lsym;
++
++ new_stretch += init_trampoline_frag (tf);
++ offset = fragP->fr_fix; /* Where to assemble the j insn. */
++ lsym = fragP->fr_symbol;
++ fP = fixP->fx_frag;
++ /* Assemble a jump to the target label here. */
++ tinsn_init (&insn);
++ insn.insn_type = ITYPE_INSN;
++ insn.opcode = xtensa_j_opcode;
++ insn.ntok = 1;
++ set_expr_symbol_offset (&insn.tok[0], lsym, offset);
++ fmt = xg_get_single_format (xtensa_j_opcode);
++ tinsn_to_slotbuf (fmt, 0, &insn, trampoline_slotbuf);
++ xtensa_format_set_slot (isa, fmt, 0, trampoline_buf, trampoline_slotbuf);
++ xtensa_insnbuf_to_chars (isa, trampoline_buf, (unsigned char *)fragP->fr_literal + offset, 3);
++ fragP->fr_fix += 3;
++ fragP->fr_var -= 3;
++ /* Add a fix-up for the original j insn. */
++ newfixP = fix_new (fP, fixP->fx_where, fixP->fx_size, lsym, fragP->fr_fix - 3, TRUE, fixP->fx_r_type);
++ newfixP->fx_no_overflow = 1;
++ newfixP->tc_fix_data.X_add_symbol = lsym;
++ newfixP->tc_fix_data.X_add_number = offset;
++ newfixP->tc_fix_data.slot = slot;
++ /* Move the fix-up from the original j insn to this one. */
++ fixP->fx_frag = fragP;
++ fixP->fx_where = fragP->fr_fix - 3;
++ fixP->tc_fix_data.slot = 0;
++ /* Adjust the jump around this trampoline (if present). */
++ if (tf->fixP != NULL)
++ {
++ tf->fixP->fx_offset += 3;
++ }
++ new_stretch += 3;
++ fragP->tc_frag_data.relax_seen = FALSE; /* Need another pass. */
++ /* Do we have room for more? */
++ if (fragP->fr_var < 3)
++ { /* No, convert to fill. */
++ frag_wane (fragP);
++ fragP->fr_subtype = 0;
++ /* Remove from the trampoline_list. */
++ prev->next = tf->next;
++ break;
++ }
++ }
++ }
++ }
++ }
++ }
++ break;
++
+ default:
+ as_bad (_("bad relaxation state"));
+ }
+@@ -9146,6 +9472,200 @@ bytes_to_stretch (fragS *this_frag,
+ }
+
+
++static struct trampoline_frag *
++search_trampolines (TInsn *tinsn, fragS *fragP, bfd_boolean unreachable_only)
++{
++ struct trampoline_seg *ts = find_trampoline_seg (now_seg);
++ struct trampoline_frag *tf = (ts) ? ts->trampoline_list.next : NULL;
++ struct trampoline_frag *best_tf = NULL;
++ int best_delta = 0;
++ int best_addr = 0;
++ symbolS *sym = tinsn->tok[0].X_add_symbol;
++ offsetT target = S_GET_VALUE (sym) + tinsn->tok[0].X_add_number;
++ offsetT addr = fragP->fr_address;
++ offsetT lower = (addr < target) ? addr : target;
++ offsetT upper = (addr > target) ? addr : target;
++ int delta = upper - lower;
++ offsetT midpoint = lower + delta / 2;
++ int this_delta = -1;
++ int this_addr = -1;
++
++ if (delta > 2 * J_RANGE)
++ {
++ /* One trampoline won't do; we need multiple.
++ Choose the farthest trampoline that's still in range of the original
++ and let a later pass finish the job. */
++ for ( ; tf; tf = tf->next)
++ {
++ int next_addr = (tf->next) ? tf->next->fragP->fr_address + tf->next->fragP->fr_fix : 0;
++
++ this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ if (lower == addr)
++ {
++ /* Forward jump. */
++ if (this_addr - addr < J_RANGE)
++ break;
++ }
++ else
++ {
++ /* Backward jump. */
++ if (next_addr == 0 || addr - next_addr > J_RANGE)
++ break;
++ }
++ if (abs (addr - this_addr) < J_RANGE)
++ return tf;
++
++ return NULL;
++ }
++ }
++ for ( ; tf; tf = tf->next)
++ {
++ this_addr = tf->fragP->fr_address + tf->fragP->fr_fix;
++ this_delta = abs (this_addr - midpoint);
++ if (unreachable_only && tf->needs_jump_around)
++ continue;
++ if (!best_tf || this_delta < best_delta)
++ {
++ best_tf = tf;
++ best_delta = this_delta;
++ best_addr = this_addr;
++ }
++ }
++
++ if (best_tf &&
++ best_delta < J_RANGE &&
++ abs(best_addr - lower) < J_RANGE &&
++ abs(best_addr - upper) < J_RANGE)
++ return best_tf;
++
++ return NULL; /* No suitable trampoline found. */
++}
++
++
++static struct trampoline_frag *
++get_best_trampoline (TInsn *tinsn, fragS *fragP)
++{
++ struct trampoline_frag *tf = NULL;
++
++ tf = search_trampolines (tinsn, fragP, TRUE); /* Try unreachable first. */
++
++ if (tf == NULL)
++ tf = search_trampolines (tinsn, fragP, FALSE); /* Try ones needing a jump-around, too. */
++
++ return tf;
++}
++
++
++static void
++check_and_update_trampolines (void)
++{
++ struct trampoline_seg *ts = find_trampoline_seg (now_seg);
++ struct trampoline_frag *tf = ts->trampoline_list.next;
++ struct trampoline_frag *prev = &ts->trampoline_list;
++
++ for ( ; tf; prev = tf, tf = tf->next)
++ {
++ if (tf->fragP->fr_var < 3)
++ {
++ frag_wane (tf->fragP);
++ prev->next = tf->next;
++ tf->fragP = NULL;
++ }
++ }
++}
++
++
++static int
++init_trampoline_frag (struct trampoline_frag *trampP)
++{
++ fragS *fp = trampP->fragP;
++ int growth = 0;
++
++ if (fp->fr_fix == 0)
++ {
++ symbolS *lsym;
++ char label[10 + 2 * sizeof(fp)];
++ sprintf (label, ".L0_TR_%p", fp);
++
++ lsym = (symbolS *)local_symbol_make (label, now_seg, 0, fp);
++ fp->fr_symbol = lsym;
++ if (trampP->needs_jump_around)
++ {
++ /* Add a jump around this block of jumps, in case
++ control flows into this block. */
++ fixS *fixP;
++ TInsn insn;
++ xtensa_format fmt;
++ xtensa_isa isa = xtensa_default_isa;
++
++ fp->tc_frag_data.is_insn = 1;
++ /* Assemble a jump insn. */
++ tinsn_init (&insn);
++ insn.insn_type = ITYPE_INSN;
++ insn.opcode = xtensa_j_opcode;
++ insn.ntok = 1;
++ set_expr_symbol_offset (&insn.tok[0], lsym, 3);
++ fmt = xg_get_single_format (xtensa_j_opcode);
++ tinsn_to_slotbuf (fmt, 0, &insn, trampoline_slotbuf);
++ xtensa_format_set_slot (isa, fmt, 0, trampoline_buf, trampoline_slotbuf);
++ xtensa_insnbuf_to_chars (isa, trampoline_buf, (unsigned char *)fp->fr_literal, 3);
++ fp->fr_fix += 3;
++ fp->fr_var -= 3;
++ growth = 3;
++ fixP = fix_new (fp, 0, 3, lsym, 3, TRUE, BFD_RELOC_XTENSA_SLOT0_OP);
++ trampP->fixP = fixP;
++ }
++ }
++ return growth;
++}
++
++
++static int
++add_jump_to_trampoline (struct trampoline_frag *trampP, fragS *origfrag)
++{
++ fragS *tramp = trampP->fragP;
++ fixS *fixP;
++ int offset = tramp->fr_fix; /* Where to assemble the j insn. */
++ TInsn insn;
++ symbolS *lsym;
++ symbolS *tsym;
++ int toffset;
++ xtensa_format fmt;
++ xtensa_isa isa = xtensa_default_isa;
++ int growth = 0;
++
++ lsym = tramp->fr_symbol;
++ /* Assemble a jump to the target label in the trampoline frag. */
++ tsym = origfrag->tc_frag_data.slot_symbols[0];
++ toffset = origfrag-> tc_frag_data.slot_offsets[0];
++ tinsn_init (&insn);
++ insn.insn_type = ITYPE_INSN;
++ insn.opcode = xtensa_j_opcode;
++ insn.ntok = 1;
++ set_expr_symbol_offset (&insn.tok[0], tsym, toffset);
++ fmt = xg_get_single_format (xtensa_j_opcode);
++ tinsn_to_slotbuf (fmt, 0, &insn, trampoline_slotbuf);
++ xtensa_format_set_slot (isa, fmt, 0, trampoline_buf, trampoline_slotbuf);
++ xtensa_insnbuf_to_chars (isa, trampoline_buf, (unsigned char *)tramp->fr_literal + offset, 3);
++ tramp->fr_fix += 3;
++ tramp->fr_var -= 3;
++ growth = 3;
++ /* add a fix-up for the trampoline jump. */
++ fixP = fix_new (tramp, tramp->fr_fix - 3, 3, tsym, toffset, TRUE, BFD_RELOC_XTENSA_SLOT0_OP);
++ /* Modify the jump at the start of this trampoline to point past the newly-added jump. */
++ fixP = trampP->fixP;
++ if (fixP)
++ fixP->fx_offset += 3;
++ /* Modify the original j to point here. */
++ origfrag->tc_frag_data.slot_symbols[0] = lsym;
++ origfrag->tc_frag_data.slot_offsets[0] = tramp->fr_fix - 3;
++ /* If trampoline is full, remove it from the list. */
++ check_and_update_trampolines ();
++
++ return growth;
++}
++
++
+ static long
+ relax_frag_immed (segT segP,
+ fragS *fragP,
+@@ -9284,6 +9804,37 @@ relax_frag_immed (segT segP,
+ if (negatable_branch && istack.ninsn > 1)
+ update_next_frag_state (fragP);
+
++ /* If last insn is a jump, and it cannot reach its target, try to find a trampoline. */
++ if (istack.ninsn > 2 &&
++ istack.insn[istack.ninsn - 1].insn_type == ITYPE_LABEL &&
++ istack.insn[istack.ninsn - 2].insn_type == ITYPE_INSN &&
++ istack.insn[istack.ninsn - 2].opcode == xtensa_j_opcode)
++ {
++ TInsn *jinsn = &istack.insn[istack.ninsn - 2];
++
++ if (!xg_symbolic_immeds_fit (jinsn, segP, fragP, fragP->fr_offset, total_text_diff))
++ {
++ struct trampoline_frag *tf = get_best_trampoline (jinsn, fragP);
++
++ if (tf)
++ {
++ this_text_diff += init_trampoline_frag (tf);
++ this_text_diff += add_jump_to_trampoline (tf, fragP);
++ }
++ else
++ {
++ /* If target symbol is undefined, assume it will reach once linked. */
++ expressionS *exp = &istack.insn[istack.ninsn - 2].tok[0];
++
++ if (exp->X_op == O_symbol && S_IS_DEFINED (exp->X_add_symbol))
++ {
++ as_bad_where (fragP->fr_file, fragP->fr_line,
++ _("jump target out of range; no usable trampoline found"));
++ }
++ }
++ }
++ }
++
+ return this_text_diff;
+ }
+
+@@ -9404,6 +9955,9 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragp)
+ else
+ as_bad (_("invalid relaxation fragment result"));
+ break;
++
++ case RELAX_TRAMPOLINE:
++ break;
+ }
+
+ fragp->fr_var = 0;
+diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h
+index 0bf1240..4672bc6 100644
+--- a/gas/config/tc-xtensa.h
++++ b/gas/config/tc-xtensa.h
+@@ -180,6 +180,11 @@ enum xtensa_relax_statesE
+ prevent the linker from changing the size of any frag between the
+ section start and the org frag. */
+
++ RELAX_TRAMPOLINE,
++ /* Every few thousand frags, we insert one of these, just in case we may
++ need some space for a trampoline (jump to a jump) because the function
++ has gotten too big. If not needed, it disappears. */
++
+ RELAX_NONE
+ };
+
+diff --git a/gas/frags.c b/gas/frags.c
+index 5f68480..e14099d 100644
+--- a/gas/frags.c
++++ b/gas/frags.c
+@@ -24,6 +24,20 @@
+
+ extern fragS zero_address_frag;
+ extern fragS predefined_address_frag;
++
++static int totalfrags;
++
++int
++get_frag_count (void)
++{
++ return totalfrags;
++}
++
++void
++clear_frag_count (void)
++{
++ totalfrags = 0;
++}
+
+ /* Initialization for frag routines. */
+
+@@ -70,6 +84,7 @@ frag_alloc (struct obstack *ob)
+ ptr = (fragS *) obstack_alloc (ob, SIZEOF_STRUCT_FRAG);
+ obstack_alignment_mask (ob) = oalign;
+ memset (ptr, 0, SIZEOF_STRUCT_FRAG);
++ totalfrags++;
+ return ptr;
+ }
+
+diff --git a/gas/frags.h b/gas/frags.h
+index 319898f..2f9e1b5 100644
+--- a/gas/frags.h
++++ b/gas/frags.h
+@@ -155,4 +155,7 @@ char *frag_var (relax_stateT type,
+
+ bfd_boolean frag_offset_fixed_p (const fragS *, const fragS *, offsetT *);
+
++int get_frag_count (void);
++void clear_frag_count (void);
++
+ #endif /* FRAGS_H */
+diff --git a/gas/testsuite/gas/xtensa/all.exp b/gas/testsuite/gas/xtensa/all.exp
+index 2b2c294..3683b78 100644
+--- a/gas/testsuite/gas/xtensa/all.exp
++++ b/gas/testsuite/gas/xtensa/all.exp
+@@ -98,6 +98,7 @@ if [istarget xtensa*-*-*] then {
+ run_dump_test "pcrel"
+ run_dump_test "weak-call"
+ run_dump_test "jlong"
++ run_dump_test "trampoline"
+ }
+
+ if [info exists errorInfo] then {
+diff --git a/gas/testsuite/gas/xtensa/trampoline.d b/gas/testsuite/gas/xtensa/trampoline.d
+new file mode 100644
+index 0000000..b4f65dc
+--- /dev/null
++++ b/gas/testsuite/gas/xtensa/trampoline.d
+@@ -0,0 +1,26 @@
++#as:
++#objdump: -d
++#name: trampolines relaxation
++
++.*: +file format .*xtensa.*
++#...
++.*0:.*j.0x1194c
++.*3:.*j.0x1194f
++.*6:.*j.0x11952
++.*9:.*j.0x1d4e4
++#...
++.*11949:.*j.0x11955
++.*1194c:.*j.0x24a0e
++.*1194f:.*j.0x24a0e
++.*11952:.*j.0x24a11
++#...
++.*1d4e1:.*j.0x1d4e7
++.*1d4e4:.*j.0x33462
++#...
++.*24a0e:.*j.0x24a0e
++.*24a11:.*j.0x24a11
++#...
++.*3345f:.*ret
++.*33462:.*j.0x49407
++#...
++.*49407:.*j.0x49407
+diff --git a/gas/testsuite/gas/xtensa/trampoline.s b/gas/testsuite/gas/xtensa/trampoline.s
+new file mode 100644
+index 0000000..259a3bb
+--- /dev/null
++++ b/gas/testsuite/gas/xtensa/trampoline.s
+@@ -0,0 +1,21 @@
++ .text
++ j 1f
++ j 1f
++ j 2f
++ j 3f
++ .rep 25000
++99:
++ and a2, a2, a3
++ bne a2, a3, 99b
++ .endr
++1:
++ j 1b
++2:
++ j 2b
++
++ .rep 25000
++ and a2, a2, a3
++ _ret
++ .endr
++3:
++ j 3b
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/901-xtensa-gas-first-frag-alignment.patch b/patches/binutils/2.24/901-xtensa-gas-first-frag-alignment.patch
new file mode 100644
index 0000000..e1c2d85
--- /dev/null
+++ b/patches/binutils/2.24/901-xtensa-gas-first-frag-alignment.patch
@@ -0,0 +1,51 @@
+From a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Tue, 15 Apr 2014 19:12:46 +0400
+Subject: [PATCH] Fix alignment for the first section frag on xtensa
+
+Linking object files produced by partial linking with link-time
+relaxation enabled sometimes fails with the following error message:
+
+dangerous relocation: call8: misaligned call target: (.text.unlikely+0x63)
+
+This happens because no basic block with an XTENSA_PROP_ALIGN flag in the
+property table is generated for the first basic block, even if the
+.align directive is present.
+It was believed that the first frag alignment could be derived from the
+section alignment, but this was not implemented for the partial linking
+case: after partial linking first frag of a section may become not
+first, but no additional alignment frag is inserted before it.
+Basic block for such frag may be merged with previous basic block into
+extended basic block during relaxation pass losing its alignment
+restrictions.
+
+Fix this by always recording alignment for the first section frag.
+
+2014-04-22 Max Filippov <jcmvbkbc@gmail.com>
+
+gas/
+ * config/tc-xtensa.c (xtensa_handle_align): record alignment for the
+ first section frag.
+
+---
+Backported from: a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1
+Changes to Changelog files and tests are dropped.
+
+ gas/config/tc-xtensa.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index ea23c96..58ace38 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -5609,7 +5609,6 @@ xtensa_handle_align (fragS *fragP)
+ && ! fragP->tc_frag_data.is_literal
+ && (fragP->fr_type == rs_align
+ || fragP->fr_type == rs_align_code)
+- && fragP->fr_address + fragP->fr_fix > 0
+ && fragP->fr_offset > 0
+ && now_seg != bss_section)
+ {
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/902-xtensa-gas-ld-diff-relocation-signed.patch b/patches/binutils/2.24/902-xtensa-gas-ld-diff-relocation-signed.patch
new file mode 100644
index 0000000..ba24f4e
--- /dev/null
+++ b/patches/binutils/2.24/902-xtensa-gas-ld-diff-relocation-signed.patch
@@ -0,0 +1,133 @@
+From 6a17eba5358549d0d6d195bb22b34cdbc068def2 Mon Sep 17 00:00:00 2001
+From: Volodymyr Arbatov <arbatov@cadence.com>
+Date: Mon, 6 May 2013 09:43:21 -0800
+Subject: [PATCH] Use signed data type for R_XTENSA_DIFF* relocation offsets.
+
+R_XTENSA_DIFF relocation offsets are in fact signed. Treat them as such.
+Add testcase that examines ld behaviour on R_XTENSA_DIFF relocation
+changing sign during relaxation.
+
+2014-05-02 Volodymyr Arbatov <arbatov@cadence.com>
+ David Weatherford <weath@cadence.com>
+ Max Filippov <jcmvbkbc@gmail.com>
+
+bfd/
+ * elf32-xtensa.c (relax_section): treat R_XTENSA_DIFF* relocations as
+ signed.
+
+gas/
+ * config/tc-xtensa.c (md_apply_fix): mark BFD_RELOC_XTENSA_DIFF*
+ fixups as signed.
+---
+Backported from: 1058c7532d0b012ac329219264ddad59049fb6e6
+Changes to Changelog files and tests are dropped.
+
+ bfd/elf32-xtensa.c | 32 ++++++++++++-----------
+ gas/config/tc-xtensa.c | 3 +++
+ 2 files changed, 20 insertions(+), 15 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index edb04b4..8818d67 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -222,11 +222,11 @@ static reloc_howto_type elf_howto_table[] =
+ FALSE, 0, 0, FALSE),
+
+ /* Relocations for supporting difference of symbols. */
+- HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
++ HOWTO (R_XTENSA_DIFF8, 0, 0, 8, FALSE, 0, complain_overflow_signed,
+ bfd_elf_xtensa_reloc, "R_XTENSA_DIFF8", FALSE, 0, 0xff, FALSE),
+- HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
++ HOWTO (R_XTENSA_DIFF16, 0, 1, 16, FALSE, 0, complain_overflow_signed,
+ bfd_elf_xtensa_reloc, "R_XTENSA_DIFF16", FALSE, 0, 0xffff, FALSE),
+- HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
++ HOWTO (R_XTENSA_DIFF32, 0, 2, 32, FALSE, 0, complain_overflow_signed,
+ bfd_elf_xtensa_reloc, "R_XTENSA_DIFF32", FALSE, 0, 0xffffffff, FALSE),
+
+ /* General immediate operand relocations. */
+@@ -9013,7 +9013,8 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ || r_type == R_XTENSA_DIFF16
+ || r_type == R_XTENSA_DIFF32)
+ {
+- bfd_vma diff_value = 0, new_end_offset, diff_mask = 0;
++ bfd_signed_vma diff_value = 0;
++ bfd_vma new_end_offset, diff_mask = 0;
+
+ if (bfd_get_section_limit (abfd, sec) < old_source_offset)
+ {
+@@ -9027,15 +9028,15 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ {
+ case R_XTENSA_DIFF8:
+ diff_value =
+- bfd_get_8 (abfd, &contents[old_source_offset]);
++ bfd_get_signed_8 (abfd, &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF16:
+ diff_value =
+- bfd_get_16 (abfd, &contents[old_source_offset]);
++ bfd_get_signed_16 (abfd, &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF32:
+ diff_value =
+- bfd_get_32 (abfd, &contents[old_source_offset]);
++ bfd_get_signed_32 (abfd, &contents[old_source_offset]);
+ break;
+ }
+
+@@ -9047,24 +9048,25 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ switch (r_type)
+ {
+ case R_XTENSA_DIFF8:
+- diff_mask = 0xff;
+- bfd_put_8 (abfd, diff_value,
++ diff_mask = 0x7f;
++ bfd_put_signed_8 (abfd, diff_value,
+ &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF16:
+- diff_mask = 0xffff;
+- bfd_put_16 (abfd, diff_value,
++ diff_mask = 0x7fff;
++ bfd_put_signed_16 (abfd, diff_value,
+ &contents[old_source_offset]);
+ break;
+ case R_XTENSA_DIFF32:
+- diff_mask = 0xffffffff;
+- bfd_put_32 (abfd, diff_value,
++ diff_mask = 0x7fffffff;
++ bfd_put_signed_32 (abfd, diff_value,
+ &contents[old_source_offset]);
+ break;
+ }
+
+- /* Check for overflow. */
+- if ((diff_value & ~diff_mask) != 0)
++ /* Check for overflow. Sign bits must be all zeroes or all ones */
++ if ((diff_value & ~diff_mask) != 0 &&
++ (diff_value & ~diff_mask) != (-1 & ~diff_mask))
+ {
+ (*link_info->callbacks->reloc_dangerous)
+ (link_info, _("overflow after relaxation"),
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index 58ace38..7547c0a0 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -5867,12 +5867,15 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
+ {
+ case BFD_RELOC_8:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF8;
++ fixP->fx_signed = 1;
+ break;
+ case BFD_RELOC_16:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF16;
++ fixP->fx_signed = 1;
+ break;
+ case BFD_RELOC_32:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF32;
++ fixP->fx_signed = 1;
+ break;
+ default:
+ break;
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch b/patches/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
new file mode 100644
index 0000000..6a0846e
--- /dev/null
+++ b/patches/binutils/2.24/903-xtensa-fix-ld-segfault-when-linking-linux-modules.patch
@@ -0,0 +1,47 @@
+From e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 10 Jul 2014 01:47:33 +0400
+Subject: [PATCH] Fix xtensa ld segfault when linking linux modules
+
+is_inconsistent_linkonce_section makes an assumption that section name
+that starts with ".gnu.linkonce.prop." has one more dot in its suffix.
+However gas generates such section name by insertion of "prop." right
+after ".gnu.linkonce." part of the name of the original section. So, for
+section named ".gnu.linkonce.this_module" corresponding property section
+name does not satisfy the assumption. Such section names are common in
+linux modules. This bug was exposed by the patch "a35d5e8 Fix alignment
+for the first section frag on xtensa", that makes gas produce property
+section for each section that has ".align" directive in it.
+
+Use suffix that immediately follows ".gnu.linkonce.prop." when there are
+no more dots following it.
+
+2014-07-10 Max Filippov <jcmvbkbc@gmail.com>
+
+ld/
+ * emultempl/xtensaelf.em (is_inconsistent_linkonce_section):
+ correctly handle missing dot in section name after
+ ".gnu.linkonce.prop.".
+---
+Backported from: e7d17e71cdc10a2e81e454ce3b9637f1b2a587f2
+Changes to ld/ChangeLog file are dropped.
+
+ ld/emultempl/xtensaelf.em | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em
+index 151eea4..948d18d 100644
+--- a/ld/emultempl/xtensaelf.em
++++ b/ld/emultempl/xtensaelf.em
+@@ -1310,7 +1310,7 @@ is_inconsistent_linkonce_section (asection *sec)
+ for Tensilica's XCC compiler. */
+ name = sec_name + linkonce_len;
+ if (CONST_STRNEQ (name, "prop."))
+- name = strchr (name + 5, '.') + 1;
++ name = strchr (name + 5, '.') ? strchr (name + 5, '.') + 1 : name + 5;
+ else if (name[1] == '.'
+ && (name[0] == 'p' || name[0] == 'e' || name[0] == 'h'))
+ name += 2;
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch b/patches/binutils/2.24/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch
new file mode 100644
index 0000000..e4c600e
--- /dev/null
+++ b/patches/binutils/2.24/904-Fix-call8-call-target-out-of-range-xtensa-ld-relaxation.patch
@@ -0,0 +1,79 @@
+From 7fc39194f8fb48914c995f8ec3826d50086f1ec0 Mon Sep 17 00:00:00 2001
+From: Sterling Augustine <augustine.sterling@gmail.com>
+Date: Tue, 25 Jan 2011 13:59:13 -0800
+Subject: [PATCH] Fix 'call8: call target out of range' xtensa ld relaxation
+ bug
+
+During link-time relaxation distance between cross-section call site and
+its target may grow, producing 'call target out of range' error for
+relaxed calls. Be more conservative when calculating whether or not a
+callx can be converted to a straight call.
+
+2014-09-23 Sterling Augustine <augustine.sterling@gmail.com>
+
+bfd/
+ * elf32-xtensa.c (is_resolvable_asm_expansion): for cross-section
+ call relaxation use furthermost addresses where call source and
+ destination can be to check whether it's in the range of a direct
+ call.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 41 +++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 09862e3..e32496a 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -7124,10 +7124,43 @@ is_resolvable_asm_expansion (bfd *abfd,
+ || is_reloc_sym_weak (abfd, irel)))
+ return FALSE;
+
+- self_address = (sec->output_section->vma
+- + sec->output_offset + irel->r_offset + 3);
+- dest_address = (target_sec->output_section->vma
+- + target_sec->output_offset + target_offset);
++ if (target_sec->output_section != sec->output_section)
++ {
++ /* If the two sections are sufficiently far away that relaxation
++ might take the call out of range, we can't simplify. For
++ example, a positive displacement call into another memory
++ could get moved to a lower address due to literal removal,
++ but the destination won't move, and so the displacment might
++ get larger.
++
++ If the displacement is negative, assume the destination could
++ move as far back as the start of the output section. The
++ self_address will be at least as far into the output section
++ as it is prior to relaxation.
++
++ If the displacement is postive, assume the destination will be in
++ it's pre-relaxed location (because relaxation only makes sections
++ smaller). The self_address could go all the way to the beginning
++ of the output section. */
++
++ dest_address = target_sec->output_section->vma;
++ self_address = sec->output_section->vma;
++
++ if (sec->output_section->vma > target_sec->output_section->vma)
++ self_address += sec->output_offset + irel->r_offset + 3;
++ else
++ dest_address += bfd_get_section_limit (abfd, target_sec->output_section);
++ /* Call targets should be four-byte aligned. */
++ dest_address = (dest_address + 3) & ~3;
++ }
++ else
++ {
++
++ self_address = (sec->output_section->vma
++ + sec->output_offset + irel->r_offset + 3);
++ dest_address = (target_sec->output_section->vma
++ + target_sec->output_offset + target_offset);
++ }
+
+ *is_reachable_p = pcrel_reloc_fits (direct_call_opcode, 0,
+ self_address, dest_address);
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/905-Fix-trampolines-search-code-for-conditional-branches.patch b/patches/binutils/2.24/905-Fix-trampolines-search-code-for-conditional-branches.patch
new file mode 100644
index 0000000..8aeb064
--- /dev/null
+++ b/patches/binutils/2.24/905-Fix-trampolines-search-code-for-conditional-branches.patch
@@ -0,0 +1,90 @@
+From 415480d6471e67aef97c0241d451ef2423a1da9d Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Tue, 25 Nov 2014 21:33:21 +0300
+Subject: [PATCH] Fix trampolines search code for conditional branches
+
+For conditional branches that need more than one trampoline to reach its
+target assembler couldn't always find suitable trampoline because
+post-loop condition check was placed inside the loop, resulting in
+premature loop termination. Move check outside the loop.
+
+This fixes the following build errors seen when assembling huge files
+produced by gcc:
+ Error: jump target out of range; no usable trampoline found
+ Error: operand 1 of 'j' has out of range value '307307'
+
+2014-11-25 Max Filippov <jcmvbkbc@gmail.com>
+
+gas/
+ * config/tc-xtensa.c (search_trampolines): Move post-loop
+ condition check outside the search loop.
+
+gas/testsuite/
+ * gas/xtensa/trampoline.d: Add expected output for branches.
+ * gas/xtensa/trampoline.s: Add test case for branches.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: d92b6eece424f0ad35d96fdd85bf207295e8c4c3
+Changes to ChangeLogs are dropped.
+
+ gas/config/tc-xtensa.c | 8 ++++----
+ gas/testsuite/gas/xtensa/trampoline.d | 9 +++++++++
+ gas/testsuite/gas/xtensa/trampoline.s | 7 +++++++
+ 3 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index d11b0c7..f23ccf8 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -9514,11 +9514,11 @@ search_trampolines (TInsn *tinsn, fragS *fragP, bfd_boolean unreachable_only)
+ if (next_addr == 0 || addr - next_addr > J_RANGE)
+ break;
+ }
+- if (abs (addr - this_addr) < J_RANGE)
+- return tf;
+-
+- return NULL;
+ }
++ if (abs (addr - this_addr) < J_RANGE)
++ return tf;
++
++ return NULL;
+ }
+ for ( ; tf; tf = tf->next)
+ {
+diff --git a/gas/testsuite/gas/xtensa/trampoline.d b/gas/testsuite/gas/xtensa/trampoline.d
+index b4f65dc..5ae32a6 100644
+--- a/gas/testsuite/gas/xtensa/trampoline.d
++++ b/gas/testsuite/gas/xtensa/trampoline.d
+@@ -24,3 +24,12 @@
+ .*33462:.*j.0x49407
+ #...
+ .*49407:.*j.0x49407
++.*4940a:.*beqz.n.a2,.0x4940f
++.*4940c:.*j.0x693d1
++#...
++.*693d1:.*j.0x7ddd4
++#...
++.*7ddd4:.*j.0x927f5
++#...
++.*927f5:.*j.0x927f5
++#...
+diff --git a/gas/testsuite/gas/xtensa/trampoline.s b/gas/testsuite/gas/xtensa/trampoline.s
+index 259a3bb..4465786 100644
+--- a/gas/testsuite/gas/xtensa/trampoline.s
++++ b/gas/testsuite/gas/xtensa/trampoline.s
+@@ -19,3 +19,10 @@
+ .endr
+ 3:
+ j 3b
++ bnez a2, 4f
++ .rep 50000
++ and a2, a2, a3
++ _ret
++ .endr
++4:
++ j 4b
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/906-xtensa-optimize-check_section_ebb_pcrels_fit.patch b/patches/binutils/2.24/906-xtensa-optimize-check_section_ebb_pcrels_fit.patch
new file mode 100644
index 0000000..8a21100
--- /dev/null
+++ b/patches/binutils/2.24/906-xtensa-optimize-check_section_ebb_pcrels_fit.patch
@@ -0,0 +1,502 @@
+From 20c79baf82273a0b368587f761f152c4d3a593a4 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Fri, 27 Mar 2015 07:13:55 +0300
+Subject: [PATCH 1/4] xtensa: optimize check_section_ebb_pcrels_fit
+
+The original check_section_ebb_pcrels_fit algorithm checks that text
+actions proposed for current EBB are OK for every relocation in a
+section. There's no need to check every relocation, because text actions
+for EBB can only change size of that EBB, thus only affecting
+relocations that in any way cross that EBB. In addition EBBs are
+iterated in ascending order of their VMA, making it easier to track
+relevant relocations.
+
+Introduce a structure that can track relocations that cross the range of
+VMAs of EBB and use it to only check relocations relevant to current EBB
+in check_section_ebb_pcrels_fit.
+It takes O(N log N) operations to build it and O(N) operations to move
+current EBB VMA window through its entire range, where N is the number
+of relocations in a section. The resulting complexity of
+compute_text_actions is thus reduced from O(N^2) to O(N log N + N * M),
+where M is the average number of relocations crossing each EBB.
+
+Original profile:
+
+% time self children called name
+-----------------------------------------
+ 44.26 71.53 6429/6429 compute_text_actions
+ 50.2 44.26 71.53 6429 check_section_ebb_pcrels_fit
+ 1.16 20.12 347506666/347576152 pcrel_reloc_fits
+ 2.95 16.52 347506666/348104944 get_relocation_opnd
+ 2.01 9.74 347575100/361252208 r_reloc_init
+ 0.55 7.53 347575100/363381467 r_reloc_get_section
+ 5.76 0.02 695013332/695013332 xlate_offset_with_removed_text
+ 0.68 3.89 347575100/363483827 bfd_octets_per_byte
+ 0.32 0.00 347506666/349910253 is_alt_relocation
+ 0.18 0.11 6391/6391 build_xlate_map
+ 0.00 0.00 6429/19417168 get_xtensa_relax_info
+ 0.00 0.00 6391/6391 free_xlate_map
+-----------------------------------------
+
+Same data, after optimization:
+
+% time self children called name
+-----------------------------------------
+ 2.56 3.08 6429/6429 compute_text_actions
+ 8.2 2.56 3.08 6429 check_section_ebb_pcrels_fit
+ 0.08 0.91 17721075/17790561 pcrel_reloc_fits
+ 0.17 0.47 17721075/31685977 r_reloc_init
+ 0.43 0.00 35442150/35442150 xlate_offset_with_removed_text
+ 0.02 0.37 17721075/33815236 r_reloc_get_section
+ 0.22 0.11 6391/6391 build_xlate_map
+ 0.05 0.22 17721075/33917596 bfd_octets_per_byte
+ 0.03 0.00 17721075/20405299 is_alt_relocation
+ 0.01 0.00 6429/6429 reloc_range_list_update_range
+ 0.00 0.00 6429/19417168 get_xtensa_relax_info
+ 0.00 0.00 6391/6391 free_xlate_map
+-----------------------------------------
+
+2015-04-01 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (reloc_range_list, reloc_range_list_entry,
+ reloc_range): new typedef.
+ (reloc_range_list_struct, reloc_range_list_entry_struct,
+ reloc_range_struct): new structures.
+ (reloc_range_compare, build_reloc_ranges,
+ reloc_range_list_append, reloc_range_list_remove,
+ reloc_range_list_update_range, free_reloc_range_list): new
+ functions.
+ (compute_text_actions): precompute relocation opcodes before the
+ loop. Add relevant_relocs variable, initialize it before the
+ loop, pass it to the check_section_ebb_pcrels_fit.
+ (check_section_ebb_pcrels_fit): add new parameter:
+ relevant_relocs. Update address range in the relevant_relocs if
+ it's non-NULL and iterate only over relevant relocations.
+
+Backported from: b2b326d246f839ee218192ac88da2384d929a072
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 321 +++++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 298 insertions(+), 23 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 0b6f584..872370b 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -6619,8 +6619,10 @@ static bfd_boolean compute_text_actions
+ (bfd *, asection *, struct bfd_link_info *);
+ static bfd_boolean compute_ebb_proposed_actions (ebb_constraint *);
+ static bfd_boolean compute_ebb_actions (ebb_constraint *);
++typedef struct reloc_range_list_struct reloc_range_list;
+ static bfd_boolean check_section_ebb_pcrels_fit
+- (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, const ebb_constraint *,
++ (bfd *, asection *, bfd_byte *, Elf_Internal_Rela *,
++ reloc_range_list *, const ebb_constraint *,
+ const xtensa_opcode *);
+ static bfd_boolean check_section_ebb_reduces (const ebb_constraint *);
+ static void text_action_add_proposed
+@@ -7219,6 +7221,221 @@ build_reloc_opcodes (bfd *abfd,
+ return reloc_opcodes;
+ }
+
++struct reloc_range_struct
++{
++ bfd_vma addr;
++ bfd_boolean add; /* TRUE if start of a range, FALSE otherwise. */
++ /* Original irel index in the array of relocations for a section. */
++ unsigned irel_index;
++};
++typedef struct reloc_range_struct reloc_range;
++
++typedef struct reloc_range_list_entry_struct reloc_range_list_entry;
++struct reloc_range_list_entry_struct
++{
++ reloc_range_list_entry *next;
++ reloc_range_list_entry *prev;
++ Elf_Internal_Rela *irel;
++ xtensa_opcode opcode;
++ int opnum;
++};
++
++struct reloc_range_list_struct
++{
++ /* The rest of the structure is only meaningful when ok is TRUE. */
++ bfd_boolean ok;
++
++ unsigned n_range; /* Number of range markers. */
++ reloc_range *range; /* Sorted range markers. */
++
++ unsigned first; /* Index of a first range element in the list. */
++ unsigned last; /* One past index of a last range element in the list. */
++
++ unsigned n_list; /* Number of list elements. */
++ reloc_range_list_entry *reloc; /* */
++ reloc_range_list_entry list_root;
++};
++
++static int
++reloc_range_compare (const void *a, const void *b)
++{
++ const reloc_range *ra = a;
++ const reloc_range *rb = b;
++
++ if (ra->addr != rb->addr)
++ return ra->addr < rb->addr ? -1 : 1;
++ if (ra->add != rb->add)
++ return ra->add ? -1 : 1;
++ return 0;
++}
++
++static void
++build_reloc_ranges (bfd *abfd, asection *sec,
++ bfd_byte *contents,
++ Elf_Internal_Rela *internal_relocs,
++ xtensa_opcode *reloc_opcodes,
++ reloc_range_list *list)
++{
++ unsigned i;
++ size_t n = 0;
++ size_t max_n = 0;
++ reloc_range *ranges = NULL;
++ reloc_range_list_entry *reloc =
++ bfd_malloc (sec->reloc_count * sizeof (*reloc));
++
++ memset (list, 0, sizeof (*list));
++ list->ok = TRUE;
++
++ for (i = 0; i < sec->reloc_count; i++)
++ {
++ Elf_Internal_Rela *irel = &internal_relocs[i];
++ int r_type = ELF32_R_TYPE (irel->r_info);
++ reloc_howto_type *howto = &elf_howto_table[r_type];
++ r_reloc r_rel;
++
++ if (r_type == R_XTENSA_ASM_SIMPLIFY
++ || r_type == R_XTENSA_32_PCREL
++ || !howto->pc_relative)
++ continue;
++
++ r_reloc_init (&r_rel, abfd, irel, contents,
++ bfd_get_section_limit (abfd, sec));
++
++ if (r_reloc_get_section (&r_rel) != sec)
++ continue;
++
++ if (n + 2 > max_n)
++ {
++ max_n = (max_n + 2) * 2;
++ ranges = bfd_realloc (ranges, max_n * sizeof (*ranges));
++ }
++
++ ranges[n].addr = irel->r_offset;
++ ranges[n + 1].addr = r_rel.target_offset;
++
++ ranges[n].add = ranges[n].addr < ranges[n + 1].addr;
++ ranges[n + 1].add = !ranges[n].add;
++
++ ranges[n].irel_index = i;
++ ranges[n + 1].irel_index = i;
++
++ n += 2;
++
++ reloc[i].irel = irel;
++
++ /* Every relocation won't possibly be checked in the optimized version of
++ check_section_ebb_pcrels_fit, so this needs to be done here. */
++ if (is_alt_relocation (ELF32_R_TYPE (irel->r_info)))
++ {
++ /* None of the current alternate relocs are PC-relative,
++ and only PC-relative relocs matter here. */
++ }
++ else
++ {
++ xtensa_opcode opcode;
++ int opnum;
++
++ if (reloc_opcodes)
++ opcode = reloc_opcodes[i];
++ else
++ opcode = get_relocation_opcode (abfd, sec, contents, irel);
++
++ if (opcode == XTENSA_UNDEFINED)
++ {
++ list->ok = FALSE;
++ break;
++ }
++
++ opnum = get_relocation_opnd (opcode, ELF32_R_TYPE (irel->r_info));
++ if (opnum == XTENSA_UNDEFINED)
++ {
++ list->ok = FALSE;
++ break;
++ }
++
++ /* Record relocation opcode and opnum as we've calculated them
++ anyway and they won't change. */
++ reloc[i].opcode = opcode;
++ reloc[i].opnum = opnum;
++ }
++ }
++
++ if (list->ok)
++ {
++ ranges = bfd_realloc (ranges, n * sizeof (*ranges));
++ qsort (ranges, n, sizeof (*ranges), reloc_range_compare);
++
++ list->n_range = n;
++ list->range = ranges;
++ list->reloc = reloc;
++ list->list_root.prev = &list->list_root;
++ list->list_root.next = &list->list_root;
++ }
++ else
++ {
++ free (ranges);
++ free (reloc);
++ }
++}
++
++static void reloc_range_list_append (reloc_range_list *list,
++ unsigned irel_index)
++{
++ reloc_range_list_entry *entry = list->reloc + irel_index;
++
++ entry->prev = list->list_root.prev;
++ entry->next = &list->list_root;
++ entry->prev->next = entry;
++ entry->next->prev = entry;
++ ++list->n_list;
++}
++
++static void reloc_range_list_remove (reloc_range_list *list,
++ unsigned irel_index)
++{
++ reloc_range_list_entry *entry = list->reloc + irel_index;
++
++ entry->next->prev = entry->prev;
++ entry->prev->next = entry->next;
++ --list->n_list;
++}
++
++/* Update relocation list object so that it lists all relocations that cross
++ [first; last] range. Range bounds should not decrease with successive
++ invocations. */
++static void reloc_range_list_update_range (reloc_range_list *list,
++ bfd_vma first, bfd_vma last)
++{
++ /* This should not happen: EBBs are iterated from lower addresses to higher.
++ But even if that happens there's no need to break: just flush current list
++ and start from scratch. */
++ if ((list->last > 0 && list->range[list->last - 1].addr > last) ||
++ (list->first > 0 && list->range[list->first - 1].addr >= first))
++ {
++ list->first = 0;
++ list->last = 0;
++ list->n_list = 0;
++ list->list_root.next = &list->list_root;
++ list->list_root.prev = &list->list_root;
++ fprintf (stderr, "%s: move backwards requested\n", __func__);
++ }
++
++ for (; list->last < list->n_range &&
++ list->range[list->last].addr <= last; ++list->last)
++ if (list->range[list->last].add)
++ reloc_range_list_append (list, list->range[list->last].irel_index);
++
++ for (; list->first < list->n_range &&
++ list->range[list->first].addr < first; ++list->first)
++ if (!list->range[list->first].add)
++ reloc_range_list_remove (list, list->range[list->first].irel_index);
++}
++
++static void free_reloc_range_list (reloc_range_list *list)
++{
++ free (list->range);
++ free (list->reloc);
++}
+
+ /* The compute_text_actions function will build a list of potential
+ transformation actions for code in the extended basic block of each
+@@ -7245,6 +7462,7 @@ compute_text_actions (bfd *abfd,
+ property_table_entry *prop_table = 0;
+ int ptblsize = 0;
+ bfd_size_type sec_size;
++ reloc_range_list relevant_relocs;
+
+ relax_info = get_xtensa_relax_info (sec);
+ BFD_ASSERT (relax_info);
+@@ -7277,6 +7495,12 @@ compute_text_actions (bfd *abfd,
+ goto error_return;
+ }
+
++ /* Precompute the opcode for each relocation. */
++ reloc_opcodes = build_reloc_opcodes (abfd, sec, contents, internal_relocs);
++
++ build_reloc_ranges (abfd, sec, contents, internal_relocs, reloc_opcodes,
++ &relevant_relocs);
++
+ for (i = 0; i < sec->reloc_count; i++)
+ {
+ Elf_Internal_Rela *irel = &internal_relocs[i];
+@@ -7340,17 +7564,13 @@ compute_text_actions (bfd *abfd,
+ ebb->start_reloc_idx = i;
+ ebb->end_reloc_idx = i;
+
+- /* Precompute the opcode for each relocation. */
+- if (reloc_opcodes == NULL)
+- reloc_opcodes = build_reloc_opcodes (abfd, sec, contents,
+- internal_relocs);
+-
+ if (!extend_ebb_bounds (ebb)
+ || !compute_ebb_proposed_actions (&ebb_table)
+ || !compute_ebb_actions (&ebb_table)
+ || !check_section_ebb_pcrels_fit (abfd, sec, contents,
+- internal_relocs, &ebb_table,
+- reloc_opcodes)
++ internal_relocs,
++ &relevant_relocs,
++ &ebb_table, reloc_opcodes)
+ || !check_section_ebb_reduces (&ebb_table))
+ {
+ /* If anything goes wrong or we get unlucky and something does
+@@ -7372,6 +7592,8 @@ compute_text_actions (bfd *abfd,
+ free_ebb_constraint (&ebb_table);
+ }
+
++ free_reloc_range_list (&relevant_relocs);
++
+ #if DEBUG
+ if (relax_info->action_list.head)
+ print_action_list (stderr, &relax_info->action_list);
+@@ -7974,14 +8196,17 @@ check_section_ebb_pcrels_fit (bfd *abfd,
+ asection *sec,
+ bfd_byte *contents,
+ Elf_Internal_Rela *internal_relocs,
++ reloc_range_list *relevant_relocs,
+ const ebb_constraint *constraint,
+ const xtensa_opcode *reloc_opcodes)
+ {
+ unsigned i, j;
++ unsigned n = sec->reloc_count;
+ Elf_Internal_Rela *irel;
+ xlate_map_t *xmap = NULL;
+ bfd_boolean ok = TRUE;
+ xtensa_relax_info *relax_info;
++ reloc_range_list_entry *entry = NULL;
+
+ relax_info = get_xtensa_relax_info (sec);
+
+@@ -7992,7 +8217,40 @@ check_section_ebb_pcrels_fit (bfd *abfd,
+ can still be used. */
+ }
+
+- for (i = 0; i < sec->reloc_count; i++)
++ if (relevant_relocs && constraint->action_count)
++ {
++ if (!relevant_relocs->ok)
++ {
++ ok = FALSE;
++ n = 0;
++ }
++ else
++ {
++ bfd_vma min_offset, max_offset;
++ min_offset = max_offset = constraint->actions[0].offset;
++
++ for (i = 1; i < constraint->action_count; ++i)
++ {
++ proposed_action *action = &constraint->actions[i];
++ bfd_vma offset = action->offset;
++
++ if (offset < min_offset)
++ min_offset = offset;
++ if (offset > max_offset)
++ max_offset = offset;
++ }
++ reloc_range_list_update_range (relevant_relocs, min_offset,
++ max_offset);
++ n = relevant_relocs->n_list;
++ entry = &relevant_relocs->list_root;
++ }
++ }
++ else
++ {
++ relevant_relocs = NULL;
++ }
++
++ for (i = 0; i < n; i++)
+ {
+ r_reloc r_rel;
+ bfd_vma orig_self_offset, orig_target_offset;
+@@ -8001,7 +8259,15 @@ check_section_ebb_pcrels_fit (bfd *abfd,
+ reloc_howto_type *howto;
+ int self_removed_bytes, target_removed_bytes;
+
+- irel = &internal_relocs[i];
++ if (relevant_relocs)
++ {
++ entry = entry->next;
++ irel = entry->irel;
++ }
++ else
++ {
++ irel = internal_relocs + i;
++ }
+ r_type = ELF32_R_TYPE (irel->r_info);
+
+ howto = &elf_howto_table[r_type];
+@@ -8067,21 +8333,30 @@ check_section_ebb_pcrels_fit (bfd *abfd,
+ xtensa_opcode opcode;
+ int opnum;
+
+- if (reloc_opcodes)
+- opcode = reloc_opcodes[i];
+- else
+- opcode = get_relocation_opcode (abfd, sec, contents, irel);
+- if (opcode == XTENSA_UNDEFINED)
++ if (relevant_relocs)
+ {
+- ok = FALSE;
+- break;
++ opcode = entry->opcode;
++ opnum = entry->opnum;
+ }
+-
+- opnum = get_relocation_opnd (opcode, ELF32_R_TYPE (irel->r_info));
+- if (opnum == XTENSA_UNDEFINED)
++ else
+ {
+- ok = FALSE;
+- break;
++ if (reloc_opcodes)
++ opcode = reloc_opcodes[relevant_relocs ?
++ (unsigned)(entry - relevant_relocs->reloc) : i];
++ else
++ opcode = get_relocation_opcode (abfd, sec, contents, irel);
++ if (opcode == XTENSA_UNDEFINED)
++ {
++ ok = FALSE;
++ break;
++ }
++
++ opnum = get_relocation_opnd (opcode, ELF32_R_TYPE (irel->r_info));
++ if (opnum == XTENSA_UNDEFINED)
++ {
++ ok = FALSE;
++ break;
++ }
+ }
+
+ if (!pcrel_reloc_fits (opcode, opnum, self_offset, target_offset))
+@@ -8778,7 +9053,7 @@ move_shared_literal (asection *sec,
+ /* Check all of the PC-relative relocations to make sure they still fit. */
+ relocs_fit = check_section_ebb_pcrels_fit (target_sec->owner, target_sec,
+ target_sec_cache->contents,
+- target_sec_cache->relocs,
++ target_sec_cache->relocs, NULL,
+ &ebb_table, NULL);
+
+ if (!relocs_fit)
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/907-xtensa-optimize-removed_by_actions.patch b/patches/binutils/2.24/907-xtensa-optimize-removed_by_actions.patch
new file mode 100644
index 0000000..9df8065
--- /dev/null
+++ b/patches/binutils/2.24/907-xtensa-optimize-removed_by_actions.patch
@@ -0,0 +1,356 @@
+From 3e3f60207399ab29dd55af109e5ae9facc7d8e83 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sat, 28 Mar 2015 08:46:28 +0300
+Subject: [PATCH 2/4] xtensa: optimize removed_by_actions
+
+The function removed_by_actions iterates through text actions to
+calculate an offset applied by text actions to a given VMA. Although it
+has a parameter p_start_action that allows for incremental offset
+calculation, in many places it's used with p_start_action explicitly set
+to the first action. After the first relaxation pass when the list of
+text actions is finalized, an array of offsets sorted by VMA may be used
+to speed up this function.
+
+Original profile:
+
+% time self children called name
+-----------------------------------------
+ 0.35 0.00 33872/4808961 relax_section_symbols
+ 3.32 0.00 326022/4808961 relax_property_section
+ 12.83 0.00 1259379/4808961 offset_with_removed_text
+ 32.50 0.00 3189688/4808961 translate_reloc
+ 71.5 49.00 0.00 4808961 removed_by_actions
+-----------------------------------------
+
+Same data, after optimization:
+
+% time self children called name
+-----------------------------------------
+ 0.00 0.00 33872/4808537 relax_section_symbols
+ 0.01 0.00 326022/4808537 relax_property_section
+ 0.05 0.00 1258955/4808537 offset_with_removed_text_map
+ 0.13 0.00 3189688/4808537 translate_reloc
+ 1.0 0.20 0.00 4808537 removed_by_actions_map
+ 0.00 0.00 120/120 map_removal_by_action
+-----------------------------------------
+
+2015-04-01 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (removal_by_action_entry_struct,
+ removal_by_action_map_struct): new structures.
+ (removal_by_action_entry, removal_by_action_map): new typedefs.
+ (text_action_list_struct): add new field: map.
+ (map_removal_by_action, removed_by_actions_map,
+ offset_with_removed_text_map): new functions.
+ (relax_section): replace offset_with_removed_text with
+ offset_with_removed_text_map.
+ (translate_reloc, relax_property_section, relax_section_symbols):
+ replace removed_by_actions with removed_by_actions_map.
+
+Backported from: 071aa5c98a31c966f5fbfc573fcee61350fd1936
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 181 +++++++++++++++++++++++++++++++++++++++++++++--------
+ 1 file changed, 156 insertions(+), 25 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 872370b..21b2871 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -5420,11 +5420,28 @@ struct text_action_struct
+ text_action *next;
+ };
+
++struct removal_by_action_entry_struct
++{
++ bfd_vma offset;
++ int removed;
++ int eq_removed;
++ int eq_removed_before_fill;
++};
++typedef struct removal_by_action_entry_struct removal_by_action_entry;
++
++struct removal_by_action_map_struct
++{
++ unsigned n_entries;
++ removal_by_action_entry *entry;
++};
++typedef struct removal_by_action_map_struct removal_by_action_map;
++
+
+ /* List of all of the actions taken on a text section. */
+ struct text_action_list_struct
+ {
+ text_action *head;
++ removal_by_action_map map;
+ };
+
+
+@@ -5636,6 +5653,101 @@ action_list_count (text_action_list *action_list)
+ return count;
+ }
+
++static void
++map_removal_by_action (text_action_list *action_list)
++{
++ text_action *r;
++ int removed = 0;
++ removal_by_action_map map;
++ bfd_boolean eq_complete;
++
++ map.n_entries = 0;
++ map.entry = bfd_malloc (action_list_count (action_list) *
++ sizeof (removal_by_action_entry));
++ eq_complete = FALSE;
++
++ for (r = action_list->head; r;)
++ {
++ removal_by_action_entry *ientry = map.entry + map.n_entries;
++
++ if (map.n_entries && (ientry - 1)->offset == r->offset)
++ {
++ --ientry;
++ }
++ else
++ {
++ ++map.n_entries;
++ eq_complete = FALSE;
++ ientry->offset = r->offset;
++ ientry->eq_removed_before_fill = removed;
++ }
++
++ if (!eq_complete)
++ {
++ if (r->action != ta_fill || r->removed_bytes >= 0)
++ {
++ ientry->eq_removed = removed;
++ eq_complete = TRUE;
++ }
++ else
++ ientry->eq_removed = removed + r->removed_bytes;
++ }
++
++ removed += r->removed_bytes;
++ ientry->removed = removed;
++ r = r->next;
++ }
++ action_list->map = map;
++}
++
++static int
++removed_by_actions_map (text_action_list *action_list, bfd_vma offset,
++ bfd_boolean before_fill)
++{
++ unsigned a, b;
++
++ if (!action_list->map.entry)
++ map_removal_by_action (action_list);
++
++ if (!action_list->map.n_entries)
++ return 0;
++
++ a = 0;
++ b = action_list->map.n_entries;
++
++ while (b - a > 1)
++ {
++ unsigned c = (a + b) / 2;
++
++ if (action_list->map.entry[c].offset <= offset)
++ a = c;
++ else
++ b = c;
++ }
++
++ if (action_list->map.entry[a].offset < offset)
++ {
++ return action_list->map.entry[a].removed;
++ }
++ else if (action_list->map.entry[a].offset == offset)
++ {
++ return before_fill ?
++ action_list->map.entry[a].eq_removed_before_fill :
++ action_list->map.entry[a].eq_removed;
++ }
++ else
++ {
++ return 0;
++ }
++}
++
++static bfd_vma
++offset_with_removed_text_map (text_action_list *action_list, bfd_vma offset)
++{
++ int removed = removed_by_actions_map (action_list, offset, FALSE);
++ return offset - removed;
++}
++
+
+ /* The find_insn_action routine will only find non-fill actions. */
+
+@@ -5909,6 +6021,9 @@ init_xtensa_relax_info (asection *sec)
+
+ relax_info->action_list.head = NULL;
+
++ relax_info->action_list.map.n_entries = 0;
++ relax_info->action_list.map.entry = NULL;
++
+ relax_info->fix_list = NULL;
+ relax_info->fix_array = NULL;
+ relax_info->fix_array_count = 0;
+@@ -9218,7 +9333,7 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ if (elf_hash_table (link_info)->dynamic_sections_created)
+ shrink_dynamic_reloc_sections (link_info, abfd, sec, irel);
+ irel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
+- irel->r_offset = offset_with_removed_text
++ irel->r_offset = offset_with_removed_text_map
+ (&relax_info->action_list, irel->r_offset);
+ continue;
+ }
+@@ -9255,7 +9370,7 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ }
+ }
+
+- source_offset = offset_with_removed_text
++ source_offset = offset_with_removed_text_map
+ (&relax_info->action_list, irel->r_offset);
+ irel->r_offset = source_offset;
+ }
+@@ -9352,7 +9467,7 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ break;
+ }
+
+- new_end_offset = offset_with_removed_text
++ new_end_offset = offset_with_removed_text_map
+ (&target_relax_info->action_list,
+ r_rel.target_offset + diff_value);
+ diff_value = new_end_offset - new_reloc.target_offset;
+@@ -9750,7 +9865,6 @@ translate_reloc (const r_reloc *orig_rel, r_reloc *new_rel, asection *sec)
+ xtensa_relax_info *relax_info;
+ removed_literal *removed;
+ bfd_vma target_offset, base_offset;
+- text_action *act;
+
+ *new_rel = *orig_rel;
+
+@@ -9803,19 +9917,26 @@ translate_reloc (const r_reloc *orig_rel, r_reloc *new_rel, asection *sec)
+ offset. */
+
+ base_offset = r_reloc_get_target_offset (new_rel) - new_rel->rela.r_addend;
+- act = relax_info->action_list.head;
+ if (base_offset <= target_offset)
+ {
+- int base_removed = removed_by_actions (&act, base_offset, FALSE);
+- int addend_removed = removed_by_actions (&act, target_offset, FALSE);
++ int base_removed = removed_by_actions_map (&relax_info->action_list,
++ base_offset, FALSE);
++ int addend_removed = removed_by_actions_map (&relax_info->action_list,
++ target_offset, FALSE) -
++ base_removed;
++
+ new_rel->target_offset = target_offset - base_removed - addend_removed;
+ new_rel->rela.r_addend -= addend_removed;
+ }
+ else
+ {
+ /* Handle a negative addend. The base offset comes first. */
+- int tgt_removed = removed_by_actions (&act, target_offset, FALSE);
+- int addend_removed = removed_by_actions (&act, base_offset, FALSE);
++ int tgt_removed = removed_by_actions_map (&relax_info->action_list,
++ target_offset, FALSE);
++ int addend_removed = removed_by_actions_map (&relax_info->action_list,
++ base_offset, FALSE) -
++ tgt_removed;
++
+ new_rel->target_offset = target_offset - tgt_removed;
+ new_rel->rela.r_addend += addend_removed;
+ }
+@@ -10138,9 +10259,10 @@ relax_property_section (bfd *abfd,
+ bfd_vma old_offset = val.r_rel.target_offset;
+ bfd_vma new_offset;
+ long old_size, new_size;
+- text_action *act = target_relax_info->action_list.head;
+- new_offset = old_offset -
+- removed_by_actions (&act, old_offset, FALSE);
++ int removed_by_old_offset =
++ removed_by_actions_map (&target_relax_info->action_list,
++ old_offset, FALSE);
++ new_offset = old_offset - removed_by_old_offset;
+
+ /* Assert that we are not out of bounds. */
+ old_size = bfd_get_32 (abfd, size_p);
+@@ -10164,9 +10286,10 @@ relax_property_section (bfd *abfd,
+
+ /* Recompute the new_offset, but this time don't
+ include any fill inserted by relaxation. */
+- act = target_relax_info->action_list.head;
+- new_offset = old_offset -
+- removed_by_actions (&act, old_offset, TRUE);
++ removed_by_old_offset =
++ removed_by_actions_map (&target_relax_info->action_list,
++ old_offset, TRUE);
++ new_offset = old_offset - removed_by_old_offset;
+
+ /* If it is not unreachable and we have not yet
+ seen an unreachable at this address, place it
+@@ -10182,8 +10305,12 @@ relax_property_section (bfd *abfd,
+ }
+ }
+ else
+- new_size -=
+- removed_by_actions (&act, old_offset + old_size, TRUE);
++ {
++ int removed_by_old_offset_size =
++ removed_by_actions_map (&target_relax_info->action_list,
++ old_offset + old_size, TRUE);
++ new_size -= removed_by_old_offset_size - removed_by_old_offset;
++ }
+
+ if (new_size != old_size)
+ {
+@@ -10441,14 +10568,16 @@ relax_section_symbols (bfd *abfd, asection *sec)
+
+ if (isym->st_shndx == sec_shndx)
+ {
+- text_action *act = relax_info->action_list.head;
+ bfd_vma orig_addr = isym->st_value;
++ int removed = removed_by_actions_map (&relax_info->action_list,
++ orig_addr, FALSE);
+
+- isym->st_value -= removed_by_actions (&act, orig_addr, FALSE);
+-
++ isym->st_value -= removed;
+ if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC)
+ isym->st_size -=
+- removed_by_actions (&act, orig_addr + isym->st_size, FALSE);
++ removed_by_actions_map (&relax_info->action_list,
++ orig_addr + isym->st_size, FALSE) -
++ removed;
+ }
+ }
+
+@@ -10466,15 +10595,17 @@ relax_section_symbols (bfd *abfd, asection *sec)
+ || sym_hash->root.type == bfd_link_hash_defweak)
+ && sym_hash->root.u.def.section == sec)
+ {
+- text_action *act = relax_info->action_list.head;
+ bfd_vma orig_addr = sym_hash->root.u.def.value;
++ int removed = removed_by_actions_map (&relax_info->action_list,
++ orig_addr, FALSE);
+
+- sym_hash->root.u.def.value -=
+- removed_by_actions (&act, orig_addr, FALSE);
++ sym_hash->root.u.def.value -= removed;
+
+ if (sym_hash->type == STT_FUNC)
+ sym_hash->size -=
+- removed_by_actions (&act, orig_addr + sym_hash->size, FALSE);
++ removed_by_actions_map (&relax_info->action_list,
++ orig_addr + sym_hash->size, FALSE) -
++ removed;
+ }
+ }
+
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/908-xtensa-optimize-find_removed_literal.patch b/patches/binutils/2.24/908-xtensa-optimize-find_removed_literal.patch
new file mode 100644
index 0000000..96d526f
--- /dev/null
+++ b/patches/binutils/2.24/908-xtensa-optimize-find_removed_literal.patch
@@ -0,0 +1,146 @@
+From 288c2b709e5e6841484e1a129eaccd299db36877 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sat, 4 Apr 2015 14:49:42 +0300
+Subject: [PATCH 3/4] xtensa: optimize find_removed_literal
+
+find_removed_literal uses linear search to find removed literal by its
+VMA. The list of literals is fixed at that point, build an ordered index
+array and use binary search instead.
+
+Original profile:
+
+% time self children called name
+-----------------------------------------
+ 56.72 0.00 297578/669392 translate_reloc
+ 70.86 0.00 371814/669392 relax_section
+ 67.9 127.58 0.00 669392 find_removed_literal
+-----------------------------------------
+
+Same data, after optimization:
+
+% time self children called name
+-----------------------------------------
+ 0.00 0.00 297578/669392 translate_reloc
+ 0.00 0.00 371814/669392 relax_section
+ 0.0 0.00 0.00 669392 find_removed_literal
+ 0.00 0.00 23838/23838 map_removed_literal
+-----------------------------------------
+
+2015-04-03 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (removed_literal_map_entry): new typedef.
+ (removed_literal_map_entry_struct): new structure.
+ (removed_literal_list_struct): add new fields: n_map and map.
+ (map_removed_literal, removed_literal_compare): new functions.
+ (find_removed_literal): build index array for literals ordered
+ by VMA, use binary search to find removed literal.
+
+Backported from: 3439c466273378021821473d3fc84990e089ae34
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 58 insertions(+), 6 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 21b2871..51733ad 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -5832,6 +5832,7 @@ print_action_list (FILE *fp, text_action_list *action_list)
+ by the "from" offset field. */
+
+ typedef struct removed_literal_struct removed_literal;
++typedef struct removed_literal_map_entry_struct removed_literal_map_entry;
+ typedef struct removed_literal_list_struct removed_literal_list;
+
+ struct removed_literal_struct
+@@ -5841,10 +5842,19 @@ struct removed_literal_struct
+ removed_literal *next;
+ };
+
++struct removed_literal_map_entry_struct
++{
++ bfd_vma addr;
++ removed_literal *literal;
++};
++
+ struct removed_literal_list_struct
+ {
+ removed_literal *head;
+ removed_literal *tail;
++
++ unsigned n_map;
++ removed_literal_map_entry *map;
+ };
+
+
+@@ -5893,6 +5903,39 @@ add_removed_literal (removed_literal_list *removed_list,
+ }
+ }
+
++static void
++map_removed_literal (removed_literal_list *removed_list)
++{
++ unsigned n_map = 0;
++ unsigned i;
++ removed_literal_map_entry *map = NULL;
++ removed_literal *r = removed_list->head;
++
++ for (i = 0; r; ++i, r = r->next)
++ {
++ if (i == n_map)
++ {
++ n_map = (n_map * 2) + 2;
++ map = bfd_realloc (map, n_map * sizeof (*map));
++ }
++ map[i].addr = r->from.target_offset;
++ map[i].literal = r;
++ }
++ removed_list->map = map;
++ removed_list->n_map = i;
++}
++
++static int
++removed_literal_compare (const void *a, const void *b)
++{
++ const removed_literal_map_entry *pa = a;
++ const removed_literal_map_entry *pb = b;
++
++ if (pa->addr == pb->addr)
++ return 0;
++ else
++ return pa->addr < pb->addr ? -1 : 1;
++}
+
+ /* Check if the list of removed literals contains an entry for the
+ given address. Return the entry if found. */
+@@ -5900,12 +5943,21 @@ add_removed_literal (removed_literal_list *removed_list,
+ static removed_literal *
+ find_removed_literal (removed_literal_list *removed_list, bfd_vma addr)
+ {
+- removed_literal *r = removed_list->head;
+- while (r && r->from.target_offset < addr)
+- r = r->next;
+- if (r && r->from.target_offset == addr)
+- return r;
+- return NULL;
++ removed_literal_map_entry *p;
++ removed_literal *r = NULL;
++
++ if (removed_list->map == NULL)
++ map_removed_literal (removed_list);
++
++ p = bsearch (&addr, removed_list->map, removed_list->n_map,
++ sizeof (*removed_list->map), removed_literal_compare);
++ if (p)
++ {
++ while (p != removed_list->map && (p - 1)->addr == addr)
++ --p;
++ r = p->literal;
++ }
++ return r;
+ }
+
+
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/909-xtensa-replace-action-list-with-splay-tree.patch b/patches/binutils/2.24/909-xtensa-replace-action-list-with-splay-tree.patch
new file mode 100644
index 0000000..3090cc2
--- /dev/null
+++ b/patches/binutils/2.24/909-xtensa-replace-action-list-with-splay-tree.patch
@@ -0,0 +1,826 @@
+From e5409aedd3ee2192855018a564650ffb75c26e60 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 5 Apr 2015 17:04:22 +0300
+Subject: [PATCH 4/4] xtensa: replace action list with splay tree
+
+text_action_add uses linear list search to order text actions list by
+action VMA. The list is used at the first relaxation pass, when it's not
+fixed yet.
+Replace the list with splay tree from libiberty.
+
+Original profile:
+
+% time self children called name
+-----------------------------------------
+ 0.00 0.00 14/158225 compute_text_actions
+ 3.62 0.00 25211/158225 remove_dead_literal
+ 8.42 0.00 58645/158225 coalesce_shared_literal
+ 10.68 0.00 74355/158225 text_action_add_proposed
+ 38.8 22.73 0.00 158225 text_action_add
+ 0.00 0.00 144527/293246 bfd_zmalloc
+-----------------------------------------
+
+Same data, after optimization:
+
+% time self children called name
+-----------------------------------------
+ 0.00 0.00 14/158225 compute_text_actions
+ 0.00 0.00 25211/158225 remove_dead_literal
+ 0.00 0.01 58645/158225 coalesce_shared_literal
+ 0.00 0.01 74355/158225 text_action_add_proposed
+ 0.1 0.00 0.02 158225 text_action_add
+ 0.01 0.00 144527/144527 splay_tree_insert
+ 0.00 0.00 144527/195130 splay_tree_lookup
+ 0.00 0.00 144527/293246 bfd_zmalloc
+-----------------------------------------
+
+2015-04-03 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (splay-tree.h): include header.
+ (text_action_struct): drop next pointer.
+ (text_action_list_struct): drop head pointer, add count and
+ tree fields.
+ (find_fill_action): instead of linear search in text_action_list
+ search in the tree.
+ (text_action_compare, action_first, action_next): new functions.
+ (text_action_add, text_action_add_literal): instead of linear
+ search and insertion insert new node into the tree.
+ (removed_by_actions): pass additional parameter: action_list,
+ use it to traverse the tree.
+ (offset_with_removed_text): pass additional action_list parameter
+ to removed_by_actions.
+ (map_action_fn_context): new typedef.
+ (map_action_fn_context_struct): new structure.
+ (map_action_fn): new function.
+ (map_removal_by_action): use splay_tree_foreach to build map.
+ (find_insn_action): replace linear search in text_action_list
+ with series of splay_tree_lookups.
+ (print_action, print_action_list_fn): new functions.
+ (print_action_list): use splay_tree_foreach.
+ (init_xtensa_relax_info): drop action_list.head initialization.
+ Initialize the tree.
+ (compute_text_actions): use non-zero action_list_count instead of
+ non-NULL action list.
+ (xlate_map_context): new typedef.
+ (xlate_map_context_struct): new structure.
+ (xlate_map_fn): new function.
+ (build_xlate_map): use splay_tree_foreach to build map.
+ (action_remove_bytes_fn): new function.
+ (relax_section): use zero action_list_count instead of NULL
+ action list. Use splay_tree_foreach to count final section size.
+ Drop unused variable 'removed'.
+
+Backported from: 4c2af04fe8b4452bf51d2debf1bb467fafcd0f08
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ bfd/elf32-xtensa.c | 488 +++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 282 insertions(+), 206 deletions(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 51733ad..53af1c6 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -28,6 +28,7 @@
+ #include "libbfd.h"
+ #include "elf-bfd.h"
+ #include "elf/xtensa.h"
++#include "splay-tree.h"
+ #include "xtensa-isa.h"
+ #include "xtensa-config.h"
+
+@@ -5416,8 +5417,6 @@ struct text_action_struct
+ bfd_vma virtual_offset; /* Zero except for adding literals. */
+ int removed_bytes;
+ literal_value value; /* Only valid when adding literals. */
+-
+- text_action *next;
+ };
+
+ struct removal_by_action_entry_struct
+@@ -5440,7 +5439,8 @@ typedef struct removal_by_action_map_struct removal_by_action_map;
+ /* List of all of the actions taken on a text section. */
+ struct text_action_list_struct
+ {
+- text_action *head;
++ unsigned count;
++ splay_tree tree;
+ removal_by_action_map map;
+ };
+
+@@ -5448,20 +5448,18 @@ struct text_action_list_struct
+ static text_action *
+ find_fill_action (text_action_list *l, asection *sec, bfd_vma offset)
+ {
+- text_action **m_p;
++ text_action a;
+
+ /* It is not necessary to fill at the end of a section. */
+ if (sec->size == offset)
+ return NULL;
+
+- for (m_p = &l->head; *m_p && (*m_p)->offset <= offset; m_p = &(*m_p)->next)
+- {
+- text_action *t = *m_p;
+- /* When the action is another fill at the same address,
+- just increase the size. */
+- if (t->offset == offset && t->action == ta_fill)
+- return t;
+- }
++ a.offset = offset;
++ a.action = ta_fill;
++
++ splay_tree_node node = splay_tree_lookup (l->tree, (splay_tree_key)&a);
++ if (node)
++ return (text_action *)node->value;
+ return NULL;
+ }
+
+@@ -5509,6 +5507,49 @@ adjust_fill_action (text_action *ta, int fill_diff)
+ }
+
+
++static int
++text_action_compare (splay_tree_key a, splay_tree_key b)
++{
++ text_action *pa = (text_action *)a;
++ text_action *pb = (text_action *)b;
++ static const int action_priority[] =
++ {
++ [ta_fill] = 0,
++ [ta_none] = 1,
++ [ta_convert_longcall] = 2,
++ [ta_narrow_insn] = 3,
++ [ta_remove_insn] = 4,
++ [ta_remove_longcall] = 5,
++ [ta_remove_literal] = 6,
++ [ta_widen_insn] = 7,
++ [ta_add_literal] = 8,
++ };
++
++ if (pa->offset == pb->offset)
++ {
++ if (pa->action == pb->action)
++ return 0;
++ return action_priority[pa->action] - action_priority[pb->action];
++ }
++ else
++ return pa->offset < pb->offset ? -1 : 1;
++}
++
++static text_action *
++action_first (text_action_list *action_list)
++{
++ splay_tree_node node = splay_tree_min (action_list->tree);
++ return node ? (text_action *)node->value : NULL;
++}
++
++static text_action *
++action_next (text_action_list *action_list, text_action *action)
++{
++ splay_tree_node node = splay_tree_successor (action_list->tree,
++ (splay_tree_key)action);
++ return node ? (text_action *)node->value : NULL;
++}
++
+ /* Add a modification action to the text. For the case of adding or
+ removing space, modify any current fill and assume that
+ "unreachable_space" bytes can be freely contracted. Note that a
+@@ -5521,8 +5562,8 @@ text_action_add (text_action_list *l,
+ bfd_vma offset,
+ int removed)
+ {
+- text_action **m_p;
+ text_action *ta;
++ text_action a;
+
+ /* It is not necessary to fill at the end of a section. */
+ if (action == ta_fill && sec->size == offset)
+@@ -5532,34 +5573,30 @@ text_action_add (text_action_list *l,
+ if (action == ta_fill && removed == 0)
+ return;
+
+- for (m_p = &l->head; *m_p && (*m_p)->offset <= offset; m_p = &(*m_p)->next)
++ a.action = action;
++ a.offset = offset;
++
++ if (action == ta_fill)
+ {
+- text_action *t = *m_p;
++ splay_tree_node node = splay_tree_lookup (l->tree, (splay_tree_key)&a);
+
+- if (action == ta_fill)
++ if (node)
+ {
+- /* When the action is another fill at the same address,
+- just increase the size. */
+- if (t->offset == offset && t->action == ta_fill)
+- {
+- t->removed_bytes += removed;
+- return;
+- }
+- /* Fills need to happen before widens so that we don't
+- insert fill bytes into the instruction stream. */
+- if (t->offset == offset && t->action == ta_widen_insn)
+- break;
++ ta = (text_action *)node->value;
++ ta->removed_bytes += removed;
++ return;
+ }
+ }
++ else
++ BFD_ASSERT (splay_tree_lookup (l->tree, (splay_tree_key)&a) == NULL);
+
+- /* Create a new record and fill it up. */
+ ta = (text_action *) bfd_zmalloc (sizeof (text_action));
+ ta->action = action;
+ ta->sec = sec;
+ ta->offset = offset;
+ ta->removed_bytes = removed;
+- ta->next = (*m_p);
+- *m_p = ta;
++ splay_tree_insert (l->tree, (splay_tree_key)ta, (splay_tree_value)ta);
++ ++l->count;
+ }
+
+
+@@ -5570,7 +5607,6 @@ text_action_add_literal (text_action_list *l,
+ const literal_value *value,
+ int removed)
+ {
+- text_action **m_p;
+ text_action *ta;
+ asection *sec = r_reloc_get_section (loc);
+ bfd_vma offset = loc->target_offset;
+@@ -5578,14 +5614,6 @@ text_action_add_literal (text_action_list *l,
+
+ BFD_ASSERT (action == ta_add_literal);
+
+- for (m_p = &l->head; *m_p != NULL; m_p = &(*m_p)->next)
+- {
+- if ((*m_p)->offset > offset
+- && ((*m_p)->offset != offset
+- || (*m_p)->virtual_offset > virtual_offset))
+- break;
+- }
+-
+ /* Create a new record and fill it up. */
+ ta = (text_action *) bfd_zmalloc (sizeof (text_action));
+ ta->action = action;
+@@ -5594,8 +5622,10 @@ text_action_add_literal (text_action_list *l,
+ ta->virtual_offset = virtual_offset;
+ ta->value = *value;
+ ta->removed_bytes = removed;
+- ta->next = (*m_p);
+- *m_p = ta;
++
++ BFD_ASSERT (splay_tree_lookup (l->tree, (splay_tree_key)ta) == NULL);
++ splay_tree_insert (l->tree, (splay_tree_key)ta, (splay_tree_value)ta);
++ ++l->count;
+ }
+
+
+@@ -5606,7 +5636,8 @@ text_action_add_literal (text_action_list *l,
+ so that each search may begin where the previous one left off. */
+
+ static int
+-removed_by_actions (text_action **p_start_action,
++removed_by_actions (text_action_list *action_list,
++ text_action **p_start_action,
+ bfd_vma offset,
+ bfd_boolean before_fill)
+ {
+@@ -5614,6 +5645,13 @@ removed_by_actions (text_action **p_start_action,
+ int removed = 0;
+
+ r = *p_start_action;
++ if (r)
++ {
++ splay_tree_node node = splay_tree_lookup (action_list->tree,
++ (splay_tree_key)r);
++ BFD_ASSERT (node != NULL && r == (text_action *)node->value);
++ }
++
+ while (r)
+ {
+ if (r->offset > offset)
+@@ -5625,7 +5663,7 @@ removed_by_actions (text_action **p_start_action,
+
+ removed += r->removed_bytes;
+
+- r = r->next;
++ r = action_next (action_list, r);
+ }
+
+ *p_start_action = r;
+@@ -5636,68 +5674,74 @@ removed_by_actions (text_action **p_start_action,
+ static bfd_vma
+ offset_with_removed_text (text_action_list *action_list, bfd_vma offset)
+ {
+- text_action *r = action_list->head;
+- return offset - removed_by_actions (&r, offset, FALSE);
++ text_action *r = action_first (action_list);
++
++ return offset - removed_by_actions (action_list, &r, offset, FALSE);
+ }
+
+
+ static unsigned
+ action_list_count (text_action_list *action_list)
+ {
+- text_action *r = action_list->head;
+- unsigned count = 0;
+- for (r = action_list->head; r != NULL; r = r->next)
+- {
+- count++;
+- }
+- return count;
++ return action_list->count;
+ }
+
+-static void
+-map_removal_by_action (text_action_list *action_list)
++typedef struct map_action_fn_context_struct map_action_fn_context;
++struct map_action_fn_context_struct
+ {
+- text_action *r;
+- int removed = 0;
++ int removed;
+ removal_by_action_map map;
+ bfd_boolean eq_complete;
++};
+
+- map.n_entries = 0;
+- map.entry = bfd_malloc (action_list_count (action_list) *
+- sizeof (removal_by_action_entry));
+- eq_complete = FALSE;
++static int
++map_action_fn (splay_tree_node node, void *p)
++{
++ map_action_fn_context *ctx = p;
++ text_action *r = (text_action *)node->value;
++ removal_by_action_entry *ientry = ctx->map.entry + ctx->map.n_entries;
+
+- for (r = action_list->head; r;)
++ if (ctx->map.n_entries && (ientry - 1)->offset == r->offset)
+ {
+- removal_by_action_entry *ientry = map.entry + map.n_entries;
++ --ientry;
++ }
++ else
++ {
++ ++ctx->map.n_entries;
++ ctx->eq_complete = FALSE;
++ ientry->offset = r->offset;
++ ientry->eq_removed_before_fill = ctx->removed;
++ }
+
+- if (map.n_entries && (ientry - 1)->offset == r->offset)
++ if (!ctx->eq_complete)
++ {
++ if (r->action != ta_fill || r->removed_bytes >= 0)
+ {
+- --ientry;
++ ientry->eq_removed = ctx->removed;
++ ctx->eq_complete = TRUE;
+ }
+ else
+- {
+- ++map.n_entries;
+- eq_complete = FALSE;
+- ientry->offset = r->offset;
+- ientry->eq_removed_before_fill = removed;
+- }
++ ientry->eq_removed = ctx->removed + r->removed_bytes;
++ }
+
+- if (!eq_complete)
+- {
+- if (r->action != ta_fill || r->removed_bytes >= 0)
+- {
+- ientry->eq_removed = removed;
+- eq_complete = TRUE;
+- }
+- else
+- ientry->eq_removed = removed + r->removed_bytes;
+- }
++ ctx->removed += r->removed_bytes;
++ ientry->removed = ctx->removed;
++ return 0;
++}
+
+- removed += r->removed_bytes;
+- ientry->removed = removed;
+- r = r->next;
+- }
+- action_list->map = map;
++static void
++map_removal_by_action (text_action_list *action_list)
++{
++ map_action_fn_context ctx;
++
++ ctx.removed = 0;
++ ctx.map.n_entries = 0;
++ ctx.map.entry = bfd_malloc (action_list_count (action_list) *
++ sizeof (removal_by_action_entry));
++ ctx.eq_complete = FALSE;
++
++ splay_tree_foreach (action_list->tree, map_action_fn, &ctx);
++ action_list->map = ctx.map;
+ }
+
+ static int
+@@ -5754,28 +5798,26 @@ offset_with_removed_text_map (text_action_list *action_list, bfd_vma offset)
+ static text_action *
+ find_insn_action (text_action_list *action_list, bfd_vma offset)
+ {
+- text_action *t;
+- for (t = action_list->head; t; t = t->next)
++ static const text_action_t action[] =
+ {
+- if (t->offset == offset)
+- {
+- switch (t->action)
+- {
+- case ta_none:
+- case ta_fill:
+- break;
+- case ta_remove_insn:
+- case ta_remove_longcall:
+- case ta_convert_longcall:
+- case ta_narrow_insn:
+- case ta_widen_insn:
+- return t;
+- case ta_remove_literal:
+- case ta_add_literal:
+- BFD_ASSERT (0);
+- break;
+- }
+- }
++ ta_convert_longcall,
++ ta_remove_longcall,
++ ta_widen_insn,
++ ta_narrow_insn,
++ ta_remove_insn,
++ };
++ text_action a;
++ unsigned i;
++
++ a.offset = offset;
++ for (i = 0; i < sizeof (action) / sizeof (*action); ++i)
++ {
++ splay_tree_node node;
++
++ a.action = action[i];
++ node = splay_tree_lookup (action_list->tree, (splay_tree_key)&a);
++ if (node)
++ return (text_action *)node->value;
+ }
+ return NULL;
+ }
+@@ -5784,40 +5826,50 @@ find_insn_action (text_action_list *action_list, bfd_vma offset)
+ #if DEBUG
+
+ static void
+-print_action_list (FILE *fp, text_action_list *action_list)
++print_action (FILE *fp, text_action *r)
++{
++ const char *t = "unknown";
++ switch (r->action)
++ {
++ case ta_remove_insn:
++ t = "remove_insn"; break;
++ case ta_remove_longcall:
++ t = "remove_longcall"; break;
++ case ta_convert_longcall:
++ t = "convert_longcall"; break;
++ case ta_narrow_insn:
++ t = "narrow_insn"; break;
++ case ta_widen_insn:
++ t = "widen_insn"; break;
++ case ta_fill:
++ t = "fill"; break;
++ case ta_none:
++ t = "none"; break;
++ case ta_remove_literal:
++ t = "remove_literal"; break;
++ case ta_add_literal:
++ t = "add_literal"; break;
++ }
++
++ fprintf (fp, "%s: %s[0x%lx] \"%s\" %d\n",
++ r->sec->owner->filename,
++ r->sec->name, (unsigned long) r->offset, t, r->removed_bytes);
++}
++
++static int
++print_action_list_fn (splay_tree_node node, void *p)
+ {
+- text_action *r;
++ text_action *r = (text_action *)node->value;
+
+- fprintf (fp, "Text Action\n");
+- for (r = action_list->head; r != NULL; r = r->next)
+- {
+- const char *t = "unknown";
+- switch (r->action)
+- {
+- case ta_remove_insn:
+- t = "remove_insn"; break;
+- case ta_remove_longcall:
+- t = "remove_longcall"; break;
+- case ta_convert_longcall:
+- t = "convert_longcall"; break;
+- case ta_narrow_insn:
+- t = "narrow_insn"; break;
+- case ta_widen_insn:
+- t = "widen_insn"; break;
+- case ta_fill:
+- t = "fill"; break;
+- case ta_none:
+- t = "none"; break;
+- case ta_remove_literal:
+- t = "remove_literal"; break;
+- case ta_add_literal:
+- t = "add_literal"; break;
+- }
++ print_action (p, r);
++ return 0;
++}
+
+- fprintf (fp, "%s: %s[0x%lx] \"%s\" %d\n",
+- r->sec->owner->filename,
+- r->sec->name, (unsigned long) r->offset, t, r->removed_bytes);
+- }
++static void
++print_action_list (FILE *fp, text_action_list *action_list)
++{
++ fprintf (fp, "Text Action\n");
++ splay_tree_foreach (action_list->tree, print_action_list_fn, fp);
+ }
+
+ #endif /* DEBUG */
+@@ -6071,8 +6123,8 @@ init_xtensa_relax_info (asection *sec)
+ relax_info->removed_list.head = NULL;
+ relax_info->removed_list.tail = NULL;
+
+- relax_info->action_list.head = NULL;
+-
++ relax_info->action_list.tree = splay_tree_new (text_action_compare,
++ NULL, NULL);
+ relax_info->action_list.map.n_entries = 0;
+ relax_info->action_list.map.entry = NULL;
+
+@@ -7762,7 +7814,7 @@ compute_text_actions (bfd *abfd,
+ free_reloc_range_list (&relevant_relocs);
+
+ #if DEBUG
+- if (relax_info->action_list.head)
++ if (action_list_count (&relax_info->action_list))
+ print_action_list (stderr, &relax_info->action_list);
+ #endif
+
+@@ -8263,6 +8315,54 @@ xlate_offset_with_removed_text (const xlate_map_t *map,
+ return e->new_address - e->orig_address + offset;
+ }
+
++typedef struct xlate_map_context_struct xlate_map_context;
++struct xlate_map_context_struct
++{
++ xlate_map_t *map;
++ xlate_map_entry_t *current_entry;
++ int removed;
++};
++
++static int
++xlate_map_fn (splay_tree_node node, void *p)
++{
++ text_action *r = (text_action *)node->value;
++ xlate_map_context *ctx = p;
++ unsigned orig_size = 0;
++
++ switch (r->action)
++ {
++ case ta_none:
++ case ta_remove_insn:
++ case ta_convert_longcall:
++ case ta_remove_literal:
++ case ta_add_literal:
++ break;
++ case ta_remove_longcall:
++ orig_size = 6;
++ break;
++ case ta_narrow_insn:
++ orig_size = 3;
++ break;
++ case ta_widen_insn:
++ orig_size = 2;
++ break;
++ case ta_fill:
++ break;
++ }
++ ctx->current_entry->size =
++ r->offset + orig_size - ctx->current_entry->orig_address;
++ if (ctx->current_entry->size != 0)
++ {
++ ctx->current_entry++;
++ ctx->map->entry_count++;
++ }
++ ctx->current_entry->orig_address = r->offset + orig_size;
++ ctx->removed += r->removed_bytes;
++ ctx->current_entry->new_address = r->offset + orig_size - ctx->removed;
++ ctx->current_entry->size = 0;
++ return 0;
++}
+
+ /* Build a binary searchable offset translation map from a section's
+ action list. */
+@@ -8270,75 +8370,40 @@ xlate_offset_with_removed_text (const xlate_map_t *map,
+ static xlate_map_t *
+ build_xlate_map (asection *sec, xtensa_relax_info *relax_info)
+ {
+- xlate_map_t *map = (xlate_map_t *) bfd_malloc (sizeof (xlate_map_t));
+ text_action_list *action_list = &relax_info->action_list;
+ unsigned num_actions = 0;
+- text_action *r;
+- int removed;
+- xlate_map_entry_t *current_entry;
++ xlate_map_context ctx;
+
+- if (map == NULL)
++ ctx.map = (xlate_map_t *) bfd_malloc (sizeof (xlate_map_t));
++
++ if (ctx.map == NULL)
+ return NULL;
+
+ num_actions = action_list_count (action_list);
+- map->entry = (xlate_map_entry_t *)
++ ctx.map->entry = (xlate_map_entry_t *)
+ bfd_malloc (sizeof (xlate_map_entry_t) * (num_actions + 1));
+- if (map->entry == NULL)
++ if (ctx.map->entry == NULL)
+ {
+- free (map);
++ free (ctx.map);
+ return NULL;
+ }
+- map->entry_count = 0;
++ ctx.map->entry_count = 0;
+
+- removed = 0;
+- current_entry = &map->entry[0];
++ ctx.removed = 0;
++ ctx.current_entry = &ctx.map->entry[0];
+
+- current_entry->orig_address = 0;
+- current_entry->new_address = 0;
+- current_entry->size = 0;
++ ctx.current_entry->orig_address = 0;
++ ctx.current_entry->new_address = 0;
++ ctx.current_entry->size = 0;
+
+- for (r = action_list->head; r != NULL; r = r->next)
+- {
+- unsigned orig_size = 0;
+- switch (r->action)
+- {
+- case ta_none:
+- case ta_remove_insn:
+- case ta_convert_longcall:
+- case ta_remove_literal:
+- case ta_add_literal:
+- break;
+- case ta_remove_longcall:
+- orig_size = 6;
+- break;
+- case ta_narrow_insn:
+- orig_size = 3;
+- break;
+- case ta_widen_insn:
+- orig_size = 2;
+- break;
+- case ta_fill:
+- break;
+- }
+- current_entry->size =
+- r->offset + orig_size - current_entry->orig_address;
+- if (current_entry->size != 0)
+- {
+- current_entry++;
+- map->entry_count++;
+- }
+- current_entry->orig_address = r->offset + orig_size;
+- removed += r->removed_bytes;
+- current_entry->new_address = r->offset + orig_size - removed;
+- current_entry->size = 0;
+- }
++ splay_tree_foreach (action_list->tree, xlate_map_fn, &ctx);
+
+- current_entry->size = (bfd_get_section_limit (sec->owner, sec)
+- - current_entry->orig_address);
+- if (current_entry->size != 0)
+- map->entry_count++;
++ ctx.current_entry->size = (bfd_get_section_limit (sec->owner, sec)
++ - ctx.current_entry->orig_address);
++ if (ctx.current_entry->size != 0)
++ ctx.map->entry_count++;
+
+- return map;
++ return ctx.map;
+ }
+
+
+@@ -9302,6 +9367,16 @@ move_shared_literal (asection *sec,
+
+ /* Second relaxation pass. */
+
++static int
++action_remove_bytes_fn (splay_tree_node node, void *p)
++{
++ bfd_size_type *final_size = p;
++ text_action *action = (text_action *)node->value;
++
++ *final_size -= action->removed_bytes;
++ return 0;
++}
++
+ /* Modify all of the relocations to point to the right spot, and if this
+ is a relaxable section, delete the unwanted literals and fix the
+ section size. */
+@@ -9334,7 +9409,7 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+
+ internal_relocs = retrieve_internal_relocs (abfd, sec,
+ link_info->keep_memory);
+- if (!internal_relocs && !relax_info->action_list.head)
++ if (!internal_relocs && !action_list_count (&relax_info->action_list))
+ return TRUE;
+
+ contents = retrieve_contents (abfd, sec, link_info->keep_memory);
+@@ -9412,6 +9487,12 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ }
+ /* Update the action so that the code that moves
+ the contents will do the right thing. */
++ /* ta_remove_longcall and ta_remove_insn actions are
++ grouped together in the tree as well as
++ ta_convert_longcall and ta_none, so that changes below
++ can be done w/o removing and reinserting action into
++ the tree. */
++
+ if (action->action == ta_remove_longcall)
+ action->action = ta_remove_insn;
+ else
+@@ -9584,13 +9665,12 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+
+ if ((relax_info->is_relaxable_literal_section
+ || relax_info->is_relaxable_asm_section)
+- && relax_info->action_list.head)
++ && action_list_count (&relax_info->action_list))
+ {
+ /* Walk through the planned actions and build up a table
+ of move, copy and fill records. Use the move, copy and
+ fill records to perform the actions once. */
+
+- int removed = 0;
+ bfd_size_type final_size, copy_size, orig_insn_size;
+ bfd_byte *scratch = NULL;
+ bfd_byte *dup_contents = NULL;
+@@ -9601,15 +9681,12 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ bfd_vma orig_dot_vo = 0; /* Virtual offset from orig_dot. */
+ bfd_vma dup_dot = 0;
+
+- text_action *action = relax_info->action_list.head;
++ text_action *action;
+
+ final_size = sec->size;
+- for (action = relax_info->action_list.head; action;
+- action = action->next)
+- {
+- final_size -= action->removed_bytes;
+- }
+
++ splay_tree_foreach (relax_info->action_list.tree,
++ action_remove_bytes_fn, &final_size);
+ scratch = (bfd_byte *) bfd_zmalloc (final_size);
+ dup_contents = (bfd_byte *) bfd_zmalloc (final_size);
+
+@@ -9618,8 +9695,8 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ print_action_list (stderr, &relax_info->action_list);
+ #endif
+
+- for (action = relax_info->action_list.head; action;
+- action = action->next)
++ for (action = action_first (&relax_info->action_list); action;
++ action = action_next (&relax_info->action_list, action))
+ {
+ virtual_action = FALSE;
+ if (action->offset > orig_dot)
+@@ -9748,7 +9825,6 @@ relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info)
+ break;
+ }
+
+- removed += action->removed_bytes;
+ BFD_ASSERT (dup_dot <= final_size);
+ BFD_ASSERT (orig_dot <= orig_size);
+ }
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/910-xtensa-optimize-trampolines-relaxation.patch b/patches/binutils/2.24/910-xtensa-optimize-trampolines-relaxation.patch
new file mode 100644
index 0000000..043ff4d
--- /dev/null
+++ b/patches/binutils/2.24/910-xtensa-optimize-trampolines-relaxation.patch
@@ -0,0 +1,345 @@
+From cbe53e134d4c3a656880a906738ce19fdcd38e8b Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Fri, 1 May 2015 11:39:12 +0300
+Subject: [PATCH] xtensa: optimize trampolines relaxation
+
+Currently every fixup in the current segment is checked when relaxing
+trampoline frag. This is very expensive. Make a searchable array of
+fixups pointing at potentially oversized jumps at the beginning of every
+relaxation pass and only check subset of this cache in the reach of
+single jump from the trampoline frag currently being relaxed.
+
+Original profile:
+
+% time self children called name
+-----------------------------------------
+ 370.16 593.38 12283048/12283048 relax_segment
+ 98.4 370.16 593.38 12283048 xtensa_relax_frag
+ 58.91 269.26 2691463834/2699602236 xtensa_insnbuf_from_chars
+ 68.35 68.17 811266668/813338977 S_GET_VALUE
+ 36.85 29.51 2684369246/2685538060 xtensa_opcode_decode
+ 28.34 8.84 2684369246/2685538060 xtensa_format_get_slot
+ 12.39 5.94 2691463834/2699775044 xtensa_format_decode
+ 0.03 4.60 4101109/4101109 relax_frag_for_align
+ 0.18 1.76 994617/994617 relax_frag_immed
+ 0.07 0.09 24556277/24851220 new_logical_line
+ 0.06 0.00 12283048/14067410 as_where
+ 0.04 0.00 7094588/15460506 xtensa_format_num_slots
+ 0.00 0.00 1/712477 xtensa_insnbuf_alloc
+-----------------------------------------
+
+Same data, after optimization:
+
+% time self children called name
+-----------------------------------------
+ 0.51 7.47 12283048/12283048 relax_segment
+ 58.0 0.51 7.47 12283048 xtensa_relax_frag
+ 0.02 4.08 4101109/4101109 relax_frag_for_align
+ 0.18 1.39 994617/994617 relax_frag_immed
+ 0.01 0.98 555/555 xtensa_cache_relaxable_fixups
+ 0.21 0.25 7094588/16693271 xtensa_insnbuf_from_chars
+ 0.06 0.12 24556277/24851220 new_logical_line
+ 0.06 0.00 7094588/15460506 xtensa_format_num_slots
+ 0.02 0.04 7094588/16866079 xtensa_format_decode
+ 0.05 0.00 12283048/14067410 as_where
+ 0.00 0.00 1/712477 xtensa_insnbuf_alloc
+ 0.00 0.00 93808/93808 xtensa_find_first_cached_fixup
+-----------------------------------------
+
+2015-05-02 Max Filippov <jcmvbkbc@gmail.com>
+gas/
+ * config/tc-xtensa.c (cached_fixupS, fixup_cacheS): New typedefs.
+ (struct cached_fixup, struct fixup_cache): New structures.
+ (fixup_order, xtensa_make_cached_fixup),
+ (xtensa_realloc_fixup_cache, xtensa_cache_relaxable_fixups),
+ (xtensa_find_first_cached_fixup, xtensa_delete_cached_fixup),
+ (xtensa_add_cached_fixup): New functions.
+ (xtensa_relax_frag): Cache fixups pointing at potentially
+ oversized jumps at the beginning of every relaxation pass. Only
+ check subset of this cache in the reach of single jump from the
+ trampoline frag currently being relaxed.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: b76f99d702c3501ac320396ea06bc7f9237173c3
+Changes to ChangeLog are dropped.
+
+ gas/config/tc-xtensa.c | 220 +++++++++++++++++++++++++++++++++++++++++++------
+ 1 file changed, 194 insertions(+), 26 deletions(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index 3e85b69..31c0b6b 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -8785,6 +8785,154 @@ static long relax_frag_for_align (fragS *, long);
+ static long relax_frag_immed
+ (segT, fragS *, long, int, xtensa_format, int, int *, bfd_boolean);
+
++typedef struct cached_fixup cached_fixupS;
++struct cached_fixup
++{
++ int addr;
++ int target;
++ int delta;
++ fixS *fixP;
++};
++
++typedef struct fixup_cache fixup_cacheS;
++struct fixup_cache
++{
++ cached_fixupS *fixups;
++ unsigned n_fixups;
++ unsigned n_max;
++
++ segT seg;
++ fragS *first_frag;
++};
++
++static int fixup_order (const void *a, const void *b)
++{
++ const cached_fixupS *pa = a;
++ const cached_fixupS *pb = b;
++
++ if (pa->addr == pb->addr)
++ {
++ if (pa->target == pb->target)
++ {
++ if (pa->fixP->fx_r_type == pb->fixP->fx_r_type)
++ return 0;
++ return pa->fixP->fx_r_type < pb->fixP->fx_r_type ? -1 : 1;
++ }
++ return pa->target - pb->target;
++ }
++ return pa->addr - pb->addr;
++}
++
++static bfd_boolean xtensa_make_cached_fixup (cached_fixupS *o, fixS *fixP)
++{
++ xtensa_isa isa = xtensa_default_isa;
++ int addr = fixP->fx_frag->fr_address;
++ int target;
++ int delta;
++ symbolS *s = fixP->fx_addsy;
++ int slot;
++ xtensa_format fmt;
++ xtensa_opcode opcode;
++
++ if (fixP->fx_r_type < BFD_RELOC_XTENSA_SLOT0_OP ||
++ fixP->fx_r_type > BFD_RELOC_XTENSA_SLOT14_OP)
++ return FALSE;
++ target = S_GET_VALUE (s);
++ delta = target - addr;
++
++ if (abs(delta) < J_RANGE / 2)
++ return FALSE;
++
++ xtensa_insnbuf_from_chars (isa, trampoline_buf,
++ (unsigned char *) fixP->fx_frag->fr_literal +
++ fixP->fx_where, 0);
++ fmt = xtensa_format_decode (isa, trampoline_buf);
++ gas_assert (fmt != XTENSA_UNDEFINED);
++ slot = fixP->tc_fix_data.slot;
++ xtensa_format_get_slot (isa, fmt, slot, trampoline_buf, trampoline_slotbuf);
++ opcode = xtensa_opcode_decode (isa, fmt, slot, trampoline_slotbuf);
++ if (opcode != xtensa_j_opcode)
++ return FALSE;
++
++ o->addr = addr;
++ o->target = target;
++ o->delta = delta;
++ o->fixP = fixP;
++
++ return TRUE;
++}
++
++static void xtensa_realloc_fixup_cache (fixup_cacheS *cache, unsigned add)
++{
++ if (cache->n_fixups + add > cache->n_max)
++ {
++ cache->n_max = (cache->n_fixups + add) * 2;
++ cache->fixups = xrealloc (cache->fixups,
++ sizeof (*cache->fixups) * cache->n_max);
++ }
++}
++
++static void xtensa_cache_relaxable_fixups (fixup_cacheS *cache,
++ segment_info_type *seginfo)
++{
++ fixS *fixP;
++
++ cache->n_fixups = 0;
++
++ for (fixP = seginfo->fix_root; fixP ; fixP = fixP->fx_next)
++ {
++ xtensa_realloc_fixup_cache (cache, 1);
++
++ if (xtensa_make_cached_fixup (cache->fixups + cache->n_fixups, fixP))
++ ++cache->n_fixups;
++ }
++ qsort (cache->fixups, cache->n_fixups, sizeof (*cache->fixups), fixup_order);
++}
++
++static unsigned xtensa_find_first_cached_fixup (const fixup_cacheS *cache,
++ int addr)
++{
++ unsigned a = 0;
++ unsigned b = cache->n_fixups;
++
++ while (b - a > 1)
++ {
++ unsigned c = (a + b) / 2;
++
++ if (cache->fixups[c].addr < addr)
++ a = c;
++ else
++ b = c;
++ }
++ return a;
++}
++
++static void xtensa_delete_cached_fixup (fixup_cacheS *cache, unsigned i)
++{
++ memmove (cache->fixups + i, cache->fixups + i + 1,
++ (cache->n_fixups - i - 1) * sizeof (*cache->fixups));
++ --cache->n_fixups;
++}
++
++static bfd_boolean xtensa_add_cached_fixup (fixup_cacheS *cache, fixS *fixP)
++{
++ cached_fixupS o;
++ unsigned i;
++
++ if (!xtensa_make_cached_fixup (&o, fixP))
++ return FALSE;
++ xtensa_realloc_fixup_cache (cache, 1);
++ i = xtensa_find_first_cached_fixup (cache, o.addr);
++ if (i < cache->n_fixups)
++ {
++ ++i;
++ memmove (cache->fixups + i + 1, cache->fixups + i,
++ (cache->n_fixups - i) * sizeof (*cache->fixups));
++ }
++ cache->fixups[i] = o;
++ ++cache->n_fixups;
++ return TRUE;
++}
+
+ /* Return the number of bytes added to this fragment, given that the
+ input has been stretched already by "stretch". */
+@@ -8896,35 +9044,42 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
+ case RELAX_TRAMPOLINE:
+ if (fragP->tc_frag_data.relax_seen)
+ {
+- segment_info_type *seginfo = seg_info (now_seg);
+- fragS *fP; /* The out-of-range jump. */
+- fixS *fixP;
++ static fixup_cacheS fixup_cache;
++ segment_info_type *seginfo = seg_info (now_seg);
++ int trampaddr = fragP->fr_address + fragP->fr_fix;
++ int searchaddr = trampaddr < J_RANGE ? 0 : trampaddr - J_RANGE;
++ unsigned i;
++
++ if (now_seg != fixup_cache.seg ||
++ fragP == fixup_cache.first_frag ||
++ fixup_cache.first_frag == NULL)
++ {
++ xtensa_cache_relaxable_fixups (&fixup_cache, seginfo);
++ fixup_cache.seg = now_seg;
++ fixup_cache.first_frag = fragP;
++ }
+
+ /* Scan for jumps that will not reach. */
+- for (fixP = seginfo->fix_root; fixP ; fixP = fixP->fx_next)
++ for (i = xtensa_find_first_cached_fixup (&fixup_cache, searchaddr);
++ i < fixup_cache.n_fixups; ++i)
++
+ {
+- symbolS *s = fixP->fx_addsy;
+- xtensa_opcode opcode;
+- int target;
+- int addr;
+- int delta;
+-
+- if (fixP->fx_r_type < BFD_RELOC_XTENSA_SLOT0_OP ||
+- fixP->fx_r_type > BFD_RELOC_XTENSA_SLOT14_OP)
+- continue;
+- xtensa_insnbuf_from_chars (isa, trampoline_buf,
+- (unsigned char *) fixP->fx_frag->fr_literal + fixP->fx_where,
+- 0);
+- fmt = xtensa_format_decode (isa, trampoline_buf);
+- gas_assert (fmt != XTENSA_UNDEFINED);
+- slot = fixP->tc_fix_data.slot;
+- xtensa_format_get_slot (isa, fmt, slot, trampoline_buf, trampoline_slotbuf);
+- opcode = xtensa_opcode_decode (isa, fmt, slot, trampoline_slotbuf);
+- if (opcode != xtensa_j_opcode)
++ fixS *fixP = fixup_cache.fixups[i].fixP;
++ int target = fixup_cache.fixups[i].target;
++ int addr = fixup_cache.fixups[i].addr;
++ int delta = fixup_cache.fixups[i].delta + stretch;
++
++ trampaddr = fragP->fr_address + fragP->fr_fix;
++
++ if (addr + J_RANGE < trampaddr)
+ continue;
+- target = S_GET_VALUE (s);
+- addr = fixP->fx_frag->fr_address;
+- delta = target - addr + stretch;
++ if (addr > trampaddr + J_RANGE)
++ break;
++ if (abs (delta) < J_RANGE)
++ continue;
++
++ slot = fixP->tc_fix_data.slot;
++
+ if (delta > J_RANGE || delta < -1 * J_RANGE)
+ { /* Found an out-of-range jump; scan the list of trampolines for the best match. */
+ struct trampoline_seg *ts = find_trampoline_seg (now_seg);
+@@ -8978,14 +9133,13 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
+ }
+ if (tf->fragP == fragP)
+ {
+- int trampaddr = fragP->fr_address + fragP->fr_fix;
+-
+ if (abs (addr - trampaddr) < J_RANGE)
+ { /* The trampoline is in range of original; fix it! */
+ fixS *newfixP;
+ int offset;
+ TInsn insn;
+ symbolS *lsym;
++ fragS *fP; /* The out-of-range jump. */
+
+ new_stretch += init_trampoline_frag (tf);
+ offset = fragP->fr_fix; /* Where to assemble the j insn. */
+@@ -9009,10 +9163,20 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
+ newfixP->tc_fix_data.X_add_symbol = lsym;
+ newfixP->tc_fix_data.X_add_number = offset;
+ newfixP->tc_fix_data.slot = slot;
++
++ xtensa_delete_cached_fixup (&fixup_cache, i);
++ xtensa_add_cached_fixup (&fixup_cache, newfixP);
++
+ /* Move the fix-up from the original j insn to this one. */
+ fixP->fx_frag = fragP;
+ fixP->fx_where = fragP->fr_fix - 3;
+ fixP->tc_fix_data.slot = 0;
++
++ xtensa_add_cached_fixup (&fixup_cache, fixP);
++
++ /* re-do current fixup */
++ --i;
++
+ /* Adjust the jump around this trampoline (if present). */
+ if (tf->fixP != NULL)
+ {
+@@ -9027,6 +9191,8 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
+ fragP->fr_subtype = 0;
+ /* Remove from the trampoline_list. */
+ prev->next = tf->next;
++ if (fragP == fixup_cache.first_frag)
++ fixup_cache.first_frag = NULL;
+ break;
+ }
+ }
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch b/patches/binutils/2.24/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch
new file mode 100644
index 0000000..9ad6b3b
--- /dev/null
+++ b/patches/binutils/2.24/911-xtensa-fix-localized-symbol-refcounting-with-gc-sect.patch
@@ -0,0 +1,57 @@
+From 8ec76b16f62d1bf386fb2c39af5f66c3afddc5cb Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 14 May 2015 05:22:55 +0300
+Subject: [PATCH] xtensa: fix localized symbol refcounting with --gc-sections
+
+elf_xtensa_gc_sweep_hook doesn't correctly unreference symbols that were
+made local, that results in link failure with the following message:
+
+ BFD (GNU Binutils) 2.24 internal error, aborting at elf32-xtensa.c line
+ 3372 in elf_xtensa_finish_dynamic_sections
+
+elf_xtensa_gc_sweep_hook determines symbol reference type (PLT or GOT) by
+relocation type. Relocation types are not changed when symbol becomes
+local, but its PLT references are added to GOT references and
+plt.refcount is set to 0. Such symbol cannot be unreferences in the
+elf_xtensa_gc_sweep_hook and its extra references make calculated GOT
+relocations section size not match number of GOT relocations.
+
+Fix it by treating PLT reference as GOT reference when plt.refcount is
+not positive.
+
+2015-05-14 Max Filippov <jcmvbkbc@gmail.com>
+bfd/
+ * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Treat PLT reference
+ as GOT reference when plt.refcount is not positive.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: e6c9a083ec5ae7a45bd71682b26aae1939849388
+Changes to ChangeLog are dropped.
+
+ bfd/elf32-xtensa.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
+index 53af1c6..2523670 100644
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -1360,10 +1360,14 @@ elf_xtensa_gc_sweep_hook (bfd *abfd,
+ {
+ if (is_plt)
+ {
++ /* If the symbol has been localized its plt.refcount got moved
++ to got.refcount. Handle it as GOT. */
+ if (h->plt.refcount > 0)
+ h->plt.refcount--;
++ else
++ is_got = TRUE;
+ }
+- else if (is_got)
++ if (is_got)
+ {
+ if (h->got.refcount > 0)
+ h->got.refcount--;
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/912-xtensa-fix-gas-segfault-with-text-section-literals.patch b/patches/binutils/2.24/912-xtensa-fix-gas-segfault-with-text-section-literals.patch
new file mode 100644
index 0000000..4a3de2c
--- /dev/null
+++ b/patches/binutils/2.24/912-xtensa-fix-gas-segfault-with-text-section-literals.patch
@@ -0,0 +1,56 @@
+From 2d0522e76e4afeeb2e104e0a4332d94fa0d2fbf6 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 17 May 2015 06:46:15 +0300
+Subject: [PATCH] xtensa: fix gas segfault with --text-section-literals
+
+When --text-section-literals is used and code in the .init or .fini
+emits literal in the absence of .literal_position, xtensa_move_literals
+segfaults.
+
+Check that search_frag is non-NULL in the xtensa_move_literals and
+report error otherwise.
+
+2015-05-26 Max Filippov <jcmvbkbc@gmail.com>
+gas/
+ * config/tc-xtensa.c (xtensa_move_literals): Check that
+ search_frag is non-NULL. Report error if literal frag is not
+ found.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: 4de0562a4c69fef4952aa7e19d7bda359f02e8b4
+Changes to ChangeLog are dropped.
+
+ gas/config/tc-xtensa.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index 31c0b6b..18307c1 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -10808,13 +10808,21 @@ xtensa_move_literals (void)
+ frchain_to = NULL;
+ frag_splice = &(frchain_from->frch_root);
+
+- while (!search_frag->tc_frag_data.literal_frag)
++ while (search_frag && !search_frag->tc_frag_data.literal_frag)
+ {
+ gas_assert (search_frag->fr_fix == 0
+ || search_frag->fr_type == rs_align);
+ search_frag = search_frag->fr_next;
+ }
+
++ if (!search_frag)
++ {
++ search_frag = frchain_from->frch_root;
++ as_bad_where (search_frag->fr_file, search_frag->fr_line,
++ _("literal pool location required for text-section-literals; specify with .literal_position"));
++ continue;
++ }
++
+ gas_assert (search_frag->tc_frag_data.literal_frag->fr_subtype
+ == RELAX_LITERAL_POOL_BEGIN);
+ xtensa_switch_section_emit_state (&state, segment->seg, 0);
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.24/913-xtensa-add-auto-litpools-option.patch b/patches/binutils/2.24/913-xtensa-add-auto-litpools-option.patch
new file mode 100644
index 0000000..f0199e1
--- /dev/null
+++ b/patches/binutils/2.24/913-xtensa-add-auto-litpools-option.patch
@@ -0,0 +1,698 @@
+From 978adaaa4cd3921842e2be8a31c05f081fb17fcf Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Wed, 29 Jul 2015 17:42:54 +0300
+Subject: [PATCH] xtensa: add --auto-litpools option
+
+Auto-litpools is the automated version of text-section-literals: literal
+pool candidate frags are planted every N frags and during relaxation
+they are turned into actual literal pools where literals are moved to
+become reachable for their first reference by L32R instruction.
+
+2015-08-12 David Weatherford <weath@cadence.com>
+gas/
+ * config/tc-xtensa.c (struct litpool_frag, struct litpool_seg):
+ New structures.
+ (xtensa_maybe_create_literal_pool_frag): New function.
+ (litpool_seg_list, auto_litpools, auto_litpool_limit)
+ (litpool_buf, litpool_slotbuf): New static variables.
+ (option_auto_litpools, option_no_auto_litpools)
+ (option_auto_litpool_limit): New enum identifiers.
+ (md_longopts): Add entries for auto-litpools, no-auto-litpools
+ and auto-litpool-limit.
+ (md_parse_option): Handle option_auto_litpools,
+ option_no_auto_litpools and option_auto_litpool_limit.
+ (md_show_usage): Add help for --[no-]auto-litpools and
+ --auto-litpool-limit.
+ (xtensa_mark_literal_pool_location): Record a place for literal
+ pool with a call to xtensa_maybe_create_literal_pool_frag.
+ (get_literal_pool_location): Find highest priority literal pool
+ or convert candidate to literal pool when auto-litpools are used.
+ (xg_assemble_vliw_tokens): Create literal pool after jump
+ instruction.
+ (xtensa_check_frag_count): Create candidate literal pool every
+ auto_litpool_limit frags.
+ (xtensa_relax_frag): Add jump around literals to non-empty
+ literal pool.
+ (xtensa_move_literals): Estimate literal pool addresses and move
+ unreachable literals closer to their users, converting candidate
+ to literal pool if needed.
+ (xtensa_switch_to_non_abs_literal_fragment): Only emit error
+ about missing .literal_position in case auto-litpools are not
+ used.
+ * config/tc-xtensa.h (xtensa_relax_statesE): New relaxation
+ state: RELAX_LITERAL_POOL_CANDIDATE_BEGIN.
+
+2015-08-12 Max Filippov <jcmvbkbc@gmail.com>
+gas/testsuite/
+ * gas/xtensa/all.exp: Add auto-litpools to the list of xtensa
+ tests.
+ * gas/xtensa/auto-litpools.s: New file: auto-litpools test.
+ * gas/xtensa/auto-litpools.s: New file: auto-litpools test
+ result pattern.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: b46824bd49648c575372e6d9bc6a6defeabd6ed5
+Changes to ChangeLogs and documentation are dropped.
+
+ gas/config/tc-xtensa.c | 432 ++++++++++++++++++++++++++++++-
+ gas/config/tc-xtensa.h | 1 +
+ gas/testsuite/gas/xtensa/all.exp | 1 +
+ gas/testsuite/gas/xtensa/auto-litpools.d | 12 +
+ gas/testsuite/gas/xtensa/auto-litpools.s | 13 +
+ 5 files changed, 454 insertions(+), 5 deletions(-)
+ create mode 100644 gas/testsuite/gas/xtensa/auto-litpools.d
+ create mode 100644 gas/testsuite/gas/xtensa/auto-litpools.s
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index 7311a05..b8b1e7d 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -440,6 +440,29 @@ bfd_boolean directive_state[] =
+ #endif
+ };
+
++/* A circular list of all potential and actual literal pool locations
++ in a segment. */
++struct litpool_frag
++{
++ struct litpool_frag *next;
++ struct litpool_frag *prev;
++ fragS *fragP;
++ addressT addr;
++ short priority; /* 1, 2, or 3 -- 1 is highest */
++ short original_priority;
++};
++
++/* Map a segment to its litpool_frag list. */
++struct litpool_seg
++{
++ struct litpool_seg *next;
++ asection *seg;
++ struct litpool_frag frag_list;
++ int frag_count; /* since last litpool location */
++};
++
++static struct litpool_seg litpool_seg_list;
++
+
+ /* Directive functions. */
+
+@@ -474,6 +497,9 @@ static void xtensa_create_trampoline_frag (bfd_boolean);
+ static void xtensa_maybe_create_trampoline_frag (void);
+ struct trampoline_frag;
+ static int init_trampoline_frag (struct trampoline_frag *);
++static void xtensa_maybe_create_literal_pool_frag (bfd_boolean, bfd_boolean);
++static bfd_boolean auto_litpools = FALSE;
++static int auto_litpool_limit = 10000;
+
+ /* Alignment Functions. */
+
+@@ -698,6 +724,10 @@ enum
+
+ option_trampolines,
+ option_no_trampolines,
++
++ option_auto_litpools,
++ option_no_auto_litpools,
++ option_auto_litpool_limit,
+ };
+
+ const char *md_shortopts = "";
+@@ -773,6 +803,10 @@ struct option md_longopts[] =
+ { "trampolines", no_argument, NULL, option_trampolines },
+ { "no-trampolines", no_argument, NULL, option_no_trampolines },
+
++ { "auto-litpools", no_argument, NULL, option_auto_litpools },
++ { "no-auto-litpools", no_argument, NULL, option_no_auto_litpools },
++ { "auto-litpool-limit", required_argument, NULL, option_auto_litpool_limit },
++
+ { NULL, no_argument, NULL, 0 }
+ };
+
+@@ -961,6 +995,34 @@ md_parse_option (int c, char *arg)
+ use_trampolines = FALSE;
+ return 1;
+
++ case option_auto_litpools:
++ auto_litpools = TRUE;
++ use_literal_section = FALSE;
++ return 1;
++
++ case option_no_auto_litpools:
++ auto_litpools = FALSE;
++ auto_litpool_limit = -1;
++ return 1;
++
++ case option_auto_litpool_limit:
++ {
++ int value = 0;
++ if (auto_litpool_limit < 0)
++ as_fatal (_("no-auto-litpools is incompatible with auto-litpool-limit"));
++ if (*arg == 0 || *arg == '-')
++ as_fatal (_("invalid auto-litpool-limit argument"));
++ value = strtol (arg, &arg, 10);
++ if (*arg != 0)
++ as_fatal (_("invalid auto-litpool-limit argument"));
++ if (value < 100 || value > 10000)
++ as_fatal (_("invalid auto-litpool-limit argument (range is 100-10000)"));
++ auto_litpool_limit = value;
++ auto_litpools = TRUE;
++ use_literal_section = FALSE;
++ return 1;
++ }
++
+ default:
+ return 0;
+ }
+@@ -986,7 +1048,12 @@ Xtensa options:\n\
+ flix bundles\n\
+ --rename-section old=new Rename section 'old' to 'new'\n\
+ --[no-]trampolines [Do not] generate trampolines (jumps to jumps)\n\
+- when jumps do not reach their targets\n", stream);
++ when jumps do not reach their targets\n\
++ --[no-]auto-litpools [Do not] automatically create literal pools\n\
++ --auto-litpool-limit=<value>\n\
++ (range 100-10000) Maximum number of blocks of\n\
++ instructions to emit between literal pool\n\
++ locations; implies --auto-litpools flag\n", stream);
+ }
+
+
+@@ -4728,6 +4795,8 @@ xtensa_mark_literal_pool_location (void)
+ pool_location = frag_now;
+ frag_now->tc_frag_data.lit_frchain = frchain_now;
+ frag_now->tc_frag_data.literal_frag = frag_now;
++ /* Just record this frag. */
++ xtensa_maybe_create_literal_pool_frag (FALSE, FALSE);
+ frag_variant (rs_machine_dependent, 0, 0,
+ RELAX_LITERAL_POOL_BEGIN, NULL, 0, NULL);
+ xtensa_set_frag_assembly_state (frag_now);
+@@ -4832,6 +4901,31 @@ get_expanded_loop_offset (xtensa_opcode opcode)
+ static fragS *
+ get_literal_pool_location (segT seg)
+ {
++ struct litpool_seg *lps = litpool_seg_list.next;
++ struct litpool_frag *lpf;
++ for ( ; lps && lps->seg->id != seg->id; lps = lps->next)
++ ;
++ if (lps)
++ {
++ for (lpf = lps->frag_list.prev; lpf->fragP; lpf = lpf->prev)
++ { /* Skip "candidates" for now. */
++ if (lpf->fragP->fr_subtype == RELAX_LITERAL_POOL_BEGIN &&
++ lpf->priority == 1)
++ return lpf->fragP;
++ }
++ /* Must convert a lower-priority pool. */
++ for (lpf = lps->frag_list.prev; lpf->fragP; lpf = lpf->prev)
++ {
++ if (lpf->fragP->fr_subtype == RELAX_LITERAL_POOL_BEGIN)
++ return lpf->fragP;
++ }
++ /* Still no match -- try for a low priority pool. */
++ for (lpf = lps->frag_list.prev; lpf->fragP; lpf = lpf->prev)
++ {
++ if (lpf->fragP->fr_subtype == RELAX_LITERAL_POOL_CANDIDATE_BEGIN)
++ return lpf->fragP;
++ }
++ }
+ return seg_info (seg)->tc_segment_info_data.literal_pool_loc;
+ }
+
+@@ -7098,6 +7192,11 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
+ frag_now->tc_frag_data.slot_symbols[slot] = tinsn->symbol;
+ frag_now->tc_frag_data.slot_offsets[slot] = tinsn->offset;
+ frag_now->tc_frag_data.literal_frags[slot] = tinsn->literal_frag;
++ if (tinsn->opcode == xtensa_l32r_opcode)
++ {
++ frag_now->tc_frag_data.literal_frags[slot] =
++ tinsn->tok[1].X_add_symbol->sy_frag;
++ }
+ if (tinsn->literal_space != 0)
+ xg_assemble_literal_space (tinsn->literal_space, slot);
+ frag_now->tc_frag_data.free_reg[slot] = tinsn->extra_arg;
+@@ -7170,6 +7269,8 @@ xg_assemble_vliw_tokens (vliw_insn *vinsn)
+ frag_now->fr_symbol, frag_now->fr_offset, NULL);
+ xtensa_set_frag_assembly_state (frag_now);
+ xtensa_maybe_create_trampoline_frag ();
++ /* Always create one here. */
++ xtensa_maybe_create_literal_pool_frag (TRUE, FALSE);
+ }
+ else if (is_branch && do_align_targets ())
+ {
+@@ -7314,11 +7415,18 @@ xtensa_check_frag_count (void)
+ clear_frag_count ();
+ unreachable_count = 0;
+ }
++
++ /* We create an area for a possible literal pool every N (default 5000)
++ frags or so. */
++ xtensa_maybe_create_literal_pool_frag (TRUE, TRUE);
+ }
+
+ static xtensa_insnbuf trampoline_buf = NULL;
+ static xtensa_insnbuf trampoline_slotbuf = NULL;
+
++static xtensa_insnbuf litpool_buf = NULL;
++static xtensa_insnbuf litpool_slotbuf = NULL;
++
+ #define TRAMPOLINE_FRAG_SIZE 3000
+
+ static void
+@@ -7410,6 +7518,135 @@ dump_trampolines (void)
+ }
+ }
+
++static void dump_litpools (void) __attribute__ ((unused));
++
++static void
++dump_litpools (void)
++{
++ struct litpool_seg *lps = litpool_seg_list.next;
++ struct litpool_frag *lpf;
++
++ for ( ; lps ; lps = lps->next )
++ {
++ printf("litpool seg %s\n", lps->seg->name);
++ for ( lpf = lps->frag_list.next; lpf->fragP; lpf = lpf->next )
++ {
++ fragS *litfrag = lpf->fragP->fr_next;
++ int count = 0;
++ while (litfrag && litfrag->fr_subtype != RELAX_LITERAL_POOL_END)
++ {
++ if (litfrag->fr_fix == 4)
++ count++;
++ litfrag = litfrag->fr_next;
++ }
++ printf(" %ld <%d:%d> (%d) [%d]: ",
++ lpf->addr, lpf->priority, lpf->original_priority,
++ lpf->fragP->fr_line, count);
++ //dump_frag(lpf->fragP);
++ }
++ }
++}
++
++static void
++xtensa_maybe_create_literal_pool_frag (bfd_boolean create,
++ bfd_boolean only_if_needed)
++{
++ struct litpool_seg *lps = litpool_seg_list.next;
++ fragS *fragP;
++ struct litpool_frag *lpf;
++ bfd_boolean needed = FALSE;
++
++ if (use_literal_section || !auto_litpools)
++ return;
++
++ for ( ; lps ; lps = lps->next )
++ {
++ if (lps->seg == now_seg)
++ break;
++ }
++
++ if (lps == NULL)
++ {
++ lps = (struct litpool_seg *)xcalloc (sizeof (struct litpool_seg), 1);
++ lps->next = litpool_seg_list.next;
++ litpool_seg_list.next = lps;
++ lps->seg = now_seg;
++ lps->frag_list.next = &lps->frag_list;
++ lps->frag_list.prev = &lps->frag_list;
++ }
++
++ lps->frag_count++;
++
++ if (create)
++ {
++ if (only_if_needed)
++ {
++ if (past_xtensa_end || !use_transform() ||
++ frag_now->tc_frag_data.is_no_transform)
++ {
++ return;
++ }
++ if (auto_litpool_limit <= 0)
++ {
++ /* Don't create a litpool based only on frag count. */
++ return;
++ }
++ else if (lps->frag_count > auto_litpool_limit)
++ {
++ needed = TRUE;
++ }
++ else
++ {
++ return;
++ }
++ }
++ else
++ {
++ needed = TRUE;
++ }
++ }
++
++ if (needed)
++ {
++ int size = (only_if_needed) ? 3 : 0; /* Space for a "j" insn. */
++ /* Create a potential site for a literal pool. */
++ frag_wane (frag_now);
++ frag_new (0);
++ xtensa_set_frag_assembly_state (frag_now);
++ fragP = frag_now;
++ fragP->tc_frag_data.lit_frchain = frchain_now;
++ fragP->tc_frag_data.literal_frag = fragP;
++ frag_var (rs_machine_dependent, size, size,
++ (only_if_needed) ?
++ RELAX_LITERAL_POOL_CANDIDATE_BEGIN :
++ RELAX_LITERAL_POOL_BEGIN,
++ NULL, 0, NULL);
++ frag_now->tc_frag_data.lit_seg = now_seg;
++ frag_variant (rs_machine_dependent, 0, 0,
++ RELAX_LITERAL_POOL_END, NULL, 0, NULL);
++ xtensa_set_frag_assembly_state (frag_now);
++ }
++ else
++ {
++ /* RELAX_LITERAL_POOL_BEGIN frag is being created;
++ just record it here. */
++ fragP = frag_now;
++ }
++
++ lpf = (struct litpool_frag *)xmalloc(sizeof (struct litpool_frag));
++ /* Insert at tail of circular list. */
++ lpf->addr = 0;
++ lps->frag_list.prev->next = lpf;
++ lpf->next = &lps->frag_list;
++ lpf->prev = lps->frag_list.prev;
++ lps->frag_list.prev = lpf;
++ lpf->fragP = fragP;
++ lpf->priority = (needed) ? (only_if_needed) ? 3 : 2 : 1;
++ lpf->original_priority = lpf->priority;
++
++ lps->frag_count = 0;
++}
++
+ static void
+ xtensa_cleanup_align_frags (void)
+ {
+@@ -9029,7 +9266,41 @@ xtensa_relax_frag (fragS *fragP, long stretch, int *stretched_p)
+ break;
+
+ case RELAX_LITERAL_POOL_BEGIN:
++ if (fragP->fr_var != 0)
++ {
++ /* We have a converted "candidate" literal pool;
++ assemble a jump around it. */
++ TInsn insn;
++ if (!litpool_slotbuf)
++ {
++ litpool_buf = xtensa_insnbuf_alloc (isa);
++ litpool_slotbuf = xtensa_insnbuf_alloc (isa);
++ }
++ new_stretch += 3;
++ fragP->tc_frag_data.relax_seen = FALSE; /* Need another pass. */
++ fragP->tc_frag_data.is_insn = TRUE;
++ tinsn_init (&insn);
++ insn.insn_type = ITYPE_INSN;
++ insn.opcode = xtensa_j_opcode;
++ insn.ntok = 1;
++ set_expr_symbol_offset (&insn.tok[0], fragP->fr_symbol,
++ fragP->fr_fix);
++ fmt = xg_get_single_format (xtensa_j_opcode);
++ tinsn_to_slotbuf (fmt, 0, &insn, litpool_slotbuf);
++ xtensa_format_set_slot (isa, fmt, 0, litpool_buf, litpool_slotbuf);
++ xtensa_insnbuf_to_chars (isa, litpool_buf,
++ (unsigned char *)fragP->fr_literal +
++ fragP->fr_fix, 3);
++ fragP->fr_fix += 3;
++ fragP->fr_var -= 3;
++ /* Add a fix-up. */
++ fix_new (fragP, 0, 3, fragP->fr_symbol, 0, TRUE,
++ BFD_RELOC_XTENSA_SLOT0_OP);
++ }
++ break;
++
+ case RELAX_LITERAL_POOL_END:
++ case RELAX_LITERAL_POOL_CANDIDATE_BEGIN:
+ case RELAX_MAYBE_UNREACHABLE:
+ case RELAX_MAYBE_DESIRE_ALIGN:
+ /* No relaxation required. */
+@@ -10789,12 +11060,115 @@ xtensa_move_literals (void)
+ segT dest_seg;
+ fixS *fix, *next_fix, **fix_splice;
+ sym_list *lit;
++ struct litpool_seg *lps;
+
+ mark_literal_frags (literal_head->next);
+
+ if (use_literal_section)
+ return;
+
++ /* Assign addresses (rough estimates) to the potential literal pool locations
++ and create new ones if the gaps are too large. */
++
++ for (lps = litpool_seg_list.next; lps; lps = lps->next)
++ {
++ frchainS *frchP = seg_info (lps->seg)->frchainP;
++ struct litpool_frag *lpf = lps->frag_list.next;
++ addressT addr = 0;
++
++ for ( ; frchP; frchP = frchP->frch_next)
++ {
++ fragS *fragP;
++ for (fragP = frchP->frch_root; fragP; fragP = fragP->fr_next)
++ {
++ if (lpf && fragP == lpf->fragP)
++ {
++ gas_assert(fragP->fr_type == rs_machine_dependent &&
++ (fragP->fr_subtype == RELAX_LITERAL_POOL_BEGIN ||
++ fragP->fr_subtype == RELAX_LITERAL_POOL_CANDIDATE_BEGIN));
++ /* Found a litpool location. */
++ lpf->addr = addr;
++ lpf = lpf->next;
++ }
++ if (fragP->fr_type == rs_machine_dependent &&
++ fragP->fr_subtype == RELAX_SLOTS)
++ {
++ int slot;
++ for (slot = 0; slot < MAX_SLOTS; slot++)
++ {
++ if (fragP->tc_frag_data.literal_frags[slot])
++ {
++ /* L32R; point its literal to the nearest litpool
++ preferring non-"candidate" positions to avoid
++ the jump-around. */
++ fragS *litfrag = fragP->tc_frag_data.literal_frags[slot];
++ struct litpool_frag *lp = lpf->prev;
++ if (!lp->fragP)
++ {
++ break;
++ }
++ while (lp->fragP->fr_subtype ==
++ RELAX_LITERAL_POOL_CANDIDATE_BEGIN)
++ {
++ lp = lp->prev;
++ if (lp->fragP == NULL)
++ {
++ /* End of list; have to bite the bullet.
++ Take the nearest. */
++ lp = lpf->prev;
++ break;
++ }
++ /* Does it (conservatively) reach? */
++ if (addr - lp->addr <= 128 * 1024)
++ {
++ if (lp->fragP->fr_subtype == RELAX_LITERAL_POOL_BEGIN)
++ {
++ /* Found a good one. */
++ break;
++ }
++ else if (lp->prev->fragP &&
++ addr - lp->prev->addr > 128 * 1024)
++ {
++ /* This is still a "candidate" but the next one
++ will be too far away, so revert to the nearest
++ one, convert it and add the jump around. */
++ fragS *poolbeg;
++ fragS *poolend;
++ symbolS *lsym;
++ char label[10 + 2 * sizeof (fragS *)];
++ lp = lpf->prev;
++ poolbeg = lp->fragP;
++ lp->priority = 1;
++ poolbeg->fr_subtype = RELAX_LITERAL_POOL_BEGIN;
++ poolend = poolbeg->fr_next;
++ gas_assert (poolend->fr_type == rs_machine_dependent &&
++ poolend->fr_subtype == RELAX_LITERAL_POOL_END);
++ /* Create a local symbol pointing to the
++ end of the pool. */
++ sprintf (label, ".L0_LT_%p", poolbeg);
++ lsym = (symbolS *)local_symbol_make (label, lps->seg,
++ 0, poolend);
++ poolbeg->fr_symbol = lsym;
++ /* Rest is done in xtensa_relax_frag. */
++ }
++ }
++ }
++ if (! litfrag->tc_frag_data.literal_frag)
++ {
++ /* Take earliest use of this literal to avoid
++ forward refs. */
++ litfrag->tc_frag_data.literal_frag = lp->fragP;
++ }
++ }
++ }
++ }
++ addr += fragP->fr_fix;
++ if (fragP->fr_type == rs_fill)
++ addr += fragP->fr_offset;
++ }
++ }
++ }
++
+ for (segment = literal_head->next; segment; segment = segment->next)
+ {
+ /* Keep the literals for .init and .fini in separate sections. */
+@@ -10839,9 +11213,6 @@ xtensa_move_literals (void)
+ while (search_frag != frag_now)
+ {
+ next_frag = search_frag->fr_next;
+-
+- /* First, move the frag out of the literal section and
+- to the appropriate place. */
+ if (search_frag->tc_frag_data.literal_frag)
+ {
+ literal_pool = search_frag->tc_frag_data.literal_frag;
+@@ -10849,8 +11220,56 @@ xtensa_move_literals (void)
+ frchain_to = literal_pool->tc_frag_data.lit_frchain;
+ gas_assert (frchain_to);
+ }
++
++ if (search_frag->fr_type == rs_fill && search_frag->fr_fix == 0)
++ {
++ /* Skip empty fill frags. */
++ *frag_splice = next_frag;
++ search_frag = next_frag;
++ continue;
++ }
++
++ if (search_frag->fr_type == rs_align)
++ {
++ /* Skip alignment frags, because the pool as a whole will be
++ aligned if used, and we don't want to force alignment if the
++ pool is unused. */
++ *frag_splice = next_frag;
++ search_frag = next_frag;
++ continue;
++ }
++
++ /* First, move the frag out of the literal section and
++ to the appropriate place. */
++
++ /* Insert an aligmnent frag at start of pool. */
++ if (literal_pool->fr_next->fr_type == rs_machine_dependent &&
++ literal_pool->fr_next->fr_subtype == RELAX_LITERAL_POOL_END)
++ {
++ segT pool_seg = literal_pool->fr_next->tc_frag_data.lit_seg;
++ emit_state prev_state;
++ fragS *prev_frag;
++ fragS *align_frag;
++ xtensa_switch_section_emit_state (&prev_state, pool_seg, 0);
++ prev_frag = frag_now;
++ frag_variant (rs_fill, 0, 0, 0, NULL, 0, NULL);
++ align_frag = frag_now;
++ frag_align (2, 0, 0);
++ /* Splice it into the right place. */
++ prev_frag->fr_next = align_frag->fr_next;
++ align_frag->fr_next = literal_pool->fr_next;
++ literal_pool->fr_next = align_frag;
++ /* Insert after this one. */
++ literal_pool->tc_frag_data.literal_frag = align_frag;
++ xtensa_restore_emit_state (&prev_state);
++ }
+ insert_after = literal_pool->tc_frag_data.literal_frag;
+ dest_seg = insert_after->fr_next->tc_frag_data.lit_seg;
++ /* Skip align frag. */
++ if (insert_after->fr_next->fr_type == rs_align)
++ {
++ insert_after = insert_after->fr_next;
++ }
+
+ *frag_splice = next_frag;
+ search_frag->fr_next = insert_after->fr_next;
+@@ -11014,7 +11433,10 @@ xtensa_switch_to_non_abs_literal_fragment (emit_state *result)
+ && !recursive
+ && !is_init && ! is_fini)
+ {
+- as_bad (_("literal pool location required for text-section-literals; specify with .literal_position"));
++ if (!auto_litpools)
++ {
++ as_bad (_("literal pool location required for text-section-literals; specify with .literal_position"));
++ }
+
+ /* When we mark a literal pool location, we want to put a frag in
+ the literal pool that points to it. But to do that, we want to
+diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h
+index b2e43fa..290d902 100644
+--- a/gas/config/tc-xtensa.h
++++ b/gas/config/tc-xtensa.h
+@@ -124,6 +124,7 @@ enum xtensa_relax_statesE
+
+ RELAX_LITERAL_POOL_BEGIN,
+ RELAX_LITERAL_POOL_END,
++ RELAX_LITERAL_POOL_CANDIDATE_BEGIN,
+ /* Technically these are not relaxations at all but mark a location
+ to store literals later. Note that fr_var stores the frchain for
+ BEGIN frags and fr_var stores now_seg for END frags. */
+diff --git a/gas/testsuite/gas/xtensa/all.exp b/gas/testsuite/gas/xtensa/all.exp
+index d197ec8..db39629 100644
+--- a/gas/testsuite/gas/xtensa/all.exp
++++ b/gas/testsuite/gas/xtensa/all.exp
+@@ -100,5 +100,6 @@ if [istarget xtensa*-*-*] then {
+ run_dump_test "jlong"
+ run_dump_test "trampoline"
++ run_dump_test "auto-litpools"
+ }
+
+ if [info exists errorInfo] then {
+diff --git a/gas/testsuite/gas/xtensa/auto-litpools.d b/gas/testsuite/gas/xtensa/auto-litpools.d
+new file mode 100644
+index 0000000..4d1a690
+--- /dev/null
++++ b/gas/testsuite/gas/xtensa/auto-litpools.d
+@@ -0,0 +1,12 @@
++#as: --auto-litpools
++#objdump: -d
++#name: auto literal pool placement
++
++.*: +file format .*xtensa.*
++#...
++.*4:.*l32r.a2, 0 .*
++#...
++.*3e437:.*j.3e440 .*
++#...
++.*40750:.*l32r.a2, 3e43c .*
++#...
+diff --git a/gas/testsuite/gas/xtensa/auto-litpools.s b/gas/testsuite/gas/xtensa/auto-litpools.s
+new file mode 100644
+index 0000000..9a5b26b
+--- /dev/null
++++ b/gas/testsuite/gas/xtensa/auto-litpools.s
+@@ -0,0 +1,13 @@
++ .text
++ .align 4
++ .literal .L0, 0x12345
++ .literal .L1, 0x12345
++
++f:
++ l32r a2, .L0
++ .rep 44000
++ _nop
++ _nop
++ .endr
++ l32r a2, .L1
++ ret
+--
+1.8.1.4
+
diff --git a/patches/binutils/2.25.1/500-sysroot.patch b/patches/binutils/2.25.1/500-sysroot.patch
new file mode 100644
index 0000000..e49c795
--- /dev/null
+++ b/patches/binutils/2.25.1/500-sysroot.patch
@@ -0,0 +1,37 @@
+Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
+
+Always try to prepend the sysroot prefix to absolute filenames first.
+
+http://bugs.gentoo.org/275666
+http://sourceware.org/bugzilla/show_bug.cgi?id=10340
+
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -308,18 +308,25 @@
+ directory first. */
+ if (! entry->flags.maybe_archive)
+ {
+- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename))
++ /* For absolute pathnames, try to always open the file in the
++ sysroot first. If this fails, try to open the file at the
++ given location. */
++ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename);
++ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)
++ && ld_sysroot)
+ {
+ char *name = concat (ld_sysroot, entry->filename,
+ (const char *) NULL);
+ if (ldfile_try_open_bfd (name, entry))
+ {
+ entry->filename = name;
++ entry->flags.sysrooted = TRUE;
+ return TRUE;
+ }
+ free (name);
+ }
+- else if (ldfile_try_open_bfd (entry->filename, entry))
++
++ if (ldfile_try_open_bfd (entry->filename, entry))
+ return TRUE;
+
+ if (IS_ABSOLUTE_PATH (entry->filename))
diff --git a/patches/binutils/2.25.1/600-poison-system-directories.patch b/patches/binutils/2.25.1/600-poison-system-directories.patch
new file mode 100644
index 0000000..ec3622b
--- /dev/null
+++ b/patches/binutils/2.25.1/600-poison-system-directories.patch
@@ -0,0 +1,276 @@
+Patch adapted to binutils 2.23.2 and extended to use
+BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni.
+
+[Gustavo: adapt to binutils 2.25]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+
+Patch originally created by Mark Hatle, forward-ported to
+binutils 2.21 by Scott Garman.
+
+purpose: warn for uses of system directories when cross linking
+
+Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
+
+2008-07-02 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * ld.h (args_type): Add error_poison_system_directories.
+ * ld.texinfo (--error-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.error_poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.error_poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --error-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-06-13 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * config.in: Regenerate.
+ * ld.h (args_type): Add poison_system_directories.
+ * ld.texinfo (--no-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --no-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-04-20 Joseph Myers <joseph@codesourcery.com>
+
+ Merge from Sourcery G++ binutils 2.17:
+
+ 2007-03-20 Joseph Myers <joseph@codesourcery.com>
+ Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+ ld/
+ * configure.ac (--enable-poison-system-directories): New option.
+ * configure, config.in: Regenerate.
+ * ldfile.c (ldfile_add_library_path): If
+ ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+ /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Nura a/ld/config.in b/ld/config.in
+--- a/ld/config.in 2014-10-14 04:32:04.000000000 -0300
++++ b/ld/config.in 2014-12-24 08:07:28.997918918 -0300
+@@ -11,6 +11,9 @@
+ language is requested. */
+ #undef ENABLE_NLS
+
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+
+diff -Nura a/ld/configure b/ld/configure
+--- a/ld/configure 2014-12-23 11:22:07.000000000 -0300
++++ b/ld/configure 2014-12-24 08:07:29.002919088 -0300
+@@ -783,6 +783,7 @@
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_werror
+@@ -1439,6 +1440,8 @@
+ --disable-largefile omit support for large files
+ --enable-targets alternative target configurations
+ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
++ --enable-poison-system-directories
++ warn for use of native system library directories
+ --enable-gold[=ARG] build gold [ARG={default,yes,no}]
+ --enable-got=<type> GOT handling scheme (target, single, negative,
+ multigot)
+@@ -15487,7 +15490,18 @@
+ fi
+
+
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++ enableval=$enable_poison_system_directories;
++else
++ enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
+
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
+
+ # Check whether --enable-got was given.
+ if test "${enable_got+set}" = set; then :
+diff -Nura a/ld/configure.ac b/ld/configure.ac
+--- a/ld/configure.ac 2014-10-14 04:32:04.000000000 -0300
++++ b/ld/configure.ac 2014-12-24 08:07:29.002919088 -0300
+@@ -94,6 +94,16 @@
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system library directories]),,
++ [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++ [1],
++ [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+diff -Nura a/ld/ldfile.c b/ld/ldfile.c
+--- a/ld/ldfile.c 2014-10-14 04:32:04.000000000 -0300
++++ b/ld/ldfile.c 2014-12-24 08:07:29.002919088 -0300
+@@ -114,6 +114,23 @@
+ new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
+ else
+ new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (command_line.poison_system_directories
++ && ((!strncmp (name, "/lib", 4))
++ || (!strncmp (name, "/usr/lib", 8))
++ || (!strncmp (name, "/usr/local/lib", 14))
++ || (!strncmp (name, "/usr/X11R6/lib", 14))))
++ {
++ if (command_line.error_poison_system_directories)
++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ else
++ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ }
++#endif
++
+ }
+
+ /* Try to open a BFD for a lang_input_statement. */
+diff -Nura a/ld/ld.h b/ld/ld.h
+--- a/ld/ld.h 2014-10-14 04:32:04.000000000 -0300
++++ b/ld/ld.h 2014-12-24 08:07:29.003919122 -0300
+@@ -161,6 +161,14 @@
+ /* If TRUE we'll just print the default output on stdout. */
+ bfd_boolean print_output_format;
+
++ /* If TRUE (the default) warn for uses of system directories when
++ cross linking. */
++ bfd_boolean poison_system_directories;
++
++ /* If TRUE (default FALSE) give an error for uses of system
++ directories when cross linking instead of a warning. */
++ bfd_boolean error_poison_system_directories;
++
+ /* Big or little endian as set on command line. */
+ enum endian_enum endian;
+
+diff -Nura a/ld/ldlex.h b/ld/ldlex.h
+--- a/ld/ldlex.h 2014-11-04 06:54:41.000000000 -0300
++++ b/ld/ldlex.h 2014-12-24 08:09:47.477644294 -0300
+@@ -140,6 +140,8 @@
+ OPTION_IGNORE_UNRESOLVED_SYMBOL,
+ OPTION_PUSH_STATE,
+ OPTION_POP_STATE,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+
+ /* The initial parser states. */
+diff -Nura a/ld/ldmain.c b/ld/ldmain.c
+--- a/ld/ldmain.c 2014-10-14 04:32:04.000000000 -0300
++++ b/ld/ldmain.c 2014-12-24 08:07:29.003919122 -0300
+@@ -266,6 +266,8 @@
+ command_line.warn_mismatch = TRUE;
+ command_line.warn_search_mismatch = TRUE;
+ command_line.check_section_addresses = -1;
++ command_line.poison_system_directories = TRUE;
++ command_line.error_poison_system_directories = FALSE;
+
+ /* We initialize DEMANGLING based on the environment variable
+ COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
+diff -Nura a/ld/ld.texinfo b/ld/ld.texinfo
+--- a/ld/ld.texinfo 2014-12-23 05:47:10.000000000 -0300
++++ b/ld/ld.texinfo 2014-12-24 08:07:29.005919191 -0300
+@@ -2212,6 +2212,18 @@
+
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking. This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+
+ @c man end
+diff -Nura a/ld/lexsup.c b/ld/lexsup.c
+--- a/ld/lexsup.c 2014-11-04 06:54:41.000000000 -0300
++++ b/ld/lexsup.c 2014-12-24 08:48:50.136583414 -0300
+@@ -513,6 +513,14 @@
+ { {"pop-state", no_argument, NULL, OPTION_POP_STATE},
+ '\0', NULL, N_("Pop state of flags governing input file handling"),
+ TWO_DASHES },
++ { {"no-poison-system-directories", no_argument, NULL,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Do not warn for -L options using system directories"),
++ TWO_DASHES },
++ { {"error-poison-system-directories", no_argument, NULL,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Give an error for -L options using system directories"),
++ TWO_DASHES },
+ };
+
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -525,6 +533,7 @@
+ int ingroup = 0;
+ char *default_dirlist = NULL;
+ char *shortopts;
++ char *BR_paranoid_env;
+ struct option *longopts;
+ struct option *really_longopts;
+ int last_optind;
+@@ -1458,6 +1467,14 @@
+ }
+ break;
+
++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++ command_line.poison_system_directories = FALSE;
++ break;
++
++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++ command_line.error_poison_system_directories = TRUE;
++ break;
++
+ case OPTION_PUSH_STATE:
+ input_flags.pushed = xmemdup (&input_flags,
+ sizeof (input_flags),
+@@ -1483,6 +1500,10 @@
+ command_line.soname = NULL;
+ }
+
++ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
++ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0)
++ command_line.error_poison_system_directories = TRUE;
++
+ while (ingroup)
+ {
+ lang_leave_group ();
diff --git a/patches/binutils/2.25/300-001_ld_makefile_patch.patch b/patches/binutils/2.25/300-001_ld_makefile_patch.patch
deleted file mode 100644
index 2a1320c..0000000
--- a/patches/binutils/2.25/300-001_ld_makefile_patch.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/ld/Makefile.am b/ld/Makefile.am
-index 9575f1f..84df0bf 100644
---- a/ld/Makefile.am
-+++ b/ld/Makefile.am
-@@ -54,7 +54,7 @@ endif
- # 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 --git a/ld/Makefile.in b/ld/Makefile.in
-index 9f56ca1..272860f 100644
---- a/ld/Makefile.in
-+++ b/ld/Makefile.in
-@@ -388,7 +388,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
- # 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
diff --git a/patches/binutils/2.25/300-012_check_ldrunpath_length.patch b/patches/binutils/2.25/300-012_check_ldrunpath_length.patch
deleted file mode 100644
index f1f31af..0000000
--- a/patches/binutils/2.25/300-012_check_ldrunpath_length.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
-index 137446f..bb8391a 100644
---- a/ld/emultempl/elf32.em
-+++ b/ld/emultempl/elf32.em
-@@ -1195,6 +1195,8 @@ fragment <<EOF
- && 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;
-@@ -1458,6 +1460,8 @@ gld${EMULATION_NAME}_before_allocation (void)
- rpath = command_line.rpath;
- if (rpath == NULL)
- rpath = (const char *) getenv ("LD_RUN_PATH");
-+ if ((rpath) && (*rpath == '\0'))
-+ rpath = NULL;
-
- for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
- if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
diff --git a/patches/binutils/2.25/340-Darwin-gold-binary-cc-include-string-not-cstring.patch b/patches/binutils/2.25/340-Darwin-gold-binary-cc-include-string-not-cstring.patch
deleted file mode 100644
index 33441cc..0000000
--- a/patches/binutils/2.25/340-Darwin-gold-binary-cc-include-string-not-cstring.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- binutils-2.25.orig/gold/binary.cc 2015-06-09 10:48:32.000000000 +0100
-+++ binutils-2.25/gold/binary.cc 2015-06-09 10:49:23.000000000 +0100
-@@ -23,7 +23,7 @@
- #include "gold.h"
-
- #include <cerrno>
--#include <cstring>
-+#include <string>
- #include "safe-ctype.h"
-
- #include "elfcpp.h"
diff --git a/patches/binutils/2.25/350-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch b/patches/binutils/2.25/350-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch
deleted file mode 100644
index 871d239..0000000
--- a/patches/binutils/2.25/350-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From c39479f4ab4d372b518957871e1f205a03e7c3d6 Mon Sep 17 00:00:00 2001
-From: Andrew Hsieh <andrewhsieh@google.com>
-Date: Wed, 18 Mar 2015 10:57:24 +0800
-Subject: [PATCH] Fix darwin build
-
-1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4
- doesn't support ended initializer list
-2. wcsncasecmp doesn't exist in MacSDK10.6.x
-
-Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e
----
- binutils-2.25/bfd/peXXigen.c | 22 ++++++++++++++++++++++
- binutils-2.25/gold/gold-threads.cc | 15 ++++++++++++---
- 2 files changed, 34 insertions(+), 3 deletions(-)
-
-diff --git binutils-2.25.orig/bfd/peXXigen.c binutils-2.25/bfd/peXXigen.c
-index 13e39e4..7a98306 100644
---- binutils-2.25.orig/bfd/peXXigen.c
-+++ binutils-2.25/bfd/peXXigen.c
-@@ -3522,6 +3522,28 @@ u16_mbtouc (wchar_t * puc, const unsigned short * s, unsigned int n)
- }
- #endif /* HAVE_WCHAR_H and not Cygwin/Mingw */
-
-+#ifdef __APPLE__
-+/* wcsncasecmp isn't always defined in Mac SDK */
-+static int
-+wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
-+{
-+ wchar_t c1, c2;
-+
-+ if (n == 0)
-+ return (0);
-+ for (; *s1; s1++, s2++)
-+ {
-+ c1 = towlower(*s1);
-+ c2 = towlower(*s2);
-+ if (c1 != c2)
-+ return ((int)c1 - c2);
-+ if (--n == 0)
-+ return (0);
-+ }
-+ return (-*s2);
-+}
-+#endif
-+
- /* Perform a comparison of two entries. */
- static signed int
- rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)
-diff --git binutils-2.25.orig/gold/gold-threads.cc binutils-2.25/gold/gold-threads.cc
-index ff5a8ac..45140e0 100644
---- binutils-2.25.orig/gold/gold-threads.cc
-+++ binutils-2.25/gold/gold-threads.cc
-@@ -284,9 +284,18 @@ Condvar::~Condvar()
- class Once_initialize
- {
- public:
-- Once_initialize()
-- : once_(PTHREAD_ONCE_INIT)
-- { }
-+ Once_initialize()
-+#if !defined(__APPLE__)
-+ : once_(PTHREAD_ONCE_INIT)
-+ { }
-+#else
-+// In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support
-+// extended initializer list as above */
-+ {
-+ pthread_once_t once_2 = PTHREAD_ONCE_INIT;
-+ once_ = once_2;
-+ }
-+#endif
-
- // Return a pointer to the pthread_once_t variable.
- pthread_once_t*
---
-2.1.3
-
diff --git a/patches/cloog-ppl/0.15.10/100-add_on_libs_position.patch b/patches/cloog-ppl/0.15.10/100-add_on_libs_position.patch
deleted file mode 100644
index 2e97b5a..0000000
--- a/patches/cloog-ppl/0.15.10/100-add_on_libs_position.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naurd cloog-ppl-0.15.10-a/configure cloog-ppl-0.15.10-b/configure
---- cloog-ppl-0.15.10-a/configure 2010-08-27 21:14:33.000000000 +0200
-+++ cloog-ppl-0.15.10-b/configure 2012-01-27 13:28:49.262987773 +0100
-@@ -11168,7 +11168,7 @@
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
-
- $as_echo "#define CLOOG_PPL_BACKEND 1" >>confdefs.h
-
-diff -Naurd cloog-ppl-0.15.10-a/configure.in cloog-ppl-0.15.10-b/configure.in
---- cloog-ppl-0.15.10-a/configure.in 2010-08-27 21:13:48.000000000 +0200
-+++ cloog-ppl-0.15.10-b/configure.in 2012-01-27 13:28:49.262987773 +0100
-@@ -343,7 +343,7 @@
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
- AC_DEFINE([CLOOG_PPL_BACKEND], 1, [Use the PPL backend])
-
- else
diff --git a/patches/cloog-ppl/0.15.11/100-add_on_libs_position.patch b/patches/cloog-ppl/0.15.11/100-add_on_libs_position.patch
deleted file mode 100644
index 21f7213..0000000
--- a/patches/cloog-ppl/0.15.11/100-add_on_libs_position.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naurd cloog-ppl-0.15.11-a/configure cloog-ppl-0.15.11-b/configure
---- cloog-ppl-0.15.11-a/configure 2011-04-01 06:22:53.000000000 +0200
-+++ cloog-ppl-0.15.11-b/configure 2012-01-27 13:29:42.698987517 +0100
-@@ -11238,7 +11238,7 @@
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
-
- $as_echo "#define CLOOG_PPL_BACKEND 1" >>confdefs.h
-
-diff -Naurd cloog-ppl-0.15.11-a/configure.in cloog-ppl-0.15.11-b/configure.in
---- cloog-ppl-0.15.11-a/configure.in 2010-08-27 21:13:48.000000000 +0200
-+++ cloog-ppl-0.15.11-b/configure.in 2012-01-27 13:29:42.698987517 +0100
-@@ -343,7 +343,7 @@
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
- AC_DEFINE([CLOOG_PPL_BACKEND], 1, [Use the PPL backend])
-
- else
diff --git a/patches/cloog-ppl/0.15.6/100-add_on_libs_position.patch b/patches/cloog-ppl/0.15.6/100-add_on_libs_position.patch
deleted file mode 100644
index 6364292..0000000
--- a/patches/cloog-ppl/0.15.6/100-add_on_libs_position.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naurd cloog-ppl-0.15.6-a/configure cloog-ppl-0.15.6-b/configure
---- cloog-ppl-0.15.6-a/configure 2009-08-10 23:18:07.000000000 +0200
-+++ cloog-ppl-0.15.6-b/configure 2012-01-27 13:25:08.858988857 +0100
-@@ -12917,7 +12917,7 @@
-
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
-
- cat >>confdefs.h <<\_ACEOF
- #define CLOOG_PPL_BACKEND 1
-diff -Naurd cloog-ppl-0.15.6-a/configure.in cloog-ppl-0.15.6-b/configure.in
---- cloog-ppl-0.15.6-a/configure.in 2009-08-10 23:18:07.000000000 +0200
-+++ cloog-ppl-0.15.6-b/configure.in 2012-01-27 13:25:08.862988846 +0100
-@@ -354,7 +354,7 @@
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
- AC_DEFINE([CLOOG_PPL_BACKEND], 1, [Use the PPL backend])
-
- else
diff --git a/patches/cloog-ppl/0.15.7/100-add_on_libs_position.patch b/patches/cloog-ppl/0.15.7/100-add_on_libs_position.patch
deleted file mode 100644
index cc37b7d..0000000
--- a/patches/cloog-ppl/0.15.7/100-add_on_libs_position.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naurd cloog-ppl-0.15.7-a/configure cloog-ppl-0.15.7-b/configure
---- cloog-ppl-0.15.7-a/configure 2009-08-12 03:33:31.000000000 +0200
-+++ cloog-ppl-0.15.7-b/configure 2012-01-27 13:26:13.970988501 +0100
-@@ -12902,7 +12902,7 @@
-
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
-
- cat >>confdefs.h <<\_ACEOF
- #define CLOOG_PPL_BACKEND 1
-diff -Naurd cloog-ppl-0.15.7-a/configure.in cloog-ppl-0.15.7-b/configure.in
---- cloog-ppl-0.15.7-a/configure.in 2009-08-12 03:33:31.000000000 +0200
-+++ cloog-ppl-0.15.7-b/configure.in 2012-01-27 13:26:13.970988501 +0100
-@@ -345,7 +345,7 @@
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
- AC_DEFINE([CLOOG_PPL_BACKEND], 1, [Use the PPL backend])
-
- else
diff --git a/patches/cloog-ppl/0.15.8/100-add_on_libs_position.patch b/patches/cloog-ppl/0.15.8/100-add_on_libs_position.patch
deleted file mode 100644
index 4a44bae..0000000
--- a/patches/cloog-ppl/0.15.8/100-add_on_libs_position.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naurd cloog-ppl-0.15.8-a/configure cloog-ppl-0.15.8-b/configure
---- cloog-ppl-0.15.8-a/configure 2010-02-11 19:05:30.000000000 +0100
-+++ cloog-ppl-0.15.8-b/configure 2012-01-27 13:27:09.710988253 +0100
-@@ -12902,7 +12902,7 @@
-
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
-
- cat >>confdefs.h <<\_ACEOF
- #define CLOOG_PPL_BACKEND 1
-diff -Naurd cloog-ppl-0.15.8-a/configure.in cloog-ppl-0.15.8-b/configure.in
---- cloog-ppl-0.15.8-a/configure.in 2010-02-11 19:05:31.000000000 +0100
-+++ cloog-ppl-0.15.8-b/configure.in 2012-01-27 13:27:09.710988253 +0100
-@@ -345,7 +345,7 @@
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
- AC_DEFINE([CLOOG_PPL_BACKEND], 1, [Use the PPL backend])
-
- else
diff --git a/patches/cloog-ppl/0.15.9/100-add_on_libs_position.patch b/patches/cloog-ppl/0.15.9/100-add_on_libs_position.patch
deleted file mode 100644
index 94c4c8b..0000000
--- a/patches/cloog-ppl/0.15.9/100-add_on_libs_position.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naurd cloog-ppl-0.15.9-a/configure cloog-ppl-0.15.9-b/configure
---- cloog-ppl-0.15.9-a/configure 2010-03-23 22:29:47.000000000 +0100
-+++ cloog-ppl-0.15.9-b/configure 2012-01-27 13:28:03.866987993 +0100
-@@ -12902,7 +12902,7 @@
-
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
-
- cat >>confdefs.h <<\_ACEOF
- #define CLOOG_PPL_BACKEND 1
-diff -Naurd cloog-ppl-0.15.9-a/configure.in cloog-ppl-0.15.9-b/configure.in
---- cloog-ppl-0.15.9-a/configure.in 2010-03-23 22:29:47.000000000 +0100
-+++ cloog-ppl-0.15.9-b/configure.in 2012-01-27 13:28:03.866987993 +0100
-@@ -345,7 +345,7 @@
- #endif
- ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
-
-- LIBS="$LIBS -lppl_c -lppl -lgmpxx"
-+ LIBS="-lppl_c -lppl -lgmpxx $LIBS"
- AC_DEFINE([CLOOG_PPL_BACKEND], 1, [Use the PPL backend])
-
- else
diff --git a/patches/gcc/4.2.4/100-uclibc-conf.patch b/patches/gcc/4.2.4/100-uclibc-conf.patch
deleted file mode 100644
index 7261dae..0000000
--- a/patches/gcc/4.2.4/100-uclibc-conf.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-diff -durN gcc-4.2.1.orig/boehm-gc/configure gcc-4.2.1/boehm-gc/configure
---- gcc-4.2.1.orig/boehm-gc/configure 2007-07-19 16:33:56.000000000 +0200
-+++ gcc-4.2.1/boehm-gc/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -4323,7 +4323,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/contrib/regression/objs-gcc.sh gcc-4.2.1/contrib/regression/objs-gcc.sh
---- gcc-4.2.1.orig/contrib/regression/objs-gcc.sh 2005-08-15 02:41:31.000000000 +0200
-+++ gcc-4.2.1/contrib/regression/objs-gcc.sh 2007-08-03 20:29:22.000000000 +0200
-@@ -105,6 +105,10 @@
- then
- make all-gdb all-dejagnu all-ld || exit 1
- make install-gdb install-dejagnu install-ld || exit 1
-+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
-+ then
-+ make all-gdb all-dejagnu all-ld || exit 1
-+ make install-gdb install-dejagnu install-ld || exit 1
- elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
- make bootstrap || exit 1
- make install || exit 1
-diff -durN gcc-4.2.1.orig/gcc/config/cris/linux.h gcc-4.2.1/gcc/config/cris/linux.h
---- gcc-4.2.1.orig/gcc/config/cris/linux.h 2006-02-18 12:12:51.000000000 +0100
-+++ gcc-4.2.1/gcc/config/cris/linux.h 2007-08-03 20:29:22.000000000 +0200
-@@ -74,7 +74,11 @@
- #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
-
- #undef CRIS_SUBTARGET_VERSION
--#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-+#if UCLIBC_DEFAULT
-+# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
-+#else
-+# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
-+#endif
-
- #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-
-diff -durN gcc-4.2.1.orig/libffi/configure gcc-4.2.1/libffi/configure
---- gcc-4.2.1.orig/libffi/configure 2007-07-19 16:33:56.000000000 +0200
-+++ gcc-4.2.1/libffi/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -3460,7 +3460,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libgfortran/configure gcc-4.2.1/libgfortran/configure
---- gcc-4.2.1.orig/libgfortran/configure 2007-07-19 16:33:56.000000000 +0200
-+++ gcc-4.2.1/libgfortran/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -3721,7 +3721,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libgomp/configure gcc-4.2.1/libgomp/configure
---- gcc-4.2.1.orig/libgomp/configure 2007-07-19 16:33:56.000000000 +0200
-+++ gcc-4.2.1/libgomp/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -3893,7 +3893,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libjava/classpath/configure gcc-4.2.1/libjava/classpath/configure
---- gcc-4.2.1.orig/libjava/classpath/configure 2007-01-17 19:10:26.000000000 +0100
-+++ gcc-4.2.1/libjava/classpath/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -5307,7 +5307,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libjava/classpath/ltconfig gcc-4.2.1/libjava/classpath/ltconfig
---- gcc-4.2.1.orig/libjava/classpath/ltconfig 2006-08-07 22:37:50.000000000 +0200
-+++ gcc-4.2.1/libjava/classpath/ltconfig 2007-08-03 20:29:22.000000000 +0200
-@@ -603,7 +603,7 @@
-
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
--linux-gnu*) ;;
-+linux-gnu*|linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-
-@@ -1251,7 +1251,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
-diff -durN gcc-4.2.1.orig/libjava/configure gcc-4.2.1/libjava/configure
---- gcc-4.2.1.orig/libjava/configure 2007-07-19 16:33:56.000000000 +0200
-+++ gcc-4.2.1/libjava/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -5424,7 +5424,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libmudflap/configure gcc-4.2.1/libmudflap/configure
---- gcc-4.2.1.orig/libmudflap/configure 2006-12-04 12:13:07.000000000 +0100
-+++ gcc-4.2.1/libmudflap/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -5394,7 +5394,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libobjc/configure gcc-4.2.1/libobjc/configure
---- gcc-4.2.1.orig/libobjc/configure 2006-10-15 09:42:57.000000000 +0200
-+++ gcc-4.2.1/libobjc/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -3314,7 +3314,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libssp/configure gcc-4.2.1/libssp/configure
---- gcc-4.2.1.orig/libssp/configure 2006-10-15 09:42:57.000000000 +0200
-+++ gcc-4.2.1/libssp/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -4480,7 +4480,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
---- gcc-4.2.1.orig/libstdc++-v3/configure 2007-06-29 01:02:05.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -4283,7 +4283,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/libtool.m4 gcc-4.2.1/libtool.m4
---- gcc-4.2.1.orig/libtool.m4 2005-07-16 04:30:53.000000000 +0200
-+++ gcc-4.2.1/libtool.m4 2007-08-03 20:29:22.000000000 +0200
-@@ -739,7 +739,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-diff -durN gcc-4.2.1.orig/ltconfig gcc-4.2.1/ltconfig
---- gcc-4.2.1.orig/ltconfig 2007-02-14 18:08:35.000000000 +0100
-+++ gcc-4.2.1/ltconfig 2007-08-03 20:29:22.000000000 +0200
-@@ -603,7 +603,7 @@
-
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
--linux-gnu*) ;;
-+linux-gnu*|linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-
-@@ -1251,7 +1251,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
-diff -durN gcc-4.2.1.orig/zlib/configure gcc-4.2.1/zlib/configure
---- gcc-4.2.1.orig/zlib/configure 2007-01-17 19:10:26.000000000 +0100
-+++ gcc-4.2.1/zlib/configure 2007-08-03 20:29:22.000000000 +0200
-@@ -3429,7 +3429,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
diff --git a/patches/gcc/4.2.4/110-uclibc-conf-noupstream.patch b/patches/gcc/4.2.4/110-uclibc-conf-noupstream.patch
deleted file mode 100644
index 1c239d6..0000000
--- a/patches/gcc/4.2.4/110-uclibc-conf-noupstream.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
---- gcc-4.2.1.orig/gcc/config.gcc 2007-02-03 06:25:20.000000000 +0100
-+++ gcc-4.2.1/gcc/config.gcc 2007-08-03 20:29:52.000000000 +0200
-@@ -1964,7 +1964,7 @@
- ;;
- sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
- sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
-- sh-*-linux* | sh[346lbe]*-*-linux* | \
-+ sh*-*-linux* | sh[346lbe]*-*-linux* | \
- sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
- sh64-*-netbsd* | sh64l*-*-netbsd*)
- tmake_file="${tmake_file} sh/t-sh sh/t-elf"
diff --git a/patches/gcc/4.2.4/120-uclibc-locale.patch b/patches/gcc/4.2.4/120-uclibc-locale.patch
deleted file mode 100644
index 298c505..0000000
--- a/patches/gcc/4.2.4/120-uclibc-locale.patch
+++ /dev/null
@@ -1,2806 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4
---- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 2007-06-29 01:02:05.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/acinclude.m4 2007-08-03 20:30:21.000000000 +0200
-@@ -1334,7 +1334,7 @@
- AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
- GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
- [use MODEL for target locale package],
-- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
-+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
-
- # Deal with gettext issues. Default to not using it (=no) until we detect
- # support for it later. Let the user turn it off via --e/d, but let that
-@@ -1355,6 +1355,9 @@
- # Default to "generic".
- if test $enable_clocale_flag = auto; then
- case ${target_os} in
-+ *-uclibc*)
-+ enable_clocale_flag=uclibc
-+ ;;
- linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
- enable_clocale_flag=gnu
- ;;
-@@ -1526,6 +1529,40 @@
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
-+ uclibc)
-+ AC_MSG_RESULT(uclibc)
-+
-+ # Declare intention to use gettext, and add support for specific
-+ # languages.
-+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+ ALL_LINGUAS="de fr"
-+
-+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
-+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+ USE_NLS=yes
-+ fi
-+ # Export the build objects.
-+ for ling in $ALL_LINGUAS; do \
-+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
-+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
-+ done
-+ AC_SUBST(glibcxx_MOFILES)
-+ AC_SUBST(glibcxx_POFILES)
-+
-+ CLOCALE_H=config/locale/uclibc/c_locale.h
-+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+ CMESSAGES_H=config/locale/uclibc/messages_members.h
-+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+ CTIME_H=config/locale/uclibc/time_members.h
-+ CTIME_CC=config/locale/uclibc/time_members.cc
-+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+ ;;
- esac
-
- # This is where the testsuite looks for locale catalogs, using the
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,160 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8 Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <cerrno> // For errno
-+#include <locale>
-+#include <stdexcept>
-+#include <langinfo.h>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
-+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
-+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
-+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
-+#define __strtof_l(S, E, L) strtof((S), (E))
-+#define __strtod_l(S, E, L) strtod((S), (E))
-+#define __strtold_l(S, E, L) strtold((S), (E))
-+#warning should dummy __newlocale check for C|POSIX ?
-+#define __newlocale(a, b, c) NULL
-+#define __freelocale(a) ((void)0)
-+#define __duplocale(a) __c_locale()
-+#endif
-+
-+namespace std
-+{
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
-+ const __c_locale& __cloc)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ float __f = __strtof_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && errno != ERANGE)
-+ __v = __f;
-+ else
-+ __err |= ios_base::failbit;
-+ }
-+ }
-+
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
-+ const __c_locale& __cloc)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ double __d = __strtod_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && errno != ERANGE)
-+ __v = __d;
-+ else
-+ __err |= ios_base::failbit;
-+ }
-+ }
-+
-+ template<>
-+ void
-+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
-+ const __c_locale& __cloc)
-+ {
-+ if (!(__err & ios_base::failbit))
-+ {
-+ char* __sanity;
-+ errno = 0;
-+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && errno != ERANGE)
-+ __v = __ld;
-+ else
-+ __err |= ios_base::failbit;
-+ }
-+ }
-+
-+ void
-+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
-+ __c_locale __old)
-+ {
-+ __cloc = __newlocale(1 << LC_ALL, __s, __old);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ if (!__cloc)
-+ {
-+ // This named locale is not supported by the underlying OS.
-+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
-+ "name not valid"));
-+ }
-+#endif
-+ }
-+
-+ void
-+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
-+ {
-+ if (_S_get_c_locale() != __cloc)
-+ __freelocale(__cloc);
-+ }
-+
-+ __c_locale
-+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
-+ { return __duplocale(__cloc); }
-+} // namespace std
-+
-+namespace __gnu_cxx
-+{
-+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
-+ {
-+ "LC_CTYPE",
-+ "LC_NUMERIC",
-+ "LC_TIME",
-+ "LC_COLLATE",
-+ "LC_MONETARY",
-+ "LC_MESSAGES",
-+#if _GLIBCXX_NUM_CATEGORIES != 0
-+ "LC_PAPER",
-+ "LC_NAME",
-+ "LC_ADDRESS",
-+ "LC_TELEPHONE",
-+ "LC_MEASUREMENT",
-+ "LC_IDENTIFICATION"
-+#endif
-+ };
-+}
-+
-+namespace std
-+{
-+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
-+} // namespace std
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,117 @@
-+// Wrapper for underlying C-language localization -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.8 Standard locale categories.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifndef _C_LOCALE_H
-+#define _C_LOCALE_H 1
-+
-+#pragma GCC system_header
-+
-+#include <cstring> // get std::strlen
-+#include <cstdio> // get std::snprintf or std::sprintf
-+#include <clocale>
-+#include <langinfo.h> // For codecvt
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this
-+#endif
-+#ifdef __UCLIBC_HAS_LOCALE__
-+#include <iconv.h> // For codecvt using iconv, iconv_t
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#include <libintl.h> // For messages
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning what is _GLIBCXX_C_LOCALE_GNU for
-+#endif
-+#define _GLIBCXX_C_LOCALE_GNU 1
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix categories
-+#endif
-+// #define _GLIBCXX_NUM_CATEGORIES 6
-+#define _GLIBCXX_NUM_CATEGORIES 0
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+namespace __gnu_cxx
-+{
-+ extern "C" __typeof(uselocale) __uselocale;
-+}
-+#endif
-+
-+namespace std
-+{
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ typedef __locale_t __c_locale;
-+#else
-+ typedef int* __c_locale;
-+#endif
-+
-+ // Convert numeric value of type _Tv to string and return length of
-+ // string. If snprintf is available use it, otherwise fall back to
-+ // the unsafe sprintf which, in general, can be dangerous and should
-+ // be avoided.
-+ template<typename _Tv>
-+ int
-+ __convert_from_v(char* __out,
-+ const int __size __attribute__ ((__unused__)),
-+ const char* __fmt,
-+#ifdef __UCLIBC_HAS_XCLOCALE__
-+ _Tv __v, const __c_locale& __cloc, int __prec)
-+ {
-+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
-+#else
-+ _Tv __v, const __c_locale&, int __prec)
-+ {
-+# ifdef __UCLIBC_HAS_LOCALE__
-+ char* __old = std::setlocale(LC_ALL, NULL);
-+ char* __sav = new char[std::strlen(__old) + 1];
-+ std::strcpy(__sav, __old);
-+ std::setlocale(LC_ALL, "C");
-+# endif
-+#endif
-+
-+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
-+
-+#ifdef __UCLIBC_HAS_XCLOCALE__
-+ __gnu_cxx::__uselocale(__old);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+ std::setlocale(LC_ALL, __sav);
-+ delete [] __sav;
-+#endif
-+ return __ret;
-+ }
-+}
-+
-+#endif
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,63 @@
-+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
-+
-+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+// Written by Jakub Jelinek <jakub@redhat.com>
-+
-+#include <bits/c++config.h>
-+#include <clocale>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning clean this up
-+#endif
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+
-+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
-+extern "C" __typeof(strcoll_l) __strcoll_l;
-+extern "C" __typeof(strftime_l) __strftime_l;
-+extern "C" __typeof(strtod_l) __strtod_l;
-+extern "C" __typeof(strtof_l) __strtof_l;
-+extern "C" __typeof(strtold_l) __strtold_l;
-+extern "C" __typeof(strxfrm_l) __strxfrm_l;
-+extern "C" __typeof(newlocale) __newlocale;
-+extern "C" __typeof(freelocale) __freelocale;
-+extern "C" __typeof(duplocale) __duplocale;
-+extern "C" __typeof(uselocale) __uselocale;
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+extern "C" __typeof(iswctype_l) __iswctype_l;
-+extern "C" __typeof(towlower_l) __towlower_l;
-+extern "C" __typeof(towupper_l) __towupper_l;
-+extern "C" __typeof(wcscoll_l) __wcscoll_l;
-+extern "C" __typeof(wcsftime_l) __wcsftime_l;
-+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
-+extern "C" __typeof(wctype_l) __wctype_l;
-+#endif
-+
-+#endif // GLIBC 2.3 and later
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,306 @@
-+// std::codecvt implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+namespace std
-+{
-+ // Specializations.
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+ codecvt_base::result
-+ codecvt<wchar_t, char, mbstate_t>::
-+ do_out(state_type& __state, const intern_type* __from,
-+ const intern_type* __from_end, const intern_type*& __from_next,
-+ extern_type* __to, extern_type* __to_end,
-+ extern_type*& __to_next) const
-+ {
-+ result __ret = ok;
-+ state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
-+ // in case we fall back to wcrtomb and then continue, in a loop.
-+ // NB: wcsnrtombs is a GNU extension
-+ for (__from_next = __from, __to_next = __to;
-+ __from_next < __from_end && __to_next < __to_end
-+ && __ret == ok;)
-+ {
-+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
-+ __from_end - __from_next);
-+ if (!__from_chunk_end)
-+ __from_chunk_end = __from_end;
-+
-+ __from = __from_next;
-+ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
-+ __from_chunk_end - __from_next,
-+ __to_end - __to_next, &__state);
-+ if (__conv == static_cast<size_t>(-1))
-+ {
-+ // In case of error, in order to stop at the exact place we
-+ // have to start again from the beginning with a series of
-+ // wcrtomb.
-+ for (; __from < __from_next; ++__from)
-+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
-+ __state = __tmp_state;
-+ __ret = error;
-+ }
-+ else if (__from_next && __from_next < __from_chunk_end)
-+ {
-+ __to_next += __conv;
-+ __ret = partial;
-+ }
-+ else
-+ {
-+ __from_next = __from_chunk_end;
-+ __to_next += __conv;
-+ }
-+
-+ if (__from_next < __from_end && __ret == ok)
-+ {
-+ extern_type __buf[MB_LEN_MAX];
-+ __tmp_state = __state;
-+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
-+ if (__conv > static_cast<size_t>(__to_end - __to_next))
-+ __ret = partial;
-+ else
-+ {
-+ memcpy(__to_next, __buf, __conv);
-+ __state = __tmp_state;
-+ __to_next += __conv;
-+ ++__from_next;
-+ }
-+ }
-+ }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+
-+ return __ret;
-+ }
-+
-+ codecvt_base::result
-+ codecvt<wchar_t, char, mbstate_t>::
-+ do_in(state_type& __state, const extern_type* __from,
-+ const extern_type* __from_end, const extern_type*& __from_next,
-+ intern_type* __to, intern_type* __to_end,
-+ intern_type*& __to_next) const
-+ {
-+ result __ret = ok;
-+ state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
-+ // in case we store a L'\0' and then continue, in a loop.
-+ // NB: mbsnrtowcs is a GNU extension
-+ for (__from_next = __from, __to_next = __to;
-+ __from_next < __from_end && __to_next < __to_end
-+ && __ret == ok;)
-+ {
-+ const extern_type* __from_chunk_end;
-+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
-+ __from_end
-+ - __from_next));
-+ if (!__from_chunk_end)
-+ __from_chunk_end = __from_end;
-+
-+ __from = __from_next;
-+ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
-+ __from_chunk_end - __from_next,
-+ __to_end - __to_next, &__state);
-+ if (__conv == static_cast<size_t>(-1))
-+ {
-+ // In case of error, in order to stop at the exact place we
-+ // have to start again from the beginning with a series of
-+ // mbrtowc.
-+ for (;; ++__to_next, __from += __conv)
-+ {
-+ __conv = mbrtowc(__to_next, __from, __from_end - __from,
-+ &__tmp_state);
-+ if (__conv == static_cast<size_t>(-1)
-+ || __conv == static_cast<size_t>(-2))
-+ break;
-+ }
-+ __from_next = __from;
-+ __state = __tmp_state;
-+ __ret = error;
-+ }
-+ else if (__from_next && __from_next < __from_chunk_end)
-+ {
-+ // It is unclear what to return in this case (see DR 382).
-+ __to_next += __conv;
-+ __ret = partial;
-+ }
-+ else
-+ {
-+ __from_next = __from_chunk_end;
-+ __to_next += __conv;
-+ }
-+
-+ if (__from_next < __from_end && __ret == ok)
-+ {
-+ if (__to_next < __to_end)
-+ {
-+ // XXX Probably wrong for stateful encodings
-+ __tmp_state = __state;
-+ ++__from_next;
-+ *__to_next++ = L'\0';
-+ }
-+ else
-+ __ret = partial;
-+ }
-+ }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+
-+ return __ret;
-+ }
-+
-+ int
-+ codecvt<wchar_t, char, mbstate_t>::
-+ do_encoding() const throw()
-+ {
-+ // XXX This implementation assumes that the encoding is
-+ // stateless and is either single-byte or variable-width.
-+ int __ret = 0;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+ if (MB_CUR_MAX == 1)
-+ __ret = 1;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return __ret;
-+ }
-+
-+ int
-+ codecvt<wchar_t, char, mbstate_t>::
-+ do_max_length() const throw()
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+ // XXX Probably wrong for stateful encodings.
-+ int __ret = MB_CUR_MAX;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return __ret;
-+ }
-+
-+ int
-+ codecvt<wchar_t, char, mbstate_t>::
-+ do_length(state_type& __state, const extern_type* __from,
-+ const extern_type* __end, size_t __max) const
-+ {
-+ int __ret = 0;
-+ state_type __tmp_state(__state);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
-+#endif
-+
-+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
-+ // in case we advance past it and then continue, in a loop.
-+ // NB: mbsnrtowcs is a GNU extension
-+
-+ // A dummy internal buffer is needed in order for mbsnrtocws to consider
-+ // its fourth parameter (it wouldn't with NULL as first parameter).
-+ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
-+ * __max));
-+ while (__from < __end && __max)
-+ {
-+ const extern_type* __from_chunk_end;
-+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
-+ __end
-+ - __from));
-+ if (!__from_chunk_end)
-+ __from_chunk_end = __end;
-+
-+ const extern_type* __tmp_from = __from;
-+ size_t __conv = mbsnrtowcs(__to, &__from,
-+ __from_chunk_end - __from,
-+ __max, &__state);
-+ if (__conv == static_cast<size_t>(-1))
-+ {
-+ // In case of error, in order to stop at the exact place we
-+ // have to start again from the beginning with a series of
-+ // mbrtowc.
-+ for (__from = __tmp_from;; __from += __conv)
-+ {
-+ __conv = mbrtowc(NULL, __from, __end - __from,
-+ &__tmp_state);
-+ if (__conv == static_cast<size_t>(-1)
-+ || __conv == static_cast<size_t>(-2))
-+ break;
-+ }
-+ __state = __tmp_state;
-+ __ret += __from - __tmp_from;
-+ break;
-+ }
-+ if (!__from)
-+ __from = __from_chunk_end;
-+
-+ __ret += __from - __tmp_from;
-+ __max -= __conv;
-+
-+ if (__from < __end && __max)
-+ {
-+ // XXX Probably wrong for stateful encodings
-+ __tmp_state = __state;
-+ ++__from;
-+ ++__ret;
-+ --__max;
-+ }
-+ }
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+
-+ return __ret;
-+ }
-+#endif
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,80 @@
-+// std::collate implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
-+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
-+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
-+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
-+#endif
-+
-+namespace std
-+{
-+ // These are basically extensions to char_traits, and perhaps should
-+ // be put there instead of here.
-+ template<>
-+ int
-+ collate<char>::_M_compare(const char* __one, const char* __two) const
-+ {
-+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
-+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+ }
-+
-+ template<>
-+ size_t
-+ collate<char>::_M_transform(char* __to, const char* __from,
-+ size_t __n) const
-+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+ template<>
-+ int
-+ collate<wchar_t>::_M_compare(const wchar_t* __one,
-+ const wchar_t* __two) const
-+ {
-+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
-+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
-+ }
-+
-+ template<>
-+ size_t
-+ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
-+ size_t __n) const
-+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
-+#endif
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,300 @@
-+// std::ctype implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __wctype_l(S, L) wctype((S))
-+#define __towupper_l(C, L) towupper((C))
-+#define __towlower_l(C, L) towlower((C))
-+#define __iswctype_l(C, M, L) iswctype((C), (M))
-+#endif
-+
-+namespace std
-+{
-+ // NB: The other ctype<char> specializations are in src/locale.cc and
-+ // various /config/os/* files.
-+ template<>
-+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
-+ : ctype<char>(0, false, __refs)
-+ {
-+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
-+ {
-+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
-+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
-+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
-+ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
-+#endif
-+ }
-+ }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+ ctype<wchar_t>::__wmask_type
-+ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
-+ {
-+ __wmask_type __ret;
-+ switch (__m)
-+ {
-+ case space:
-+ __ret = __wctype_l("space", _M_c_locale_ctype);
-+ break;
-+ case print:
-+ __ret = __wctype_l("print", _M_c_locale_ctype);
-+ break;
-+ case cntrl:
-+ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
-+ break;
-+ case upper:
-+ __ret = __wctype_l("upper", _M_c_locale_ctype);
-+ break;
-+ case lower:
-+ __ret = __wctype_l("lower", _M_c_locale_ctype);
-+ break;
-+ case alpha:
-+ __ret = __wctype_l("alpha", _M_c_locale_ctype);
-+ break;
-+ case digit:
-+ __ret = __wctype_l("digit", _M_c_locale_ctype);
-+ break;
-+ case punct:
-+ __ret = __wctype_l("punct", _M_c_locale_ctype);
-+ break;
-+ case xdigit:
-+ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
-+ break;
-+ case alnum:
-+ __ret = __wctype_l("alnum", _M_c_locale_ctype);
-+ break;
-+ case graph:
-+ __ret = __wctype_l("graph", _M_c_locale_ctype);
-+ break;
-+ default:
-+ __ret = __wmask_type();
-+ }
-+ return __ret;
-+ }
-+
-+ wchar_t
-+ ctype<wchar_t>::do_toupper(wchar_t __c) const
-+ { return __towupper_l(__c, _M_c_locale_ctype); }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
-+ {
-+ while (__lo < __hi)
-+ {
-+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
-+ ++__lo;
-+ }
-+ return __hi;
-+ }
-+
-+ wchar_t
-+ ctype<wchar_t>::do_tolower(wchar_t __c) const
-+ { return __towlower_l(__c, _M_c_locale_ctype); }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
-+ {
-+ while (__lo < __hi)
-+ {
-+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
-+ ++__lo;
-+ }
-+ return __hi;
-+ }
-+
-+ bool
-+ ctype<wchar_t>::
-+ do_is(mask __m, wchar_t __c) const
-+ {
-+ // Highest bitmask in ctype_base == 10, but extra in "C"
-+ // library for blank.
-+ bool __ret = false;
-+ const size_t __bitmasksize = 11;
-+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+ if (__m & _M_bit[__bitcur]
-+ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
-+ {
-+ __ret = true;
-+ break;
-+ }
-+ return __ret;
-+ }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::
-+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
-+ {
-+ for (; __lo < __hi; ++__vec, ++__lo)
-+ {
-+ // Highest bitmask in ctype_base == 10, but extra in "C"
-+ // library for blank.
-+ const size_t __bitmasksize = 11;
-+ mask __m = 0;
-+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
-+ __m |= _M_bit[__bitcur];
-+ *__vec = __m;
-+ }
-+ return __hi;
-+ }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::
-+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
-+ {
-+ while (__lo < __hi && !this->do_is(__m, *__lo))
-+ ++__lo;
-+ return __lo;
-+ }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::
-+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
-+ {
-+ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
-+ ++__lo;
-+ return __lo;
-+ }
-+
-+ wchar_t
-+ ctype<wchar_t>::
-+ do_widen(char __c) const
-+ { return _M_widen[static_cast<unsigned char>(__c)]; }
-+
-+ const char*
-+ ctype<wchar_t>::
-+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
-+ {
-+ while (__lo < __hi)
-+ {
-+ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
-+ ++__lo;
-+ ++__dest;
-+ }
-+ return __hi;
-+ }
-+
-+ char
-+ ctype<wchar_t>::
-+ do_narrow(wchar_t __wc, char __dfault) const
-+ {
-+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
-+ return _M_narrow[__wc];
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+ const int __c = wctob(__wc);
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return (__c == EOF ? __dfault : static_cast<char>(__c));
-+ }
-+
-+ const wchar_t*
-+ ctype<wchar_t>::
-+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
-+ char* __dest) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+ if (_M_narrow_ok)
-+ while (__lo < __hi)
-+ {
-+ if (*__lo >= 0 && *__lo < 128)
-+ *__dest = _M_narrow[*__lo];
-+ else
-+ {
-+ const int __c = wctob(*__lo);
-+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
-+ }
-+ ++__lo;
-+ ++__dest;
-+ }
-+ else
-+ while (__lo < __hi)
-+ {
-+ const int __c = wctob(*__lo);
-+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
-+ ++__lo;
-+ ++__dest;
-+ }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ return __hi;
-+ }
-+
-+ void
-+ ctype<wchar_t>::_M_initialize_ctype()
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_ctype);
-+#endif
-+ wint_t __i;
-+ for (__i = 0; __i < 128; ++__i)
-+ {
-+ const int __c = wctob(__i);
-+ if (__c == EOF)
-+ break;
-+ else
-+ _M_narrow[__i] = static_cast<char>(__c);
-+ }
-+ if (__i == 128)
-+ _M_narrow_ok = true;
-+ else
-+ _M_narrow_ok = false;
-+ for (size_t __j = 0;
-+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
-+ _M_widen[__j] = btowc(__j);
-+
-+ for (size_t __k = 0; __k <= 11; ++__k)
-+ {
-+ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
-+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
-+ }
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#endif
-+ }
-+#endif // _GLIBCXX_USE_WCHAR_T
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,100 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix gettext stuff
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__dcgettext(const char *domainname,
-+ const char *msgid, int category);
-+#undef gettext
-+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
-+#else
-+#undef gettext
-+#define gettext(msgid) (msgid)
-+#endif
-+
-+namespace std
-+{
-+ // Specializations.
-+ template<>
-+ string
-+ messages<char>::do_get(catalog, int, int, const string& __dfault) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_messages);
-+ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
-+ __uselocale(__old);
-+ return string(__msg);
-+#elif defined __UCLIBC_HAS_LOCALE__
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, _M_name_messages);
-+ const char* __msg = gettext(__dfault.c_str());
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+ return string(__msg);
-+#else
-+ const char* __msg = gettext(__dfault.c_str());
-+ return string(__msg);
-+#endif
-+ }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+ template<>
-+ wstring
-+ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
-+ {
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(_M_c_locale_messages);
-+ char* __msg = gettext(_M_convert_to_char(__dfault));
-+ __uselocale(__old);
-+ return _M_convert_from_char(__msg);
-+# elif defined __UCLIBC_HAS_LOCALE__
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, _M_name_messages);
-+ char* __msg = gettext(_M_convert_to_char(__dfault));
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+ return _M_convert_from_char(__msg);
-+# else
-+ char* __msg = gettext(_M_convert_to_char(__dfault));
-+ return _M_convert_from_char(__msg);
-+# endif
-+ }
-+#endif
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,118 @@
-+// std::messages implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.7.1.2 messages functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix prototypes for *textdomain funcs
-+#endif
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+extern "C" char *__textdomain(const char *domainname);
-+extern "C" char *__bindtextdomain(const char *domainname,
-+ const char *dirname);
-+#else
-+#undef __textdomain
-+#undef __bindtextdomain
-+#define __textdomain(D) ((void)0)
-+#define __bindtextdomain(D,P) ((void)0)
-+#endif
-+
-+ // Non-virtual member functions.
-+ template<typename _CharT>
-+ messages<_CharT>::messages(size_t __refs)
-+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
-+ _M_name_messages(_S_get_c_name())
-+ { }
-+
-+ template<typename _CharT>
-+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
-+ size_t __refs)
-+ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
-+ _M_name_messages(__s)
-+ {
-+ char* __tmp = new char[std::strlen(__s) + 1];
-+ std::strcpy(__tmp, __s);
-+ _M_name_messages = __tmp;
-+ }
-+
-+ template<typename _CharT>
-+ typename messages<_CharT>::catalog
-+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
-+ const char* __dir) const
-+ {
-+ __bindtextdomain(__s.c_str(), __dir);
-+ return this->do_open(__s, __loc);
-+ }
-+
-+ // Virtual member functions.
-+ template<typename _CharT>
-+ messages<_CharT>::~messages()
-+ {
-+ if (_M_name_messages != _S_get_c_name())
-+ delete [] _M_name_messages;
-+ _S_destroy_c_locale(_M_c_locale_messages);
-+ }
-+
-+ template<typename _CharT>
-+ typename messages<_CharT>::catalog
-+ messages<_CharT>::do_open(const basic_string<char>& __s,
-+ const locale&) const
-+ {
-+ // No error checking is done, assume the catalog exists and can
-+ // be used.
-+ __textdomain(__s.c_str());
-+ return 0;
-+ }
-+
-+ template<typename _CharT>
-+ void
-+ messages<_CharT>::do_close(catalog) const
-+ { }
-+
-+ // messages_byname
-+ template<typename _CharT>
-+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
-+ : messages<_CharT>(__refs)
-+ {
-+ if (this->_M_name_messages != locale::facet::_S_get_c_name())
-+ delete [] this->_M_name_messages;
-+ char* __tmp = new char[std::strlen(__s) + 1];
-+ std::strcpy(__tmp, __s);
-+ this->_M_name_messages = __tmp;
-+
-+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
-+ {
-+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
-+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
-+ }
-+ }
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,692 @@
-+// std::moneypunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning optimize this for uclibc
-+#warning tailor for stub locale support
-+#endif
-+
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L) nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+ // Construct and return valid pattern consisting of some combination of:
-+ // space none symbol sign value
-+ money_base::pattern
-+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
-+ {
-+ pattern __ret;
-+
-+ // This insanely complicated routine attempts to construct a valid
-+ // pattern for use with monyepunct. A couple of invariants:
-+
-+ // if (__precedes) symbol -> value
-+ // else value -> symbol
-+
-+ // if (__space) space
-+ // else none
-+
-+ // none == never first
-+ // space never first or last
-+
-+ // Any elegant implementations of this are welcome.
-+ switch (__posn)
-+ {
-+ case 0:
-+ case 1:
-+ // 1 The sign precedes the value and symbol.
-+ __ret.field[0] = sign;
-+ if (__space)
-+ {
-+ // Pattern starts with sign.
-+ if (__precedes)
-+ {
-+ __ret.field[1] = symbol;
-+ __ret.field[3] = value;
-+ }
-+ else
-+ {
-+ __ret.field[1] = value;
-+ __ret.field[3] = symbol;
-+ }
-+ __ret.field[2] = space;
-+ }
-+ else
-+ {
-+ // Pattern starts with sign and ends with none.
-+ if (__precedes)
-+ {
-+ __ret.field[1] = symbol;
-+ __ret.field[2] = value;
-+ }
-+ else
-+ {
-+ __ret.field[1] = value;
-+ __ret.field[2] = symbol;
-+ }
-+ __ret.field[3] = none;
-+ }
-+ break;
-+ case 2:
-+ // 2 The sign follows the value and symbol.
-+ if (__space)
-+ {
-+ // Pattern either ends with sign.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = symbol;
-+ __ret.field[2] = value;
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ __ret.field[2] = symbol;
-+ }
-+ __ret.field[1] = space;
-+ __ret.field[3] = sign;
-+ }
-+ else
-+ {
-+ // Pattern ends with sign then none.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = symbol;
-+ __ret.field[1] = value;
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ __ret.field[1] = symbol;
-+ }
-+ __ret.field[2] = sign;
-+ __ret.field[3] = none;
-+ }
-+ break;
-+ case 3:
-+ // 3 The sign immediately precedes the symbol.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = sign;
-+ __ret.field[1] = symbol;
-+ if (__space)
-+ {
-+ __ret.field[2] = space;
-+ __ret.field[3] = value;
-+ }
-+ else
-+ {
-+ __ret.field[2] = value;
-+ __ret.field[3] = none;
-+ }
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ if (__space)
-+ {
-+ __ret.field[1] = space;
-+ __ret.field[2] = sign;
-+ __ret.field[3] = symbol;
-+ }
-+ else
-+ {
-+ __ret.field[1] = sign;
-+ __ret.field[2] = symbol;
-+ __ret.field[3] = none;
-+ }
-+ }
-+ break;
-+ case 4:
-+ // 4 The sign immediately follows the symbol.
-+ if (__precedes)
-+ {
-+ __ret.field[0] = symbol;
-+ __ret.field[1] = sign;
-+ if (__space)
-+ {
-+ __ret.field[2] = space;
-+ __ret.field[3] = value;
-+ }
-+ else
-+ {
-+ __ret.field[2] = value;
-+ __ret.field[3] = none;
-+ }
-+ }
-+ else
-+ {
-+ __ret.field[0] = value;
-+ if (__space)
-+ {
-+ __ret.field[1] = space;
-+ __ret.field[2] = symbol;
-+ __ret.field[3] = sign;
-+ }
-+ else
-+ {
-+ __ret.field[1] = symbol;
-+ __ret.field[2] = sign;
-+ __ret.field[3] = none;
-+ }
-+ }
-+ break;
-+ default:
-+ ;
-+ }
-+ return __ret;
-+ }
-+
-+ template<>
-+ void
-+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
-+ const char*)
-+ {
-+ if (!_M_data)
-+ _M_data = new __moneypunct_cache<char, true>;
-+
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_data->_M_decimal_point = '.';
-+ _M_data->_M_thousands_sep = ',';
-+ _M_data->_M_grouping = "";
-+ _M_data->_M_grouping_size = 0;
-+ _M_data->_M_curr_symbol = "";
-+ _M_data->_M_curr_symbol_size = 0;
-+ _M_data->_M_positive_sign = "";
-+ _M_data->_M_positive_sign_size = 0;
-+ _M_data->_M_negative_sign = "";
-+ _M_data->_M_negative_sign_size = 0;
-+ _M_data->_M_frac_digits = 0;
-+ _M_data->_M_pos_format = money_base::_S_default_pattern;
-+ _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
-+ }
-+ else
-+ {
-+ // Named locale.
-+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
-+ __cloc));
-+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
-+ __cloc));
-+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
-+
-+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+ if (!__nposn)
-+ _M_data->_M_negative_sign = "()";
-+ else
-+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
-+ __cloc);
-+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
-+
-+ // _Intl == true
-+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
-+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
-+ __cloc));
-+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
-+ __pposn);
-+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
-+ __nposn);
-+ }
-+ }
-+
-+ template<>
-+ void
-+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+ const char*)
-+ {
-+ if (!_M_data)
-+ _M_data = new __moneypunct_cache<char, false>;
-+
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_data->_M_decimal_point = '.';
-+ _M_data->_M_thousands_sep = ',';
-+ _M_data->_M_grouping = "";
-+ _M_data->_M_grouping_size = 0;
-+ _M_data->_M_curr_symbol = "";
-+ _M_data->_M_curr_symbol_size = 0;
-+ _M_data->_M_positive_sign = "";
-+ _M_data->_M_positive_sign_size = 0;
-+ _M_data->_M_negative_sign = "";
-+ _M_data->_M_negative_sign_size = 0;
-+ _M_data->_M_frac_digits = 0;
-+ _M_data->_M_pos_format = money_base::_S_default_pattern;
-+ _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
-+ }
-+ else
-+ {
-+ // Named locale.
-+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
-+ __cloc));
-+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
-+ __cloc));
-+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
-+
-+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+ if (!__nposn)
-+ _M_data->_M_negative_sign = "()";
-+ else
-+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
-+ __cloc);
-+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
-+
-+ // _Intl == false
-+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
-+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
-+ __pposn);
-+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
-+ __nposn);
-+ }
-+ }
-+
-+ template<>
-+ moneypunct<char, true>::~moneypunct()
-+ { delete _M_data; }
-+
-+ template<>
-+ moneypunct<char, false>::~moneypunct()
-+ { delete _M_data; }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+ template<>
-+ void
-+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ const char*)
-+#else
-+ const char* __name)
-+#endif
-+ {
-+ if (!_M_data)
-+ _M_data = new __moneypunct_cache<wchar_t, true>;
-+
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_data->_M_decimal_point = L'.';
-+ _M_data->_M_thousands_sep = L',';
-+ _M_data->_M_grouping = "";
-+ _M_data->_M_grouping_size = 0;
-+ _M_data->_M_curr_symbol = L"";
-+ _M_data->_M_curr_symbol_size = 0;
-+ _M_data->_M_positive_sign = L"";
-+ _M_data->_M_positive_sign_size = 0;
-+ _M_data->_M_negative_sign = L"";
-+ _M_data->_M_negative_sign_size = 0;
-+ _M_data->_M_frac_digits = 0;
-+ _M_data->_M_pos_format = money_base::_S_default_pattern;
-+ _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+ // Use ctype::widen code without the facet...
-+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+ _M_data->_M_atoms[__i] =
-+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
-+ }
-+ else
-+ {
-+ // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(__cloc);
-+#else
-+ // Switch to named locale so that mbsrtowcs will work.
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this... should be monetary
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+ union { char *__s; wchar_t __w; } __u;
-+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
-+ _M_data->_M_decimal_point = __u.__w;
-+
-+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
-+ _M_data->_M_thousands_sep = __u.__w;
-+#endif
-+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+
-+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
-+
-+ wchar_t* __wcs_ps = 0;
-+ wchar_t* __wcs_ns = 0;
-+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
-+ try
-+ {
-+ mbstate_t __state;
-+ size_t __len = strlen(__cpossign);
-+ if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ __wcs_ps = new wchar_t[__len];
-+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
-+ _M_data->_M_positive_sign = __wcs_ps;
-+ }
-+ else
-+ _M_data->_M_positive_sign = L"";
-+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
-+
-+ __len = strlen(__cnegsign);
-+ if (!__nposn)
-+ _M_data->_M_negative_sign = L"()";
-+ else if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ __wcs_ns = new wchar_t[__len];
-+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
-+ _M_data->_M_negative_sign = __wcs_ns;
-+ }
-+ else
-+ _M_data->_M_negative_sign = L"";
-+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
-+
-+ // _Intl == true.
-+ __len = strlen(__ccurr);
-+ if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ wchar_t* __wcs = new wchar_t[__len];
-+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+ _M_data->_M_curr_symbol = __wcs;
-+ }
-+ else
-+ _M_data->_M_curr_symbol = L"";
-+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
-+ }
-+ catch (...)
-+ {
-+ delete _M_data;
-+ _M_data = 0;
-+ delete __wcs_ps;
-+ delete __wcs_ns;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#else
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ __throw_exception_again;
-+ }
-+
-+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
-+ __cloc));
-+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
-+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
-+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
-+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
-+ __pposn);
-+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
-+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
-+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
-+ __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#else
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ }
-+ }
-+
-+ template<>
-+ void
-+ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ const char*)
-+#else
-+ const char* __name)
-+#endif
-+ {
-+ if (!_M_data)
-+ _M_data = new __moneypunct_cache<wchar_t, false>;
-+
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_data->_M_decimal_point = L'.';
-+ _M_data->_M_thousands_sep = L',';
-+ _M_data->_M_grouping = "";
-+ _M_data->_M_grouping_size = 0;
-+ _M_data->_M_curr_symbol = L"";
-+ _M_data->_M_curr_symbol_size = 0;
-+ _M_data->_M_positive_sign = L"";
-+ _M_data->_M_positive_sign_size = 0;
-+ _M_data->_M_negative_sign = L"";
-+ _M_data->_M_negative_sign_size = 0;
-+ _M_data->_M_frac_digits = 0;
-+ _M_data->_M_pos_format = money_base::_S_default_pattern;
-+ _M_data->_M_neg_format = money_base::_S_default_pattern;
-+
-+ // Use ctype::widen code without the facet...
-+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
-+ _M_data->_M_atoms[__i] =
-+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
-+ }
-+ else
-+ {
-+ // Named locale.
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __c_locale __old = __uselocale(__cloc);
-+#else
-+ // Switch to named locale so that mbsrtowcs will work.
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, __name);
-+#endif
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this... should be monetary
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# else
-+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
-+ union { char *__s; wchar_t __w; } __u;
-+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
-+ _M_data->_M_decimal_point = __u.__w;
-+
-+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
-+ _M_data->_M_thousands_sep = __u.__w;
-+#endif
-+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
-+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+
-+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
-+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
-+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
-+
-+ wchar_t* __wcs_ps = 0;
-+ wchar_t* __wcs_ns = 0;
-+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
-+ try
-+ {
-+ mbstate_t __state;
-+ size_t __len;
-+ __len = strlen(__cpossign);
-+ if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ __wcs_ps = new wchar_t[__len];
-+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
-+ _M_data->_M_positive_sign = __wcs_ps;
-+ }
-+ else
-+ _M_data->_M_positive_sign = L"";
-+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
-+
-+ __len = strlen(__cnegsign);
-+ if (!__nposn)
-+ _M_data->_M_negative_sign = L"()";
-+ else if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ __wcs_ns = new wchar_t[__len];
-+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
-+ _M_data->_M_negative_sign = __wcs_ns;
-+ }
-+ else
-+ _M_data->_M_negative_sign = L"";
-+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
-+
-+ // _Intl == true.
-+ __len = strlen(__ccurr);
-+ if (__len)
-+ {
-+ ++__len;
-+ memset(&__state, 0, sizeof(mbstate_t));
-+ wchar_t* __wcs = new wchar_t[__len];
-+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
-+ _M_data->_M_curr_symbol = __wcs;
-+ }
-+ else
-+ _M_data->_M_curr_symbol = L"";
-+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
-+ }
-+ catch (...)
-+ {
-+ delete _M_data;
-+ _M_data = 0;
-+ delete __wcs_ps;
-+ delete __wcs_ns;
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#else
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ __throw_exception_again;
-+ }
-+
-+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
-+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
-+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
-+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
-+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
-+ __pposn);
-+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
-+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
-+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
-+ __nposn);
-+
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __uselocale(__old);
-+#else
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ }
-+ }
-+
-+ template<>
-+ moneypunct<wchar_t, true>::~moneypunct()
-+ {
-+ if (_M_data->_M_positive_sign_size)
-+ delete [] _M_data->_M_positive_sign;
-+ if (_M_data->_M_negative_sign_size
-+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
-+ delete [] _M_data->_M_negative_sign;
-+ if (_M_data->_M_curr_symbol_size)
-+ delete [] _M_data->_M_curr_symbol;
-+ delete _M_data;
-+ }
-+
-+ template<>
-+ moneypunct<wchar_t, false>::~moneypunct()
-+ {
-+ if (_M_data->_M_positive_sign_size)
-+ delete [] _M_data->_M_positive_sign;
-+ if (_M_data->_M_negative_sign_size
-+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
-+ delete [] _M_data->_M_negative_sign;
-+ if (_M_data->_M_curr_symbol_size)
-+ delete [] _M_data->_M_curr_symbol;
-+ delete _M_data;
-+ }
-+#endif
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,160 @@
-+// std::numpunct implementation details, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#define _LIBC
-+#include <locale>
-+#undef _LIBC
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L) nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+ template<>
-+ void
-+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
-+ {
-+ if (!_M_data)
-+ _M_data = new __numpunct_cache<char>;
-+
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_data->_M_grouping = "";
-+ _M_data->_M_grouping_size = 0;
-+ _M_data->_M_use_grouping = false;
-+
-+ _M_data->_M_decimal_point = '.';
-+ _M_data->_M_thousands_sep = ',';
-+
-+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
-+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
-+
-+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
-+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
-+ }
-+ else
-+ {
-+ // Named locale.
-+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
-+ __cloc));
-+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
-+ __cloc));
-+
-+ // Check for NULL, which implies no grouping.
-+ if (_M_data->_M_thousands_sep == '\0')
-+ _M_data->_M_grouping = "";
-+ else
-+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+ }
-+
-+ // NB: There is no way to extact this info from posix locales.
-+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+ _M_data->_M_truename = "true";
-+ _M_data->_M_truename_size = 4;
-+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+ _M_data->_M_falsename = "false";
-+ _M_data->_M_falsename_size = 5;
-+ }
-+
-+ template<>
-+ numpunct<char>::~numpunct()
-+ { delete _M_data; }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+ template<>
-+ void
-+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
-+ {
-+ if (!_M_data)
-+ _M_data = new __numpunct_cache<wchar_t>;
-+
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_data->_M_grouping = "";
-+ _M_data->_M_grouping_size = 0;
-+ _M_data->_M_use_grouping = false;
-+
-+ _M_data->_M_decimal_point = L'.';
-+ _M_data->_M_thousands_sep = L',';
-+
-+ // Use ctype::widen code without the facet...
-+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
-+ _M_data->_M_atoms_out[__i] =
-+ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
-+
-+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
-+ _M_data->_M_atoms_in[__j] =
-+ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
-+ }
-+ else
-+ {
-+ // Named locale.
-+ // NB: In the GNU model wchar_t is always 32 bit wide.
-+ union { char *__s; wchar_t __w; } __u;
-+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
-+ _M_data->_M_decimal_point = __u.__w;
-+
-+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
-+ _M_data->_M_thousands_sep = __u.__w;
-+
-+ if (_M_data->_M_thousands_sep == L'\0')
-+ _M_data->_M_grouping = "";
-+ else
-+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
-+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
-+ }
-+
-+ // NB: There is no way to extact this info from posix locales.
-+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
-+ _M_data->_M_truename = L"true";
-+ _M_data->_M_truename_size = 4;
-+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
-+ _M_data->_M_falsename = L"false";
-+ _M_data->_M_falsename_size = 5;
-+ }
-+
-+ template<>
-+ numpunct<wchar_t>::~numpunct()
-+ { delete _M_data; }
-+ #endif
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,406 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+#include <locale>
-+#include <bits/c++locale_internal.h>
-+
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning tailor for stub locale support
-+#endif
-+#ifndef __UCLIBC_HAS_XLOCALE__
-+#define __nl_langinfo_l(N, L) nl_langinfo((N))
-+#endif
-+
-+namespace std
-+{
-+ template<>
-+ void
-+ __timepunct<char>::
-+ _M_put(char* __s, size_t __maxlen, const char* __format,
-+ const tm* __tm) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
-+ _M_c_locale_timepunct);
-+#else
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, _M_name_timepunct);
-+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ // Make sure __s is null terminated.
-+ if (__len == 0)
-+ __s[0] = '\0';
-+ }
-+
-+ template<>
-+ void
-+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
-+ {
-+ if (!_M_data)
-+ _M_data = new __timepunct_cache<char>;
-+
-+ if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_c_locale_timepunct = _S_get_c_locale();
-+
-+ _M_data->_M_date_format = "%m/%d/%y";
-+ _M_data->_M_date_era_format = "%m/%d/%y";
-+ _M_data->_M_time_format = "%H:%M:%S";
-+ _M_data->_M_time_era_format = "%H:%M:%S";
-+ _M_data->_M_date_time_format = "";
-+ _M_data->_M_date_time_era_format = "";
-+ _M_data->_M_am = "AM";
-+ _M_data->_M_pm = "PM";
-+ _M_data->_M_am_pm_format = "";
-+
-+ // Day names, starting with "C"'s Sunday.
-+ _M_data->_M_day1 = "Sunday";
-+ _M_data->_M_day2 = "Monday";
-+ _M_data->_M_day3 = "Tuesday";
-+ _M_data->_M_day4 = "Wednesday";
-+ _M_data->_M_day5 = "Thursday";
-+ _M_data->_M_day6 = "Friday";
-+ _M_data->_M_day7 = "Saturday";
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ _M_data->_M_aday1 = "Sun";
-+ _M_data->_M_aday2 = "Mon";
-+ _M_data->_M_aday3 = "Tue";
-+ _M_data->_M_aday4 = "Wed";
-+ _M_data->_M_aday5 = "Thu";
-+ _M_data->_M_aday6 = "Fri";
-+ _M_data->_M_aday7 = "Sat";
-+
-+ // Month names, starting with "C"'s January.
-+ _M_data->_M_month01 = "January";
-+ _M_data->_M_month02 = "February";
-+ _M_data->_M_month03 = "March";
-+ _M_data->_M_month04 = "April";
-+ _M_data->_M_month05 = "May";
-+ _M_data->_M_month06 = "June";
-+ _M_data->_M_month07 = "July";
-+ _M_data->_M_month08 = "August";
-+ _M_data->_M_month09 = "September";
-+ _M_data->_M_month10 = "October";
-+ _M_data->_M_month11 = "November";
-+ _M_data->_M_month12 = "December";
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ _M_data->_M_amonth01 = "Jan";
-+ _M_data->_M_amonth02 = "Feb";
-+ _M_data->_M_amonth03 = "Mar";
-+ _M_data->_M_amonth04 = "Apr";
-+ _M_data->_M_amonth05 = "May";
-+ _M_data->_M_amonth06 = "Jun";
-+ _M_data->_M_amonth07 = "Jul";
-+ _M_data->_M_amonth08 = "Aug";
-+ _M_data->_M_amonth09 = "Sep";
-+ _M_data->_M_amonth10 = "Oct";
-+ _M_data->_M_amonth11 = "Nov";
-+ _M_data->_M_amonth12 = "Dec";
-+ }
-+ else
-+ {
-+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
-+
-+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
-+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
-+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
-+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
-+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
-+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
-+ __cloc);
-+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
-+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
-+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
-+
-+ // Day names, starting with "C"'s Sunday.
-+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
-+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
-+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
-+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
-+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
-+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
-+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
-+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
-+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
-+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
-+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
-+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
-+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
-+
-+ // Month names, starting with "C"'s January.
-+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
-+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
-+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
-+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
-+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
-+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
-+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
-+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
-+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
-+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
-+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
-+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
-+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
-+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
-+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
-+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
-+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
-+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
-+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
-+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
-+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
-+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
-+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
-+ }
-+ }
-+
-+#ifdef _GLIBCXX_USE_WCHAR_T
-+ template<>
-+ void
-+ __timepunct<wchar_t>::
-+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
-+ const tm* __tm) const
-+ {
-+#ifdef __UCLIBC_HAS_XLOCALE__
-+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
-+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
-+ _M_c_locale_timepunct);
-+#else
-+ char* __old = strdup(setlocale(LC_ALL, NULL));
-+ setlocale(LC_ALL, _M_name_timepunct);
-+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
-+ setlocale(LC_ALL, __old);
-+ free(__old);
-+#endif
-+ // Make sure __s is null terminated.
-+ if (__len == 0)
-+ __s[0] = L'\0';
-+ }
-+
-+ template<>
-+ void
-+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
-+ {
-+ if (!_M_data)
-+ _M_data = new __timepunct_cache<wchar_t>;
-+
-+#warning wide time stuff
-+// if (!__cloc)
-+ {
-+ // "C" locale
-+ _M_c_locale_timepunct = _S_get_c_locale();
-+
-+ _M_data->_M_date_format = L"%m/%d/%y";
-+ _M_data->_M_date_era_format = L"%m/%d/%y";
-+ _M_data->_M_time_format = L"%H:%M:%S";
-+ _M_data->_M_time_era_format = L"%H:%M:%S";
-+ _M_data->_M_date_time_format = L"";
-+ _M_data->_M_date_time_era_format = L"";
-+ _M_data->_M_am = L"AM";
-+ _M_data->_M_pm = L"PM";
-+ _M_data->_M_am_pm_format = L"";
-+
-+ // Day names, starting with "C"'s Sunday.
-+ _M_data->_M_day1 = L"Sunday";
-+ _M_data->_M_day2 = L"Monday";
-+ _M_data->_M_day3 = L"Tuesday";
-+ _M_data->_M_day4 = L"Wednesday";
-+ _M_data->_M_day5 = L"Thursday";
-+ _M_data->_M_day6 = L"Friday";
-+ _M_data->_M_day7 = L"Saturday";
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ _M_data->_M_aday1 = L"Sun";
-+ _M_data->_M_aday2 = L"Mon";
-+ _M_data->_M_aday3 = L"Tue";
-+ _M_data->_M_aday4 = L"Wed";
-+ _M_data->_M_aday5 = L"Thu";
-+ _M_data->_M_aday6 = L"Fri";
-+ _M_data->_M_aday7 = L"Sat";
-+
-+ // Month names, starting with "C"'s January.
-+ _M_data->_M_month01 = L"January";
-+ _M_data->_M_month02 = L"February";
-+ _M_data->_M_month03 = L"March";
-+ _M_data->_M_month04 = L"April";
-+ _M_data->_M_month05 = L"May";
-+ _M_data->_M_month06 = L"June";
-+ _M_data->_M_month07 = L"July";
-+ _M_data->_M_month08 = L"August";
-+ _M_data->_M_month09 = L"September";
-+ _M_data->_M_month10 = L"October";
-+ _M_data->_M_month11 = L"November";
-+ _M_data->_M_month12 = L"December";
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ _M_data->_M_amonth01 = L"Jan";
-+ _M_data->_M_amonth02 = L"Feb";
-+ _M_data->_M_amonth03 = L"Mar";
-+ _M_data->_M_amonth04 = L"Apr";
-+ _M_data->_M_amonth05 = L"May";
-+ _M_data->_M_amonth06 = L"Jun";
-+ _M_data->_M_amonth07 = L"Jul";
-+ _M_data->_M_amonth08 = L"Aug";
-+ _M_data->_M_amonth09 = L"Sep";
-+ _M_data->_M_amonth10 = L"Oct";
-+ _M_data->_M_amonth11 = L"Nov";
-+ _M_data->_M_amonth12 = L"Dec";
-+ }
-+#if 0
-+ else
-+ {
-+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
-+
-+ union { char *__s; wchar_t *__w; } __u;
-+
-+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
-+ _M_data->_M_date_format = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
-+ _M_data->_M_date_era_format = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
-+ _M_data->_M_time_format = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
-+ _M_data->_M_time_era_format = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
-+ _M_data->_M_date_time_format = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
-+ _M_data->_M_date_time_era_format = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
-+ _M_data->_M_am = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
-+ _M_data->_M_pm = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
-+ _M_data->_M_am_pm_format = __u.__w;
-+
-+ // Day names, starting with "C"'s Sunday.
-+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
-+ _M_data->_M_day1 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
-+ _M_data->_M_day2 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
-+ _M_data->_M_day3 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
-+ _M_data->_M_day4 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
-+ _M_data->_M_day5 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
-+ _M_data->_M_day6 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
-+ _M_data->_M_day7 = __u.__w;
-+
-+ // Abbreviated day names, starting with "C"'s Sun.
-+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
-+ _M_data->_M_aday1 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
-+ _M_data->_M_aday2 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
-+ _M_data->_M_aday3 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
-+ _M_data->_M_aday4 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
-+ _M_data->_M_aday5 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
-+ _M_data->_M_aday6 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
-+ _M_data->_M_aday7 = __u.__w;
-+
-+ // Month names, starting with "C"'s January.
-+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
-+ _M_data->_M_month01 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
-+ _M_data->_M_month02 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
-+ _M_data->_M_month03 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
-+ _M_data->_M_month04 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
-+ _M_data->_M_month05 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
-+ _M_data->_M_month06 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
-+ _M_data->_M_month07 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
-+ _M_data->_M_month08 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
-+ _M_data->_M_month09 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
-+ _M_data->_M_month10 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
-+ _M_data->_M_month11 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
-+ _M_data->_M_month12 = __u.__w;
-+
-+ // Abbreviated month names, starting with "C"'s Jan.
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
-+ _M_data->_M_amonth01 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
-+ _M_data->_M_amonth02 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
-+ _M_data->_M_amonth03 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
-+ _M_data->_M_amonth04 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
-+ _M_data->_M_amonth05 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
-+ _M_data->_M_amonth06 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
-+ _M_data->_M_amonth07 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
-+ _M_data->_M_amonth08 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
-+ _M_data->_M_amonth09 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
-+ _M_data->_M_amonth10 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
-+ _M_data->_M_amonth11 = __u.__w;
-+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
-+ _M_data->_M_amonth12 = __u.__w;
-+ }
-+#endif // 0
-+ }
-+#endif
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h 2007-08-03 20:30:21.000000000 +0200
-@@ -0,0 +1,68 @@
-+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-+
-+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
-+//
-+// This file is part of the GNU ISO C++ Library. This library is free
-+// software; you can redistribute it and/or modify it under the
-+// terms of the GNU General Public License as published by the
-+// Free Software Foundation; either version 2, or (at your option)
-+// any later version.
-+
-+// This library 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 library; see the file COPYING. If not, write to the Free
-+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-+// USA.
-+
-+// As a special exception, you may use this file as part of a free software
-+// library without restriction. Specifically, if other files instantiate
-+// templates or use macros or inline functions from this file, or you compile
-+// this file and link it with other files to produce an executable, this
-+// file does not by itself cause the resulting executable to be covered by
-+// the GNU General Public License. This exception does not however
-+// invalidate any other reasons why the executable file might be covered by
-+// the GNU General Public License.
-+
-+//
-+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
-+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
-+//
-+
-+// Written by Benjamin Kosnik <bkoz@redhat.com>
-+
-+ template<typename _CharT>
-+ __timepunct<_CharT>::__timepunct(size_t __refs)
-+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
-+ _M_name_timepunct(_S_get_c_name())
-+ { _M_initialize_timepunct(); }
-+
-+ template<typename _CharT>
-+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
-+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
-+ _M_name_timepunct(_S_get_c_name())
-+ { _M_initialize_timepunct(); }
-+
-+ template<typename _CharT>
-+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
-+ size_t __refs)
-+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
-+ _M_name_timepunct(__s)
-+ {
-+ char* __tmp = new char[std::strlen(__s) + 1];
-+ std::strcpy(__tmp, __s);
-+ _M_name_timepunct = __tmp;
-+ _M_initialize_timepunct(__cloc);
-+ }
-+
-+ template<typename _CharT>
-+ __timepunct<_CharT>::~__timepunct()
-+ {
-+ if (_M_name_timepunct != _S_get_c_name())
-+ delete [] _M_name_timepunct;
-+ delete _M_data;
-+ _S_destroy_c_locale(_M_c_locale_timepunct);
-+ }
-diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
---- gcc-4.2.1.orig/libstdc++-v3/configure 2007-08-03 20:29:22.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/configure 2007-08-03 20:30:21.000000000 +0200
-@@ -5769,7 +5769,7 @@
- enableval="$enable_clocale"
-
- case "$enableval" in
-- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
-+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
- *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
- echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
- { (exit 1); exit 1; }; } ;;
-@@ -5802,6 +5802,9 @@
- # Default to "generic".
- if test $enable_clocale_flag = auto; then
- case ${target_os} in
-+ linux-uclibc*)
-+ enable_clocale_flag=uclibc
-+ ;;
- linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
- enable_clocale_flag=gnu
- ;;
-@@ -6190,6 +6193,76 @@
- CTIME_CC=config/locale/generic/time_members.cc
- CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
- ;;
-+ uclibc)
-+ echo "$as_me:$LINENO: result: uclibc" >&5
-+echo "${ECHO_T}uclibc" >&6
-+
-+ # Declare intention to use gettext, and add support for specific
-+ # languages.
-+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
-+ ALL_LINGUAS="de fr"
-+
-+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
-+ # Extract the first word of "msgfmt", so it can be a program name with args.
-+set dummy msgfmt; ac_word=$2
-+echo "$as_me:$LINENO: checking for $ac_word" >&5
-+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ if test -n "$check_msgfmt"; then
-+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+ IFS=$as_save_IFS
-+ test -z "$as_dir" && as_dir=.
-+ for ac_exec_ext in '' $ac_executable_extensions; do
-+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+ ac_cv_prog_check_msgfmt="yes"
-+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-+ break 2
-+ fi
-+done
-+done
-+
-+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
-+fi
-+fi
-+check_msgfmt=$ac_cv_prog_check_msgfmt
-+if test -n "$check_msgfmt"; then
-+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
-+echo "${ECHO_T}$check_msgfmt" >&6
-+else
-+ echo "$as_me:$LINENO: result: no" >&5
-+echo "${ECHO_T}no" >&6
-+fi
-+
-+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
-+ USE_NLS=yes
-+ fi
-+ # Export the build objects.
-+ for ling in $ALL_LINGUAS; do \
-+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
-+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
-+ done
-+
-+
-+
-+ CLOCALE_H=config/locale/uclibc/c_locale.h
-+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
-+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
-+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
-+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
-+ CMESSAGES_H=config/locale/uclibc/messages_members.h
-+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
-+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
-+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
-+ CTIME_H=config/locale/uclibc/time_members.h
-+ CTIME_CC=config/locale/uclibc/time_members.cc
-+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
-+ ;;
- esac
-
- # This is where the testsuite looks for locale catalogs, using the
-diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h
---- gcc-4.2.1.orig/libstdc++-v3/include/c_compatibility/wchar.h 2005-08-17 04:28:44.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/include/c_compatibility/wchar.h 2007-08-03 20:30:21.000000000 +0200
-@@ -101,7 +101,9 @@
- using std::wmemcpy;
- using std::wmemmove;
- using std::wmemset;
-+#if _GLIBCXX_HAVE_WCSFTIME
- using std::wcsftime;
-+#endif
-
- #if _GLIBCXX_USE_C99
- using std::wcstold;
-diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h
---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cwchar.h 2006-12-07 10:33:51.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cwchar.h 2007-08-03 20:30:21.000000000 +0200
-@@ -182,7 +182,9 @@
- using ::wcscoll;
- using ::wcscpy;
- using ::wcscspn;
-+#if _GLIBCXX_HAVE_WCSFTIME
- using ::wcsftime;
-+#endif
- using ::wcslen;
- using ::wcsncat;
- using ::wcsncmp;
diff --git a/patches/gcc/4.2.4/130-uclibc-locale-no__x.patch b/patches/gcc/4.2.4/130-uclibc-locale-no__x.patch
deleted file mode 100644
index d88dc22..0000000
--- a/patches/gcc/4.2.4/130-uclibc-locale-no__x.patch
+++ /dev/null
@@ -1,223 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2007-08-03 20:30:53.000000000 +0200
-@@ -39,20 +39,6 @@
- #include <langinfo.h>
- #include <bits/c++locale_internal.h>
-
--#ifndef __UCLIBC_HAS_XLOCALE__
--#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
--#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
--#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
--#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
--#define __strtof_l(S, E, L) strtof((S), (E))
--#define __strtod_l(S, E, L) strtod((S), (E))
--#define __strtold_l(S, E, L) strtold((S), (E))
--#warning should dummy __newlocale check for C|POSIX ?
--#define __newlocale(a, b, c) NULL
--#define __freelocale(a) ((void)0)
--#define __duplocale(a) __c_locale()
--#endif
--
- namespace std
- {
- template<>
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2007-08-03 20:30:53.000000000 +0200
-@@ -68,6 +68,7 @@
- {
- extern "C" __typeof(uselocale) __uselocale;
- }
-+#define __uselocale uselocale
- #endif
-
- namespace std
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2007-08-03 20:30:53.000000000 +0200
-@@ -60,4 +60,49 @@
- extern "C" __typeof(wctype_l) __wctype_l;
- #endif
-
-+# define __nl_langinfo_l nl_langinfo_l
-+# define __strcoll_l strcoll_l
-+# define __strftime_l strftime_l
-+# define __strtod_l strtod_l
-+# define __strtof_l strtof_l
-+# define __strtold_l strtold_l
-+# define __strxfrm_l strxfrm_l
-+# define __newlocale newlocale
-+# define __freelocale freelocale
-+# define __duplocale duplocale
-+# define __uselocale uselocale
-+
-+# ifdef _GLIBCXX_USE_WCHAR_T
-+# define __iswctype_l iswctype_l
-+# define __towlower_l towlower_l
-+# define __towupper_l towupper_l
-+# define __wcscoll_l wcscoll_l
-+# define __wcsftime_l wcsftime_l
-+# define __wcsxfrm_l wcsxfrm_l
-+# define __wctype_l wctype_l
-+# endif
-+
-+#else
-+# define __nl_langinfo_l(N, L) nl_langinfo((N))
-+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
-+# define __strtod_l(S, E, L) strtod((S), (E))
-+# define __strtof_l(S, E, L) strtof((S), (E))
-+# define __strtold_l(S, E, L) strtold((S), (E))
-+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
-+# warning should dummy __newlocale check for C|POSIX ?
-+# define __newlocale(a, b, c) NULL
-+# define __freelocale(a) ((void)0)
-+# define __duplocale(a) __c_locale()
-+//# define __uselocale ?
-+//
-+# ifdef _GLIBCXX_USE_WCHAR_T
-+# define __iswctype_l(C, M, L) iswctype((C), (M))
-+# define __towlower_l(C, L) towlower((C))
-+# define __towupper_l(C, L) towupper((C))
-+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
-+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
-+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
-+# define __wctype_l(S, L) wctype((S))
-+# endif
-+
- #endif // GLIBC 2.3 and later
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2007-08-03 20:30:53.000000000 +0200
-@@ -36,13 +36,6 @@
- #include <locale>
- #include <bits/c++locale_internal.h>
-
--#ifndef __UCLIBC_HAS_XLOCALE__
--#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
--#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
--#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
--#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
--#endif
--
- namespace std
- {
- // These are basically extensions to char_traits, and perhaps should
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2007-08-03 20:30:53.000000000 +0200
-@@ -38,13 +38,6 @@
- #undef _LIBC
- #include <bits/c++locale_internal.h>
-
--#ifndef __UCLIBC_HAS_XLOCALE__
--#define __wctype_l(S, L) wctype((S))
--#define __towupper_l(C, L) towupper((C))
--#define __towlower_l(C, L) towlower((C))
--#define __iswctype_l(C, M, L) iswctype((C), (M))
--#endif
--
- namespace std
- {
- // NB: The other ctype<char> specializations are in src/locale.cc and
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2007-08-03 20:30:53.000000000 +0200
-@@ -39,13 +39,10 @@
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning fix gettext stuff
- #endif
--#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
--extern "C" char *__dcgettext(const char *domainname,
-- const char *msgid, int category);
- #undef gettext
--#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
-+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
- #else
--#undef gettext
- #define gettext(msgid) (msgid)
- #endif
-
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2007-08-03 20:30:53.000000000 +0200
-@@ -36,15 +36,11 @@
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning fix prototypes for *textdomain funcs
- #endif
--#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
--extern "C" char *__textdomain(const char *domainname);
--extern "C" char *__bindtextdomain(const char *domainname,
-- const char *dirname);
--#else
--#undef __textdomain
--#undef __bindtextdomain
--#define __textdomain(D) ((void)0)
--#define __bindtextdomain(D,P) ((void)0)
-+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
-+#undef textdomain
-+#undef bindtextdomain
-+#define textdomain(D) ((void)0)
-+#define bindtextdomain(D,P) ((void)0)
- #endif
-
- // Non-virtual member functions.
-@@ -70,7 +66,7 @@
- messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
- const char* __dir) const
- {
-- __bindtextdomain(__s.c_str(), __dir);
-+ bindtextdomain(__s.c_str(), __dir);
- return this->do_open(__s, __loc);
- }
-
-@@ -90,7 +86,7 @@
- {
- // No error checking is done, assume the catalog exists and can
- // be used.
-- __textdomain(__s.c_str());
-+ textdomain(__s.c_str());
- return 0;
- }
-
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:30:53.000000000 +0200
-@@ -43,10 +43,6 @@
- #warning tailor for stub locale support
- #endif
-
--#ifndef __UCLIBC_HAS_XLOCALE__
--#define __nl_langinfo_l(N, L) nl_langinfo((N))
--#endif
--
- namespace std
- {
- // Construct and return valid pattern consisting of some combination of:
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:30:53.000000000 +0200
-@@ -41,9 +41,6 @@
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning tailor for stub locale support
- #endif
--#ifndef __UCLIBC_HAS_XLOCALE__
--#define __nl_langinfo_l(N, L) nl_langinfo((N))
--#endif
-
- namespace std
- {
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2007-08-03 20:30:53.000000000 +0200
-@@ -40,9 +40,6 @@
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning tailor for stub locale support
- #endif
--#ifndef __UCLIBC_HAS_XLOCALE__
--#define __nl_langinfo_l(N, L) nl_langinfo((N))
--#endif
-
- namespace std
- {
diff --git a/patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch b/patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
deleted file mode 100644
index 077bb56..0000000
--- a/patches/gcc/4.2.4/140-uclibc-locale-wchar_fix.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:30:53.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:31:24.000000000 +0200
-@@ -401,7 +401,7 @@
- # ifdef __UCLIBC_HAS_XLOCALE__
- _M_data->_M_decimal_point = __cloc->decimal_point_wc;
- _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
--# else
-+# elif defined __UCLIBC_HAS_LOCALE__
- _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
- _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
- # endif
-@@ -556,7 +556,7 @@
- # ifdef __UCLIBC_HAS_XLOCALE__
- _M_data->_M_decimal_point = __cloc->decimal_point_wc;
- _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
--# else
-+# elif defined __UCLIBC_HAS_LOCALE__
- _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
- _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
- # endif
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:30:53.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:31:24.000000000 +0200
-@@ -127,12 +127,25 @@
- {
- // Named locale.
- // NB: In the GNU model wchar_t is always 32 bit wide.
-+#ifdef __UCLIBC_MJN3_ONLY__
-+#warning fix this... should be numeric
-+#endif
-+#ifdef __UCLIBC__
-+# ifdef __UCLIBC_HAS_XLOCALE__
-+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
-+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-+# elif defined __UCLIBC_HAS_LOCALE__
-+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
-+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
-+# endif
-+#else
- union { char *__s; wchar_t __w; } __u;
- __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
- _M_data->_M_decimal_point = __u.__w;
-
- __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
- _M_data->_M_thousands_sep = __u.__w;
-+#endif
-
- if (_M_data->_M_thousands_sep == L'\0')
- _M_data->_M_grouping = "";
diff --git a/patches/gcc/4.2.4/150-uclibc-locale-update.patch b/patches/gcc/4.2.4/150-uclibc-locale-update.patch
deleted file mode 100644
index 534f4e4..0000000
--- a/patches/gcc/4.2.4/150-uclibc-locale-update.patch
+++ /dev/null
@@ -1,354 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2007-08-03 20:30:53.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2007-08-03 20:31:54.000000000 +0200
-@@ -46,16 +46,13 @@
- __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
- const __c_locale& __cloc)
- {
-- if (!(__err & ios_base::failbit))
-- {
-- char* __sanity;
-- errno = 0;
-- float __f = __strtof_l(__s, &__sanity, __cloc);
-- if (__sanity != __s && errno != ERANGE)
-- __v = __f;
-- else
-- __err |= ios_base::failbit;
-- }
-+ char* __sanity;
-+ errno = 0;
-+ float __f = __strtof_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && errno != ERANGE)
-+ __v = __f;
-+ else
-+ __err |= ios_base::failbit;
- }
-
- template<>
-@@ -63,16 +60,13 @@
- __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
- const __c_locale& __cloc)
- {
-- if (!(__err & ios_base::failbit))
-- {
-- char* __sanity;
-- errno = 0;
-- double __d = __strtod_l(__s, &__sanity, __cloc);
-- if (__sanity != __s && errno != ERANGE)
-- __v = __d;
-- else
-- __err |= ios_base::failbit;
-- }
-+ char* __sanity;
-+ errno = 0;
-+ double __d = __strtod_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && errno != ERANGE)
-+ __v = __d;
-+ else
-+ __err |= ios_base::failbit;
- }
-
- template<>
-@@ -80,16 +74,13 @@
- __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
- const __c_locale& __cloc)
- {
-- if (!(__err & ios_base::failbit))
-- {
-- char* __sanity;
-- errno = 0;
-- long double __ld = __strtold_l(__s, &__sanity, __cloc);
-- if (__sanity != __s && errno != ERANGE)
-- __v = __ld;
-- else
-- __err |= ios_base::failbit;
-- }
-+ char* __sanity;
-+ errno = 0;
-+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
-+ if (__sanity != __s && errno != ERANGE)
-+ __v = __ld;
-+ else
-+ __err |= ios_base::failbit;
- }
-
- void
-@@ -110,7 +101,7 @@
- void
- locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
- {
-- if (_S_get_c_locale() != __cloc)
-+ if (__cloc && _S_get_c_locale() != __cloc)
- __freelocale(__cloc);
- }
-
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2007-08-03 20:30:53.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2007-08-03 20:31:54.000000000 +0200
-@@ -39,21 +39,23 @@
- #pragma GCC system_header
-
- #include <cstring> // get std::strlen
--#include <cstdio> // get std::snprintf or std::sprintf
-+#include <cstdio> // get std::vsnprintf or std::vsprintf
- #include <clocale>
- #include <langinfo.h> // For codecvt
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning fix this
- #endif
--#ifdef __UCLIBC_HAS_LOCALE__
-+#ifdef _GLIBCXX_USE_ICONV
- #include <iconv.h> // For codecvt using iconv, iconv_t
- #endif
--#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
--#include <libintl.h> // For messages
-+#ifdef HAVE_LIBINTL_H
-+#include <libintl.h> // For messages
- #endif
-+#include <cstdarg>
-
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning what is _GLIBCXX_C_LOCALE_GNU for
-+// psm: used in os/gnu-linux/ctype_noninline.h
- #endif
- #define _GLIBCXX_C_LOCALE_GNU 1
-
-@@ -62,7 +64,7 @@
- #endif
- // #define _GLIBCXX_NUM_CATEGORIES 6
- #define _GLIBCXX_NUM_CATEGORIES 0
--
-+
- #ifdef __UCLIBC_HAS_XLOCALE__
- namespace __gnu_cxx
- {
-@@ -79,22 +81,24 @@
- typedef int* __c_locale;
- #endif
-
-- // Convert numeric value of type _Tv to string and return length of
-- // string. If snprintf is available use it, otherwise fall back to
-- // the unsafe sprintf which, in general, can be dangerous and should
-+ // Convert numeric value of type double to string and return length of
-+ // string. If vsnprintf is available use it, otherwise fall back to
-+ // the unsafe vsprintf which, in general, can be dangerous and should
- // be avoided.
-- template<typename _Tv>
-- int
-- __convert_from_v(char* __out,
-- const int __size __attribute__ ((__unused__)),
-- const char* __fmt,
--#ifdef __UCLIBC_HAS_XCLOCALE__
-- _Tv __v, const __c_locale& __cloc, int __prec)
-+ inline int
-+ __convert_from_v(const __c_locale&
-+#ifndef __UCLIBC_HAS_XCLOCALE__
-+ __cloc __attribute__ ((__unused__))
-+#endif
-+ ,
-+ char* __out,
-+ const int __size,
-+ const char* __fmt, ...)
- {
-+ va_list __args;
-+#ifdef __UCLIBC_HAS_XCLOCALE__
- __c_locale __old = __gnu_cxx::__uselocale(__cloc);
- #else
-- _Tv __v, const __c_locale&, int __prec)
-- {
- # ifdef __UCLIBC_HAS_LOCALE__
- char* __old = std::setlocale(LC_ALL, NULL);
- char* __sav = new char[std::strlen(__old) + 1];
-@@ -103,7 +107,9 @@
- # endif
- #endif
-
-- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
-+ va_start(__args, __fmt);
-+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
-+ va_end(__args);
-
- #ifdef __UCLIBC_HAS_XCLOCALE__
- __gnu_cxx::__uselocale(__old);
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2007-08-03 20:30:53.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2007-08-03 20:31:54.000000000 +0200
-@@ -33,9 +33,14 @@
-
- // Written by Benjamin Kosnik <bkoz@redhat.com>
-
-+#include <features.h>
-+#ifdef __UCLIBC_HAS_LOCALE__
- #define _LIBC
- #include <locale>
- #undef _LIBC
-+#else
-+#include <locale>
-+#endif
- #include <bits/c++locale_internal.h>
-
- namespace std
-@@ -138,20 +143,34 @@
- ctype<wchar_t>::
- do_is(mask __m, wchar_t __c) const
- {
-- // Highest bitmask in ctype_base == 10, but extra in "C"
-- // library for blank.
-+ // The case of __m == ctype_base::space is particularly important,
-+ // due to its use in many istream functions. Therefore we deal with
-+ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
-+ // is the mask corresponding to ctype_base::space. NB: an encoding
-+ // change would not affect correctness!
- bool __ret = false;
-- const size_t __bitmasksize = 11;
-- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-- if (__m & _M_bit[__bitcur]
-- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
-- {
-- __ret = true;
-- break;
-- }
-+ if (__m == _M_bit[5])
-+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
-+ else
-+ {
-+ // Highest bitmask in ctype_base == 10, but extra in "C"
-+ // library for blank.
-+ const size_t __bitmasksize = 11;
-+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
-+ if (__m & _M_bit[__bitcur])
-+ {
-+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
-+ {
-+ __ret = true;
-+ break;
-+ }
-+ else if (__m == _M_bit[__bitcur])
-+ break;
-+ }
-+ }
- return __ret;
- }
--
-+
- const wchar_t*
- ctype<wchar_t>::
- do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2007-08-03 20:30:53.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2007-08-03 20:31:54.000000000 +0200
-@@ -47,18 +47,21 @@
- template<typename _CharT>
- messages<_CharT>::messages(size_t __refs)
- : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
-- _M_name_messages(_S_get_c_name())
-+ _M_name_messages(_S_get_c_name())
- { }
-
- template<typename _CharT>
- messages<_CharT>::messages(__c_locale __cloc, const char* __s,
- size_t __refs)
-- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
-- _M_name_messages(__s)
-+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
- {
-- char* __tmp = new char[std::strlen(__s) + 1];
-- std::strcpy(__tmp, __s);
-+ const size_t __len = std::strlen(__s) + 1;
-+ char* __tmp = new char[__len];
-+ std::memcpy(__tmp, __s, __len);
- _M_name_messages = __tmp;
-+
-+ // Last to avoid leaking memory if new throws.
-+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
- }
-
- template<typename _CharT>
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:31:24.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2007-08-03 20:31:54.000000000 +0200
-@@ -33,9 +33,14 @@
-
- // Written by Benjamin Kosnik <bkoz@redhat.com>
-
-+#include <features.h>
-+#ifdef __UCLIBC_HAS_LOCALE__
- #define _LIBC
- #include <locale>
- #undef _LIBC
-+#else
-+#include <locale>
-+#endif
- #include <bits/c++locale_internal.h>
-
- #ifdef __UCLIBC_MJN3_ONLY__
-@@ -206,7 +211,7 @@
- }
- break;
- default:
-- ;
-+ __ret = pattern();
- }
- return __ret;
- }
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:31:24.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2007-08-03 20:31:54.000000000 +0200
-@@ -33,9 +33,14 @@
-
- // Written by Benjamin Kosnik <bkoz@redhat.com>
-
-+#include <features.h>
-+#ifdef __UCLIBC_HAS_LOCALE__
- #define _LIBC
- #include <locale>
- #undef _LIBC
-+#else
-+#include <locale>
-+#endif
- #include <bits/c++locale_internal.h>
-
- #ifdef __UCLIBC_MJN3_ONLY__
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h 2007-08-03 20:31:54.000000000 +0200
-@@ -37,25 +37,33 @@
- template<typename _CharT>
- __timepunct<_CharT>::__timepunct(size_t __refs)
- : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
-- _M_name_timepunct(_S_get_c_name())
-+ _M_name_timepunct(_S_get_c_name())
- { _M_initialize_timepunct(); }
-
- template<typename _CharT>
- __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
- : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
-- _M_name_timepunct(_S_get_c_name())
-+ _M_name_timepunct(_S_get_c_name())
- { _M_initialize_timepunct(); }
-
- template<typename _CharT>
- __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
- size_t __refs)
- : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
-- _M_name_timepunct(__s)
-+ _M_name_timepunct(NULL)
- {
-- char* __tmp = new char[std::strlen(__s) + 1];
-- std::strcpy(__tmp, __s);
-+ const size_t __len = std::strlen(__s) + 1;
-+ char* __tmp = new char[__len];
-+ std::memcpy(__tmp, __s, __len);
- _M_name_timepunct = __tmp;
-- _M_initialize_timepunct(__cloc);
-+
-+ try
-+ { _M_initialize_timepunct(__cloc); }
-+ catch(...)
-+ {
-+ delete [] _M_name_timepunct;
-+ __throw_exception_again;
-+ }
- }
-
- template<typename _CharT>
diff --git a/patches/gcc/4.2.4/160-libstdc++-pic.patch b/patches/gcc/4.2.4/160-libstdc++-pic.patch
deleted file mode 100644
index 7244d4c..0000000
--- a/patches/gcc/4.2.4/160-libstdc++-pic.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am 2006-07-28 06:57:34.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/src/Makefile.am 2007-08-03 20:32:27.000000000 +0200
-@@ -257,6 +257,12 @@
- $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
-
-
-+install-exec-local:
-+ifeq ($(enable_shared),yes)
-+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
-+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
-+endif
-+
- # Added bits to build debug library.
- if GLIBCXX_BUILD_DEBUG
- all-local: build_debug
-diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
---- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in 2006-10-16 21:08:22.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/src/Makefile.in 2007-08-03 20:32:27.000000000 +0200
-@@ -657,7 +657,7 @@
-
- install-data-am: install-data-local
-
--install-exec-am: install-toolexeclibLTLIBRARIES
-+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
-
- install-info: install-info-am
-
-@@ -690,6 +690,7 @@
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-data-local install-exec \
-+ install-exec-local \
- install-exec-am install-info install-info-am install-man \
- install-strip install-toolexeclibLTLIBRARIES installcheck \
- installcheck-am installdirs maintainer-clean \
-@@ -799,6 +800,13 @@
- install_debug:
- (cd ${debugdir} && $(MAKE) \
- toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
-+
-+install-exec-local:
-+ifeq ($(enable_shared),yes)
-+ $(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
-+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
-+endif
-+
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
diff --git a/patches/gcc/4.2.4/170-missing-execinfo_h.patch b/patches/gcc/4.2.4/170-missing-execinfo_h.patch
deleted file mode 100644
index ff67899..0000000
--- a/patches/gcc/4.2.4/170-missing-execinfo_h.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.2.1.orig/boehm-gc/include/gc.h gcc-4.2.1/boehm-gc/include/gc.h
---- gcc-4.2.1.orig/boehm-gc/include/gc.h 2006-09-18 20:45:08.000000000 +0200
-+++ gcc-4.2.1/boehm-gc/include/gc.h 2007-08-03 20:33:00.000000000 +0200
-@@ -502,7 +502,7 @@
- #if defined(__linux__) || defined(__GLIBC__)
- # include <features.h>
- # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
-- && !defined(__ia64__)
-+ && !defined(__ia64__) && !defined(__UCLIBC__)
- # ifndef GC_HAVE_BUILTIN_BACKTRACE
- # define GC_HAVE_BUILTIN_BACKTRACE
- # endif
diff --git a/patches/gcc/4.2.4/180-c99-snprintf.patch b/patches/gcc/4.2.4/180-c99-snprintf.patch
deleted file mode 100644
index ddb0c34..0000000
--- a/patches/gcc/4.2.4/180-c99-snprintf.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h
---- gcc-4.2.1.orig/libstdc++-v3/include/c_std/std_cstdio.h 2006-12-07 10:33:51.000000000 +0100
-+++ gcc-4.2.1/libstdc++-v3/include/c_std/std_cstdio.h 2007-08-03 20:33:24.000000000 +0200
-@@ -144,7 +144,7 @@
-
- _GLIBCXX_END_NAMESPACE
-
--#if _GLIBCXX_USE_C99
-+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
-
- #undef snprintf
- #undef vfscanf
diff --git a/patches/gcc/4.2.4/190-c99-complex-ugly-hack.patch b/patches/gcc/4.2.4/190-c99-complex-ugly-hack.patch
deleted file mode 100644
index de6d71c..0000000
--- a/patches/gcc/4.2.4/190-c99-complex-ugly-hack.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure
---- gcc-4.2.1.orig/libstdc++-v3/configure 2007-08-03 20:30:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/configure 2007-08-03 20:33:56.000000000 +0200
-@@ -7514,6 +7514,9 @@
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h. */
- #include <complex.h>
-+#ifdef __UCLIBC__
-+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
-+#endif
- int
- main ()
- {
diff --git a/patches/gcc/4.2.4/200-index_macro.patch b/patches/gcc/4.2.4/200-index_macro.patch
deleted file mode 100644
index 1e56b5d..0000000
--- a/patches/gcc/4.2.4/200-index_macro.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/rope gcc-4.2.1/libstdc++-v3/include/ext/rope
---- gcc-4.2.1.orig/libstdc++-v3/include/ext/rope 2006-10-17 13:56:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/include/ext/rope 2007-08-03 20:34:23.000000000 +0200
-@@ -58,6 +58,9 @@
- #include <bits/allocator.h>
- #include <ext/hash_fun.h>
-
-+/* cope w/ index defined as macro, SuSv3 proposal */
-+#undef index
-+
- # ifdef __GC
- # define __GC_CONST const
- # else
-diff -durN gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h
---- gcc-4.2.1.orig/libstdc++-v3/include/ext/ropeimpl.h 2006-10-17 13:56:21.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/include/ext/ropeimpl.h 2007-08-03 20:34:23.000000000 +0200
-@@ -54,6 +54,9 @@
- #include <ext/memory> // For uninitialized_copy_n
- #include <ext/numeric> // For power
-
-+/* cope w/ index defined as macro, SuSv3 proposal */
-+#undef index
-+
- _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
-
- using std::size_t;
diff --git a/patches/gcc/4.2.4/210-libmudflap-susv3-legacy.patch b/patches/gcc/4.2.4/210-libmudflap-susv3-legacy.patch
deleted file mode 100644
index 26e8704..0000000
--- a/patches/gcc/4.2.4/210-libmudflap-susv3-legacy.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -durN gcc-4.2.1.orig/libmudflap/mf-hooks2.c gcc-4.2.1/libmudflap/mf-hooks2.c
---- gcc-4.2.1.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
-+++ gcc-4.2.1/libmudflap/mf-hooks2.c 2007-08-03 20:35:09.000000000 +0200
-@@ -427,7 +427,7 @@
- {
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
-- bzero (s, n);
-+ memset (s, 0, n);
- }
-
-
-@@ -437,7 +437,7 @@
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
- MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
-- bcopy (src, dest, n);
-+ memmove (dest, src, n);
- }
-
-
-@@ -447,7 +447,7 @@
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
- MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
-- return bcmp (s1, s2, n);
-+ return n == 0 ? 0 : memcmp (s1, s2, n);
- }
-
-
-@@ -456,7 +456,7 @@
- size_t n = strlen (s);
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
-- return index (s, c);
-+ return strchr (s, c);
- }
-
-
-@@ -465,7 +465,7 @@
- size_t n = strlen (s);
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
-- return rindex (s, c);
-+ return strrchr (s, c);
- }
-
- /* XXX: stpcpy, memccpy */
diff --git a/patches/gcc/4.2.4/220-libstdc++-namespace.patch b/patches/gcc/4.2.4/220-libstdc++-namespace.patch
deleted file mode 100644
index 709e8f2..0000000
--- a/patches/gcc/4.2.4/220-libstdc++-namespace.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2007-08-03 20:31:54.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2007-08-03 20:35:40.000000000 +0200
-@@ -32,7 +32,8 @@
- //
-
- // Written by Benjamin Kosnik <bkoz@redhat.com>
--
-+namespace std
-+{
- #ifdef __UCLIBC_MJN3_ONLY__
- #warning fix prototypes for *textdomain funcs
- #endif
-@@ -115,3 +116,4 @@
- this->_S_create_c_locale(this->_M_c_locale_messages, __s);
- }
- }
-+}
-diff -durN gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h
---- gcc-4.2.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2007-08-03 20:31:54.000000000 +0200
-+++ gcc-4.2.1/libstdc++-v3/config/locale/uclibc/time_members.h 2007-08-03 20:35:40.000000000 +0200
-@@ -33,7 +33,8 @@
- //
-
- // Written by Benjamin Kosnik <bkoz@redhat.com>
--
-+namespace std
-+{
- template<typename _CharT>
- __timepunct<_CharT>::__timepunct(size_t __refs)
- : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
-@@ -74,3 +75,4 @@
- delete _M_data;
- _S_destroy_c_locale(_M_c_locale_timepunct);
- }
-+}
diff --git a/patches/gcc/4.2.4/230-libbackend_dep_gcov-iov.h.patch b/patches/gcc/4.2.4/230-libbackend_dep_gcov-iov.h.patch
deleted file mode 100644
index 32754be..0000000
--- a/patches/gcc/4.2.4/230-libbackend_dep_gcov-iov.h.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.2.1.orig/gcc/Makefile.in gcc-4.2.1/gcc/Makefile.in
---- gcc-4.2.1.orig/gcc/Makefile.in 2007-05-31 17:37:38.000000000 +0200
-+++ gcc-4.2.1/gcc/Makefile.in 2007-08-03 20:36:14.000000000 +0200
-@@ -2660,7 +2660,7 @@
- # FIXME: writing proper dependencies for this is a *LOT* of work.
- libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
- insn-config.h insn-flags.h insn-codes.h insn-constants.h \
-- insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
-+ insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
- $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
- -DTARGET_NAME=\"$(target_noncanonical)\" \
- -DLOCALEDIR=\"$(localedir)\" \
diff --git a/patches/gcc/4.2.4/240-arm-bigendian.patch b/patches/gcc/4.2.4/240-arm-bigendian.patch
deleted file mode 100644
index 2abeccd..0000000
--- a/patches/gcc/4.2.4/240-arm-bigendian.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -durN gcc-4.2.1.orig/gcc/config/arm/linux-elf.h gcc-4.2.1/gcc/config/arm/linux-elf.h
---- gcc-4.2.1.orig/gcc/config/arm/linux-elf.h 2006-02-17 00:29:10.000000000 +0100
-+++ gcc-4.2.1/gcc/config/arm/linux-elf.h 2007-08-03 20:36:43.000000000 +0200
-@@ -28,19 +28,33 @@
- #undef TARGET_VERSION
- #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
-
-+/*
-+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
-+ * (big endian) configurations.
-+ */
-+#if TARGET_BIG_ENDIAN_DEFAULT
-+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
-+#define TARGET_ENDIAN_OPTION "mbig-endian"
-+#define TARGET_LINKER_EMULATION "armelfb_linux"
-+#else
-+#define TARGET_ENDIAN_DEFAULT 0
-+#define TARGET_ENDIAN_OPTION "mlittle-endian"
-+#define TARGET_LINKER_EMULATION "armelf_linux"
-+#endif
-+
- #undef TARGET_DEFAULT_FLOAT_ABI
- #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
-
- #undef TARGET_DEFAULT
--#define TARGET_DEFAULT (0)
-+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
-
- #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
-
--#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
-+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
-
- #undef MULTILIB_DEFAULTS
- #define MULTILIB_DEFAULTS \
-- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
-+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
-
- /* Now we define the strings used to build the spec file. */
- #undef LIB_SPEC
-@@ -61,7 +75,7 @@
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
- -X \
-- %{mbig-endian:-EB}" \
-+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
- SUBTARGET_EXTRA_LINK_SPEC
-
- #undef LINK_SPEC
-diff -durN gcc-4.2.1.orig/gcc/config.gcc gcc-4.2.1/gcc/config.gcc
---- gcc-4.2.1.orig/gcc/config.gcc 2007-08-03 20:29:52.000000000 +0200
-+++ gcc-4.2.1/gcc/config.gcc 2007-08-03 20:36:43.000000000 +0200
-@@ -705,6 +705,11 @@
- tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
- tmake_file="${tmake_file} t-linux arm/t-arm"
- case ${target} in
-+ arm*b-*)
-+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
-+ ;;
-+ esac
-+ case ${target} in
- arm*-*-linux-*eabi)
- tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
- tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
diff --git a/patches/gcc/4.2.4/241-arm-bigendian2.patch b/patches/gcc/4.2.4/241-arm-bigendian2.patch
deleted file mode 100644
index 9b9c131..0000000
--- a/patches/gcc/4.2.4/241-arm-bigendian2.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> wrote:
-
-I tried to use crosstool-ng to generate a toolchain for Linux on big
-endian arm with recent versions of gcc, glibc, etc... but had a few
-problems.
-
-It appears that the gcc patch (for gcc 4.2.x)
-for big-endian arm (240-arm-bigendian.patch) lacks the change attached
-to this mail as 240-arm-bigendian2.patch.
-
---- gcc-4.2.4/gcc/config/arm/bpabi.h~ 2007-09-01 17:28:30.000000000 +0200
-+++ gcc-4.2.4/gcc/config/arm/bpabi.h 2009-01-05 19:19:10.000000000 +0100
-@@ -32,9 +32,19 @@
- #undef FPUTYPE_DEFAULT
- #define FPUTYPE_DEFAULT FPUTYPE_VFP
-
-+/*
-+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
-+ * (big endian) configurations.
-+ */
-+#if TARGET_BIG_ENDIAN_DEFAULT
-+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
-+#else
-+#define TARGET_ENDIAN_DEFAULT 0
-+#endif
-+
- /* EABI targets should enable interworking by default. */
- #undef TARGET_DEFAULT
--#define TARGET_DEFAULT MASK_INTERWORK
-+#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
-
- /* The ARM BPABI functions return a boolean; they use no special
- calling convention. */
diff --git a/patches/gcc/4.2.4/250-softfloat-fix.patch b/patches/gcc/4.2.4/250-softfloat-fix.patch
deleted file mode 100644
index 3517856..0000000
--- a/patches/gcc/4.2.4/250-softfloat-fix.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-This patch (C) 2007 Yann E. MORIN
-Licensed under GPL v2.
-
-First hunk of this patch solves compiling uClibc:
-
-make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
- LD libuClibc-0.9.29.so
-libc/libc_so.a(difftime.os): In function `difftime':
-difftime.c:(.text+0x8): undefined reference to `__floatsidf'
-difftime.c:(.text+0x2c): undefined reference to `__subdf3'
-libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
-_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
-_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
-_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
-_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
-_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
-_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
-_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
-libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
-__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
-libc/libc_so.a(strtof.os): In function `strtof':
-strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
-/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
-In function `__fixunsdfsi':
-libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
-make[2]: *** [lib/libc.so] Error 1
-make[1]: *** [lib/libc.so.0] Error 2
-make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
-make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
-Error 2
-
-The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
-
-
-diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
---- gcc-4.2.0.orig/gcc/config.gcc 2007-07-15 11:24:18.000000000 +0200
-+++ gcc-4.2.0/gcc/config.gcc 2007-07-15 11:26:02.000000000 +0200
-@@ -721,7 +721,7 @@
- default_use_cxa_atexit=yes
- ;;
- *)
-- tmake_file="$tmake_file arm/t-linux"
-+ tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
- ;;
- esac
- tm_file="$tm_file arm/aout.h arm/arm.h"
-diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
---- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h 2007-07-15 11:24:18.000000000 +0200
-+++ gcc-4.2.0/gcc/config/arm/linux-elf.h 2007-07-15 11:26:02.000000000 +0200
-@@ -63,7 +63,7 @@
- %{shared:-lc} \
- %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-
--#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
-+#define LIBGCC_SPEC "-lgcc"
-
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-
diff --git a/patches/gcc/4.2.4/260-flatten-switch-stmt-00.patch b/patches/gcc/4.2.4/260-flatten-switch-stmt-00.patch
deleted file mode 100644
index 6c40c57..0000000
--- a/patches/gcc/4.2.4/260-flatten-switch-stmt-00.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -durN gcc-4.2.1.orig/gcc/stmt.c gcc-4.2.1/gcc/stmt.c
---- gcc-4.2.1.orig/gcc/stmt.c 2007-07-19 05:25:32.000000000 +0200
-+++ gcc-4.2.1/gcc/stmt.c 2007-08-03 20:37:19.000000000 +0200
-@@ -2512,7 +2512,11 @@
- use_cost_table
- = (TREE_CODE (orig_type) != ENUMERAL_TYPE
- && estimate_case_costs (case_list));
-- balance_case_nodes (&case_list, NULL);
-+ /* When optimizing for size, we want a straight list to avoid
-+ jumps as much as possible. This basically creates an if-else
-+ chain. */
-+ if (!optimize_size)
-+ balance_case_nodes (&case_list, NULL);
- emit_case_nodes (index, case_list, default_label, index_type);
- emit_jump (default_label);
- }
-@@ -3070,6 +3074,7 @@
- {
- if (!node_has_low_bound (node, index_type))
- {
-+ if (!optimize_size) /* don't jl to the .default_label. */
- emit_cmp_and_jump_insns (index,
- convert_modes
- (mode, imode,
diff --git a/patches/gcc/4.2.4/270-soft-float.patch b/patches/gcc/4.2.4/270-soft-float.patch
deleted file mode 100644
index 4287bfa..0000000
--- a/patches/gcc/4.2.4/270-soft-float.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
---- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c 2007-03-05 11:54:00.000000000 -0500
-+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c 2008-01-31 17:51:24.000000000 -0500
-@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
- but GCC currently generates poor code when a union is used to turn
- a long double into a pair of doubles. */
-
-+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
-+
- long double __gcc_qadd (double, double, double, double);
- long double __gcc_qsub (double, double, double, double);
- long double __gcc_qmul (double, double, double, double);
-@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
- return z.ldval;
- }
-
--#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
--
- long double __gcc_qneg (double, double);
- int __gcc_qeq (double, double, double, double);
- int __gcc_qne (double, double, double, double);
diff --git a/patches/gcc/4.2.4/280-eabi_fixes.patch b/patches/gcc/4.2.4/280-eabi_fixes.patch
deleted file mode 100644
index 7dce608..0000000
--- a/patches/gcc/4.2.4/280-eabi_fixes.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -durN gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h gcc-4.2.3/gcc/config/arm/linux-eabi.h
---- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h 2007-09-01 17:28:30.000000000 +0200
-+++ gcc-4.2.3/gcc/config/arm/linux-eabi.h 2008-05-25 23:47:36.000000000 +0200
-@@ -47,7 +47,8 @@
- #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
-
- #undef SUBTARGET_EXTRA_LINK_SPEC
--#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
-+#define SUBTARGET_EXTRA_LINK_SPEC \
-+ " %{mlittle-endian:-m armelf_linux_eabi} %{mbig-endian:-m armelfb_linux_eabi}"
-
- /* Use ld-linux.so.3 so that it will be possible to run "classic"
- GNU/Linux binaries on an EABI system. */
diff --git a/patches/gcc/4.2.4/290-alpha-signal_h.patch b/patches/gcc/4.2.4/290-alpha-signal_h.patch
deleted file mode 100644
index d7e1796..0000000
--- a/patches/gcc/4.2.4/290-alpha-signal_h.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500
-+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500
-@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */
- /* Do code reading to identify a signal frame, and set the frame
- state data appropriately. See unwind-dw2.c for the structs. */
-
-+/* Don't use this if inhibit_libc is set
-+ The build for this target will fail trying to include missing headers */
-+#ifndef inhibit_libc
- #include <signal.h>
- #include <sys/ucontext.h>
-
-@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
- fs->retaddr_column = 64;
- return _URC_NO_REASON;
- }
-+#endif /* inhibit_libc */
diff --git a/patches/gcc/4.2.4/300-fortran-signed-TImode.patch b/patches/gcc/4.2.4/300-fortran-signed-TImode.patch
deleted file mode 100644
index 01e2f01..0000000
--- a/patches/gcc/4.2.4/300-fortran-signed-TImode.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Fix building gfortran for ARM.
-http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01010.html
-----
-
-The patch below fixes a crash building libgfortran on arm-linux-gnueabi.
-
-This target doesn't really have a 128-bit integer type, however it does use
-TImode to represent the return value of certain special ABI defined library
-functions. This results in type_for_size(TImode) being called.
-
-Because TImode deosn't correspond to any gfortran integer kind
-gfc_type_for_size returns NULL and we segfault shortly after.
-
-The patch below fixes this by making gfc_type_for_size handle TImode in the
-same way as the C frontend.
-
-Tested on x86_64-linux and arm-linux-gnueabi.
-Applied to trunk.
-
-Paul
-
-2007-05-15 Paul Brook <paul@codesourcery.com>
-
- gcc/fortran/
- * trans-types.c (gfc_type_for_size): Handle signed TImode.
-
-diff -durN gcc-4.2.3.old/gcc/fortran/trans-types.c gcc-4.2.3/gcc/fortran/trans-types.c
---- gcc-4.2.3.old/gcc/fortran/trans-types.c 2007-08-31 10:27:50.000000000 +0200
-+++ gcc-4.2.3/gcc/fortran/trans-types.c 2008-07-17 09:54:20.000000000 +0200
-@@ -1799,6 +1799,13 @@
- if (type && bits == TYPE_PRECISION (type))
- return type;
- }
-+
-+ /* Handle TImode as a special case because it is used by some backends
-+ (eg. ARM) even though it is not available for normal use. */
-+#if HOST_BITS_PER_WIDE_INT >= 64
-+ if (bits == TYPE_PRECISION (intTI_type_node))
-+ return intTI_type_node;
-+#endif
- }
- else
- {
diff --git a/patches/gcc/4.2.4/310-sh-without-headers.patch b/patches/gcc/4.2.4/310-sh-without-headers.patch
deleted file mode 100644
index 07ddb65..0000000
--- a/patches/gcc/4.2.4/310-sh-without-headers.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-On 20081011, Khem RAJ writes:
- You have to bar gcc trying to build unwinding at stage 1. Try the
- attached patch and see if it helps.
-
- gcc/config/sh/linux-unwind.h | 3 +++
- 1 file changed, 3 insertions(+)
-
-Index: gcc-4_2-branch/gcc/config/sh/linux-unwind.h
-===================================================================
---- gcc-4_2-branch.orig/gcc/config/sh/linux-unwind.h 2008-07-01 17:24:40.000000000 -0700
-+++ gcc-4_2-branch/gcc/config/sh/linux-unwind.h 2008-07-01 17:25:47.000000000 -0700
-@@ -26,6 +26,8 @@ along with this program; see the file CO
- the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-+#ifndef inhibit_libc
-+
- /* Do code reading to identify a signal frame, and set the frame
- state data appropriately. See unwind-dw2.c for the structs. */
-
-@@ -251,3 +253,4 @@ sh_fallback_frame_state (struct _Unwind_
- return _URC_NO_REASON;
- }
- #endif /* defined (__SH5__) */
-+#endif /* ifndef inhibit_libc */
-
diff --git a/patches/gcc/4.2.4/320-libgcc_eh.a.patch b/patches/gcc/4.2.4/320-libgcc_eh.a.patch
deleted file mode 100644
index 909db3a..0000000
--- a/patches/gcc/4.2.4/320-libgcc_eh.a.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Vampirised from:
- http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
-
-diff -durN gcc-4.2.2.orig/gcc/mklibgcc.in gcc-4.2.2/gcc/mklibgcc.in
---- gcc-4.2.2.orig/gcc/mklibgcc.in 2006-07-04 22:20:01.000000000 +0200
-+++ gcc-4.2.2/gcc/mklibgcc.in 2011-08-31 16:24:03.674690016 +0200
-@@ -223,8 +223,8 @@
- if [ "$LIBUNWIND" ]; then
- libunwind_a=$dir/libunwind.a
- fi
-+ libgcc_eh_a=$dir/libgcc_eh.a
- if [ "$SHLIB_LINK" ]; then
-- libgcc_eh_a=$dir/libgcc_eh.a
- libgcc_s_so=$dir/libgcc_s${SHLIB_EXT}
- if [ "$LIBUNWIND" ]; then
- libunwind_so=$dir/libunwind${SHLIB_EXT}
-@@ -889,11 +889,11 @@
- echo ' chmod 644' ${ldir}/libgcov.a
- echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
-
-- if [ "$SHLIB_LINK" ]; then
-- echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
-- echo ' chmod 644' ${ldir}/libgcc_eh.a
-- echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
-+ echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
-+ echo ' chmod 644' ${ldir}/libgcc_eh.a
-+ echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
-
-+ if [ "$SHLIB_LINK" ]; then
- shlib_slibdir_qual=
- os_multilib_dir=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
- if [ "$os_multilib_dir" != . ]; then
diff --git a/patches/gcc/4.3.6/100-alpha-mieee-default.patch b/patches/gcc/4.3.6/100-alpha-mieee-default.patch
deleted file mode 100644
index 945019d..0000000
--- a/patches/gcc/4.3.6/100-alpha-mieee-default.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Original patch from: ../4.3.2/100-alpha-mieee-default.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
-Set the default behavior on alpha to use -mieee since the large majority of
-time we want this (bad/weird things can happen with packages built without
--mieee).
-
-To satisfy those people who may not want -mieee forced on them all the time,
-we also provide -mno-ieee.
-
-Patch by Mike Frysinger <vapier@gentoo.org>
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/alpha/alpha.h gcc-4.3.3/gcc/config/alpha/alpha.h
---- gcc-4.3.3.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100
-+++ gcc-4.3.3/gcc/config/alpha/alpha.h 2009-01-27 22:19:02.000000000 +0100
-@@ -95,6 +95,8 @@
- while (0)
- #endif
-
-+#define CPP_SPEC "%{!no-ieee:-mieee}"
-+
- #define WORD_SWITCH_TAKES_ARG(STR) \
- (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
-
-diff -durN gcc-4.3.3.orig/gcc/config/alpha/alpha.opt gcc-4.3.3/gcc/config/alpha/alpha.opt
---- gcc-4.3.3.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200
-+++ gcc-4.3.3/gcc/config/alpha/alpha.opt 2009-01-27 22:19:02.000000000 +0100
-@@ -39,7 +39,7 @@
- Request IEEE-conformant math library routines (OSF/1)
-
- mieee
--Target Report RejectNegative Mask(IEEE)
-+Target Report Mask(IEEE)
- Emit IEEE-conformant code, without inexact exceptions
-
- mieee-with-inexact
diff --git a/patches/gcc/4.3.6/110-trampolinewarn.patch b/patches/gcc/4.3.6/110-trampolinewarn.patch
deleted file mode 100644
index 43ab217..0000000
--- a/patches/gcc/4.3.6/110-trampolinewarn.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Original patch from: ../4.3.2/110-trampolinewarn.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
- This trivial patch causes gcc to emit a warning whenever
- it generates a trampoline. These are otherwise hard to
- locate. It is rigged to default ON - to have it default
- to OFF remove the text 'Init(1)' from the common.opt
- patch, leaving just 'Common Var(warn_trampolines)'.
- Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/builtins.c gcc-4.3.3/gcc/builtins.c
---- gcc-4.3.3.orig/gcc/builtins.c 2008-08-19 18:37:13.000000000 +0200
-+++ gcc-4.3.3/gcc/builtins.c 2009-01-27 22:19:12.000000000 +0100
-@@ -5662,6 +5662,9 @@
- trampolines_created = 1;
- INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
-
-+ if (warn_trampolines)
-+ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
-+
- return const0_rtx;
- }
-
-diff -durN gcc-4.3.3.orig/gcc/common.opt gcc-4.3.3/gcc/common.opt
---- gcc-4.3.3.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100
-+++ gcc-4.3.3/gcc/common.opt 2009-01-27 22:19:12.000000000 +0100
-@@ -182,6 +182,10 @@
- Common Var(warn_system_headers) Warning
- Do not suppress warnings from system headers
-
-+Wtrampolines
-+Common Var(warn_trampolines) Init(1)
-+Warn whenever a trampoline is generated
-+
- Wuninitialized
- Common Var(warn_uninitialized) Warning
- Warn about uninitialized automatic variables
diff --git a/patches/gcc/4.3.6/120-java-nomulti.patch b/patches/gcc/4.3.6/120-java-nomulti.patch
deleted file mode 100644
index 47b813e..0000000
--- a/patches/gcc/4.3.6/120-java-nomulti.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-Original patch from: ../4.3.2/120-java-nomulti.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/libjava/configure gcc-4.3.3/libjava/configure
---- gcc-4.3.3.orig/libjava/configure 2009-01-24 11:32:29.000000000 +0100
-+++ gcc-4.3.3/libjava/configure 2009-01-27 22:19:14.000000000 +0100
-@@ -1018,6 +1018,8 @@
- --enable-gconf-peer compile GConf native peers for util.preferences
- --enable-java-maintainer-mode
- allow rebuilding of .class and .h files
-+ --enable-libjava-multilib
-+ build libjava as multilib
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-maintainer-mode enable make rules and dependencies not useful
-@@ -1850,6 +1852,16 @@
- fi
-
-
-+# Check whether --enable-libjava-multilib was given.
-+if test "${enable_libjava_multilib+set}" = set; then
-+ enableval=$enable_libjava_multilib;
-+fi
-+
-+if test "$enable_libjava_multilib" = no; then
-+ multilib=no
-+ ac_configure_args="$ac_configure_args --disable-multilib"
-+fi
-+
- # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
-
-
-diff -durN gcc-4.3.3.orig/libjava/configure.ac gcc-4.3.3/libjava/configure.ac
---- gcc-4.3.3.orig/libjava/configure.ac 2008-07-02 23:23:43.000000000 +0200
-+++ gcc-4.3.3/libjava/configure.ac 2009-01-27 22:19:14.000000000 +0100
-@@ -82,6 +82,13 @@
- [allow rebuilding of .class and .h files]))
- AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
-
-+AC_ARG_ENABLE(libjava-multilib,
-+ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
-+if test "$enable_libjava_multilib" = no; then
-+ multilib=no
-+ ac_configure_args="$ac_configure_args --disable-multilib"
-+fi
-+
- # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
- GCC_NO_EXECUTABLES
-
diff --git a/patches/gcc/4.3.6/130-cross-compile.patch b/patches/gcc/4.3.6/130-cross-compile.patch
deleted file mode 100644
index e265998..0000000
--- a/patches/gcc/4.3.6/130-cross-compile.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Original patch from: ../4.3.2/130-cross-compile.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
-Some notes on the 'bootstrap with or without libc headers' debate:
-http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
-http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/configure gcc-4.3.3/gcc/configure
---- gcc-4.3.3.orig/gcc/configure 2008-08-01 11:51:03.000000000 +0200
-+++ gcc-4.3.3/gcc/configure 2009-01-27 22:19:16.000000000 +0100
-@@ -13442,7 +13442,7 @@
- | powerpc*-*-*,powerpc64*-*-*)
- CROSS="$CROSS -DNATIVE_CROSS" ;;
- esac
--elif test "x$TARGET_SYSTEM_ROOT" != x; then
-+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
- SYSTEM_HEADER_DIR=$build_system_header_dir
- fi
-
-diff -durN gcc-4.3.3.orig/gcc/configure.ac gcc-4.3.3/gcc/configure.ac
---- gcc-4.3.3.orig/gcc/configure.ac 2008-08-01 11:51:03.000000000 +0200
-+++ gcc-4.3.3/gcc/configure.ac 2009-01-27 22:19:16.000000000 +0100
-@@ -1749,7 +1749,7 @@
- | powerpc*-*-*,powerpc64*-*-*)
- CROSS="$CROSS -DNATIVE_CROSS" ;;
- esac
--elif test "x$TARGET_SYSTEM_ROOT" != x; then
-+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
- SYSTEM_HEADER_DIR=$build_system_header_dir
- fi
-
-diff -durN gcc-4.3.3.orig/gcc/unwind-dw2.c gcc-4.3.3/gcc/unwind-dw2.c
---- gcc-4.3.3.orig/gcc/unwind-dw2.c 2008-09-25 00:44:28.000000000 +0200
-+++ gcc-4.3.3/gcc/unwind-dw2.c 2009-01-27 22:19:16.000000000 +0100
-@@ -334,9 +334,11 @@
- }
- #endif
-
-+#ifndef inhibit_libc
- #ifdef MD_UNWIND_SUPPORT
- #include MD_UNWIND_SUPPORT
- #endif
-+#endif
-
- /* Extract any interesting information from the CIE for the translation
- unit F belongs to. Return a pointer to the byte after the augmentation,
diff --git a/patches/gcc/4.3.6/140-netbsd-symbolic.patch b/patches/gcc/4.3.6/140-netbsd-symbolic.patch
deleted file mode 100644
index a899dd6..0000000
--- a/patches/gcc/4.3.6/140-netbsd-symbolic.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Original patch from: ../4.3.2/140-netbsd-symbolic.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch
-http://bugs.gentoo.org/122698
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/netbsd-elf.h gcc-4.3.3/gcc/config/netbsd-elf.h
---- gcc-4.3.3.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200
-+++ gcc-4.3.3/gcc/config/netbsd-elf.h 2009-01-27 22:19:18.000000000 +0100
-@@ -82,6 +82,7 @@
- #define NETBSD_LINK_SPEC_ELF \
- "%{assert*} %{R*} %{rpath*} \
- %{shared:-shared} \
-+ %{symbolic:-Bsymbolic} \
- %{!shared: \
- -dc -dp \
- %{!nostdlib: \
diff --git a/patches/gcc/4.3.6/150-sparc64-bsd.patch b/patches/gcc/4.3.6/150-sparc64-bsd.patch
deleted file mode 100644
index 233a763..0000000
--- a/patches/gcc/4.3.6/150-sparc64-bsd.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Original patch from: ../4.3.2/150-sparc64-bsd.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/sparc/freebsd.h gcc-4.3.3/gcc/config/sparc/freebsd.h
---- gcc-4.3.3.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200
-+++ gcc-4.3.3/gcc/config/sparc/freebsd.h 2009-01-27 22:19:20.000000000 +0100
-@@ -25,9 +25,22 @@
- /* FreeBSD needs the platform name (sparc64) defined.
- Emacs needs to know if the arch is 64 or 32-bits. */
-
--#undef CPP_CPU64_DEFAULT_SPEC
--#define CPP_CPU64_DEFAULT_SPEC \
-- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
-+#undef FBSD_TARGET_CPU_CPP_BUILTINS
-+#define FBSD_TARGET_CPU_CPP_BUILTINS() \
-+ do \
-+ { \
-+ if (TARGET_ARCH64) \
-+ { \
-+ builtin_define ("__sparc64__"); \
-+ builtin_define ("__sparc_v9__"); \
-+ builtin_define ("__sparcv9"); \
-+ } \
-+ else \
-+ builtin_define ("__sparc"); \
-+ builtin_define ("__sparc__"); \
-+ } \
-+ while (0)
-+
-
- #define LINK_SPEC "%(link_arch) \
- %{!mno-relax:%{!r:-relax}} \
diff --git a/patches/gcc/4.3.6/160-flatten-switch-stmt-00.patch b/patches/gcc/4.3.6/160-flatten-switch-stmt-00.patch
deleted file mode 100644
index 82acfbc..0000000
--- a/patches/gcc/4.3.6/160-flatten-switch-stmt-00.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-Original patch from: ../4.3.2/160-flatten-switch-stmt-00.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch
-http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
-
-Hi,
-
-The attached patch makes sure that we create smaller object code for
-simple switch statements. We just make sure to flatten the switch
-statement into an if-else chain, basically.
-
-This fixes a size-regression as compared to gcc-3.4, as can be seen
-below.
-
-2007-04-15 Bernhard Fischer <..>
-
- * stmt.c (expand_case): Do not create a complex binary tree when
- optimizing for size but rather use the simple ordered list.
- (emit_case_nodes): do not emit jumps to the default_label when
- optimizing for size.
-
-Not regtested so far.
-Comments?
-
-Attached is the test switch.c mentioned below.
-
-$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
-gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
-$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
-gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
-
-$ size switch-*.o
- text data bss dec hex filename
- 169 0 0 169 a9 switch-2.95.o
- 115 0 0 115 73 switch-3.3.o
- 103 0 0 103 67 switch-3.4.o
- 124 0 0 124 7c switch-4.0.o
- 124 0 0 124 7c switch-4.1.o
- 124 0 0 124 7c switch-4.2.orig-HEAD.o
- 95 0 0 95 5f switch-4.3-HEAD.o
- 124 0 0 124 7c switch-4.3.orig-HEAD.o
- 166 0 0 166 a6 switch-CHAIN-2.95.o
- 111 0 0 111 6f switch-CHAIN-3.3.o
- 95 0 0 95 5f switch-CHAIN-3.4.o
- 95 0 0 95 5f switch-CHAIN-4.0.o
- 95 0 0 95 5f switch-CHAIN-4.1.o
- 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
- 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
- 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
-
-
-Content-Type: text/x-diff; charset=us-ascii
-Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/stmt.c gcc-4.3.3/gcc/stmt.c
---- gcc-4.3.3.orig/gcc/stmt.c 2008-05-09 20:12:13.000000000 +0200
-+++ gcc-4.3.3/gcc/stmt.c 2009-01-27 22:19:28.000000000 +0100
-@@ -2509,7 +2509,11 @@
- use_cost_table
- = (TREE_CODE (orig_type) != ENUMERAL_TYPE
- && estimate_case_costs (case_list));
-- balance_case_nodes (&case_list, NULL);
-+ /* When optimizing for size, we want a straight list to avoid
-+ jumps as much as possible. This basically creates an if-else
-+ chain. */
-+ if (!optimize_size)
-+ balance_case_nodes (&case_list, NULL);
- emit_case_nodes (index, case_list, default_label, index_type);
- emit_jump (default_label);
- }
-@@ -3067,6 +3071,7 @@
- {
- if (!node_has_low_bound (node, index_type))
- {
-+ if (!optimize_size) /* don't jl to the .default_label. */
- emit_cmp_and_jump_insns (index,
- convert_modes
- (mode, imode,
diff --git a/patches/gcc/4.3.6/170-libiberty-pic.patch b/patches/gcc/4.3.6/170-libiberty-pic.patch
deleted file mode 100644
index 00789d0..0000000
--- a/patches/gcc/4.3.6/170-libiberty-pic.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from: ../4.3.2/170-libiberty-pic.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/libiberty/Makefile.in gcc-4.3.3/libiberty/Makefile.in
---- gcc-4.3.3.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200
-+++ gcc-4.3.3/libiberty/Makefile.in 2009-01-27 22:19:30.000000000 +0100
-@@ -225,6 +225,7 @@
- $(AR) $(AR_FLAGS) $(TARGETLIB) \
- $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
- $(RANLIB) $(TARGETLIB); \
-+ cp $(TARGETLIB) ../ ; \
- cd ..; \
- else true; fi
-
diff --git a/patches/gcc/4.3.6/180-superh-default-multilib.patch b/patches/gcc/4.3.6/180-superh-default-multilib.patch
deleted file mode 100644
index a419377..0000000
--- a/patches/gcc/4.3.6/180-superh-default-multilib.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Original patch from: ../4.3.2/180-superh-default-multilib.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch
-The gcc-3.x toolchains would contain all the targets by default. With gcc-4,
-you have to actually list out the multilibs you want or you will end up with
-just one when using targets like 'sh4-linux-gnu'.
-
-The resulting toolchain can't even build a kernel as the kernel needs to build
-with the nofpu flag to be sure that no fpu ops are generated.
-
-Here we restore the gcc-3.x behavior; the additional overhead of building all
-of these multilibs by default is negligible.
-
-http://bugs.gentoo.org/140205
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config.gcc gcc-4.3.3/gcc/config.gcc
---- gcc-4.3.3.orig/gcc/config.gcc 2008-11-20 18:09:53.000000000 +0100
-+++ gcc-4.3.3/gcc/config.gcc 2009-01-27 22:19:32.000000000 +0100
-@@ -2275,7 +2275,7 @@
- if test x${sh_multilibs} = x ; then
- case ${target} in
- sh64-superh-linux* | \
-- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
-+ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
- sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
- sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
- sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
diff --git a/patches/gcc/4.3.6/190-libstdc++-pic.patch b/patches/gcc/4.3.6/190-libstdc++-pic.patch
deleted file mode 100644
index f4bc602..0000000
--- a/patches/gcc/4.3.6/190-libstdc++-pic.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Original patch from: ../4.3.2/190-libstdc++-pic.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
-install libstdc++_pic.a if we have pic objs
-
--= END original header =-
-
-diff -durN gcc-4.3.5.orig/libstdc++-v3/src/Makefile.am gcc-4.3.5/libstdc++-v3/src/Makefile.am
---- gcc-4.3.5.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100
-+++ gcc-4.3.5/libstdc++-v3/src/Makefile.am 2010-09-19 18:58:40.000000000 +0200
-@@ -289,6 +289,13 @@
- $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
-
-
-+install-exec-local:
-+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
-+ if [ x"$$pic_objs" != x ]; then \
-+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
-+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
-+ fi
-+
- # Added bits to build debug library.
- if GLIBCXX_BUILD_DEBUG
- all-local: build_debug
-diff -durN gcc-4.3.5.orig/libstdc++-v3/src/Makefile.in gcc-4.3.5/libstdc++-v3/src/Makefile.in
---- gcc-4.3.5.orig/libstdc++-v3/src/Makefile.in 2010-05-06 19:19:46.000000000 +0200
-+++ gcc-4.3.5/libstdc++-v3/src/Makefile.in 2010-09-19 19:01:43.000000000 +0200
-@@ -646,7 +646,7 @@
-
- install-data-am: install-data-local
-
--install-exec-am: install-toolexeclibLTLIBRARIES
-+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
-
- install-info: install-info-am
-
-@@ -685,7 +685,7 @@
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am \
-- uninstall-toolexeclibLTLIBRARIES
-+ uninstall-toolexeclibLTLIBRARIES install-exec-local
-
-
- # Symbol versioning for shared libraries.
-@@ -811,6 +811,14 @@
- install_debug:
- (cd ${debugdir} && $(MAKE) \
- toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
-+
-+install-exec-local:
-+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
-+ if [ x"$$pic_objs" != x ]; then \
-+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
-+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
-+ fi
-+
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
diff --git a/patches/gcc/4.3.6/200-pr24170.patch b/patches/gcc/4.3.6/200-pr24170.patch
deleted file mode 100644
index e2bbc9e..0000000
--- a/patches/gcc/4.3.6/200-pr24170.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-Original patch from: ../4.3.2/200-pr24170.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch
-http://gcc.gnu.org/PR24170
-
-2008-02-20 Tom Tromey <tromey@redhat.com>
-
- PR libgcj/24170:
- * java/io/natFilePosix.cc (File::performList): Don't use
- readdir_r.
- * configure, include/config.h.in: Rebuilt.
- * configure.ac: Don't check for readdir_r.
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/libjava/configure.ac gcc-4.3.3/libjava/configure.ac
---- gcc-4.3.3.orig/libjava/configure.ac 2009-01-27 22:19:16.000000000 +0100
-+++ gcc-4.3.3/libjava/configure.ac 2009-01-27 22:19:36.000000000 +0100
-@@ -1030,7 +1030,7 @@
- PLATFORMNET=NoNet
- else
- AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
-- localtime_r readdir_r getpwuid_r getcwd \
-+ localtime_r getpwuid_r getcwd \
- access stat lstat mkdir rename rmdir unlink utime chmod readlink \
- nl_langinfo setlocale \
- inet_pton uname inet_ntoa \
-diff -durN gcc-4.3.3.orig/libjava/include/config.h.in gcc-4.3.3/libjava/include/config.h.in
---- gcc-4.3.3.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200
-+++ gcc-4.3.3/libjava/include/config.h.in 2009-01-27 22:19:36.000000000 +0100
-@@ -214,9 +214,6 @@
- /* Define to 1 if you have the <pwd.h> header file. */
- #undef HAVE_PWD_H
-
--/* Define to 1 if you have the `readdir_r' function. */
--#undef HAVE_READDIR_R
--
- /* Define to 1 if you have the `readlink' function. */
- #undef HAVE_READLINK
-
-diff -durN gcc-4.3.3.orig/libjava/java/io/natFilePosix.cc gcc-4.3.3/libjava/java/io/natFilePosix.cc
---- gcc-4.3.3.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200
-+++ gcc-4.3.3/libjava/java/io/natFilePosix.cc 2009-01-27 22:19:36.000000000 +0100
-@@ -1,6 +1,6 @@
- // natFile.cc - Native part of File class for POSIX.
-
--/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
-+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
- Free Software Foundation
-
- This file is part of libgcj.
-@@ -292,13 +292,7 @@
-
- java::util::ArrayList *list = new java::util::ArrayList ();
- struct dirent *d;
--#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
-- int name_max = pathconf (buf, _PC_NAME_MAX);
-- char dbuf[sizeof (struct dirent) + name_max + 1];
-- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
--#else /* HAVE_READDIR_R */
- while ((d = readdir (dir)) != NULL)
--#endif /* HAVE_READDIR_R */
- {
- // Omit "." and "..".
- if (d->d_name[0] == '.'
diff --git a/patches/gcc/4.3.6/210-noteGNUstack-00.patch b/patches/gcc/4.3.6/210-noteGNUstack-00.patch
deleted file mode 100644
index 84c6424..0000000
--- a/patches/gcc/4.3.6/210-noteGNUstack-00.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-Original patch from: ../4.3.2/210-noteGNUstack-00.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
-2004-09-20 Jakub Jelinek <jakub@redhat.com>
-
- * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
- on ppc64-linux.
-
- * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
- ia64-linux.
- * config/ia64/crtbegin.asm: Likewise.
- * config/ia64/crtend.asm: Likewise.
- * config/ia64/crti.asm: Likewise.
- * config/ia64/crtn.asm: Likewise.
-
-2004-05-14 Jakub Jelinek <jakub@redhat.com>
-
- * config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.3/gcc/config/ia64/crtbegin.asm
---- gcc-4.3.3.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200
-+++ gcc-4.3.3/gcc/config/ia64/crtbegin.asm 2009-01-27 22:19:39.000000000 +0100
-@@ -255,3 +255,7 @@
- .weak __cxa_finalize
- #endif
- .weak _Jv_RegisterClasses
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.3.3.orig/gcc/config/ia64/crtend.asm gcc-4.3.3/gcc/config/ia64/crtend.asm
---- gcc-4.3.3.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200
-+++ gcc-4.3.3/gcc/config/ia64/crtend.asm 2009-01-27 22:19:39.000000000 +0100
-@@ -122,3 +122,7 @@
-
- br.ret.sptk.many rp
- .endp __do_global_ctors_aux
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.3.3.orig/gcc/config/ia64/crti.asm gcc-4.3.3/gcc/config/ia64/crti.asm
---- gcc-4.3.3.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200
-+++ gcc-4.3.3/gcc/config/ia64/crti.asm 2009-01-27 22:19:39.000000000 +0100
-@@ -64,3 +64,7 @@
- .body
-
- # end of crti.asm
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.3.3.orig/gcc/config/ia64/crtn.asm gcc-4.3.3/gcc/config/ia64/crtn.asm
---- gcc-4.3.3.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200
-+++ gcc-4.3.3/gcc/config/ia64/crtn.asm 2009-01-27 22:19:39.000000000 +0100
-@@ -54,3 +54,7 @@
- br.ret.sptk.many b0
-
- # end of crtn.asm
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.3.3.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.3/gcc/config/ia64/lib1funcs.asm
---- gcc-4.3.3.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200
-+++ gcc-4.3.3/gcc/config/ia64/lib1funcs.asm 2009-01-27 22:19:39.000000000 +0100
-@@ -792,3 +792,7 @@
- }
- .endp __floattitf
- #endif
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.3.3.orig/gcc/config/ia64/linux.h gcc-4.3.3/gcc/config/ia64/linux.h
---- gcc-4.3.3.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100
-+++ gcc-4.3.3/gcc/config/ia64/linux.h 2009-01-27 22:19:39.000000000 +0100
-@@ -5,6 +5,8 @@
-
- #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
-
-+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
-+
- /* This is for -profile to use -lc_p instead of -lc. */
- #undef CC1_SPEC
- #define CC1_SPEC "%{profile:-p} %{G*}"
-diff -durN gcc-4.3.3.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.3/gcc/config/rs6000/ppc-asm.h
---- gcc-4.3.3.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200
-+++ gcc-4.3.3/gcc/config/rs6000/ppc-asm.h 2009-01-27 22:19:39.000000000 +0100
-@@ -158,7 +158,7 @@
- .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
- #endif
-
--#if defined __linux__ && !defined __powerpc64__
-+#if defined __linux__
- .section .note.GNU-stack
- .previous
- #endif
diff --git a/patches/gcc/4.3.6/220-noteGNUstack-01.patch b/patches/gcc/4.3.6/220-noteGNUstack-01.patch
deleted file mode 100644
index cb6e999..0000000
--- a/patches/gcc/4.3.6/220-noteGNUstack-01.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-Original patch from: ../4.3.2/220-noteGNUstack-01.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch
-2005-02-08 Jakub Jelinek <jakub@redhat.com>
-
- * src/alpha/osf.S: Add .note.GNU-stack on Linux.
- * src/s390/sysv.S: Likewise.
- * src/powerpc/linux64.S: Likewise.
- * src/powerpc/linux64_closure.S: Likewise.
- * src/powerpc/ppc_closure.S: Likewise.
- * src/powerpc/sysv.S: Likewise.
- * src/x86/unix64.S: Likewise.
- * src/x86/sysv.S: Likewise.
- * src/sparc/v8.S: Likewise.
- * src/sparc/v9.S: Likewise.
- * src/m68k/sysv.S: Likewise.
- * src/ia64/unix.S: Likewise.
- * src/arm/sysv.S: Likewise.
-
- * ia64_save_regs_in_stack.s: Moved to...
- * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack
- on Linux.
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.S
---- gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.S 2009-01-27 22:25:27.000000000 +0100
-@@ -0,0 +1,15 @@
-+ .text
-+ .align 16
-+ .global GC_save_regs_in_stack
-+ .proc GC_save_regs_in_stack
-+GC_save_regs_in_stack:
-+ .bodyfoo.mpg
-+ flushrs
-+ ;;
-+ mov r8=ar.bsp
-+ br.ret.sptk.few rp
-+ .endp GC_save_regs_in_stack
-+
-+#ifdef __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.s
---- gcc-4.3.3.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200
-+++ gcc-4.3.3/boehm-gc/ia64_save_regs_in_stack.s 1970-01-01 01:00:00.000000000 +0100
-@@ -1,12 +0,0 @@
-- .text
-- .align 16
-- .global GC_save_regs_in_stack
-- .proc GC_save_regs_in_stack
--GC_save_regs_in_stack:
-- .body
-- flushrs
-- ;;
-- mov r8=ar.bsp
-- br.ret.sptk.few rp
-- .endp GC_save_regs_in_stack
--
-diff -durN gcc-4.3.3.orig/libffi/src/alpha/osf.S gcc-4.3.3/libffi/src/alpha/osf.S
---- gcc-4.3.3.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200
-+++ gcc-4.3.3/libffi/src/alpha/osf.S 2009-01-27 22:25:27.000000000 +0100
-@@ -358,4 +358,8 @@
- .byte 16 # uleb128 offset 16*-8
- .align 3
- $LEFDE3:
-+
-+#ifdef __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
- #endif
-diff -durN gcc-4.3.3.orig/libffi/src/arm/sysv.S gcc-4.3.3/libffi/src/arm/sysv.S
---- gcc-4.3.3.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200
-+++ gcc-4.3.3/libffi/src/arm/sysv.S 2009-01-27 22:25:27.000000000 +0100
-@@ -293,3 +293,6 @@
- UNWIND .fnend
- .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
-
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",%progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/ia64/unix.S gcc-4.3.3/libffi/src/ia64/unix.S
---- gcc-4.3.3.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200
-+++ gcc-4.3.3/libffi/src/ia64/unix.S 2009-01-27 22:25:27.000000000 +0100
-@@ -553,3 +553,7 @@
- data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
- data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
- data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/m68k/sysv.S gcc-4.3.3/libffi/src/m68k/sysv.S
---- gcc-4.3.3.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200
-+++ gcc-4.3.3/libffi/src/m68k/sysv.S 2009-01-27 22:25:27.000000000 +0100
-@@ -207,3 +207,7 @@
- rts
- CFI_ENDPROC()
- .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/powerpc/linux64.S gcc-4.3.3/libffi/src/powerpc/linux64.S
---- gcc-4.3.3.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100
-+++ gcc-4.3.3/libffi/src/powerpc/linux64.S 2009-01-27 22:25:27.000000000 +0100
-@@ -179,3 +179,7 @@
- .align 3
- .LEFDE1:
- #endif
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.3/libffi/src/powerpc/linux64_closure.S
---- gcc-4.3.3.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200
-+++ gcc-4.3.3/libffi/src/powerpc/linux64_closure.S 2009-01-27 22:25:27.000000000 +0100
-@@ -204,3 +204,7 @@
- .align 3
- .LEFDE1:
- #endif
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.3/libffi/src/powerpc/ppc_closure.S
---- gcc-4.3.3.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100
-+++ gcc-4.3.3/libffi/src/powerpc/ppc_closure.S 2009-01-27 22:25:27.000000000 +0100
-@@ -295,3 +295,7 @@
- .LEFDE1:
-
- #endif
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/powerpc/sysv.S gcc-4.3.3/libffi/src/powerpc/sysv.S
---- gcc-4.3.3.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100
-+++ gcc-4.3.3/libffi/src/powerpc/sysv.S 2009-01-27 22:25:27.000000000 +0100
-@@ -223,3 +223,7 @@
- .align 2
- .LEFDE1:
- #endif
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/s390/sysv.S gcc-4.3.3/libffi/src/s390/sysv.S
---- gcc-4.3.3.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200
-+++ gcc-4.3.3/libffi/src/s390/sysv.S 2009-01-27 22:25:27.000000000 +0100
-@@ -427,3 +427,6 @@
-
- #endif
-
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/sparc/v8.S gcc-4.3.3/libffi/src/sparc/v8.S
---- gcc-4.3.3.orig/libffi/src/sparc/v8.S 2008-11-21 23:13:13.000000000 +0100
-+++ gcc-4.3.3/libffi/src/sparc/v8.S 2009-01-27 22:25:27.000000000 +0100
-@@ -306,3 +306,7 @@
- .byte 0x1f ! uleb128 0x1f
- .align WS
- .LLEFDE2:
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/sparc/v9.S gcc-4.3.3/libffi/src/sparc/v9.S
---- gcc-4.3.3.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100
-+++ gcc-4.3.3/libffi/src/sparc/v9.S 2009-01-27 22:25:27.000000000 +0100
-@@ -300,3 +300,7 @@
- .align 8
- .LLEFDE2:
- #endif
-+
-+#ifdef __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/x86/sysv.S gcc-4.3.3/libffi/src/x86/sysv.S
---- gcc-4.3.3.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100
-+++ gcc-4.3.3/libffi/src/x86/sysv.S 2009-01-27 22:25:27.000000000 +0100
-@@ -430,3 +430,7 @@
- #endif
-
- #endif /* ifndef __x86_64__ */
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
-diff -durN gcc-4.3.3.orig/libffi/src/x86/unix64.S gcc-4.3.3/libffi/src/x86/unix64.S
---- gcc-4.3.3.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200
-+++ gcc-4.3.3/libffi/src/x86/unix64.S 2009-01-27 22:25:27.000000000 +0100
-@@ -410,3 +410,7 @@
- .LEFDE3:
-
- #endif /* __x86_64__ */
-+
-+#if defined __ELF__ && defined __linux__
-+ .section .note.GNU-stack,"",@progbits
-+#endif
diff --git a/patches/gcc/4.3.6/230-pr34571.patch b/patches/gcc/4.3.6/230-pr34571.patch
deleted file mode 100644
index c28a1cc..0000000
--- a/patches/gcc/4.3.6/230-pr34571.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Original patch from: ../4.3.2/230-pr34571.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch
-http://gcc.gnu.org/PR34571
-
-2007-12-26 Rask Ingemann Lambertsen <rask@sygehus.dk>
-
- PR target/34571
- * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
- symbolic_operand.
- * varasm.c (output_constant_pool_1): Fix typo.
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/alpha/alpha.c gcc-4.3.3/gcc/config/alpha/alpha.c
---- gcc-4.3.3.orig/gcc/config/alpha/alpha.c 2008-09-09 01:16:55.000000000 +0200
-+++ gcc-4.3.3/gcc/config/alpha/alpha.c 2009-01-27 22:25:29.000000000 +0100
-@@ -1113,8 +1113,7 @@
- static bool
- alpha_cannot_force_const_mem (rtx x)
- {
-- enum rtx_code code = GET_CODE (x);
-- return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
-+ return symbolic_operand (x, GET_MODE (x));
- }
-
- /* We do not allow indirect calls to be optimized into sibling calls, nor
diff --git a/patches/gcc/4.3.6/240-pr25343.patch b/patches/gcc/4.3.6/240-pr25343.patch
deleted file mode 100644
index 07d6318..0000000
--- a/patches/gcc/4.3.6/240-pr25343.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Original patch from: ../4.3.2/240-pr25343.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch
-http://gcc.gnu.org/PR25343
-
-sniped from Debian
-
-2008-04-27 Roman Zippel <zippel@linux-m68k.org>
-
- * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/host-linux.c gcc-4.3.3/gcc/config/host-linux.c
---- gcc-4.3.3.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200
-+++ gcc-4.3.3/gcc/config/host-linux.c 2009-01-27 22:25:31.000000000 +0100
-@@ -84,6 +84,8 @@
- # define TRY_EMPTY_VM_SPACE 0x8000000000
- #elif defined(__sparc__)
- # define TRY_EMPTY_VM_SPACE 0x60000000
-+#elif defined(__mc68000__)
-+# define TRY_EMPTY_VM_SPACE 0x40000000
- #else
- # define TRY_EMPTY_VM_SPACE 0
- #endif
diff --git a/patches/gcc/4.3.6/250-sh-pr24836.patch b/patches/gcc/4.3.6/250-sh-pr24836.patch
deleted file mode 100644
index 1528b35..0000000
--- a/patches/gcc/4.3.6/250-sh-pr24836.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Original patch from: ../4.3.2/250-sh-pr24836.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/74_all_sh-pr24836.patch
-http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
-http://gcc.gnu.org/PR24836
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/configure gcc-4.3.3/gcc/configure
---- gcc-4.3.3.orig/gcc/configure 2009-01-27 22:19:18.000000000 +0100
-+++ gcc-4.3.3/gcc/configure 2009-01-27 22:25:33.000000000 +0100
-@@ -20689,7 +20689,7 @@
- tls_first_minor=14
- tls_as_opt="-m64 -Aesame --fatal-warnings"
- ;;
-- sh-*-* | sh[34]-*-*)
-+ sh-*-* | sh[34]*-*-*)
- conftest_s='
- .section ".tdata","awT",@progbits
- foo: .long 25
-diff -durN gcc-4.3.3.orig/gcc/configure.ac gcc-4.3.3/gcc/configure.ac
---- gcc-4.3.3.orig/gcc/configure.ac 2009-01-27 22:19:18.000000000 +0100
-+++ gcc-4.3.3/gcc/configure.ac 2009-01-27 22:25:33.000000000 +0100
-@@ -2552,7 +2552,7 @@
- tls_first_minor=14
- tls_as_opt="-m64 -Aesame --fatal-warnings"
- ;;
-- sh-*-* | sh[34]-*-*)
-+ sh-*-* | sh[34]*-*-*)
- conftest_s='
- .section ".tdata","awT",@progbits
- foo: .long 25
diff --git a/patches/gcc/4.3.6/260-uclibc-conf-noupstream.patch b/patches/gcc/4.3.6/260-uclibc-conf-noupstream.patch
deleted file mode 100644
index c046030..0000000
--- a/patches/gcc/4.3.6/260-uclibc-conf-noupstream.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Original patch from: ../4.3.2/260-uclibc-conf-noupstream.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config.gcc gcc-4.3.3/gcc/config.gcc
---- gcc-4.3.3.orig/gcc/config.gcc 2009-01-27 22:19:34.000000000 +0100
-+++ gcc-4.3.3/gcc/config.gcc 2009-01-27 22:25:35.000000000 +0100
-@@ -2146,7 +2146,7 @@
- ;;
- sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
- sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
-- sh-*-linux* | sh[346lbe]*-*-linux* | \
-+ sh*-*-linux* | sh[346lbe]*-*-linux* | \
- sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
- sh64-*-netbsd* | sh64l*-*-netbsd*)
- tmake_file="${tmake_file} sh/t-sh sh/t-elf"
diff --git a/patches/gcc/4.3.6/270-missing-execinfo_h.patch b/patches/gcc/4.3.6/270-missing-execinfo_h.patch
deleted file mode 100644
index 8f36f45..0000000
--- a/patches/gcc/4.3.6/270-missing-execinfo_h.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Original patch from: ../4.3.2/270-missing-execinfo_h.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/boehm-gc/include/gc.h gcc-4.3.3/boehm-gc/include/gc.h
---- gcc-4.3.3.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
-+++ gcc-4.3.3/boehm-gc/include/gc.h 2009-01-27 22:25:37.000000000 +0100
-@@ -503,7 +503,7 @@
- #if defined(__linux__) || defined(__GLIBC__)
- # include <features.h>
- # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
-- && !defined(__ia64__)
-+ && !defined(__ia64__) && !defined(__UCLIBC__)
- # ifndef GC_HAVE_BUILTIN_BACKTRACE
- # define GC_HAVE_BUILTIN_BACKTRACE
- # endif
diff --git a/patches/gcc/4.3.6/280-c99-complex-ugly-hack.patch b/patches/gcc/4.3.6/280-c99-complex-ugly-hack.patch
deleted file mode 100644
index 7588647..0000000
--- a/patches/gcc/4.3.6/280-c99-complex-ugly-hack.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Original patch from: ../4.3.2/280-c99-complex-ugly-hack.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/libstdc++-v3/configure gcc-4.3.3/libstdc++-v3/configure
---- gcc-4.3.3.orig/libstdc++-v3/configure 2008-07-07 21:49:54.000000000 +0200
-+++ gcc-4.3.3/libstdc++-v3/configure 2009-01-27 22:25:39.000000000 +0100
-@@ -38935,6 +38935,9 @@
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h. */
- #include <complex.h>
-+#ifdef __UCLIBC__
-+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
-+#endif
- int
- main ()
- {
diff --git a/patches/gcc/4.3.6/290-index_macro.patch b/patches/gcc/4.3.6/290-index_macro.patch
deleted file mode 100644
index 7bb899a..0000000
--- a/patches/gcc/4.3.6/290-index_macro.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Original patch from: ../4.3.2/290-index_macro.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/libstdc++-v3/include/ext/rope gcc-4.3.3/libstdc++-v3/include/ext/rope
---- gcc-4.3.3.orig/libstdc++-v3/include/ext/rope 2008-07-15 12:14:51.000000000 +0200
-+++ gcc-4.3.3/libstdc++-v3/include/ext/rope 2009-01-27 22:25:41.000000000 +0100
-@@ -59,6 +59,9 @@
- #include <bits/gthr.h>
- #include <tr1/functional>
-
-+/* cope w/ index defined as macro, SuSv3 proposal */
-+#undef index
-+
- # ifdef __GC
- # define __GC_CONST const
- # else
-diff -durN gcc-4.3.3.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.3/libstdc++-v3/include/ext/ropeimpl.h
---- gcc-4.3.3.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
-+++ gcc-4.3.3/libstdc++-v3/include/ext/ropeimpl.h 2009-01-27 22:25:41.000000000 +0100
-@@ -54,6 +54,9 @@
- #include <ext/memory> // For uninitialized_copy_n
- #include <ext/numeric> // For power
-
-+/* cope w/ index defined as macro, SuSv3 proposal */
-+#undef index
-+
- _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
-
- using std::size_t;
diff --git a/patches/gcc/4.3.6/300-libmudflap-susv3-legacy.patch b/patches/gcc/4.3.6/300-libmudflap-susv3-legacy.patch
deleted file mode 100644
index 7b20da9..0000000
--- a/patches/gcc/4.3.6/300-libmudflap-susv3-legacy.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-Original patch from: ../4.3.2/300-libmudflap-susv3-legacy.patch
-
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/libmudflap/mf-hooks2.c gcc-4.3.3/libmudflap/mf-hooks2.c
---- gcc-4.3.3.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
-+++ gcc-4.3.3/libmudflap/mf-hooks2.c 2009-01-27 22:25:45.000000000 +0100
-@@ -427,7 +427,7 @@
- {
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
-- bzero (s, n);
-+ memset (s, 0, n);
- }
-
-
-@@ -437,7 +437,7 @@
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
- MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
-- bcopy (src, dest, n);
-+ memmove (dest, src, n);
- }
-
-
-@@ -447,7 +447,7 @@
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
- MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
-- return bcmp (s1, s2, n);
-+ return memcmp (s1, s2, n);
- }
-
-
-@@ -456,7 +456,7 @@
- size_t n = strlen (s);
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
-- return index (s, c);
-+ return strchr (s, c);
- }
-
-
-@@ -465,7 +465,7 @@
- size_t n = strlen (s);
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
-- return rindex (s, c);
-+ return strrchr (s, c);
- }
-
- /* XXX: stpcpy, memccpy */
diff --git a/patches/gcc/4.3.6/310-arm-softfloat.patch b/patches/gcc/4.3.6/310-arm-softfloat.patch
deleted file mode 100644
index 60de45f..0000000
--- a/patches/gcc/4.3.6/310-arm-softfloat.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Original patch from: ../4.3.2/310-arm-softfloat.patch
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/arm/linux-elf.h gcc-4.3.3/gcc/config/arm/linux-elf.h
---- gcc-4.3.3.orig/gcc/config/arm/linux-elf.h 2007-11-08 14:44:09.000000000 +0100
-+++ gcc-4.3.3/gcc/config/arm/linux-elf.h 2009-01-27 22:25:47.000000000 +0100
-@@ -60,7 +60,7 @@
- %{shared:-lc} \
- %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-
--#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
-+#define LIBGCC_SPEC "-lgcc"
-
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-
-diff -durN gcc-4.3.3.orig/gcc/config/arm/t-linux gcc-4.3.3/gcc/config/arm/t-linux
---- gcc-4.3.3.orig/gcc/config/arm/t-linux 2006-11-09 23:14:27.000000000 +0100
-+++ gcc-4.3.3/gcc/config/arm/t-linux 2009-01-27 22:25:47.000000000 +0100
-@@ -3,7 +3,12 @@
- TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
-
- LIB1ASMSRC = arm/lib1funcs.asm
--LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
-+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
-+ _call_via_rX _interwork_call_via_rX \
-+ _lshrdi3 _ashrdi3 _ashldi3 \
-+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
-+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
-+ _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
-
- # MULTILIB_OPTIONS = mhard-float/msoft-float
- # MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/patches/gcc/4.3.6/320-alpha-signal_h.patch b/patches/gcc/4.3.6/320-alpha-signal_h.patch
deleted file mode 100644
index 2f4df3e..0000000
--- a/patches/gcc/4.3.6/320-alpha-signal_h.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Original patch from: ../4.3.2/320-alpha-signal_h.patch
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/alpha/linux-unwind.h gcc-4.3.3/gcc/config/alpha/linux-unwind.h
---- gcc-4.3.3.orig/gcc/config/alpha/linux-unwind.h 2006-10-26 21:31:09.000000000 +0200
-+++ gcc-4.3.3/gcc/config/alpha/linux-unwind.h 2009-01-27 22:25:49.000000000 +0100
-@@ -29,6 +29,9 @@
- /* Do code reading to identify a signal frame, and set the frame
- state data appropriately. See unwind-dw2.c for the structs. */
-
-+/* Don't use this if inhibit_libc is set
-+ The build for this target will fail trying to include missing headers */
-+#ifndef inhibit_libc
- #include <signal.h>
- #include <sys/ucontext.h>
-
-@@ -80,3 +83,4 @@
- fs->retaddr_column = 64;
- return _URC_NO_REASON;
- }
-+#endif /* inhibit_libc */
diff --git a/patches/gcc/4.3.6/330-unwind-for-uClibc.patch b/patches/gcc/4.3.6/330-unwind-for-uClibc.patch
deleted file mode 100644
index ac97c2f..0000000
--- a/patches/gcc/4.3.6/330-unwind-for-uClibc.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Original patch from: ../4.3.2/330-unwind-for-uClibc.patch
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/t-linux-uclibc gcc-4.3.3/gcc/config/t-linux-uclibc
---- gcc-4.3.3.orig/gcc/config/t-linux-uclibc 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.3.3/gcc/config/t-linux-uclibc 2009-01-27 22:28:53.000000000 +0100
-@@ -0,0 +1,5 @@
-+# Remove glibc specific files added in t-linux
-+SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
-+
-+# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
-+LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
-diff -durN gcc-4.3.3.orig/gcc/config.gcc gcc-4.3.3/gcc/config.gcc
---- gcc-4.3.3.orig/gcc/config.gcc 2009-01-27 22:25:37.000000000 +0100
-+++ gcc-4.3.3/gcc/config.gcc 2009-01-27 22:28:53.000000000 +0100
-@@ -2648,6 +2648,12 @@
- ;;
- esac
-
-+# Rather than hook into each target, just do it after all the linux
-+# targets have been processed
-+case ${target} in
-+ *-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc";;
-+esac
-+
- case ${target} in
- i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
- tmake_file="${tmake_file} i386/t-gmm_malloc"
diff --git a/patches/gcc/4.3.6/340-make-mno-spe-work-as-expected.patch b/patches/gcc/4.3.6/340-make-mno-spe-work-as-expected.patch
deleted file mode 100644
index ad2d203..0000000
--- a/patches/gcc/4.3.6/340-make-mno-spe-work-as-expected.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-Original patch from: ../4.3.2/340-make-mno-spe-work-as-expected.patch
-
--= BEGIN original header =-
-2008-04-03 Nathan Froyd <froydnj@codesourcery.com>
- Nathan Sidwell <nathan@codesourcery.com>
-
- * config/rs6000/rs6000.opt (mspe): Remove Var property.
- (misel): Likewise.
- * config/rs6000/rs6000.h (rs6000_spe): Declare.
- (rs6000_isel): Likewise.
- * config/rs6000/rs6000.c (rs6000_spe): New variable.
- (rs6000_isel): New variable.
- (rs6000_handle_option): Handle OPT_mspe and OPT_misel.
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/rs6000/rs6000.c gcc-4.3.3/gcc/config/rs6000/rs6000.c
---- gcc-4.3.3.orig/gcc/config/rs6000/rs6000.c 2008-11-18 23:07:58.000000000 +0100
-+++ gcc-4.3.3/gcc/config/rs6000/rs6000.c 2009-01-27 22:28:55.000000000 +0100
-@@ -174,9 +174,15 @@
- /* Nonzero to use AltiVec ABI. */
- int rs6000_altivec_abi;
-
-+/* Nonzero if we want SPE SIMD instructions. */
-+int rs6000_spe;
-+
- /* Nonzero if we want SPE ABI extensions. */
- int rs6000_spe_abi;
-
-+/* Nonzero to use isel instructions. */
-+int rs6000_isel;
-+
- /* Nonzero if floating point operations are done in the GPRs. */
- int rs6000_float_gprs = 0;
-
-@@ -2144,11 +2150,21 @@
- rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
- break;
-
-+ case OPT_misel:
-+ rs6000_explicit_options.isel = true;
-+ rs6000_isel = value;
-+ break;
-+
- case OPT_misel_:
- rs6000_explicit_options.isel = true;
- rs6000_parse_yes_no_option ("isel", arg, &(rs6000_isel));
- break;
-
-+ case OPT_mspe:
-+ rs6000_explicit_options.spe = true;
-+ rs6000_spe = value;
-+ break;
-+
- case OPT_mspe_:
- rs6000_explicit_options.spe = true;
- rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe));
-diff -durN gcc-4.3.3.orig/gcc/config/rs6000/rs6000.h gcc-4.3.3/gcc/config/rs6000/rs6000.h
---- gcc-4.3.3.orig/gcc/config/rs6000/rs6000.h 2008-01-26 18:18:35.000000000 +0100
-+++ gcc-4.3.3/gcc/config/rs6000/rs6000.h 2009-01-27 22:28:55.000000000 +0100
-@@ -349,6 +349,8 @@
- extern int rs6000_ieeequad;
- extern int rs6000_altivec_abi;
- extern int rs6000_spe_abi;
-+extern int rs6000_spe;
-+extern int rs6000_isel;
- extern int rs6000_float_gprs;
- extern int rs6000_alignment_flags;
- extern const char *rs6000_sched_insert_nops_str;
-diff -durN gcc-4.3.3.orig/gcc/config/rs6000/rs6000.opt gcc-4.3.3/gcc/config/rs6000/rs6000.opt
---- gcc-4.3.3.orig/gcc/config/rs6000/rs6000.opt 2007-10-31 08:56:01.000000000 +0100
-+++ gcc-4.3.3/gcc/config/rs6000/rs6000.opt 2009-01-27 22:28:55.000000000 +0100
-@@ -190,7 +190,7 @@
- -mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
-
- misel
--Target Var(rs6000_isel)
-+Target
- Generate isel instructions
-
- misel=
-@@ -198,7 +198,7 @@
- -misel=yes/no Deprecated option. Use -misel/-mno-isel instead
-
- mspe
--Target Var(rs6000_spe)
-+Target
- Generate SPE SIMD instructions on E500
-
- mpaired
diff --git a/patches/gcc/4.3.6/350-sh-without-headers.patch b/patches/gcc/4.3.6/350-sh-without-headers.patch
deleted file mode 100644
index 0bb860d..0000000
--- a/patches/gcc/4.3.6/350-sh-without-headers.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Original patch from: ../4.3.2/350-sh-without-headers.patch
-
--= BEGIN original header =-
-On 20081011, Khem RAJ writes:
- You have to bar gcc trying to build unwinding at stage 1. Try the
- attached patch and see if it helps.
-
- gcc/config/sh/linux-unwind.h | 3 +++
- 1 file changed, 3 insertions(+)
-
--= END original header =-
-
-diff -durN gcc-4.3.3.orig/gcc/config/sh/linux-unwind.h gcc-4.3.3/gcc/config/sh/linux-unwind.h
---- gcc-4.3.3.orig/gcc/config/sh/linux-unwind.h 2007-09-12 08:59:06.000000000 +0200
-+++ gcc-4.3.3/gcc/config/sh/linux-unwind.h 2009-01-27 22:28:57.000000000 +0100
-@@ -26,6 +26,8 @@
- the Free Software Foundation, 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-+#ifndef inhibit_libc
-+
- /* Do code reading to identify a signal frame, and set the frame
- state data appropriately. See unwind-dw2.c for the structs. */
-
-@@ -251,3 +253,4 @@
- return _URC_NO_REASON;
- }
- #endif /* defined (__SH5__) */
-+#endif /* ifndef inhibit_libc */
diff --git a/patches/gcc/4.3.6/380-pr37436.patch b/patches/gcc/4.3.6/380-pr37436.patch
deleted file mode 100644
index 99a016f..0000000
--- a/patches/gcc/4.3.6/380-pr37436.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-gcc svn 142778:
-
-PR target/37436
-* arm.c (arm_legitimate_index): Only accept addresses that are in
-canonical form.
-* predicates.md (arm_reg_or_extendqisi_mem_op): New predicate.
-* arm.md (extendqihi2): Use arm_reg_or_extendqisi_mem_op predicate
-for operand1.
-(extendqisi2): Likewise.
-(arm_extendqisi, arm_extendqisi_v6): Use arm_extendqisi_mem_op
-predicate for operand1.
-
-diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.c gcc-4.3.3/gcc/config/arm/arm.c
---- gcc-4.3.3.orig/gcc/config/arm/arm.c 2008-06-11 07:52:55.000000000 -0300
-+++ gcc-4.3.3/gcc/config/arm/arm.c 2009-05-21 16:06:45.000000000 -0300
-@@ -3769,6 +3769,7 @@
- rtx xop1 = XEXP (x, 1);
-
- return ((arm_address_register_rtx_p (xop0, strict_p)
-+ && GET_CODE(xop1) == CONST_INT
- && arm_legitimate_index_p (mode, xop1, outer, strict_p))
- || (arm_address_register_rtx_p (xop1, strict_p)
- && arm_legitimate_index_p (mode, xop0, outer, strict_p)));
-diff -Nura gcc-4.3.3.orig/gcc/config/arm/arm.md gcc-4.3.3/gcc/config/arm/arm.md
---- gcc-4.3.3.orig/gcc/config/arm/arm.md 2007-09-04 01:44:47.000000000 -0300
-+++ gcc-4.3.3/gcc/config/arm/arm.md 2009-05-21 16:06:45.000000000 -0300
-@@ -4199,7 +4199,7 @@
-
- (define_expand "extendqihi2"
- [(set (match_dup 2)
-- (ashift:SI (match_operand:QI 1 "general_operand" "")
-+ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
- (const_int 24)))
- (set (match_operand:HI 0 "s_register_operand" "")
- (ashiftrt:SI (match_dup 2)
-@@ -4224,7 +4224,7 @@
-
- (define_insn "*arm_extendqihi_insn"
- [(set (match_operand:HI 0 "s_register_operand" "=r")
-- (sign_extend:HI (match_operand:QI 1 "memory_operand" "Uq")))]
-+ (sign_extend:HI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
- "TARGET_ARM && arm_arch4"
- "ldr%(sb%)\\t%0, %1"
- [(set_attr "type" "load_byte")
-@@ -4235,7 +4235,7 @@
-
- (define_expand "extendqisi2"
- [(set (match_dup 2)
-- (ashift:SI (match_operand:QI 1 "general_operand" "")
-+ (ashift:SI (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "")
- (const_int 24)))
- (set (match_operand:SI 0 "s_register_operand" "")
- (ashiftrt:SI (match_dup 2)
-@@ -4267,7 +4267,7 @@
-
- (define_insn "*arm_extendqisi"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
-- (sign_extend:SI (match_operand:QI 1 "memory_operand" "Uq")))]
-+ (sign_extend:SI (match_operand:QI 1 "arm_extendqisi_mem_op" "Uq")))]
- "TARGET_ARM && arm_arch4 && !arm_arch6"
- "ldr%(sb%)\\t%0, %1"
- [(set_attr "type" "load_byte")
-@@ -4278,7 +4278,8 @@
-
- (define_insn "*arm_extendqisi_v6"
- [(set (match_operand:SI 0 "s_register_operand" "=r,r")
-- (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,Uq")))]
-+ (sign_extend:SI
-+ (match_operand:QI 1 "arm_reg_or_extendqisi_mem_op" "r,Uq")))]
- "TARGET_ARM && arm_arch6"
- "@
- sxtb%?\\t%0, %1
-diff -Nura gcc-4.3.3.orig/gcc/config/arm/predicates.md gcc-4.3.3/gcc/config/arm/predicates.md
---- gcc-4.3.3.orig/gcc/config/arm/predicates.md 2007-08-02 07:49:31.000000000 -0300
-+++ gcc-4.3.3/gcc/config/arm/predicates.md 2009-05-21 16:06:45.000000000 -0300
-@@ -234,6 +234,10 @@
- (match_test "arm_legitimate_address_p (mode, XEXP (op, 0), SIGN_EXTEND,
- 0)")))
-
-+(define_special_predicate "arm_reg_or_extendqisi_mem_op"
-+ (ior (match_operand 0 "arm_extendqisi_mem_op")
-+ (match_operand 0 "s_register_operand")))
-+
- (define_predicate "power_of_two_operand"
- (match_code "const_int")
- {
diff --git a/patches/gcc/4.3.6/390-unbreak-armv4t.patch b/patches/gcc/4.3.6/390-unbreak-armv4t.patch
deleted file mode 100644
index af14e0d..0000000
--- a/patches/gcc/4.3.6/390-unbreak-armv4t.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gcc-4.3.2.orig/gcc/config/arm/linux-eabi.h 2009-09-08 23:46:44.000000000 +0200
-+++ gcc-4.3.2/gcc/config/arm/linux-eabi.h 2009-09-08 23:46:51.000000000 +0200
-@@ -44,7 +44,7 @@
- The ARM10TDMI core is the default for armv5t, so set
- SUBTARGET_CPU_DEFAULT to achieve this. */
- #undef SUBTARGET_CPU_DEFAULT
--#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
-+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
-
- /* TARGET_BIG_ENDIAN_DEFAULT is set in
- config.gcc for big endian configurations. */
diff --git a/patches/gcc/4.3.6/400-ecjx-host-cc.patch b/patches/gcc/4.3.6/400-ecjx-host-cc.patch
deleted file mode 100644
index 793069b..0000000
--- a/patches/gcc/4.3.6/400-ecjx-host-cc.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -ur gcc-4.3.4-orig/libjava/Makefile.in gcc-4.3.4/libjava/Makefile.in
---- gcc-4.3.4-orig/libjava/Makefile.in 2009-08-04 04:12:27.000000000 -0700
-+++ gcc-4.3.4/libjava/Makefile.in 2009-09-23 22:03:15.750951483 -0700
-@@ -8874,6 +8874,9 @@
- ecjx$(EXEEXT): $(ecjx_OBJECTS) $(ecjx_DEPENDENCIES)
- @rm -f ecjx$(EXEEXT)
- $(ecjx_LINK) $(ecjx_LDFLAGS) $(ecjx_OBJECTS) $(ecjx_LDADD) $(LIBS)
-+ecjx.$(OBJEXT): $(ecjx_SOURCES)
-+ @rm -f ecjx.$(OBJEXT)
-+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c -o $@ $<
- gappletviewer$(EXEEXT): $(gappletviewer_OBJECTS) $(gappletviewer_DEPENDENCIES)
- @rm -f gappletviewer$(EXEEXT)
- $(gappletviewer_LINK) $(gappletviewer_LDFLAGS) $(gappletviewer_OBJECTS) $(gappletviewer_LDADD) $(LIBS)
diff --git a/patches/gcc/4.3.6/410-pr42289-fix-libffi-build-on-arm-oabi.patch b/patches/gcc/4.3.6/410-pr42289-fix-libffi-build-on-arm-oabi.patch
deleted file mode 100644
index 8654879..0000000
--- a/patches/gcc/4.3.6/410-pr42289-fix-libffi-build-on-arm-oabi.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gcc-4.3.4/libffi/src/arm/sysv.S
-+++ gcc-4.3.4/libffi/src/arm/sysv.S
-@@ -235,7 +235,7 @@ ARM_FUNC_START ffi_closure_SYSV
- stmfd sp!, {ip, lr}
- UNWIND .save {r0, lr}
- add r2, sp, #8
-- .pad #16
-+ UNWIND .pad #16
- sub sp, sp, #16
- str sp, [sp, #8]
- add r1, sp, #8
diff --git a/patches/gcc/4.3.6/420-libgcc_eh.a.patch b/patches/gcc/4.3.6/420-libgcc_eh.a.patch
deleted file mode 100644
index 854198a..0000000
--- a/patches/gcc/4.3.6/420-libgcc_eh.a.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Highly inspired by:
- http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
-
-diff -durN gcc-4.3.2.orig//libgcc/Makefile.in gcc-4.3.2/libgcc/Makefile.in
---- gcc-4.3.2.orig//libgcc/Makefile.in 2008-06-17 11:32:34.000000000 +0200
-+++ gcc-4.3.2/libgcc/Makefile.in 2011-09-02 12:27:39.296538955 +0200
-@@ -705,8 +705,9 @@
- libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
- endif
-
-+all: libgcc_eh.a
- ifeq ($(enable_shared),yes)
--all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
-+all: libgcc_s$(SHLIB_EXT)
- ifneq ($(LIBUNWIND),)
- all: libunwind$(SHLIB_EXT)
- endif
-@@ -875,10 +876,6 @@
- install-shared:
- $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
-
-- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
--
- $(subst @multilib_dir@,$(MULTIDIR),$(subst \
- @shlib_base_name@,libgcc_s,$(subst \
- @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
-@@ -893,6 +890,10 @@
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
-
-+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+
- parts="$(INSTALL_PARTS)"; \
- for file in $$parts; do \
- rm -f $(DESTDIR)$(inst_libdir)/$$file; \
diff --git a/patches/gcc/4.4.7/100-alpha-mieee-default.patch b/patches/gcc/4.4.7/100-alpha-mieee-default.patch
deleted file mode 100644
index 5f3acd8..0000000
--- a/patches/gcc/4.4.7/100-alpha-mieee-default.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/alpha/alpha.h gcc-4.4.5/gcc/config/alpha/alpha.h
---- gcc-4.4.5.orig/gcc/config/alpha/alpha.h 2009-02-20 16:20:38.000000000 +0100
-+++ gcc-4.4.5/gcc/config/alpha/alpha.h 2010-10-09 22:57:31.000000000 +0200
-@@ -95,6 +95,8 @@
- while (0)
- #endif
-
-+#define CPP_SPEC "%{!no-ieee:-mieee}"
-+
- #define WORD_SWITCH_TAKES_ARG(STR) \
- (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
-
-diff -durN gcc-4.4.5.orig/gcc/config/alpha/alpha.opt gcc-4.4.5/gcc/config/alpha/alpha.opt
---- gcc-4.4.5.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200
-+++ gcc-4.4.5/gcc/config/alpha/alpha.opt 2010-10-09 22:57:31.000000000 +0200
-@@ -39,7 +39,7 @@
- Request IEEE-conformant math library routines (OSF/1)
-
- mieee
--Target Report RejectNegative Mask(IEEE)
-+Target Report Mask(IEEE)
- Emit IEEE-conformant code, without inexact exceptions
-
- mieee-with-inexact
diff --git a/patches/gcc/4.4.7/110-trampolinewarn.patch b/patches/gcc/4.4.7/110-trampolinewarn.patch
deleted file mode 100644
index 0bce857..0000000
--- a/patches/gcc/4.4.7/110-trampolinewarn.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/builtins.c gcc-4.4.5/gcc/builtins.c
---- gcc-4.4.5.orig/gcc/builtins.c 2010-03-22 16:00:20.000000000 +0100
-+++ gcc-4.4.5/gcc/builtins.c 2010-10-09 22:57:58.000000000 +0200
-@@ -5783,6 +5783,9 @@
- trampolines_created = 1;
- INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
-
-+ if (warn_trampolines)
-+ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
-+
- return const0_rtx;
- }
-
-diff -durN gcc-4.4.5.orig/gcc/common.opt gcc-4.4.5/gcc/common.opt
---- gcc-4.4.5.orig/gcc/common.opt 2009-03-28 18:28:45.000000000 +0100
-+++ gcc-4.4.5/gcc/common.opt 2010-10-09 22:57:58.000000000 +0200
-@@ -197,6 +197,10 @@
- Common Var(warn_type_limits) Init(-1) Warning
- Warn if a comparison is always true or always false due to the limited range of the data type
-
-+Wtrampolines
-+Common Var(warn_trampolines) Init(1)
-+Warn whenever a trampoline is generated
-+
- Wuninitialized
- Common Var(warn_uninitialized) Warning
- Warn about uninitialized automatic variables
diff --git a/patches/gcc/4.4.7/120-java-nomulti.patch b/patches/gcc/4.4.7/120-java-nomulti.patch
deleted file mode 100644
index aded63e..0000000
--- a/patches/gcc/4.4.7/120-java-nomulti.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -durN gcc-4.4.5.orig/libjava/configure gcc-4.4.5/libjava/configure
---- gcc-4.4.5.orig/libjava/configure 2010-10-01 10:26:18.000000000 +0200
-+++ gcc-4.4.5/libjava/configure 2010-10-09 22:58:04.000000000 +0200
-@@ -1022,6 +1022,8 @@
- default=yes
- --enable-java-maintainer-mode
- allow rebuilding of .class and .h files
-+ --enable-libjava-multilib
-+ build libjava as multilib
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --enable-maintainer-mode enable make rules and dependencies not useful
-@@ -1974,6 +1976,16 @@
- fi
-
-
-+# Check whether --enable-libjava-multilib was given.
-+if test "${enable_libjava_multilib+set}" = set; then
-+ enableval=$enable_libjava_multilib;
-+fi
-+
-+if test "$enable_libjava_multilib" = no; then
-+ multilib=no
-+ ac_configure_args="$ac_configure_args --disable-multilib"
-+fi
-+
- # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
-
-
-diff -durN gcc-4.4.5.orig/libjava/configure.ac gcc-4.4.5/libjava/configure.ac
---- gcc-4.4.5.orig/libjava/configure.ac 2010-06-11 13:49:16.000000000 +0200
-+++ gcc-4.4.5/libjava/configure.ac 2010-10-09 22:58:04.000000000 +0200
-@@ -139,6 +139,13 @@
- [allow rebuilding of .class and .h files]))
- AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
-
-+AC_ARG_ENABLE(libjava-multilib,
-+ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
-+if test "$enable_libjava_multilib" = no; then
-+ multilib=no
-+ ac_configure_args="$ac_configure_args --disable-multilib"
-+fi
-+
- # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
- GCC_NO_EXECUTABLES
-
diff --git a/patches/gcc/4.4.7/130-cross-compile.patch b/patches/gcc/4.4.7/130-cross-compile.patch
deleted file mode 100644
index 72bc60e..0000000
--- a/patches/gcc/4.4.7/130-cross-compile.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/configure gcc-4.4.5/gcc/configure
---- gcc-4.4.5.orig/gcc/configure 2010-06-20 17:43:53.000000000 +0200
-+++ gcc-4.4.5/gcc/configure 2010-10-09 22:58:36.000000000 +0200
-@@ -13997,7 +13997,7 @@
- | powerpc*-*-*,powerpc64*-*-*)
- CROSS="$CROSS -DNATIVE_CROSS" ;;
- esac
--elif test "x$TARGET_SYSTEM_ROOT" != x; then
-+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
- SYSTEM_HEADER_DIR=$build_system_header_dir
- fi
-
-diff -durN gcc-4.4.5.orig/gcc/configure.ac gcc-4.4.5/gcc/configure.ac
---- gcc-4.4.5.orig/gcc/configure.ac 2010-06-20 17:43:53.000000000 +0200
-+++ gcc-4.4.5/gcc/configure.ac 2010-10-09 22:58:36.000000000 +0200
-@@ -1720,7 +1720,7 @@
- | powerpc*-*-*,powerpc64*-*-*)
- CROSS="$CROSS -DNATIVE_CROSS" ;;
- esac
--elif test "x$TARGET_SYSTEM_ROOT" != x; then
-+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
- SYSTEM_HEADER_DIR=$build_system_header_dir
- fi
-
-diff -durN gcc-4.4.5.orig/gcc/unwind-dw2.c gcc-4.4.5/gcc/unwind-dw2.c
---- gcc-4.4.5.orig/gcc/unwind-dw2.c 2010-01-20 09:39:18.000000000 +0100
-+++ gcc-4.4.5/gcc/unwind-dw2.c 2010-10-09 22:58:36.000000000 +0200
-@@ -329,9 +329,11 @@
- }
- #endif
-
-+#ifndef inhibit_libc
- #ifdef MD_UNWIND_SUPPORT
- #include MD_UNWIND_SUPPORT
- #endif
-+#endif
-
- /* Extract any interesting information from the CIE for the translation
- unit F belongs to. Return a pointer to the byte after the augmentation,
diff --git a/patches/gcc/4.4.7/140-default-format-security.patch b/patches/gcc/4.4.7/140-default-format-security.patch
deleted file mode 100644
index ac1d988..0000000
--- a/patches/gcc/4.4.7/140-default-format-security.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/c-common.c gcc-4.4.5/gcc/c-common.c
---- gcc-4.4.5.orig/gcc/c-common.c 2010-07-27 15:07:28.000000000 +0200
-+++ gcc-4.4.5/gcc/c-common.c 2010-10-09 22:59:03.000000000 +0200
-@@ -301,7 +301,7 @@
- /* Warn about format/argument anomalies in calls to formatted I/O functions
- (*printf, *scanf, strftime, strfmon, etc.). */
-
--int warn_format;
-+int warn_format = 1;
-
- /* Warn about using __null (as NULL in C++) as sentinel. For code compiled
- with GCC this doesn't matter as __null is guaranteed to have the right
-diff -durN gcc-4.4.5.orig/gcc/c.opt gcc-4.4.5/gcc/c.opt
---- gcc-4.4.5.orig/gcc/c.opt 2009-09-18 23:53:23.000000000 +0200
-+++ gcc-4.4.5/gcc/c.opt 2010-10-09 22:59:03.000000000 +0200
-@@ -236,7 +236,7 @@
- Warn about format strings that contain NUL bytes
-
- Wformat-security
--C ObjC C++ ObjC++ Var(warn_format_security) Warning
-+C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning
- Warn about possible security problems with format functions
-
- Wformat-y2k
-diff -durN gcc-4.4.5.orig/gcc/doc/invoke.texi gcc-4.4.5/gcc/doc/invoke.texi
---- gcc-4.4.5.orig/gcc/doc/invoke.texi 2010-09-08 20:13:03.000000000 +0200
-+++ gcc-4.4.5/gcc/doc/invoke.texi 2010-10-09 22:59:03.000000000 +0200
-@@ -2888,6 +2888,9 @@
- @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
- @option{-Wformat=2} are available, but are not included in @option{-Wall}.
-
-+NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
-+To disable, use @option{-Wformat=0}.
-+
- @item -Wformat-y2k
- @opindex Wformat-y2k
- @opindex Wno-format-y2k
-@@ -2941,6 +2944,11 @@
- in future warnings may be added to @option{-Wformat-security} that are not
- included in @option{-Wformat-nonliteral}.)
-
-+NOTE: In Gentoo, this option is enabled by default for C, C++, ObjC, ObjC++.
-+To disable, use @option{-Wno-format-security}, or disable all format warnings
-+with @option{-Wformat=0}. To make format security warnings fatal, specify
-+@option{-Werror=format-security}.
-+
- @item -Wformat=2
- @opindex Wformat=2
- @opindex Wno-format=2
diff --git a/patches/gcc/4.4.7/150-default-fortify-source.patch b/patches/gcc/4.4.7/150-default-fortify-source.patch
deleted file mode 100644
index ad5a7e8..0000000
--- a/patches/gcc/4.4.7/150-default-fortify-source.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/doc/invoke.texi gcc-4.4.5/gcc/doc/invoke.texi
---- gcc-4.4.5.orig/gcc/doc/invoke.texi 2010-10-09 22:59:03.000000000 +0200
-+++ gcc-4.4.5/gcc/doc/invoke.texi 2010-10-09 22:59:33.000000000 +0200
-@@ -5432,6 +5432,11 @@
- Please note the warning under @option{-fgcse} about
- invoking @option{-O2} on programs that use computed gotos.
-
-+NOTE: In Gentoo, @option{-D_FORTIFY_SOURCE=2} is set by default, and is
-+activated when @option{-O} is set to 2 or higher. This enables additional
-+compile-time and run-time checks for several libc functions. To disable,
-+specify either @option{-U_FORTIFY_SOURCE} or @option{-D_FORTIFY_SOURCE=0}.
-+
- @item -O3
- @opindex O3
- Optimize yet more. @option{-O3} turns on all optimizations specified
-diff -durN gcc-4.4.5.orig/gcc/gcc.c gcc-4.4.5/gcc/gcc.c
---- gcc-4.4.5.orig/gcc/gcc.c 2010-01-09 01:05:06.000000000 +0100
-+++ gcc-4.4.5/gcc/gcc.c 2010-10-09 22:59:33.000000000 +0200
-@@ -807,6 +807,7 @@
- %{H} %C %{D*&U*&A*} %{i*} %Z %i\
- %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
- %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
-+ %{!D_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE=*:%{!U_FORTIFY_SOURCE:-D_FORTIFY_SOURCE=2}}}\
- %{E|M|MM:%W{o*}}";
-
- /* This contains cpp options which are common with cc1_options and are passed
diff --git a/patches/gcc/4.4.7/160-netbsd-symbolic.patch b/patches/gcc/4.4.7/160-netbsd-symbolic.patch
deleted file mode 100644
index a61b078..0000000
--- a/patches/gcc/4.4.7/160-netbsd-symbolic.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/netbsd-elf.h gcc-4.4.5/gcc/config/netbsd-elf.h
---- gcc-4.4.5.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200
-+++ gcc-4.4.5/gcc/config/netbsd-elf.h 2010-10-09 22:59:57.000000000 +0200
-@@ -82,6 +82,7 @@
- #define NETBSD_LINK_SPEC_ELF \
- "%{assert*} %{R*} %{rpath*} \
- %{shared:-shared} \
-+ %{symbolic:-Bsymbolic} \
- %{!shared: \
- -dc -dp \
- %{!nostdlib: \
diff --git a/patches/gcc/4.4.7/170-sparc64-bsd.patch b/patches/gcc/4.4.7/170-sparc64-bsd.patch
deleted file mode 100644
index 85d9b52..0000000
--- a/patches/gcc/4.4.7/170-sparc64-bsd.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/sparc/freebsd.h gcc-4.4.5/gcc/config/sparc/freebsd.h
---- gcc-4.4.5.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200
-+++ gcc-4.4.5/gcc/config/sparc/freebsd.h 2010-10-09 23:00:03.000000000 +0200
-@@ -25,9 +25,22 @@
- /* FreeBSD needs the platform name (sparc64) defined.
- Emacs needs to know if the arch is 64 or 32-bits. */
-
--#undef CPP_CPU64_DEFAULT_SPEC
--#define CPP_CPU64_DEFAULT_SPEC \
-- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
-+#undef FBSD_TARGET_CPU_CPP_BUILTINS
-+#define FBSD_TARGET_CPU_CPP_BUILTINS() \
-+ do \
-+ { \
-+ if (TARGET_ARCH64) \
-+ { \
-+ builtin_define ("__sparc64__"); \
-+ builtin_define ("__sparc_v9__"); \
-+ builtin_define ("__sparcv9"); \
-+ } \
-+ else \
-+ builtin_define ("__sparc"); \
-+ builtin_define ("__sparc__"); \
-+ } \
-+ while (0)
-+
-
- #define LINK_SPEC "%(link_arch) \
- %{!mno-relax:%{!r:-relax}} \
diff --git a/patches/gcc/4.4.7/180-libgomp-no-werror.patch b/patches/gcc/4.4.7/180-libgomp-no-werror.patch
deleted file mode 100644
index 35d5063..0000000
--- a/patches/gcc/4.4.7/180-libgomp-no-werror.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.4.5.orig/libgomp/configure gcc-4.4.5/libgomp/configure
---- gcc-4.4.5.orig/libgomp/configure 2010-10-01 10:26:18.000000000 +0200
-+++ gcc-4.4.5/libgomp/configure 2010-10-09 23:00:33.000000000 +0200
-@@ -3334,7 +3334,7 @@
-
- # Add -Wall -Werror if we are using GCC.
- if test "x$GCC" = "xyes"; then
-- XCFLAGS="$XCFLAGS -Wall -Werror"
-+ XCFLAGS="$XCFLAGS -Wall"
- fi
-
- # Find other programs we need.
diff --git a/patches/gcc/4.4.7/190-flatten-switch-stmt-00.patch b/patches/gcc/4.4.7/190-flatten-switch-stmt-00.patch
deleted file mode 100644
index d4d68fe..0000000
--- a/patches/gcc/4.4.7/190-flatten-switch-stmt-00.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/stmt.c gcc-4.4.5/gcc/stmt.c
---- gcc-4.4.5.orig/gcc/stmt.c 2010-03-08 12:46:28.000000000 +0100
-+++ gcc-4.4.5/gcc/stmt.c 2010-10-09 23:01:01.000000000 +0200
-@@ -2377,7 +2377,11 @@
- use_cost_table
- = (TREE_CODE (orig_type) != ENUMERAL_TYPE
- && estimate_case_costs (case_list));
-- balance_case_nodes (&case_list, NULL);
-+ /* When optimizing for size, we want a straight list to avoid
-+ jumps as much as possible. This basically creates an if-else
-+ chain. */
-+ if (!optimize_size)
-+ balance_case_nodes (&case_list, NULL);
- emit_case_nodes (index, case_list, default_label, index_type);
- if (default_label)
- emit_jump (default_label);
-@@ -2943,6 +2947,7 @@
- {
- if (!node_has_low_bound (node, index_type))
- {
-+ if (!optimize_size) /* don't jl to the .default_label. */
- emit_cmp_and_jump_insns (index,
- convert_modes
- (mode, imode,
diff --git a/patches/gcc/4.4.7/200-libiberty.h-asprintf.patch b/patches/gcc/4.4.7/200-libiberty.h-asprintf.patch
deleted file mode 100644
index 19e4523..0000000
--- a/patches/gcc/4.4.7/200-libiberty.h-asprintf.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -durN gcc-4.4.5.orig/include/libiberty.h gcc-4.4.5/include/libiberty.h
---- gcc-4.4.5.orig/include/libiberty.h 2008-06-24 03:42:31.000000000 +0200
-+++ gcc-4.4.5/include/libiberty.h 2010-10-09 23:01:30.000000000 +0200
-@@ -595,8 +595,11 @@
- /* Like sprintf but provides a pointer to malloc'd storage, which must
- be freed by the caller. */
-
-+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
-+#ifndef asprintf
- extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
- #endif
-+#endif
-
- #if !HAVE_DECL_VASPRINTF
- /* Like vsprintf but provides a pointer to malloc'd storage, which
diff --git a/patches/gcc/4.4.7/210-arm-unbreak-armv4t.patch b/patches/gcc/4.4.7/210-arm-unbreak-armv4t.patch
deleted file mode 100644
index 396a80b..0000000
--- a/patches/gcc/4.4.7/210-arm-unbreak-armv4t.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/arm/linux-eabi.h gcc-4.4.5/gcc/config/arm/linux-eabi.h
---- gcc-4.4.5.orig/gcc/config/arm/linux-eabi.h 2007-11-08 14:44:09.000000000 +0100
-+++ gcc-4.4.5/gcc/config/arm/linux-eabi.h 2010-10-09 23:01:59.000000000 +0200
-@@ -44,7 +44,7 @@
- The ARM10TDMI core is the default for armv5t, so set
- SUBTARGET_CPU_DEFAULT to achieve this. */
- #undef SUBTARGET_CPU_DEFAULT
--#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
-+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
-
- /* TARGET_BIG_ENDIAN_DEFAULT is set in
- config.gcc for big endian configurations. */
diff --git a/patches/gcc/4.4.7/220-libiberty-pic.patch b/patches/gcc/4.4.7/220-libiberty-pic.patch
deleted file mode 100644
index 93b180a..0000000
--- a/patches/gcc/4.4.7/220-libiberty-pic.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -durN gcc-4.4.5.orig/libiberty/Makefile.in gcc-4.4.5/libiberty/Makefile.in
---- gcc-4.4.5.orig/libiberty/Makefile.in 2008-10-22 15:30:19.000000000 +0200
-+++ gcc-4.4.5/libiberty/Makefile.in 2010-10-09 23:02:28.000000000 +0200
-@@ -227,6 +227,7 @@
- $(AR) $(AR_FLAGS) $(TARGETLIB) \
- $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
- $(RANLIB) $(TARGETLIB); \
-+ cp $(TARGETLIB) ../ ; \
- cd ..; \
- else true; fi
-
diff --git a/patches/gcc/4.4.7/230-superh-default-multilib.patch b/patches/gcc/4.4.7/230-superh-default-multilib.patch
deleted file mode 100644
index 0df23a9..0000000
--- a/patches/gcc/4.4.7/230-superh-default-multilib.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config.gcc gcc-4.4.5/gcc/config.gcc
---- gcc-4.4.5.orig/gcc/config.gcc 2010-06-14 00:16:50.000000000 +0200
-+++ gcc-4.4.5/gcc/config.gcc 2010-10-09 23:02:56.000000000 +0200
-@@ -2140,7 +2140,7 @@
- if test x${sh_multilibs} = x ; then
- case ${target} in
- sh64-superh-linux* | \
-- sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
-+ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
- sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
- sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
- sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;;
diff --git a/patches/gcc/4.4.7/240-libstdc++-pic.patch b/patches/gcc/4.4.7/240-libstdc++-pic.patch
deleted file mode 100644
index 4dde5a1..0000000
--- a/patches/gcc/4.4.7/240-libstdc++-pic.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -durN gcc-4.4.5.orig/libstdc++-v3/src/Makefile.am gcc-4.4.5/libstdc++-v3/src/Makefile.am
---- gcc-4.4.5.orig/libstdc++-v3/src/Makefile.am 2009-08-26 21:04:11.000000000 +0200
-+++ gcc-4.4.5/libstdc++-v3/src/Makefile.am 2010-10-09 23:03:26.000000000 +0200
-@@ -356,6 +356,13 @@
- $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
-
-
-+install-exec-local:
-+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
-+ if [ x"$$pic_objs" != x ]; then \
-+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
-+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
-+ fi
-+
- # Added bits to build debug library.
- if GLIBCXX_BUILD_DEBUG
- all-local: build_debug
-diff -durN gcc-4.4.5.orig/libstdc++-v3/src/Makefile.in gcc-4.4.5/libstdc++-v3/src/Makefile.in
---- gcc-4.4.5.orig/libstdc++-v3/src/Makefile.in 2009-08-26 21:04:11.000000000 +0200
-+++ gcc-4.4.5/libstdc++-v3/src/Makefile.in 2010-10-09 23:03:26.000000000 +0200
-@@ -726,7 +726,7 @@
-
- install-data-am: install-data-local
-
--install-exec-am: install-toolexeclibLTLIBRARIES
-+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
-
- install-info: install-info-am
-
-@@ -765,7 +765,7 @@
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
-- uninstall-toolexeclibLTLIBRARIES
-+ uninstall-toolexeclibLTLIBRARIES install-exec-local
-
-
- # Symbol versioning for shared libraries.
-@@ -947,6 +947,14 @@
- install_debug:
- (cd ${debugdir} && $(MAKE) \
- toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
-+
-+install-exec-local:
-+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
-+ if [ x"$$pic_objs" != x ]; then \
-+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
-+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
-+ fi
-+
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
- .NOEXPORT:
diff --git a/patches/gcc/4.4.7/250-ia64-noteGNUstack.patch b/patches/gcc/4.4.7/250-ia64-noteGNUstack.patch
deleted file mode 100644
index 6d128e4..0000000
--- a/patches/gcc/4.4.7/250-ia64-noteGNUstack.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/ia64/crtbegin.asm gcc-4.4.5/gcc/config/ia64/crtbegin.asm
---- gcc-4.4.5.orig/gcc/config/ia64/crtbegin.asm 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/ia64/crtbegin.asm 2010-10-09 23:03:55.000000000 +0200
-@@ -252,3 +252,7 @@
- .weak __cxa_finalize
- #endif
- .weak _Jv_RegisterClasses
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.4.5.orig/gcc/config/ia64/crtend.asm gcc-4.4.5/gcc/config/ia64/crtend.asm
---- gcc-4.4.5.orig/gcc/config/ia64/crtend.asm 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/ia64/crtend.asm 2010-10-09 23:03:55.000000000 +0200
-@@ -119,3 +119,7 @@
-
- br.ret.sptk.many rp
- .endp __do_global_ctors_aux
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.4.5.orig/gcc/config/ia64/crti.asm gcc-4.4.5/gcc/config/ia64/crti.asm
---- gcc-4.4.5.orig/gcc/config/ia64/crti.asm 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/ia64/crti.asm 2010-10-09 23:03:55.000000000 +0200
-@@ -51,3 +51,7 @@
- .body
-
- # end of crti.asm
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.4.5.orig/gcc/config/ia64/crtn.asm gcc-4.4.5/gcc/config/ia64/crtn.asm
---- gcc-4.4.5.orig/gcc/config/ia64/crtn.asm 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/ia64/crtn.asm 2010-10-09 23:03:55.000000000 +0200
-@@ -41,3 +41,7 @@
- br.ret.sptk.many b0
-
- # end of crtn.asm
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.4.5.orig/gcc/config/ia64/lib1funcs.asm gcc-4.4.5/gcc/config/ia64/lib1funcs.asm
---- gcc-4.4.5.orig/gcc/config/ia64/lib1funcs.asm 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/ia64/lib1funcs.asm 2010-10-09 23:03:55.000000000 +0200
-@@ -793,3 +793,7 @@
- .endp __floattitf
- #endif
- #endif
-+
-+#ifdef __linux__
-+.section .note.GNU-stack; .previous
-+#endif
-diff -durN gcc-4.4.5.orig/gcc/config/ia64/linux.h gcc-4.4.5/gcc/config/ia64/linux.h
---- gcc-4.4.5.orig/gcc/config/ia64/linux.h 2009-02-12 17:30:53.000000000 +0100
-+++ gcc-4.4.5/gcc/config/ia64/linux.h 2010-10-09 23:03:55.000000000 +0200
-@@ -5,6 +5,8 @@
-
- #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
-
-+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
-+
- /* This is for -profile to use -lc_p instead of -lc. */
- #undef CC1_SPEC
- #define CC1_SPEC "%{profile:-p} %{G*}"
-diff -durN gcc-4.4.5.orig/gcc/config/rs6000/ppc-asm.h gcc-4.4.5/gcc/config/rs6000/ppc-asm.h
---- gcc-4.4.5.orig/gcc/config/rs6000/ppc-asm.h 2008-10-13 17:44:26.000000000 +0200
-+++ gcc-4.4.5/gcc/config/rs6000/ppc-asm.h 2010-10-09 23:03:55.000000000 +0200
-@@ -172,7 +172,7 @@
- .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
- #endif
-
--#if defined __linux__ && !defined __powerpc64__
-+#if defined __linux__
- .section .note.GNU-stack
- .previous
- #endif
diff --git a/patches/gcc/4.4.7/260-sh-libgcc-stacks.patch b/patches/gcc/4.4.7/260-sh-libgcc-stacks.patch
deleted file mode 100644
index cc6baf3..0000000
--- a/patches/gcc/4.4.7/260-sh-libgcc-stacks.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/sh/lib1funcs.asm gcc-4.4.5/gcc/config/sh/lib1funcs.asm
---- gcc-4.4.5.orig/gcc/config/sh/lib1funcs.asm 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/sh/lib1funcs.asm 2010-10-09 23:04:22.000000000 +0200
-@@ -30,6 +30,11 @@
- !! recoded in assembly by Toshiyasu Morita
- !! tm@netcom.com
-
-+#if defined(__ELF__) && defined(__linux__)
-+.section .note.GNU-stack,"",%progbits
-+.previous
-+#endif
-+
- /* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
- ELF local label prefixes by J"orn Rennecke
- amylaar@cygnus.com */
-diff -durN gcc-4.4.5.orig/gcc/config/sh/linux-atomic.asm gcc-4.4.5/gcc/config/sh/linux-atomic.asm
---- gcc-4.4.5.orig/gcc/config/sh/linux-atomic.asm 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/sh/linux-atomic.asm 2010-10-09 23:04:22.000000000 +0200
-@@ -136,3 +136,6 @@
- ATOMIC_FETCH_AND_COMBOP(nand,and,not,4,l,mov)
-
- #endif /* ! __SH5__ */
-+
-+.section .note.GNU-stack,"",%progbits
-+.previous
diff --git a/patches/gcc/4.4.7/270-sh-pr24836.patch b/patches/gcc/4.4.7/270-sh-pr24836.patch
deleted file mode 100644
index 11ca63d..0000000
--- a/patches/gcc/4.4.7/270-sh-pr24836.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/configure gcc-4.4.5/gcc/configure
---- gcc-4.4.5.orig/gcc/configure 2010-10-09 22:58:36.000000000 +0200
-+++ gcc-4.4.5/gcc/configure 2010-10-09 23:04:50.000000000 +0200
-@@ -22285,7 +22285,7 @@
- tls_first_minor=14
- tls_as_opt="-m64 -Aesame --fatal-warnings"
- ;;
-- sh-*-* | sh[34]-*-*)
-+ sh-*-* | sh[34]*-*-*)
- conftest_s='
- .section ".tdata","awT",@progbits
- foo: .long 25
-diff -durN gcc-4.4.5.orig/gcc/configure.ac gcc-4.4.5/gcc/configure.ac
---- gcc-4.4.5.orig/gcc/configure.ac 2010-10-09 22:58:36.000000000 +0200
-+++ gcc-4.4.5/gcc/configure.ac 2010-10-09 23:04:50.000000000 +0200
-@@ -2728,7 +2728,7 @@
- tls_first_minor=14
- tls_as_opt="-m64 -Aesame --fatal-warnings"
- ;;
-- sh-*-* | sh[34]-*-*)
-+ sh-*-* | sh[34]*-*-*)
- conftest_s='
- .section ".tdata","awT",@progbits
- foo: .long 25
diff --git a/patches/gcc/4.4.7/280-freebsd.patch b/patches/gcc/4.4.7/280-freebsd.patch
deleted file mode 100644
index e26b34a..0000000
--- a/patches/gcc/4.4.7/280-freebsd.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/freebsd-spec.h gcc-4.4.5/gcc/config/freebsd-spec.h
---- gcc-4.4.5.orig/gcc/config/freebsd-spec.h 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/config/freebsd-spec.h 2010-10-09 23:09:53.000000000 +0200
-@@ -61,6 +61,8 @@
- builtin_assert ("system=unix"); \
- builtin_assert ("system=bsd"); \
- builtin_assert ("system=FreeBSD"); \
-+ if(!(flag_iso && (c_dialect_cxx () ? cxx_dialect == cxx98 : !flag_isoc99))) \
-+ builtin_define("_LONGLONG"); \
- FBSD_TARGET_CPU_CPP_BUILTINS(); \
- } \
- while (0)
-diff -durN gcc-4.4.5.orig/gcc/config/t-freebsd-eh gcc-4.4.5/gcc/config/t-freebsd-eh
---- gcc-4.4.5.orig/gcc/config/t-freebsd-eh 1970-01-01 01:00:00.000000000 +0100
-+++ gcc-4.4.5/gcc/config/t-freebsd-eh 2010-10-09 23:09:53.000000000 +0200
-@@ -0,0 +1,4 @@
-+# Use unwind-dw2-fde-glibc
-+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
-+ $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
-+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
-diff -durN gcc-4.4.5.orig/gcc/config.gcc gcc-4.4.5/gcc/config.gcc
---- gcc-4.4.5.orig/gcc/config.gcc 2010-10-09 23:02:56.000000000 +0200
-+++ gcc-4.4.5/gcc/config.gcc 2010-10-09 23:09:53.000000000 +0200
-@@ -456,7 +456,7 @@
- # pleases around the provided core setting.
- gas=yes
- gnu_ld=yes
-- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
-+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
- fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
- tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
- tmake_file="t-slibgcc-elf-ver t-freebsd"
-@@ -1048,6 +1048,10 @@
- ;;
- i[34567]86-*-freebsd*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
-+ fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
-+ if test ${fbsd_major} -ge 7; then
-+ tmake_file="${tmake_file} t-freebsd-eh"
-+ fi
- ;;
- x86_64-*-freebsd*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
-diff -durN gcc-4.4.5.orig/gcc/crtstuff.c gcc-4.4.5/gcc/crtstuff.c
---- gcc-4.4.5.orig/gcc/crtstuff.c 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/crtstuff.c 2010-10-09 23:09:53.000000000 +0200
-@@ -85,13 +85,15 @@
- && !defined(OBJECT_FORMAT_FLAT) \
- && defined(HAVE_LD_EH_FRAME_HDR) \
- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
-- && defined(__GLIBC__) && __GLIBC__ >= 2
-+ && ((defined(__GLIBC__) && __GLIBC__ >= 2) \
-+ || (defined(__FreeBSD_version) && __FreeBSD_version >= 700022))
- #include <link.h>
- /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
- But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
- # if !defined(__UCLIBC__) \
-- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
-+ || (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
-+ || (__FreeBSD_version >= 700022)
- # define USE_PT_GNU_EH_FRAME
- # endif
- #endif
-diff -durN gcc-4.4.5.orig/gcc/unwind-dw2-fde-glibc.c gcc-4.4.5/gcc/unwind-dw2-fde-glibc.c
---- gcc-4.4.5.orig/gcc/unwind-dw2-fde-glibc.c 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/gcc/unwind-dw2-fde-glibc.c 2010-10-09 23:09:53.000000000 +0200
-@@ -46,8 +46,9 @@
- #include "gthr.h"
-
- #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
-- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
-+ && ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
-+ || (__FreeBSD_version >= 700022 ))
-
- #ifndef __RELOC_POINTER
- # define __RELOC_POINTER(ptr, base) ((ptr) + (base))
-@@ -63,6 +64,13 @@
- #define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550)
- #endif
-
-+/* Support FreeBSD */
-+#ifndef ElfW
-+# ifdef __ElfN
-+# define ElfW __ElfN
-+# endif
-+#endif
-+
- struct unw_eh_callback_data
- {
- _Unwind_Ptr pc;
diff --git a/patches/gcc/4.4.7/290-freebsd.patch b/patches/gcc/4.4.7/290-freebsd.patch
deleted file mode 100644
index 88d632e..0000000
--- a/patches/gcc/4.4.7/290-freebsd.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -durN gcc-4.4.5.orig/gcc/config/freebsd-spec.h gcc-4.4.5/gcc/config/freebsd-spec.h
---- gcc-4.4.5.orig/gcc/config/freebsd-spec.h 2010-10-09 23:09:53.000000000 +0200
-+++ gcc-4.4.5/gcc/config/freebsd-spec.h 2010-10-09 23:10:02.000000000 +0200
-@@ -86,9 +86,10 @@
- #define FBSD_STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-- %{!p:%{profile:gcrt1.o%s} \
-- %{!profile:crt1.o%s}}}} \
-- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-+ %{!p:%{profile:gcrt1.o%s} \
-+ %{!profile:crt1.o%s}}}} \
-+ crti.o%s \
-+ %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
-
- /* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
- the magical crtend.o file (see crtstuff.c) which provides part of
-@@ -126,7 +127,8 @@
- %{pg: -lc_p} \
- }"
- #else
--#if FBSD_MAJOR < 5
-+#include <sys/param.h>
-+#if __FreeBSD_version < 500016
- #define FBSD_LIB_SPEC " \
- %{!shared: \
- %{!pg: \
-@@ -136,17 +138,34 @@
- %{!pthread:-lc_p} \
- %{pthread:-lc_r_p}} \
- }"
--#else
-+#elif __FreeBSD_version < 700022
- #define FBSD_LIB_SPEC " \
- %{!shared: \
- %{!pg: %{pthread:-lpthread} -lc} \
- %{pg: %{pthread:-lpthread_p} -lc_p} \
- }"
-+#else
-+#define FBSD_LIB_SPEC " \
-+ %{!shared: \
-+ %{!pg: %{pthread:-lpthread} -lc} \
-+ %{pg: %{pthread:-lpthread_p} -lc_p}} \
-+ %{shared: \
-+ %{pthread:-lpthread} -lc} \
-+ "
- #endif
- #endif
-
--#if FBSD_MAJOR < 6
-+#if FBSD_MAJOR < 5
- #define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
- #else
- #define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
- #endif
-+
-+#if defined(HAVE_LD_EH_FRAME_HDR)
-+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-+#endif
-+
-+/* Use --as-needed -lgcc_s for eh support. */
-+#ifdef HAVE_LD_AS_NEEDED
-+#define USE_LD_AS_NEEDED 1
-+#endif
diff --git a/patches/gcc/4.4.7/300-uclibc-conf.patch b/patches/gcc/4.4.7/300-uclibc-conf.patch
deleted file mode 100644
index b1465e0..0000000
--- a/patches/gcc/4.4.7/300-uclibc-conf.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -durN gcc-4.4.5.orig/contrib/regression/objs-gcc.sh gcc-4.4.5/contrib/regression/objs-gcc.sh
---- gcc-4.4.5.orig/contrib/regression/objs-gcc.sh 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/contrib/regression/objs-gcc.sh 2010-10-09 23:10:32.000000000 +0200
-@@ -106,6 +106,10 @@
- then
- make all-gdb all-dejagnu all-ld || exit 1
- make install-gdb install-dejagnu install-ld || exit 1
-+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
-+ then
-+ make all-gdb all-dejagnu all-ld || exit 1
-+ make install-gdb install-dejagnu install-ld || exit 1
- elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
- make bootstrap || exit 1
- make install || exit 1
-diff -durN gcc-4.4.5.orig/libjava/classpath/ltconfig gcc-4.4.5/libjava/classpath/ltconfig
---- gcc-4.4.5.orig/libjava/classpath/ltconfig 2007-06-04 01:18:43.000000000 +0200
-+++ gcc-4.4.5/libjava/classpath/ltconfig 2010-10-09 23:10:32.000000000 +0200
-@@ -603,7 +603,7 @@
-
- # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
- case $host_os in
--linux-gnu*) ;;
-+linux-gnu*|linux-uclibc*) ;;
- linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
- esac
-
-@@ -1251,7 +1251,7 @@
- ;;
-
- # This must be Linux ELF.
--linux-gnu*)
-+linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
diff --git a/patches/gcc/4.4.7/310-missing-execinfo_h.patch b/patches/gcc/4.4.7/310-missing-execinfo_h.patch
deleted file mode 100644
index 3d381da..0000000
--- a/patches/gcc/4.4.7/310-missing-execinfo_h.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.4.5.orig/boehm-gc/include/gc.h gcc-4.4.5/boehm-gc/include/gc.h
---- gcc-4.4.5.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
-+++ gcc-4.4.5/boehm-gc/include/gc.h 2010-10-09 23:11:00.000000000 +0200
-@@ -503,7 +503,7 @@
- #if defined(__linux__) || defined(__GLIBC__)
- # include <features.h>
- # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
-- && !defined(__ia64__)
-+ && !defined(__ia64__) && !defined(__UCLIBC__)
- # ifndef GC_HAVE_BUILTIN_BACKTRACE
- # define GC_HAVE_BUILTIN_BACKTRACE
- # endif
diff --git a/patches/gcc/4.4.7/320-c99-snprintf.patch b/patches/gcc/4.4.7/320-c99-snprintf.patch
deleted file mode 100644
index c6aa06c..0000000
--- a/patches/gcc/4.4.7/320-c99-snprintf.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -durN gcc-4.4.5.orig/libstdc++-v3/include/c_global/cstdio gcc-4.4.5/libstdc++-v3/include/c_global/cstdio
---- gcc-4.4.5.orig/libstdc++-v3/include/c_global/cstdio 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/libstdc++-v3/include/c_global/cstdio 2010-10-09 23:11:27.000000000 +0200
-@@ -139,7 +139,7 @@
-
- _GLIBCXX_END_NAMESPACE
-
--#if _GLIBCXX_USE_C99
-+#if _GLIBCXX_USE_C99 || defined __UCLIBC__
-
- #undef snprintf
- #undef vfscanf
diff --git a/patches/gcc/4.4.7/330-libmudflap-susv3-legacy.patch b/patches/gcc/4.4.7/330-libmudflap-susv3-legacy.patch
deleted file mode 100644
index 95f7709..0000000
--- a/patches/gcc/4.4.7/330-libmudflap-susv3-legacy.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -durN gcc-4.4.5.orig/libmudflap/mf-hooks2.c gcc-4.4.5/libmudflap/mf-hooks2.c
---- gcc-4.4.5.orig/libmudflap/mf-hooks2.c 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/libmudflap/mf-hooks2.c 2010-10-09 23:11:52.000000000 +0200
-@@ -421,7 +421,7 @@
- {
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
-- bzero (s, n);
-+ memset (s, 0, n);
- }
-
-
-@@ -431,7 +431,7 @@
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
- MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
-- bcopy (src, dest, n);
-+ memmove (dest, src, n);
- }
-
-
-@@ -441,7 +441,7 @@
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
- MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
-- return bcmp (s1, s2, n);
-+ return n == 0 ? 0 : memcmp (s1, s2, n);
- }
-
-
-@@ -450,7 +450,7 @@
- size_t n = strlen (s);
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
-- return index (s, c);
-+ return strchr (s, c);
- }
-
-
-@@ -459,7 +459,7 @@
- size_t n = strlen (s);
- TRACE ("%s\n", __PRETTY_FUNCTION__);
- MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
-- return rindex (s, c);
-+ return strrchr (s, c);
- }
-
- /* XXX: stpcpy, memccpy */
diff --git a/patches/gcc/4.4.7/340-ecjx-host-cc.patch b/patches/gcc/4.4.7/340-ecjx-host-cc.patch
deleted file mode 100644
index c7f6ae7..0000000
--- a/patches/gcc/4.4.7/340-ecjx-host-cc.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -durN gcc-4.4.5.orig/libjava/Makefile.in gcc-4.4.5/libjava/Makefile.in
---- gcc-4.4.5.orig/libjava/Makefile.in 2010-10-01 10:26:18.000000000 +0200
-+++ gcc-4.4.5/libjava/Makefile.in 2010-10-09 23:12:22.000000000 +0200
-@@ -9180,6 +9180,9 @@
- ecjx$(EXEEXT): $(ecjx_OBJECTS) $(ecjx_DEPENDENCIES)
- @rm -f ecjx$(EXEEXT)
- $(ecjx_LINK) $(ecjx_LDFLAGS) $(ecjx_OBJECTS) $(ecjx_LDADD) $(LIBS)
-+ecjx.$(OBJEXT): $(ecjx_SOURCES)
-+ @rm -f ecjx.$(OBJEXT)
-+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c -o $@ $<
- gappletviewer$(EXEEXT): $(gappletviewer_OBJECTS) $(gappletviewer_DEPENDENCIES)
- @rm -f gappletviewer$(EXEEXT)
- $(gappletviewer_LINK) $(gappletviewer_LDFLAGS) $(gappletviewer_OBJECTS) $(gappletviewer_LDADD) $(LIBS)
diff --git a/patches/gcc/4.4.7/350-index_macro.patch b/patches/gcc/4.4.7/350-index_macro.patch
deleted file mode 100644
index 0dda11e..0000000
--- a/patches/gcc/4.4.7/350-index_macro.patch
+++ /dev/null
@@ -1,30 +0,0 @@
--= BEGIN original header =-
-Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
--= END original header =-
-
-diff -durN gcc-4.4.5.orig/libstdc++-v3/include/ext/rope gcc-4.4.5/libstdc++-v3/include/ext/rope
---- gcc-4.4.5.orig/libstdc++-v3/include/ext/rope 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/libstdc++-v3/include/ext/rope 2010-10-09 23:12:51.000000000 +0200
-@@ -54,6 +54,9 @@
- #include <bits/gthr.h>
- #include <tr1/functional>
-
-+/* cope w/ index defined as macro, SuSv3 proposal */
-+#undef index
-+
- # ifdef __GC
- # define __GC_CONST const
- # else
-diff -durN gcc-4.4.5.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.4.5/libstdc++-v3/include/ext/ropeimpl.h
---- gcc-4.4.5.orig/libstdc++-v3/include/ext/ropeimpl.h 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/libstdc++-v3/include/ext/ropeimpl.h 2010-10-09 23:12:51.000000000 +0200
-@@ -49,6 +49,9 @@
- #include <ext/memory> // For uninitialized_copy_n
- #include <ext/numeric> // For power
-
-+/* cope w/ index defined as macro, SuSv3 proposal */
-+#undef index
-+
- _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
-
- using std::size_t;
diff --git a/patches/gcc/4.4.7/360-arm-bigendian.patch b/patches/gcc/4.4.7/360-arm-bigendian.patch
deleted file mode 100644
index 5a64290..0000000
--- a/patches/gcc/4.4.7/360-arm-bigendian.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-By Lennert Buytenhek <buytenh@wantstofly.org>
-Adds support for arm*b-linux* big-endian ARM targets
-
-See http://gcc.gnu.org/PR16350
-
-diff -durN gcc-4.4.5.orig/gcc/config/arm/linux-elf.h gcc-4.4.5/gcc/config/arm/linux-elf.h
---- gcc-4.4.5.orig/gcc/config/arm/linux-elf.h 2009-02-20 16:20:38.000000000 +0100
-+++ gcc-4.4.5/gcc/config/arm/linux-elf.h 2010-10-09 23:13:21.000000000 +0200
-@@ -51,7 +51,7 @@
-
- #undef MULTILIB_DEFAULTS
- #define MULTILIB_DEFAULTS \
-- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
-+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
-
- /* Now we define the strings used to build the spec file. */
- #undef LIB_SPEC
-diff -durN gcc-4.4.5.orig/gcc/config.gcc gcc-4.4.5/gcc/config.gcc
---- gcc-4.4.5.orig/gcc/config.gcc 2010-10-09 23:09:53.000000000 +0200
-+++ gcc-4.4.5/gcc/config.gcc 2010-10-09 23:13:21.000000000 +0200
-@@ -739,6 +739,11 @@
- tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h"
- tmake_file="arm/t-arm arm/t-arm-elf"
- case ${target} in
-+ arm*b-*)
-+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
-+ ;;
-+ esac
-+ case ${target} in
- arm*-*-uclinux*eabi)
- tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h"
- tmake_file="$tmake_file arm/t-bpabi"
diff --git a/patches/gcc/4.4.7/370-bootstrap-target_lib_path.patch b/patches/gcc/4.4.7/370-bootstrap-target_lib_path.patch
deleted file mode 100644
index 84f62d4..0000000
--- a/patches/gcc/4.4.7/370-bootstrap-target_lib_path.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-ChangeLog:
-2010-01-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- PR bootstrap/41818
- * Makefile.tpl (BASE_TARGET_EXPORTS): Only add TARGET_LIB_PATH
- to $(RPATH_ENVVAR) if bootstrapping.
- * Makefile.in: Regenerate.
-
-diff -durN gcc-4.4.5.orig/Makefile.in gcc-4.4.5/Makefile.in
---- gcc-4.4.5.orig/Makefile.in 2009-04-25 06:10:29.000000000 +0200
-+++ gcc-4.4.5/Makefile.in 2010-10-09 23:13:50.000000000 +0200
-@@ -245,7 +245,10 @@
- STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
-- $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-+@if gcc-bootstrap
-+ $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
-+@endif gcc-bootstrap
-+ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-
- RAW_CXX_TARGET_EXPORTS = \
- $(BASE_TARGET_EXPORTS) \
-diff -durN gcc-4.4.5.orig/Makefile.tpl gcc-4.4.5/Makefile.tpl
---- gcc-4.4.5.orig/Makefile.tpl 2009-04-14 10:57:33.000000000 +0200
-+++ gcc-4.4.5/Makefile.tpl 2010-10-09 23:13:50.000000000 +0200
-@@ -248,7 +248,10 @@
- STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
- WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
-- $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-+@if gcc-bootstrap
-+ $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
-+@endif gcc-bootstrap
-+ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
-
- RAW_CXX_TARGET_EXPORTS = \
- $(BASE_TARGET_EXPORTS) \
diff --git a/patches/gcc/4.4.7/380-powerpc-libgcc_s-link-libm.patch b/patches/gcc/4.4.7/380-powerpc-libgcc_s-link-libm.patch
deleted file mode 100644
index 06bc93d..0000000
--- a/patches/gcc/4.4.7/380-powerpc-libgcc_s-link-libm.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
-
-On glibc the libc.so carries a copy of the math function copysignl() but
-contains unresolved symbols, any attempt to link against libgcc_s
-without explicitely specifying -lm fails, resulting in a broken
-bootstrap of the compiler.
-
-
-diff -durN gcc-4.4.5.orig/gcc/config/t-slibgcc-elf-ver gcc-4.4.5/gcc/config/t-slibgcc-elf-ver
---- gcc-4.4.5.orig/gcc/config/t-slibgcc-elf-ver 2010-01-04 16:13:08.000000000 +0100
-+++ gcc-4.4.5/gcc/config/t-slibgcc-elf-ver 2010-10-09 23:14:18.000000000 +0200
-@@ -9,7 +9,7 @@
- SHLIB_OBJS = @shlib_objs@
- SHLIB_DIR = @multilib_dir@
- SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
--SHLIB_LC = -lc
-+SHLIB_LC = @libgcc_libm@ -lc
- SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
- SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
- $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
-diff -durN gcc-4.4.5.orig/libgcc/configure gcc-4.4.5/libgcc/configure
---- gcc-4.4.5.orig/libgcc/configure 2008-11-20 18:13:01.000000000 +0100
-+++ gcc-4.4.5/libgcc/configure 2010-10-09 23:14:18.000000000 +0200
-@@ -272,7 +272,7 @@
- PACKAGE_BUGREPORT=''
-
- ac_unique_file="static-object.mk"
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls LIBGCC_LIBM tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
- ac_subst_files=''
- ac_pwd=`pwd`
-
-@@ -3547,6 +3547,39 @@
- fi
-
-
-+# On powerpc libgcc_s references copysignl which is a libm function but
-+# glibc apparently also provides it via libc as opposed to uClibc where
-+# it lives in libm.
-+echo "$as_me:$LINENO: checking for library containing copysignl" >&5
-+echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
-+if test "${libgcc_cv_copysignl_lib+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+
-+ echo '#include <features.h>' > conftest.c
-+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
-+ libgcc_cv_copysignl_lib="-lc"
-+ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }
-+ then
-+ libgcc_cv_copysignl_lib="-lm"
-+ fi
-+ rm -f conftest.*
-+
-+fi
-+echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
-+echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
-+
-+case /${libgcc_cv_copysignl_lib}/ in
-+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
-+ *) LIBGCC_LIBM= ;;
-+esac
-+
-+
- # Conditionalize the makefile for this target machine.
- tmake_file_=
- for f in ${tmake_file}
-@@ -4267,6 +4300,7 @@
- s,@fixed_point@,$fixed_point,;t t
- s,@vis_hide@,$vis_hide,;t t
- s,@set_have_cc_tls@,$set_have_cc_tls,;t t
-+s,@LIBGCC_LIBM@,$LIBGCC_LIBM,;t t
- s,@tmake_file@,$tmake_file,;t t
- s,@extra_parts@,$extra_parts,;t t
- s,@asm_hidden_op@,$asm_hidden_op,;t t
-diff -durN gcc-4.4.5.orig/libgcc/configure.ac gcc-4.4.5/libgcc/configure.ac
---- gcc-4.4.5.orig/libgcc/configure.ac 2008-11-20 18:13:01.000000000 +0100
-+++ gcc-4.4.5/libgcc/configure.ac 2010-10-09 23:14:18.000000000 +0200
-@@ -223,6 +223,27 @@
- fi
- AC_SUBST(set_have_cc_tls)
-
-+# On powerpc libgcc_s references copysignl which is a libm function but
-+# glibc apparently also provides it via libc as opposed to uClibc where
-+# it lives in libm.
-+AC_CACHE_CHECK
-+ libgcc_cv_copysignl_lib,
-+ echo '#include <features.h>' > conftest.c
-+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
-+ libgcc_cv_copysignl_lib="-lc"
-+ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
-+ then
-+ libgcc_cv_copysignl_lib="-lm"
-+ fi
-+ rm -f conftest.*
-+ ])
-+
-+case /${libgcc_cv_copysignl_lib}/ in
-+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
-+ *) LIBGCC_LIBM= ;;
-+esac
-+AC_SUBST(LIBGCC_LIBM)
-+
- # Conditionalize the makefile for this target machine.
- tmake_file_=
- for f in ${tmake_file}
-diff -durN gcc-4.4.5.orig/libgcc/Makefile.in gcc-4.4.5/libgcc/Makefile.in
---- gcc-4.4.5.orig/libgcc/Makefile.in 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.5/libgcc/Makefile.in 2010-10-09 23:14:18.000000000 +0200
-@@ -39,6 +39,7 @@
- decimal_float = @decimal_float@
- enable_decimal_float = @enable_decimal_float@
- fixed_point = @fixed_point@
-+LIBGCC_LIBM = @LIBGCC_LIBM@
-
- host_noncanonical = @host_noncanonical@
-
-@@ -787,9 +788,10 @@
- @multilib_dir@,$(MULTIDIR),$(subst \
- @shlib_objs@,$(objects),$(subst \
- @shlib_base_name@,libgcc_s,$(subst \
-+ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
- @shlib_map_file@,$(mapfile),$(subst \
- @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
-- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
-+ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
-
- libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
- # @multilib_flags@ is still needed because this may use
diff --git a/patches/gcc/4.4.7/390-arm-softfloat-libgcc.patch b/patches/gcc/4.4.7/390-arm-softfloat-libgcc.patch
deleted file mode 100644
index e6a30a3..0000000
--- a/patches/gcc/4.4.7/390-arm-softfloat-libgcc.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-[PATCH] add the correct symbols to libgcc for uclibc arm softfloat
-
-Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
----
- gcc/config/arm/linux-elf.h | 2 +-
- gcc/config/arm/t-linux | 6 +++++-
- 2 files changed, 6 insertions(+), 2 deletions(-)
-
-Index: gcc-4.4.0/gcc/config/arm/t-linux
-===================================================================
---- gcc-4.4.0.orig/gcc/config/arm/t-linux
-+++ gcc-4.4.0/gcc/config/arm/t-linux
-@@ -4,7 +4,11 @@
-
- LIB1ASMSRC = arm/lib1funcs.asm
- LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
-- _arm_addsubdf3 _arm_addsubsf3
-+ _arm_addsubdf3 _arm_addsubsf3 \
-+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
-+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
-+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
-+ _arm_fixsfsi _arm_fixunssfsi
-
- # MULTILIB_OPTIONS = mhard-float/msoft-float
- # MULTILIB_DIRNAMES = hard-float soft-float
-Index: gcc-4.4.0/gcc/config/arm/linux-elf.h
-===================================================================
---- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h
-+++ gcc-4.4.0/gcc/config/arm/linux-elf.h
-@@ -60,7 +60,7 @@
- %{shared:-lc} \
- %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-
--#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
-+#define LIBGCC_SPEC "-lgcc"
-
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-
diff --git a/patches/gcc/4.4.7/400-pr42289-fix-libffi-build-on-arm-oabi.patch b/patches/gcc/4.4.7/400-pr42289-fix-libffi-build-on-arm-oabi.patch
deleted file mode 100644
index 8654879..0000000
--- a/patches/gcc/4.4.7/400-pr42289-fix-libffi-build-on-arm-oabi.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- gcc-4.3.4/libffi/src/arm/sysv.S
-+++ gcc-4.3.4/libffi/src/arm/sysv.S
-@@ -235,7 +235,7 @@ ARM_FUNC_START ffi_closure_SYSV
- stmfd sp!, {ip, lr}
- UNWIND .save {r0, lr}
- add r2, sp, #8
-- .pad #16
-+ UNWIND .pad #16
- sub sp, sp, #16
- str sp, [sp, #8]
- add r1, sp, #8
diff --git a/patches/gcc/4.4.7/410-libgcc_eh.a.patch b/patches/gcc/4.4.7/410-libgcc_eh.a.patch
deleted file mode 100644
index 4753260..0000000
--- a/patches/gcc/4.4.7/410-libgcc_eh.a.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Highly inspired by:
- http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
-
-diff -durN gcc-4.4.0.orig/libgcc/Makefile.in gcc-4.4.0/libgcc/Makefile.in
---- gcc-4.4.0.orig/libgcc/Makefile.in 2009-04-10 01:23:07.000000000 +0200
-+++ gcc-4.4.0/libgcc/Makefile.in 2011-09-12 17:05:25.121124559 +0200
-@@ -754,8 +754,9 @@
- libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
- endif
-
-+all: libgcc_eh.a
- ifeq ($(enable_shared),yes)
--all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
-+all: libgcc_s$(SHLIB_EXT)
- ifneq ($(LIBUNWIND),)
- all: libunwind$(SHLIB_EXT)
- endif
-@@ -924,10 +925,6 @@
- install-shared:
- $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
-
-- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
--
- $(subst @multilib_dir@,$(MULTIDIR),$(subst \
- @shlib_base_name@,libgcc_s,$(subst \
- @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
-@@ -942,6 +939,10 @@
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
-
-+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+
- parts="$(INSTALL_PARTS)"; \
- for file in $$parts; do \
- rm -f $(DESTDIR)$(inst_libdir)/$$file; \
diff --git a/patches/gcc/4.5.4/100-ecjx-host.patch b/patches/gcc/4.5.4/100-ecjx-host.patch
deleted file mode 100644
index ea6aa50..0000000
--- a/patches/gcc/4.5.4/100-ecjx-host.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -durN gcc-4.5.2.orig/libjava/Makefile.in gcc-4.5.2/libjava/Makefile.in
---- gcc-4.5.2.orig/libjava/Makefile.in 2010-12-16 13:49:03.000000000 +0100
-+++ gcc-4.5.2/libjava/Makefile.in 2010-12-29 23:02:41.000000000 +0100
-@@ -9463,6 +9463,9 @@
- ecjx$(EXEEXT): $(ecjx_OBJECTS) $(ecjx_DEPENDENCIES)
- @rm -f ecjx$(EXEEXT)
- $(ecjx_LINK) $(ecjx_OBJECTS) $(ecjx_LDADD) $(LIBS)
-+ecjx.$(OBJEXT): $(ecjx_SOURCES)
-+ @rm -f ecjx.$(OBJEXT)
-+ $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c -o $@ $<
- gappletviewer$(EXEEXT): $(gappletviewer_OBJECTS) $(gappletviewer_DEPENDENCIES)
- @rm -f gappletviewer$(EXEEXT)
- $(gappletviewer_LINK) $(gappletviewer_OBJECTS) $(gappletviewer_LDADD) $(LIBS)
diff --git a/patches/gcc/4.5.4/110-libgcc_eh.a.patch b/patches/gcc/4.5.4/110-libgcc_eh.a.patch
deleted file mode 100644
index 4cc019e..0000000
--- a/patches/gcc/4.5.4/110-libgcc_eh.a.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Highly inspired by:
- http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
-
-diff -durN gcc-4.5.0.orig/libgcc/Makefile.in gcc-4.5.0/libgcc/Makefile.in
---- gcc-4.5.0.orig/libgcc/Makefile.in 2010-03-30 15:08:52.000000000 +0200
-+++ gcc-4.5.0/libgcc/Makefile.in 2011-09-12 17:46:51.342800731 +0200
-@@ -765,8 +765,9 @@
- libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
- endif
-
-+all: libgcc_eh.a
- ifeq ($(enable_shared),yes)
--all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
-+all: libgcc_s$(SHLIB_EXT)
- ifneq ($(LIBUNWIND),)
- all: libunwind$(SHLIB_EXT)
- endif
-@@ -935,10 +936,6 @@
- install-shared:
- $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
-
-- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
--
- $(subst @multilib_dir@,$(MULTIDIR),$(subst \
- @shlib_base_name@,libgcc_s,$(subst \
- @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
-@@ -953,6 +950,10 @@
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
-
-+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+
- parts="$(INSTALL_PARTS)"; \
- for file in $$parts; do \
- rm -f $(DESTDIR)$(inst_libdir)/$$file; \
diff --git a/patches/gcc/4.6.4/100-libgcc_eh.a.patch b/patches/gcc/4.6.4/100-libgcc_eh.a.patch
deleted file mode 100644
index 74ae897..0000000
--- a/patches/gcc/4.6.4/100-libgcc_eh.a.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Highly inspired by:
- http://landley.net/hg/aboriginal/file/7e0747a665ab/sources/patches/gcc-core-libgcceh.patch
-
-diff -durN gcc-4.6.0.orig/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in
---- gcc-4.6.0.orig/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100
-+++ gcc-4.6.0/libgcc/Makefile.in 2011-09-12 18:17:12.743718974 +0200
-@@ -772,8 +772,9 @@
- libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
- endif
-
-+all: libgcc_eh.a
- ifeq ($(enable_shared),yes)
--all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
-+all: libgcc_s$(SHLIB_EXT)
- ifneq ($(LIBUNWIND),)
- all: libunwind$(SHLIB_EXT)
- endif
-@@ -950,10 +951,6 @@
- install-shared:
- $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
-
-- $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-- chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
--
- $(subst @multilib_dir@,$(MULTIDIR),$(subst \
- @shlib_base_name@,libgcc_s,$(subst \
- @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
-@@ -968,6 +965,10 @@
- chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
- $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
-
-+ $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
-+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+
- parts="$(INSTALL_PARTS)"; \
- for file in $$parts; do \
- rm -f $(DESTDIR)$(inst_libdir)/$$file; \
diff --git a/patches/gcc/4.7.4/000-libitm-fix-definition-of-__m64.patch b/patches/gcc/4.7.4/000-libitm-fix-definition-of-__m64.patch
deleted file mode 100644
index ade14a7..0000000
--- a/patches/gcc/4.7.4/000-libitm-fix-definition-of-__m64.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 3d27d47fbebdb1be3d35e398a7c042a930f64aa6 Mon Sep 17 00:00:00 2001
-From: Richard Braun <rbraun@sceen.net>
-Date: Mon, 26 Nov 2012 11:36:17 +0100
-Subject: [PATCH] libitm: fix definition of __m64
-
-See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52695 for details.
----
- libitm/config/x86/target.h | 3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/libitm/config/x86/target.h b/libitm/config/x86/target.h
-index 5c7e6fb..6254d8a 100644
---- a/libitm/config/x86/target.h
-+++ b/libitm/config/x86/target.h
-@@ -73,6 +73,9 @@ cpu_relax (void)
- /* ??? It's broken for C++. */
- #include <x86intrin.h>
- #else
-+# ifdef __MMX__
-+# include <mmintrin.h>
-+# endif
- # ifdef __SSE2__
- # include <emmintrin.h>
- # elif defined(__SSE__)
---
-1.7.2.5
-
diff --git a/patches/gcc/4.7.4/100-fix-PR-target-58595.patch b/patches/gcc/4.7.4/100-fix-PR-target-58595.patch
deleted file mode 100644
index 11b2d5d..0000000
--- a/patches/gcc/4.7.4/100-fix-PR-target-58595.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-commit 4fa1f8926227d4e79975b674dc4292b9bec4b137
-Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Thu Mar 6 12:07:07 2014 +0000
-
- PR target/58595
- * config/arm/arm.c (arm_tls_symbol_p): Remove.
- (arm_legitimize_address): Call legitimize_tls_address for any
- arm_tls_referenced_p expression, handle constant addend. Call it
- before testing for !TARGET_ARM.
- (thumb_legitimize_address): Don't handle arm_tls_symbol_p here.
-
- * gcc.dg/tls/pr58595.c: New test.
-
-
- git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208380 138bc75d-0d04-0410-961f-82ee72b054a4
-
-diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
-index ce24bfe..af5666b 100644
---- a/gcc/config/arm/arm.c
-+++ b/gcc/config/arm/arm.c
-@@ -235,7 +235,6 @@ static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
- static void arm_option_override (void);
- static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
- static bool arm_cannot_copy_insn_p (rtx);
--static bool arm_tls_symbol_p (rtx x);
- static int arm_issue_rate (void);
- static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
- static bool arm_output_addr_const_extra (FILE *, rtx);
-@@ -7336,6 +7335,32 @@ legitimize_tls_address (rtx x, rtx reg)
- rtx
- arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
- {
-+ if (arm_tls_referenced_p (x))
-+ {
-+ rtx addend = NULL;
-+
-+ if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS)
-+ {
-+ addend = XEXP (XEXP (x, 0), 1);
-+ x = XEXP (XEXP (x, 0), 0);
-+ }
-+
-+ if (GET_CODE (x) != SYMBOL_REF)
-+ return x;
-+
-+ gcc_assert (SYMBOL_REF_TLS_MODEL (x) != 0);
-+
-+ x = legitimize_tls_address (x, NULL_RTX);
-+
-+ if (addend)
-+ {
-+ x = gen_rtx_PLUS (SImode, x, addend);
-+ orig_x = x;
-+ }
-+ else
-+ return x;
-+ }
-+
- if (!TARGET_ARM)
- {
- /* TODO: legitimize_address for Thumb2. */
-@@ -7344,9 +7369,6 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
- return thumb_legitimize_address (x, orig_x, mode);
- }
-
-- if (arm_tls_symbol_p (x))
-- return legitimize_tls_address (x, NULL_RTX);
--
- if (GET_CODE (x) == PLUS)
- {
- rtx xop0 = XEXP (x, 0);
-@@ -7459,9 +7481,6 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
- rtx
- thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
- {
-- if (arm_tls_symbol_p (x))
-- return legitimize_tls_address (x, NULL_RTX);
--
- if (GET_CODE (x) == PLUS
- && GET_CODE (XEXP (x, 1)) == CONST_INT
- && (INTVAL (XEXP (x, 1)) >= 32 * GET_MODE_SIZE (mode)
-@@ -7756,20 +7775,6 @@ thumb_legitimize_reload_address (rtx *x_p,
-
- /* Test for various thread-local symbols. */
-
--/* Return TRUE if X is a thread-local symbol. */
--
--static bool
--arm_tls_symbol_p (rtx x)
--{
-- if (! TARGET_HAVE_TLS)
-- return false;
--
-- if (GET_CODE (x) != SYMBOL_REF)
-- return false;
--
-- return SYMBOL_REF_TLS_MODEL (x) != 0;
--}
--
- /* Helper for arm_tls_referenced_p. */
-
- static int
diff --git a/patches/gcc/4.7.4/100-hardfloat-ld.patch b/patches/gcc/4.7.4/100-hardfloat-ld.patch
deleted file mode 100644
index 0e97b6f..0000000
--- a/patches/gcc/4.7.4/100-hardfloat-ld.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 9dd1a0668e5ab10a5943fdd1aee2e1616d7fc7ed Mon Sep 17 00:00:00 2001
-From: michaelh <michaelh@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Thu, 26 Apr 2012 04:33:08 +0000
-Subject: [PATCH] 2012-04-26 Michael Hope <michael.hope@linaro.org>
- Richard Earnshaw <rearnsha@arm.com>
-
- * config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_SOFT_FLOAT): Define.
- (GLIBC_DYNAMIC_LINKER_HARD_FLOAT): Define.
- (GLIBC_DYNAMIC_LINKER_DEFAULT): Define.
- (GLIBC_DYNAMIC_LINKER): Redefine to use the hard float path.
-
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186859 138bc75d-0d04-0410-961f-82ee72b054a4
----
- gcc/config/arm/linux-eabi.h | 12 +++++++++++-
- 2 files changed, 19 insertions(+), 1 deletion(-)
-
-diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
-index 80bd825..2ace6f0 100644
---- a/gcc/config/arm/linux-eabi.h
-+++ b/gcc/config/arm/linux-eabi.h
-@@ -62,7 +62,17 @@
- /* Use ld-linux.so.3 so that it will be possible to run "classic"
- GNU/Linux binaries on an EABI system. */
- #undef GLIBC_DYNAMIC_LINKER
--#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
-+#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
-+#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
-+#if TARGET_DEFAULT_FLOAT_ABI == ARM_FLOAT_ABI_HARD
-+#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_HARD_FLOAT
-+#else
-+#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
-+#endif
-+#define GLIBC_DYNAMIC_LINKER \
-+ "%{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \
-+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
-+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
-
- /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
- use the GNU/Linux version, not the generic BPABI version. */
---
-2.1.0
-
diff --git a/patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch b/patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch
deleted file mode 100644
index 20d1c06..0000000
--- a/patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Upstream status: In progress
-
-Index: b/libgcc/config/nios2/linux-atomic.c
-===================================================================
---- a/libgcc/config/nios2/linux-atomic.c
-+++ b/libgcc/config/nios2/linux-atomic.c
-@@ -20,7 +20,6 @@
- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
- <http://www.gnu.org/licenses/>. */
-
--#include <asm/unistd.h>
- #define EFAULT 14
- #define EBUSY 16
- #define ENOSYS 38
diff --git a/patches/gcc/5.2.0/100-uclibc-conf.patch b/patches/gcc/5.3.0/100-uclibc-conf.patch
index 73d1f0d..73d1f0d 100644
--- a/patches/gcc/5.2.0/100-uclibc-conf.patch
+++ b/patches/gcc/5.3.0/100-uclibc-conf.patch
diff --git a/patches/gcc/5.2.0/110-xtensa-implement-trap-pattern.patch b/patches/gcc/5.3.0/110-xtensa-implement-trap-pattern.patch
index 3304532..3304532 100644
--- a/patches/gcc/5.2.0/110-xtensa-implement-trap-pattern.patch
+++ b/patches/gcc/5.3.0/110-xtensa-implement-trap-pattern.patch
diff --git a/patches/gcc/5.3.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch b/patches/gcc/5.3.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
new file mode 100644
index 0000000..c11ad35
--- /dev/null
+++ b/patches/gcc/5.3.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
@@ -0,0 +1,29 @@
+From 9bf6066d588632dab9f78932df15b5b4140f31f3 Mon Sep 17 00:00:00 2001
+From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
+Date: Fri, 6 Nov 2015 14:27:23 +0100
+Subject: [PATCH] gcc/config.gcc: fix typo for powerpc e6500 cpu_is_64bit
+
+Otherwise it is not recognized as a 64-bit powerpc and gcc will not generate
+64-bit binaries by default.
+
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
+---
+ gcc/config.gcc | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 4a7cbd2..9cc765e 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -439,7 +439,7 @@ powerpc*-*-*)
+ cpu_type=rs6000
+ extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
+ case x$with_cpu in
+- xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500)
++ xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
+ cpu_is_64bit=yes
+ ;;
+ esac
+--
+2.6.2
+
diff --git a/patches/gcc/5.2.0/301-missing-execinfo_h.patch b/patches/gcc/5.3.0/301-missing-execinfo_h.patch
index 2d0e7ba..2d0e7ba 100644
--- a/patches/gcc/5.2.0/301-missing-execinfo_h.patch
+++ b/patches/gcc/5.3.0/301-missing-execinfo_h.patch
diff --git a/patches/gcc/5.3.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/5.3.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
new file mode 100644
index 0000000..d8986d5
--- /dev/null
+++ b/patches/gcc/5.3.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
@@ -0,0 +1,160 @@
+diff -urN gcc-5.3.0.orig/config/gcc-plugin.m4 gcc-5.3.0/config/gcc-plugin.m4
+--- gcc-5.3.0.orig/config/gcc-plugin.m4 2015-12-19 14:39:04.120734900 +0000
++++ gcc-5.3.0/config/gcc-plugin.m4 2015-12-20 01:28:45.381965300 +0000
+@@ -20,6 +20,9 @@
+
+ pluginlibs=
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+@@ -30,6 +33,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -81,17 +89,17 @@
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- AC_MSG_CHECKING([for -fPIC -shared])
++ AC_MSG_CHECKING([for ${PICFLAG} -shared])
+ AC_TRY_LINK(
+- [extern int X;],[return X == 0;],
++ [${UNDEFINEDPREAMBLE}],[${UNDEFINEDCODE}],
+ [AC_MSG_RESULT([yes]); have_pic_shared=yes],
+ [AC_MSG_RESULT([no]); have_pic_shared=no])
+ if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
+diff -urN gcc-5.3.0.orig/gcc/configure gcc-5.3.0/gcc/configure
+--- gcc-5.3.0.orig/gcc/configure 2015-12-19 14:40:16.893975900 +0000
++++ gcc-5.3.0/gcc/configure 2015-12-20 01:28:45.472476700 +0000
+@@ -28386,6 +28386,9 @@
+
+ pluginlibs=
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+@@ -28396,6 +28399,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -28508,23 +28516,23 @@
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
+-$as_echo_n "checking for -fPIC -shared... " >&6; }
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
++$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-extern int X;
++${UNDEFINEDPREAMBLE}
+ int
+ main ()
+ {
+-return X == 0;
++${UNDEFINEDCODE}
+ ;
+ return 0;
+ }
+diff -urN gcc-5.3.0.orig/libcc1/configure gcc-5.3.0/libcc1/configure
+--- gcc-5.3.0.orig/libcc1/configure 2015-12-19 14:40:20.855979000 +0000
++++ gcc-5.3.0/libcc1/configure 2015-12-20 01:28:45.504980900 +0000
+@@ -14500,6 +14500,9 @@
+
+ pluginlibs=
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+@@ -14510,6 +14513,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -14622,23 +14630,23 @@
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
+-$as_echo_n "checking for -fPIC -shared... " >&6; }
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
++$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-extern int X;
++${UNDEFINEDPREAMBLE}
+ int
+ main ()
+ {
+-return X == 0;
++${UNDEFINEDCODE}
+ ;
+ return 0;
+ }
diff --git a/patches/gcc/5.3.0/380-gcc-plugin-POSIX-include-sys-select-h.patch b/patches/gcc/5.3.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
new file mode 100644
index 0000000..12ef48e
--- /dev/null
+++ b/patches/gcc/5.3.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
@@ -0,0 +1,11 @@
+diff -urN gcc-5.3.0.orig/libcc1/connection.cc gcc-5.3.0/libcc1/connection.cc
+--- gcc-5.3.0.orig/libcc1/connection.cc 2015-12-19 14:40:20.860479600 +0000
++++ gcc-5.3.0/libcc1/connection.cc 2015-12-20 01:31:04.346611500 +0000
+@@ -21,6 +21,7 @@
+ #include <string>
+ #include <unistd.h>
+ #include <sys/types.h>
++#include <sys/select.h>
+ #include <string.h>
+ #include <errno.h>
+ #include "marshall.hh"
diff --git a/patches/gcc/5.2.0/810-arm-softfloat-libgcc.patch b/patches/gcc/5.3.0/810-arm-softfloat-libgcc.patch
index 5efa7fd..5efa7fd 100644
--- a/patches/gcc/5.2.0/810-arm-softfloat-libgcc.patch
+++ b/patches/gcc/5.3.0/810-arm-softfloat-libgcc.patch
diff --git a/patches/gcc/5.2.0/830-arm_unbreak_armv4t.patch b/patches/gcc/5.3.0/830-arm_unbreak_armv4t.patch
index b730059..b730059 100644
--- a/patches/gcc/5.2.0/830-arm_unbreak_armv4t.patch
+++ b/patches/gcc/5.3.0/830-arm_unbreak_armv4t.patch
diff --git a/patches/gcc/5.2.0/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/5.3.0/840-microblaze-enable-dwarf-eh-support.patch
index 9d29090..9d29090 100644
--- a/patches/gcc/5.2.0/840-microblaze-enable-dwarf-eh-support.patch
+++ b/patches/gcc/5.3.0/840-microblaze-enable-dwarf-eh-support.patch
diff --git a/patches/gcc/5.2.0/850-libstdcxx-uclibc-c99.patch b/patches/gcc/5.3.0/850-libstdcxx-uclibc-c99.patch
index 9e97d94..9e97d94 100644
--- a/patches/gcc/5.2.0/850-libstdcxx-uclibc-c99.patch
+++ b/patches/gcc/5.3.0/850-libstdcxx-uclibc-c99.patch
diff --git a/patches/gcc/5.2.0/860-cilk-wchar.patch b/patches/gcc/5.3.0/860-cilk-wchar.patch
index 1d9916f..1d9916f 100644
--- a/patches/gcc/5.2.0/860-cilk-wchar.patch
+++ b/patches/gcc/5.3.0/860-cilk-wchar.patch
diff --git a/patches/gcc/5.2.0/870-xtensa-add-mauto-litpools-option.patch b/patches/gcc/5.3.0/870-xtensa-add-mauto-litpools-option.patch
index aa1376c..aa1376c 100644
--- a/patches/gcc/5.2.0/870-xtensa-add-mauto-litpools-option.patch
+++ b/patches/gcc/5.3.0/870-xtensa-add-mauto-litpools-option.patch
diff --git a/patches/gcc/5.2.0/871-xtensa-reimplement-register-spilling.patch b/patches/gcc/5.3.0/871-xtensa-reimplement-register-spilling.patch
index 4056f8b..4056f8b 100644
--- a/patches/gcc/5.2.0/871-xtensa-reimplement-register-spilling.patch
+++ b/patches/gcc/5.3.0/871-xtensa-reimplement-register-spilling.patch
diff --git a/patches/gcc/5.2.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch b/patches/gcc/5.3.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
index 9707f68..9707f68 100644
--- a/patches/gcc/5.2.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
+++ b/patches/gcc/5.3.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
diff --git a/patches/gcc/5.2.0/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/5.3.0/873-xtensa-fix-_Unwind_GetCFA.patch
index 2d8eb7c..2d8eb7c 100644
--- a/patches/gcc/5.2.0/873-xtensa-fix-_Unwind_GetCFA.patch
+++ b/patches/gcc/5.3.0/873-xtensa-fix-_Unwind_GetCFA.patch
diff --git a/patches/gcc/5.2.0/900-libitm-fixes-for-musl-support.patch b/patches/gcc/5.3.0/900-libitm-fixes-for-musl-support.patch
index fdf4ee7..fdf4ee7 100644
--- a/patches/gcc/5.2.0/900-libitm-fixes-for-musl-support.patch
+++ b/patches/gcc/5.3.0/900-libitm-fixes-for-musl-support.patch
diff --git a/patches/gcc/5.2.0/901-fixincludes-update-for-musl-support.patch b/patches/gcc/5.3.0/901-fixincludes-update-for-musl-support.patch
index 13c08d6..13c08d6 100644
--- a/patches/gcc/5.2.0/901-fixincludes-update-for-musl-support.patch
+++ b/patches/gcc/5.3.0/901-fixincludes-update-for-musl-support.patch
diff --git a/patches/gcc/5.2.0/902-unwind-fix-for-musl.patch b/patches/gcc/5.3.0/902-unwind-fix-for-musl.patch
index ef47054..ef47054 100644
--- a/patches/gcc/5.2.0/902-unwind-fix-for-musl.patch
+++ b/patches/gcc/5.3.0/902-unwind-fix-for-musl.patch
diff --git a/patches/gcc/5.2.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch b/patches/gcc/5.3.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch
index c852131..c852131 100644
--- a/patches/gcc/5.2.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch
+++ b/patches/gcc/5.3.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch
diff --git a/patches/gcc/5.2.0/904-musl-libc-config.patch b/patches/gcc/5.3.0/904-musl-libc-config.patch
index 8549140..8549140 100644
--- a/patches/gcc/5.2.0/904-musl-libc-config.patch
+++ b/patches/gcc/5.3.0/904-musl-libc-config.patch
diff --git a/patches/gcc/5.2.0/905-add-musl-support-to-gcc.patch b/patches/gcc/5.3.0/905-add-musl-support-to-gcc.patch
index 92e7436..92e7436 100644
--- a/patches/gcc/5.2.0/905-add-musl-support-to-gcc.patch
+++ b/patches/gcc/5.3.0/905-add-musl-support-to-gcc.patch
diff --git a/patches/gcc/5.2.0/906-mips-musl-support.patch b/patches/gcc/5.3.0/906-mips-musl-support.patch
index 6b473f9..6b473f9 100644
--- a/patches/gcc/5.2.0/906-mips-musl-support.patch
+++ b/patches/gcc/5.3.0/906-mips-musl-support.patch
diff --git a/patches/gcc/5.2.0/907-x86-musl-support.patch b/patches/gcc/5.3.0/907-x86-musl-support.patch
index 3f2fe5d..3f2fe5d 100644
--- a/patches/gcc/5.2.0/907-x86-musl-support.patch
+++ b/patches/gcc/5.3.0/907-x86-musl-support.patch
diff --git a/patches/gcc/5.2.0/908-arm-musl-support.patch b/patches/gcc/5.3.0/908-arm-musl-support.patch
index 906355a..906355a 100644
--- a/patches/gcc/5.2.0/908-arm-musl-support.patch
+++ b/patches/gcc/5.3.0/908-arm-musl-support.patch
diff --git a/patches/gcc/5.2.0/909-aarch64-musl-support.patch b/patches/gcc/5.3.0/909-aarch64-musl-support.patch
index 3d032f5..3d032f5 100644
--- a/patches/gcc/5.2.0/909-aarch64-musl-support.patch
+++ b/patches/gcc/5.3.0/909-aarch64-musl-support.patch
diff --git a/patches/ppl/0.10.2/100-fix-configure-with-gmp-5_0_1.patch b/patches/ppl/0.10.2/100-fix-configure-with-gmp-5_0_1.patch
deleted file mode 100644
index ab23ee9..0000000
--- a/patches/ppl/0.10.2/100-fix-configure-with-gmp-5_0_1.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- ppl-0.10.2/configure.orig 2010-08-04 21:48:19.000000000 -0400
-+++ ppl-0.10.2/configure 2010-08-04 21:50:04.000000000 -0400
-@@ -16443,6 +16443,10 @@
- #GMP version 4.1.3 or higher is required
- #endif
-
-+#ifndef BITS_PER_MP_LIMB
-+#define BITS_PER_MP_LIMB GMP_LIMB_BITS
-+#endif
-+
- int
- main() {
- std::string header_version;
-@@ -16469,11 +16473,11 @@
- return 1;
- }
-
-- if (sizeof(mp_limb_t)*CHAR_BIT != GMP_LIMB_BITS
-- || GMP_LIMB_BITS != mp_bits_per_limb) {
-+ if (sizeof(mp_limb_t)*CHAR_BIT != BITS_PER_MP_LIMB
-+ || BITS_PER_MP_LIMB != mp_bits_per_limb) {
- std::cerr
- << "GMP header (gmp.h) and library (ligmp.*) bits-per-limb mismatch:\n"
-- << "header gives " << __GMP_BITS_PER_MP_LIMB << ";\n"
-+ << "header gives " << BITS_PER_MP_LIMB << ";\n"
- << "library gives " << mp_bits_per_limb << ".\n"
- << "This probably means you are on a bi-arch system and\n"
- << "you are compiling with the wrong header or linking with\n"
diff --git a/patches/ppl/0.10.2/200-fix-build-with-local-gmp.patch b/patches/ppl/0.10.2/200-fix-build-with-local-gmp.patch
deleted file mode 100644
index 7f9d625..0000000
--- a/patches/ppl/0.10.2/200-fix-build-with-local-gmp.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -aur ppl-0.10-orig/configure ppl-0.10/configure
---- ppl-0.10-orig/configure 2008-11-04 04:37:00.000000000 -0500
-+++ ppl-0.10/configure 2013-07-15 18:48:26.688013150 -0400
-@@ -15162,6 +15162,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
-
-
-diff -aur ppl-0.10-orig/m4/ac_check_gmp.m4 ppl-0.10/m4/ac_check_gmp.m4
---- ppl-0.10-orig/m4/ac_check_gmp.m4 2008-10-22 07:43:22.000000000 -0400
-+++ ppl-0.10/m4/ac_check_gmp.m4 2013-07-15 18:48:26.669013816 -0400
-@@ -31,6 +31,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
- dnl Check how to link with libgmp.
- AC_LIB_LINKFLAGS([gmp])
diff --git a/patches/ppl/0.11.1/100-fix-java-test-vs-enabled-shared.patch b/patches/ppl/0.11.1/100-fix-java-test-vs-enabled-shared.patch
deleted file mode 100644
index 12a72e8..0000000
--- a/patches/ppl/0.11.1/100-fix-java-test-vs-enabled-shared.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit 25bb77587944768581225d1c0048facab32cf019
-Author: Roberto Bagnara <bagnara@cs.unipr.it>
-Date: Wed May 18 09:35:36 2011 +0200
-
- Moved misplaced conditional.
-
-diff --git a/interfaces/Java/tests/Makefile.am b/interfaces/Java/tests/Makefile.am
-index 64ba864..607bbc6 100644
---- a/interfaces/Java/tests/Makefile.am
-+++ b/interfaces/Java/tests/Makefile.am
-@@ -51,6 +51,8 @@ Parma_Polyhedra_Library_test2.java \
- PPL_Test.java \
- ppl_java_tests_common
-
-+if ENABLE_SHARED
-+
- check_JAVA = \
- ppl_java_generated_tests.java \
- Test_Executor.java \
-@@ -62,8 +64,6 @@ Parma_Polyhedra_Library_test1.java \
- Parma_Polyhedra_Library_test2.java \
- PPL_Test.java
-
--if ENABLE_SHARED
--
- CLASSPATH = ../ppl_java.jar:.
- JAVACFLAGS = -classpath $(CLASSPATH)
-
diff --git a/patches/ppl/0.11.1/200-fix-build-with-local-gmp.patch b/patches/ppl/0.11.1/200-fix-build-with-local-gmp.patch
deleted file mode 100644
index a4bb9f1..0000000
--- a/patches/ppl/0.11.1/200-fix-build-with-local-gmp.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/m4/ac_check_gmp.m4~ 2011-02-27 04:07:47.000000000 -0500
-+++ b/m4/ac_check_gmp.m4 2013-07-10 19:57:35.894457259 -0400
-@@ -32,6 +32,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
- AC_ARG_WITH(gmp-build,
- AS_HELP_STRING([--with-gmp-build=DIR],
---- a/configure~ 2011-02-27 04:07:47.000000000 -0500
-+++ b/configure 2013-07-10 19:57:35.894457259 -0400
-@@ -10217,6 +10217,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
-
- # Check whether --with-gmp-build was given.
diff --git a/patches/ppl/0.11.1/300-fix-data-dir.patch b/patches/ppl/0.11.1/300-fix-data-dir.patch
deleted file mode 100644
index fe15ba5..0000000
--- a/patches/ppl/0.11.1/300-fix-data-dir.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-commit 10e0afa8fa25c9e0e8eaac9a0d730ab325086010
-Author: Roberto Bagnara <bagnara@cs.unipr.it>
-Date: Sun Feb 12 08:48:59 2012 +0100
-
- Prolog sources must go under .../share/ppl as these files are architecture independent.
- Moreover, new versions of Automake no longer accept pkglib_DATA.
-
-diff --git a/interfaces/Prolog/Ciao/Makefile.am b/interfaces/Prolog/Ciao/Makefile.am
-index c8dd56e..8dcf17e 100644
---- a/interfaces/Prolog/Ciao/Makefile.am
-+++ b/interfaces/Prolog/Ciao/Makefile.am
-@@ -170,7 +170,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_ciao.po
-+pkgdata_DATA = ppl_ciao.po
-
- ppl_ciao.pl: $(interface_generator_dependencies)
- $(M4) --prefix-builtin -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. \
-diff --git a/interfaces/Prolog/GNU/Makefile.am b/interfaces/Prolog/GNU/Makefile.am
-index 5904bf1..2ba45ee 100644
---- a/interfaces/Prolog/GNU/Makefile.am
-+++ b/interfaces/Prolog/GNU/Makefile.am
-@@ -169,7 +169,7 @@ ppl_gprolog.pl: $(interface_generator_dependencies)
- $(M4) --prefix-builtin -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. \
- $(srcdir)/ppl_interface_generator_gprolog_pl.m4 > $@
-
--pkglib_DATA = ppl_gprolog.pl
-+pkgdata_DATA = ppl_gprolog.pl
-
- bin_PROGRAMS = ppl_gprolog
-
-diff --git a/interfaces/Prolog/SICStus/Makefile.am b/interfaces/Prolog/SICStus/Makefile.am
-index 17a54c7..22f809f 100644
---- a/interfaces/Prolog/SICStus/Makefile.am
-+++ b/interfaces/Prolog/SICStus/Makefile.am
-@@ -69,7 +69,7 @@ ppl_sicstus_SOURCES =
-
- if ENABLE_SHARED
-
--pkglib_DATA = ppl_sicstus.pl ppl_sicstus.s.o
-+pkgdata_DATA = ppl_sicstus.pl ppl_sicstus.s.o
-
- ppl_sicstus.so: ppl_sicstus.pl $(top_builddir)/src/libppl.la $(WATCHDOG_LIBRARY) libppl_sicstus.la
- $(LIBTOOL) --mode=link --tag=CXX \
-@@ -87,7 +87,7 @@ install-data-local: ppl_sicstus.so
-
- else !ENABLE_SHARED
-
--pkglib_DATA = ppl_sicstus.pl
-+pkgdata_DATA = ppl_sicstus.pl
-
- endif !ENABLE_SHARED
-
-diff --git a/interfaces/Prolog/SWI/Makefile.am b/interfaces/Prolog/SWI/Makefile.am
-index f5bcbe8..5e4e0e4 100644
---- a/interfaces/Prolog/SWI/Makefile.am
-+++ b/interfaces/Prolog/SWI/Makefile.am
-@@ -189,7 +189,7 @@ $(NO_UNDEFINED_FLAG) \
- bin_PROGRAMS = ppl_pl
- ppl_pl_SOURCES = ppl_pl.cc
-
--pkglib_DATA = ppl_swiprolog.pl
-+pkgdata_DATA = ppl_swiprolog.pl
-
- CLPQ_TESTS_NONSTRICT = \
- ack.clpq \
-diff --git a/interfaces/Prolog/XSB/Makefile.am b/interfaces/Prolog/XSB/Makefile.am
-index 18648eb..1bc1e67 100644
---- a/interfaces/Prolog/XSB/Makefile.am
-+++ b/interfaces/Prolog/XSB/Makefile.am
-@@ -188,7 +188,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_xsb.xwam
-+pkgdata_DATA = ppl_xsb.xwam
-
- ppl_xsb.xwam: ppl_xsb.H ppl_xsb.cc libppl_xsb.la
- cp -f ppl_xsb.cc ppl_xsb.c
-diff --git a/interfaces/Prolog/YAP/Makefile.am b/interfaces/Prolog/YAP/Makefile.am
-index fab59c2..34d89e9 100644
---- a/interfaces/Prolog/YAP/Makefile.am
-+++ b/interfaces/Prolog/YAP/Makefile.am
-@@ -179,7 +179,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_yap.pl
-+pkgdata_DATA = ppl_yap.pl
-
- CLPQ_TESTS_NONSTRICT = \
- ack.clpq \
diff --git a/patches/ppl/0.11.2/100-fix-java-test-vs-enabled-shared.patch b/patches/ppl/0.11.2/100-fix-java-test-vs-enabled-shared.patch
deleted file mode 100644
index 12a72e8..0000000
--- a/patches/ppl/0.11.2/100-fix-java-test-vs-enabled-shared.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit 25bb77587944768581225d1c0048facab32cf019
-Author: Roberto Bagnara <bagnara@cs.unipr.it>
-Date: Wed May 18 09:35:36 2011 +0200
-
- Moved misplaced conditional.
-
-diff --git a/interfaces/Java/tests/Makefile.am b/interfaces/Java/tests/Makefile.am
-index 64ba864..607bbc6 100644
---- a/interfaces/Java/tests/Makefile.am
-+++ b/interfaces/Java/tests/Makefile.am
-@@ -51,6 +51,8 @@ Parma_Polyhedra_Library_test2.java \
- PPL_Test.java \
- ppl_java_tests_common
-
-+if ENABLE_SHARED
-+
- check_JAVA = \
- ppl_java_generated_tests.java \
- Test_Executor.java \
-@@ -62,8 +64,6 @@ Parma_Polyhedra_Library_test1.java \
- Parma_Polyhedra_Library_test2.java \
- PPL_Test.java
-
--if ENABLE_SHARED
--
- CLASSPATH = ../ppl_java.jar:.
- JAVACFLAGS = -classpath $(CLASSPATH)
-
diff --git a/patches/ppl/0.11.2/200-fix-build-with-local-gmp.patch b/patches/ppl/0.11.2/200-fix-build-with-local-gmp.patch
deleted file mode 100644
index a4bb9f1..0000000
--- a/patches/ppl/0.11.2/200-fix-build-with-local-gmp.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/m4/ac_check_gmp.m4~ 2011-02-27 04:07:47.000000000 -0500
-+++ b/m4/ac_check_gmp.m4 2013-07-10 19:57:35.894457259 -0400
-@@ -32,6 +32,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
- AC_ARG_WITH(gmp-build,
- AS_HELP_STRING([--with-gmp-build=DIR],
---- a/configure~ 2011-02-27 04:07:47.000000000 -0500
-+++ b/configure 2013-07-10 19:57:35.894457259 -0400
-@@ -10217,6 +10217,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
-
- # Check whether --with-gmp-build was given.
diff --git a/patches/ppl/0.11.2/300-fix-data-dir.patch b/patches/ppl/0.11.2/300-fix-data-dir.patch
deleted file mode 100644
index fe15ba5..0000000
--- a/patches/ppl/0.11.2/300-fix-data-dir.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-commit 10e0afa8fa25c9e0e8eaac9a0d730ab325086010
-Author: Roberto Bagnara <bagnara@cs.unipr.it>
-Date: Sun Feb 12 08:48:59 2012 +0100
-
- Prolog sources must go under .../share/ppl as these files are architecture independent.
- Moreover, new versions of Automake no longer accept pkglib_DATA.
-
-diff --git a/interfaces/Prolog/Ciao/Makefile.am b/interfaces/Prolog/Ciao/Makefile.am
-index c8dd56e..8dcf17e 100644
---- a/interfaces/Prolog/Ciao/Makefile.am
-+++ b/interfaces/Prolog/Ciao/Makefile.am
-@@ -170,7 +170,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_ciao.po
-+pkgdata_DATA = ppl_ciao.po
-
- ppl_ciao.pl: $(interface_generator_dependencies)
- $(M4) --prefix-builtin -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. \
-diff --git a/interfaces/Prolog/GNU/Makefile.am b/interfaces/Prolog/GNU/Makefile.am
-index 5904bf1..2ba45ee 100644
---- a/interfaces/Prolog/GNU/Makefile.am
-+++ b/interfaces/Prolog/GNU/Makefile.am
-@@ -169,7 +169,7 @@ ppl_gprolog.pl: $(interface_generator_dependencies)
- $(M4) --prefix-builtin -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. \
- $(srcdir)/ppl_interface_generator_gprolog_pl.m4 > $@
-
--pkglib_DATA = ppl_gprolog.pl
-+pkgdata_DATA = ppl_gprolog.pl
-
- bin_PROGRAMS = ppl_gprolog
-
-diff --git a/interfaces/Prolog/SICStus/Makefile.am b/interfaces/Prolog/SICStus/Makefile.am
-index 17a54c7..22f809f 100644
---- a/interfaces/Prolog/SICStus/Makefile.am
-+++ b/interfaces/Prolog/SICStus/Makefile.am
-@@ -69,7 +69,7 @@ ppl_sicstus_SOURCES =
-
- if ENABLE_SHARED
-
--pkglib_DATA = ppl_sicstus.pl ppl_sicstus.s.o
-+pkgdata_DATA = ppl_sicstus.pl ppl_sicstus.s.o
-
- ppl_sicstus.so: ppl_sicstus.pl $(top_builddir)/src/libppl.la $(WATCHDOG_LIBRARY) libppl_sicstus.la
- $(LIBTOOL) --mode=link --tag=CXX \
-@@ -87,7 +87,7 @@ install-data-local: ppl_sicstus.so
-
- else !ENABLE_SHARED
-
--pkglib_DATA = ppl_sicstus.pl
-+pkgdata_DATA = ppl_sicstus.pl
-
- endif !ENABLE_SHARED
-
-diff --git a/interfaces/Prolog/SWI/Makefile.am b/interfaces/Prolog/SWI/Makefile.am
-index f5bcbe8..5e4e0e4 100644
---- a/interfaces/Prolog/SWI/Makefile.am
-+++ b/interfaces/Prolog/SWI/Makefile.am
-@@ -189,7 +189,7 @@ $(NO_UNDEFINED_FLAG) \
- bin_PROGRAMS = ppl_pl
- ppl_pl_SOURCES = ppl_pl.cc
-
--pkglib_DATA = ppl_swiprolog.pl
-+pkgdata_DATA = ppl_swiprolog.pl
-
- CLPQ_TESTS_NONSTRICT = \
- ack.clpq \
-diff --git a/interfaces/Prolog/XSB/Makefile.am b/interfaces/Prolog/XSB/Makefile.am
-index 18648eb..1bc1e67 100644
---- a/interfaces/Prolog/XSB/Makefile.am
-+++ b/interfaces/Prolog/XSB/Makefile.am
-@@ -188,7 +188,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_xsb.xwam
-+pkgdata_DATA = ppl_xsb.xwam
-
- ppl_xsb.xwam: ppl_xsb.H ppl_xsb.cc libppl_xsb.la
- cp -f ppl_xsb.cc ppl_xsb.c
-diff --git a/interfaces/Prolog/YAP/Makefile.am b/interfaces/Prolog/YAP/Makefile.am
-index fab59c2..34d89e9 100644
---- a/interfaces/Prolog/YAP/Makefile.am
-+++ b/interfaces/Prolog/YAP/Makefile.am
-@@ -179,7 +179,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_yap.pl
-+pkgdata_DATA = ppl_yap.pl
-
- CLPQ_TESTS_NONSTRICT = \
- ack.clpq \
diff --git a/patches/ppl/0.11.2/400-fix-build-with-gmp-5.1.patch b/patches/ppl/0.11.2/400-fix-build-with-gmp-5.1.patch
deleted file mode 100644
index 89d7a74..0000000
--- a/patches/ppl/0.11.2/400-fix-build-with-gmp-5.1.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 9f843aecc23981aec6ed1eaa8be06e6786a47f0d Mon Sep 17 00:00:00 2001
-From: Roberto Bagnara <bagnara@cs.unipr.it>
-Date: Wed, 19 Dec 2012 08:42:19 +0100
-Subject: [PATCH] GMP version 5.1.0 (and, presumably, later versions) defines
- std::numeric_limits.
-
----
- src/mp_std_bits.cc | 6 ++++++
- src/mp_std_bits.defs.hh | 6 ++++++
- 2 files changed, 12 insertions(+)
-
---- a/src/mp_std_bits.cc
-+++ b/src/mp_std_bits.cc
-@@ -26,6 +26,9 @@ site: http://www.cs.unipr.it/ppl/ . */
- #include <ppl-config.h>
- #include "mp_std_bits.defs.hh"
-
-+#if __GNU_MP_VERSION < 5 \
-+ || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
-+
- const bool std::numeric_limits<mpz_class>::is_specialized;
- const int std::numeric_limits<mpz_class>::digits;
- const int std::numeric_limits<mpz_class>::digits10;
-@@ -71,3 +74,6 @@ const bool std::numeric_limits<mpq_class
- const bool std::numeric_limits<mpq_class>::traps;
- const bool std::numeric_limits<mpq_class>::tininess_before;
- const std::float_round_style std::numeric_limits<mpq_class>::round_style;
-+
-+#endif // __GNU_MP_VERSION < 5
-+ // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
---- a/src/mp_std_bits.defs.hh
-+++ b/src/mp_std_bits.defs.hh
-@@ -39,6 +39,9 @@ void swap(mpz_class& x, mpz_class& y);
- #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
- void swap(mpq_class& x, mpq_class& y);
-
-+#if __GNU_MP_VERSION < 5 \
-+ || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
-+
- namespace std {
-
- #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
-@@ -165,6 +168,9 @@ public:
-
- } // namespace std
-
-+#endif // __GNU_MP_VERSION < 5
-+ // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
-+
- #include "mp_std_bits.inlines.hh"
-
- #endif // !defined(PPL_mp_std_bits_defs_hh)
diff --git a/patches/ppl/0.11.2/500-ptrdiff_t.patch b/patches/ppl/0.11.2/500-ptrdiff_t.patch
deleted file mode 100644
index af26cf9..0000000
--- a/patches/ppl/0.11.2/500-ptrdiff_t.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From: Bernhard Walle <bernhard@bwalle.de>
-Subject: Fix compilation with gcc 4.9 (ptrdiff_t errors)
-
-This is a backport of following patch in ppl git
-
- commit 61d4e14dfd9f1121e9b4521dead5728b2424dd7c
- Author: Roberto Bagnara <bagnara@cs.unipr.it>
- Date: Tue Apr 29 21:51:43 2014 +0200
-
- Added missing inclusions. Use std::ptrdiff_t.
- (Thanks to Paulo Cesar Pereira de Andrade.)
-
----
- src/Congruence_System.defs.hh | 3 ++-
- src/Constraint_System.defs.hh | 3 ++-
- src/Generator_System.defs.hh | 3 ++-
- src/Grid_Generator_System.defs.hh | 3 ++-
- 4 files changed, 8 insertions(+), 4 deletions(-)
-
---- a/src/Grid_Generator_System.defs.hh
-+++ b/src/Grid_Generator_System.defs.hh
-@@ -30,6 +30,7 @@ site: http://www.cs.unipr.it/ppl/ . */
- #include "Variables_Set.types.hh"
- #include "Grid.types.hh"
- #include <iosfwd>
-+#include <cstddef>
-
- namespace Parma_Polyhedra_Library {
-
-@@ -267,7 +268,7 @@ public:
- class const_iterator
- : public std::iterator<std::forward_iterator_tag,
- Grid_Generator,
-- ptrdiff_t,
-+ std::ptrdiff_t,
- const Grid_Generator*,
- const Grid_Generator&>,
- private Generator_System::const_iterator {
---- a/src/Congruence_System.defs.hh
-+++ b/src/Congruence_System.defs.hh
-@@ -33,6 +33,7 @@ site: http://www.cs.unipr.it/ppl/ . */
- #include "Grid.types.hh"
- #include "Grid_Certificate.types.hh"
- #include <iosfwd>
-+#include <cstddef>
-
- namespace Parma_Polyhedra_Library {
-
-@@ -235,7 +236,7 @@ public:
- class const_iterator
- : public std::iterator<std::forward_iterator_tag,
- Congruence,
-- ptrdiff_t,
-+ std::ptrdiff_t,
- const Congruence*,
- const Congruence&> {
- public:
---- a/src/Constraint_System.defs.hh
-+++ b/src/Constraint_System.defs.hh
-@@ -33,6 +33,7 @@ site: http://www.cs.unipr.it/ppl/ . */
- #include "Congruence_System.types.hh"
- #include <iterator>
- #include <iosfwd>
-+#include <cstddef>
-
- namespace Parma_Polyhedra_Library {
-
-@@ -204,7 +205,7 @@ public:
- class const_iterator
- : public std::iterator<std::forward_iterator_tag,
- Constraint,
-- ptrdiff_t,
-+ std::ptrdiff_t,
- const Constraint*,
- const Constraint&> {
- public:
---- a/src/Generator_System.defs.hh
-+++ b/src/Generator_System.defs.hh
-@@ -33,6 +33,7 @@ site: http://www.cs.unipr.it/ppl/ . */
- #include "Polyhedron.types.hh"
- #include "Poly_Con_Relation.defs.hh"
- #include <iosfwd>
-+#include <cstddef>
-
- namespace Parma_Polyhedra_Library {
-
-@@ -250,7 +251,7 @@ public:
- class const_iterator
- : public std::iterator<std::forward_iterator_tag,
- Generator,
-- ptrdiff_t,
-+ std::ptrdiff_t,
- const Generator*,
- const Generator&> {
- public:
diff --git a/patches/ppl/0.11/100-fix-java-test-vs-enabled-shared.patch b/patches/ppl/0.11/100-fix-java-test-vs-enabled-shared.patch
deleted file mode 100644
index 12a72e8..0000000
--- a/patches/ppl/0.11/100-fix-java-test-vs-enabled-shared.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit 25bb77587944768581225d1c0048facab32cf019
-Author: Roberto Bagnara <bagnara@cs.unipr.it>
-Date: Wed May 18 09:35:36 2011 +0200
-
- Moved misplaced conditional.
-
-diff --git a/interfaces/Java/tests/Makefile.am b/interfaces/Java/tests/Makefile.am
-index 64ba864..607bbc6 100644
---- a/interfaces/Java/tests/Makefile.am
-+++ b/interfaces/Java/tests/Makefile.am
-@@ -51,6 +51,8 @@ Parma_Polyhedra_Library_test2.java \
- PPL_Test.java \
- ppl_java_tests_common
-
-+if ENABLE_SHARED
-+
- check_JAVA = \
- ppl_java_generated_tests.java \
- Test_Executor.java \
-@@ -62,8 +64,6 @@ Parma_Polyhedra_Library_test1.java \
- Parma_Polyhedra_Library_test2.java \
- PPL_Test.java
-
--if ENABLE_SHARED
--
- CLASSPATH = ../ppl_java.jar:.
- JAVACFLAGS = -classpath $(CLASSPATH)
-
diff --git a/patches/ppl/0.11/200-fix-build-with-local-gmp.patch b/patches/ppl/0.11/200-fix-build-with-local-gmp.patch
deleted file mode 100644
index a4bb9f1..0000000
--- a/patches/ppl/0.11/200-fix-build-with-local-gmp.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/m4/ac_check_gmp.m4~ 2011-02-27 04:07:47.000000000 -0500
-+++ b/m4/ac_check_gmp.m4 2013-07-10 19:57:35.894457259 -0400
-@@ -32,6 +32,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
- AC_ARG_WITH(gmp-build,
- AS_HELP_STRING([--with-gmp-build=DIR],
---- a/configure~ 2011-02-27 04:07:47.000000000 -0500
-+++ b/configure 2013-07-10 19:57:35.894457259 -0400
-@@ -10217,6 +10217,9 @@
- with_libgmpxx_prefix="$with_libgmp_prefix"
- fi
- fi
-+CPPFLAGS="$CPPFLAGS -I$with_libgmp_prefix/include"
-+CXXFLAGS="$CXXFLAGS -I$with_libgmpxx_prefix/include"
-+LDFLAGS="$CPPFLAGS -L$with_libgmpxx_prefix/lib -L$with_libgmp_prefix/lib"
-
-
- # Check whether --with-gmp-build was given.
diff --git a/patches/ppl/0.11/300-fix-data-dir.patch b/patches/ppl/0.11/300-fix-data-dir.patch
deleted file mode 100644
index f091308..0000000
--- a/patches/ppl/0.11/300-fix-data-dir.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-commit 10e0afa8fa25c9e0e8eaac9a0d730ab325086010
-Author: Roberto Bagnara <bagnara@cs.unipr.it>
-Date: Sun Feb 12 08:48:59 2012 +0100
-
- Prolog sources must go under .../share/ppl as these files are architecture independent.
- Moreover, new versions of Automake no longer accept pkglib_DATA.
-
-diff --git a/interfaces/Prolog/Ciao/Makefile.am b/interfaces/Prolog/Ciao/Makefile.am
-index c8dd56e..8dcf17e 100644
---- a/interfaces/Prolog/Ciao/Makefile.am
-+++ b/interfaces/Prolog/Ciao/Makefile.am
-@@ -169,7 +169,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_ciao.po
-+pkgdata_DATA = ppl_ciao.po
-
- ppl_ciao.pl: $(interface_generator_dependencies)
- $(M4) --prefix-builtin -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. \
-diff --git a/interfaces/Prolog/GNU/Makefile.am b/interfaces/Prolog/GNU/Makefile.am
-index 5904bf1..2ba45ee 100644
---- a/interfaces/Prolog/GNU/Makefile.am
-+++ b/interfaces/Prolog/GNU/Makefile.am
-@@ -168,7 +168,7 @@ ppl_gprolog.pl: $(interface_generator_dependencies)
- $(M4) --prefix-builtin -I../.. -I$(srcdir)/.. -I$(srcdir)/../.. \
- $(srcdir)/ppl_interface_generator_gprolog_pl.m4 > $@
-
--pkglib_DATA = ppl_gprolog.pl
-+pkgdata_DATA = ppl_gprolog.pl
-
- bin_PROGRAMS = ppl_gprolog
-
-diff --git a/interfaces/Prolog/SICStus/Makefile.am b/interfaces/Prolog/SICStus/Makefile.am
-index 17a54c7..22f809f 100644
---- a/interfaces/Prolog/SICStus/Makefile.am
-+++ b/interfaces/Prolog/SICStus/Makefile.am
-@@ -68,7 +68,7 @@ ppl_sicstus_SOURCES =
-
- if ENABLE_SHARED
-
--pkglib_DATA = ppl_sicstus.pl ppl_sicstus.s.o
-+pkgdata_DATA = ppl_sicstus.pl ppl_sicstus.s.o
-
- ppl_sicstus.so: ppl_sicstus.pl $(top_builddir)/src/libppl.la $(WATCHDOG_LIBRARY) libppl_sicstus.la
- $(LIBTOOL) --mode=link --tag=CXX \
-@@ -86,7 +86,7 @@ install-data-local: ppl_sicstus.so
-
- else !ENABLE_SHARED
-
--pkglib_DATA = ppl_sicstus.pl
-+pkgdata_DATA = ppl_sicstus.pl
-
- endif !ENABLE_SHARED
-
-diff --git a/interfaces/Prolog/SWI/Makefile.am b/interfaces/Prolog/SWI/Makefile.am
-index f5bcbe8..5e4e0e4 100644
---- a/interfaces/Prolog/SWI/Makefile.am
-+++ b/interfaces/Prolog/SWI/Makefile.am
-@@ -188,7 +188,7 @@ $(NO_UNDEFINED_FLAG) \
- bin_PROGRAMS = ppl_pl
- ppl_pl_SOURCES = ppl_pl.cc
-
--pkglib_DATA = ppl_swiprolog.pl
-+pkgdata_DATA = ppl_swiprolog.pl
-
- CLPQ_TESTS_NONSTRICT = \
- ack.clpq \
-diff --git a/interfaces/Prolog/XSB/Makefile.am b/interfaces/Prolog/XSB/Makefile.am
-index 18648eb..1bc1e67 100644
---- a/interfaces/Prolog/XSB/Makefile.am
-+++ b/interfaces/Prolog/XSB/Makefile.am
-@@ -187,7 +187,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_xsb.xwam
-+pkgdata_DATA = ppl_xsb.xwam
-
- ppl_xsb.xwam: ppl_xsb.H ppl_xsb.cc libppl_xsb.la
- cp -f ppl_xsb.cc ppl_xsb.c
-diff --git a/interfaces/Prolog/YAP/Makefile.am b/interfaces/Prolog/YAP/Makefile.am
-index fab59c2..34d89e9 100644
---- a/interfaces/Prolog/YAP/Makefile.am
-+++ b/interfaces/Prolog/YAP/Makefile.am
-@@ -178,7 +178,7 @@ $(NO_UNDEFINED_FLAG) \
- -module \
- -avoid-version
-
--pkglib_DATA = ppl_yap.pl
-+pkgdata_DATA = ppl_yap.pl
-
- CLPQ_TESTS_NONSTRICT = \
- ack.clpq \