diff --git a/0002-PPC-gas-supported-c2000.patch b/PPC-gas-supported-c2000.patch similarity index 74% rename from 0002-PPC-gas-supported-c2000.patch rename to PPC-gas-supported-c2000.patch index a0a7d8748547b1093cb0fc898b53d0cc281157b2..7d9b3eba79adb8eababa69ebfb3566acf3dda727 100644 --- a/0002-PPC-gas-supported-c2000.patch +++ b/PPC-gas-supported-c2000.patch @@ -1,6 +1,6 @@ -From d1fd0f2d0da3171a8678c7e31bb1863a53dfe1c2 Mon Sep 17 00:00:00 2001 +From efa66fcdad9c88db3244ec12e1a64db553a9484c Mon Sep 17 00:00:00 2001 From: chenyuanfeng -Date: Wed, 3 Jan 2024 14:26:27 +0800 +Date: Tue, 27 Feb 2024 09:53:29 +0800 Subject: [PATCH] PPC-gas-supported-c2000 --- @@ -11,17 +11,16 @@ Subject: [PATCH] PPC-gas-supported-c2000 gas/doc/as.info | 5 +- gas/doc/as.texi | 2 +- gas/doc/c-ppc.texi | 3 + - gas/po/gas.pot | 231 +++++++++++++++++++------------------ + gas/po/gas.pot | 233 +++++++++++++++++++------------------ include/opcode/ppc.h | 7 ++ opcodes/ppc-dis.c | 21 ++-- opcodes/ppc-opc.c | 2 +- - 11 files changed, 180 insertions(+), 126 deletions(-) + 11 files changed, 181 insertions(+), 127 deletions(-) create mode 100644 binutils/ChangeLog-2024 - mode change 100644 => 100755 gas/po/gas.pot diff --git a/binutils/ChangeLog-2024 b/binutils/ChangeLog-2024 new file mode 100644 -index 00000000..caf4b43d +index 00000000..db429887 --- /dev/null +++ b/binutils/ChangeLog-2024 @@ -0,0 +1,29 @@ @@ -56,23 +55,23 @@ index 00000000..caf4b43d +End: \ No newline at end of file diff --git a/binutils/doc/binutils.info b/binutils/doc/binutils.info -index 56b7005c..9b13580f 100644 +index c9446db8..0fea501d 100644 --- a/binutils/doc/binutils.info +++ b/binutils/doc/binutils.info -@@ -2335,7 +2335,7 @@ given. - 'efs', 'power4', 'power5', 'power6', 'power7', 'power8', 'power9', - 'power10', 'ppc', 'ppc32', 'ppc64', 'ppc64bridge', 'ppcps', 'pwr', - 'pwr2', 'pwr4', 'pwr5', 'pwr5x', 'pwr6', 'pwr7', 'pwr8', 'pwr9', -- 'pwr10', 'pwrx', 'titan', 'vle', and 'future'. '32' and '64' -+ 'pwr10', 'pwrx', 'titan', 'c2000', 'vle', and 'future'. '32' and '64' +@@ -2343,7 +2343,7 @@ given. + ‘efs’, ‘power4’, ‘power5’, ‘power6’, ‘power7’, ‘power8’, ‘power9’, + ‘power10’, ‘ppc’, ‘ppc32’, ‘ppc64’, ‘ppc64bridge’, ‘ppcps’, ‘pwr’, + ‘pwr2’, ‘pwr4’, ‘pwr5’, ‘pwr5x’, ‘pwr6’, ‘pwr7’, ‘pwr8’, ‘pwr9’, +- ‘pwr10’, ‘pwrx’, ‘titan’, ‘vle’, and ‘future’. ‘32’ and ‘64’ ++ ‘pwr10’, ‘pwrx’, ‘titan’, ‘c2000’, ‘vle’, and ‘future’. ‘32’ and ‘64’ modify the default or a prior CPU selection, disabling and enabling - 64-bit insns respectively. In addition, 'altivec', 'any', 'lsp', - 'htm', 'vsx', 'spe' and 'spe2' add capabilities to a previous _or + 64-bit insns respectively. In addition, ‘altivec’, ‘any’, ‘lsp’, + ‘htm’, ‘vsx’, ‘spe’ and ‘spe2’ add capabilities to a previous _or diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi -index e48a48dd..e33d5beb 100644 +index 8314cb57..e94ec504 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi -@@ -2648,7 +2648,7 @@ rather than @code{li}. All of the @option{-m} arguments for +@@ -2655,7 +2655,7 @@ rather than @code{li}. All of the @option{-m} arguments for @option{ppc32}, @option{ppc64}, @option{ppc64bridge}, @option{ppcps}, @option{pwr}, @option{pwr2}, @option{pwr4}, @option{pwr5}, @option{pwr5x}, @option{pwr6}, @option{pwr7}, @option{pwr8}, @option{pwr9}, @option{pwr10}, @@ -82,7 +81,7 @@ index e48a48dd..e33d5beb 100644 selection, disabling and enabling 64-bit insns respectively. In addition, @option{altivec}, @option{any}, @option{lsp}, @option{htm}, diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c -index 9450fa74..f904c7ed 100644 +index a8b034c8..d99a6091 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1426,6 +1426,8 @@ PowerPC options:\n")); @@ -95,7 +94,7 @@ index 9450fa74..f904c7ed 100644 fprintf (stream, _("\ -mno-regnames Do not allow symbolic names for registers\n")); diff --git a/gas/doc/as.info b/gas/doc/as.info -index 37793fa5..6c8fdcf7 100644 +index ce2dc91c..ef56d9a0 100644 --- a/gas/doc/as.info +++ b/gas/doc/as.info @@ -288,7 +288,7 @@ Command-Line Options: Invoking. @@ -107,18 +106,18 @@ index 37793fa5..6c8fdcf7 100644 [-many] [-maltivec|-mvsx|-mhtm|-mvle] [-mregnames|-mno-regnames] [-mrelocatable|-mrelocatable-lib|-K PIC] [-memb] -@@ -18366,6 +18366,9 @@ architecture reference manual. - '-mfuture' - Generate code for 'future' architecture. +@@ -18702,6 +18702,9 @@ architecture reference manual. + ‘-mfuture’ + Generate code for ’future’ architecture. -+'-mc2000' ++‘-mc2000’ + Generate code for Hexin C2000 architecture. + - '-mcell' - '-mcell' + ‘-mcell’ + ‘-mcell’ Generate code for Cell Broadband Engine architecture. diff --git a/gas/doc/as.texi b/gas/doc/as.texi -index bbdfa4bf..d046c18e 100644 +index 4959c2f6..02cd9058 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -536,7 +536,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @@ -145,17 +144,15 @@ index f1dc17c6..115b730c 100644 @item -mcell Generate code for Cell Broadband Engine architecture. diff --git a/gas/po/gas.pot b/gas/po/gas.pot -old mode 100644 -new mode 100755 -index 09c2411b..df3a81e1 +index bf47483b..36aa5fd7 100644 --- a/gas/po/gas.pot +++ b/gas/po/gas.pot @@ -8,10 +8,11 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: https://sourceware.org/bugzilla/\n" --"POT-Creation-Date: 2023-01-14 13:17+0000\n" -+"POT-Creation-Date: 2024-01-03 14:12+0800\n" +-"POT-Creation-Date: 2023-07-30 14:35+0100\n" ++"POT-Creation-Date: 2024-02-27 09:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -164,102 +161,113 @@ index 09c2411b..df3a81e1 "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" @@ -647,7 +648,7 @@ msgstr "" - #: cgen.c:106 config/tc-alpha.c:2094 config/tc-alpha.c:2118 - #: config/tc-arc.c:4072 config/tc-arc.c:4145 config/tc-d10v.c:550 - #: config/tc-d30v.c:534 config/tc-mn10200.c:1091 config/tc-mn10300.c:1752 --#: config/tc-ppc.c:3957 config/tc-s390.c:1334 config/tc-s390.c:1457 -+#: config/tc-ppc.c:3959 config/tc-s390.c:1334 config/tc-s390.c:1457 - #: config/tc-s390.c:1591 config/tc-v850.c:2535 config/tc-v850.c:2606 + #: cgen.c:106 config/tc-alpha.c:2097 config/tc-alpha.c:2121 + #: config/tc-arc.c:4074 config/tc-arc.c:4147 config/tc-d10v.c:550 + #: config/tc-d30v.c:534 config/tc-mn10200.c:1092 config/tc-mn10300.c:1753 +-#: config/tc-ppc.c:3959 config/tc-s390.c:1337 config/tc-s390.c:1460 ++#: config/tc-ppc.c:3961 config/tc-s390.c:1337 config/tc-s390.c:1460 + #: config/tc-s390.c:1594 config/tc-v850.c:2535 config/tc-v850.c:2606 #: config/tc-v850.c:2653 config/tc-v850.c:2690 config/tc-v850.c:2727 - #: config/tc-v850.c:2990 + #: config/tc-v850.c:2991 @@ -655,7 +656,7 @@ msgid "too many fixups" msgstr "" - #: cgen.c:371 cgen.c:391 config/tc-d10v.c:461 config/tc-d30v.c:450 --#: config/tc-mn10200.c:1033 config/tc-mn10300.c:1677 config/tc-ppc.c:3479 -+#: config/tc-mn10200.c:1033 config/tc-mn10300.c:1677 config/tc-ppc.c:3481 - #: config/tc-s390.c:1318 config/tc-v850.c:2644 config/tc-v850.c:2678 - #: config/tc-v850.c:2718 config/tc-v850.c:2963 config/tc-z80.c:785 + #: cgen.c:371 cgen.c:393 config/tc-d10v.c:461 config/tc-d30v.c:450 +-#: config/tc-mn10200.c:1034 config/tc-mn10300.c:1678 config/tc-ppc.c:3481 ++#: config/tc-mn10200.c:1034 config/tc-mn10300.c:1678 config/tc-ppc.c:3483 + #: config/tc-s390.c:1321 config/tc-v850.c:2644 config/tc-v850.c:2678 + #: config/tc-v850.c:2718 config/tc-v850.c:2964 config/tc-z80.c:785 msgid "illegal operand" @@ -664,7 +665,7 @@ msgstr "" - #: cgen.c:395 config/tc-avr.c:910 config/tc-d10v.c:463 config/tc-d30v.c:452 + #: cgen.c:397 config/tc-avr.c:910 config/tc-d10v.c:463 config/tc-d30v.c:452 #: config/tc-h8300.c:493 config/tc-mcore.c:662 config/tc-microblaze.c:613 - #: config/tc-mmix.c:495 config/tc-mn10200.c:1036 config/tc-mn10300.c:1680 --#: config/tc-msp430.c:417 config/tc-ppc.c:3481 config/tc-s390.c:1323 -+#: config/tc-msp430.c:417 config/tc-ppc.c:3483 config/tc-s390.c:1323 + #: config/tc-mmix.c:495 config/tc-mn10200.c:1037 config/tc-mn10300.c:1681 +-#: config/tc-msp430.c:417 config/tc-ppc.c:3483 config/tc-s390.c:1326 ++#: config/tc-msp430.c:417 config/tc-ppc.c:3485 config/tc-s390.c:1326 #: config/tc-sh.c:988 config/tc-v850.c:2648 config/tc-v850.c:2682 - #: config/tc-v850.c:2722 config/tc-v850.c:2966 config/tc-xgate.c:895 - #: config/tc-z80.c:932 config/tc-z8k.c:349 + #: config/tc-v850.c:2722 config/tc-v850.c:2967 config/tc-xgate.c:895 + #: config/tc-z80.c:933 config/tc-z8k.c:349 @@ -688,7 +689,7 @@ msgstr "" msgid "expression too complex" msgstr "" --#: cgen.c:959 config/tc-ppc.c:7484 config/tc-s390.c:2373 config/tc-v850.c:3499 -+#: cgen.c:959 config/tc-ppc.c:7486 config/tc-s390.c:2373 config/tc-v850.c:3499 +-#: cgen.c:961 config/tc-ppc.c:7489 config/tc-s390.c:2376 config/tc-v850.c:3500 ++#: cgen.c:961 config/tc-ppc.c:7491 config/tc-s390.c:2376 config/tc-v850.c:3500 #: config/tc-xstormy16.c:541 msgid "unresolved expression that must be resolved" msgstr "" -@@ -2573,7 +2574,7 @@ msgid "sequence number in use for !tlsgd!%ld" +@@ -2689,7 +2690,7 @@ msgid "sequence number in use for !tlsgd!%ld" msgstr "" - #: config/tc-alpha.c:1991 config/tc-arc.c:2867 config/tc-mn10200.c:847 + #: config/tc-alpha.c:1994 config/tc-arc.c:2869 config/tc-mn10200.c:847 -#: config/tc-mn10300.c:1150 config/tc-ppc.c:2063 config/tc-s390.c:668 +#: config/tc-mn10300.c:1150 config/tc-ppc.c:2065 config/tc-s390.c:668 #: config/tc-tilegx.c:422 config/tc-tilegx.c:472 config/tc-tilepro.c:375 msgid "operand" msgstr "" -@@ -2590,7 +2591,7 @@ msgstr "" +@@ -2706,7 +2707,7 @@ msgstr "" msgid "can not resolve expression" msgstr "" --#: config/tc-alpha.c:3511 config/tc-microblaze.c:204 config/tc-ppc.c:2405 -+#: config/tc-alpha.c:3511 config/tc-microblaze.c:204 config/tc-ppc.c:2407 +-#: config/tc-alpha.c:3514 config/tc-microblaze.c:204 config/tc-ppc.c:2405 ++#: config/tc-alpha.c:3514 config/tc-microblaze.c:204 config/tc-ppc.c:2407 #, c-format msgid ".COMMon length (%ld.) <0! Ignored." msgstr "" -@@ -2810,8 +2811,8 @@ msgstr "" - #: config/tc-ia64.c:7462 config/tc-m68k.c:4558 config/tc-m68k.c:4570 - #: config/tc-mips.c:3700 config/tc-mips.c:3733 config/tc-mips.c:3759 - #: config/tc-nds32.c:3439 config/tc-nios2.c:3624 config/tc-nios2.c:3629 +@@ -2926,8 +2927,8 @@ msgstr "" + #: config/tc-ia64.c:7463 config/tc-m68k.c:4558 config/tc-m68k.c:4570 + #: config/tc-mips.c:3703 config/tc-mips.c:3736 config/tc-mips.c:3762 + #: config/tc-nds32.c:3440 config/tc-nios2.c:3624 config/tc-nios2.c:3629 -#: config/tc-nios2.c:3635 config/tc-ns32k.c:1906 config/tc-ppc.c:1743 -#: config/tc-ppc.c:1783 config/tc-pru.c:1568 config/tc-pru.c:1572 +#: config/tc-nios2.c:3635 config/tc-ns32k.c:1906 config/tc-ppc.c:1745 +#: config/tc-ppc.c:1785 config/tc-pru.c:1568 config/tc-pru.c:1572 #: config/tc-s390.c:538 config/tc-s390.c:576 config/tc-sparc.c:961 #: config/tc-sparc.c:993 config/tc-tic30.c:121 config/tc-tic30.c:131 - #: config/tc-tic30.c:141 config/tc-tic30.c:151 config/tc-tic4x.c:1219 -@@ -5903,7 +5904,7 @@ msgstr "" + #: config/tc-tic30.c:141 config/tc-tic30.c:151 config/tc-tic4x.c:1220 +@@ -3279,8 +3280,8 @@ msgstr "" + #: config/tc-arc.c:4324 + #, c-format + msgid "" +-"A jump instruction with long immediate detected at the end of the ZOL label @" +-"%s" ++"A jump instruction with long immediate detected at the end of the ZOL label " ++"@%s" + msgstr "" + + #: config/tc-arc.c:4330 +@@ -6026,7 +6027,7 @@ msgstr "" #. xgettext:c-format. #: config/tc-avr.c:1865 config/tc-bfin.c:824 config/tc-d10v.c:1461 #: config/tc-d30v.c:1768 config/tc-metag.c:7016 config/tc-mn10200.c:772 --#: config/tc-mn10300.c:2177 config/tc-msp430.c:4643 config/tc-ppc.c:7763 -+#: config/tc-mn10300.c:2177 config/tc-msp430.c:4643 config/tc-ppc.c:7765 - #: config/tc-spu.c:877 config/tc-spu.c:1090 config/tc-v850.c:3364 - #: config/tc-z80.c:3877 +-#: config/tc-mn10300.c:2178 config/tc-msp430.c:4645 config/tc-ppc.c:7768 ++#: config/tc-mn10300.c:2178 config/tc-msp430.c:4645 config/tc-ppc.c:7770 + #: config/tc-spu.c:878 config/tc-spu.c:1091 config/tc-v850.c:3365 + #: config/tc-z80.c:3878 #, c-format -@@ -8601,8 +8602,8 @@ msgstr "" - #: config/tc-i386.c:7421 +@@ -8716,8 +8717,8 @@ msgstr "" + #: config/tc-i386.c:7529 #, c-format msgid "" -"no instruction mnemonic suffix given and no register operands; can't size `%" -"s'" -+"no instruction mnemonic suffix given and no register operands; can't size `" -+"%s'" ++"no instruction mnemonic suffix given and no register operands; can't size " ++"`%s'" msgstr "" - #: config/tc-i386.c:7426 -@@ -10677,8 +10678,8 @@ msgstr "" + #: config/tc-i386.c:7534 +@@ -10849,8 +10850,8 @@ msgstr "" msgid ".SCOMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-m32r.c:1514 config/tc-microblaze.c:218 config/tc-ppc.c:2419 --#: config/tc-ppc.c:4356 config/tc-ppc.c:4411 +-#: config/tc-ppc.c:4358 config/tc-ppc.c:4413 +#: config/tc-m32r.c:1514 config/tc-microblaze.c:218 config/tc-ppc.c:2421 -+#: config/tc-ppc.c:4358 config/tc-ppc.c:4413 ++#: config/tc-ppc.c:4360 config/tc-ppc.c:4415 msgid "ignoring bad alignment" msgstr "" -@@ -11524,7 +11525,7 @@ msgid_plural "%s relocations do not fit in %u bytes" +@@ -11696,7 +11697,7 @@ msgid_plural "%s relocations do not fit in %u bytes" msgstr[0] "" msgstr[1] "" @@ -268,8 +276,8 @@ index 09c2411b..df3a81e1 msgid "unknown .gnu_attribute value" msgstr "" -@@ -11561,11 +11562,10 @@ msgstr "" - msgid "operand must be a multiple of 2" +@@ -11737,11 +11738,10 @@ msgstr "" + msgid "base register expected" msgstr "" -#: config/tc-mcore.c:888 config/tc-microblaze.c:948 @@ -284,25 +292,25 @@ index 09c2411b..df3a81e1 #, c-format msgid "unknown opcode \"%s\"" msgstr "" -@@ -13591,7 +13591,7 @@ msgid "Unrecognized opcode: `%s'" +@@ -13767,7 +13767,7 @@ msgid "Unrecognized opcode: `%s'" msgstr "" #. xgettext:c-format. --#: config/tc-mn10200.c:1132 config/tc-mn10300.c:1821 config/tc-ppc.c:4006 -+#: config/tc-mn10200.c:1132 config/tc-mn10300.c:1821 config/tc-ppc.c:4008 - #: config/tc-s390.c:1604 config/tc-v850.c:3040 +-#: config/tc-mn10200.c:1133 config/tc-mn10300.c:1822 config/tc-ppc.c:4008 ++#: config/tc-mn10200.c:1133 config/tc-mn10300.c:1822 config/tc-ppc.c:4010 + #: config/tc-s390.c:1607 config/tc-v850.c:3041 #, c-format msgid "junk at end of line: `%s'" -@@ -15050,7 +15050,7 @@ msgstr "" +@@ -15226,7 +15226,7 @@ msgstr "" msgid "pcrel too far" msgstr "" --#: config/tc-ppc.c:964 config/tc-ppc.c:972 config/tc-ppc.c:3493 -+#: config/tc-ppc.c:964 config/tc-ppc.c:972 config/tc-ppc.c:3495 +-#: config/tc-ppc.c:964 config/tc-ppc.c:972 config/tc-ppc.c:3495 ++#: config/tc-ppc.c:964 config/tc-ppc.c:972 config/tc-ppc.c:3497 msgid "invalid register expression" msgstr "" -@@ -15318,418 +15318,423 @@ msgstr "" +@@ -15494,414 +15494,419 @@ msgstr "" #: config/tc-ppc.c:1428 #, c-format @@ -403,11 +411,6 @@ index 09c2411b..df3a81e1 msgid "unknown default cpu = %s, os = %s" msgstr "" --#: config/tc-ppc.c:1516 -+#: config/tc-ppc.c:1518 - msgid "neither Power nor PowerPC opcodes were selected." - msgstr "" - -#: config/tc-ppc.c:1574 +#: config/tc-ppc.c:1576 #, c-format @@ -482,8 +485,8 @@ index 09c2411b..df3a81e1 msgid "symbol+offset@%s not supported" msgstr "" --#: config/tc-ppc.c:2356 config/tc-ppc.c:4224 config/tc-ppc.c:7686 -+#: config/tc-ppc.c:2358 config/tc-ppc.c:4226 config/tc-ppc.c:7688 +-#: config/tc-ppc.c:2356 config/tc-ppc.c:4226 config/tc-ppc.c:7691 ++#: config/tc-ppc.c:2358 config/tc-ppc.c:4228 config/tc-ppc.c:7693 msgid "data in executable section" msgstr "" @@ -571,249 +574,249 @@ index 09c2411b..df3a81e1 msgid "`%s' invalid when little-endian" msgstr "" --#: config/tc-ppc.c:3693 -+#: config/tc-ppc.c:3695 +-#: config/tc-ppc.c:3695 ++#: config/tc-ppc.c:3697 #, c-format msgid "@tls may not be used with \"%s\" operands" msgstr "" --#: config/tc-ppc.c:3696 -+#: config/tc-ppc.c:3698 +-#: config/tc-ppc.c:3698 ++#: config/tc-ppc.c:3700 msgid "@tls may only be used in last operand" msgstr "" --#: config/tc-ppc.c:3734 config/tc-ppc.c:3744 config/tc-ppc.c:3754 --#: config/tc-ppc.c:3769 -+#: config/tc-ppc.c:3736 config/tc-ppc.c:3746 config/tc-ppc.c:3756 -+#: config/tc-ppc.c:3771 +-#: config/tc-ppc.c:3736 config/tc-ppc.c:3746 config/tc-ppc.c:3756 +-#: config/tc-ppc.c:3771 ++#: config/tc-ppc.c:3738 config/tc-ppc.c:3748 config/tc-ppc.c:3758 ++#: config/tc-ppc.c:3773 #, c-format msgid "%s unsupported on this instruction" msgstr "" --#: config/tc-ppc.c:3816 -+#: config/tc-ppc.c:3818 +-#: config/tc-ppc.c:3818 ++#: config/tc-ppc.c:3820 #, c-format msgid "assuming %s on symbol" msgstr "" --#: config/tc-ppc.c:3939 -+#: config/tc-ppc.c:3941 +-#: config/tc-ppc.c:3941 ++#: config/tc-ppc.c:3943 msgid "unsupported relocation for DS offset field" msgstr "" --#: config/tc-ppc.c:3992 -+#: config/tc-ppc.c:3994 +-#: config/tc-ppc.c:3994 ++#: config/tc-ppc.c:3996 #, c-format msgid "syntax error; found `%c', expected `%c'" msgstr "" --#: config/tc-ppc.c:3997 -+#: config/tc-ppc.c:3999 +-#: config/tc-ppc.c:3999 ++#: config/tc-ppc.c:4001 #, c-format msgid "syntax error; end of line, expected `%c'" msgstr "" --#: config/tc-ppc.c:4062 config/tc-ppc.c:6860 -+#: config/tc-ppc.c:4064 config/tc-ppc.c:6862 +-#: config/tc-ppc.c:4064 config/tc-ppc.c:6865 ++#: config/tc-ppc.c:4066 config/tc-ppc.c:6867 #, c-format msgid "instruction address is not a multiple of %d" msgstr "" --#: config/tc-ppc.c:4181 -+#: config/tc-ppc.c:4183 +-#: config/tc-ppc.c:4183 ++#: config/tc-ppc.c:4185 msgid "bad .section directive: want a,e,v,w,x,M,S,G,T in string" msgstr "" --#: config/tc-ppc.c:4331 -+#: config/tc-ppc.c:4333 +-#: config/tc-ppc.c:4333 ++#: config/tc-ppc.c:4335 msgid "missing size" msgstr "" --#: config/tc-ppc.c:4340 -+#: config/tc-ppc.c:4342 +-#: config/tc-ppc.c:4342 ++#: config/tc-ppc.c:4344 msgid "negative size" msgstr "" --#: config/tc-ppc.c:4367 -+#: config/tc-ppc.c:4369 +-#: config/tc-ppc.c:4369 ++#: config/tc-ppc.c:4371 msgid "Unknown visibility field in .comm" msgstr "" --#: config/tc-ppc.c:4385 -+#: config/tc-ppc.c:4387 +-#: config/tc-ppc.c:4387 ++#: config/tc-ppc.c:4389 msgid "missing real symbol name" msgstr "" --#: config/tc-ppc.c:4424 -+#: config/tc-ppc.c:4426 +-#: config/tc-ppc.c:4426 ++#: config/tc-ppc.c:4428 msgid "attempt to redefine symbol" msgstr "" --#: config/tc-ppc.c:4733 -+#: config/tc-ppc.c:4735 +-#: config/tc-ppc.c:4735 ++#: config/tc-ppc.c:4737 #, c-format msgid "no known dwarf XCOFF section for flag 0x%08x\n" msgstr "" --#: config/tc-ppc.c:4746 -+#: config/tc-ppc.c:4748 +-#: config/tc-ppc.c:4748 ++#: config/tc-ppc.c:4750 #, c-format msgid "label %s was not defined in this dwarf section" msgstr "" --#: config/tc-ppc.c:4860 -+#: config/tc-ppc.c:4862 +-#: config/tc-ppc.c:4862 ++#: config/tc-ppc.c:4864 msgid "the XCOFF file format does not support arbitrary sections" msgstr "" --#: config/tc-ppc.c:4898 -+#: config/tc-ppc.c:4900 +-#: config/tc-ppc.c:4900 ++#: config/tc-ppc.c:4902 msgid "Unknown visibility field in .extern" msgstr "" --#: config/tc-ppc.c:4935 -+#: config/tc-ppc.c:4937 +-#: config/tc-ppc.c:4937 ++#: config/tc-ppc.c:4939 msgid "Unknown visibility field in .globl" msgstr "" --#: config/tc-ppc.c:4972 -+#: config/tc-ppc.c:4974 +-#: config/tc-ppc.c:4974 ++#: config/tc-ppc.c:4976 msgid "Unknown visibility field in .weak" msgstr "" --#: config/tc-ppc.c:5023 -+#: config/tc-ppc.c:5025 +-#: config/tc-ppc.c:5025 ++#: config/tc-ppc.c:5027 msgid ".ref outside .csect" msgstr "" --#: config/tc-ppc.c:5044 config/tc-ppc.c:5304 -+#: config/tc-ppc.c:5046 config/tc-ppc.c:5306 +-#: config/tc-ppc.c:5046 config/tc-ppc.c:5306 ++#: config/tc-ppc.c:5048 config/tc-ppc.c:5308 msgid "missing symbol name" msgstr "" --#: config/tc-ppc.c:5074 -+#: config/tc-ppc.c:5076 +-#: config/tc-ppc.c:5076 ++#: config/tc-ppc.c:5078 msgid "missing rename string" msgstr "" --#: config/tc-ppc.c:5104 config/tc-ppc.c:5706 -+#: config/tc-ppc.c:5106 config/tc-ppc.c:5708 +-#: config/tc-ppc.c:5106 config/tc-ppc.c:5708 ++#: config/tc-ppc.c:5108 config/tc-ppc.c:5710 msgid "missing value" msgstr "" --#: config/tc-ppc.c:5122 -+#: config/tc-ppc.c:5124 +-#: config/tc-ppc.c:5124 ++#: config/tc-ppc.c:5126 msgid "illegal .stabx expression; zero assumed" msgstr "" --#: config/tc-ppc.c:5154 -+#: config/tc-ppc.c:5156 +-#: config/tc-ppc.c:5156 ++#: config/tc-ppc.c:5158 msgid "missing class" msgstr "" --#: config/tc-ppc.c:5163 -+#: config/tc-ppc.c:5165 +-#: config/tc-ppc.c:5165 ++#: config/tc-ppc.c:5167 msgid "missing type" msgstr "" --#: config/tc-ppc.c:5190 -+#: config/tc-ppc.c:5192 +-#: config/tc-ppc.c:5192 ++#: config/tc-ppc.c:5194 msgid ".stabx of storage class stsym must be within .bs/.es" msgstr "" --#: config/tc-ppc.c:5494 -+#: config/tc-ppc.c:5496 +-#: config/tc-ppc.c:5496 ++#: config/tc-ppc.c:5498 msgid "nested .bs blocks" msgstr "" --#: config/tc-ppc.c:5525 -+#: config/tc-ppc.c:5527 +-#: config/tc-ppc.c:5527 ++#: config/tc-ppc.c:5529 msgid ".es without preceding .bs" msgstr "" --#: config/tc-ppc.c:5698 -+#: config/tc-ppc.c:5700 +-#: config/tc-ppc.c:5700 ++#: config/tc-ppc.c:5702 msgid "non-constant byte count" msgstr "" --#: config/tc-ppc.c:5773 -+#: config/tc-ppc.c:5775 +-#: config/tc-ppc.c:5775 ++#: config/tc-ppc.c:5777 msgid ".tc not in .toc section" msgstr "" --#: config/tc-ppc.c:5791 -+#: config/tc-ppc.c:5793 +-#: config/tc-ppc.c:5793 ++#: config/tc-ppc.c:5795 msgid ".tc with no label" msgstr "" --#: config/tc-ppc.c:5819 -+#: config/tc-ppc.c:5821 +-#: config/tc-ppc.c:5821 ++#: config/tc-ppc.c:5823 #, c-format msgid ".tc with storage class %d not yet supported" msgstr "" --#: config/tc-ppc.c:5888 config/tc-s390.c:1964 -+#: config/tc-ppc.c:5890 config/tc-s390.c:1964 +-#: config/tc-ppc.c:5890 config/tc-s390.c:1967 ++#: config/tc-ppc.c:5892 config/tc-s390.c:1967 msgid ".machine stack overflow" msgstr "" --#: config/tc-ppc.c:5895 config/tc-s390.c:1975 -+#: config/tc-ppc.c:5897 config/tc-s390.c:1975 +-#: config/tc-ppc.c:5897 config/tc-s390.c:1978 ++#: config/tc-ppc.c:5899 config/tc-s390.c:1978 msgid ".machine stack underflow" msgstr "" --#: config/tc-ppc.c:5937 config/tc-s390.c:1987 -+#: config/tc-ppc.c:5939 config/tc-s390.c:1987 +-#: config/tc-ppc.c:5939 config/tc-s390.c:1990 ++#: config/tc-ppc.c:5941 config/tc-s390.c:1990 #, c-format msgid "invalid machine `%s'" msgstr "" --#: config/tc-ppc.c:5981 -+#: config/tc-ppc.c:5983 +-#: config/tc-ppc.c:5983 ++#: config/tc-ppc.c:5985 msgid "bad symbol suffix" msgstr "" --#: config/tc-ppc.c:6080 -+#: config/tc-ppc.c:6082 +-#: config/tc-ppc.c:6082 ++#: config/tc-ppc.c:6084 msgid "unrecognized symbol suffix" msgstr "" --#: config/tc-ppc.c:6168 -+#: config/tc-ppc.c:6170 +-#: config/tc-ppc.c:6170 ++#: config/tc-ppc.c:6172 msgid ".ef with no preceding .function" msgstr "" --#: config/tc-ppc.c:6304 -+#: config/tc-ppc.c:6306 +-#: config/tc-ppc.c:6309 ++#: config/tc-ppc.c:6311 #, c-format msgid "warning: symbol %s has no csect" msgstr "" --#: config/tc-ppc.c:6636 -+#: config/tc-ppc.c:6638 +-#: config/tc-ppc.c:6641 ++#: config/tc-ppc.c:6643 msgid "symbol in .toc does not match any .tc" msgstr "" --#: config/tc-ppc.c:7388 -+#: config/tc-ppc.c:7390 +-#: config/tc-ppc.c:7393 ++#: config/tc-ppc.c:7395 #, c-format msgid "%s unsupported as instruction fixup" msgstr "" --#: config/tc-ppc.c:7487 -+#: config/tc-ppc.c:7489 +-#: config/tc-ppc.c:7492 ++#: config/tc-ppc.c:7494 #, c-format msgid "unsupported relocation against %s" msgstr "" --#: config/tc-ppc.c:7649 -+#: config/tc-ppc.c:7651 +-#: config/tc-ppc.c:7654 ++#: config/tc-ppc.c:7656 #, c-format msgid "R_TLSML relocation doesn't target a TOC entry named \"_$TLSML\": %s" msgstr "" --#: config/tc-ppc.c:7669 -+#: config/tc-ppc.c:7671 +-#: config/tc-ppc.c:7674 ++#: config/tc-ppc.c:7676 #, c-format msgid "Gas failure, reloc value %d\n" msgstr "" @@ -914,5 +917,5 @@ index 37f1aeb7..ac92a8f1 100644 #define PPCLSP PPC_OPCODE_LSP #define SVP64 PPC_OPCODE_SVP64 -- -2.34.1 +2.33.0 diff --git a/0001-X86-Change-fpic-to-fPIC-in-PICFLAG.patch b/X86-Change-fpic-to-fPIC-in-PICFLAG.patch similarity index 100% rename from 0001-X86-Change-fpic-to-fPIC-in-PICFLAG.patch rename to X86-Change-fpic-to-fPIC-in-PICFLAG.patch diff --git a/binutils-2.19.50.0.1-output-format.sed b/binutils-2.19.50.0.1-output-format.sed new file mode 100644 index 0000000000000000000000000000000000000000..fd770cb255d266b685133ca1230d42d850cfcd51 --- /dev/null +++ b/binutils-2.19.50.0.1-output-format.sed @@ -0,0 +1,38 @@ +# Generate OUTPUT_FORMAT line for .so files from the system linker output. +# Imported from glibc/Makerules. + +/ld.*[ ]-E[BL]/b f +/collect.*[ ]-E[BL]/b f +/OUTPUT_FORMAT[^)]*$/{N +s/\n[ ]*/ / +} +t o +: o +s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/ +t q +s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/ +t s +s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/ +t q +d +: s +s/"//g +G +s/\n// +s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p +s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p +s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p +/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p +q +: q +s/"//g +p +q +: f +s/^.*[ ]-E\([BL]\)[ ].*$/,\1/ +t h +s/^.*[ ]-E\([BL]\)$/,\1/ +t h +d +: h +h diff --git a/binutils-2.40.tar.xz b/binutils-2.41.tar.xz similarity index 69% rename from binutils-2.40.tar.xz rename to binutils-2.41.tar.xz index e9c9f9d4c68c8ff37d85890f0389bba89fd7149d..17cfb0cec609e1771ed867b2d005492329759e39 100644 Binary files a/binutils-2.40.tar.xz and b/binutils-2.41.tar.xz differ diff --git a/binutils-CVE-2023-1972.patch b/binutils-CVE-2023-1972.patch deleted file mode 100644 index dd637fcd84c9bc4323d72e1c0c0237c5af5145d5..0000000000000000000000000000000000000000 --- a/binutils-CVE-2023-1972.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- binutils.orig/bfd/elf.c 2023-04-17 16:26:08.720347439 +0100 -+++ binutils-2.40/bfd/elf.c 2023-04-17 16:28:03.286317601 +0100 -@@ -9050,6 +9050,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd - bfd_set_error (bfd_error_file_too_big); - goto error_return_verdef; - } -+ if (amt == 0) -+ goto error_return_verdef; - elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt); - if (elf_tdata (abfd)->verdef == NULL) - goto error_return_verdef; -@@ -9153,6 +9155,8 @@ _bfd_elf_slurp_version_tables (bfd *abfd - bfd_set_error (bfd_error_file_too_big); - goto error_return; - } -+ if (amt == 0) -+ goto error_return; - elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt); - if (elf_tdata (abfd)->verdef == NULL) - goto error_return; diff --git a/binutils-objcopy-note-merge-speedup.patch b/binutils-objcopy-note-merge-speedup.patch deleted file mode 100644 index 1827fc49d191a5dcee29fcec6fc9720a4abfb5e6..0000000000000000000000000000000000000000 --- a/binutils-objcopy-note-merge-speedup.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- binutils.orig/binutils/objcopy.c 2023-01-16 12:15:46.405649346 +0000 -+++ binutils-2.39/binutils/objcopy.c 2023-01-16 12:16:48.892667868 +0000 -@@ -2383,6 +2383,8 @@ merge_gnu_build_notes (bfd * ab - other note then if they are both of the same type (open - or func) then they can be merged and one deleted. If - they are of different types then they cannot be merged. */ -+ objcopy_internal_note * prev_note = NULL; -+ - for (pnote = pnotes; pnote < pnotes_end; pnote ++) - { - /* Skip already deleted notes. -@@ -2404,7 +2406,9 @@ merge_gnu_build_notes (bfd * ab - objcopy_internal_note * back; - - /* Rule 2: Check to see if there is an identical previous note. */ -- for (iter = 0, back = pnote - 1; back >= pnotes; back --) -+ for (iter = 0, back = prev_note ? prev_note : pnote - 1; -+ back >= pnotes; -+ back --) - { - if (is_deleted_note (back)) - continue; -@@ -2466,11 +2470,18 @@ merge_gnu_build_notes (bfd * ab - break; - } - } --#if DEBUG_MERGE -+ -+ - if (! is_deleted_note (pnote)) -- merge_debug ("Unable to do anything with note at %#08lx\n", -- (pnote->note.namedata - (char *) contents) - 12); -+ { -+ /* Keep a pointer to this note, so that we can -+ start the next search for rule 2 matches here. */ -+ prev_note = pnote; -+#if DEBUG_MERGE -+ merge_debug ("Unable to do anything with note at %#08lx\n", -+ (pnote->note.namedata - (char *) contents) - 12); - #endif -+ } - } - - /* Resort the notes. */ diff --git a/binutils-reloc-symtab.patch b/binutils-reloc-symtab.patch deleted file mode 100644 index d2173063334c66f0af024cd94965c54f6c150d41..0000000000000000000000000000000000000000 --- a/binutils-reloc-symtab.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- binutils.orig/bfd/elf.c 2023-03-30 10:01:40.824181703 +0100 -+++ binutils-2.40/bfd/elf.c 2023-03-30 10:02:23.103135337 +0100 -@@ -3877,21 +3877,23 @@ assign_section_numbers (bfd *abfd, struc - { - case SHT_REL: - case SHT_RELA: -- /* A reloc section which we are treating as a normal BFD -- section. sh_link is the section index of the symbol -- table. sh_info is the section index of the section to -- which the relocation entries apply. We assume that an -- allocated reloc section uses the dynamic symbol table -- if there is one. Otherwise we guess the normal symbol -- table. FIXME: How can we be sure? */ -- if (d->this_hdr.sh_link == 0 && (sec->flags & SEC_ALLOC) != 0) -+ /* sh_link is the section index of the symbol table. -+ sh_info is the section index of the section to which the -+ relocation entries apply. */ -+ if (d->this_hdr.sh_link == 0) - { -- s = bfd_get_section_by_name (abfd, ".dynsym"); -- if (s != NULL) -- d->this_hdr.sh_link = elf_section_data (s)->this_idx; -+ /* FIXME maybe: If this is a reloc section which we are -+ treating as a normal section then we likely should -+ not be assuming its sh_link is .dynsym or .symtab. */ -+ if ((sec->flags & SEC_ALLOC) != 0) -+ { -+ s = bfd_get_section_by_name (abfd, ".dynsym"); -+ if (s != NULL) -+ d->this_hdr.sh_link = elf_section_data (s)->this_idx; -+ } -+ else -+ d->this_hdr.sh_link = elf_onesymtab (abfd); - } -- if (d->this_hdr.sh_link == 0) -- d->this_hdr.sh_link = elf_onesymtab (abfd); - - s = elf_get_reloc_section (sec); - if (s != NULL) ---- binutils.orig/binutils/objcopy.c 2023-03-30 10:01:41.063181441 +0100 -+++ binutils-2.40/binutils/objcopy.c 2023-03-30 12:25:41.439108276 +0100 -@@ -2256,7 +2256,7 @@ merge_gnu_build_notes (bfd * ab - { - if (pnote->note.namedata[4] == '2') - ++ version_2_seen; -- else if (pnote->note.namedata[4] == '3') -+ else if (pnote->note.namedata[4] == '3' || pnote->note.namedata[4] == '4') - ++ version_3_seen; - else - { diff --git a/binutils-update-linker-manual.patch b/binutils-update-linker-manual.patch index 69392141c0d4b4fb09bdf3c67d48d6dc3cfc3274..c7b6270fbbe27a00a3896ca942f4629ae1a7106d 100644 --- a/binutils-update-linker-manual.patch +++ b/binutils-update-linker-manual.patch @@ -1,31 +1,31 @@ -diff -rup binutils.orig/ld/ld.1 binutils-2.38/ld/ld.1 ---- binutils.orig/ld/ld.1 2022-05-27 10:56:44.937044892 +0100 -+++ binutils-2.38/ld/ld.1 2022-05-27 11:10:50.311802310 +0100 -@@ -2595,7 +2595,7 @@ systems may not understand them. If you +diff -rup binutils.orig/ld/ld.1 binutils-2.41/ld/ld.1 +--- binutils.orig/ld/ld.1 2023-08-03 12:47:14.427004953 +0100 ++++ binutils-2.41/ld/ld.1 2023-08-03 12:49:10.672145873 +0100 +@@ -2669,7 +2669,7 @@ systems may not understand them. If you \&\fB\-\-enable\-new\-dtags\fR, the new dynamic tags will be created as needed and older dynamic tags will be omitted. If you specify \fB\-\-disable\-new\-dtags\fR, no new dynamic tags will be -created. By default, the new dynamic tags are not created. Note that +created. By default, the new dynamic tags are created. Note that - those options are only available for \s-1ELF\s0 systems. - .IP "\fB\-\-hash\-size=\fR\fInumber\fR" 4 + those options are only available for ELF systems. + .IP \fB\-\-hash\-size=\fR\fInumber\fR 4 .IX Item "--hash-size=number" -diff -rup binutils.orig/ld/ld.info binutils-2.38/ld/ld.info ---- binutils.orig/ld/ld.info 2022-05-27 11:01:12.286346357 +0100 -+++ binutils-2.38/ld/ld.info 2022-05-27 11:11:24.585709176 +0100 -@@ -2236,7 +2236,7 @@ GNU linker: - '--enable-new-dtags', the new dynamic tags will be created as +diff -rup binutils.orig/ld/ld.info binutils-2.41/ld/ld.info +--- binutils.orig/ld/ld.info 2023-08-03 12:47:14.427004953 +0100 ++++ binutils-2.41/ld/ld.info 2023-08-03 12:49:58.829204257 +0100 +@@ -2366,7 +2366,7 @@ GNU linker: + ‘--enable-new-dtags’, the new dynamic tags will be created as needed and older dynamic tags will be omitted. If you specify - '--disable-new-dtags', no new dynamic tags will be created. By + ‘--disable-new-dtags’, no new dynamic tags will be created. By - default, the new dynamic tags are not created. Note that those + default, the new dynamic tags are created. Note that those options are only available for ELF systems. - '--hash-size=NUMBER' -diff -rup binutils.orig/ld/ld.texi binutils-2.38/ld/ld.texi ---- binutils.orig/ld/ld.texi 2022-05-27 11:01:24.081314960 +0100 -+++ binutils-2.38/ld/ld.texi 2022-05-27 11:10:05.608923798 +0100 -@@ -2796,7 +2796,7 @@ systems may not understand them. If you + ‘--hash-size=NUMBER’ +diff -rup binutils.orig/ld/ld.texi binutils-2.41/ld/ld.texi +--- binutils.orig/ld/ld.texi 2023-08-03 12:50:58.176276215 +0100 ++++ binutils-2.41/ld/ld.texi 2023-08-03 12:41:11.902610960 +0100 +@@ -2946,7 +2946,7 @@ systems may not understand them. If you @option{--enable-new-dtags}, the new dynamic tags will be created as needed and older dynamic tags will be omitted. If you specify @option{--disable-new-dtags}, no new dynamic tags will be diff --git a/binutils.spec b/binutils.spec index b9cd69e06432a762ed6598e89510ddd5cb455cec..65281c749bfea05096e482ac3e268bc3eff76aa5 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,9 +1,9 @@ Summary: A GNU collection of binary utilities Name: binutils%{?_with_debug:-debug} -Version: 2.40 -Release: 6 -License: GPL-3.0-or-later +Version: 2.41 +Release: 1 +License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later URL: https://sourceware.org/binutils #---Start of Configure Options----------------------------------------------- @@ -11,16 +11,16 @@ URL: https://sourceware.org/binutils # The binutils can be built with the following parameters to change # the default behaviour: -# --with{out} bootstrap Build with minimal dependencies. -# --with{out} clang Force building with CLANG instead of GCC. -# --with{out} crossbuilds Build cross targeted versions of the binutils as well as natives. -# --with{out} debug Build without optimizations and without splitting the debuginfo into a separate file. -# --with{out} debuginfod Disable support for debuginfod. -# --with{out} docs Skip building documentation. Default is with docs, except when building a cross binutils. -# --with{out} gold Disable building of the GOLD linker. -# --with{out} gprofng Do not build the GprofNG profiler. -# --with{out} systemzlib Use the binutils version of zlib. -# --with{out} testsuite Do not run the testsuite. Default is to run it. +# --with bootstrap Build with minimal dependencies. +# --with clang Force building with CLANG instead of GCC. +# --with crossbuilds Build cross targeted versions of the binutils as well as natives. +# --with debug Build without optimizations and without splitting the debuginfo into a separate file. +# --with debuginfod Disable support for debuginfod. +# --without docs Skip building documentation. Default is with docs, except when building a cross binutils. +# --without gold Disable building of the GOLD linker. +# --with gprofng Do not build the GprofNG profiler. +# --without systemzlib Use the binutils version of zlib. +# --without testsuite Do not run the testsuite. Default is to run it. # Other configuration options can be set by modifying the following defines. @@ -32,10 +32,14 @@ URL: https://sourceware.org/binutils %define enable_deterministic_archives 0 # Generate a warning when linking creates an executable stack -%define warn_for_executable_stacks 0 +%define warn_for_executable_stacks 1 # Generate a warning when linking creates a segment with read, write and execute permissions -%define warn_for_rwx_segments 0 +%define warn_for_rwx_segments 1 + +# Turn the above warnings into errors. Only effective if the warnings are enabled. +%define error_for_executable_stacks 0 +%define error_for_rwx_segments 0 # Enable support for GCC LTO compilation. # Disable if it is necessary to work around bugs in LTO. @@ -71,8 +75,6 @@ URL: https://sourceware.org/binutils # not just x86/x86_64. %define enable_separate_code 0 -%define customized_test 1 - #----End of Configure Options------------------------------------------------ # Note - in the future the gold linker may become deprecated. @@ -89,14 +91,13 @@ URL: https://sourceware.org/binutils %bcond_with debug # Default: Always build documentation. %bcond_without docs -# Default: Always run the testsuite. -%bcond_without testsuite +# Default: Always run the testsuite. FIXME: Temporarily disable it. +%bcond_with testsuite # Default: Not support debuginfod. %bcond_with debuginfod # Default: Not build binutils-gprofng package. %bcond_with gprofng -# Use the system supplied version of the zlib compress library. -# Change this to use the binutils builtin version instead. +# Default: Use the system supplied version of the zlib compression library. %bcond_without systemzlib # Allow the user to override the compiler used to build the binutils. @@ -125,6 +126,7 @@ URL: https://sourceware.org/binutils %if %{with debug} %undefine with_testsuite +%define enable_shared 0 %endif # GprofNG currenly onlly supports the x86 and AArch64 architectures. @@ -150,9 +152,21 @@ URL: https://sourceware.org/binutils # instead. Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz +Source2: binutils-2.19.50.0.1-output-format.sed #---------------------------------------------------------------------------- +# OpenEuler Patch Naming Rules +# https://gitee.com/openeuler/TC/blob/master/oEEP/oEEP-0012%20openEuler%E8%BD%AF%E4%BB%B6%E5%8C%85%E9%9D%9Eupstream%E6%94%AF%E6%8C%81%E5%A4%9A%E6%9E%B6%E6%9E%84%E4%BB%A3%E7%A0%81%E6%8F%90%E4%BA%A4%E8%A7%84%E5%88%99.md + +# Part 1000 - 1999 + +Patch1001: X86-Change-fpic-to-fPIC-in-PICFLAG.patch +Patch1002: PPC-gas-supported-c2000.patch + + +# Part 5000 - + # Purpose: Use /lib64 and /usr/lib64 instead of /lib and /usr/lib in the # default library search path of 64-bit targets. # Lifetime: Permanent, but it should not be. This is a bug in the libtool @@ -160,17 +174,12 @@ Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz # libtool.m4 file). These are based on a version released in 2009 # (2.2.6?) rather than the latest version. (Definitely fixed in # libtool version 2.4.6). -Patch01: binutils-libtool-lib64.patch - -# Purpose: Appends a Vendor release string to the generic binutils -# version string. -# Lifetime: Permanent. This is a Vendor specific patch. -# Patch02: binutils-version.patch +Patch5001: binutils-libtool-lib64.patch # Purpose: Exports the demangle.h header file (associated with the libiberty # sources) with the binutils-devel rpm. # Lifetime: Permanent. This is a Vendor specific patch. -Patch03: binutils-export-demangle.h.patch +Patch5002: binutils-export-demangle.h.patch # Purpose: Disables the check in the BFD library's bfd.h header file that # config.h has been included before the bfd.h header. See BZ @@ -181,111 +190,34 @@ Patch03: binutils-export-demangle.h.patch # FIXME: It would be better if the packages using the bfd.h header were # fixed so that they do include the header files in the correct # order. -Patch04: binutils-no-config-h-check.patch - -# 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 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 -# problematic for tools that want to intercept PLT entries, such -# as ltrace and LD_AUDIT. See BZs 1452111 and 1333481. -# Lifetime: Permanent. But it should not be. -# FIXME: Replace with a configure time option. -# 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. 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. -# Patch07: binutils-readelf-other-sym-info.patch +Patch5003: binutils-no-config-h-check.patch # Purpose: Do not create PLT entries for AARCH64 IFUNC symbols referenced in # debug sections. # Lifetime: Permanent. # FIXME: Find related bug. Decide on permanency. -Patch08: binutils-2.27-aarch64-ifunc.patch - -# Purpose: Stop the binutils from statically linking with libstdc++. -# Lifetime: Permanent. -# Patch09: binutils-do-not-link-with-static-libstdc++.patch +Patch5004: binutils-2.27-aarch64-ifunc.patch # Purpose: Allow OS specific sections in section groups. -# Lifetime: Fixed in 2.39 (maybe) -Patch10: binutils-special-sections-in-groups.patch - -# Purpose: Fix linker testsuite failures. -# Lifetime: Fixed in 2.39 (maybe) -# Patch11: binutils-fix-testsuite-failures.patch +# Lifetime: Fixed in 2.42 (maybe) +Patch5005: binutils-special-sections-in-groups.patch # Purpose: Stop gold from aborting when input sections with the same name # have different flags. -# Lifetime: Fixed in 2.39 (maybe) -Patch12: binutils-gold-mismatched-section-flags.patch - -# Purpose: Change the gold configuration script to only warn about -# unsupported targets. This allows the binutils to be built with -# BPF support enabled. -# Lifetime: Permanent. -# Patch13: binutils-gold-warn-unsupported.patch - -# Purpose: Enable the creation of .note.gnu.property sections by the GOLD -# linker for x86 binaries. -# Lifetime: Permanent. -# Patch14: binutils-gold-i386-gnu-property-notes.patch - -# Purpose: Allow the binutils to be configured with any (recent) version of -# autoconf. -# Lifetime: Fixed in 2.39 (maybe ?) -# Patch15: binutils-autoconf-version.patch - -# Purpose: Stop libtool from inserting useless runpaths into binaries. -# Lifetime: Who knows. -# Patch16: binutils-libtool-no-rpath.patch +# Lifetime: Fixed in 2.42 (maybe) +Patch5006: binutils-gold-mismatched-section-flags.patch %if %{enable_new_dtags} # Purpose: Change ld man page so that it says that --enable-new-dtags is the default. # Lifetime: Permanent -Patch17: binutils-update-linker-manual.patch +Patch5007: binutils-update-linker-manual.patch %endif -# Purpose: Speed up objcopy's note merging algorithm. -# Lifetime: Fixed in 2.41 -Patch18: binutils-objcopy-note-merge-speedup.patch - -# Purpose: Fix testsuite failures due to the patches applied here. -# Lifetime: Permanent, but varying with each new rebase. -# Patch19: binutils-testsuite-fixes.patch - -# Purpose: Stop the linker from associating allocated reloc sections with -# the .symtab section , which prevents it from being stripped. -# Lifetime: Fixed in 2.41 -Patch20: binutils-reloc-symtab.patch - -# Purpose: Stop an illegal memory access in the BFD library when loading -# a file with corrupt symbol version information. -# Lifetime: Fixed in 2.41 -Patch21: binutils-CVE-2023-1972.patch - # Purpose: Stop an abort when using dwp to process a file with no dwo links. -# Lifetime: Fixed in 2.41 (maybe) -Patch22: binutils-gold-empty-dwp.patch +# Lifetime: Fixed in 2.42 (maybe) +Patch5008: binutils-gold-empty-dwp.patch -#### Other patches -Patch23: 0001-X86-Change-fpic-to-fPIC-in-PICFLAG.patch -Patch24: 0002-PPC-gas-supported-c2000.patch - #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -317,7 +249,10 @@ Conflicts: gcc-c++ < 4.0.0 %endif %if %{without bootstrap} -BuildRequires: gettext, flex, zlib-devel, jansson-devel +BuildRequires: gettext, flex, jansson-devel +%if %{with systemzlib} +BuildRequires: zlib-devel +%endif %endif %if %{with docs} @@ -333,7 +268,10 @@ BuildRequires: findutils %if %{with testsuite} # relro_test.sh uses dc which is part of the bc rpm, hence its inclusion here. # sharutils is needed so that we can uuencode the testsuite results. -BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc, libstdc++ +BuildRequires: dejagnu, glibc-static, sharutils, bc, libstdc++ +%if %{with systemzlib} +BuildRequires: zlib-devel +%endif %endif %if %{with debuginfod} @@ -380,7 +318,9 @@ converting addresses to file and line). %package devel Summary: BFD and opcodes static and dynamic libraries and header files Provides: binutils-static = %{version}-%{release} +%if %{with systemzlib} Requires: zlib-devel +%endif Requires: binutils = %{version}-%{release} # BZ 1215242: We need touch... Requires: coreutils @@ -438,6 +378,7 @@ linker, and it may become deprecated in the future. Summary: Next Generating code profiling tool Provides: gprofng = %{version}-%{release} Requires: binutils = %{version}-%{release} +BuildRequires: bison %description gprofng GprofNG is the GNU Next Generation Profiler for analyzing the performance @@ -460,7 +401,10 @@ of Linux applications. %package -n cross-binutils-aarch64 Summary: Cross targeted AArch64 binutils for developer use. Not intended for production. Provides: cross-binutils-aarch64 = %{version}-%{release} -Requires: zlib-devel coreutils +Requires: coreutils +%if %{with systemzlib} +Requires: zlib-devel +%endif BuildRequires: autoconf automake perl sed coreutils make gcc findutils gcc-c++ ExcludeArch: aarch64-linux-gnu aarch64-%{_vendor}-linux @@ -472,7 +416,10 @@ use by developers. It is NOT INTENDED FOR PRODUCTION use. %package -n cross-binutils-ppc64le Summary: Cross targeted PPC64LE binutils for developer use. Not intended for production. Provides: cross-binutils-ppc64le = %{version}-%{release} -Requires: zlib-devel coreutils +Requires: coreutils +%if %{with systemzlib} +Requires: zlib-devel +%endif BuildRequires: autoconf automake perl sed coreutils make gcc findutils gcc-c++ ExcludeArch: ppc64le-linux-gnu ppc64le-%{_vendor}-linux @@ -484,7 +431,10 @@ use by developers. It is NOT INTENDED FOR PRODUCTION use. %package -n cross-binutils-s390x Summary: Cross targeted S390X binutils for developer use. Not intended for production. Provides: cross-binutils-s390x = %{version}-%{release} -Requires: zlib-devel coreutils +Requires: coreutils +%if %{with systemzlib} +Requires: zlib-devel +%endif BuildRequires: autoconf automake perl sed coreutils make gcc findutils gcc-c++ ExcludeArch: s390x-linux-gnu s390x-%{_vendor}-linux @@ -496,7 +446,10 @@ use by developers. It is NOT INTENDED FOR PRODUCTION use. %package -n cross-binutils-x86_64 Summary: Cross targeted X86_64 binutils for developer use. Not intended for production. Provides: cross-binutils-x86_64 = %{version}-%{release} -Requires: zlib-devel coreutils +Requires: coreutils +%if %{with systemzlib} +Requires: zlib-devel +%endif BuildRequires: autoconf automake perl sed coreutils make gcc findutils gcc-c++ ExcludeArch: x86_64-linux-gnu x86_64-%{_vendor}-linux i686-linux-gnu i686-%{_vendor}-linux @@ -618,12 +571,18 @@ compute_global_configuration() %if %{warn_for_executable_stacks} CARGS="$CARGS --enable-warn-execstack=yes" CARGS="$CARGS --enable-default-execstack=no" +%if %{error_for_executable_stacks} + CARGS="$CARGS --enable-error-execstack=yes" +%endif %else CARGS="$CARGS --enable-warn-execstack=no" %endif %if %{warn_for_rwx_segments} CARGS="$CARGS --enable-warn-rwx-segments=yes" +%if %{error_for_rwx_segments} + CARGS="$CARGS --enable-error-rwx-segments=yes" +%endif %else CARGS="$CARGS --enable-warn-rwx-segments=no" %endif @@ -676,12 +635,15 @@ run_target_configuration() %endif %if %{with debug} - export CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0" - shared=0 + %undefine _fortify_level + export CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error" %endif export CXXFLAGS="$CXXFLAGS $CFLAGS" + # BZ 1541027 - include the linker flags from %%{_vendor}-rpm-config as well. + export LDFLAGS=$RPM_LD_FLAGS + %if %{enable_new_dtags} # Build the tools with new dtags, as well as supporting their generation by the linker. export LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags" @@ -693,37 +655,33 @@ run_target_configuration() # BZ 1920373: Enable PEP support for all targets as the PERF package's # testsuite expects to be able to read PE format files ragrdless of # the host's architecture. - # - # Also enable the BPF target so that strip will work on BPF files. -# case $target in -# s390*) -# # Note - The s390-linux target is there so that the GOLD linker will -# # build. By default, if configured for just s390x-linux, the GOLD -# # configure system will only include support for 64-bit targets, but -# # the s390x gold backend uses both 32-bit and 64-bit templates. -# TARGS="--enable-targets=s390-linux,s390x-linux,x86_64-pep,bpf-unknown-none" -# ;; -# ia64*) -# TARGS="--enable-targets=ia64-linux,x86_64-pep,bpf-unknown-none" -# ;; -# ppc64-*) -# TARGS="--enable-targets=powerpc64le-linux,spu,x86_64-pep,bpf-unknown-none" -# ;; -# ppc64le*) -# TARGS="--enable-targets=powerpc-linux,spu,x86_64-pep,bpf-unknown-none" -# ;; -# *) -# TARGS="--enable-targets=x86_64-pep,bpf-unknown-none" -# ;; -# esac - - # No extra targets are supported. - TARGS="" + case $target in + s390*) + # Note - The s390-linux target is there so that the GOLD linker will + # build. By default, if configured for just s390x-linux, the GOLD + # configure system will only include support for 64-bit targets, but + # the s390x gold backend uses both 32-bit and 64-bit templates. + TARGS="--enable-targets=s390-linux,s390x-linux,x86_64-pep" + ;; + ia64*) + TARGS="--enable-targets=ia64-linux,x86_64-pep" + ;; + ppc64-*) + TARGS="--enable-targets=powerpc64le-linux,spu,x86_64-pep" + ;; + ppc64le*) + TARGS="--enable-targets=powerpc-linux,spu,x86_64-pep" + ;; + *) + TARGS="--enable-targets=x86_64-pep" + ;; + esac # Set up the sysroot and paths. SARGS="--with-sysroot=/ \ --prefix=%{_prefix} \ - --libdir=%{_libdir}" + --libdir=%{_libdir} \ + --sysconfdir=%{_sysconfdir}" %if %{with gold} SARGS="$SARGS --enable-gold=default" %else @@ -743,6 +701,7 @@ run_target_configuration() --prefix=%{_prefix}/$target \ --libdir=%{_libdir} \ --exec-prefix=%{_usr} \ + --sysconfdir=%{_sysconfdir} \ --disable-gold" fi @@ -797,7 +756,6 @@ run_tests() return %endif -%if ! %{customized_test} pushd build-$target # FIXME: I have not been able to find a way to capture a "failed" return @@ -869,122 +827,6 @@ run_tests() fi popd -%else - pushd build-$target - - errorcode=0 -check_failure() -{ - local file="$1" - local knownfail="$2" - - if [ -f $file ]; then - echo ==================== PRINT $file ==================== - cat $file - - while read line - do - if [[ "${knownfail[@]}" =~ "@${line}@" ]]; then - echo Known Failure: $line - else - echo Unknown Failure: $line - errorcode=1 - fi - done < <(grep -e "^XPASS:\|^FAIL:" $file) - fi -} - - echo ================ $target == TEST RUN =============================== - - if test x$native == x1 ; then - make -k check-gas check-binutils check-ld < /dev/null || : -%if %{with gold} - make -k check-gold < /dev/null || : -%endif - - local gas_failure=("@@") - local binutils_failure=("@@") - local ld_failure=("@@") - local gold_failure=("@@") - -%ifarch aarch64 - binutils_failure=( - "@FAIL: objdump -S@" - "@FAIL: objdump --source-comment@" - ) - ld_failure=( - "@XPASS: Run pr19719 fun undefined@" - ) -%endif -%ifarch x86_64 - binutils_failure=( - "@FAIL: objdump -S@" - "@FAIL: objdump --source-comment@" - ) - ld_failure=( - "@FAIL: Build protected-func-2 without PIE@" - "@FAIL: Build protected-func-2a without PIE@" - "@FAIL: Build pr22001-1b@" - "@FAIL: Undefined weak symbol (-fno-PIE -no-pie)@" - ) - gold_failure=( - "@FAIL: weak_undef_test@" - "@FAIL: initpri3a@" - "@FAIL: script_test_1@" - "@FAIL: script_test_2@" - "@FAIL: justsyms@" - "@FAIL: justsyms_exec@" - "@FAIL: binary_test@" - "@FAIL: script_test_3@" - "@FAIL: tls_phdrs_script_test@" - "@FAIL: script_test_12i@" - "@FAIL: ifuncmain6pie@" - "@FAIL: incremental_test_2@" - "@FAIL: incremental_test_3@" - "@FAIL: incremental_test_4@" - "@FAIL: incremental_test_5@" - "@FAIL: incremental_test_6@" - "@FAIL: incremental_copy_test@" - "@FAIL: incremental_common_test_1@" - "@FAIL: incremental_comdat_test_1@" - ) -%endif - - if [ -f gas/testsuite/gas.sum ]; then - check_failure "gas/testsuite/gas.sum" "${gas_failure[*]}" - cat gas/testsuite/gas.log || : - fi - - if [ -f binutils/binutils.sum ]; then - check_failure "binutils/binutils.sum" "${binutils_failure[*]}" - cat binutils/binutils.log || : - fi - - if [ -f ld/ld.sum ]; then - check_failure "ld/ld.sum" "${ld_failure[*]}" - cat ld/ld.log || : - fi - -%if %{with gold} - if [ -f gold/test-suite.log ]; then - check_failure "gold/test-suite.log" "${gold_failure[*]}" - fi - - if [ -f gold/testsuite/test-suite.log ]; then - check_failure "gold/testsuite/test-suite.log" "${gold_failure[*]}" - cat gold/testsuite/*.log || : - fi -%endif - - if test x$errorcode == x1 ; then - echo == WARNING == WARNING == WARNING == WARNING == WARNING == - echo == Unexpected Test Case Failures == - echo == WARNING == WARNING == WARNING == WARNING == WARNING == - fi - fi - - popd -%endif } #---------------------------------------------------------------------------- @@ -1101,11 +943,11 @@ install_binutils() %set_build_flags %make_build -s CFLAGS="-g -fPIC $RPM_OPT_FLAGS" -C libsframe - install -m 644 bfd/libbfd.a $local_libdir - install -m 644 libiberty/libiberty.a $local_libdir - install -m 644 ../include/libiberty.h $local_incdir - install -m 644 opcodes/libopcodes.a $local_libdir - install -m 644 libsframe/.libs/libsframe.a $local_libdir + install -m 644 bfd/.libs/libbfd.a $local_libdir + install -m 644 libiberty/libiberty.a $local_libdir + install -m 644 ../include/libiberty.h $local_incdir + install -m 644 opcodes/.libs/libopcodes.a $local_libdir + install -m 644 libsframe/.libs/libsframe.a $local_libdir # Remove Windows/Novell only man pages rm -f $local_mandir/{dlltool,nlmconv,windres,windmc}* @@ -1143,79 +985,32 @@ install_binutils() touch -r ../bfd/bfd-in2.h $local_incdir/bfd.h - # Generate libbfd.so and libopcodes.so + # Generate .so linker scripts for dependencies; imported from glibc/Makerules: -%ifarch %{power64} - tee %{buildroot}%{_libdir}/libbfd.so < - 2.41-1 +- Update binutils 2.41 +- Reference: https://gitlab.com/redhat/centos-stream/rpms/binutils/-/tree/c10s +- Retire: binutils-CVE-2023-1972.patch +- Retire: binutils-objcopy-note-merge-speedup.patch +- Retire: binutils-reloc-symtab.patch + * Fri Jan 05 2024 yuucyf - 2.40-6 - In PPC, gas supported c2000 processor