From f29b8a1970404d07cb12a25a755bb4c795ea1cf6 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 20:48:08 +0100 Subject: [PATCH] build with --enable-plugins [release 2.24-2mamba;Fri May 02 2014] --- README.md | 12 + binutils-2.16.1-native-lib-dirs.patch | 14 + binutils-2.18-makeinfo_check.patch | 12 + binutils-2.19-readelf-CAN-2005-1704.patch | 22 + ...ort_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch | 34 ++ binutils-2.22-build-id.patch | 47 ++ binutils-2.22-gcc-4.7-gold-casts.patch | 263 +++++++++ ...tils-2.22-gold-fix_pointer_reference.patch | 12 + ...add_support_for_delayed_load_feature.patch | 131 +++++ binutils-2.23.2-texinfo-5.1.patch | 42 ++ binutils.spec | 524 ++++++++++++++++++ 11 files changed, 1113 insertions(+) create mode 100644 binutils-2.16.1-native-lib-dirs.patch create mode 100644 binutils-2.18-makeinfo_check.patch create mode 100644 binutils-2.19-readelf-CAN-2005-1704.patch create mode 100644 binutils-2.20.1-unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch create mode 100644 binutils-2.22-build-id.patch create mode 100644 binutils-2.22-gcc-4.7-gold-casts.patch create mode 100644 binutils-2.22-gold-fix_pointer_reference.patch create mode 100644 binutils-2.22-x86_64-add_support_for_delayed_load_feature.patch create mode 100644 binutils-2.23.2-texinfo-5.1.patch create mode 100644 binutils.spec diff --git a/README.md b/README.md index e2dead2..a6842af 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,14 @@ # binutils +Binutils is a collection of binary utilities, including: + * ar: creating modifying and extracting from archives + * nm: for listing symbols from object files + * objcopy: for copying and translating object files + * objdump: for displaying information from object files + * ranlib: for generating an index for the contents of an archive + * size: for listing the section sizes of an object or archive file + * strings: for listing printable strings from files + * strip: for discarding symbols (a filter for demangling encoded C++ symbols + * addr2line: for converting addresses to file and line + * nlmconv: for converting object code into an NLM + diff --git a/binutils-2.16.1-native-lib-dirs.patch b/binutils-2.16.1-native-lib-dirs.patch new file mode 100644 index 0000000..807b3f1 --- /dev/null +++ b/binutils-2.16.1-native-lib-dirs.patch @@ -0,0 +1,14 @@ +diff -Nru binutils-2.16.1.orig/ld/configure.tgt binutils-2.16.1/ld/configure.tgt +--- binutils-2.16.1.orig/ld/configure.tgt 2005-08-01 18:25:53.000000000 +0200 ++++ binutils-2.16.1/ld/configure.tgt 2005-08-01 18:28:12.000000000 +0200 +@@ -620,6 +620,10 @@ + NATIVE_LIB_DIRS='/usr/lib /usr/lib/w32api' + ;; + ++ppc-*-linux* | powerpc-*-linux*) ++ NATIVE_LIB_DIRS='/usr/local/lib /lib/ppc /lib /usr/lib' ++ ;; ++ + *-*-linux*) + ;; + diff --git a/binutils-2.18-makeinfo_check.patch b/binutils-2.18-makeinfo_check.patch new file mode 100644 index 0000000..02d9a3f --- /dev/null +++ b/binutils-2.18-makeinfo_check.patch @@ -0,0 +1,12 @@ +diff -Nru binutils-2.18.orig/configure binutils-2.18/configure +--- binutils-2.18.orig/configure 2007-08-06 22:29:40.000000000 +0200 ++++ binutils-2.18/configure 2007-11-28 18:40:18.000000000 +0100 +@@ -6128,7 +6128,7 @@ + # For an installed makeinfo, we require it to be from texinfo 4.4 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\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then + : + else + MAKEINFO="$MISSING makeinfo" diff --git a/binutils-2.19-readelf-CAN-2005-1704.patch b/binutils-2.19-readelf-CAN-2005-1704.patch new file mode 100644 index 0000000..99aff07 --- /dev/null +++ b/binutils-2.19-readelf-CAN-2005-1704.patch @@ -0,0 +1,22 @@ +--- binutils-2.16.1/binutils/readelf.c.orig 2005-06-16 12:25:11.000000000 +0200 ++++ binutils-2.16.1/binutils/readelf.c 2005-06-16 12:33:37.000000000 +0200 +@@ -4123,6 +4123,19 @@ process_section_groups (FILE *file) + entry = byte_get (indices, 4); + indices += 4; + ++ if (entry >= elf_header.e_shnum) ++ { ++ error (_("section [%5u] in group section [%5u] > maximum section [%5u]\n"), ++ entry, i, elf_header.e_shnum - 1); ++ continue; ++ } ++ else if (entry >= SHN_LORESERVE && entry <= SHN_HIRESERVE) ++ { ++ error (_("invalid section [%5u] in group section [%5u]\n"), ++ entry, i); ++ continue; ++ } ++ + if (do_section_groups) + { + printf ("\n%s group section [%5u] `%s' [%s] contains %u sections:\n", diff --git a/binutils-2.20.1-unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch b/binutils-2.20.1-unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch new file mode 100644 index 0000000..ae79c95 --- /dev/null +++ b/binutils-2.20.1-unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch @@ -0,0 +1,34 @@ +diff -Nru 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-04-13 00:54:33.841153767 +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/binutils-2.22-build-id.patch b/binutils-2.22-build-id.patch new file mode 100644 index 0000000..f602583 --- /dev/null +++ b/binutils-2.22-build-id.patch @@ -0,0 +1,47 @@ +--- bfd/compress.c.jj 2010-12-24 11:40:19.000000000 +0100 ++++ bfd/compress.c 2011-01-28 15:40:19.869777126 +0100 +@@ -174,7 +174,7 @@ bfd_get_full_section_contents (bfd *abfd + case COMPRESS_SECTION_NONE: + if (p == NULL) + { +- p = (bfd_byte *) bfd_malloc (sz); ++ p = (bfd_byte *) bfd_zmalloc (sz); + if (p == NULL) + return FALSE; + } +@@ -214,7 +214,7 @@ bfd_get_full_section_contents (bfd *abfd + if (!ret) + goto fail_compressed; + +- uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size); ++ uncompressed_buffer = (bfd_byte *) bfd_zmalloc (uncompressed_size); + if (uncompressed_buffer == NULL) + goto fail_compressed; + +--- bfd/elfcode.h.jj 2010-12-31 03:43:21.000000000 +0100 ++++ bfd/elfcode.h 2011-01-28 15:34:39.055388479 +0100 +@@ -1158,6 +1158,24 @@ elf_checksum_contents (bfd *abfd, + + if (i_shdr.contents) + (*process) (i_shdr.contents, i_shdr.sh_size, arg); ++ else ++ { ++ asection *sec; ++ ++ sec = bfd_section_from_elf_index (abfd, count); ++ if (sec != NULL) ++ { ++ if (sec->contents == NULL) ++ { ++ /* Force rereading from file. */ ++ sec->flags &= ~SEC_IN_MEMORY; ++ if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents)) ++ continue; ++ } ++ if (sec->contents != NULL) ++ (*process) (sec->contents, i_shdr.sh_size, arg); ++ } ++ } + } + + return TRUE; diff --git a/binutils-2.22-gcc-4.7-gold-casts.patch b/binutils-2.22-gcc-4.7-gold-casts.patch new file mode 100644 index 0000000..aa0d215 --- /dev/null +++ b/binutils-2.22-gcc-4.7-gold-casts.patch @@ -0,0 +1,263 @@ +diff -cp ../binutils-2.22.orig/gold/dwarf_reader.cc gold/dwarf_reader.cc +*** ../binutils-2.22.orig/gold/dwarf_reader.cc 2012-01-13 12:20:00.279690374 +0000 +--- gold/dwarf_reader.cc 2012-01-13 12:22:26.500694442 +0000 +*************** Sized_dwarf_line_info: +*** 491,498 **** + && (shndx == -1U || lsm.shndx == -1U || shndx == lsm.shndx)) + { + Offset_to_lineno_entry entry +! = { lsm.address, this->current_header_index_, +! lsm.file_num, true, lsm.line_num }; + std::vector& + map(this->line_number_map_[lsm.shndx]); + // If we see two consecutive entries with the same +--- 491,498 ---- + && (shndx == -1U || lsm.shndx == -1U || shndx == lsm.shndx)) + { + Offset_to_lineno_entry entry +! = { (off_t) lsm.address, this->current_header_index_, +! (unsigned int) lsm.file_num, true, lsm.line_num }; + std::vector& + map(this->line_number_map_[lsm.shndx]); + // If we see two consecutive entries with the same +Common subdirectories: ../binutils-2.22.orig/gold/gcctestdir1 and gold/gcctestdir1 +Common subdirectories: ../binutils-2.22.orig/gold/gcctestdir2 and gold/gcctestdir2 +Common subdirectories: ../binutils-2.22.orig/gold/gcctestdir2-r and gold/gcctestdir2-r +diff -cp ../binutils-2.22.orig/gold/i386.cc gold/i386.cc +*** ../binutils-2.22.orig/gold/i386.cc 2012-01-13 12:20:00.355690373 +0000 +--- gold/i386.cc 2012-01-13 12:23:48.407696800 +0000 +*************** Target_i386::do_code_fill(section_size_t +*** 3480,3529 **** + } + + // Nop sequences of various lengths. +! const char nop1[1] = { 0x90 }; // nop +! const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax +! const char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi +! const char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi +! const char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop + 0x00 }; // leal 0(%esi,1),%esi +! const char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi + 0x00, 0x00 }; +! const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi + 0x00, 0x00, 0x00 }; +! const char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop + 0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi +! const char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi + 0x27, 0x00, 0x00, 0x00, // leal 0L(%edi,1),%edi + 0x00 }; +! const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi + 0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi + 0x00, 0x00 }; +! const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi + 0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi + 0x00, 0x00, 0x00 }; +! const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi + 0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi + 0x00, 0x00, 0x00, 0x00 }; +! const char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi + 0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi + 0x27, 0x00, 0x00, 0x00, + 0x00 }; +! const char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi + 0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi + 0xbc, 0x27, 0x00, 0x00, + 0x00, 0x00 }; +! const char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15 + 0x90, 0x90, 0x90, 0x90, // nop,nop,nop,... + 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90 }; + +! const char* nops[16] = { + NULL, + nop1, nop2, nop3, nop4, nop5, nop6, nop7, + nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15 + }; + +! return std::string(nops[length], length); + } + + // Return the value to use for the base of a DW_EH_PE_datarel offset +--- 3480,3529 ---- + } + + // Nop sequences of various lengths. +! const unsigned char nop1[1] = { 0x90 }; // nop +! const unsigned char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax +! const unsigned char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi +! const unsigned char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi +! const unsigned char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop + 0x00 }; // leal 0(%esi,1),%esi +! const unsigned char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi + 0x00, 0x00 }; +! const unsigned char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi + 0x00, 0x00, 0x00 }; +! const unsigned char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop + 0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi +! const unsigned char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi + 0x27, 0x00, 0x00, 0x00, // leal 0L(%edi,1),%edi + 0x00 }; +! const unsigned char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi + 0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi + 0x00, 0x00 }; +! const unsigned char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi + 0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi + 0x00, 0x00, 0x00 }; +! const unsigned char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi + 0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi + 0x00, 0x00, 0x00, 0x00 }; +! const unsigned char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi + 0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi + 0x27, 0x00, 0x00, 0x00, + 0x00 }; +! const unsigned char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi + 0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi + 0xbc, 0x27, 0x00, 0x00, + 0x00, 0x00 }; +! const unsigned char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15 + 0x90, 0x90, 0x90, 0x90, // nop,nop,nop,... + 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90 }; + +! const unsigned char* nops[16] = { + NULL, + nop1, nop2, nop3, nop4, nop5, nop6, nop7, + nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15 + }; + +! return std::string((const char *) nops[length], length); + } + + // Return the value to use for the base of a DW_EH_PE_datarel offset +Common subdirectories: ../binutils-2.22.orig/gold/po and gold/po +diff -cp ../binutils-2.22.orig/gold/resolve.cc gold/resolve.cc +*** ../binutils-2.22.orig/gold/resolve.cc 2012-01-13 12:20:00.288690373 +0000 +--- gold/resolve.cc 2012-01-13 12:24:29.576697764 +0000 +*************** Symbol_table::resolve(Sized_symbol +*** 336,344 **** + && to->name()[0] == '_' && to->name()[1] == 'Z') + { + Symbol_location fromloc +! = { object, orig_st_shndx, sym.get_st_value() }; + Symbol_location toloc = { to->object(), to->shndx(&to_is_ordinary), +! to->value() }; + this->candidate_odr_violations_[to->name()].insert(fromloc); + this->candidate_odr_violations_[to->name()].insert(toloc); + } +--- 336,344 ---- + && to->name()[0] == '_' && to->name()[1] == 'Z') + { + Symbol_location fromloc +! = { object, orig_st_shndx, (off_t) sym.get_st_value() }; + Symbol_location toloc = { to->object(), to->shndx(&to_is_ordinary), +! (off_t) to->value() }; + this->candidate_odr_violations_[to->name()].insert(fromloc); + this->candidate_odr_violations_[to->name()].insert(toloc); + } +Common subdirectories: ../binutils-2.22.orig/gold/testsuite and gold/testsuite +diff -cp ../binutils-2.22.orig/gold/x86_64.cc gold/x86_64.cc +*** ../binutils-2.22.orig/gold/x86_64.cc 2012-01-13 12:21:24.880692697 +0000 +--- gold/x86_64.cc 2012-01-13 12:25:36.219699685 +0000 +*************** Target_x86_64::do_code_fill(section_size +*** 3867,3916 **** + } + + // Nop sequences of various lengths. +! const char nop1[1] = { 0x90 }; // nop +! const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax +! const char nop3[3] = { 0x0f, 0x1f, 0x00 }; // nop (%rax) +! const char nop4[4] = { 0x0f, 0x1f, 0x40, 0x00}; // nop 0(%rax) +! const char nop5[5] = { 0x0f, 0x1f, 0x44, 0x00, // nop 0(%rax,%rax,1) + 0x00 }; +! const char nop6[6] = { 0x66, 0x0f, 0x1f, 0x44, // nopw 0(%rax,%rax,1) + 0x00, 0x00 }; +! const char nop7[7] = { 0x0f, 0x1f, 0x80, 0x00, // nopl 0L(%rax) + 0x00, 0x00, 0x00 }; +! const char nop8[8] = { 0x0f, 0x1f, 0x84, 0x00, // nopl 0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00 }; +! const char nop9[9] = { 0x66, 0x0f, 0x1f, 0x84, // nopw 0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00, + 0x00 }; +! const char nop10[10] = { 0x66, 0x2e, 0x0f, 0x1f, // nopw %cs:0L(%rax,%rax,1) + 0x84, 0x00, 0x00, 0x00, + 0x00, 0x00 }; +! const char nop11[11] = { 0x66, 0x66, 0x2e, 0x0f, // data16 + 0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00 }; +! const char nop12[12] = { 0x66, 0x66, 0x66, 0x2e, // data16; data16 + 0x0f, 0x1f, 0x84, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00 }; +! const char nop13[13] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x2e, 0x0f, 0x1f, 0x84, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00, + 0x00 }; +! const char nop14[14] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x66, 0x2e, 0x0f, 0x1f, // data16 + 0x84, 0x00, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00 }; +! const char nop15[15] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x66, 0x66, 0x2e, 0x0f, // data16; data16 + 0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00 }; + +! const char* nops[16] = { + NULL, + nop1, nop2, nop3, nop4, nop5, nop6, nop7, + nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15 + }; + +! return std::string(nops[length], length); + } + + // Return the addend to use for a target specific relocation. The +--- 3867,3916 ---- + } + + // Nop sequences of various lengths. +! const unsigned char nop1[1] = { 0x90 }; // nop +! const unsigned char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax +! const unsigned char nop3[3] = { 0x0f, 0x1f, 0x00 }; // nop (%rax) +! const unsigned char nop4[4] = { 0x0f, 0x1f, 0x40, 0x00}; // nop 0(%rax) +! const unsigned char nop5[5] = { 0x0f, 0x1f, 0x44, 0x00, // nop 0(%rax,%rax,1) + 0x00 }; +! const unsigned char nop6[6] = { 0x66, 0x0f, 0x1f, 0x44, // nopw 0(%rax,%rax,1) + 0x00, 0x00 }; +! const unsigned char nop7[7] = { 0x0f, 0x1f, 0x80, 0x00, // nopl 0L(%rax) + 0x00, 0x00, 0x00 }; +! const unsigned char nop8[8] = { 0x0f, 0x1f, 0x84, 0x00, // nopl 0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00 }; +! const unsigned char nop9[9] = { 0x66, 0x0f, 0x1f, 0x84, // nopw 0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00, + 0x00 }; +! const unsigned char nop10[10] = { 0x66, 0x2e, 0x0f, 0x1f, // nopw %cs:0L(%rax,%rax,1) + 0x84, 0x00, 0x00, 0x00, + 0x00, 0x00 }; +! const unsigned char nop11[11] = { 0x66, 0x66, 0x2e, 0x0f, // data16 + 0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00 }; +! const unsigned char nop12[12] = { 0x66, 0x66, 0x66, 0x2e, // data16; data16 + 0x0f, 0x1f, 0x84, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00 }; +! const unsigned char nop13[13] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x2e, 0x0f, 0x1f, 0x84, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00, 0x00, + 0x00 }; +! const unsigned char nop14[14] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x66, 0x2e, 0x0f, 0x1f, // data16 + 0x84, 0x00, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00 }; +! const unsigned char nop15[15] = { 0x66, 0x66, 0x66, 0x66, // data16; data16; data16 + 0x66, 0x66, 0x2e, 0x0f, // data16; data16 + 0x1f, 0x84, 0x00, 0x00, // nopw %cs:0L(%rax,%rax,1) + 0x00, 0x00, 0x00 }; + +! const unsigned char* nops[16] = { + NULL, + nop1, nop2, nop3, nop4, nop5, nop6, nop7, + nop8, nop9, nop10, nop11, nop12, nop13, nop14, nop15 + }; + +! return std::string((const char *) nops[length], length); + } + + // Return the addend to use for a target specific relocation. The diff --git a/binutils-2.22-gold-fix_pointer_reference.patch b/binutils-2.22-gold-fix_pointer_reference.patch new file mode 100644 index 0000000..927a72d --- /dev/null +++ b/binutils-2.22-gold-fix_pointer_reference.patch @@ -0,0 +1,12 @@ +diff -Nru binutils-2.22.orig/gold/options.cc binutils-2.22/gold/options.cc +--- binutils-2.22.orig/gold/options.cc 2011-07-11 16:19:51.000000000 +0000 ++++ binutils-2.22/gold/options.cc 2012-07-31 14:52:22.178701142 +0000 +@@ -198,7 +198,7 @@ + { + char* endptr; + *retval = strtol(arg, &endptr, 0); +- if (*endptr != '\0' || retval < 0) ++ if (*endptr != '\0' || *retval < 0) + gold_fatal(_("%s: invalid option value (expected an integer): %s"), + option_name, arg); + } diff --git a/binutils-2.22-x86_64-add_support_for_delayed_load_feature.patch b/binutils-2.22-x86_64-add_support_for_delayed_load_feature.patch new file mode 100644 index 0000000..e4732b5 --- /dev/null +++ b/binutils-2.22-x86_64-add_support_for_delayed_load_feature.patch @@ -0,0 +1,131 @@ +=================================================================== +RCS file: /cvs/src/src/binutils/dlltool.c,v +retrieving revision 1.104 +retrieving revision 1.105 +diff -u -r1.104 -r1.105 +--- src/binutils/dlltool.c 2012/02/09 04:51:44 1.104 ++++ src/binutils/dlltool.c 2012/02/21 16:10:12 1.105 +@@ -515,6 +515,14 @@ + 0xE9, 0x00, 0x00, 0x00, 0x00 /* jmp __tailMerge__dllname */ + }; + ++static const unsigned char i386_x64_dljtab[] = ++{ ++ 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, /* jmp __imp__function */ ++ 0x48, 0x8d, 0x05, /* leaq rax, (__imp__function) */ ++ 0x00, 0x00, 0x00, 0x00, ++ 0xE9, 0x00, 0x00, 0x00, 0x00 /* jmp __tailMerge__dllname */ ++}; ++ + static const unsigned char arm_jtab[] = + { + 0x00, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */ +@@ -591,6 +599,22 @@ + "\tpopl %%ecx\n" + "\tjmp *%%eax\n"; + ++static const char i386_x64_trampoline[] = ++ "\tpushq %%rcx\n" ++ "\tpushq %%rdx\n" ++ "\tpushq %%r8\n" ++ "\tpushq %%r9\n" ++ "\tsubq $40, %%rsp\n" ++ "\tmovq %%rax, %%rdx\n" ++ "\tleaq __DELAY_IMPORT_DESCRIPTOR_%s(%%rip), %%rcx\n" ++ "\tcall __delayLoadHelper2\n" ++ "\taddq $40, %%rsp\n" ++ "\tpopq %%r9\n" ++ "\tpopq %%r8\n" ++ "\tpopq %%rdx\n" ++ "\tpopq %%rcx\n" ++ "\tjmp *%%rax\n"; ++ + struct mac + { + const char *type; +@@ -735,7 +759,7 @@ + "jmp *", ".global", ".space", ".align\t2",".align\t4", "", + "pe-x86-64",bfd_arch_i386, + i386_jtab, sizeof (i386_jtab), 2, +- i386_dljtab, sizeof (i386_dljtab), 2, 7, 12, i386_trampoline ++ i386_x64_dljtab, sizeof (i386_x64_dljtab), 2, 9, 14, i386_x64_trampoline + } + , + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +@@ -2609,9 +2633,14 @@ + + if (delay) + { +- rel2->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); ++ if (machine == MX86) ++ rel2->howto = bfd_reloc_type_lookup (abfd, ++ BFD_RELOC_32_PCREL); ++ else ++ rel2->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); + rel2->sym_ptr_ptr = rel->sym_ptr_ptr; +- rel3->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32_PCREL); ++ rel3->howto = bfd_reloc_type_lookup (abfd, ++ BFD_RELOC_32_PCREL); + rel3->sym_ptr_ptr = iname_lab_pp; + } + +@@ -2623,10 +2652,11 @@ + case IDATA5: + if (delay) + { +- si->data = xmalloc (4); +- si->size = 4; ++ si->size = create_for_pep ? 8 : 4; ++ si->data = xmalloc (si->size); + sec->reloc_count = 1; + memset (si->data, 0, si->size); ++ /* Point after jmp [__imp_...] instruction. */ + si->data[0] = 6; + rel = xmalloc (sizeof (arelent)); + rpp = xmalloc (sizeof (arelent *) * 2); +@@ -2634,7 +2664,10 @@ + rpp[1] = 0; + rel->address = 0; + rel->addend = 0; +- rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); ++ if (create_for_pep) ++ rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_64); ++ else ++ rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); + rel->sym_ptr_ptr = secdata[TEXT].sympp; + sec->orelocation = rpp; + break; +@@ -3005,6 +3038,8 @@ + fprintf (f, "\n.section .data\n"); + fprintf (f, "__DLL_HANDLE_%s:\n", imp_name_lab); + fprintf (f, "\t%s\t0\t%s Handle\n", ASM_LONG, ASM_C); ++ if (create_for_pep) ++ fprintf (f, "\t%s\t0\n", ASM_LONG); + fprintf (f, "\n"); + + fprintf (f, "%sStuff for compatibility\n", ASM_C); +@@ -3013,11 +3048,10 @@ + { + fprintf (f, "\t.section\t.idata$5\n"); + /* NULL terminating list. */ +-#ifdef DLLTOOL_MX86_64 +- fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); +-#else +- fprintf (f,"\t%s\t0\n", ASM_LONG); +-#endif ++ if (create_for_pep) ++ fprintf (f,"\t%s\t0\n\t%s\t0\n", ASM_LONG, ASM_LONG); ++ else ++ fprintf (f,"\t%s\t0\n", ASM_LONG); + fprintf (f, "__IAT_%s:\n", imp_name_lab); + } + +@@ -3025,6 +3059,8 @@ + { + fprintf (f, "\t.section\t.idata$4\n"); + fprintf (f, "\t%s\t0\n", ASM_LONG); ++ if (create_for_pep) ++ fprintf (f, "\t%s\t0\n", ASM_LONG); + fprintf (f, "\t.section\t.idata$4\n"); + fprintf (f, "__INT_%s:\n", imp_name_lab); + } diff --git a/binutils-2.23.2-texinfo-5.1.patch b/binutils-2.23.2-texinfo-5.1.patch new file mode 100644 index 0000000..980741b --- /dev/null +++ b/binutils-2.23.2-texinfo-5.1.patch @@ -0,0 +1,42 @@ +diff -Nru binutils-2.23.2.orig/bfd/doc/bfd.texinfo binutils-2.23.2/bfd/doc/bfd.texinfo +--- binutils-2.23.2.orig/bfd/doc/bfd.texinfo 2010-10-28 13:40:25.000000000 +0200 ++++ binutils-2.23.2/bfd/doc/bfd.texinfo 2013-03-27 13:45:34.100572691 +0100 +@@ -322,7 +322,7 @@ + @printindex cp + + @tex +-% I think something like @colophon should be in texinfo. In the ++% I think something like @@colophon should be in texinfo. In the + % meantime: + \long\def\colophon{\hbox to0pt{}\vfill + \centerline{The body of this manual is set in} +@@ -333,7 +333,7 @@ + \centerline{{\sl\fontname\tensl\/}} + \centerline{are used for emphasis.}\vfill} + \page\colophon +-% Blame: doc@cygnus.com, 28mar91. ++% Blame: doc@@cygnus.com, 28mar91. + @end tex + + @bye +diff -Nru binutils-2.23.2.orig/ld/ld.texinfo binutils-2.23.2/ld/ld.texinfo +--- binutils-2.23.2.orig/ld/ld.texinfo 2013-03-25 09:06:23.000000000 +0100 ++++ binutils-2.23.2/ld/ld.texinfo 2013-03-27 13:47:43.387364956 +0100 +@@ -7863,7 +7863,7 @@ + @printindex cp + + @tex +-% I think something like @colophon should be in texinfo. In the ++% I think something like @@colophon should be in texinfo. In the + % meantime: + \long\def\colophon{\hbox to0pt{}\vfill + \centerline{The body of this manual is set in} +@@ -7874,7 +7874,7 @@ + \centerline{{\sl\fontname\tensl\/}} + \centerline{are used for emphasis.}\vfill} + \page\colophon +-% Blame: doc@cygnus.com, 28mar91. ++% Blame: doc@@cygnus.com, 28mar91. + @end tex + + @bye diff --git a/binutils.spec b/binutils.spec new file mode 100644 index 0000000..044c1ca --- /dev/null +++ b/binutils.spec @@ -0,0 +1,524 @@ +# cross platform binutils specfile + +%define target_cpu %(echo %{_target_platform} | cut -d- -f1) +%define gprof 1 +%define pkgver %(echo %version | sed "s|[a-z]*$||") + +Name: binutils +Version: 2.24 +Release: 2mamba +Summary: GNU Binary Utility Development Utilities +Group: Development/Tools +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +Source: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2 +URL: http://www.gnu.org/software/binutils/binutils.html +Patch0: %{name}-2.19-readelf-CAN-2005-1704.patch +Patch1: %{name}-2.16.1-native-lib-dirs.patch +Patch2: %{name}-2.18-makeinfo_check.patch +Patch3: %{name}-2.20.1-unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch +Patch4: %{name}-2.22-x86_64-add_support_for_delayed_load_feature.patch +Patch5: %{name}-2.22-gcc-4.7-gold-casts.patch +Patch6: %{name}-2.22-build-id.patch +Patch7: %{name}-2.22-gold-fix_pointer_reference.patch +Patch8: binutils-2.23.2-texinfo-5.1.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: bash +BuildRequires: glibc-devel +BuildRequires: texinfo +## AUTOBUILDREQ-END +BuildRequires: bison >= 2.5 +Requires: libbinutils = %{version}-%{release} +BuildRoot: %{_tmppath}/binutils-%{version}-build +Requires(post):%{__install_info} + +%description +Binutils is a collection of binary utilities, including: + * ar: creating modifying and extracting from archives + * nm: for listing symbols from object files + * objcopy: for copying and translating object files + * objdump: for displaying information from object files + * ranlib: for generating an index for the contents of an archive + * size: for listing the section sizes of an object or archive file + * strings: for listing printable strings from files + * strip: for discarding symbols (a filter for demangling encoded C++ symbols + * addr2line: for converting addresses to file and line + * nlmconv: for converting object code into an NLM + +%package -n libbinutils +Summary: Main library for binutils +Group: System/Libraries + +%description -n libbinutils +This package contains the library needed to run programs dynamically +linked with binutils. + +%package -n libbinutils-devel +Summary: Main library for binutils +Group: System/Libraries +Requires: libbinutils = %{version}-%{release} + +%description -n libbinutils-devel +This package contains the library needed to run programs dynamically +linked with binutils. + +%package -n cross-%{_target_platform}-%{name} +Summary: Cross Platform Binutils for %{_target_platform} +Group: Development/Tools +AutoReqProv: no + +%description -n cross-%{_target_platform}-%{name} +Binutils is a collection of binary utilities, including: + * ar: creating modifying and extracting from archives + * nm: for listing symbols from object files + * objcopy: for copying and translating object files + * objdump: for displaying information from object files + * ranlib: for generating an index for the contents of an archive + * size: for listing the section sizes of an object or archive file + * strings: for listing printable strings from files + * strip: for discarding symbols (a filter for demangling encoded C++ symbols + * addr2line: for converting addresses to file and line + * nlmconv: for converting object code into an NLM + +Use this package if you need cross platform builds for %{_target_platform} target. + +%prep +%setup -q -n binutils-%{pkgver} +%patch0 -p1 +%patch1 -p1 +#%patch2 -p1 +#%patch3 -p1 +#%patch4 -p1 +#%patch5 -p0 +#%patch6 -p0 +#%patch7 -p1 +#%patch8 -p1 + +%build +install -d binutils-build +CONFIGURE_ADD="--enable-gold=default --enable-plugins --enable-ld --enable-shared" +case %{target_cpu} in + i*86 | athlon*) + TARGETS="\ +--enable-64bit-bfd \ +--enable-targets=x86_64-linux,powerpc-linux,powerpc64-linux,arm-linux,armelf-linux-eabi" + ;; + ppc | powerpc) +# disable shared build for cross platform binutils because it is a big-endian platform and complain about +# glibc not being little-endian + TARGETS="\ +--enable-64bit-bfd \ +--enable-targets=powerpc64-linux,i386-linux,x86_64-linux,arm-linux,armelf-linux-eabi" +# gold is not well supported for ppc, gcc build fails. Use bfd as default + CONFIGURE_ADD="--enable-gold=yes --enable-ld=default" +%if "%{_target_platform}" != "%{_host}" + CONFIGURE_ADD="$CONFIGURE_ADD --disable-shared" +%endif + ;; + arm) + TARGETS="\ +--enable-targets=powerpc-linux,powerpc64-linux,i386-linux,x86_64-linux,arm-linux,armelf-linux-eabi" +#--with-lib-path=%{_prefix}/%{_target_platform}/lib:%{_prefix}/%{_target_platform}/lib/be:%{_prefix}/%{_target_platform}/lib/soft-float:%{_prefix}/%{_target_platform}/lib/be/soft-float" + ;; + avr) + TARGETS="" + CONFIGURE_ADD="--enable-ld --disable-shared" + ;; + x86_64) + TARGETS="\ +--enable-64bit-bfd \ +--enable-targets=i386-linux,powerpc-linux,powerpc64-linux,arm-linux,armelf-linux-eabi" + ;; + *) + TARGETS="\ +--enable-targets=powerpc64-linux,i386-linux,x86_64-linux,arm-linux,armelf-linux-eabi" + ;; +esac + +cd binutils-build +../configure \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ + --build=%{_build} \ + --target=%{_target_platform} \ + $TARGETS \ + --host=%{_host} \ + $CONFIGURE_ADD + +%make all tooldir=%{_prefix} +%make info tooldir=%{_prefix} +# tooldir=%{_prefix}/%{_target_platform} + +# \ +# LIB_PATH=%{?addlibdir} + +#\ +# NATIVE_LIB_DIRS="/usr/local/lib %{addlibdirs} /lib /usr/lib" + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +# FIXME: bfd and opcodes are installed under +# /usr/%host_noncanonical/%_target_platform dir instead of +# /usr/%_target_platform, why ? +sed -i "s|host_noncanonical =.*|host_noncanonical = \"\"|" \ + binutils-build/bfd/Makefile \ + binutils-build/opcodes/Makefile + +%makeinstall install-info -C binutils-build host_noncanonical="" + +%if "%{?_target_platform}" == "%{_host}" +install -D include/libiberty.h %{buildroot}%{_includedir}/libiberty.h + +# create platform specific symlinks +for i in addr2line ar as c++filt ld nm objcopy objdump ranlib readelf \ + size strings strip; do + ln -sf $i %{buildroot}%{_bindir}/%{_target_platform}-$i +done + +# remove c++filt (which conflict with gcc package) +#rm -f %{buildroot}%{_bindir}/c++filt +#rm -f %{buildroot}%{_mandir}/man1/c++filt.* + +cp ./ld/NEWS NEWS.ld +cp ./gas/NEWS NEWS.gas +cp ./binutils/NEWS NEWS.binutils + +%find_lang bfd +%find_lang binutils +%find_lang gas +%find_lang gold +%if "%gprof" == "1" +%find_lang gprof +%endif +%find_lang ld +%find_lang opcodes + +> %{name}-all.lang + +%if "%gprof" == "1" +extralang=gprof +%endif + +for i in bfd binutils gas gold ld opcodes $extralang; do + cat ${i}.lang >> %{name}-all.lang +done +%endif + + +%if "%{_target_platform}" != "%{_host}" +# recreate platform specific symlinks, instead of copies +for i in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip; do + if [ -f %{buildroot}%{_bindir}/%{_target_platform}-$i ]; then + rm -f %{buildroot}%{_bindir}/%{_target_platform}-$i + ln -sf ../%{_target_platform}/bin/$i %{buildroot}%{_bindir}/%{_target_platform}-$i + fi +done +rm -rf %{buildroot}%{_datadir}/locale +rm -rf %{buildroot}%{_datadir}/info +rm -rf %{buildroot}%{_libdir}/libiberty.a +%else +# recreate platform specific symlinks, instead of copies +for i in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip; do + if [ -f %{buildroot}%{_bindir}/$i ]; then + rm -f %{buildroot}%{_bindir}/$i + ln -sf ../%{_target_platform}/bin/$i %{buildroot}%{_bindir}/$i + fi +done +%endif +# use alternatives for %_bindir/ld +rm -f %{buildroot}%{_prefix}/%{_target_platform}/bin/ld + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +if [ $1 -ge 1 ]; then +%if "%gprof" == "1" + extralang=gprof +%endif + for i in as bfd binutils configure ld standards $extralang; do +%install_info ${i}.info + done +# remove legacy alternatives + /usr/sbin/update-alternatives --remove ld %{_bindir}/ld.bfd 2>/dev/null + /usr/sbin/update-alternatives --remove ld %{_bindir}/ld.gold 2>/dev/null + [ -L %{_prefix}/%{_target_platform}/bin/ld ] || rm -f %{_prefix}/%{_target_platform}/bin/ld + /usr/sbin/update-alternatives \ + --install %{_prefix}/%{_target_platform}/bin/ld ld \ + %{_prefix}/%{_target_platform}/bin/ld.bfd 20 + /usr/sbin/update-alternatives \ + --install %{_prefix}/%{_target_platform}/bin/ld ld \ + %{_prefix}/%{_target_platform}/bin/ld.gold 10 +fi +exit 0 + +%preun +if [ $1 -eq 0 ]; then +%if "%gprof" == "1" + extralang=gprof +%endif + for i in as bfd binutils configure ld standards $extralang; do +%uninstall_info ${i}.info + done +fi +exit 0 + +%postun +if [ $1 -eq 0 ]; then +# remove legacy alternatives /usr/bin/ld + /usr/sbin/update-alternatives --remove ld %{_bindir}/ld.bfd 2>/dev/null + /usr/sbin/update-alternatives --remove ld %{_bindir}/ld.gold 2>/dev/null + + /usr/sbin/update-alternatives --remove ld \ + %{_prefix}/%{_target_platform}/bin/ld.bfd + /usr/sbin/update-alternatives --remove ld \ + %{_prefix}/%{_target_platform}/bin/ld.gold +fi +exit 0 + +%posttrans +[ -e %{_prefix}/%{_target_platform}/bin/ld ] || ln -s /etc/alternatives/ld %{_prefix}/%{_target_platform}/bin/ld +exit 0 + +%post -n cross-%{_target_platform}-%{name} +if [ $1 -ge 1 ]; then + [ -L %{_prefix}/%{_target_platform}/bin/ld ] || rm -f %{_prefix}/%{_target_platform}/bin/ld + /usr/sbin/update-alternatives \ + --install %{_prefix}/%{_target_platform}/bin/ld %{_target_platform}-ld \ + %{_prefix}/%{_target_platform}/bin/ld.bfd 20 + /usr/sbin/update-alternatives \ + --install %{_prefix}/%{_target_platform}/bin/ld %{_target_platform}-ld \ + %{_prefix}/%{_target_platform}/bin/ld.gold 10 +fi +exit 0 + +%postun -n cross-%{_target_platform}-%{name} +if [ $1 -eq 0 ]; then + /usr/sbin/update-alternatives --remove %{_target_platform}-ld \ + %{_prefix}/%{_target_platform}/bin/ld.bfd + /usr/sbin/update-alternatives --remove %{_target_platform}-ld \ + %{_prefix}/%{_target_platform}/bin/ld.gold +fi +exit 0 + +%posttrans -n cross-%{_target_platform}-%{name} +[ -e %{_prefix}/%{_target_platform}/bin/ld ] || ln -s /etc/alternatives/ld %{_prefix}/%{_target_platform}/bin/ld +exit 0 + +%if "%{_target_platform}" == "%{_host}" +%files -f %{name}-all.lang +%defattr(-,root,root) +%{_bindir}/addr2line +%{_bindir}/ar +%{_bindir}/as +%{_bindir}/c++filt +%{_bindir}/dwp +%{_bindir}/elfedit +%{_bindir}/embedspu +%if "%gprof" == "1" +%{_bindir}/gprof +%endif +%{_bindir}/ld +%{_bindir}/ld.bfd +%{_bindir}/ld.gold +%{_bindir}/nm +%{_bindir}/objcopy +%{_bindir}/objdump +%{_bindir}/ranlib +%{_bindir}/readelf +%{_bindir}/size +%{_bindir}/strings +%{_bindir}/strip +%{_bindir}/%{_target_platform}-* +%{_prefix}/%{_host}/bin/* +%{_prefix}/%{_host}/lib/* +%{_mandir}/man1/addr2line.1.gz +%{_mandir}/man1/ar.1.gz +%{_mandir}/man1/as.1.gz +%{_mandir}/man1/c++filt.1.gz +%{_mandir}/man1/dlltool.1.gz +%{_mandir}/man1/elfedit.1.gz +%if "%gprof" == "1" +%{_mandir}/man1/gprof.1.gz +%endif +%{_mandir}/man1/ld.1.gz +%{_mandir}/man1/nlmconv.1.gz +%{_mandir}/man1/nm.1.gz +%{_mandir}/man1/objcopy.1.gz +%{_mandir}/man1/objdump.1.gz +%{_mandir}/man1/ranlib.1.gz +%{_mandir}/man1/readelf.1.gz +%{_mandir}/man1/size.1.gz +%{_mandir}/man1/strings.1.gz +%{_mandir}/man1/strip.1.gz +%{_mandir}/man1/windmc.1.gz +%{_mandir}/man1/windres.1.gz +%{_infodir}/* +%doc COPYING* README NEWS* + +%files -n libbinutils +%defattr(-,root,root) +%{_libdir}/libbfd-%{version}.so +%{_libdir}/libopcodes-%{version}.so + +%files -n libbinutils-devel +%defattr(-,root,root) +%{_includedir}/* +%{_libdir}/libbfd.*a +%{_libdir}/libbfd.so +%{_libdir}/libopcodes.*a +%{_libdir}/libopcodes.so +#%{_libdir}/libiberty.a + +%else +%files -n cross-%{_target_platform}-%{name} +%defattr(-,root,root) +%{_prefix}/bin/%{_target_platform}-* +%{_prefix}/%{_target_platform}/bin/* +%{_prefix}/%{_target_platform}/lib/* +%if "%{target_cpu}" != "avr" +%if "%{target_cpu}" != "ppc" +%{_prefix}/%{_target_platform}/include/* +%endif +%endif +%{_mandir}/man1/%{_target_platform}* +%endif + +%changelog +* Fri May 02 2014 Silvan Calarco 2.24-2mamba +- build with --enable-plugins + +* Mon Dec 09 2013 Automatic Build System 2.24-1mamba +- automatic version update by autodist + +* Wed Mar 27 2013 Automatic Build System 2.23.2-1mamba +- automatic version update by autodist + +* Wed Nov 14 2012 Automatic Build System 2.23.1-1mamba +- automatic version update by autodist +- source edit: cross-*-ld: set %{target_platform}-ld alternatives for bfd/gold + +* Tue Oct 23 2012 Automatic Build System 2.23-1mamba +- automatic version update by autodist + +* Tue Jul 31 2012 Silvan Calarco 2.22-7mamba +- x86_64: add support for delayed-load feature required by valgrind 3.7.0 +- added gold cast patch ti fix gold build with gcc 4.7 +- alternatives: revert to bfd as default linker + +* Sun Apr 15 2012 Silvan Calarco 2.22-6mamba +- make %_bindir files symlink to /usr/%_host/bin +- move %{_prefix}/%{_host}/bin/* from libbinutils-devel to binutils +- change ld alternative destination from /usr/bin/ld to %{_prefix}/%{_host}/bin/ld + +* Mon Apr 02 2012 Silvan Calarco 2.22-5mamba +- rebuilt + +* Fri Mar 23 2012 Silvan Calarco 2.22-4mamba +- make symlinks instead of copies in %_bindir to platform bin directory + +* Sat Feb 18 2012 Silvan Calarco 2.22-3mamba +- install /usr/bin/ld alternative for ld.bfd and ld.gold (default: ld.gold) + +* Fri Jan 06 2012 Silvan Calarco 2.22-2mamba +- rebuilt with "--enable-gold=default --enable-ld" (i.e. switch to new gold linker as default) + +* Mon Nov 21 2011 Automatic Build System 2.22-1mamba +- automatic version update by autodist + +* Fri Aug 26 2011 Automatic Build System 2.21.1a-1mamba +- automatic version update by autodist + +* Sat Jul 16 2011 Automatic Build System 2.21.1-1mamba +- automatic update by autodist + +* Sun Dec 12 2010 Automatic Build System 2.21-1mamba +- automatic update to 2.21 by autodist + +* Fri Apr 16 2010 Silvan Calarco 2.20.1-2mamba +- use full target_platform in packages name +- added support for additional target arm-linux-eabi +- removed use on cross_platform_cpu, use more standard %_target_platform + +* Fri Mar 05 2010 Automatic Build System 2.20.1-1mamba +- automatic update to 2.20.1 by autodist + +* Sat Oct 17 2009 Automatic Build System 2.20-1mamba +- automatic update to 2.20 by autodist + +* Tue Feb 03 2009 Silvan Calarco 2.19.1-1mamba +- automatic update to 2.19.1 by autodist + +* Tue Oct 28 2008 Silvan Calarco 2.19-1mamba +- automatic update to 2.19 by autodist + +* Wed Nov 28 2007 Silvan Calarco 2.18-1mamba +- update to 2.18 + +* Thu Mar 08 2007 Silvan Calarco 2.17-3qilnx +- build for openmamba distribution + +* Fri Dec 29 2006 Silvan Calarco 2.17-2qilnx +- added x86_64 target + +* Wed Aug 30 2006 Silvan Calarco 2.17-1qilnx +- new version build +- add support for multilib with ARM + +* Sun Jun 11 2006 Silvan Calarco 2.16.93-1qilnx +- update to version 2.16.93 by autospec + +* Thu Jun 08 2006 Silvan Calarco 2.16.1-10qilnx +- rebuilt + +* Mon Sep 05 2005 Silvan Calarco 2.16.1-9qilnx +- add specific target symlink for host target + +* Sat Aug 27 2005 Silvan Calarco 2.16.1-8qilnx +- rebuilt with multime targets support for tools +- 64 bits support + +* Mon Aug 01 2005 Silvan Calarco 2.16.1-7qilnx +- cross builds: use /lib/ as additional native libdir + +* Tue Jul 22 2005 Silvan Calarco 2.16.1-6qilnx +- add correct cross target files in proper dirs (fixme: should be done automatically) + +* Tue Jul 21 2005 Silvan Calarco 2.16.1-5qilnx +- added support for --define='cross_target_cpu xxx' build option + +* Tue Jul 12 2005 Silvan Calarco 2.16.1-4qilnx +- added --target command line support for cross releases build + +* Fri Jul 08 2005 Davide Madrisan 2.16.1-3qilnx +- modified to support cross compilation + +* Wed Jun 15 2005 Davide Madrisan 2.16.1-2qilnx +- security fix QSA-2005-077 (CAN-2005-1704) + +* Wed Jun 15 2005 Davide Madrisan 2.16.1-1qilnx +- update to version 2.16.1 by autospec + +* Tue May 10 2005 Davide Madrisan 2.16-1qilnx +- update to version 2.16 by autospec +- added missing scripts + +* Tue Jun 29 2004 Silvan Calarco 2.15-2qilnx +- (re)added libiberty.a removed from gcc + +* Wed May 19 2004 Davide Madrisan 2.15-1qilnx +- new version rebuild + +* Mon Jun 16 2003 Silvan Calarco 2.14-1qilnx +- rebuild without c++filt (conflicting with gcc) +- build with gcc 3.2.3 + +* Thu Apr 18 2003 Alessandro Ramazzina 2.13.2.1-2qilnx +- rebuild after install modifications + +* Thu Apr 17 2003 Alessandro Ramazzina 2.13.2.1-1qilnx +- creation of binutils package