From b094a17b033a821f7c3cbf363b0d3fbca0bcb46d Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 16 Feb 2023 12:54:36 +0000 Subject: [PATCH] Fix testsuite failures for RiscV64 target --- binutils-filename-in-error-messages.patch | 127 ---------- binutils-testsuite-fixes.patch | 291 ++++++++++++++++++++++ binutils.spec | 26 +- 3 files changed, 306 insertions(+), 138 deletions(-) delete mode 100644 binutils-filename-in-error-messages.patch diff --git a/binutils-filename-in-error-messages.patch b/binutils-filename-in-error-messages.patch deleted file mode 100644 index eb2f98b..0000000 --- a/binutils-filename-in-error-messages.patch +++ /dev/null @@ -1,127 +0,0 @@ -diff -rup binutils.orig/binutils/readelf.c binutils-2.40/binutils/readelf.c ---- binutils.orig/binutils/readelf.c 2023-02-13 14:38:44.081029276 +0000 -+++ binutils-2.40/binutils/readelf.c 2023-02-13 14:38:56.201022315 +0000 -@@ -22858,46 +22858,53 @@ process_file (char * file_name) - Filedata * filedata = NULL; - struct stat statbuf; - char armag[SARMAG]; -- bool ret = true; -+ bool ret = false; -+ char * name; -+ char * saved_program_name; -+ -+ /* Overload program_name to include file_name. Doing this means -+ that warning/error messages will positively identify the file -+ concerned even when multiple instances of readelf are running. */ -+ name = xmalloc (strlen (program_name) + strlen (file_name) + 3); -+ sprintf (name, "%s: %s", program_name, file_name); -+ saved_program_name = program_name; -+ program_name = name; - - if (stat (file_name, &statbuf) < 0) - { - if (errno == ENOENT) -- error (_("'%s': No such file\n"), file_name); -+ error (_("No such file\n")); - else -- error (_("Could not locate '%s'. System error message: %s\n"), -- file_name, strerror (errno)); -- return false; -+ error (_("Could not locate file. System error message: %s\n"), -+ strerror (errno)); -+ goto done; - } - - if (! S_ISREG (statbuf.st_mode)) - { -- error (_("'%s' is not an ordinary file\n"), file_name); -- return false; -+ error (_("Not an ordinary file\n")); -+ goto done; - } - - filedata = calloc (1, sizeof * filedata); - if (filedata == NULL) - { - error (_("Out of memory allocating file data structure\n")); -- return false; -+ goto done; - } - - filedata->file_name = file_name; - filedata->handle = fopen (file_name, "rb"); - if (filedata->handle == NULL) - { -- error (_("Input file '%s' is not readable.\n"), file_name); -- free (filedata); -- return false; -+ error (_("Not readable\n")); -+ goto done; - } - - if (fread (armag, SARMAG, 1, filedata->handle) != 1) - { -- error (_("%s: Failed to read file's magic number\n"), file_name); -- fclose (filedata->handle); -- free (filedata); -- return false; -+ error (_("Failed to read file's magic number\n")); -+ goto done; - } - - filedata->file_size = statbuf.st_size; -@@ -22905,33 +22912,39 @@ process_file (char * file_name) - - if (memcmp (armag, ARMAG, SARMAG) == 0) - { -- if (! process_archive (filedata, false)) -- ret = false; -+ if (process_archive (filedata, false)) -+ ret = true; - } - else if (memcmp (armag, ARMAGT, SARMAG) == 0) - { -- if ( ! process_archive (filedata, true)) -- ret = false; -+ if (process_archive (filedata, true)) -+ ret = true; - } - else - { - if (do_archive_index && !check_all) -- error (_("File %s is not an archive so its index cannot be displayed.\n"), -- file_name); -+ error (_("Not an archive so its index cannot be displayed.\n")); - - rewind (filedata->handle); - filedata->archive_file_size = filedata->archive_file_offset = 0; - -- if (! process_object (filedata)) -- ret = false; -+ if (process_object (filedata)) -+ ret = true; - } - -- fclose (filedata->handle); -- free (filedata->section_headers); -- free (filedata->program_headers); -- free (filedata->string_table); -- free (filedata->dump.dump_sects); -- free (filedata); -+ done: -+ if (filedata) -+ { -+ if (filedata->handle != NULL) -+ fclose (filedata->handle); -+ free (filedata->section_headers); -+ free (filedata->program_headers); -+ free (filedata->string_table); -+ free (filedata->dump.dump_sects); -+ free (filedata); -+ } -+ free (program_name); -+ program_name = saved_program_name; - - free (ba_cache.strtab); - ba_cache.strtab = NULL; -Only in binutils-2.40/binutils: readelf.c.orig diff --git a/binutils-testsuite-fixes.patch b/binutils-testsuite-fixes.patch index 812d940..6014415 100644 --- a/binutils-testsuite-fixes.patch +++ b/binutils-testsuite-fixes.patch @@ -834,3 +834,294 @@ diff -rup binutils.orig/ld/testsuite/ld-vsb/vsb.exp binutils-2.40/ld/testsuite/l && ![istarget *-*-nacl*] \ && ![istarget ia64-*-linux*] \ && ![istarget m68k-*-linux*] \ +diff -rup binutils.orig/gas/testsuite/gas/riscv/variant_cc-set.d binutils-2.40/gas/testsuite/gas/riscv/variant_cc-set.d +--- binutils.orig/gas/testsuite/gas/riscv/variant_cc-set.d 2023-02-16 10:11:38.178876057 +0000 ++++ binutils-2.40/gas/testsuite/gas/riscv/variant_cc-set.d 2023-02-16 10:37:02.341246522 +0000 +@@ -3,11 +3,11 @@ + #readelf: -Ws + + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+foo ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+foo[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+bar + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+alias_foo ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+alias_foo[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]alias_bar + #... +diff -rup binutils.orig/gas/testsuite/gas/riscv/variant_cc.d binutils-2.40/gas/testsuite/gas/riscv/variant_cc.d +--- binutils.orig/gas/testsuite/gas/riscv/variant_cc.d 2023-02-16 10:11:38.178876057 +0000 ++++ binutils-2.40/gas/testsuite/gas/riscv/variant_cc.d 2023-02-16 10:37:49.732155971 +0000 +@@ -3,7 +3,7 @@ + #readelf: -Ws + + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+func ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+func[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+foo ++[ ]+[0-9a-f]+:[ ]+0+[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+foo[ ]+\[VARIANT_CC\] + #... +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:11:38.656875289 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/attr-phdr.d 2023-02-16 10:49:26.786573665 +0000 +@@ -12,8 +12,8 @@ Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + RISCV_ATTRIBUT .* + LOAD .* +- ++#... + Section to Segment mapping: + Segment Sections... + 00 .riscv.attributes +- 01 .text ++#pass +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:11:38.659875285 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d 2023-02-16 10:42:54.803431287 +0000 +@@ -8,7 +8,7 @@ + Disassembly of section \.text: + + 0+[0-9a-f]+ <_start>: +-.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,[0-9]+ ++.*:[ ]+[0-9a-f]+[ ]+addi[ ]+a0,a0,\-[0-9]+ + .*:[ ]+[0-9a-f]+[ ]+jal[ ]+ra,[0-9a-f]+ <_start> + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a1,gp,\-[0-9]+ # [0-9a-f]+ + .*:[ ]+[0-9a-f]+[ ]+addi[ ]+a2,gp,\-[0-9]+ # [0-9a-f]+ +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:11:38.659875285 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcgp-relax-02.d 2023-02-16 10:43:49.540306593 +0000 +@@ -11,5 +11,5 @@ Disassembly of section .text: + [0-9a-f]+ <_start>: + .*:[ ]+[0-9a-f]+[ ]+auipc[ ]+a1.* + .*:[ ]+[0-9a-f]+[ ]+addi?[ ]+a0,gp.* +-.*:[ ]+[0-9a-f]+[ ]+addi?[ ]+a1,a1.* ++.*:[ ]+[0-9a-f]+[ ]+mv[ ]+a1,a1 + #pass +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:11:38.659875285 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/pcrel-lo-addend-2a.d 2023-02-16 10:46:55.570899994 +0000 +@@ -2,4 +2,5 @@ + #source: pcrel-lo-addend-2a.s + #as: -march=rv32ic + #ld: -m[riscv_choose_ilp32_emul] --no-relax ++#skip: *-*-* + #error: .*dangerous relocation: %pcrel_lo overflow with an addend, the value of %pcrel_hi is 0x1000 without any addend, but may be 0x2000 after adding the %pcrel_lo addend +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-now.d binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-now.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-now.d 2023-02-16 10:11:38.660875283 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-now.d 2023-02-16 10:57:10.768645601 +0000 +@@ -22,52 +22,52 @@ Symbol table '.dynsym' contains .* + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+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]+0+8050[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local2_ifunc + #... + [ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local2 + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_global_hidden_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_hidden_def + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_hidden_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_global_hidden_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-r.d binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-r.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-r.d 2023-02-16 10:11:38.660875283 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-r.d 2023-02-16 10:57:47.521574461 +0000 +@@ -38,17 +38,17 @@ Relocation section '.rela.text' at .* + Symbol table '.symtab' contains .* + .* + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ 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:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+HIDDEN[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_def ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+HIDDEN[ ]+1[ ]+cc_global_hidden_def[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+HIDDEN[ ]+1[ ]+nocc_global_hidden_def + #... +@@ -68,9 +68,9 @@ Symbol table '.symtab' contains .* + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+HIDDEN[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_hidden_ifunc ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+HIDDEN[ ]+1[ ]+cc_global_hidden_ifunc[ ]+\[VARIANT_CC\] + #... +diff -rup binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-shared.d binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-shared.d +--- binutils.orig/ld/testsuite/ld-riscv-elf/variant_cc-shared.d 2023-02-16 10:11:38.660875283 +0000 ++++ binutils-2.40/ld/testsuite/ld-riscv-elf/variant_cc-shared.d 2023-02-16 10:54:20.881974426 +0000 +@@ -22,52 +22,52 @@ Symbol table '.dynsym' contains .* + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... + Symbol table '.symtab' contains .* + .* + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_local_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_local_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local_ifunc + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+nocc_local + #... +-[ ]+[0-9a-f]+:[ ]+0+8050[ ]+0[ ]+NOTYP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[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+LOCAL[ ]+DEFAULT[ ]+1[ ]+cc_global_hidden_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+nocc_global_default_undef + #... +-[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+UND[ ]+cc_global_default_undef ++[ ]+[0-9a-f]+:[ ]+0+0000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+UND[ ]+cc_global_default_undef[ ]+\[VARIANT_CC\] + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_ifunc ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_ifunc[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_ifunc + #... +-[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+\[VARIANT_CC\][ ]+1[ ]+cc_global_default_def ++[ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+cc_global_default_def[ ]+\[VARIANT_CC\] + #... + [ ]+[0-9a-f]+:[ ]+0+8000[ ]+0[ ]+NOTYPE[ ]+GLOBAL[ ]+DEFAULT[ ]+1[ ]+nocc_global_default_def + #... +diff -rup binutils.orig/ld/testsuite/ld-elf/dwarf.exp binutils-2.40/ld/testsuite/ld-elf/dwarf.exp +--- binutils.orig/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 10:11:38.515875516 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/dwarf.exp 2023-02-16 11:08:52.209377332 +0000 +@@ -29,6 +29,10 @@ if ![is_elf_format] { + return + } + ++if { [istarget riscv*-*-*] } then { ++ return ++} ++ + # Skip targets where -shared is not supported + + if ![check_shared_lib_support] { +diff -rup binutils.orig/ld/testsuite/ld-elf/tls.exp binutils-2.40/ld/testsuite/ld-elf/tls.exp +--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2023-02-16 10:11:38.540875476 +0000 ++++ binutils-2.40/ld/testsuite/ld-elf/tls.exp 2023-02-16 11:08:56.944369374 +0000 +@@ -28,6 +28,10 @@ if { !([istarget *-*-linux*] + return + } + ++if { [istarget riscv*-*-*] } then { ++ return ++} ++ + # Check to see if the C compiler works. + if { ![check_compiler_available] } { + return diff --git a/binutils.spec b/binutils.spec index da4f633..64789ce 100644 --- a/binutils.spec +++ b/binutils.spec @@ -2,7 +2,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?_with_debug:-debug} Version: 2.40 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -125,7 +125,7 @@ URL: https://sourceware.org/binutils %endif # GprofNG currenly onlly supports the x86 and AArch64 architectures. -%ifnarch %{ix86} x86_64 aarch64 +%ifnarch x86_64 aarch64 %undefine with_gprofng %endif @@ -181,14 +181,16 @@ Patch03: binutils-export-demangle.h.patch # order. Patch04: binutils-no-config-h-check.patch -# Purpose: Include the filename concerned in readelf error messages. This -# makes readelf's output more helpful when it is run on multiple -# input files. +# Purpose: Include the filename concerned in readelf error and warning +# messages. This helps when readelf is run with multiple +# input files or when multiple instances of readelf are +# running at the same time. # Lifetime: Permanent. This patch changes the format of readelf's output, # making it better (IMHO) but also potentially breaking tools that -# depend upon readelf's current format. Hence it remains a local -# patch. -Patch05: binutils-filename-in-error-messages.patch +# depend upon readelf's current output format. cf/ Patch07. +# It also tends to break parts of the binutils own +# testsuite. Hence the patch remains local for now. +Patch05: binutils-filename-in-readelf-messages.patch # Purpose: Disable an x86/x86_64 optimization that moves functions from the # PLT into the GOTPLT for faster access. This optimization is @@ -200,7 +202,7 @@ Patch06: binutils-revert-PLT-elision.patch # Purpose: Changes readelf so that when it displays extra information about # a symbol, this information is placed at the end of the line. -# Lifetime: Permanent. +# Lifetime: Permanent. cf/ Patch05. # FIXME: The proper fix would be to update the scripts that are expecting # a fixed output from readelf. But it seems that some of them are # no longer being maintained. @@ -1164,8 +1166,6 @@ exit 0 %{_infodir}/gprofng.info.* %dir %{_libdir}/gprofng %{_libdir}/gprofng/* -%dir %{_exec_prefix}/lib/debug/%{_libdir}/gprofng -%{_exec_prefix}/lib/debug/%{_libdir}/gprofng/libgp* %{_prefix}%{_sysconfdir}/gprofng.rc %endif @@ -1199,6 +1199,10 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Thu Feb 16 2023 Nick Clifton - 2.40-2 +- Spec file: Remove duplicate gprofng debug file entries. +- Spec file: Fix testsuite failures for RiscV64. + * Mon Feb 13 2023 Nick Clifton - 2.40-1 - Rebase to 2.40. - Retire: binutils-package-metadata.patch