Merge remote-tracking branch 'up/master' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
commit
048b54dccd
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,3 +17,4 @@ build-sources
|
||||
/binutils-2.31.1.tar.xz
|
||||
/binutils-special-sections-in-groups.patch
|
||||
/binutils-2.32.tar.xz
|
||||
/binutils-2.33.1.tar.xz
|
||||
|
15
binutils-CVE-2019-1010204.patch
Normal file
15
binutils-CVE-2019-1010204.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100
|
||||
+++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100
|
||||
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
|
||||
ssize_t bytes;
|
||||
if (this->whole_file_view_ != NULL)
|
||||
{
|
||||
+ // See PR 23765 for an example of a testcase that triggers this error.
|
||||
+ if (((ssize_t) start) < 0)
|
||||
+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
|
||||
+ this->filename().c_str(),
|
||||
+ static_cast<long long>(start));
|
||||
+
|
||||
bytes = this->size_ - start;
|
||||
if (static_cast<section_size_type>(bytes) >= size)
|
||||
{
|
@ -1,110 +0,0 @@
|
||||
--- binutils.orig/libiberty/cp-demangle.c 2019-04-10 10:31:27.854997707 +0100
|
||||
+++ binutils-2.31.1/libiberty/cp-demangle.c 2019-04-10 16:00:35.820350978 +0100
|
||||
@@ -858,7 +858,7 @@ CP_STATIC_IF_GLIBCPP_V3
|
||||
int
|
||||
cplus_demangle_fill_name (struct demangle_component *p, const char *s, int len)
|
||||
{
|
||||
- if (p == NULL || s == NULL || len == 0)
|
||||
+ if (p == NULL || s == NULL || len <= 0)
|
||||
return 0;
|
||||
p->d_printing = 0;
|
||||
p->type = DEMANGLE_COMPONENT_NAME;
|
||||
@@ -4032,7 +4032,7 @@ d_growable_string_callback_adapter (cons
|
||||
are larger than the actual numbers encountered. */
|
||||
|
||||
static void
|
||||
-d_count_templates_scopes (int *num_templates, int *num_scopes,
|
||||
+d_count_templates_scopes (struct d_print_info *dpi,
|
||||
const struct demangle_component *dc)
|
||||
{
|
||||
if (dc == NULL)
|
||||
@@ -4052,13 +4052,13 @@ d_count_templates_scopes (int *num_templ
|
||||
break;
|
||||
|
||||
case DEMANGLE_COMPONENT_TEMPLATE:
|
||||
- (*num_templates)++;
|
||||
+ dpi->num_copy_templates++;
|
||||
goto recurse_left_right;
|
||||
|
||||
case DEMANGLE_COMPONENT_REFERENCE:
|
||||
case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
|
||||
if (d_left (dc)->type == DEMANGLE_COMPONENT_TEMPLATE_PARAM)
|
||||
- (*num_scopes)++;
|
||||
+ dpi->num_saved_scopes++;
|
||||
goto recurse_left_right;
|
||||
|
||||
case DEMANGLE_COMPONENT_QUAL_NAME:
|
||||
@@ -4122,42 +4122,42 @@ d_count_templates_scopes (int *num_templ
|
||||
case DEMANGLE_COMPONENT_TAGGED_NAME:
|
||||
case DEMANGLE_COMPONENT_CLONE:
|
||||
recurse_left_right:
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- d_left (dc));
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- d_right (dc));
|
||||
+ /* PR 89394 - Check for too much recursion. */
|
||||
+ if (dpi->recursion > DEMANGLE_RECURSION_LIMIT)
|
||||
+ /* FIXME: There ought to be a way to report to the
|
||||
+ user that the recursion limit has been reached. */
|
||||
+ return;
|
||||
+
|
||||
+ ++ dpi->recursion;
|
||||
+ d_count_templates_scopes (dpi, d_left (dc));
|
||||
+ d_count_templates_scopes (dpi, d_right (dc));
|
||||
+ -- dpi->recursion;
|
||||
break;
|
||||
|
||||
case DEMANGLE_COMPONENT_CTOR:
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- dc->u.s_ctor.name);
|
||||
+ d_count_templates_scopes (dpi, dc->u.s_ctor.name);
|
||||
break;
|
||||
|
||||
case DEMANGLE_COMPONENT_DTOR:
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- dc->u.s_dtor.name);
|
||||
+ d_count_templates_scopes (dpi, dc->u.s_dtor.name);
|
||||
break;
|
||||
|
||||
case DEMANGLE_COMPONENT_EXTENDED_OPERATOR:
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- dc->u.s_extended_operator.name);
|
||||
+ d_count_templates_scopes (dpi, dc->u.s_extended_operator.name);
|
||||
break;
|
||||
|
||||
case DEMANGLE_COMPONENT_FIXED_TYPE:
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- dc->u.s_fixed.length);
|
||||
+ d_count_templates_scopes (dpi, dc->u.s_fixed.length);
|
||||
break;
|
||||
|
||||
case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS:
|
||||
case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS:
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- d_left (dc));
|
||||
+ d_count_templates_scopes (dpi, d_left (dc));
|
||||
break;
|
||||
|
||||
case DEMANGLE_COMPONENT_LAMBDA:
|
||||
case DEMANGLE_COMPONENT_DEFAULT_ARG:
|
||||
- d_count_templates_scopes (num_templates, num_scopes,
|
||||
- dc->u.s_unary_num.sub);
|
||||
+ d_count_templates_scopes (dpi, dc->u.s_unary_num.sub);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4192,8 +4192,12 @@ d_print_init (struct d_print_info *dpi,
|
||||
dpi->next_copy_template = 0;
|
||||
dpi->num_copy_templates = 0;
|
||||
|
||||
- d_count_templates_scopes (&dpi->num_copy_templates,
|
||||
- &dpi->num_saved_scopes, dc);
|
||||
+ d_count_templates_scopes (dpi, dc);
|
||||
+ /* If we did not reach the recursion limit, then reset the
|
||||
+ current recursion value back to 0, so that we can print
|
||||
+ the templates. */
|
||||
+ if (dpi->recursion < DEMANGLE_RECURSION_LIMIT)
|
||||
+ dpi->recursion = 0;
|
||||
dpi->num_copy_templates *= dpi->num_saved_scopes;
|
||||
|
||||
dpi->current_template = NULL;
|
@ -1,13 +0,0 @@
|
||||
--- binutils.orig/binutils/objdump.c 2019-02-25 16:12:30.394056901 +0000
|
||||
+++ binutils-2.31.1/binutils/objdump.c 2019-02-25 16:13:07.224778005 +0000
|
||||
@@ -2993,7 +2993,9 @@ dump_bfd_header (bfd *abfd)
|
||||
static void
|
||||
dump_bfd_private_header (bfd *abfd)
|
||||
{
|
||||
- bfd_print_private_bfd_data (abfd, stdout);
|
||||
+ if (!bfd_print_private_bfd_data (abfd, stdout))
|
||||
+ non_fatal (_("warning: private headers incomplete: %s"),
|
||||
+ bfd_errmsg (bfd_get_error ()));
|
||||
}
|
||||
|
||||
static void
|
@ -1,32 +0,0 @@
|
||||
--- binutils.orig/bfd/pei-x86_64.c 2019-02-25 16:12:29.798061414 +0000
|
||||
+++ binutils-2.31.1/bfd/pei-x86_64.c 2019-02-25 17:09:02.783425236 +0000
|
||||
@@ -541,7 +541,7 @@ pex64_bfd_print_pdata_section (bfd *abfd
|
||||
/* virt_size might be zero for objects. */
|
||||
if (stop == 0 && strcmp (abfd->xvec->name, "pe-x86-64") == 0)
|
||||
{
|
||||
- stop = (datasize / onaline) * onaline;
|
||||
+ stop = datasize;
|
||||
virt_size_is_zero = TRUE;
|
||||
}
|
||||
else if (datasize < stop)
|
||||
@@ -551,8 +551,8 @@ pex64_bfd_print_pdata_section (bfd *abfd
|
||||
_("Warning: %s section size (%ld) is smaller than virtual size (%ld)\n"),
|
||||
pdata_section->name, (unsigned long) datasize,
|
||||
(unsigned long) stop);
|
||||
- /* Be sure not to read passed datasize. */
|
||||
- stop = datasize / onaline;
|
||||
+ /* Be sure not to read past datasize. */
|
||||
+ stop = datasize;
|
||||
}
|
||||
|
||||
/* Display functions table. */
|
||||
@@ -724,8 +724,7 @@ pex64_bfd_print_pdata_section (bfd *abfd
|
||||
altent += imagebase;
|
||||
|
||||
if (altent >= pdata_vma
|
||||
- && (altent + PDATA_ROW_SIZE <= pdata_vma
|
||||
- + pei_section_data (abfd, pdata_section)->virt_size))
|
||||
+ && altent - pdata_vma + PDATA_ROW_SIZE <= stop)
|
||||
{
|
||||
pex64_get_runtime_function
|
||||
(abfd, &arf, &pdata[altent - pdata_vma]);
|
@ -1,73 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/archive64.c binutils-2.31.1/bfd/archive64.c
|
||||
--- binutils.orig/bfd/archive64.c 2019-02-26 11:17:11.882530151 +0000
|
||||
+++ binutils-2.31.1/bfd/archive64.c 2019-02-26 11:19:18.422488805 +0000
|
||||
@@ -100,8 +100,6 @@ _bfd_archive_64_bit_slurp_armap (bfd *ab
|
||||
return FALSE;
|
||||
carsyms = ardata->symdefs;
|
||||
stringbase = ((char *) ardata->symdefs) + carsym_size;
|
||||
- stringbase[stringsize] = 0;
|
||||
- stringend = stringbase + stringsize;
|
||||
|
||||
raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize);
|
||||
if (raw_armap == NULL)
|
||||
@@ -115,15 +113,17 @@ _bfd_archive_64_bit_slurp_armap (bfd *ab
|
||||
goto release_raw_armap;
|
||||
}
|
||||
|
||||
+ stringend = stringbase + stringsize;
|
||||
+ *stringend = 0;
|
||||
for (i = 0; i < nsymz; i++)
|
||||
{
|
||||
carsyms->file_offset = bfd_getb64 (raw_armap + i * 8);
|
||||
carsyms->name = stringbase;
|
||||
- if (stringbase < stringend)
|
||||
- stringbase += strlen (stringbase) + 1;
|
||||
+ stringbase += strlen (stringbase);
|
||||
+ if (stringbase != stringend)
|
||||
+ ++stringbase;
|
||||
++carsyms;
|
||||
}
|
||||
- *stringbase = '\0';
|
||||
|
||||
ardata->symdef_count = nsymz;
|
||||
ardata->first_file_filepos = bfd_tell (abfd);
|
||||
diff -rup binutils.orig/bfd/archive.c binutils-2.31.1/bfd/archive.c
|
||||
--- binutils.orig/bfd/archive.c 2019-02-26 11:17:11.884530134 +0000
|
||||
+++ binutils-2.31.1/bfd/archive.c 2019-02-26 11:18:33.354859687 +0000
|
||||
@@ -1014,6 +1014,7 @@ do_slurp_coff_armap (bfd *abfd)
|
||||
int *raw_armap, *rawptr;
|
||||
struct artdata *ardata = bfd_ardata (abfd);
|
||||
char *stringbase;
|
||||
+ char *stringend;
|
||||
bfd_size_type stringsize;
|
||||
bfd_size_type parsed_size;
|
||||
carsym *carsyms;
|
||||
@@ -1073,22 +1074,20 @@ do_slurp_coff_armap (bfd *abfd)
|
||||
}
|
||||
|
||||
/* OK, build the carsyms. */
|
||||
- for (i = 0; i < nsymz && stringsize > 0; i++)
|
||||
+ stringend = stringbase + stringsize;
|
||||
+ *stringend = 0;
|
||||
+ for (i = 0; i < nsymz; i++)
|
||||
{
|
||||
bfd_size_type len;
|
||||
|
||||
rawptr = raw_armap + i;
|
||||
carsyms->file_offset = swap ((bfd_byte *) rawptr);
|
||||
carsyms->name = stringbase;
|
||||
- /* PR 17512: file: 4a1d50c1. */
|
||||
- len = strnlen (stringbase, stringsize);
|
||||
- if (len < stringsize)
|
||||
- len ++;
|
||||
- stringbase += len;
|
||||
- stringsize -= len;
|
||||
+ stringbase += strlen (stringbase);
|
||||
+ if (stringbase != stringend)
|
||||
+ ++stringbase;
|
||||
carsyms++;
|
||||
}
|
||||
- *stringbase = 0;
|
||||
|
||||
ardata->symdef_count = nsymz;
|
||||
ardata->first_file_filepos = bfd_tell (abfd);
|
@ -1,16 +0,0 @@
|
||||
--- binutils.orig/binutils/readelf.c 2019-02-26 11:17:12.414525772 +0000
|
||||
+++ binutils-2.31.1/binutils/readelf.c 2019-02-26 12:11:40.642876742 +0000
|
||||
@@ -16009,6 +16009,13 @@ process_mips_specific (Filedata * fileda
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ /* PR 24243 */
|
||||
+ if (sect->sh_size < sizeof (* eopt))
|
||||
+ {
|
||||
+ error (_("The MIPS options section is too small.\n"));
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
eopt = (Elf_External_Options *) get_data (NULL, filedata, options_offset, 1,
|
||||
sect->sh_size, _("options"));
|
||||
if (eopt)
|
@ -1,20 +0,0 @@
|
||||
--- binutils.orig/gold/aarch64.cc 2019-05-21 11:24:07.642560743 +0100
|
||||
+++ binutils-2.32/gold/aarch64.cc 2019-05-21 11:25:02.425157682 +0100
|
||||
@@ -6496,6 +6496,17 @@ Target_aarch64<size, big_endian>::Scan::
|
||||
gold_error(_("%s: unsupported reloc %u in pos independent link."),
|
||||
object->name().c_str(), r_type);
|
||||
}
|
||||
+ // Make a PLT entry if necessary.
|
||||
+ if (gsym->needs_plt_entry())
|
||||
+ {
|
||||
+ target->make_plt_entry(symtab, layout, gsym);
|
||||
+ // Since this is not a PC-relative relocation, we may be
|
||||
+ // taking the address of a function. In that case we need to
|
||||
+ // set the entry in the dynamic symbol table to the address of
|
||||
+ // the PLT entry.
|
||||
+ if (gsym->is_from_dynobj() && !parameters->options().shared())
|
||||
+ gsym->set_needs_dynsym_value();
|
||||
+ }
|
||||
break;
|
||||
|
||||
case elfcpp::R_AARCH64_LD_PREL_LO19: // 273
|
@ -1,39 +0,0 @@
|
||||
diff -rup binutils.orig/bfd/coffgen.c binutils-2.31.1/bfd/coffgen.c
|
||||
--- binutils.orig/bfd/coffgen.c 2019-03-06 08:49:19.500586870 +0000
|
||||
+++ binutils-2.31.1/bfd/coffgen.c 2019-03-06 08:49:45.798394582 +0000
|
||||
@@ -2289,7 +2289,7 @@ coff_find_nearest_line_with_names (bfd *
|
||||
information. So try again, using a bias against the address sought. */
|
||||
if (coff_data (abfd)->dwarf2_find_line_info != NULL)
|
||||
{
|
||||
- bfd_signed_vma bias;
|
||||
+ bfd_signed_vma bias = 0;
|
||||
|
||||
/* Create a cache of the result for the next call. */
|
||||
if (sec_data == NULL && section->owner == abfd)
|
||||
@@ -2301,10 +2301,11 @@ coff_find_nearest_line_with_names (bfd *
|
||||
|
||||
if (sec_data != NULL && sec_data->saved_bias)
|
||||
bias = sec_data->saved_bias;
|
||||
- else
|
||||
+ else if (symbols)
|
||||
{
|
||||
bias = _bfd_dwarf2_find_symbol_bias (symbols,
|
||||
& coff_data (abfd)->dwarf2_find_line_info);
|
||||
+
|
||||
if (sec_data)
|
||||
{
|
||||
sec_data->saved_bias = TRUE;
|
||||
Only in binutils-2.31.1/bfd: coffgen.c.orig
|
||||
diff -rup binutils.orig/bfd/dwarf2.c binutils-2.31.1/bfd/dwarf2.c
|
||||
--- binutils.orig/bfd/dwarf2.c 2019-03-06 08:49:19.498586884 +0000
|
||||
+++ binutils-2.31.1/bfd/dwarf2.c 2019-03-06 08:49:45.799394575 +0000
|
||||
@@ -4463,7 +4463,7 @@ _bfd_dwarf2_find_symbol_bias (asymbol **
|
||||
|
||||
stash = (struct dwarf2_debug *) *pinfo;
|
||||
|
||||
- if (stash == NULL)
|
||||
+ if (stash == NULL || symbols == NULL)
|
||||
return 0;
|
||||
|
||||
for (unit = stash->all_comp_units; unit; unit = unit->next_unit)
|
||||
Only in binutils-2.31.1/bfd: dwarf2.c.orig
|
@ -8,16 +8,6 @@ diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-12.d binutils-2.32/ld/testsuite/ld-plugin/plugin-12.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-12.d 2019-02-15 13:33:21.976627309 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-12.d 2019-02-15 13:47:04.060076132 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
#...
|
||||
-.*: symbol `func' definition: 0, visibility: 0, resolution: 2
|
||||
+.*: symbol `func' definition: 0, visibility: 0, resolution: .
|
||||
.*: symbol `func1' definition: 0, visibility: 1, resolution: 3
|
||||
.*: symbol `func2' definition: 0, visibility: 2, resolution: 3
|
||||
.*: symbol `func3' definition: 0, visibility: 3, resolution: 3
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:33:21.980627277 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:41:30.189692800 +0000
|
||||
@ -289,20 +279,6 @@ diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.32/ld
|
||||
+#...
|
||||
hook called: cleanup.
|
||||
#...
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-12.d binutils-2.32/ld/testsuite/ld-plugin/plugin-12.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-12.d 2019-02-15 14:10:58.912710532 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-12.d 2019-02-15 14:13:18.464583848 +0000
|
||||
@@ -1,6 +1,6 @@
|
||||
#...
|
||||
-.*: symbol `func' definition: 0, visibility: 0, resolution: .
|
||||
-.*: symbol `func1' definition: 0, visibility: 1, resolution: 3
|
||||
-.*: symbol `func2' definition: 0, visibility: 2, resolution: 3
|
||||
-.*: symbol `func3' definition: 0, visibility: 3, resolution: 3
|
||||
+.*: symbol `_?func' definition: 0, visibility: 0, resolution: .
|
||||
+.*: symbol `_?func1' definition: 0, visibility: 1, resolution: 3
|
||||
+.*: symbol `_?func2' definition: 0, visibility: 2, resolution: 3
|
||||
+.*: symbol `_?func3' definition: 0, visibility: 3, resolution: 3
|
||||
#pass
|
||||
diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d
|
||||
--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:10:58.942710289 +0000
|
||||
+++ binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:15:20.030602369 +0000
|
||||
|
36
binutils-gold-mismatched-section-flags.patch
Normal file
36
binutils-gold-mismatched-section-flags.patch
Normal file
@ -0,0 +1,36 @@
|
||||
diff -rup binutils.orig/gold/layout.cc binutils-2.32/gold/layout.cc
|
||||
--- binutils.orig/gold/layout.cc 2019-06-24 14:37:36.013086899 +0100
|
||||
+++ binutils-2.32/gold/layout.cc 2019-06-24 14:41:40.054517479 +0100
|
||||
@@ -868,6 +868,7 @@ Layout::get_output_section(const char* n
|
||||
&& (same_name->flags() & elfcpp::SHF_TLS) == 0)
|
||||
os = same_name;
|
||||
}
|
||||
+#if 0 /* BZ 1722715, PR 17556. */
|
||||
else if ((flags & elfcpp::SHF_TLS) == 0)
|
||||
{
|
||||
elfcpp::Elf_Xword zero_flags = 0;
|
||||
@@ -878,6 +879,7 @@ Layout::get_output_section(const char* n
|
||||
if (p != this->section_name_map_.end())
|
||||
os = p->second;
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
if (os == NULL)
|
||||
diff -rup binutils.orig/gold/object.cc binutils-2.32/gold/object.cc
|
||||
--- binutils.orig/gold/object.cc 2019-06-24 14:37:36.012086906 +0100
|
||||
+++ binutils-2.32/gold/object.cc 2019-06-24 14:39:59.287165501 +0100
|
||||
@@ -1644,6 +1644,13 @@ Sized_relobj_file<size, big_endian>::do_
|
||||
omit[i] = true;
|
||||
}
|
||||
|
||||
+ // Skip empty sections without flags.
|
||||
+ if (!(shdr.get_sh_flags() & ~elfcpp::SHF_GROUP)
|
||||
+ && !shdr.get_sh_size())
|
||||
+ {
|
||||
+ omit[i] = true;
|
||||
+ }
|
||||
+
|
||||
bool discard = omit[i];
|
||||
if (!discard)
|
||||
{
|
1865
binutils-improved-note-merging.patch
Normal file
1865
binutils-improved-note-merging.patch
Normal file
File diff suppressed because it is too large
Load Diff
207
binutils.spec
207
binutils.spec
@ -1,35 +1,62 @@
|
||||
|
||||
Summary: A GNU collection of binary utilities
|
||||
Name: %{?cross}binutils%{?_with_debug:-debug}
|
||||
Version: 2.33.1
|
||||
Release: 3%{?dist}
|
||||
License: GPLv3+
|
||||
URL: https://sourceware.org/binutils
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# Binutils SPEC file. Can be invoked with the following parameters:
|
||||
|
||||
# --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils.
|
||||
# --with=bootstrap: Build with minimal dependencies.
|
||||
# --with=debug: Build without optimizations and without splitting the debuginfo.
|
||||
# --without=docs: Skip building documentation.
|
||||
# --without=testsuite: Do not run the testsuite. Default is to run it.
|
||||
# --with=testsuite: Run the testsuite. Default when --with=debug is not to run it.
|
||||
# --with=bootstrap Build with minimal dependencies.
|
||||
# --with=debug Build without optimizations and without splitting
|
||||
# the debuginfo into a separate file.
|
||||
# --without=docs Skip building documentation.
|
||||
# --without=testsuite Do not run the testsuite. Default is to run it.
|
||||
# --with=testsuite Run the testsuite. Default when --with=debug is not
|
||||
# to run it.
|
||||
# --without=gold Disable building of the GOLD linker.
|
||||
|
||||
#---Start of Configure Options-----------------------------------------------
|
||||
|
||||
# Do not create deterministic archives by default (cf: BZ 1195883)
|
||||
# Use clang as the build time compiler rather than gcc.
|
||||
%define build_using_clang 0
|
||||
|
||||
# Create deterministic archives (ie ones without timestamps).
|
||||
# Default is off because of BZ 1195883.
|
||||
%define enable_deterministic_archives 0
|
||||
|
||||
# Enable support for GCC LTO compilation.
|
||||
# Disable if it is necessary to work around bugs in LTO.
|
||||
%define enable_lto 1
|
||||
|
||||
# Disable the default generation of compressed debug sections.
|
||||
# Enable the compression of debug sections as default behaviour of the
|
||||
# assembler and linker. This option is disabled for now. The assembler and
|
||||
# linker have command line options to override the default behaviour.
|
||||
%define default_compress_debug 0
|
||||
|
||||
# Default to read-only-relocations (relro) in shared binaries.
|
||||
# This is enabled as a security feature.
|
||||
%define default_relro 1
|
||||
|
||||
# Disable the default generation of GNU Build notes by the assembler.
|
||||
# This has turned out to be problematic for the i686 architecture.
|
||||
# although the exact reason has not been determined. (See BZ 1572485)
|
||||
# It also breaks building EFI binaries on AArch64, as these cannot have
|
||||
# relocations against absolute symbols.
|
||||
# Enable the default generation of GNU Build notes by the assembler.
|
||||
# This option is disabled as it has turned out to be problematic for the i686
|
||||
# architecture, although the exact reason has not been determined. (See
|
||||
# BZ 1572485). It also breaks building EFI binaries on AArch64, as these
|
||||
# cannot have relocations against absolute symbols.
|
||||
%define default_generate_notes 0
|
||||
|
||||
# Use "--without gold" to exclude the gold linker.
|
||||
# The default is to include it.
|
||||
# Enable thread support in the GOLD linker (if it is being built). This is
|
||||
# particularly important if plugins to the linker intend to use threads
|
||||
# themselves. See BZ 1636479 for more details. This option is made
|
||||
# configurable in case there is ever a need to disable thread support.
|
||||
%define enable_threading 1
|
||||
|
||||
#----End of Configure Options------------------------------------------------
|
||||
|
||||
# Note - in the future the gold linker may become deprecated.
|
||||
%ifnarch riscv64
|
||||
%bcond_without gold
|
||||
@ -38,14 +65,6 @@
|
||||
%bcond_with gold
|
||||
%endif
|
||||
|
||||
# Enable thread support in the GOLD linker. This is particularly
|
||||
# important if plugins to the linker intend to use threads themselves.
|
||||
# See BZ 1636479 for more details. This option is made configurable
|
||||
# in case there is ever a need to disable thread support.
|
||||
%define enable_threading 1
|
||||
|
||||
#----End of Configure Options------------------------------------------------
|
||||
|
||||
# Default: Not bootstrapping.
|
||||
%bcond_with bootstrap
|
||||
# Default: Not debug
|
||||
@ -82,13 +101,6 @@
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
Summary: A GNU collection of binary utilities
|
||||
Name: %{?cross}binutils%{?_with_debug:-debug}
|
||||
Version: 2.32
|
||||
Release: 14.0.riscv64%{?dist}
|
||||
License: GPLv3+
|
||||
URL: https://sourceware.org/binutils
|
||||
|
||||
# Note - the Linux Kernel binutils releases are too unstable and contain
|
||||
# too many controversial patches so we stick with the official FSF version
|
||||
# instead.
|
||||
@ -171,45 +183,30 @@ Patch10: binutils-attach-to-group.patch
|
||||
|
||||
# Purpose: Stop gold from complaining about relocs in the .gnu.build.attribute
|
||||
# section that reference symbols in discarded sections.
|
||||
# Lifetime: Fixed in 2.33 (maybe)
|
||||
# Lifetime: Fixed in 2.34 (maybe)
|
||||
Patch11: binutils-gold-ignore-discarded-note-relocs.patch
|
||||
|
||||
# Purpose: Allow OS specific sections in section groups.
|
||||
# Lifetime: Might be fixed in 2.33
|
||||
# Lifetime: Might be fixed in 2.34 (maybe)
|
||||
Patch12: binutils-special-sections-in-groups.patch
|
||||
|
||||
# Purpose: Fix linker testsuite failures.
|
||||
# Lifetime: Fixed in 2.33 (possibly)
|
||||
# Lifetime: Fixed in 2.34 (maybe)
|
||||
Patch13: binutils-fix-testsuite-failures.patch
|
||||
|
||||
# Purpose: Improve objdump's handling of corrupt input files.
|
||||
# Lifetime: Fixed in 2.33
|
||||
Patch14: binutils-CVE-2019-9073.patch
|
||||
# Purpose: Stop gold from aborting when input sections with the same name
|
||||
# have different flags.
|
||||
# Lifetime: Fixed in 2.34 (maybe)
|
||||
Patch14: binutils-gold-mismatched-section-flags.patch
|
||||
|
||||
# Purpose: Stop illegal memory access parsing corrupt PE files.
|
||||
# Lifetime: Fixed in 2.33
|
||||
Patch15: binutils-CVE-2019-9074.patch
|
||||
# Purpose: Add a check to the GOLD linker for a corrupt input file
|
||||
# with a fuzzed section offset.
|
||||
# Lifetime: Fixed in 2.34 (maybe)
|
||||
Patch15: binutils-CVE-2019-1010204.patch
|
||||
|
||||
# Purpose: Stop illegal memory access parsing corrupt archives.
|
||||
# Lifetime: Fixed in 2.33
|
||||
Patch16: binutils-CVE-2019-9075.patch
|
||||
|
||||
# Purpose: Stop illegal memory access parsing a corrupt MIPS binary.
|
||||
# Lifetime: Fixed in 2.33
|
||||
Patch17: binutils-CVE-2019-9077.patch
|
||||
|
||||
# Purpose: Stop a seg-fault when disassembling an EFI binary.
|
||||
# Lifetime: Fixed in 2.33
|
||||
Patch18: binutils-disassembling-efi-files.patch
|
||||
|
||||
# Purpose: Fix a stack exhaustion problem in libiberty's name demangling code.
|
||||
# Lifetime: Fixed in 2.33
|
||||
Patch19: binutils-CVE-2019-9071.patch
|
||||
|
||||
# Purpose: Have the GOLD linker for AArch64 generate PLT entries for MOVW_ABS
|
||||
# relocations if necessary.
|
||||
# Lifetime: Fixed in 2.33
|
||||
Patch20: binutils-aarch64-gold-PLT-for-MOVW_ABS.patch
|
||||
# Purpose: Improve objdump's ability to merge GNU build attribute notes.
|
||||
# Lifetime: Fixed in 2.34
|
||||
Patch16: binutils-improved-note-merging.patch
|
||||
|
||||
# Purpose: Fix object files without ELF headers on RISC-V
|
||||
# Lifetime: Fixed in master (2.33)
|
||||
@ -237,7 +234,13 @@ Requires: binutils-gold >= %{version}
|
||||
%endif
|
||||
|
||||
# Perl, sed and touch are all used in the %%prep section of this spec file.
|
||||
BuildRequires: gcc, perl, sed, coreutils
|
||||
BuildRequires: perl, sed, coreutils
|
||||
|
||||
%if %{build_using_clang}
|
||||
BuildRequires: clang
|
||||
%else
|
||||
BuildRequires: gcc
|
||||
%endif
|
||||
|
||||
%if %{without bootstrap}
|
||||
BuildRequires: gettext, flex, zlib-devel
|
||||
@ -329,12 +332,15 @@ BuildRequires: bison, m4, gcc-c++
|
||||
# The GOLD testsuite needs a static libc++
|
||||
BuildRequires: libstdc++-static
|
||||
|
||||
%if ! %{build_using_clang}
|
||||
BuildRequires: gcc-c++
|
||||
Conflicts: gcc-c++ < 4.0.0
|
||||
%endif
|
||||
|
||||
# The higher of these two numbers determines the default ld.
|
||||
%{!?ld_gold_priority:%global ld_gold_priority 30}
|
||||
|
||||
%endif # with gold
|
||||
%endif %%# with gold
|
||||
|
||||
%{!?ld_bfd_priority: %global ld_bfd_priority 50}
|
||||
|
||||
@ -358,10 +364,6 @@ Conflicts: gcc-c++ < 4.0.0
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
|
||||
%patch25 -p1
|
||||
|
||||
@ -407,6 +409,11 @@ touch */configure
|
||||
%build
|
||||
echo target is %{binutils_target}
|
||||
|
||||
%if %{build_using_clang}
|
||||
# Clang does not support the -fstack-clash-protection option.
|
||||
%global optflags %(echo %{optflags} | sed 's/-fstack-clash-protection//')
|
||||
%endif
|
||||
|
||||
%ifarch %{power64}
|
||||
export CFLAGS="$RPM_OPT_FLAGS -Wno-error"
|
||||
%else
|
||||
@ -462,6 +469,10 @@ export LDFLAGS=$RPM_LD_FLAGS
|
||||
# We could optimize the cross builds size by --enable-shared but the produced
|
||||
# binaries may be less convenient in the embedded environment.
|
||||
%configure \
|
||||
%if %{build_using_clang}
|
||||
CC=clang \
|
||||
CXX=clang++ \
|
||||
%endif
|
||||
--quiet \
|
||||
--build=%{_target_platform} --host=%{_target_platform} \
|
||||
--target=%{binutils_target} \
|
||||
@ -723,7 +734,8 @@ exit 0
|
||||
%license COPYING COPYING3 COPYING3.LIB COPYING.LIB
|
||||
%doc README
|
||||
%{_bindir}/%{?cross}[!l]*
|
||||
%{_bindir}/%{?cross}ld
|
||||
# %%verify(symlink) does not work for some reason, so using "owner" instead.
|
||||
%verify(owner) %{_bindir}/%{?cross}ld
|
||||
%{_bindir}/%{?cross}ld.bfd
|
||||
|
||||
%if %{with docs}
|
||||
@ -760,8 +772,69 @@ exit 0
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
%changelog
|
||||
* Thu Jun 20 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> - 2.32-14.0.riscv64
|
||||
- Backport fix for binary objects without ELF headers flags set on RISC-V
|
||||
* Wed Oct 30 2019 Nick Clifton <nickc@redhat.com> - 2.33-3
|
||||
- Fix the verification of the installed linker symlink. (#1767000)
|
||||
|
||||
* Mon Oct 28 2019 Nick Clifton <nickc@redhat.com> - 2.33-2
|
||||
- Improve objdump's ability to merge GNU build attribute notes.
|
||||
|
||||
* Mon Oct 14 2019 Nick Clifton <nickc@redhat.com> - 2.33-1
|
||||
- Rebase to GNU Binutils 2.33.1.
|
||||
- Retire: binutils-CVE-2019-9073.patch
|
||||
- Retire: binutils-CVE-2019-9074.patch
|
||||
- Retire: binutils-CVE-2019-9075.patch
|
||||
- Retire: binutils-CVE-2019-9077.patch
|
||||
- Retire: binutils-disassembling-efi-files.patch
|
||||
- Retire: binutils-CVE-2019-9071.patch
|
||||
- Retire: binutils-gas-build-note-relocs.patch
|
||||
- Retire: binutils-do-not-warn-about-debuginfo-files.patch
|
||||
- Retire: binutils-do-not-merge-differing-SHF_EXCLUDE-groups.patch
|
||||
- Retire: binutils-rh1736114.patch
|
||||
- Retire: binutils-objcopy-gnu-build-version-notes.patch
|
||||
- Retire: binutils-CVE-2019-14250.patch
|
||||
- Retire: binutils-CVE-2019-14444.patch
|
||||
- Retire: binutils-gcc-10-fixes.patch
|
||||
- Retire: binutils-remove-old-formats.patch
|
||||
- Retire: binutils-aarch64-gold-PLT-for-MOVW_ABS.patch
|
||||
|
||||
* Fri Oct 04 2019 Nick Clifton <nickc@redhat.com> - 2.32-27
|
||||
- Remove support for old file formats (ihex, tekhex, verilog) as they are a constant source of CVEs.
|
||||
|
||||
* Wed Sep 25 2019 Nick Clifton <nickc@redhat.com> - 2.32-26
|
||||
- Add an option to build using clang instead of gcc.
|
||||
|
||||
* Tue Sep 24 2019 Nick Clifton <nickc@redhat.com> - 2.32-25
|
||||
- Fix building with gcc-10.
|
||||
|
||||
* Tue Aug 13 2019 Nick Clifton <nickc@redhat.com> - 2.32-24
|
||||
- Fix potential integer overflow in readelf. (#1740470)
|
||||
|
||||
* Fri Aug 09 2019 Nick Clifton <nickc@redhat.com> - 2.32-23
|
||||
- Fix potential integer overflow in GOLD. (#1739491)
|
||||
|
||||
* Tue Aug 06 2019 Nick Clifton <nickc@redhat.com> - 2.32-22
|
||||
- Stop GOLD from seg-faulting on a corrupt input with a fuzzed section offset. (#1735605)
|
||||
|
||||
* Mon Aug 05 2019 Nick Clifton <nickc@redhat.com> - 2.32-21
|
||||
- Stop strip from complaining if the first build note is not a version note. (#1736114)
|
||||
|
||||
* Fri Aug 2 2019 Florian Weimer <fweimer@redhat.com> - 2.32-20
|
||||
- Fix ld -Map not to produce corrupt ELF notes (#1736114)
|
||||
|
||||
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.32-19
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Mon Jul 22 2019 Nick Clifton <nickc@redhat.com> - 2.32-18
|
||||
- Stops the linker from merging section groups with different SHF_EXCLUDE flags. (#1730906)
|
||||
|
||||
* Tue Jul 02 2019 Nick Clifton <nickc@redhat.com> - 2.32-17
|
||||
- Stop the BFD library from complaining about sections found inside debuginfo files. (PR 24717)
|
||||
|
||||
* Mon Jul 01 2019 Nick Clifton <nickc@redhat.com> - 2.32-16
|
||||
- Stop gas from triggering a seg-fault when creating relocs for build notes. (PR 24748)
|
||||
|
||||
* Mon Jun 24 2019 Nick Clifton <nickc@redhat.com> - 2.32-15
|
||||
- Stop gold from aborting when it encounters input sections with the same name and different flags. (#1722715)
|
||||
|
||||
* Tue May 21 2019 Nick Clifton <nickc@redhat.com> - 2.32-14
|
||||
- Import fix for PR 23870 in order to help building Go binaries.
|
||||
|
2
sources
2
sources
@ -1,2 +1,2 @@
|
||||
SHA512 (binutils-2.32.tar.xz) = d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a
|
||||
SHA512 (binutils-2.33.1.tar.xz) = b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac
|
||||
SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2
|
||||
|
Loading…
Reference in New Issue
Block a user