aboutsummaryrefslogtreecommitdiff
path: root/ChangeLog.git.2.37-2.38
blob: 9405aefc768e8fbaed6c91cb70f7a107058a618d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
27482
27483
27484
27485
27486
27487
27488
27489
27490
27491
27492
27493
27494
27495
27496
27497
27498
27499
27500
27501
27502
27503
27504
27505
27506
27507
27508
27509
27510
27511
27512
27513
27514
27515
27516
27517
27518
27519
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552
27553
27554
27555
27556
27557
27558
27559
27560
27561
27562
27563
27564
27565
27566
27567
27568
27569
27570
27571
27572
27573
27574
27575
27576
27577
27578
27579
27580
27581
27582
27583
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
27620
27621
27622
27623
27624
27625
27626
27627
27628
27629
27630
27631
27632
27633
27634
27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
27656
27657
27658
27659
27660
27661
27662
27663
27664
27665
27666
27667
27668
27669
27670
27671
27672
27673
27674
27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
27685
27686
27687
27688
27689
27690
27691
27692
27693
27694
27695
27696
27697
27698
27699
27700
27701
27702
27703
27704
27705
27706
27707
27708
27709
27710
27711
27712
27713
27714
27715
27716
27717
27718
27719
27720
27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
27745
27746
27747
27748
27749
27750
27751
27752
27753
27754
27755
27756
27757
27758
27759
27760
27761
27762
27763
27764
27765
27766
27767
27768
27769
27770
27771
27772
27773
27774
27775
27776
27777
27778
27779
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789
27790
27791
27792
27793
27794
27795
27796
27797
27798
27799
27800
27801
27802
27803
27804
27805
27806
27807
27808
27809
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
27825
27826
27827
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
27843
27844
27845
27846
27847
27848
27849
27850
27851
27852
27853
27854
27855
27856
27857
27858
27859
27860
27861
27862
27863
27864
27865
27866
27867
27868
27869
27870
27871
27872
27873
27874
27875
27876
27877
27878
27879
27880
27881
27882
27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903
27904
27905
27906
27907
27908
27909
27910
27911
27912
27913
27914
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
27930
27931
27932
27933
27934
27935
27936
27937
27938
27939
27940
27941
27942
27943
27944
27945
27946
27947
27948
27949
27950
27951
27952
27953
27954
27955
27956
27957
27958
27959
27960
27961
27962
27963
27964
27965
27966
27967
27968
27969
27970
27971
27972
27973
27974
27975
27976
27977
27978
27979
27980
27981
27982
27983
27984
27985
27986
27987
27988
27989
27990
27991
27992
27993
27994
27995
27996
27997
27998
27999
28000
28001
28002
28003
28004
28005
28006
28007
28008
28009
28010
28011
28012
28013
28014
28015
28016
28017
28018
28019
28020
28021
28022
28023
28024
28025
28026
28027
28028
28029
28030
28031
28032
28033
28034
28035
28036
28037
28038
28039
28040
28041
28042
28043
28044
28045
28046
28047
28048
28049
28050
28051
28052
28053
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063
28064
28065
28066
28067
28068
28069
28070
28071
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
28090
28091
28092
28093
28094
28095
28096
28097
28098
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110
28111
28112
28113
28114
28115
28116
28117
28118
28119
28120
28121
28122
28123
28124
28125
28126
28127
28128
28129
28130
28131
28132
28133
28134
28135
28136
28137
28138
28139
28140
28141
28142
28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
28162
28163
28164
28165
28166
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
28189
28190
28191
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202
28203
28204
28205
28206
28207
28208
28209
28210
28211
28212
28213
28214
28215
28216
28217
28218
28219
28220
28221
28222
28223
28224
28225
28226
28227
28228
28229
28230
28231
28232
28233
28234
28235
28236
28237
28238
28239
28240
28241
28242
28243
28244
28245
28246
28247
28248
28249
28250
28251
28252
28253
28254
28255
28256
28257
28258
28259
28260
28261
28262
28263
28264
28265
28266
28267
28268
28269
28270
28271
28272
28273
28274
28275
28276
28277
28278
28279
28280
28281
28282
28283
28284
28285
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296
28297
28298
28299
28300
28301
28302
28303
28304
28305
28306
28307
28308
28309
28310
28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329
28330
28331
28332
28333
28334
28335
28336
28337
28338
28339
28340
28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351
28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
28378
28379
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390
28391
28392
28393
28394
28395
28396
28397
28398
28399
28400
28401
28402
28403
28404
28405
28406
28407
28408
28409
28410
28411
28412
28413
28414
28415
28416
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
28432
28433
28434
28435
28436
28437
28438
28439
28440
28441
28442
28443
28444
28445
28446
28447
28448
28449
28450
28451
28452
28453
28454
28455
28456
28457
28458
28459
28460
28461
28462
28463
28464
28465
28466
28467
28468
28469
28470
28471
28472
28473
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484
28485
28486
28487
28488
28489
28490
28491
28492
28493
28494
28495
28496
28497
28498
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
28514
28515
28516
28517
28518
28519
28520
28521
28522
28523
28524
28525
28526
28527
28528
28529
28530
28531
28532
28533
28534
28535
28536
28537
28538
28539
28540
28541
28542
28543
28544
28545
28546
28547
28548
28549
28550
28551
28552
28553
28554
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
28584
28585
28586
28587
28588
28589
28590
28591
28592
28593
28594
28595
28596
28597
28598
28599
28600
28601
28602
28603
28604
28605
28606
28607
28608
28609
28610
28611
28612
28613
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
28629
28630
28631
28632
28633
28634
28635
28636
28637
28638
28639
28640
28641
28642
28643
28644
28645
28646
28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
28659
28660
28661
28662
28663
28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
28675
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
28705
28706
28707
28708
28709
28710
28711
28712
28713
28714
28715
28716
28717
28718
28719
28720
28721
28722
28723
28724
28725
28726
28727
28728
28729
28730
28731
28732
28733
28734
28735
28736
28737
28738
28739
28740
28741
28742
28743
28744
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
28774
28775
28776
28777
28778
28779
28780
28781
28782
28783
28784
28785
28786
28787
28788
28789
28790
28791
28792
28793
28794
28795
28796
28797
28798
28799
28800
28801
28802
28803
28804
28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
28825
28826
28827
28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
28847
28848
28849
28850
28851
28852
28853
28854
28855
28856
28857
28858
28859
28860
28861
28862
28863
28864
28865
28866
28867
28868
28869
28870
28871
28872
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
28918
28919
28920
28921
28922
28923
28924
28925
28926
28927
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939
28940
28941
28942
28943
28944
28945
28946
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
28964
28965
28966
28967
28968
28969
28970
28971
28972
28973
28974
28975
28976
28977
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
29011
29012
29013
29014
29015
29016
29017
29018
29019
29020
29021
29022
29023
29024
29025
29026
29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
29037
29038
29039
29040
29041
29042
29043
29044
29045
29046
29047
29048
29049
29050
29051
29052
29053
29054
29055
29056
29057
29058
29059
29060
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
29071
29072
29073
29074
29075
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085
29086
29087
29088
29089
29090
29091
29092
29093
29094
29095
29096
29097
29098
29099
29100
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
29138
29139
29140
29141
29142
29143
29144
29145
29146
29147
29148
29149
29150
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
29166
29167
29168
29169
29170
29171
29172
29173
29174
29175
29176
29177
29178
29179
29180
29181
29182
29183
29184
29185
29186
29187
29188
29189
29190
29191
29192
29193
29194
29195
29196
29197
29198
29199
29200
29201
29202
29203
29204
29205
29206
29207
29208
29209
29210
29211
29212
29213
29214
29215
29216
29217
29218
29219
29220
29221
29222
29223
29224
29225
29226
29227
29228
29229
29230
29231
29232
29233
29234
29235
29236
29237
29238
29239
29240
29241
29242
29243
29244
29245
29246
29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
29257
29258
29259
29260
29261
29262
29263
29264
29265
29266
29267
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
29286
29287
29288
29289
29290
29291
29292
29293
29294
29295
29296
29297
29298
29299
29300
29301
29302
29303
29304
29305
29306
29307
29308
29309
29310
29311
29312
29313
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323
29324
29325
29326
29327
29328
29329
29330
29331
29332
29333
29334
29335
29336
29337
29338
29339
29340
29341
29342
29343
29344
29345
29346
29347
29348
29349
29350
29351
29352
29353
29354
29355
29356
29357
29358
29359
29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
29376
29377
29378
29379
29380
29381
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
29404
29405
29406
29407
29408
29409
29410
29411
29412
29413
29414
29415
29416
29417
29418
29419
29420
29421
29422
29423
29424
29425
29426
29427
29428
29429
29430
29431
29432
29433
29434
29435
29436
29437
29438
29439
29440
29441
29442
29443
29444
29445
29446
29447
29448
29449
29450
29451
29452
29453
29454
29455
29456
29457
29458
29459
29460
29461
29462
29463
29464
29465
29466
29467
29468
29469
29470
29471
29472
29473
29474
29475
29476
29477
29478
29479
29480
29481
29482
29483
29484
29485
29486
29487
29488
29489
29490
29491
29492
29493
29494
29495
29496
29497
29498
29499
29500
29501
29502
29503
29504
29505
29506
29507
29508
29509
29510
29511
29512
29513
29514
29515
29516
29517
29518
29519
29520
29521
29522
29523
29524
29525
29526
29527
29528
29529
29530
29531
29532
29533
29534
29535
29536
29537
29538
29539
29540
29541
29542
29543
29544
29545
29546
29547
29548
29549
29550
29551
29552
29553
29554
29555
29556
29557
29558
29559
29560
29561
29562
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
29584
29585
29586
29587
29588
29589
29590
29591
29592
29593
29594
29595
29596
29597
29598
29599
29600
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611
29612
29613
29614
29615
29616
29617
29618
29619
29620
29621
29622
29623
29624
29625
29626
29627
29628
29629
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639
29640
29641
29642
29643
29644
29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
29663
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691
29692
29693
29694
29695
29696
29697
29698
29699
29700
29701
29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
29713
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723
29724
29725
29726
29727
29728
29729
29730
29731
29732
29733
29734
29735
29736
29737
29738
29739
29740
29741
29742
29743
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753
29754
29755
29756
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768
29769
29770
29771
29772
29773
29774
29775
29776
29777
29778
29779
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
29795
29796
29797
29798
29799
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809
29810
29811
29812
29813
29814
29815
29816
29817
29818
29819
29820
29821
29822
29823
29824
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834
29835
29836
29837
29838
29839
29840
29841
29842
29843
29844
29845
29846
29847
29848
29849
29850
29851
29852
29853
29854
29855
29856
29857
29858
29859
29860
29861
29862
29863
29864
29865
29866
29867
29868
29869
29870
29871
29872
29873
29874
29875
29876
29877
29878
29879
29880
29881
29882
29883
29884
29885
29886
29887
29888
29889
29890
29891
29892
29893
29894
29895
29896
29897
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918
29919
29920
29921
29922
29923
29924
29925
29926
29927
29928
29929
29930
29931
29932
29933
29934
29935
29936
29937
29938
29939
29940
29941
29942
29943
29944
29945
29946
29947
29948
29949
29950
29951
29952
29953
29954
29955
29956
29957
29958
29959
29960
29961
29962
29963
29964
29965
29966
29967
29968
29969
29970
29971
29972
29973
29974
29975
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
30008
30009
30010
30011
30012
30013
30014
30015
30016
30017
30018
30019
30020
30021
30022
30023
30024
30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
30053
30054
30055
30056
30057
30058
30059
30060
30061
30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
30072
30073
30074
30075
30076
30077
30078
30079
30080
30081
30082
30083
30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
30096
30097
30098
30099
30100
30101
30102
30103
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
30154
30155
30156
30157
30158
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187
30188
30189
30190
30191
30192
30193
30194
30195
30196
30197
30198
30199
30200
30201
30202
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212
30213
30214
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225
30226
30227
30228
30229
30230
30231
30232
30233
30234
30235
30236
30237
30238
30239
30240
30241
30242
30243
30244
30245
30246
30247
30248
30249
30250
30251
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
30275
30276
30277
30278
30279
30280
30281
30282
30283
30284
30285
30286
30287
30288
30289
30290
30291
30292
30293
30294
30295
30296
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
30312
30313
30314
30315
30316
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335
30336
30337
30338
30339
30340
30341
30342
30343
30344
30345
30346
30347
30348
30349
30350
30351
30352
30353
30354
30355
30356
30357
30358
30359
30360
30361
30362
30363
30364
30365
30366
30367
30368
30369
30370
30371
30372
30373
30374
30375
30376
30377
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
30390
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405
30406
30407
30408
30409
30410
30411
30412
30413
30414
30415
30416
30417
30418
30419
30420
30421
30422
30423
30424
30425
30426
30427
30428
30429
30430
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
30446
30447
30448
30449
30450
30451
30452
30453
30454
30455
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480
30481
30482
30483
30484
30485
30486
30487
30488
30489
30490
30491
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
30514
30515
30516
30517
30518
30519
30520
30521
30522
30523
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534
30535
30536
30537
30538
30539
30540
30541
30542
30543
30544
30545
30546
30547
30548
30549
30550
30551
30552
30553
30554
30555
30556
30557
30558
30559
30560
30561
30562
30563
30564
30565
30566
30567
30568
30569
30570
30571
30572
30573
30574
30575
30576
30577
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
30607
30608
30609
30610
30611
30612
30613
30614
30615
30616
30617
30618
30619
30620
30621
30622
30623
30624
30625
30626
30627
30628
30629
30630
30631
30632
30633
30634
30635
30636
30637
30638
30639
30640
30641
30642
30643
30644
30645
30646
30647
30648
30649
30650
30651
30652
30653
30654
30655
30656
30657
30658
30659
30660
30661
30662
30663
30664
30665
30666
30667
30668
30669
30670
30671
30672
30673
30674
30675
30676
30677
30678
30679
30680
30681
30682
30683
30684
30685
30686
30687
30688
30689
30690
30691
30692
30693
30694
30695
30696
30697
30698
30699
30700
30701
30702
30703
30704
30705
30706
30707
30708
30709
30710
30711
30712
30713
30714
30715
30716
30717
30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
30729
30730
30731
30732
30733
30734
30735
30736
30737
30738
30739
30740
30741
30742
30743
30744
30745
30746
30747
30748
30749
30750
30751
30752
30753
30754
30755
30756
30757
30758
30759
30760
30761
30762
30763
30764
30765
30766
30767
30768
30769
30770
30771
30772
30773
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
30789
30790
30791
30792
30793
30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
30808
30809
30810
30811
30812
30813
30814
30815
30816
30817
30818
30819
30820
30821
30822
30823
30824
30825
30826
30827
30828
30829
30830
30831
30832
30833
30834
30835
30836
30837
30838
30839
30840
30841
30842
30843
30844
30845
30846
30847
30848
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
30864
30865
30866
30867
30868
30869
30870
30871
30872
30873
30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
30885
30886
30887
30888
30889
30890
30891
30892
30893
30894
30895
30896
30897
30898
30899
30900
30901
30902
30903
30904
30905
30906
30907
30908
30909
30910
30911
30912
30913
30914
30915
30916
30917
30918
30919
30920
30921
30922
30923
30924
30925
30926
30927
30928
30929
30930
30931
30932
30933
30934
30935
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945
30946
30947
30948
30949
30950
30951
30952
30953
30954
30955
30956
30957
30958
30959
30960
30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977
30978
30979
30980
30981
30982
30983
30984
30985
30986
30987
30988
30989
30990
30991
30992
30993
30994
30995
30996
30997
30998
30999
31000
31001
31002
31003
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
31019
31020
31021
31022
31023
31024
31025
31026
31027
31028
31029
31030
31031
31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
31047
31048
31049
31050
31051
31052
31053
31054
31055
31056
31057
31058
31059
31060
31061
31062
31063
31064
31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
31082
31083
31084
31085
31086
31087
31088
31089
31090
31091
31092
31093
31094
31095
31096
31097
31098
31099
31100
31101
31102
31103
31104
31105
31106
31107
31108
31109
31110
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
31127
31128
31129
31130
31131
31132
31133
31134
31135
31136
31137
31138
31139
31140
31141
31142
31143
31144
31145
31146
31147
31148
31149
31150
31151
31152
31153
31154
31155
31156
31157
31158
31159
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178
31179
31180
31181
31182
31183
31184
31185
31186
31187
31188
31189
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31211
31212
31213
31214
31215
31216
31217
31218
31219
31220
31221
31222
31223
31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
31234
31235
31236
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246
31247
31248
31249
31250
31251
31252
31253
31254
31255
31256
31257
31258
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
31279
31280
31281
31282
31283
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
31299
31300
31301
31302
31303
31304
31305
31306
31307
31308
31309
31310
31311
31312
31313
31314
31315
31316
31317
31318
31319
31320
31321
31322
31323
31324
31325
31326
31327
31328
31329
31330
31331
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31554
31555
31556
31557
31558
31559
31560
31561
31562
31563
31564
31565
31566
31567
31568
31569
31570
31571
31572
31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
31595
31596
31597
31598
31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
31610
31611
31612
31613
31614
31615
31616
31617
31618
31619
31620
31621
31622
31623
31624
31625
31626
31627
31628
31629
31630
31631
31632
31633
31634
31635
31636
31637
31638
31639
31640
31641
31642
31643
31644
31645
31646
31647
31648
31649
31650
31651
31652
31653
31654
31655
31656
31657
31658
31659
31660
31661
31662
31663
31664
31665
31666
31667
31668
31669
31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
31688
31689
31690
31691
31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
31706
31707
31708
31709
31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
31724
31725
31726
31727
31728
31729
31730
31731
31732
31733
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
31749
31750
31751
31752
31753
31754
31755
31756
31757
31758
31759
31760
31761
31762
31763
31764
31765
31766
31767
31768
31769
31770
31771
31772
31773
31774
31775
31776
31777
31778
31779
31780
31781
31782
31783
31784
31785
31786
31787
31788
31789
31790
31791
31792
31793
31794
31795
31796
31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
31808
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
31824
31825
31826
31827
31828
31829
31830
31831
31832
31833
31834
31835
31836
31837
31838
31839
31840
31841
31842
31843
31844
31845
31846
31847
31848
31849
31850
31851
31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
31862
31863
31864
31865
31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
31876
31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
31890
31891
31892
31893
31894
31895
31896
31897
31898
31899
31900
31901
31902
31903
31904
31905
31906
31907
31908
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
31924
31925
31926
31927
31928
31929
31930
31931
31932
31933
31934
31935
31936
31937
31938
31939
31940
31941
31942
31943
31944
31945
31946
31947
31948
31949
31950
31951
31952
31953
31954
31955
31956
31957
31958
31959
31960
31961
31962
31963
31964
31965
31966
31967
31968
31969
31970
31971
31972
31973
31974
31975
31976
31977
31978
31979
31980
31981
31982
31983
31984
31985
31986
31987
31988
31989
31990
31991
31992
31993
31994
31995
31996
31997
31998
31999
32000
32001
32002
32003
32004
32005
32006
32007
32008
32009
32010
32011
32012
32013
32014
32015
32016
32017
32018
32019
32020
32021
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
32037
32038
32039
32040
32041
32042
32043
32044
32045
32046
32047
32048
32049
32050
32051
32052
32053
32054
32055
32056
32057
32058
32059
32060
32061
32062
32063
32064
32065
32066
32067
32068
32069
32070
32071
32072
32073
32074
32075
32076
32077
32078
32079
32080
32081
32082
32083
32084
32085
32086
32087
32088
32089
32090
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
32114
32115
32116
32117
32118
32119
32120
32121
32122
32123
32124
32125
32126
32127
32128
32129
32130
32131
32132
32133
32134
32135
32136
32137
32138
32139
32140
32141
32142
32143
32144
32145
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
32161
32162
32163
32164
32165
32166
32167
32168
32169
32170
32171
32172
32173
32174
32175
32176
32177
32178
32179
32180
32181
32182
32183
32184
32185
32186
32187
32188
32189
32190
32191
32192
32193
32194
32195
32196
32197
32198
32199
32200
32201
32202
32203
32204
32205
32206
32207
32208
32209
32210
32211
32212
32213
32214
32215
32216
32217
32218
32219
32220
32221
32222
32223
32224
32225
32226
32227
32228
32229
32230
32231
32232
32233
32234
32235
32236
32237
32238
32239
32240
32241
32242
32243
32244
32245
32246
32247
32248
32249
32250
32251
32252
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
32268
32269
32270
32271
32272
32273
32274
32275
32276
32277
32278
32279
32280
32281
32282
32283
32284
32285
32286
32287
32288
32289
32290
32291
32292
32293
32294
32295
32296
32297
32298
32299
32300
32301
32302
32303
32304
32305
32306
32307
32308
32309
32310
32311
32312
32313
32314
32315
32316
32317
32318
32319
32320
32321
32322
32323
32324
32325
32326
32327
32328
32329
32330
32331
32332
32333
32334
32335
32336
32337
32338
32339
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355
32356
32357
32358
32359
32360
32361
32362
32363
32364
32365
32366
32367
32368
32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
32391
32392
32393
32394
32395
32396
32397
32398
32399
32400
32401
32402
32403
32404
32405
32406
32407
32408
32409
32410
32411
32412
32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
32424
32425
32426
32427
32428
32429
32430
32431
32432
32433
32434
32435
32436
32437
32438
32439
32440
32441
32442
32443
32444
32445
32446
32447
32448
32449
32450
32451
32452
32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
32465
32466
32467
32468
32469
32470
32471
32472
32473
32474
32475
32476
32477
32478
32479
32480
32481
32482
32483
32484
32485
32486
32487
32488
32489
32490
32491
32492
32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
32523
32524
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
32544
32545
32546
32547
32548
32549
32550
32551
32552
32553
32554
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571
32572
32573
32574
32575
32576
32577
32578
32579
32580
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
32621
32622
32623
32624
32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
32637
32638
32639
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
32653
32654
32655
32656
32657
32658
32659
32660
32661
32662
32663
32664
32665
32666
32667
32668
32669
32670
32671
32672
32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
32684
32685
32686
32687
32688
32689
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
32705
32706
32707
32708
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
32730
32731
32732
32733
32734
32735
32736
32737
32738
32739
32740
32741
32742
32743
32744
32745
32746
32747
32748
32749
32750
32751
32752
32753
32754
32755
32756
32757
32758
32759
32760
32761
32762
32763
32764
32765
32766
32767
32768
32769
32770
32771
32772
32773
32774
32775
32776
32777
32778
32779
32780
32781
32782
32783
32784
32785
32786
32787
32788
32789
32790
32791
32792
32793
32794
32795
32796
32797
32798
32799
32800
32801
32802
32803
32804
32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
32815
32816
32817
32818
32819
32820
32821
32822
32823
32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
32837
32838
32839
32840
32841
32842
32843
32844
32845
32846
32847
32848
32849
32850
32851
32852
32853
32854
32855
32856
32857
32858
32859
32860
32861
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881
32882
32883
32884
32885
32886
32887
32888
32889
32890
32891
32892
32893
32894
32895
32896
32897
32898
32899
32900
32901
32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
32917
32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
32930
32931
32932
32933
32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
32946
32947
32948
32949
32950
32951
32952
32953
32954
32955
32956
32957
32958
32959
32960
32961
32962
32963
32964
32965
32966
32967
32968
32969
32970
32971
32972
32973
32974
32975
32976
32977
32978
32979
32980
32981
32982
32983
32984
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
33011
33012
33013
33014
33015
33016
33017
33018
33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
33030
33031
33032
33033
33034
33035
33036
33037
33038
33039
33040
33041
33042
33043
33044
33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
33056
33057
33058
33059
33060
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
33076
33077
33078
33079
33080
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
33100
33101
33102
33103
33104
33105
33106
33107
33108
33109
33110
33111
33112
33113
33114
33115
33116
33117
33118
33119
33120
33121
33122
33123
33124
33125
33126
33127
33128
33129
33130
33131
33132
33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
33144
33145
33146
33147
33148
33149
33150
33151
33152
33153
33154
33155
33156
33157
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
33173
33174
33175
33176
33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
33188
33189
33190
33191
33192
33193
33194
33195
33196
33197
33198
33199
33200
33201
33202
33203
33204
33205
33206
33207
33208
33209
33210
33211
33212
33213
33214
33215
33216
33217
33218
33219
33220
33221
33222
33223
33224
33225
33226
33227
33228
33229
33230
33231
33232
33233
33234
33235
33236
33237
33238
33239
33240
33241
33242
33243
33244
33245
33246
33247
33248
33249
33250
33251
33252
33253
33254
33255
33256
33257
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
33275
33276
33277
33278
33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321
33322
33323
33324
33325
33326
33327
33328
33329
33330
33331
33332
33333
33334
33335
33336
33337
33338
33339
33340
33341
33342
33343
33344
33345
33346
33347
33348
33349
33350
33351
33352
33353
33354
33355
33356
33357
33358
33359
33360
33361
33362
33363
33364
33365
33366
33367
33368
33369
33370
33371
33372
33373
33374
33375
33376
33377
33378
33379
33380
33381
33382
33383
33384
33385
33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
33412
33413
33414
33415
33416
33417
33418
33419
33420
33421
33422
33423
33424
33425
33426
33427
33428
33429
33430
33431
33432
33433
33434
33435
33436
33437
33438
33439
33440
33441
33442
33443
33444
33445
33446
33447
33448
33449
33450
33451
33452
33453
33454
33455
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
33471
33472
33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
33484
33485
33486
33487
33488
33489
33490
33491
33492
33493
33494
33495
33496
33497
33498
33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
33510
33511
33512
33513
33514
33515
33516
33517
33518
33519
33520
33521
33522
33523
33524
33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
33536
33537
33538
33539
33540
33541
33542
33543
33544
33545
33546
33547
33548
33549
33550
33551
33552
33553
33554
33555
33556
33557
33558
33559
33560
33561
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
33580
33581
33582
33583
33584
33585
33586
33587
33588
33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629
33630
33631
33632
33633
33634
33635
33636
33637
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
33694
33695
33696
33697
33698
33699
33700
33701
33702
33703
33704
33705
33706
33707
33708
33709
33710
33711
33712
33713
33714
33715
33716
33717
33718
33719
33720
33721
33722
33723
33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
33736
33737
33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
33755
33756
33757
33758
33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
33776
33777
33778
33779
33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
33797
33798
33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
33826
33827
33828
33829
33830
33831
33832
33833
33834
33835
33836
33837
33838
33839
33840
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
33859
33860
33861
33862
33863
33864
33865
33866
33867
33868
33869
33870
33871
33872
33873
33874
33875
33876
33877
33878
33879
33880
33881
33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
33897
33898
33899
33900
33901
33902
33903
33904
33905
33906
33907
33908
33909
33910
33911
33912
33913
33914
33915
33916
33917
33918
33919
33920
33921
33922
33923
33924
33925
33926
33927
33928
33929
33930
33931
33932
33933
33934
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986
33987
33988
33989
33990
33991
33992
33993
33994
33995
33996
33997
33998
33999
34000
34001
34002
34003
34004
34005
34006
34007
34008
34009
34010
34011
34012
34013
34014
34015
34016
34017
34018
34019
34020
34021
34022
34023
34024
34025
34026
34027
34028
34029
34030
34031
34032
34033
34034
34035
34036
34037
34038
34039
34040
34041
34042
34043
34044
34045
34046
34047
34048
34049
34050
34051
34052
34053
34054
34055
34056
34057
34058
34059
34060
34061
34062
34063
34064
34065
34066
34067
34068
34069
34070
34071
34072
34073
34074
34075
34076
34077
34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
34098
34099
34100
34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
34120
34121
34122
34123
34124
34125
34126
34127
34128
34129
34130
34131
34132
34133
34134
34135
34136
34137
34138
34139
34140
34141
34142
34143
34144
34145
34146
34147
34148
34149
34150
34151
34152
34153
34154
34155
34156
34157
34158
34159
34160
34161
34162
34163
34164
34165
34166
34167
34168
34169
34170
34171
34172
34173
34174
34175
34176
34177
34178
34179
34180
34181
34182
34183
34184
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
34200
34201
34202
34203
34204
34205
34206
34207
34208
34209
34210
34211
34212
34213
34214
34215
34216
34217
34218
34219
34220
34221
34222
34223
34224
34225
34226
34227
34228
34229
34230
34231
34232
34233
34234
34235
34236
34237
34238
34239
34240
34241
34242
34243
34244
34245
34246
34247
34248
34249
34250
34251
34252
34253
34254
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
34270
34271
34272
34273
34274
34275
34276
34277
34278
34279
34280
34281
34282
34283
34284
34285
34286
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
34313
34314
34315
34316
34317
34318
34319
34320
34321
34322
34323
34324
34325
34326
34327
34328
34329
34330
34331
34332
34333
34334
34335
34336
34337
34338
34339
34340
34341
34342
34343
34344
34345
34346
34347
34348
34349
34350
34351
34352
34353
34354
34355
34356
34357
34358
34359
34360
34361
34362
34363
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
34379
34380
34381
34382
34383
34384
34385
34386
34387
34388
34389
34390
34391
34392
34393
34394
34395
34396
34397
34398
34399
34400
34401
34402
34403
34404
34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
34420
34421
34422
34423
34424
34425
34426
34427
34428
34429
34430
34431
34432
34433
34434
34435
34436
34437
34438
34439
34440
34441
34442
34443
34444
34445
34446
34447
34448
34449
34450
34451
34452
34453
34454
34455
34456
34457
34458
34459
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471
34472
34473
34474
34475
34476
34477
34478
34479
34480
34481
34482
34483
34484
34485
34486
34487
34488
34489
34490
34491
34492
34493
34494
34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
34506
34507
34508
34509
34510
34511
34512
34513
34514
34515
34516
34517
34518
34519
34520
34521
34522
34523
34524
34525
34526
34527
34528
34529
34530
34531
34532
34533
34534
34535
34536
34537
34538
34539
34540
34541
34542
34543
34544
34545
34546
34547
34548
34549
34550
34551
34552
34553
34554
34555
34556
34557
34558
34559
34560
34561
34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
34577
34578
34579
34580
34581
34582
34583
34584
34585
34586
34587
34588
34589
34590
34591
34592
34593
34594
34595
34596
34597
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
34613
34614
34615
34616
34617
34618
34619
34620
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
34636
34637
34638
34639
34640
34641
34642
34643
34644
34645
34646
34647
34648
34649
34650
34651
34652
34653
34654
34655
34656
34657
34658
34659
34660
34661
34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
34673
34674
34675
34676
34677
34678
34679
34680
34681
34682
34683
34684
34685
34686
34687
34688
34689
34690
34691
34692
34693
34694
34695
34696
34697
34698
34699
34700
34701
34702
34703
34704
34705
34706
34707
34708
34709
34710
34711
34712
34713
34714
34715
34716
34717
34718
34719
34720
34721
34722
34723
34724
34725
34726
34727
34728
34729
34730
34731
34732
34733
34734
34735
34736
34737
34738
34739
34740
34741
34742
34743
34744
34745
34746
34747
34748
34749
34750
34751
34752
34753
34754
34755
34756
34757
34758
34759
34760
34761
34762
34763
34764
34765
34766
34767
34768
34769
34770
34771
34772
34773
34774
34775
34776
34777
34778
34779
34780
34781
34782
34783
34784
34785
34786
34787
34788
34789
34790
34791
34792
34793
34794
34795
34796
34797
34798
34799
34800
34801
34802
34803
34804
34805
34806
34807
34808
34809
34810
34811
34812
34813
34814
34815
34816
34817
34818
34819
34820
34821
34822
34823
34824
34825
34826
34827
34828
34829
34830
34831
34832
34833
34834
34835
34836
34837
34838
34839
34840
34841
34842
34843
34844
34845
34846
34847
34848
34849
34850
34851
34852
34853
34854
34855
34856
34857
34858
34859
34860
34861
34862
34863
34864
34865
34866
34867
34868
34869
34870
34871
34872
34873
34874
34875
34876
34877
34878
34879
34880
34881
34882
34883
34884
34885
34886
34887
34888
34889
34890
34891
34892
34893
34894
34895
34896
34897
34898
34899
34900
34901
34902
34903
34904
34905
34906
34907
34908
34909
34910
34911
34912
34913
34914
34915
34916
34917
34918
34919
34920
34921
34922
34923
34924
34925
34926
34927
34928
34929
34930
34931
34932
34933
34934
34935
34936
34937
34938
34939
34940
34941
34942
34943
34944
34945
34946
34947
34948
34949
34950
34951
34952
34953
34954
34955
34956
34957
34958
34959
34960
34961
34962
34963
34964
34965
34966
34967
34968
34969
34970
34971
34972
34973
34974
34975
34976
34977
34978
34979
34980
34981
34982
34983
34984
34985
34986
34987
34988
34989
34990
34991
34992
34993
34994
34995
34996
34997
34998
34999
35000
35001
35002
35003
35004
35005
35006
35007
35008
35009
35010
35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
35023
35024
35025
35026
35027
35028
35029
35030
35031
35032
35033
35034
35035
35036
35037
35038
35039
35040
35041
35042
35043
35044
35045
35046
35047
35048
35049
35050
35051
35052
35053
35054
35055
35056
35057
35058
35059
35060
35061
35062
35063
35064
35065
35066
35067
35068
35069
35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080
35081
35082
35083
35084
35085
35086
35087
35088
35089
35090
35091
35092
35093
35094
35095
35096
35097
35098
35099
35100
35101
35102
35103
35104
35105
35106
35107
35108
35109
35110
35111
35112
35113
35114
35115
35116
35117
35118
35119
35120
35121
35122
35123
35124
35125
35126
35127
35128
35129
35130
35131
35132
35133
35134
35135
35136
35137
35138
35139
35140
35141
35142
35143
35144
35145
35146
35147
35148
35149
35150
35151
35152
35153
35154
35155
35156
35157
35158
35159
35160
35161
35162
35163
35164
35165
35166
35167
35168
35169
35170
35171
35172
35173
35174
35175
35176
35177
35178
35179
35180
35181
35182
35183
35184
35185
35186
35187
35188
35189
35190
35191
35192
35193
35194
35195
35196
35197
35198
35199
35200
35201
35202
35203
35204
35205
35206
35207
35208
35209
35210
35211
35212
35213
35214
35215
35216
35217
35218
35219
35220
35221
35222
35223
35224
35225
35226
35227
35228
35229
35230
35231
35232
35233
35234
35235
35236
35237
35238
35239
35240
35241
35242
35243
35244
35245
35246
35247
35248
35249
35250
35251
35252
35253
35254
35255
35256
35257
35258
35259
35260
35261
35262
35263
35264
35265
35266
35267
35268
35269
35270
35271
35272
35273
35274
35275
35276
35277
35278
35279
35280
35281
35282
35283
35284
35285
35286
35287
35288
35289
35290
35291
35292
35293
35294
35295
35296
35297
35298
35299
35300
35301
35302
35303
35304
35305
35306
35307
35308
35309
35310
35311
35312
35313
35314
35315
35316
35317
35318
35319
35320
35321
35322
35323
35324
35325
35326
35327
35328
35329
35330
35331
35332
35333
35334
35335
35336
35337
35338
35339
35340
35341
35342
35343
35344
35345
35346
35347
35348
35349
35350
35351
35352
35353
35354
35355
35356
35357
35358
35359
35360
35361
35362
35363
35364
35365
35366
35367
35368
35369
35370
35371
35372
35373
35374
35375
35376
35377
35378
35379
35380
35381
35382
35383
35384
35385
35386
35387
35388
35389
35390
35391
35392
35393
35394
35395
35396
35397
35398
35399
35400
35401
35402
35403
35404
35405
35406
35407
35408
35409
35410
35411
35412
35413
35414
35415
35416
35417
35418
35419
35420
35421
35422
35423
35424
35425
35426
35427
35428
35429
35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
35441
35442
35443
35444
35445
35446
35447
35448
35449
35450
35451
35452
35453
35454
35455
35456
35457
35458
35459
35460
35461
35462
35463
35464
35465
35466
35467
35468
35469
35470
35471
35472
35473
35474
35475
35476
35477
35478
35479
35480
35481
35482
35483
35484
35485
35486
35487
35488
35489
35490
35491
35492
35493
35494
35495
35496
35497
35498
35499
35500
35501
35502
35503
35504
35505
35506
35507
35508
35509
35510
35511
35512
35513
35514
35515
35516
35517
35518
35519
35520
35521
35522
35523
35524
35525
35526
35527
35528
35529
35530
35531
35532
35533
35534
35535
35536
35537
35538
35539
35540
35541
35542
35543
35544
35545
35546
35547
35548
35549
35550
35551
35552
35553
35554
35555
35556
35557
35558
35559
35560
35561
35562
35563
35564
35565
35566
35567
35568
35569
35570
35571
35572
35573
35574
35575
35576
35577
35578
35579
35580
35581
35582
35583
35584
35585
35586
35587
35588
35589
35590
35591
35592
35593
35594
35595
35596
35597
35598
35599
35600
35601
35602
35603
35604
35605
35606
35607
35608
35609
35610
35611
35612
35613
35614
35615
35616
35617
35618
35619
35620
35621
35622
35623
35624
35625
35626
35627
35628
35629
35630
35631
35632
35633
35634
35635
35636
35637
35638
35639
35640
35641
35642
35643
35644
35645
35646
35647
35648
35649
35650
35651
35652
35653
35654
35655
35656
35657
35658
35659
35660
35661
35662
35663
35664
35665
35666
35667
35668
35669
35670
35671
35672
35673
35674
35675
35676
35677
35678
35679
35680
35681
35682
35683
35684
35685
35686
35687
35688
35689
35690
35691
35692
35693
35694
35695
35696
35697
35698
35699
35700
35701
35702
35703
35704
35705
35706
35707
35708
35709
35710
35711
35712
35713
35714
35715
35716
35717
35718
35719
35720
35721
35722
35723
35724
35725
35726
35727
35728
35729
35730
35731
35732
35733
35734
35735
35736
35737
35738
35739
35740
35741
35742
35743
35744
35745
35746
35747
35748
35749
35750
35751
35752
35753
35754
35755
35756
35757
35758
35759
35760
35761
35762
35763
35764
35765
35766
35767
35768
35769
35770
35771
35772
35773
35774
35775
35776
35777
35778
35779
35780
35781
35782
35783
35784
35785
35786
35787
35788
35789
35790
35791
35792
35793
35794
35795
35796
35797
35798
35799
35800
35801
35802
35803
35804
35805
35806
35807
35808
35809
35810
35811
35812
35813
35814
35815
35816
35817
35818
35819
35820
35821
35822
35823
35824
35825
35826
35827
35828
35829
35830
35831
35832
35833
35834
35835
35836
35837
35838
35839
35840
35841
35842
35843
35844
35845
35846
35847
35848
35849
35850
35851
35852
35853
35854
35855
35856
35857
35858
35859
35860
35861
35862
35863
35864
35865
35866
35867
35868
35869
35870
35871
35872
35873
35874
35875
35876
35877
35878
35879
35880
35881
35882
35883
35884
35885
35886
35887
35888
35889
35890
35891
35892
35893
35894
35895
35896
35897
35898
35899
35900
35901
35902
35903
35904
35905
35906
35907
35908
35909
35910
35911
35912
35913
35914
35915
35916
35917
35918
35919
35920
35921
35922
35923
35924
35925
35926
35927
35928
35929
35930
35931
35932
35933
35934
35935
35936
35937
35938
35939
35940
35941
35942
35943
35944
35945
35946
35947
35948
35949
35950
35951
35952
35953
35954
35955
35956
35957
35958
35959
35960
35961
35962
35963
35964
35965
35966
35967
35968
35969
35970
35971
35972
35973
35974
35975
35976
35977
35978
35979
35980
35981
35982
35983
35984
35985
35986
35987
35988
35989
35990
35991
35992
35993
35994
35995
35996
35997
35998
35999
36000
36001
36002
36003
36004
36005
36006
36007
36008
36009
36010
36011
36012
36013
36014
36015
36016
36017
36018
36019
36020
36021
36022
36023
36024
36025
36026
36027
36028
36029
36030
36031
36032
36033
36034
36035
36036
36037
36038
36039
36040
36041
36042
36043
36044
36045
36046
36047
36048
36049
36050
36051
36052
36053
36054
36055
36056
36057
36058
36059
36060
36061
36062
36063
36064
36065
36066
36067
36068
36069
36070
36071
36072
36073
36074
36075
36076
36077
36078
36079
36080
36081
36082
36083
36084
36085
36086
36087
36088
36089
36090
36091
36092
36093
36094
36095
36096
36097
36098
36099
36100
36101
36102
36103
36104
36105
36106
36107
36108
36109
36110
36111
36112
36113
36114
36115
36116
36117
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
36134
36135
36136
36137
36138
36139
36140
36141
36142
36143
36144
36145
36146
36147
36148
36149
36150
36151
36152
36153
36154
36155
36156
36157
36158
36159
36160
36161
36162
36163
36164
36165
36166
36167
36168
36169
36170
36171
36172
36173
36174
36175
36176
36177
36178
36179
36180
36181
36182
36183
36184
36185
36186
36187
36188
36189
36190
36191
36192
36193
36194
36195
36196
36197
36198
36199
36200
36201
36202
36203
36204
36205
36206
36207
36208
36209
36210
36211
36212
36213
36214
36215
36216
36217
36218
36219
36220
36221
36222
36223
36224
36225
36226
36227
36228
36229
36230
36231
36232
36233
36234
36235
36236
36237
36238
36239
36240
36241
36242
36243
36244
36245
36246
36247
36248
36249
36250
36251
36252
36253
36254
36255
36256
36257
36258
36259
36260
36261
36262
36263
36264
36265
36266
36267
36268
36269
36270
36271
36272
36273
36274
36275
36276
36277
36278
36279
36280
36281
36282
36283
36284
36285
36286
36287
36288
36289
36290
36291
36292
36293
36294
36295
36296
36297
36298
36299
36300
36301
36302
36303
36304
36305
36306
36307
36308
36309
36310
36311
36312
36313
36314
36315
36316
36317
36318
36319
36320
36321
36322
36323
36324
36325
36326
36327
36328
36329
36330
36331
36332
36333
36334
36335
36336
36337
36338
36339
36340
36341
36342
36343
36344
36345
36346
36347
36348
36349
36350
36351
36352
36353
36354
36355
36356
36357
36358
36359
36360
36361
36362
36363
36364
36365
36366
36367
36368
36369
36370
36371
36372
36373
36374
36375
36376
36377
36378
36379
36380
36381
36382
36383
36384
36385
36386
36387
36388
36389
36390
36391
36392
36393
36394
36395
36396
36397
36398
36399
36400
36401
36402
36403
36404
36405
36406
36407
36408
36409
36410
36411
36412
36413
36414
36415
36416
36417
36418
36419
36420
36421
36422
36423
36424
36425
36426
36427
2022-02-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-08  Palmer Dabbelt  <palmer@rivosinc.com>

	RISC-V: Stop reporting warnings for mismatched extension versions
	The extension version checking logic is really just too complicated to
	encode into the linker, trying to do so causes more harm than good.
	This removes the checks and the associated tests, leaving the logic to
	keep the largest version of each extension linked into the target.

	bfd/

		* elfnn-riscv.c (riscv_version_mismatch): Rename to
		riscv_update_subset_version, and stop reporting warnings on
		version mismatches.
		(riscv_merge_std_ext): Adjust calls to riscv_version_mismatch.
		(riscv_merge_multi_letter_ext): Likewise.

	ld/
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Remove
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-01a.s: Likewise
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-01b.s: Likewise
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: Likewise
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-02a.s: Likewise
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-02b.s: Likewise
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-02c.s: Likewise
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-02d.s: Likewise
		* testsuite/ld-riscv-elf/attr-merge-user-ext-01.d: New test.
		* testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p0.s:
		Likewise.
		* testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p1.s:
		Likewise.
		* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Remove obselete
		attr-merge-arch-failed-{01,02}, replace with
		attr-merge-user-ext-01.

2022-02-08  H.J. Lu  <hjl.tools@gmail.com>

	i386: Allow GOT32 relocations against ABS symbols
	GOT32 relocations are allowed since absolute value + addend is stored in
	the GOT slot.

	Tested on glibc 2.35 build with GCC 11.2 and -Os.

	bfd/

		PR ld/28870
		* elfxx-x86.c (_bfd_elf_x86_valid_reloc_p): Also allow GOT32
		relocations.

	ld/

		PR ld/28870
		* testsuite/ld-i386/i386.exp: Run pr28870.
		* testsuite/ld-i386/pr28870.d: New file.
		* testsuite/ld-i386/pr28870.s: Likewise.

	(cherry picked from commit 30a954525f4e53a9cd50a1a8a6f201c7cf6595c7)

2022-02-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-07  Alan Modra  <amodra@gmail.com>

	Revert "elf: Remove the 1-page gap before the RELRO segment"
	This reverts commit 2f83249c13d86065b4c7cdb198ea871017b4bba1.

		PR ld/28743
		* ldlang.c (lang_size_relro_segment_1): Revert 2022-01-10 changes.
		* testsuite/ld-i386/pr20830.d: Likewise.
		* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
		* testsuite/ld-x86-64/pr14207.d: Likewise.
		* testsuite/ld-x86-64/pr18176.d: Likewise.
		* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
		* testsuite/ld-x86-64/pr20830a.d: Likewise.
		* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
		* testsuite/ld-x86-64/pr20830b.d: Likewise.
		* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038a.d: Likewise.
		* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038c.d: Likewise.

2022-02-07  Alan Modra  <amodra@gmail.com>

	Revert "ld: Rewrite lang_size_relro_segment_1"
	This reverts commit 8b7c6a1fbab5b0efc6abb50cdb24aef3954ac018.

		PR ld/28743
		PR ld/28819
		* ldlang.c (lang_size_relro_segment_1): Revert 2022-01-14 change.
		testsuite/ld-x86-64/pr28743-1.d: Likewise.
		testsuite/ld-x86-64/pr28743-1.s: Likewise.
		testsuite/ld-x86-64/x86-64.exp: Likewise.

2022-02-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-05  H.J. Lu  <hjl.tools@gmail.com>

	x86: Skip undefined symbol when finishing DT_RELR
	Don't abort for undefined symbol when finishing DT_RELR.  Instead, skip
	undefined symbol.  Undefined symbol will be reported by relocate_section.

		* elfxx-x86.c (elf_x86_size_or_finish_relative_reloc): Skip
		undefined symbol in finishing phase.

	(cherry picked from commit a9e61227c09c03d5cb54f9c88520baffc1d86c86)

2022-02-05  Alan Modra  <amodra@gmail.com>

	PR28827 testcase
	This testcase triggers a stub sizing error with the patches applied
	for PR28743 (commit 2f83249c13d8 and c804c6f98d34).

		PR 28827
		* testsuite/ld-powerpc/pr28827-1.s,
		* testsuite/ld-powerpc/pr28827-1.d: New test.
		* testsuite/ld-powerpc/powerpc.exp: Run it.

	(cherry picked from commit 9810db10f726f47c8e878ca4b0b4b4f5e9c16a5d)
	(cherry picked from commit 0acf434a23768449cbb4b3732355f3f2febecaee)

2022-02-05  Alan Modra  <amodra@gmail.com>

	Enable "size" as a dumpprog in ld
	binutils/
		* testsuite/lib/binutils-common.exp (run_dump_test): Reference
		global SIZE and SIZEFLAGS.
	ld/
		* testsuite/config/default.exp: Define SIZE and SIZEFLAGS.

	(cherry picked from commit cd8adbf3017272877c7e196e2e326f888f207bd9)

2022-02-05  Alan Modra  <amodra@gmail.com>

	Detect .eh_frame_hdr earlier for SIZEOF_HEADERS
	Current code detects the need for PT_GNU_EH_FRAME using a field set by
	_bfd_elf_discard_section_eh_frame_hdr, which is called fairly late in
	the linking process.  Use the elf hash table eh_info instead, which is
	set up earlier by size_dynamic_sections.

		* elf-bfd.h (struct output_elf_obj_tdata): Delete eh_frame_hdr.
		(elf_eh_frame_hdr): Don't define.
		(_bfd_elf_discard_section_eh_frame_hdr): Update prototype.
		* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Delete
		abfd parameter.  Don't set elf_eh_frame_hdr.
		* elf.c (elf_eh_frame_hdr): New function.
		(get_program_header_size): Adjust elf_eh_frame_hdr call.
		(_bfd_elf_map_sections_to_segments): Likewise.

	(cherry picked from commit 8df52eeeb06efcccd6b840689ad8e11ebb264e7f)

2022-02-05  Alan Modra  <amodra@gmail.com>

	PowerPC64 treatment of absolute symbols
	Supporting -static-pie on PowerPC64 requires the linker to properly
	treat SHN_ABS symbols for cases like glibc's _nl_current_LC_CTYPE_used
	absolute symbol.  I've been slow to fix the linker on powerpc because
	there is some chance that this will break some shared libraries or
	PIEs.

	bfd/
		* elf64-ppc.c (ppc64_elf_check_relocs): Consolidate local sym
		handling code.  Don't count dyn relocs against non-dynamic
		absolute symbols.
		(dec_dynrel_count): Adjust to suit.
		(ppc64_elf_edit_toc): Don't remove entries for absolute symbols
		when pic.
		(allocate_got): Don't allocate space for got relocs against
		non-dynamic absolute syms.
		(ppc64_elf_layout_multitoc): Likewise.
		(got_and_plt_relr): Likewise.
		(ppc64_elf_size_dynamic_sections): Likewise for local got.
		(got_and_plt_relr_for_local_syms): Likewise.
		(ppc64_elf_size_stubs): Don't allocate space for relr either.
		(ppc64_elf_relocate_section): Don't write relocs against non-dynamic
		absolute symbols.  Don't optimise got and toc code sequences
		loading absolute symbol entries.
	ld/
		* testsuite/ld-powerpc/abs-reloc.s,
		* testsuite/ld-powerpc/abs-static.d,
		* testsuite/ld-powerpc/abs-static.r,
		* testsuite/ld-powerpc/abs-pie.d,
		* testsuite/ld-powerpc/abs-pie.r,
		* testsuite/ld-powerpc/abs-shared.d,
		* testsuite/ld-powerpc/abs-shared.r,
		* testsuite/ld-powerpc/abs-pie-relr.d,
		* testsuite/ld-powerpc/abs-pie-relr.r,
		* testsuite/ld-powerpc/abs-shared-relr.d,
		* testsuite/ld-powerpc/abs-shared-relr.r: New tests.
		* testsuite/ld-powerpc/powerpc.exp: Run them.

	(cherry picked from commit 3a3a4c1fe4ccb1914d29fbf8f5930d55aacec78f)

2022-02-05  Alan Modra  <amodra@gmail.com>

	PR28827, assertion building LLVM 9 on powerpc64le-linux-gnu
	The assertion is this one in ppc_build_one_stub
	  BFD_ASSERT (stub_entry->stub_offset >= stub_entry->group->stub_sec->size);
	It is checking that a stub doesn't overwrite the tail of a previous
	stub, so not something trivial.

	Normally, stub sizing iterates until no stubs are added, detected by
	no change in stub section size.  Iteration also continues if no stubs
	are added but one or more stubs increases in size, which also can be
	detected by a change in stub section size.  But there is a
	pathological case where stub section sizing decreases one iteration
	then increases the next.  To handle that situation, stub sizing also
	stops at more than STUB_SHRINK_ITER (20) iterations when calculated
	stub section size is smaller.  The previous larger size is kept for
	the actual layout (so that building the stubs, which behaves like
	another iteration of stub sizing, will see the stub section sizes
	shrink).  The problem with that stopping condition is that it assumes
	that stub sizing is only affected by addresses external to the stub
	sections, which isn't always true.

	This patch fixes that by also keeping larger individual stub_offset
	addresses past STUB_SHRINK_ITER.  It also catches a further
	pathological case where one stub shrinks and another expands in such a
	way that no stub section size change is seen.

		PR 28827
		* elf64-ppc.c (struct ppc_link_hash_table): Add stub_changed.
		(STUB_SHRINK_ITER): Move earlier in file.
		(ppc_size_one_stub): Detect any change in stub_offset.  Keep
		larger one if past STUB_SHRINK_ITER.
		(ppc64_elf_size_stubs): Iterate on stub_changed too.

	(cherry picked from commit 0441f94fba61998b4bd18487aacf70a672df099c)

	Re: PR28827, assertion building LLVM 9 on powerpc64le-linux-gnu

	The previous patch wasn't quite correct.  The size and padding depends
	on offset used in the current iteration, and if we're fudging the
	offset past STUB_SHRINK_ITER then we'd better use that offset.  We
	can't have plt_stub_pad using stub_sec->size as the offset.

		PR 28827
		* elf64-ppc.c (plt_stub_pad): Add stub_off param.
		(ppc_size_one_stub): Set up stub_offset to value used in this
		iteration before sizing the stub.  Adjust plt_stub_pad calls.

	(cherry picked from commit 2405fc4016feadea33cb747d5654514f62b74ff4)

	Re: PR28827, assertion building LLVM 9 on powerpc64le-linux-gnu

	In trying to find a testcase for PR28827, I managed to hit a linker
	error in bfd_set_section_contents with a .branch_lt input section
	being too large for the output .branch_lt.

	bfd/
		PR 28827
		* elf64-ppc.c (ppc64_elf_size_stubs): Set section size to
		maxsize past STUB_SHRINK_ITER before laying out.  Remove now
		unnecessary conditional setting of maxsize at start of loop.
	ld/
		* testsuite/ld-powerpc/pr28827-2.d,
		* testsuite/ld-powerpc/pr28827-2.lnk,
		* testsuite/ld-powerpc/pr28827-2.s: New test.
		* testsuite/ld-powerpc/powerpc.exp: Run it.

	(cherry picked from commit 9ff8aa7d418bc508dbd429576b93e30ed9dc5891)

2022-02-05  Alan Modra  <amodra@gmail.com>

	Update PowerPC64 symtocbase test
	Using a symbol other than .TOC. with @tocbase is an extension to the
	ABI.  It is never valid to use a symbol without a definition in the
	binary, and symbols on these expressions cannot be overridden.  Make
	this explicit by using ".hidden" in the testcase.

		* testsuite/ld-powerpc/symtocbase-1.s: Align data.  Make function
		entry symbol hidden.
		* testsuite/ld-powerpc/symtocbase-2.s: Likewise.
		* testsuite/ld-powerpc/symtocbase.d: Adjust expected output.

	(cherry picked from commit ef5684c2bdf4d4f9975650e3b7b8f9b0ff98abee)

2022-02-05  Alan Modra  <amodra@gmail.com>

	objcopy --only-keep-debug
	From: Peilin Ye <peilin.ye@bytedance.com>
	objcopy's --only-keep-debug option has been broken for ELF files since
	commit 8c803a2dd7d3.

	  1. binutils/objcopy.c:setup_section() marks non-debug sections as
	     SHT_NOBITS, then calls bfd_copy_private_section_data();
	  2. If ISEC and OSEC share the same section flags,
	     bfd/elf.c:_bfd_elf_init_private_section_data() restores OSEC's
	     section type back to ISEC's section type, effectively undoing
	     "make_nobits".

		* objcopy.c (setup_section): Act on make_nobits after calling
		bfd_copy_private_section_data.

	(cherry picked from commit 7c4643efe7befea8e5063e8b56c0400fd8cee2d5)

2022-02-05  Alan Modra  <amodra@gmail.com>

	PR28826 x86_64 ld segfaults building xen
	Fallout from commit e86fc4a5bc37

		PR 28826
		* coffgen.c (coff_write_alien_symbol): Init dummy to zeros.

	(cherry picked from commit 07c9f243b3a12cc6749bc02ee7b165859979348b)

2022-02-05  Alan Modra  <amodra@gmail.com>

	PR28753, buffer overflow in read_section_stabs_debugging_info
		PR 28753
		* rddbg.c (read_section_stabs_debugging_info): Don't read past
		end of section when concatentating stab strings.

	(cherry picked from commit 085b299b71721e15f5c5c5344dc3e4e4536dadba)

2022-02-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-03  H.J. Lu  <hjl.tools@gmail.com>

	x86: Update X86_64_GOT_TYPE_P to cover more GOT relocations
	Add R_X86_64_GOT32, R_X86_64_GOT64, R_X86_64_GOTPCREL64 and
	R_X86_64_GOTPLT64 to X86_64_GOT_TYPE_P to cover more GOT relocations.

		PR ld/28858
		* elfxx-x86.h (X86_64_GOT_TYPE_P): Add R_X86_64_GOT32,
		R_X86_64_GOT64, R_X86_64_GOTPCREL64 and R_X86_64_GOTPLT64.

	(cherry picked from commit 8d26ee1cd166b8565df17c82e7ecc9d35b5a367f)

2022-02-03  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-02  Nick Clifton  <nickc@redhat.com>

	Stop the BFD library from complaining that dwarf debug string sections are too big.
		PR 28834
		* dwarf2.c (read_section): Change the heuristic that checks for
		overlarge dwarf debug info sections.

	Updated French translation for the ld/ and gold/ sub-directories

2022-02-02  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-02-01  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-31  Nick Clifton  <nickc@redhat.com>

	Import a patch from the GCC mainline to fix an infinite recursion in the Rust demangler.
		PR 98886
		PR 99935
		* rust-demangle.c (struct rust_demangler): Add a recursion
		counter.
		(demangle_path): Increment/decrement the recursion counter upon
		entry and exit.  Fail if the counter exceeds a fixed limit.
		(demangle_type): Likewise.
		(rust_demangle_callback): Initialise the recursion counter,
		disabling if requested by the option flags.

2022-01-31  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-30  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-29  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-28  Nick Clifton  <nickc@redhat.com>

	Updated French translation for the gas sub-directory

2022-01-28  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-27  Nick Clifton  <nickc@redhat.com>

	Updated Swedish translation for the binutils subdirectory

2022-01-27  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-26  H.J. Lu  <hjl.tools@gmail.com>

	ld: Rewrite lang_size_relro_segment_1
	1. Compute the desired PT_GNU_RELRO segment base and find the maximum
	section alignment of sections starting from the PT_GNU_RELRO segment.
	2. Find the first preceding load section.
	3. Don't add the 1-page gap between the first preceding load section and
	the relro segment if the maximum page size >= the maximum section
	alignment.  Align the PT_GNU_RELRO segment first.  Subtract the maximum
	page size if therer is still a 1-page gap.

		PR ld/28743
		PR ld/28819
		* ldlang.c (lang_size_relro_segment_1): Rewrite.
		* testsuite/ld-x86-64/pr28743-1.d: New file.
		* testsuite/ld-x86-64/pr28743-1.s: Likewise.
		* testsuite/ld-x86-64/x86-64.exp: Run pr28743-1.

	(cherry picked from commit c804c6f98d342c3d46f73d7a7ec6229d5ab1c9f3)

2022-01-26  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-25  Klaus Ziegler  <klausz@haus-gisela.de>

	Fix problem building binutils on SPARC/amd64
		PR 28816
		* elf/common.h (AT_SUN_HWCAP): Make definition conditional.

2022-01-25  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-24  Martin Sebor  <msebor@redhat.com>

	Fix a problem building the libiberty library with gcc-12.
		PR 28779
		* regex.c: Suppress -Wuse-after-free.

2022-01-24  Nick Clifton  <nickc@redhat.com>

	Update Bulgarian, French, Romaniam and Ukranian translation for some of the sub-directories

	Restore accidentally deleted allocfail.sh source file

2022-01-24  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-23  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-22  Martin Storsj?  <martin@martin.st>

	Allow inferring tmp_prefix from the dll name from a def file

2022-01-22  Alexander von Gluck IV  <kallisti5@unixzen.com>

	Adjust default page sizes for haiku arm.
		* configure.tgt (arm-haiku): Fix typo.
		* emulparams/armelf_haiku.su (MAXPAGESIZE): Use the default value.
		(COMMONPAGESIZE): Likewise.

2022-01-22  Nick Clifton  <nickc@redhat.com>

	CHange version number to 2.37.90 and regenerate files

	Add markers for 2.38 branch

2022-01-22  Lifang Xia  <lifang_xia@linux.alibaba.com>

	RISC-V: create new frag after alignment.
	PR 28793:

	The alignment may be removed in linker. We need to create new frag after
	alignment to prevent the assembler from computing static offsets.

	gas/
		* config/tc-riscv.c (riscv_frag_align_code): Create new frag.

2022-01-22  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-21  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: include gdbsupport/buildargv.h in ser-mingw.c
	Fixes:

	      CXX    ser-mingw.o
	    /home/simark/src/binutils-gdb/gdb/ser-mingw.c: In function ‘int pipe_windows_open(serial*, const char*)’:
	    /home/simark/src/binutils-gdb/gdb/ser-mingw.c:870:3: error: ‘gdb_argv’ was not declared in this scope
	      870 |   gdb_argv argv (name);
	          |   ^~~~~~~~

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28802
	Change-Id: I7f3e8ec5f9ca8582d587545fdf6b69901259f199

2022-01-21  Nick Clifton  <nickc@redhat.com>

	Updated Serbian translation for the ld sub-directory

2022-01-21  Andrew Burgess  <aburgess@redhat.com>

	gdb/doc: fill in two missing @r
	I noticed two places in the docs where we appear to be missing @r.
	makeinfo seems to do the correct things despite these being
	missing (at least, I couldn't see any difference in the pdf or info
	output), but it doesn't hurt to have the @r in place.

2022-01-21  Mike Frysinger  <vapier@gentoo.org>

	drop old unused stamp-h.in file
	This was needed by ancient versions of automake, but that hasn't been
	the case since at least automake-1.5, so punt this from the tree.

2022-01-21  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport/gdb_regex.cc: replace defs.h include with common-defs.h
	This was forgotten when gdb_regex was moved from gdb to gdbsupport.

	Change-Id: I73b446f71861cabbf7afdb7408ef9d59fa64b804

2022-01-21  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-20  Tom Tromey  <tromey@adacore.com>

	Avoid bad breakpoints with --gc-sections
	We found a case where --gc-sections can cause gdb to set an invalid
	breakpoint.  In the included test case, gdb will set a breakpoint with
	two locations, one of which is 0x0.

	The code in lnp_state_machine::check_line_address is intended to
	filter out this sort of problem, but in this case, the entire CU is
	empty, causing unrelocated_lowpc==0x0 -- which circumvents the check.

	It seems to me that if a CU is empty like this, then it is ok to
	simply ignore the line table, as there won't be any locations anyway.

2022-01-20  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-19  Maciej W. Rozycki  <macro@embecosm.com>

	Add `set print array-indexes' tests for C/C++ arrays
	Add `set print array-indexes' tests for C/C++ arrays, complementing one
	for Fortran arrays.

2022-01-19  Maciej W. Rozycki  <macro@embecosm.com>

	Respect `set print array-indexes' with Fortran arrays
	Add `set print array-indexes' handling for Fortran arrays.  Currently
	the setting is ignored and indices are never shown.

	Keep track of the most recent index handled so that any outstanding
	repeated elements printed when the limit set by `set print elements' is
	hit have the correct index shown.

	Output now looks like:

	(gdb) set print array-indexes on
	(gdb) print array_1d
	$1 = ((-2) = 1, (-1) = 1, (0) = 1, (1) = 1, (2) = 1)
	(gdb) set print repeats 4
	(gdb) set print elements 12
	(gdb) print array_2d
	$2 = ((-2) = ((-2) = 2, <repeats 5 times>) (-1) = ((-2) = 2, <repeats 5 times>) (0) = ((-2) = 2, (-1) = 2, ...) ...)
	(gdb)

	for a 5-element vector and a 5 by 5 array filled with the value of 2.

2022-01-19  Maciej W. Rozycki  <macro@embecosm.com>

	Add `set print repeats' tests for C/C++ arrays
	Add `set print repeats' tests for C/C++ arrays, complementing one for
	Fortran arrays and covering the different interpretation of the `set
	print elements' setting in particular where the per-dimension count of
	the elements handled is matched against the trigger rather than the
	total element count as with Fortran arrays.

2022-01-19  Maciej W. Rozycki  <macro@embecosm.com>

	Respect `set print repeats' with Fortran arrays
	Implement `set print repeats' handling for Fortran arrays.  Currently
	the setting is ignored and always treated as if no limit was set.

	Unlike the generic array walker implemented decades ago the Fortran one
	is a proper C++ class.  Rather than trying to mimic the old walker then,
	which turned out a bit of a challenge where interacting with the `set
	print elements' setting, write it entirely from scratch, by adding an
	extra specialization handler method for processing dimensions other than
	the innermost one and letting the specialization class call the `walk_1'
	method from the handler as it sees fit.  This way repeats can be tracked
	and the next inner dimension recursed into as a need arises only, or
	unconditionally in the base class.

	Keep track of the dimension number being handled in the class rather as
	a parameter to the walker so that it does not have to be passed across
	by the specialization class.

	Use per-dimension element count tracking, needed to terminate processing
	early when the limit set by `set print elements' is hit.  This requires
	extra care too where the limit triggers exactly where another element
	that is a subarray begins.  In that case rather than recursing we need
	to terminate processing or lone `(...)' would be printed.  Additionally
	if the skipped element is the last one in the current dimension we need
	to print `...' by hand, because `continue_walking' won't print it at the
	upper level, because it can see the last element has already been taken
	care of.

	Preserve the existing semantics of `set print elements' where the total
	count of the elements handled is matched against the trigger level which
	is unlike with the C/C++ array printer where the per-dimension element
	count is used instead.

	Output now looks like:

	(gdb) set print repeats 4
	(gdb) print array_2d
	$1 = ((2, <repeats 5 times>) <repeats 5 times>)
	(gdb) set print elements 12
	(gdb) print array_2d
	$2 = ((2, <repeats 5 times>) (2, <repeats 5 times>) (2, 2, ...) ...)
	(gdb)

	for a 5 by 5 array filled with the value of 2.

	Amend existing test cases accordingly that rely on the current incorrect
	behavior and explicitly request that there be no limit for printing
	repeated elements there.

	Add suitable test cases as well covering sliced arrays in particular.

	Co-Authored-By: Andrew Burgess <andrew.burgess@embecosm.com>

2022-01-19  John Baldwin  <jhb@FreeBSD.org>

	fbsd-nat: Add include for gdb_argv.

2022-01-19  Alan Modra  <amodra@gmail.com>

	PowerPC64 DT_RELR ELFv1
	More fun with R_PPC64_NONE found in .opd.  Fixed by the
	allocate_dynrelocs and ppc64_elf_size_dynamic_sections changes, and
	since we are doing ifunc, opd and SYMBOL_REFERENCES_LOCAL tests later,
	don't duplicate that work in check_relocs.

		* elf64-ppc.c (ppc64_elf_check_relocs): Remove opd and ifunc
		conditions for rel_count.
		(dec_dynrel_count): Likewise.
		(allocate_dynrelocs): Test for opd and ifunc when allocating
		relative relocs.
		(ppc64_elf_size_dynamic_sections): Likewise.

2022-01-19  Alan Modra  <amodra@gmail.com>

	PowerPC64 DT_RELR local PLT
	Similarly to the local GOT case.

		* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
		space for PLT relocs against local syms when enable_dt_relr.

2022-01-19  Alan Modra  <amodra@gmail.com>

	PowerPC64 DT_RELR local GOT
	Fixes another case where we end up with superfluous R_PPC64_NONE.

		* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate
		space for GOT relocs against non-TLS local syms when enable_dt_relr.
		(ppc64_elf_layout_multitoc): Likewise.

2022-01-19  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-18  Alan Modra  <amodra@gmail.com>

	Re: PowerPC64 DT_RELR
	HJ: "There are 238 R_PPC64_NONEs in libc.so.6 alone."
	Indeed, let's make them go away.  I had the SYMBOL_REFERENCES_LOCAL
	test in the wrong place.  check_relocs is too early to know whether a
	symbol is dynamic in a shared library.  Lots of glibc symbols are made
	local by version script, but that doesn't happen until
	size_dynamic_sections.

		* elf64-ppc.c (ppc64_elf_check_relocs): Don't count relative relocs
		here depending on SYMBOL_REFERENCES_LOCAL.
		(dec_dynrel_count): Likewise.
		(allocate_dynrelocs): Do so here instead.

2022-01-18  Tom Tromey  <tom@tromey.com>

	Fix the remote-sim.c build
	My earlier patch to move gdb_argv broke the remote-sim.c build.  This
	patch fixes the bug.  I'm checking it in.

2022-01-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbserver: introduce remote_debug_printf
	Add remote_debug_printf, and use it for all debug messages controlled by
	remote_debug.

	Change remote_debug to be a bool, which is trivial in this case.

	Change-Id: I90de13cb892faec3830047b571661822b126d6e8

2022-01-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbserver: introduce threads_debug_printf, THREADS_SCOPED_DEBUG_ENTER_EXIT
	Add the threads_debug_printf and THREADS_SCOPED_DEBUG_ENTER_EXIT, which
	use the logging infrastructure from gdbsupport/common-debug.h.  Replace
	all debug_print uses that are predicated by debug_threads with
	threads_dethreads_debug_printf.  Replace uses of the debug_enter and
	debug_exit macros with THREADS_SCOPED_DEBUG_ENTER_EXIT, which serves
	essentially the same purpose, but allows showing what comes between the
	enter and the exit in an indented form.

	Note that "threads" debug is currently used for a bit of everything in
	GDBserver, not only threads related stuff.  It should ideally be cleaned
	up and separated logically as is done in GDB, but that's out of the
	scope of this patch.

	Change-Id: I2d4546464462cb4c16f7f1168c5cec5a89f2289a

2022-01-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbserver: turn debug_threads into a boolean
	debug_threads is always used as a boolean.  Except in ax.cc and
	tracepoint.cc.  These files have their own macros that use
	debug_threads, and have a concept of verbosity level.  But they both
	have a single level, so it's just a boolean in the end.

	Remove this concept of level.  If we ever want to re-introduce it, I
	think it will be better implemented in a more common location.

	Change debug_threads to bool and adjust some users that were treating it
	as an int.

	Change-Id: I137f596eaf763a08c977dd74417969cedfee9ecf

2022-01-18  Tom Tromey  <tom@tromey.com>

	Simplify Ada catchpoints
	All the Ada catchpoints use the same breakpoint_ops contents, because
	the catchpoint itself records its kind.  This patch simplifies the
	code by removing the redundant ops structures.

	Move "catch exec" to a new file
	The "catch exec" code is reasonably self-contained, and so this patch
	moves it out of breakpoint.c (the second largest source file in gdb)
	and into a new file, break-catch-exec.c.

	Move "catch fork" to a new file
	The "catch fork" code is reasonably self-contained, and so this patch
	moves it out of breakpoint.c (the second largest source file in gdb)
	and into a new file, break-catch-fork.c.

	Unify "catch fork" and "catch vfork"
	I noticed that "catch fork" and "catch vfork" are nearly identical.
	This patch simplifies the code by unifying these two cases.

	Move gdb_regex to gdbsupport
	This moves the gdb_regex convenience class to gdbsupport.

	Introduce gdb-hashtab module in gdbsupport
	gdb has some extensions and helpers for working with the libiberty
	hash table.  This patch consolidates these and moves them to
	gdbsupport.

	Move gdb obstack code to gdbsupport
	This moves the gdb-specific obstack code -- both extensions like
	obconcat and obstack_strdup, and things like auto_obstack -- to
	gdbsupport.

	Move gdb_argv to gdbsupport
	This moves the gdb_argv class to a new header in gdbsupport.

	Simplify event_location_probe
	event_location_probe currently stores two strings, but really only
	needs one.  This patch simplifies it and removes some unnecessary
	copies as well.

	Use std::string in event_location
	This changes event_location to use std::string, removing some manual
	memory management, and an unnecessary string copy.

	Split event_location into subclasses
	event_location uses the old C-style discriminated union approach.
	However, it's better to use subclassing, as this makes the code
	clearer and removes some chances for error.  This also enables future
	cleanups to avoid manual memory management and copies.

	Remove EL_* macros from location.c
	This patch removes the old-style EL_* macros from location.c.  This
	cleans up the code by itself, IMO, but also enables further cleanups
	in subsequent patches.

	Boolify explicit_to_string_internal
	This changes explicit_to_string_internal to use 'bool' rather than
	'int'.

	Remove a use of xfree in location.c
	This small cleanup removes a use of xfree from location.c, by
	switching to unique_xmalloc_ptr.  One function is only used in
	location.c, so it is made static.  And, another function is changed to
	avoid a copy.

2022-01-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: use ptid_t::to_string instead of target_pid_to_str in debug statements
	Same idea as 0fab79556484 ("gdb: use ptid_t::to_string in infrun debug
	messages"), but throughout GDB.

	Change-Id: I62ba36eaef29935316d7187b9b13d7b88491acc1

2022-01-18  Andrew Burgess  <aburgess@redhat.com>

	gdb: preserve `|` in connection details string
	Consider this GDB session:

	  $ gdb -q
	  (gdb) target remote  | gdbserver - ~/tmp/hello.x
	  Remote debugging using | gdbserver - ~/tmp/hello.x
	  ... snip ...
	  (gdb) info connections
	    Num  What                              Description
	  * 1    remote gdbserver - ~/tmp/hello.x  Remote target using gdb-specific protocol
	  (gdb) python conn = gdb.selected_inferior().connection
	  (gdb) python print(conn.details)
	  gdbserver - ~/tmp/hello.x
	  (gdb)

	I think there are two things wrong here, first in the "What" column of
	the 'info connections' output, I think the text should be:

	  remote | gdbserver - ~/tmp/hello.x

	to correctly show the user how the connection was established.  And in
	a similar fashion, I think that the `details` string of the
	gdb.TargetConnection object should be:

	  | gdbserver - ~/tmp/hello.x

	This commit makes this change.  Currently the '|' is detected and
	removed in gdb/serial.c.  The string passed to the pipe_ops
	structure (from gdb/ser-pipe.c), doesn't then, contain the `|`, this
	is instead implied by the fact that it is a pipes based implementation
	of the serial_ops interface.

	After this commit we still detect the `|` in gdb/serial.c, but we now
	store the full string (including the `|`) in the serial::name member
	variable.

	For pipe based serial connections, this name is only used for
	displaying the two fields I mention above, and in pipe_open (from
	gdb/ser-pipe.c), and in pipe_open, we now know to skip over the `|`.

	The benefit I see from this change is that GDB's output now more
	accurately reflects the commands used to start a target, thus making
	it easier for a user to understand what is going on.

2022-01-18  Tiezhu Yang  <yangtiezhu@loongson.cn>

	gdb: testsuite: print explicit test result for gdb.base/dfp-test.exp
	In the current code, if decimal floating point is not supported for
	this target, there is no binary file dfp-test, and also there is no
	test result after execute the following commands:

	  $ make check-gdb TESTS="gdb.base/dfp-test.exp"
	  $ grep error gdb/testsuite/gdb.log
	  /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.c:39:1: error: decimal floating point not supported for this target
	  [...]
	  $ cat gdb/testsuite/gdb.sum
	  [...]
	  Running target unix
	  Running /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.exp ...

			  === gdb Summary ===
	  [...]

	With this patch:

	  $ make check-gdb TESTS="gdb.base/dfp-test.exp"
	  $ cat gdb/testsuite/gdb.sum
	  [...]
	  Running target unix
	  Running /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.exp ...
	  UNSUPPORTED: gdb.base/dfp-test.exp: decimal floating point not supported for this target.

			  === gdb Summary ===

	  # of unsupported tests		1
	  [...]

2022-01-18  Simon Marchi  <simon.marchi@efficios.com>

	bfd/elf64-ppc.c: fix clang -Wbitwise-instead-of-logical warning in ppc64_elf_check_init_fini
	I see this error with clang-14:

	      CC       elf64-ppc.lo
	    /home/smarchi/src/binutils-gdb/bfd/elf64-ppc.c:13131:11: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
	      return (check_pasted_section (info, ".init")
	             ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	Fix by replacing & with &&.  But given that the check_pasted_section
	function has side-effects and we want to make sure both calls are made,
	assign to temporary variables before evaluating the `&&`.

	Change-Id: I849e1b2401bea5f4d8ef3ab9af99ba9e3ef42490

2022-01-18  Alan Modra  <amodra@gmail.com>

	PR28029, debuginfod tests
	binutils/NEWS says of the change in --process-links semantics:
	  If other debug section display options are also enabled (eg
	  --debug-dump=info) then the contents of matching sections in both the main
	  file and the separate debuginfo file *will* be displayed.  This is because in
	  most cases the debug section will only be present in one of the files.

	Implying that debug info is dumped without --process-links.  Indeed
	that appears to be the case for readelf.  This does the same for
	objdump.

		PR 28029
		* objdump.c (dump_bfd): Do not exit early when !is_mainfile
		&& !processlinks, instead just exclude non-debug output.
		(dump_dwarf): Add is_mainfile parameter and pass to
		dump_dwarf_section.
		(dump_dwarf_section): Only display debug sections when
		!is_mainfile and !process_links.

2022-01-18  Alan Modra  <amodra@gmail.com>

	Check thin archive element file size against archive header
	Makes it a little less likely for someone to break their thin archives.

		* archive.c (_bfd_get_elt_at_filepos): Check thin archive
		element file size.

2022-01-18  Alan Modra  <amodra@gmail.com>

	lang_size_relro_segment tidy
	This function has seen too many minimal change style edits.
	No functional changes in this patch.

		* ldlang.c (lang_size_relro_segment): Tidy.

2022-01-18  Alan Modra  <amodra@gmail.com>

	PowerPC64 DT_RELR
	PowerPC64 takes a more traditional approach to DT_RELR than x86.  Count
	relative relocs in check_relocs, allocate space for them and output in
	the usual places but not doing so when enable_dt_relr.  DT_RELR is
	sized in the existing ppc stub relaxation machinery, run via the
	linker's ldemul_after_allocation hook.  DT_RELR is output in the same
	function that writes ppc stubs, run via ldemul_finish.

	This support should be considered experimental.

	bfd/
		* elf64-ppc.c (struct ppc_local_dyn_relocs): Renamed from
		ppc_dyn_relocs.  Add rel_count field.  Update uses.
		(struct ppc_dyn_relocs): New.  Replace all uses of elf_dyn_relocs.
		(struct ppc_link_hash_table): Add relr_alloc, relr_count and
		relr_addr.
		(ppc64_elf_copy_indirect_symbol): Merge rel_count.
		(ppc64_elf_check_relocs): Init rel_count for global and local syms.
		(dec_dynrel_count): Change r_info param to reloc pointer.  Update
		all callers.  Handle decrementing rel_count.
		(allocate_got): Don't allocate space for relative relocs when
		enable_dt_relr.
		(allocate_dynrelocs): Likewise.
		(ppc64_elf_size_dynamic_sections): Likewise.  Handle srelrdyn.
		(ppc_build_one_stub): Don't emit relative relocs on .branch_lt.
		(compare_relr_address, append_relr_off): New functions.
		(got_and_plt_relr_for_local_syms, got_and_plt_relr): Likewise.
		(ppc64_elf_size_stubs): Size .relr.syn.
		(ppc64_elf_build_stubs): Emit .relr.dyn.
		(build_global_entry_stubs_and_plt): Don't output relative relocs
		when enable_dt_relr.
		(write_plt_relocs_for_local_syms): Likewise.
		(ppc64_elf_relocate_section): Likewise.
	binutils/
		* testsuite/lib/binutils-common.exp (supports_dt_relr): Add
		powerpc64.
	ld/
		* emulparams/elf64ppc.sh: Source dt-relr.sh.
		* testsuite/ld-elf/dt-relr-2b.d: Adjust for powerpc.
		* testsuite/ld-elf/dt-relr-2c.d: Likewise.
		* testsuite/ld-elf/dt-relr-2d.d: Likewise.
		* testsuite/ld-elf/dt-relr-2e.d: Likewise.

2022-01-18  Alan Modra  <amodra@gmail.com>

	tweak __ehdr_start visibility and flags for check_relocs
	bfd/
		* elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Test linker_def.
	ld/
		* ldelf.c (ldelf_before_allocation): Don't force __ehdr_start
		local and hidden here..
		* ldlang.c (lang_symbol_tweaks): ..do so here instead and set
		def_regular and linker_def for check_relocs.  New function
		extracted from lang_process.

2022-01-18  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-17  Nick Clifton  <nickc@redhat.com>

	Update the config.guess and config.sub files from the master repository and regenerate files.

2022-01-17  Sergey Belyashov  <sergey.belyashov@gmail.com>

	Fix Z80 assembly failure.
		PR 28762
		* app.c (do_scrub_chars): Correct handling when the symbol is not 'af'.

2022-01-17  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/infrun: rename variable and move to more specific scope
	Move the "started" variable to the scope it's needed, and rename it to
	"step_over_started".

	Change-Id: I56f3384dbd328f55198063bb855edda10f1492a3

2022-01-17  Jan Beulich  <jbeulich@suse.com>

	x86: adjust struct instr_info field types
	Now that this lives on the stack, let's have it be a little less
	wasteful in terms of space. Switch boolean fields to "bool" (also when
	this doesn't change their size) and also limit the widths of "rex",
	"rex_used", "op_ad", and "op_index". Do a little bit of re-ordering as
	well to limit the number of padding holes.

	x86: drop index16 field
	There's a single use on a generally infrequently taken code path. Put
	the necessary conditional there instead.

	x86: drop most Intel syntax register name arrays
	By making use of, in particular, oappend_maybe_intel() there's no need
	for this redundant set of static data.

	x86: fold variables in memory operand index handling
	There's no real need for the pseudo-boolean "haveindex" or for separate
	32-bit / 64-bit index pointers. Fold them into a single "indexes" and
	set that uniformly to AT&T names, compensating by emitting the register
	name via oappend_maybe_intel().

	x86: constify disassembler static data
	Now that the code is intended to be largely thread-safe, we'd better not
	have any writable static objects.

2022-01-17  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-16  Joel Brobecker  <brobecker@adacore.com>

	gdb/copyright.py: Do not update gdbsupport/Makefile.in
	This file is generated, so we should not modify it (any modification
	we make is going to be undone at the next re-generation anyway).

2022-01-16  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-15  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-14  Simon Marchi  <simon.marchi@efficios.com>

	gdb.dlang/demangle.exp: update expected output for _D8demangle4testFnZv
	Since commit ce2d3708bc8b ("Synchronize binutils libiberty sources with
	gcc version."), I see this failure:

	    demangle _D8demangle4testFnZv^M
	    demangle.test(typeof(null))^M
	    (gdb) FAIL: gdb.dlang/demangle.exp: _D8demangle4testFnZv

	The commit imported the commit 0e32a5aa8bc9 ("libiberty: Add support for
	D `typeof(*null)' types") from the gcc repository.  That commit includes
	an update to libiberty/testsuite/d-demangle-expected, which updates a
	test for the exact same mangled name:

	     _D8demangle4testFnZv
	    -demangle.test(none)
	    +demangle.test(typeof(null))

	I don't know anything about D, but give that the change was made by Iain
	Buclaw, the D language maintainer, I trust him on that.

	Fix our test by updating the expected output in the same way.

	Note: it's not really useful to have all these D demangling tests in the
	GDB testsuite, since there are demangling tests in libiberty.  We should
	consider removing them, but we first need to make sure that everything
	that is covered in gdb/testsuite/gdb.dlang/demangle.exp is also covered
	in libiberty/testsuite/d-demangle-expected.

	Change-Id: If2b290ea8367b8e1e0b90b20d4a6e0bee517952d

2022-01-14  Nils-Christian Kempke  <nils-christian.kempke@intel.com>

	gdb/testsuite: enable __INTEL_LLVM_COMPILER preprocessor in get_compiler_info
	Intel Next Gen compiler defines preprocessor __INTEL_LLVM_COMPILER and provides
	version info in __clang_version__ e.g. value: 12.0.0 (icx 2020.10.0.1113).

	gdb/testsuite/ChangeLog:
	2020-12-07  Abdul Basit Ijaz  <abdul.b.ijaz@intel.com>

		* lib/compiler.c: Add Intel next gen compiler pre-processor check.
		* lib/compiler.cc: Ditto.
		* lib/fortran.exp (fortran_main): Check Intel next gen compiler in
		test_compiler_info.

2022-01-14  Alan Modra  <amodra@gmail.com>

	PR28751 mbind2a / mbind2b regressions on powerpc*-linux
	include/
		* bfdlink.h (struct bfd_link_info): Add commonpagesize_is_set.
	ld/
		PR 28751
		* emultempl/elf.em (handle_option): Set commonpagesize_is_set.
		* ldelf.c (ldelf_after_parse): Don't error when only one of
		-z max-page-size or -z common-page-size is given, correct the
		other value to make it sane.
		* testsuite/ld-elf/elf.exp (mbind2a, mbind2b): Do not pass
		-z max-page-size.

2022-01-14  Jan Beulich  <jbeulich@suse.com>

	x86: drop ymmxmm_mode
	This enumerator is not used by any table entry.

	x86: share yet more VEX table entries with EVEX decoding
	On top of prior similar work more opportunities have appeared in the
	meantime. Note that this also happens to address the prior lack of
	decoding of EVEX.L'L for VMOV{L,H}P{S,D} and VMOV{LH,HL}PS.

	x86: consistently use scalar_mode for AVX512-FP16 scalar insns
	For some reason the original AVFX512F insns were not taken as a basis
	here, causing unnecessary divergence. While not an active issue, it is
	still relevant to note that OP_XMM() has special treatment of e.g.
	scalar_mode (marking broadcast as invalid). Such would better be
	consistent for all sufficiently similar insns.

	x86: record further wrong uses of EVEX.b
	For one EVEX.W set does not imply EVEX.b is uniformly valid. Reject it
	for modes which occur for insns allowing for EVEX.W to be set (noticed
	with VMOV{H,L}PD and VMOVDDUP, and only in AT&T mode, but not checked
	whether further insns would also have been impacted; I expect e.g.
	VCMPSD would have had the same issue). And then the present concept of
	broadcast makes no sense at all when the memory operand of an insn is
	the destination.

2022-01-14  Jan Beulich  <jbeulich@suse.com>

	x86: reduce AVX512 FP set of insns decoded through vex_w_table[]
	Like for AVX512-FP16, there's not that many FP insns where going through
	this table is easier / cheaper than using suitable macros. Utilize %XS
	and %XD more to eliminate a fair number of table entries.

	While doing this I noticed a few anomalies. Where lines get touched /
	moved anyway, these are being addressed right here:
	- vmovshdup used EXx for its 2nd operand, thus displaying seemingly
	  valid broadcast when EVEX.b is set with a memory operand; use
	  EXEvexXNoBcst instead just like vmovsldup already does
	- vmovlhps used EXx for its 3rd operand, when all sibling entries use
	  EXq; switch to EXq there for consistency (the two differ only for
	  memory operands)

2022-01-14  Jan Beulich  <jbeulich@suse.com>

	x86: reduce AVX512-FP16 set of insns decoded through vex_w_table[]
	Like already indicated during review of the original submission, there's
	really only very few insns where going through this table is easier /
	cheaper than using suitable macros. Utilize %XH more and introduce
	similar %XS and %XD (which subsequently can be used for further table
	size reduction).

	While there also switch to using oappend() in 'XH' macro processing.

2022-01-14  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-13  H.J. Lu  <hjl.tools@gmail.com>

	ld: Disable DT_RELR in some -z relro tests
	Disable DT_RELR in the following -z relro tests which don't expect
	DT_RELR in linker outputs.

		* testsuite/ld-i386/pr20830.d: Pass $NO_DT_RELR_LDFLAGS to ld.
		* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
		* testsuite/ld-x86-64/pr20830a.d: Likewise.
		* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
		* testsuite/ld-x86-64/pr20830b.d: Likewise.
		* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038a.d: Likewise.
		* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038c.d: Likewise.

2022-01-13  H.J. Lu  <hjl.tools@gmail.com>

	Reapply libiberty: Pass --plugin to AR and RANLIB
	Reapply the patch to detect GCC LTO plugin used for libiberty build to
	support LTO build in libiberty.

		* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
		(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
		(configure_deps): Depend on ../config/gcc-plugin.m4.
		* aclocal.m4: Include ../config/gcc-plugin.m4.
		* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
		RANLIB_PLUGIN_OPTION.
		* configure: Regenerate.

2022-01-13  H.J. Lu  <hjl.tools@gmail.com>

	elf: Remove the 1-page gap before the RELRO segment
	The existing RELRO scheme may leave a 1-page gap before the RELRO segment
	and align the end of the RELRO segment to the page size:

	  [18] .eh_frame    PROGBITS    408fa0 008fa0 005e80 00   A  0   0  8
	  [19] .init_array  INIT_ARRAY  410de0 00fde0 000008 08  WA  0   0  8
	  [20] .fini_array  FINI_ARRAY  410de8 00fde8 000008 08  WA  0   0  8
	  [21] .dynamic     DYNAMIC     410df0 00fdf0 000200 10  WA  7   0  8
	  [22] .got         PROGBITS    410ff0 00fff0 000010 08  WA  0   0  8
	  [23] .got.plt     PROGBITS    411000 010000 000048 08  WA  0   0  8

	Instead, we can remove the 1-page gap if the maximum page size >= the
	maximum section alignment:

	  [18] .eh_frame    PROGBITS    408fa0 008fa0 005e80 00   A  0   0  8
	  [19] .init_array  INIT_ARRAY  40fde0 00fde0 000008 08  WA  0   0  8
	  [20] .fini_array  FINI_ARRAY  40fde8 00fde8 000008 08  WA  0   0  8
	  [21] .dynamic     DYNAMIC     40fdf0 00fdf0 000200 10  WA  7   0  8
	  [22] .got         PROGBITS    40fff0 00fff0 000010 08  WA  0   0  8
	  [23] .got.plt     PROGBITS    410000 010000 000048 08  WA  0   0  8

	Because the end of the RELRO segment is always aligned to the page size
	and may not be moved, the RELRO segment size may be increased:

	  [ 3] .dynstr      STRTAB      000148 000148 000001 00   A  0   0  1
	  [ 4] .eh_frame    PROGBITS    000150 000150 000000 00   A  0   0  8
	  [ 5] .init_array  INIT_ARRAY  200150 000150 000010 08  WA  0   0  1
	  [ 6] .fini_array  FINI_ARRAY  200160 000160 000010 08  WA  0   0  1
	  [ 7] .jcr         PROGBITS    200170 000170 000008 00  WA  0   0  1
	  [ 8] .data.rel.ro PROGBITS    200180 000180 000020 00  WA  0   0 16
	  [ 9] .dynamic     DYNAMIC     2001a0 0001a0 0001c0 10  WA  3   0  8
	  [10] .got         PROGBITS    200360 000360 0002a8 00  WA  0   0  8
	  [11] .bss         NOBITS      201000 000608 000840 00  WA  0   0  1

	vs the old section layout:

	  [ 3] .dynstr      STRTAB      000148 000148 000001 00   A  0   0  1
	  [ 4] .eh_frame    PROGBITS    000150 000150 000000 00   A  0   0  8
	  [ 5] .init_array  INIT_ARRAY  200b48 000b48 000010 08  WA  0   0  1
	  [ 6] .fini_array  FINI_ARRAY  200b58 000b58 000010 08  WA  0   0  1
	  [ 7] .jcr         PROGBITS    200b68 000b68 000008 00  WA  0   0  1
	  [ 8] .data.rel.ro PROGBITS    200b70 000b70 000020 00  WA  0   0 16
	  [ 9] .dynamic     DYNAMIC     200b90 000b90 0001c0 10  WA  3   0  8
	  [10] .got         PROGBITS    200d50 000d50 0002a8 00  WA  0   0  8
	  [11] .bss         NOBITS      201000 000ff8 000840 00  WA  0   0  1

	But there is no 1-page gap.

		PR ld/28743
		* ldlang.c (lang_size_relro_segment_1): Remove the 1-page gap
		before the RELRO segment if the maximum page size >= the maximum
		section alignment.
		* testsuite/ld-i386/pr20830.d: Adjusted.
		* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
		* testsuite/ld-x86-64/pr14207.d: Likewise.
		* testsuite/ld-x86-64/pr18176.d: Likewise.
		* testsuite/ld-x86-64/pr20830a-now.d: Likewise.
		* testsuite/ld-x86-64/pr20830a.d: Likewise.
		* testsuite/ld-x86-64/pr20830b-now.d: Likewise.
		* testsuite/ld-x86-64/pr20830b.d: Likewise.
		* testsuite/ld-x86-64/pr21038a-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038a.d: Likewise.
		* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
		* testsuite/ld-x86-64/pr21038c.d: Likewise.

2022-01-13  Nick Clifton  <nickc@redhat.com>

	Synchronize binutils libiberty sources with gcc version.
	+2021-12-30  Lancelot SIX  <lsix@lancelotsix.com>
	+
	+	* cp-demangle.c (d_clone_suffix): Support digits in clone tag
	+	names.
	+	* testsuite/demangle-expected: Check demangling of clone symbols
	+	with digits in name.
	+
	+2021-12-16  H.J. Lu  <hjl.tools@gmail.com>
	+
	+	Revert:
	+	2021-12-16  H.J. Lu  <hjl.tools@gmail.com>
	+
	+	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
	+	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	+	(configure_deps): Depend on ../config/gcc-plugin.m4.
	+	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
	+	RANLIB_PLUGIN_OPTION.
	+	* aclocal.m4: Regenerated.
	+	* configure: Likewise.
	+
	+2021-12-15  H.J. Lu  <hjl.tools@gmail.com>
	+
	+	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
	+	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
	+	(configure_deps): Depend on ../config/gcc-plugin.m4.
	+	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
	+	RANLIB_PLUGIN_OPTION.
	+	* aclocal.m4: Regenerated.
	+	* configure: Likewise.
	+
	+2021-11-29  Eric Gallager  <egallager@gcc.gnu.org>
	+
	+	PR other/103021
	+	* Makefile.in: Use ETAGS variable in TAGS target.
	+	* configure: Regenerate.
	+	* configure.ac: Allow ETAGS variable to be overridden.
	+
	+2021-11-29  Andrew Pinski  <apinski@marvell.com>
	+
	+	* make-temp-file.c (try_dir): Check to see if the dir
	+	is actually a directory.
	+
	+2021-10-22  Eric Gallager  <egallager@gcc.gnu.org>
	+
	+	PR other/102663
	+	* Makefile.in: Allow dvi-formatted documentation
	+	to be installed.
	+
	+2021-10-17  Lu?s Ferreira  <contact@lsferreira.net>
	+
	+	PR d/102618
	+	* d-demangle.c (dlang_parse_qualified): Handle anonymous
	+	symbols correctly.
	+	* testsuite/d-demangle-expected: New tests to cover anonymous
	+	symbols.
	+
	+2021-10-14  Lu?s Ferreira  <contact@lsferreira.net>
	+
	+	* testsuite/d-demangle-expected: Add test case for function literals.
	+
	+2021-10-14  Lu?s Ferreira  <contact@lsferreira.net>
	+
	+	* testsuite/d-demangle-expected: Add test cases for simple special
	+	mangles.
	+
	+2021-10-12  Lu?s Ferreira  <contact@lsferreira.net>
	+
	+	* d-demangle.c (dlang_parse_qualified): Remove redudant parenthesis
	+	around lhs and rhs of assignments.
	+
	+2021-10-01  Lu?s Ferreira  <contact@lsferreira.net>
	+
	+	* testsuite/d-demangle-expected: Add missing format for new test
	+
	+2021-09-23  Lu?s Ferreira  <contact@lsferreira.net>
	+
	+	* d-demangle.c (dlang_Type): Validate MANGLED is nonnull.
	+	* testsuite/d-demangle-expected: New test.
	+
	+2021-09-23  Lu?s Ferreira  <contact@lsferreira.net>
	+
	+	* d-demangle.c (dlang_symbol_backref): Ensure strlen of
	+	string is less than length computed by dlang_number.
	+
	+2021-09-01  Iain Sandoe  <iain@sandoe.co.uk>

	 	* configure: Regenerate.
	+	* configure.ac: Do not search for sbrk on Darwin.
	+	* xmalloc.c: Do not declare sbrk unless it has been found
	+	by configure.
	+
	+2021-08-29  Iain Buclaw  <ibuclaw@gdcproject.org>
	+
	+	* d-demangle.c (dlang_identifier): Skip over fake parent manglings.
	+	* testsuite/d-demangle-expected: Add tests.
	+
	+2021-08-29  Iain Buclaw  <ibuclaw@gdcproject.org>
	+
	+	* d-demangle.c (dlang_parse_arrayliteral): Add 'info' parameter.
	+	(dlang_parse_assocarray): Likewise.
	+	(dlang_parse_structlit): Likewise.
	+	(dlang_value): Likewise.  Handle function literal symbols.
	+	(dlang_template_args): Pass 'info' to dlang_value.
	+	* testsuite/d-demangle-expected: Add new test.
	+
	+2021-08-29  Iain Buclaw  <ibuclaw@gdcproject.org>
	+
	+	* d-demangle.c (dlang_attributes): Handle typeof(*null).
	+	(dlang_type): Likewise.  Demangle 'n' as typeof(null).
	+	* testsuite/d-demangle-expected: Update tests.
	+
	+2021-08-23  Iain Sandoe  <iain@sandoe.co.uk>
	+
	+	* simple-object-mach-o.c (simple_object_mach_o_write_segment):
	+	Cast the first argument to set_32 as needed.

	-2021-07-03  Nick Clifton  <nickc@redhat.com>
	+2021-08-18  Iain Sandoe  <iain@sandoe.co.uk>

	+	* simple-object-mach-o.c (simple_object_mach_o_write_segment):
	+	Arrange to swap the LTO index tables where needed.
	 # Please enter the commit message for your changes. Lines starting

2022-01-13  Andrew Burgess  <aburgess@redhat.com>

	gdb: don't use -Wmissing-prototypes with g++
	This commit aims to not make use of -Wmissing-prototypes when
	compiling with g++.

	Use of -Wmissing-prototypes was added with this commit:

	  commit a0761e34f054767de6d6389929d27e9015fb299b
	  Date:   Wed Mar 11 15:15:12 2020 -0400

	      gdb: enable -Wmissing-prototypes warning

	Because clang can provide helpful warnings with this flag.
	Unfortunately, g++ doesn't accept this flag, and will give this
	warning:

	  cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++

	In theory the fact that this flag is not supported should be detected
	by the configure check in gdbsupport/warning.m4, but for users of
	ccache, this check doesn't work due to a long standing ccache issue:

	  https://github.com/ccache/ccache/issues/738

	The ccache problem is that -W... options are reordered on the command
	line, and so -Wmissing-prototypes is seen before -Werror.  Usually
	this doesn't matter, but the above warning (about the flag not being
	valid) is issued before the -Werror flag is processed, and so is not
	fatal.

	There have been two previous attempts to fix this that I'm aware of.
	The first is:

	  https://sourceware.org/pipermail/gdb-patches/2021-September/182148.html

	In this attempt, instead of just relying on a compile to check if a
	flag is valid, the proposal was to both compile and link.  As linking
	doesn't go through ccache, we don't suffer from the argument
	reordering problem, and the link phase will correctly fail when using
	-Wmissing-prototypes with g++.  The configure script will then disable
	the use of this flag.

	This approach was rejected, and the suggestion was to only add the
	-Wmissing-prototypes flag if we are compiling with gcc.

	The second attempt, attempts this approach, and can be found here:

	  https://sourceware.org/pipermail/gdb-patches/2021-November/183076.html

	This attempt only adds the -Wmissing-prototypes flag is the value of
	GCC is not 'yes'.  This feels like it is doing the right thing,
	unfortunately, the GCC flag is really a 'is gcc like' flag, not a
	strict, is gcc check.  As such, GCC is set to 'yes' for clang, which
	would mean the flag was not included for clang or gcc.  The entire
	point of the original commit was to add this flag for clang, so
	clearly the second attempt is not sufficient either.

	In this new attempt I have added gdbsupport/compiler-type.m4, this
	file defines AM_GDB_COMPILER_TYPE.  This macro sets the variable
	GDB_COMPILER_TYPE to either 'gcc', 'clang', or 'unknown'.  In future
	the list of values might be extended to cover other compilers, if this
	is ever useful.

	I've then modified gdbsupport/warning.m4 to only add the problematic
	-Wmissing-prototypes flag if GDB_COMPILER_TYPE is not 'gcc'.

	I've tested this with both gcc and clang and see the expected results,
	gcc no longer attempts to use the -Wmissing-prototypes flag, while
	clang continues to use it.

	When compiling using ccache, I am no longer seeing the warning.

2022-01-13  Andrew Burgess  <aburgess@redhat.com>

	gdb: add some extra debug information to attach_command
	While working on another patch I wanted to add some extra debug
	information to the attach_command function.  This required me to add a
	new function to convert the thread_info::state variable to a string.

	The new debug might be useful to others, and the state to string
	function might be useful in other locations, so I thought I'd merge
	it.

2022-01-13  Alan Modra  <amodra@gmail.com>

	Re: gas: add visibility support using GNU syntax on XCOFF
	tc-ppc.c: In function 'ppc_comm':
	tc-ppc.c:4560:40: error: 'visibility' may be used uninitialized in this function [-Werror=maybe-uninitialized]

	With that fixed we hit lots of segfaults in the ld testsuite.

		PR 22085
	bfd/
		* xcofflink.c (xcoff_link_input_bfd): Don't segfault on NULL
		sym_hash.
	gas/
		* config/tc-ppc.c (ppc_comm): Init visibility.

2022-01-13  Alan Modra  <amodra@gmail.com>

	dt-relr.exp --no-as-needed
	Otherwise the very simple test may not be linked with libc.so at all,
	and thus correctly have no version reference added.  Causing failure
	of the dt-relr-glibc-1b.so test.

		* testsuite/ld-elf/dt-relr.exp: Link with --no-as-needed.

2022-01-13  Alan Modra  <amodra@gmail.com>

	Correct .relr.dyn nocombreloc script
		* scripttempl/elf.sc (.relr.dyn): Don't depend on $COMBRELOC.

2022-01-13  Alan Modra  <amodra@gmail.com>

	testsuite supports_dt_relr
	Tidy, and fix "FAIL: Build dt-relr-glibc-1b.so" on all non-x86
	linux targets.

	binutils/
		* binutils-common.exp (supports_dt_relr): New proc.
	ld/
		* testsuite/config/default.exp (DT_RELR_LDFLAGS, NO_DT_RELR_LDFLAGS),
		(DT_RELR_CC_LDFLAGS, NO_DT_RELR_CC_LDFLAGS): Use supports_dt_relr.
		* testsuite/ld-elf/dt-relr.exp: Don't run unless supports_dt_relr.
		* testsuite/ld-elf/dt-relr-1a.d: Likewise.
		* testsuite/ld-elf/dt-relr-1b.d: Likewise.
		* testsuite/ld-elf/dt-relr-1c.d: Likewise.
		* testsuite/ld-elf/dt-relr-2a.d: Likewise.
		* testsuite/ld-elf/dt-relr-2b.d: Likewise.
		* testsuite/ld-elf/dt-relr-2c.d: Likewise.
		* testsuite/ld-elf/dt-relr-2d.d: Likewise.
		* testsuite/ld-elf/dt-relr-2e.d: Likewise.
		* testsuite/ld-elf/dt-relr-2f.d: Likewise.
		* testsuite/ld-elf/dt-relr-2g.d: Likewise.
		* testsuite/ld-elf/dt-relr-2h.d: Likewise.
		* testsuite/ld-elf/dt-relr-3a.d: Likewise.
		* testsuite/ld-elf/dt-relr-3b.d: Likewise.

2022-01-13  Alan Modra  <amodra@gmail.com>

	Don't use C++ comments in assembly
	It might seem to work, but only if '/' is a start of comment char.

		* testsuite/ld-elf/dt-relr-1.s: Use # for comment.
		* testsuite/ld-elf/dt-relr-2.s: Likewise.
		* testsuite/ld-elf/dt-relr-3.s: Likewise.

2022-01-13  Alan Modra  <amodra@gmail.com>

	Move DT_RELR tag setting to elflink.c
	This makes the code setting DT_RELR tags generally available.  Many
	targets will be able to use the defaults.  Those that can't should set
	up sh_entsize for .relr.dyn output section before reaching the dynamic
	tag code in bfd_elf_final_link.

		* elflink.c (bfd_elf_final_link): Set up DT_RELR tags and sh_entsize.
		* elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): Don't do any
		of that here.

2022-01-13  Alan Modra  <amodra@gmail.com>

	Re: Set SEC_ELF_REVERSE_COPY earlier
	Let's not rely on .init/.fini having relocs for the size sanity check.
	This is mainly to squash reports of "my fuzzed object made ld hang".

2022-01-13  Tiezhu Yang  <yangtiezhu@loongson.cn>

	gdb: testsuite: make string[] type as char in gdb.base/charset.c
	This reverts the commit ff656e2e1cb1 ("gdb: testsuite: fix failed
	testcases in gdb.base/charset.exp").

	The original test code has no problem. On an architecture where
	char is signed, then both 'A' and ebcdic_us_string[7] will yield
	-63, which makes the equality true. On an architecture where char
	is unsigned, then both 'A' and ebcdic_us_string[7] will yield 193,
	which also makes the equality true.

	The test cases only failed on LoongArch. The default type of char
	is signed char on LoongArch, like x86-64. But when use gdb print
	command on LoongArch, the default type of char is unsigned char,
	this is wrong, I will look into it later, sorry for that.

	On LoongArch:

	  $ cat test_char.c
	  #include <stdio.h>

	  int main()
	  {
	          char c1 = 193;
	          unsigned char c2 = 193;

	          printf("%d\n", c1);
	          printf("%d\n", c1 == c2);

	          return 0;
	  }
	  $ gcc test_char.c -o test_char
	  $ ./test_char
	  -63
	  0

	  (gdb) set target-charset EBCDIC-US
	  (gdb) print 'A'
	  $1 = 193 'A'
	  (gdb) print /c 'A'
	  $2 = 193 'A'
	  (gdb) print /u 'A'
	  $3 = 193
	  (gdb) print /d 'A'
	  $4 = -63
	  (gdb) print /x 'A'
	  $5 = 0xc1

2022-01-13  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-12  Carl Love  <cel@us.ibm.com>

	gdb Power 9 add test for HW watchpoint support.
	The Power 9 processor revision 2.2 has HW watchpoint support disabled due
	to a HW bug.  The support is fixed in Power 9 processor revision 2.3.  This
	patch add a test to lib/gdb.exp for Power to determine if the processor
	supports HW watchpoints or not.  If the Power processor doesn't support HW
	watchpoints the proceedure skip_hw_watchpoint_tests will return 1 to
	disable the various HW watchpoint tests.

	The patch has been tested on Power 9, processor revesions 2.2 and 2.3.  The
	patch has also been tested on Power 10.  No regression test failures were
	found.

2022-01-12  Andrew Burgess  <aburgess@redhat.com>

	gdb/python: add gdb.host_charset function
	We already have gdb.target_charset and gdb.target_wide_charset.  This
	commit adds gdb.host_charset along the same lines.

2022-01-12  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	gdb/testsuite: fix gdb.python/py-events.exp for finding process id
	When executed with --target_board=native-extended-gdbserver, the
	gdb.python/py-events.exp test errors out with

	  ERROR: tcl error sourcing /path/to/gdb/testsuite/gdb.python/py-events.exp.
	  ERROR: can't read "process_id": no such variable
	      while executing
	  "lappend expected "ptid: \\($process_id, $process_id, 0\\)" "address: $addr""
	      (file "/path/to/gdb/testsuite/gdb.python/py-events.exp" line 103)
	      invoked from within
	  "source /path/to/gdb/testsuite/gdb.python/py-events.exp"
	      ("uplevel" body line 1)
	      invoked from within
	  "uplevel #0 source /path/to/gdb/testsuite/gdb.python/py-events.exp"
	      invoked from within
	  "catch "uplevel #0 source $test_file_name""

	There are multiple problems around this:

	1. The process_id variable is not initialized to a default value.

	2. The test attempts to find the PID of the current thread, but the
	   regexp that it uses is not tailored for the output printed by the
	   remote target.

	3. The test uses "info threads" to find the current thread PID.
	   Using the "thread" command instead is simpler.

	Fix these problems.

2022-01-12  Tom Tromey  <tromey@adacore.com>

	Don't mention "serial" in target remote description
	PR remote/9177 points out that "info files" mentions "serial" a couple
	of times:

	    Remote serial target in gdb-specific protocol:
	    Debugging a target over a serial line.

	However, often the remote target isn't really a serial connection.

	It seems to me that this text could be a bit clearer; and furthermore
	since "info files" prints the target's long description,
	remote_target::files_info doesn't really add much and can simply be
	removed.

	Regression tested on x86-64 Fedora 34.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=9177

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	ld: Add glibc dependency for DT_RELR
	When DT_RELR is enabled, to avoid random run-time crash with older glibc
	binaries without DT_RELR support, add a GLIBC_ABI_DT_RELR symbol version,
	which is provided by glibc with DT_RELR support, dependency on the shared
	C library if it provides a GLIBC_2.XX symbol version.

	bfd/

		* elflink.c (elf_link_add_dt_relr_dependency): New function.
		(bfd_elf_size_dynamic_sections): Call
		elf_link_add_dt_relr_dependency if DT_RELR is enabled.

	ld/

		* ld.texi: Mention GLIBC_ABI_DT_RELR in -z pack-relative-relocs
		entry.
		* testsuite/ld-elf/dt-relr-glibc-1.c: New file.
		* testsuite/ld-elf/dt-relr-glibc-1a.rd: Likewise.
		* testsuite/ld-elf/dt-relr-glibc-1b.rd: Likewise.
		* testsuite/ld-elf/dt-relr.exp: Likewise.

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	ld: Add simple DT_RELR tests
		* testsuite/ld-elf/dt-relr-1.s: New file.
		* testsuite/ld-elf/dt-relr-1a.d: Likewise.
		* testsuite/ld-elf/dt-relr-1b.d: Likewise.
		* testsuite/ld-elf/dt-relr-1c.d: Likewise.
		* testsuite/ld-elf/dt-relr-2.s: Likewise.
		* testsuite/ld-elf/dt-relr-2a.d: Likewise.
		* testsuite/ld-elf/dt-relr-2b.d: Likewise.
		* testsuite/ld-elf/dt-relr-2c.d: Likewise.
		* testsuite/ld-elf/dt-relr-2d.d: Likewise.
		* testsuite/ld-elf/dt-relr-2e.d: Likewise.
		* testsuite/ld-elf/dt-relr-2f.d: Likewise.
		* testsuite/ld-elf/dt-relr-2g.d: Likewise.
		* testsuite/ld-elf/dt-relr-2h.d: Likewise.
		* testsuite/ld-elf/dt-relr-3.s: Likewise.
		* testsuite/ld-elf/dt-relr-3a.d: Likewise.
		* testsuite/ld-elf/dt-relr-3b.d: Likewise.
		* testsuite/ld-i386/dt-relr-1.s: Likewise.
		* testsuite/ld-i386/dt-relr-1a.d: Likewise.
		* testsuite/ld-i386/dt-relr-1b.d: Likewise.
		* testsuite/ld-x86-64/dt-relr-1a-x32.d: Likewise.
		* testsuite/ld-x86-64/dt-relr-1a.d: Likewise.
		* testsuite/ld-x86-64/dt-relr-1b-x32.d: Likewise.
		* testsuite/ld-x86-64/dt-relr-1b.d: Likewise.
		* testsuite/ld-x86-64/dt-relr-1.s: Likewise.
		* testsuite/ld-i386/i386.exp: Run dt-relr-1a and dt-relr-1b.
		* testsuite/ld-x86-64/x86-64.exp: Run dt-relr-1a, dt-relr-1a-x32
		dt-relr-1b and dt-relr-1b-x32.

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	x86: Add DT_RELR support
	DT_RELR is implemented with linker relaxation:

	1. During linker relaxation, we scan input relocations with the same
	logic in relocate_section to determine if a relative relocation should
	be generated and save the relative relocation candidate information for
	sizing the DT_RELR section later after all symbols addresses can be
	determined.  For these relative relocations which can't be placed in
	the DT_RELR section, they will be placed in the rela.dyn/rel.dyn
	section.
	2. When DT_RELR is enabled, _bfd_elf_map_sections_to_segments calls a
	backend function to size the DT_RELR section which will compute the
	DT_RELR section size and tell ldelf_map_segments to layout sections
	again when the DT_RELR section size has been increased.
	3. After regular symbol processing is finished, bfd_elf_final_link calls
	a backend function to finish the DT_RELR section.

		* elf32-i386.c (elf_i386_relocate_section): Don't generate
		relative relocation when DT_RELR is enabled.
		(elf_i386_finish_dynamic_symbol): Likewise.
		* elf64-x86-64.c (elf_x86_64_relocate_section): Don't generate
		relative relocation when DT_RELR is enabled.
		(elf_x86_64_finish_dynamic_symbol): Likewise.
		* elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
		relative_r_type, relative_r_name, elf_append_reloc,
		elf_write_addend and elf_write_addend_in_got.
		(elf_x86_relative_reloc_record_add): New function.
		(_bfd_x86_elf_link_relax_section): Likewise.
		(elf64_dt_relr_bitmap_add): Likewise.
		(elf32_dt_relr_bitmap_add): Likewise.
		(_bfd_elf32_write_addend): Likewise.
		(_bfd_elf64_write_addend): Likewise.
		(elf_x86_size_or_finish_relative_reloc): Likewise.
		(elf_x86_compute_dl_relr_bitmap): Likewise.
		(elf_x86_write_dl_relr_bitmap): Likewise.
		(elf_x86_relative_reloc_compare ): Likewise.
		(_bfd_elf_x86_size_relative_relocs): Likewise.
		(_bfd_elf_x86_finish_relative_relocs): Likewise.
		(_bfd_x86_elf_size_dynamic_sections): Skip the .relr.dyn section.
		(_bfd_x86_elf_finish_dynamic_sections): Convert 3 spare dynamic
		tags to DT_RELR, DT_RELRSZ and for compact relative relocation.
		* elfxx-x86.h (X86_64_GOT_TYPE_P): New.
		(I386_GOT_TYPE_P): Likewise.
		(X86_GOT_TYPE_P): Likewise.
		(X86_64_RELATIVE_RELOC_TYPE_P): Likewise.
		(I386_RELATIVE_RELOC_TYPE_P): Likewise.
		(X86_RELATIVE_RELOC_TYPE_P): Likewise.
		(X86_LOCAL_GOT_RELATIVE_RELOC_P): Likewise.
		(I386_PCREL_TYPE_P): Likewise.
		(X86_64_PCREL_TYPE_P): Likewise.
		(X86_64_NEED_DYNAMIC_RELOC_TYPE_P): Rewrite.
		(I386_NEED_DYNAMIC_RELOC_TYPE_P): Likewise.
		(GENERATE_DYNAMIC_RELOCATION_P): Also check rel_from_abs.
		(elf_x86_link_hash_entry): Add got_relative_reloc_done.
		(elf_x86_relative_reloc_record): New.
		(elf_x86_relative_reloc_data): Likewise.
		(elf_dt_relr_bitmap): Likewise.
		(elf_x86_link_hash_table): Add dt_relr_bitmap, relative_reloc,
		unaligned_relative_reloc, relative_r_type, relative_r_name,
		elf_append_reloc, elf_write_addend, elf_write_addend_in_got and
		relative_reloc_done.
		(elf_x86_relative_reloc_done): New.
		(relative_reloc_packed): Likewise.
		(_bfd_x86_elf_link_relax_section): Likewise.
		(_bfd_elf_x86_size_relative_relocs): Likewise.
		(_bfd_elf_x86_finish_relative_relocs): Likewise.
		(_bfd_elf32_write_addend): Likewise.
		(_bfd_elf64_write_addend): Likewise.
		(bfd_elf32_bfd_relax_section): Likewise.
		(bfd_elf64_bfd_relax_section): Likewise.
		(elf_backend_size_relative_relocs): Likewise.
		(elf_backend_finish_relative_relocs): Likewise.
		(elf_x86_allocate_local_got_info): Also allocate
		relative_reloc_done.

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	elf: Support DT_RELR in linker tests
	Allow eabling and disabling DT_RELR in linker tests.  Disable DT_RELR in
	linker tests which don't expect DT_RELR in linker outputs.

	binutils/

		* testsuite/lib/binutils-common.exp (run_dump_test): Make
		DT_RELR_LDFLAGS and NO_DT_RELR_LDFLAGS global.

	ld/

		* testsuite/config/default.exp (DT_RELR_LDFLAGS): New.
		(DT_RELR_CC_LDFLAGS): Likewise.
		(NO_DT_RELR_LDFLAGS): Likewise.
		(NO_DT_RELR_CC_LDFLAGS): Likewise.
		* testsuite/ld-elf/shared.exp: Pass $NO_DT_RELR_LDFLAGS to
		linker for some tests.
		* testsuite/ld-i386/export-class.exp: Likewise.
		* testsuite/ld-i386/i386.exp: Likewise.
		* testsuite/ld-i386/ibt-plt-2a.d: Pass $NO_DT_RELR_LDFLAGS to
		linker.
		* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
		* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
		* testsuite/ld-i386/pr26869.d: Likewise.
		* testsuite/ld-i386/report-reloc-1.d: Likewise.
		* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
		* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
		* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise.
		* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
		* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
		* testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise.
		* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
		* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
		* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
		* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
		* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
		* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
		* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
		* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
		* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
		* testsuite/ld-x86-64/ilp32-4.d: Likewise.
		* testsuite/ld-x86-64/load1c.d: Likewise.
		* testsuite/ld-x86-64/load1d.d: Likewise.
		* testsuite/ld-x86-64/pr13082-2b.d: Likewise.
		* testsuite/ld-x86-64/pr14207.d: Likewise.
		* testsuite/ld-x86-64/pr18176.d: Likewise.
		* testsuite/ld-x86-64/pr19162.d: Likewise.
		* testsuite/ld-x86-64/pr19636-2d.d: Likewise.
		* testsuite/ld-x86-64/pr19636-2l.d: Likewise.
		* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
		* testsuite/ld-x86-64/pr20253-1f.d: Likewise.
		* testsuite/ld-x86-64/pr20253-1j.d: Likewise.
		* testsuite/ld-x86-64/pr20253-1l.d: Likewise.
		* testsuite/ld-x86-64/report-reloc-1-x32.d: Likewise.
		* testsuite/ld-x86-64/report-reloc-1.d: Likewise.
		* testsuite/ld-x86-64/export-class.exp (x86_64_export_class_test):
		Pass $NO_DT_RELR_LDFLAGS to linker.
		* testsuite/ld-x86-64/x86-64.exp: Pass $NO_DT_RELR_LDFLAGS to
		linker for some tests.

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	elf: Add size_relative_relocs and finish_relative_relocs
	On some targets, the DT_RELR section size can be computed only after all
	symbols addresses can be determined.  Set the preliminary DT_RELR section
	size before mapping sections to segments and set the final DT_RELR section
	size after regular symbol processing is done.

		* elf-bfd.h (elf_backend_data): Add size_relative_relocs and
		finish_relative_relocs.
		* elf.c (_bfd_elf_map_sections_to_segments): Call
		size_relative_relocs if DT_RELR is enabled.
		* elflink.c (bfd_elf_final_link): Call finish_relative_relocs
		after regular symbol processing is finished if DT_RELR is enabled.
		* elfxx-target.h (elf_backend_size_relative_relocs): New.
		(elf_backend_finish_relative_relocs): Likewise.
		(elfNN_bed): Add elf_backend_size_relative_relocs and
		elf_backend_finish_relative_relocs.

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	ld: Initial DT_RELR support
	Add a -z pack-relative-relocs option to enable DT_RELR and create a
	relr.dyn section for DT_RELR.  DT_RELR is implemented with the linker
	relaxation infrastructure, but it doesn't require the --relax option
	enabled.  -z pack-relative-relocs implies -z combreloc.  -z nocombreloc
	implies -z nopack-relative-relocs.

	-z pack-relative-relocs is chosen over the similar option in lld,
	--pack-dyn-relocs=relr, to implement a glibc binary lockout mechanism
	with a special glibc version symbol, to avoid random crashes of DT_RELR
	binaries with the existing glibc binaries.

	bfd/

		* elf-bfd.h (elf_link_hash_table): Add srelrdyn.
		* elflink.c (_bfd_elf_link_create_dynamic_sections): Create a
		.relr.dyn section for DT_RELR.

	include/

		* bfdlink.h (bfd_link_info): Add enable_dt_relr.

	ld/

		* News: Mention -z pack-relative-relocs and
		-z nopack-relative-relocs.
		* ld.texi: Document -z pack-relative-relocs and
		-z nopack-relative-relocs.
		* ldelf.c (ldelf_after_parse): Disable DT_RELR if not building
		PIE nor shared library.  Add 3 spare dynamic tags for DT_RELR,
		DT_RELRSZ and DT_RELRENT.
		* ldlang.c (lang_relax_sections): Also enable relaxation if
		DT_RELR is enabled.
		* emulparams/elf32_x86_64.sh: Source dt-relr.sh.
		* emulparams/elf_i386.sh: Likewise.
		* emulparams/elf_x86_64.sh: Likewise.
		* emulparams/dt-relr.sh: New file.
		* scripttempl/elf.sc: Support .relr.dyn.

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	elf: Pass need_layout to _bfd_elf_map_sections_to_segments
	On some targets, the DT_RELR section size can be computed only after all
	symbols addresses can be determined.  Update ldelf_map_segments to pass
	need_layout to _bfd_elf_map_sections_to_segments which will size DT_RELR
	section and set need_layout to true if the DT_RELR section size is changed.

	bfd/

		* elf-bfd.h (_bfd_elf_map_sections_to_segments): Add a bool
		pointer argument.
		* elf.c (_bfd_elf_map_sections_to_segments): Add a bool pointer
		argument to indicate if section layout needs update.
		(assign_file_positions_for_load_sections): Pass NULL to
		_bfd_elf_map_sections_to_segments.
		* elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): Pass
		NULL to _bfd_elf_map_sections_to_segments.

	ld/

		* ldelfgen.c (ldelf_map_segments): Pass &need_layout to
		_bfd_elf_map_sections_to_segments.

2022-01-12  H.J. Lu  <hjl.tools@gmail.com>

	elf: Add .relr.dyn to special_sections_r
		* elf.c (special_sections_r): Add .relr.dyn.

2022-01-12  Andrew Burgess  <aburgess@redhat.com>

	gdb: add 'maint set/show gnu-source-highlight enabled' command
	In a later commit I want to address an issue with the Python pygments
	based code styling solution.  As this approach is only used when the
	GNU Source Highlight library is not available, testing bugs in this
	area can be annoying, as it requires GDB to be rebuilt with use of GNU
	Source Highlight disabled.

	This commit adds a pair of new maintenance commands:

	  maintenance set gnu-source-highlight enabled on|off
	  maintenance show gnu-source-highlight enabled

	these commands can be used to disable use of the GNU Source Highlight
	library, allowing me, in a later commit, to easily test bugs that
	would otherwise be masked by GNU Source Highlight being used.

	I made this a maintenance command, rather than a general purpose
	command, as it didn't seem like this was something a general user
	would need to adjust.  We can always convert the maintenance command
	to a general command later if needed.

	There's no test for this here, but this feature will be used in a
	later commit.

2022-01-12  Andrew Burgess  <aburgess@redhat.com>

	gdb: erase items from the source_cache::m_offset_cache
	The source_cache class has two member variables m_source_map, which
	stores the file contents, and m_offset_cache, which stores offsets
	into the file contents.

	As source files are read the contents of the file, as well as the
	offset data, are stored in the cache using these two member variables.

	Whenever GDB needs either the files contents, or the offset data,
	source_cache::ensure is called.  This function looks for the file in
	m_source_map, and if it's found then this implies the file is also in
	m_offset_cache, and we're done.

	If the file is not in m_source_map then GDB calls
	source_cache::get_plain_source_lines to open the file and read its
	contents.  ::get_plain_source_lines also calculates the offset data,
	which is then inserted into m_offset_cache.

	Back in ::ensure, the file contents are added into m_source_map.  And
	finally, if m_source_map contains more than MAX_ENTRIES, an entry is
	removed from m_source_map.

	The problem is entries are not removed from m_offset_cache at the same
	time.

	This means that if a program contains enough source files, GDB will
	hold at most MAX_ENTRIES cached source file contents, but can contain
	offsets data for every source file.

	Now, the offsets data is going to be smaller than the cached file
	contents, so maybe there's no harm here.  But, when we reload the file
	contents we always recalculate the offsets data.  And, when we
	::get_line_charpos asking for offset data we still call ::ensure which
	will ends up loading and caching the file contents.

	So, given the current code does the work of reloading the offset data
	anyway, we may as well save memory by capping m_offset_cache to
	MAX_ENTRIES just like we do m_source_map.

	That's what this commit does.

	There should be no user visible changes after this commit, except for
	ever so slightly lower memory usage in some cases.

2022-01-12  Andrew Burgess  <aburgess@redhat.com>

	gdb: new 'maint flush source-cache' command
	This commit adds a new 'maint flush source-cache' command, this
	flushes the cache of source file contents.

	After flushing GDB is forced to reread source files the next time any
	source lines are to be displayed.

	I've added a test for this new feature.  The test is a little weird,
	in that it modifies a source file after compilation, and makes use of
	the cache flush so that the changes show up when listing the source
	file.  I'm not sure when such a situation would ever crop up in real
	life, but maybe we can imagine such cases.

	In reality, this command is useful for testing the syntax highlighting
	within GDB, we can adjust the syntax highlighting settings, flush the
	cache, and then get the file contents re-highlighted using the new
	settings.

2022-01-12  Andrew Burgess  <aburgess@redhat.com>

	gdb: rename lin-lwp to linux-nat in set/show debug
	Rename 'set debug lin-lwp' to 'set debug linux-nat' and 'show debug
	lin-lwp' to 'show debug linux-nat'.

	I've updated the documentation and help text to match, as well as
	making it clear that the debug that is coming out relates to all
	aspects of Linux native inferior support, not just the LWP aspect of
	it.

	The boundary between general "native" target debug, and the lwp
	specific part of that debug was always a little blurry, but the actual
	debug variable inside GDB is debug_linux_nat, and the print routine
	linux_nat_debug_printf, is used throughout the linux-nat.c file, not
	just for lwp related debug, so the new name seems to make more sense.

2022-01-12  Clément Chigot  <clement.chigot@atos.net>

	ld: add hidden and internal visibility support for XCOFF
	This patch adds a primary support for hidden and internal visibility in
	GNU linker for XCOFF format.
	The protected visibility isn't yet supported.

	PR 22085

	bfd/ChangeLog:

		* xcofflink.c (xcoff_dynamic_definition_p): Add hidden
		  and internal visibility support.
		(xcoff_link_add_symbols): Likewise.
		(xcoff_auto_export_p): Likewise.
		(bfd_xcoff_export_symbol): Likewise.
		(xcoff_link_input_bfd): Likewise.

	ld/ChangeLog:

		* testsuite/ld-vsb/main.c: Adapt for XCOFF.
		* testsuite/ld-vsb/sh1.c: Likewse.
		* testsuite/ld-vsb/vsb.exp: Likewise.
		* testsuite/ld-vsb/visibility-1-xcoff-32.d: New test.
		* testsuite/ld-vsb/visibility-1-xcoff-64.d: New test.
		* testsuite/ld-vsb/visibility-2-xcoff-32.d: New test.
		* testsuite/ld-vsb/visibility-2-xcoff-64.d: New test.
		* testsuite/ld-vsb/xcoffvsb.dat: New test.

2022-01-12  Clément Chigot  <clement.chigot@atos.net>

	ld/testsuite: prepare ld-elfvsb to support XCOFF
	A following patch will add visibility support in ld for XCOFF. Thus,
	ld-elfvsb is renamed ld-vsb and a suffix is added to files targeting only
	ELF format.

	ld/ChangeLog:

		* testsuite/ld-elfvsb: rename as ld-vsb.
		* testsuite/ld-elfvsb/hidden0.d: move to ld-vsb and rename with
		  suffix -elf.d.
		* testsuite/ld-elfvsb/hidden1.d: Likewise.
		* testsuite/ld-elfvsb/hidden2.d: Likewise.
		* testsuite/ld-elfvsb/internal0.d: Likewise.
		* testsuite/ld-elfvsb/internal1.d: Likewise.
		* testsuite/ld-elfvsb/protected0.d: Likewise.
		* testsuite/ld-elfvsb/protected1.d: Likewise.

2022-01-12  Clément Chigot  <clement.chigot@atos.net>

	gas: add visibility support using GNU syntax on XCOFF
	In order to ease port of GNU assembly code and especially ld testsuite,
	this patch allows XCOFF to accept the usual GNU syntax for visibility.

	PR 22085

	gas/ChangeLog:

		* config/tc-ppc.c (ppc_GNU_visibility): New function.
		* testsuite/gas/ppc/aix.exp: Add new tests.
		* testsuite/gas/ppc/xcoff-visibility-2-32.d: New test.
		* testsuite/gas/ppc/xcoff-visibility-2-64.d: New test.
		* testsuite/gas/ppc/xcoff-visibility-2.s: New test.

2022-01-12  Clément Chigot  <clement.chigot@atos.net>

	gas: add visibility support for XCOFF
	XCOFF assembly defines the visibility using an additional argument
	on several pseudo-ops: .globl, .weak, .extern and .comm.
	This implies that .globl and .weak syntax is different than the
	usual GNU syntax. But we want to provide compatibility with AIX
	assembler, especially because GCC is generating the visibility
	using this XCOFF syntax.

	PR 22085

	bfd/ChangeLog:

	        * coffcode.h (coff_write_object_contents): Change XCOFF header
	        vstamp field to 2.
	        * coffgen.c (coff_print_symbol): Increase the size for n_type.

	gas/ChangeLog:

	        * config/tc-ppc.c (ppc_xcoff_get_visibility): New function.
	        (ppc_globl): New function.
	        (ppc_weak): New function.
	        (ppc_comm): Add visibility field support.
	        (ppc_extern): Likewise.
	        * testsuite/gas/all/cofftag.d: Adjust to new n_type size
	        providing by objdump.
	        * testsuite/gas/ppc/test1xcoff32.d: Likewise.
	        * testsuite/gas/ppc/aix.exp: Add new tests.
	        * testsuite/gas/ppc/xcoff-visibility-1-32.d: New test.
	        * testsuite/gas/ppc/xcoff-visibility-1-64.d: New test.
	        * testsuite/gas/ppc/xcoff-visibility-1.s: New test.

	include/ChangeLog:

	        * coff/internal.h (SYM_V_INTERNAL, SYM_V_HIDDEN,
	        SYM_V_PROTECTED, SYM_V_EXPORTED, SYM_V_MASK): New defines.
	        * coff/xcoff.h (struct xcoff_link_hash_entry): Add visibility
	        field.

	ld/ChangeLog:

	        * testsuite/ld-pe/pr19803.d: Adjust to new n_type size
	        providing by objdump.

2022-01-12  Hans-Peter Nilsson  <hp@axis.com>

	objdump, readelf: Emit "CU:" format only when wide output is requested
	As pre-approved by Alan in
	https://sourceware.org/pipermail/binutils/2021-September/118019.html
	and I believe people have run into getting testsuite failures for
	test-environments with "long" directory names, at least once more
	since that time.  Enough.  I grepped the gas, binutils and ld
	testsuites for "CU:" to catch target-specific occurrences, but I
	noticed none.  I chose to remove "CU:" on the objdump tests instead of
	changing options to get the wide format, so as to keep the name of the
	test consistent with actual options; but added it to the readelf
	options for the gas test as I believe the "CU:" format is preferable.

	Tested for cris-elf and native x86_64-pc-linux-gnu.

	binutils:
		* dwarf.c (display_debug_lines_decoded): Don't check the
		string length of the directory, instead emit the "CU: dir/name"
		format only if wide output is requested.
		* testsuite/binutils-all/dw5.W, testsuite/binutils-all/objdump.WL:
		Adjust accordingly.

	gas:
		* testsuite/gas/elf/dwarf-5-loc0.d: Add -W to readelf options.

2022-01-12  Alan Modra  <amodra@gmail.com>

	Set SEC_ELF_REVERSE_COPY earlier
	For the sake of DT_RELR.

	bfd/
		* elflink.c (elf_link_input_bfd): Don't set SEC_ELF_REVERSE_COPY
		here.  Move sanity checks to reverse copying code.
	ld/
		* ldlang.c (lang_add_section): Set SEC_ELF_REVERSE_COPY for
		.ctors/.dtors in .init_array/.fini_array.

2022-01-12  Tiezhu Yang  <yangtiezhu@loongson.cn>

	gdb: testsuite: fix wrong comment in gdb.base/charset.c
	In gdb/testsuite/gdb.base/charset.c, use "IBM1047" instead of "EBCDIC"
	to fix the wrong comment.

2022-01-12  Tiezhu Yang  <yangtiezhu@loongson.cn>

	gdb: testsuite: fix failed testcases in gdb.base/charset.exp
	In gdb/testsuite/gdb.base/charset.c, the last argument is greater than 127
	when call fill_run() in EBCDIC-US and IBM1047, but the type of string[] is
	char, this will change the value due to sign extension.

	For example, ebcdic_us_string[7] will be -63 instead of the original 193 in
	EBCDIC-US.

	Make the type of string[] as unsigned char to fix the following six failed
	testcases:

	  $ grep FAIL gdb/testsuite/gdb.sum
	  FAIL: gdb.base/charset.exp: check value of parsed character literal in EBCDIC-US
	  FAIL: gdb.base/charset.exp: check value of parsed string literal in EBCDIC-US
	  FAIL: gdb.base/charset.exp: check value of escape that doesn't exist in EBCDIC-US
	  FAIL: gdb.base/charset.exp: check value of parsed character literal in IBM1047
	  FAIL: gdb.base/charset.exp: check value of parsed string literal in IBM1047
	  FAIL: gdb.base/charset.exp: check value of escape that doesn't exist in IBM1047

2022-01-12  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-11  Fangrui Song  <maskray@google.com>

	ar: Add --thin for creating thin archives
	In many ar implementations (FreeBSD, elfutils, etc), -T has the X/Open
	System Interface specified semantics. Therefore -T for thin archives is
	not recommended for portability. -T is deprecated without diagnostics.

	    PR binutils/28759
	    * ar.c (long_options): Add --thin.
	    (usage) Add --thin. Deprecate -T without diagnostics.
	    * doc/binutils.texi: Add doc.
	    * NEWS: Mention --thin.
	    * binutils/testsuite/binutils-all/ar.exp: Add tests.

2022-01-11  Martin Storsj  <martin@martin.st>

	Fix multiple problems with DLL generation.
	ld	* pe-dll.c (make_head): Prefix the symbol name with the dll name.
		(make_tail, make_one, make_singleton_name_thunk): Likewise.
		(make_import_fixup_entry, make_runtime_pseudo_reloc): Likewise.
		(pe_create_runtime_relocator_reference): Likewise.
		(pe_dll_generate_implib): Set dll_symname_len.
		(pe_process_import_defs): Likewise.

	binutils
		* dlltool.c (main): If a prefix has not been provided, attempt to
		use a deterministic one based upon the dll name.

2022-01-11  Jan Beulich  <jbeulich@suse.com>

	gas/doc: mention quoted symbol names

2022-01-11  Andrew Burgess  <aburgess@redhat.com>

	gdbsupport: regenerate Makefile.in
	I had cause to regenerate gdbsupport/Makefile.in, and noticed some
	unexpected changes in the copyright header dates.

	I suspect that this was caused by the end of year date range update
	process.

	The Makefile.in contains two date ranges.  The first range appears to
	be the date range for the version of automake being used, that is the
	range runs up to 2017 only, when automake 1.15.1 was released.

	The second date range in Makefile.in represents the date range for the
	generated file, and so, now runs up to 2022.

	Anyway, this is the result of running autoreconf (using automake
	1.15.1) in the gdbsupport directory.

2022-01-11  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-10  Clément Chigot  <clement.chigot@atos.net>

	XCOFF: add support for TLS relocations on hidden symbols
	This patch adds support for TLS relocation targeting C_HIDEXT symbols.
	In gas, TLS relocations, except R_TLSM and R_TLMSL, must keep the value
	of their target symbol.
	In ld, it simply ensures that internal TLS symbols are added to the
	linker hash table for xcoff_reloc_type_tls.

	It also improves the tests made by both.

	bfd/ChangeLog:

		* coff-rs6000.c (xcoff_howto_table): Fix name of R_TLSML.
		(xcoff_reloc_type_tls): Replace the error when h is NULL by
		an assert.
		(xcoff_complain_overflow_unsigned_func): Adjust comments.
		* coff64-rs6000.c (xcoff64_howto_table): Fix name of R_TLSML.
		* xcofflink.c (xcoff_link_add_symbols_to_hash_table): New
		function.
		(xcoff_link_add_symbols): Add C_HIDEXT TLS symbols to the linker
		hash table.

	gas/ChangeLog:

		* config/tc-ppc.c (md_apply_fix): Enable support for TLS
		relocation over internal symbols.
		* testsuite/gas/ppc/aix.exp: Replace xcoff-tlms by xcoff-tls.
		* testsuite/gas/ppc/xcoff-tlsm-32.d: Removed.
		* testsuite/gas/ppc/xcoff-tlsm-64.d: Removed.
		* testsuite/gas/ppc/xcoff-tlsm.s: Removed.
		* testsuite/gas/ppc/xcoff-tls-32.d: New test.
		* testsuite/gas/ppc/xcoff-tls-64.d: New test.
		* testsuite/gas/ppc/xcoff-tls.s: New test.

	ld/ChangeLog:

		* testsuite/ld-powerpc/aix52.exp: Improve aix-tls-reloc test.
		* testsuite/ld-powerpc/aix-tls-reloc.s: Likewise.
		* testsuite/ld-powerpc/aix-tls-reloc-32.d: Removed.
		* testsuite/ld-powerpc/aix-tls-reloc-64.d: Removed.
		* testsuite/ld-powerpc/aix-tls-reloc-32.dd: New test.
		* testsuite/ld-powerpc/aix-tls-reloc-32.dt: New test.
		* testsuite/ld-powerpc/aix-tls-reloc-64.dd: New test.
		* testsuite/ld-powerpc/aix-tls-reloc-64.dt: New test.

2022-01-10  Tiezhu Yang  <yangtiezhu@loongson.cn>

	gdb: add Tiezhu Yang to MAINTAINERS

2022-01-10  Tom Tromey  <tom@tromey.com>

	Reduce use of unfiltered output in Darwin code
	The Darwin code uses unfiltered output liberally.  This patch changes
	this code to send some output to gdb_stdlog (in some cases via the use
	of debug_prefixed_printf_cond_nofunc), or to gdb_stderr, or to simply
	switch to filtered output.

	Note that I didn't switch inferior_debug to use
	debug_prefixed_printf_cond_nofunc, because that would affect the
	output by removing the information about the inferior.  I wasn't sure
	if this was important or not, so I left it in.

	v2 of this patch uses warning rather than prints to gdb_stderr, and
	removes some trailing whitespace.

	I can't compile this patch, so it's "best effort".

2022-01-10  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-08  Andrew Burgess  <aburgess@redhat.com>

	gdb/hurd: handle inferiors exiting
	While testing on GNU/Hurd (i386) I noticed that GDB crashes when an
	inferior exits, with this error:

	  inferior.c:293: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed.

	The problem appears to be in gnu_nat_target::wait.

	We always set inferior_ptid to null_ptid before calling target_wait,
	this has been the case since the multi-target changes were made to GDB
	in commit:

	  commit 5b6d1e4fa4fc6827c7b3f0e99ff120dfa14d65d2
	  Date:   Fri Jan 10 20:06:08 2020 +0000

	      Multi-target support

	With follow up changes in commit:

	  commit 24ed6739b699f329c2c45aedee5f8c7d2f54e493
	  Date:   Thu Jan 30 14:35:40 2020 +0000

	      gdb/remote: Restore support for 'S' stop reply packet

	Unfortunately, the GNU/Hurd target is still relying on the value of
	inferior_ptid in the case where an inferior exits - we return the
	value of inferior_ptid as the pid of the process that exited.  This
	was fine in the single target world, where inferior_ptid identified
	the one running inferior, but this is no longer good enough.

	Instead, we should return a ptid containing the pid of the process
	that exited, as obtained from the wait event, and this is what this
	commit does.

	I've not run the full testsuite on GNU/Hurd as there appear to be lots
	of other issues with this target that makes running the full testsuite
	very painful, but I think this looks like a small easy improvement.

2022-01-08  Tom Tromey  <tom@tromey.com>

	Add explicit check for nullptr to target_announce_attach
	Lancelot pointed out that target_announce_attach was missing an
	explicit check against nullptr.  This patch adds it.

2022-01-08  Hannes Domani  <ssbssa@yahoo.de>

	Add _sigsys info to siginfo struct
	This patch adds information about _sigsys structure from newer
	kernels, so that $_siginfo decoding can show information about
	_sigsys, making it easier for developers to debug seccomp failures.
	Requested in PR gdb/24283.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24283

2022-01-08  Tiezhu Yang  <yangtiezhu@loongson.cn>

	gdb: testsuite: show print array-indexes after set in arrayidx.exp
	Add "show print array-indexes" testcases after set print array-indexes
	to off or on.

	Without this patch:

	    PASS: gdb.base/arrayidx.exp: set print array-indexes to off
	    PASS: gdb.base/arrayidx.exp: print array with array-indexes off
	    PASS: gdb.base/arrayidx.exp: set print array-indexes to on
	    PASS: gdb.base/arrayidx.exp: print array with array-indexes on

	With this patch:

	    PASS: gdb.base/arrayidx.exp: set print array-indexes to off
	    PASS: gdb.base/arrayidx.exp: show print array-indexes is off
	    PASS: gdb.base/arrayidx.exp: print array with array-indexes off
	    PASS: gdb.base/arrayidx.exp: set print array-indexes to on
	    PASS: gdb.base/arrayidx.exp: show print array-indexes is on
	    PASS: gdb.base/arrayidx.exp: print array with array-indexes on

2022-01-08  H.J. Lu  <hjl.tools@gmail.com>

	ld: Extract _bfd_elf_link_iterate_on_relocs
	DT_RELR encodes consecutive R_*_RELATIVE relocations in GOT (the global
	offset table) and data sections in a compact format:

	https://groups.google.com/g/generic-abi/c/bX460iggiKg

	On some targets, R_*_RELATIVE relocations are counted and the GOT offsets
	are allocated when setting the dynamic section sizes after seeing all
	relocations.  R_*_RELATIVE relocations are generated while relocating
	sections after section layout has been finalized.

	To prepare for DT_RELR implementation on these targets, extract
	_bfd_elf_link_iterate_on_relocs from _bfd_elf_link_check_relocs so
	that a backend can scan relocations in elf_backend_always_size_sections

	For x86 targets, the old check_relocs is renamed to scan_relocs and a
	new check_relocs is added to chek input sections and create dynamic
	relocation sections so that they will be mapped to output sections.
	scan_relocs is now called from elf_backend_always_size_sections.

	Since relocations are scanned after __start, __stop, .startof. and
	.sizeof. symbols have been finalized on x86, __[start|stop]_SECNAME for
	--gc-sections -z start-stop-gc are now zero when all SECNAME sections
	been garbage collected.  This is no need for elf_x86_start_stop_gc_p.

	bfd/

		* elf-bfd.h (_bfd_elf_link_iterate_on_relocs): New.
		* elf32-i386.c (elf_i386_convert_load_reloc): Don't call
		elf_x86_start_stop_gc_p.
		(elf_i386_check_relocs): Renamed to ...
		(elf_i386_scan_relocs): This.  Don't call
		_bfd_elf_make_dynamic_reloc_section.
		(elf_i386_always_size_sections): New.
		(elf_backend_check_relocs): Removed.
		(elf_backend_always_size_sections): New.
		* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't call
		elf_x86_start_stop_gc_p.
		(elf_x86_64_check_relocs): Renamed to ...
		(elf_x86_64_scan_relocs): This.  Don't call
		_bfd_elf_make_dynamic_reloc_section.
		(elf_x86_64_always_size_sections): New.
		(elf_backend_check_relocs): Removed.
		(elf_backend_always_size_sections): New.
		* elflink.c (elf_link_check_or_scan_relocs):
		New.  Extracted from _bfd_elf_link_check_relocs.
		(_bfd_elf_link_check_relocs): Call elf_link_check_or_scan_relocs.
		* elfxx-x86.c (_bfd_x86_elf_check_relocs): New.
		* elfxx-x86.h (X86_64_NEED_DYNAMIC_RELOC_TYPE_P): New.
		(I386_NEED_DYNAMIC_RELOC_TYPE_P): Likewise.
		(X86_NEED_DYNAMIC_RELOC_TYPE_P): Likewise.
		(_bfd_x86_elf_check_relocs): Likewise.
		(elf_backend_check_relocs): Likewise.
		(elf_backend_always_size_sections): Removed.
		(elf_x86_start_stop_gc_p): Likewise.

	ld/

		* testsuite/ld-i386/pr27491-1a.d: Updated.
		* testsuite/ld-x86-64/pr27491-1a.d: Likewise.

2022-01-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.mi/mi-catch-load.exp
	When I run the testsuite, I have:

	    Running .../gdb/testsuite/gdb.mi/mi-catch-load.exp ...
	    DUPLICATE: gdb.mi/mi-catch-load.exp: breakpoint at main
	    DUPLICATE: gdb.mi/mi-catch-load.exp: mi runto main

	Fix by grouping the various phases in with_test_prefix blocks.  Since
	the tests now have a prefix, remove the manually written prefixes in
	testnames.

	Also change some messages with the pattern "(timeout) $testname" into
	"$estname (timeout)" since tools will handle this as $testname[1] (which
	is what we want in this particular scenario).

	Tested on x86_64-linux.

	[1] https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.threads/staticthreads.ex
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.threads/staticthreads.exp ...
	    DUPLICATE: gdb.threads/staticthreads.exp: couldn't compile staticthreads.c: unrecognized error

	Fix by using foreach_with_prefix instead of foreach when preparing the
	test case.

	Testeed on x86_64-linux both in a setup where the test fails to prepare
	and in a setup where the test fails to setup.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.mi/mi-language.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.mi/mi-language.exp ...
	    DUPLICATE: gdb.mi/mi-language.exp: set lang ada

	This is due to an erroneous explicit test name.  This explicit test name
	also happens to be useless (at least it would have been if it was
	correct) since it only repeats the command, so just remove the explicit
	test name and let the command be used as default test name.  Also remove
	explicit test name at another location in the file since it also just
	repeat the command.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.mi/mi-nonstop-exit.exp ...
	    DUPLICATE: gdb.mi/mi-nonstop-exit.exp: breakpoint at main
	    DUPLICATE: gdb.mi/mi-nonstop-exit.exp: mi runto main

	This test runs the same sequence of operations twice.  Refactor the code
	by running both of those sequences within a foreach_with_prefix block to
	ensure that the commands have unique test names.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.mi/mi-nonstop.exp ...
	    DUPLICATE: gdb.mi/mi-nonstop.exp: check varobj, w1, 1
	    DUPLICATE: gdb.mi/mi-nonstop.exp: stacktrace of stopped thread

	Fix by adjusting the problematic test names.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.mi/mi-nsthrexec.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.mi/mi-nsthrexec.exp ...
	    DUPLICATE: gdb.mi/mi-nsthrexec.exp: breakpoint at main

	Fix by adjusting the duplicated test name.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp
	When running the testsuite, I have:

	    Running ../gdb/testsuite/gdb.base/watchpoints.exp ...
	    DUPLICATE: gdb.base/watchpoints.exp: watchpoint hit, first time

	Fix by adjusting the test names where appropriate.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/nested-subp2.exp ...
	    DUPLICATE: gdb.base/nested-subp2.exp: continue to the STOP marker
	    DUPLICATE: gdb.base/nested-subp2.exp: print c
	    DUPLICATE: gdb.base/nested-subp2.exp: print count

	Fix by using with_test_prefix to differentiate the test that are
	performed at different points during the execution of the debuggee.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/call-signal-resume.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/call-signal-resume.exp ...
	    DUPLICATE: gdb.base/call-signal-resume.exp: dummy stack frame number
	    DUPLICATE: gdb.base/call-signal-resume.exp: set confirm off
	    DUPLICATE: gdb.base/call-signal-resume.exp: return

	This is due to the fact that a pattern was probably copy/pasted to
	re-use the logic while not adjusting the test names to avoid the
	duplication.

	Fix by removing the redundant tests ('set confirm off' only needs to be
	used once) and adjusting the test names where appropriate.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
	When I run the testsuite, I have :

	    Running .../gdb/testsuite/gdb.base/pointers.exp ...
	    DUPLICATE: gdb.base/pointers.exp: pointer assignment

	Fix by placing the sections with duplication in with_test_prefix blocks.
	This removes the duplication and gives a better organization the file.

	Tested on x86_64-linux.
	Co-Authored-By: Pedro Alves <pedro@palves.net>

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/unload.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/unload.exp ...
	    DUPLICATE: gdb.base/unload.exp: continuing to unloaded libfile

	Fix by adjusting the test name.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/define-prefix.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/define-prefix.exp ...
	    DUPLICATE: gdb.base/define-prefix.exp: define user command: ghi-prefix-cmd

	Fix by adjusting test names.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/funcargs.exp ...
	    DUPLICATE: gdb.base/funcargs.exp: run to call2a

	Fix by using proc_with_prefix instead on plain proc to create logical
	function blocks.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
	When I run the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/shlib-call.exp ...
	    DUPLICATE: gdb.base/shlib-call.exp: print g
	    DUPLICATE: gdb.base/shlib-call.exp: set print sevenbit-strings
	    DUPLICATE: gdb.base/shlib-call.exp: set print address off
	    DUPLICATE: gdb.base/shlib-call.exp: set width 0
	    DUPLICATE: gdb.base/shlib-call.exp: continue until exit

	Fix by adjusting the test names when required, and by removing
	un-necessary commands.

	While at it, do some cleanup:
	- Replace an explicit GDB restart sequence with a call to clean_restart.
	- Remove trailing whitespaces.
	- Use $gdb_test_name in gdb_test_multiple.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/set-cfd.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/set-cwd.exp ...
	    DUPLICATE: gdb.base/set-cwd.exp: test_cwd_reset: continue to breakpoint: break-here

	Fix by moving the tests after the 'runto_main' within the same
	with_test_prefix scope.

	While at it, I fix some indentation issues.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/exprs.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/exprs.exp ...
	    DUPLICATE: gdb.base/exprs.exp: \$[0-9]* = red (setup)

	Fix by using with_test_prefix where appropriate.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/readline.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/readline.exp ...
	    DUPLICATE: gdb.base/readline.exp: Simple operate-and-get-next - final prompt

	Fix by adjusting the prefix given to the second 'simple' call to
	operate_and_get_next.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/pretty-array.exp
	When I run the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/pretty-array.exp ...
	    DUPLICATE: gdb.base/pretty-array.exp: print nums
	    DUPLICATE: gdb.base/pretty-array.exp: print nums

	Fix by giving a name to the test cases.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/ui-redirect.exp ...
	    DUPLICATE: gdb.base/ui-redirect.exp: redirect while already logging: set logging redirect off

	Fix by moving the first 'set logging redirect off' to the end of the
	previous [with_test_prefix] test block. The statement's purpose is to
	clean the on flag set in this previous block, so moving it there makes
	sense and does not change the sequence of commands in the test file.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: completion-support.exp: improve leading whitespace support
	There is a expect support library in the source tree designed to help
	developers test the auto-completion capabilities of GDB.

	One of the functions is test_gdb_complete_unique_re.  It is used
	(usually indirectly via test_gdb_complete_unique) to test that a given
	input line is completed as a given output line.  The test checks for two
	ways to do the completion: using tab-completion, or using the
	'complete' command.  To do this, calls to two dedicated functions are
	performed.  If we omit few details, we can consider that a call to

	    test_gdb_complete_unique $input $expected

	is equivalent to the two following calls:

	    test_gdb_complete_tab_unique $input $expected
	    test_gdb_complete_cmd_unique $input $expected

	When using the tab-completion, everything works as expected, but some
	care must be taken when using the 'complete' command if the given input
	has leading whitespaces.  In such situation, the output of the
	'complete' command will drop the leading whitespaces.

	The current approach is that in such situation, the input and expected
	outputs are right trimmed (i.e. all leading whitespaces are removed)
	when performing the command completion check.

	This means that the following call:

	    test_gdb_complete_unique "   $input" "   $expected"

	is almost equivalent to (again, omitting few details and arguments):

	    test_gdb_complete_tab_unique "   $input" "   $expected"
	    test_gdb_complete_cmd_unique "$input" "$expected"

	This approach comes with a problem that we encounter when running the
	tests in complete-empty.exp.  When doing so, we have:

	    Running .../gdb/testsuite/gdb.base/complete-empty.exp ...
	    DUPLICATE: gdb.base/complete-empty.exp: empty-input-line: cmd complete ""

	This is because the test file does something like:

	    test_gdb_complete_unique "" "!" " " 1
	    test_gdb_complete_unique "   " "   !" " " 1¬

	which, if we do the substitution introduced above is equivalent to:

	    test_gdb_complete_tab_unique "" "!"
	    test_gdb_complete_cmd_unique "" "!"
	    test_gdb_complete_tab_unique "   " "   !"
	    test_gdb_complete_cmd_unique "" "!"

	We see that the lines 2 and 4 are now the same, and for this reason the
	testing framework complains about DUPLICATE test names.

	To fix that, this commit proposes that instead of left trimming both
	input and expected outputs, only the expected output is trimmed.

	Care must be taken in the case the completion gives more possibilities
	than allowed by the max-completions setting.  In this case, the input
	will be repeated in the output in its left trimmed version.  This commit
	also ensures that this is taken care of.

	With this commit, the gdb.base/complete-empty.exp still passes all its
	tests but does not report the DUPLICATE anymore.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/subst.exp
	When I run the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/subst.ex ...
	    DUPLICATE: gdb.base/subst.exp: unset substitute-path from, no rule entered yet

	Fix by adjusting the problematic test name.

	Tested on x86_64-linux.

2022-01-07  Pedro Alves  <pedro@palves.net>

	gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp
	When I run the testsuite, I have:

	    Running ../gdb/testsuite/gdb.base/dfp-exprs.exp ...
	    DUPLICATE: gdb.base/dfp-exprs.exp: p 1.2dl < 1.3df

	Replace hand-written tests checking various comparison operators between
	various decimal floating point types with a loop to programmatically
	generate all the combinations.  This removes the need to eyeball for all
	suffixes, which lead to the original duplication.

	Also add a lot more combinations, testing all comparison operators
	comprehensively.  The result is 262 unique tests vs 104 before this
	patch.

	Tested on x86_86-linux.

	Change-Id: Id215a3d610aa8e032bf06ee160b5e3aed4a92d1e

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/ptype.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/ptype.exp ...
	    DUPLICATE: gdb.base/ptype.exp: ptype the_highest
	    DUPLICATE: gdb.base/ptype.exp: list intfoo
	    DUPLICATE: gdb.base/ptype.exp: list charfoo

	Fix by adjusting the offending test names.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/dfp-test.exp ...
	    DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
	    DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number
	    DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
	    DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number

	Fix by using proc_with_prefix where appropriate.

	Tested on x86_64-linux.
	Co-Authored-By: Andrew Burgess <aburgess@redhat.com>

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/del.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/del.exp ...
	    DUPLICATE: gdb.base/del.exp: info break after removing break on main

	Refactor slightly this test to run the various configurations under
	foreach_with_prefix so each variant is automatically prefixed, ensuring
	that the forgotten custom test name cannot happen.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/solib-display.exp ...
	    DUPLICATE: gdb.base/solib-display.exp: NO: break 25
	    DUPLICATE: gdb.base/solib-display.exp: NO: continue
	    DUPLICATE: gdb.base/solib-display.exp: IN: break 25
	    DUPLICATE: gdb.base/solib-display.exp: IN: continue
	    DUPLICATE: gdb.base/solib-display.exp: SEP: break 25
	    DUPLICATE: gdb.base/solib-display.exp: SEP: continue

	The 'break 25' appears because the test inserts two breakpoints at the
	same location.  Fix this by only inserting the breakpoint once.

	Fix the 'continue' DUPLICATE by giving a phony name to the second
	continue: 'continue two'.

	While at it, this commit also removes a trailing space.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/decl-before-def.exp ...
	    DUPLICATE: gdb.base/decl-before-def.exp: p a

	Fix by giving explicit names to the two tests that use the same command.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/pending.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/pending.exp ...
	    DUPLICATE: gdb.base/pending.exp: disable other breakpoints

	Fix by adjusting the test names.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/checkpoint.exp ...
	    DUPLICATE: gdb.base/checkpoint.exp: verify lines 5 two
	    DUPLICATE: gdb.base/checkpoint.exp: restart 0 one

	This patch fixes the various erroneous incorrect test names.

	While at it, this patch also remove some trailing white spaces across
	the file.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/pie-fork.exp ...
	    DUPLICATE: gdb.base/pie-fork.exp: test_no_detach_on_fork: continue

	Fix by giving explicit names to the 'continue' commands that cause the
	duplicate message.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp
	When running the testsuite, I have:

	    Running .../gdb/testsuite/gdb.base/realname-expand.exp ...
	    DUPLICATE: gdb.base/realname-expand.exp: set basenames-may-differ on

	This is due to the fact that the test restarts GDB twice and each time
	sets the basenames-may-differ setting.  This patch proposes to fix this
	by not restarting GDB so the setting is maintained.  It just clears the
	breakpoints between the two tests and updates the breakpoints number as
	required.

	This patch also perform some minor refactorings to improve visibility.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/interp.exp
	When running the testsuite I have:

	    Running .../gdb/testsuite/gdb.base/interp.exp ...
	    DUPLICATE: gdb.base/interp.exp: interpreter-exec mi "-var-update *"

	This is due to the fact that multiple successive instances of
	gdb_test_multiple use 'pass $cmd', but one of them forgets to reset $cmd
	to a new test name.

	Fix by using 'pass $gdb_test_name', given that the gdb_test_name is set
	by gdb_test_multiple.

	While fixing this, this patch refactors all occurrences of the following
	pattern:

	    set cmd foo
	    gdb_test_multiple $cmd $cmd {
	        -re ... {
	            pass $cmd
	        }
	    }

	into

	    gdb_test_multiple foo "" {
	        -re ... {
	            pass $gdb_test_name
	         }
	    }

	This makes this test file coherent in its use of $gdb_test_name.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
	When running the testsuite I see:

	    Running .../gdb/testsuite/gdb.base/miscexprs.exp ...
	    DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
	    DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]

	This is due to an explicit test name repeated across multiple tests.
	The actual test explicit names do not add much over the command from
	wich default test names are derived.

	Fix by removing the explicit test names across the file where they do
	not add value.  While at doing some cleaning, also use $gdb_test_name in
	the various uses of gdb_test_multiple.

	Tested on x86_64-linux.

2022-01-07  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp
	When running the testsuite I have:

	    Running .../gdb/testsuite/gdb.base/stack-checking.exp ...
	    DUPLICATE: gdb.base/stack-checking.exp: bt
	    DUPLICATE: gdb.base/stack-checking.exp: bt

	Fix by using with_test_prefix.

	Tested on x86_64-linux.

2022-01-07  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	RISC-V: update docs to reflect privileged spec v1.9 has been dropped
	After commit d8af286fffa ("RISC-V: Drop the privileged spec v1.9
	support.") has removed support for privileged spec v1.9, this removes
	it from the documentation.

	References: d8af286fffa ("RISC-V: Drop the privileged spec v1.9 support.")

	gas/ChangeLog:

		* configure: Regenerate.
		* configure.ac: Remove reference to priv spec 1.9.
		* po/fr.po: Same.
		* po/ru.po: Same.
		* po/uk.po: Same.

2022-01-07  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	RISC-V: update docs for -mpriv-spec/--with-priv-spec for 1.12
	While support for the privileged spec was added in a63375ac337
	("RISC-V: Hypervisor ext: support Privileged Spec 1.12"), the
	documentation has not been updated.  Add 1.12 to the relevant
	documentation.

	References: a63375ac337 ("RISC-V: Hypervisor ext: support Privileged Spec 1.12")

	gas/ChangeLog:

		* config/tc-riscv.c: Add 1.12 to the usage message.
		* configure: Regenerate.
		* configure.ac: Add 1.12 to the help/usage message.
		* po/fr.po: Same.
		* po/ru.po: Same.
		* po/uk.po: Same.

2022-01-07  Tom Tromey  <tromey@adacore.com>

	Do not use CC_HAS_LONG_LONG
	ax.cc checks CC_HAS_LONG_LONG, but nothing defines this.  However,
	PRINTF_HAS_LONG_LONG is checked in configure.  This patch removes the
	former and keeps the latter.  This is PR remote/14976 (filed by me in
	2012, lol).

	I'm checking this in.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=14976

2022-01-07  Andrew Burgess  <aburgess@redhat.com>

	gdb/doc: shorten some source lines, and prevent some line breaks
	Building on the previous commit, this makes use of a trailing @ to
	split long @deffn lines in the guile.texi source file.  This splitting
	doesn't change how the document is laid out by texinfo.

	I have also wrapped keyword and argument name pairs in @w{...} to
	prevent line breaks appearing between the two.  I've currently only
	done this for the longer @deffn lines, where a line break is
	possible.  This makes the @deffn lines much nicer to read in the
	generated pdf.

2022-01-07  Andrew Burgess  <aburgess@redhat.com>

	gdb/doc: Remove (...) around guile procedure names in @deffn lines
	Most guile procedures in the guile.texi file are defined like:

	  @deffn {Scheme Procedure} name arg1 arg2 arg3

	But there are two places where we do this:

	  @deffn {Scheme Procedure} (name arg1 arg2 arg3)

	Notice the added (...).  Though this does represent how a procedure
	call is written in scheme, it's not the normal style throughout the
	manual.  I also checked the 'info guile' info page to see how they
	wrote there declarations, and they use the first style too.

	The second style also has the drawback that index entries are added as
	'(name', and so they are grouped in the '(' section of the index,
	which is not very user friendly.

	In this commit I've changed the definitions of make-command and
	make-parameter to use the first style.

	The procedure declaration lines can get pretty long with all of the
	arguments, and this was true for both of the procedures I am changing
	in this commit.  I have made use of a trailing '@' to split the deffn
	lines, and keep them under 80 characters in the texi source.  This
	makes no difference to how the final document looks.

	Finally, our current style for keyword arguments, appears to be:

	  [#:keyword-name argument-name]

	I don't really understand the reason for this, 'info guile' just seems
	to use:

	  [#:keyword-name]

	which seems just as good to me.  But I don't propose to change
	that just now.  What I do notice though, is that sometimes, texinfo
	will place a line break between the keyword-name and the
	argument-name, for example, the pdf of make-command is:

	  make-command name [#:invoke invoke] [#:command-class
	    command-class] [#:completer-class completer] [#:prefix? prefix] [#:doc
	    doc-string]

	Notice the line break after '#:command-class' and after '#:doc',
	neither of which are ideal.  And so, for the two commands I am
	changing in this commit, I have made use of @w{...} to prevent line
	breaks between the keyword-name and the argument-name.  Now the pdf
	looks like this:

	  make-command name [#:invoke invoke]
	    [#:command-class command-class] [#:completer-class completer]
	    [#:prefix? prefix] [#:doc doc-string]

	Which seems much better.  I'll probably update the other deffn lines
	at some point.

2022-01-07  Pavel Mayorov  <pmayorov@cloudlinux.com>

	Revert previous delta to debug.c.  Replace with patch to reject indirect types that point to indirect types.
		PR 28718
		* dwarf.c: Revert previous delta.
		(debug_get_real_type): Reject indirect types that point to
		indirect types.
		(debug_get_type_name, debug_get_type_size, debug_write_type):
		Likewise.

2022-01-07  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Updated the default ISA spec to 20191213.
	Update the default ISA spec from 2.2 to 20191213 will change the default
	version of i from 2.0 to 2.1.  Since zicsr and zifencei are separated
	from i 2.1, users need to add them in the architecture string if they need
	fence.i and csr instructions.  Besides, we also allow old ISA spec can
	recognize zicsr and zifencei, but we won't output them since they are
	already included in the i extension when i's version is less than 2.1.

	bfd/
		* elfxx-riscv.c (riscv_parse_add_subset): Allow old ISA spec can
		recognize zicsr and zifencei.
	gas/
		* config/tc-riscv.c (DEFAULT_RISCV_ISA_SPEC): Updated to 20191213.
		* testsuite/gas/riscv/csr-version-1p10.d: Added zicsr to -march since
		the default version of i is 2.1.
		* testsuite/gas/riscv/csr-version-1p11.d: Likewise.
		* testsuite/gas/riscv/csr-version-1p12.d: Likewise.
		* testsuite/gas/riscv/csr-version-1p9p1.d: Likewise.
		* testsuite/gas/riscv/option-arch-03.d: Updated i's version to 2.1.
		* testsuite/gas/riscv/option-arch-03.s: Likewise.
	ld/
		* testsuite/ld-riscv-elf/call-relax.d: Added zicsr to -march since
		the default version of i is 2.1.
		* testsuite/ld-riscv-elf/attr-merge-arch-01.d: Updated i's version to 2.1.
		* testsuite/ld-riscv-elf/attr-merge-arch-01a.s: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-01b.: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-02a.s: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-02b.s: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-03a.s: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-03b.s: Likewise.
		* testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: Added zifencei
		into Tag_RISCV_arch since it is added implied when i's version is
		larger than 2.1.

2022-01-07  Alan Modra  <amodra@gmail.com>

	Move elf_backend_always_size_sections earlier
		* elflink.c (bfd_elf_size_dynamic_sections): Move plt/got init
		earlier and call elf_backend_always_size_sections at the start
		of this function.

2022-01-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-06  H.J. Lu  <hjl.tools@gmail.com>

	ldelfgen.c: Add missing newlines when calling einfo
		* ldelfgen.c (ldelf_map_segments): Add the missing newline to
		einfo.

2022-01-06  Nick Clifton  <nickc@redhat.com>

	Fix a stack exhaustion bug parsing malicious STABS format debug information.
		PR 28718
		* debug.c (debug_write_type): Allow for malicious recursion via
		indirect debug types.

2022-01-06  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add support for new SME instructions
	This patch adds support for three new SME instructions: ADDSPL,
	ADDSVL and RDSVL.  They behave like ADDPL, ADDVL and RDVL, but read
	the streaming vector length instead of the current vector length.

	opcodes/
		* aarch64-tbl.h (aarch64_opcode_table): Add ADDSPL, ADDSVL and RDSVL.
		* aarch64-dis-2.c: Regenerate.

	gas/
		* testsuite/gas/aarch64/sme.s, testsuite/gas/aarch64/sme.d: Add tests
		for ADDSPL, ADDSVL and RDSVL.

2022-01-06  Tom Tromey  <tom@tromey.com>

	Use target_announce_detach in more targets
	target_announce_detach was added in commit 0f48b757 ("Factor out
	"Detaching from program" message printing").  There, Pedro wrote:

	    (For now, I left the couple targets that print this a bit differently
	    alone.  Maybe this could be further pulled out into infcmd.c.  If we
	    did that, and those targets want to continue printing differently,
	    this new function could be converted to a target method.)

	It seems to me that the differences aren't very big, and in some cases
	other targets handled the output a bit more nicely.  In particular,
	some targets will print a different message when exec_file==NULL,
	rather than printing the same output with an empty string as
	exec_file.

	This patch incorporates the nicer output into target_announce_detach,
	then changes the remaining ports to use this function.

2022-01-06  Tom Tromey  <tom@tromey.com>

	Introduce target_announce_attach
	This introduces target_announce_attach, by analog with
	target_announce_detach.  Then it converts existing targets to use
	this, rather than emitting their own output by hand.

2022-01-06  Andrew Burgess  <aburgess@redhat.com>

	gdb: make use add_setshow_prefix_cmd in gnu-nat.c
	In gnu-nat.c we currently implement some set/show prefix commands
	"manually", that is, we call add_prefix_cmd, and assign a set and show
	function to each prefix command.

	These set/show functions print an error indicating that the user
	didn't type a complete command.

	If we instead switch to using add_setshow_prefix_cmd then we can
	delete the set/show functions, GDB provides some default functions,
	which give a nice help style summary that lists all of the available
	sub-commands, along with a one line summary of what each does.

	Though this clearly changes the existing behaviour, I think this
	change is acceptable as the new behaviour is more inline with other
	set/show prefix commands, and the new behaviour is more informative.

	This change will conflict with Tom's change here:

	  https://sourceware.org/pipermail/gdb-patches/2022-January/184724.html

	Where Tom changes the set/show functions that I delete.  My suggestion
	is that the set/show functions still be deleted even after Tom's
	patch (or instead of Tom's patch).

	For testing I've build GDB on GNU/Hurd, and manually tested these
	functions.  I did a grep over the testsuite, and don't believe the
	existing error messages are being checked for in any tests.

2022-01-06  Tom Tromey  <tom@tromey.com>

	Use warning in windows-nat error messages
	A warning in windows-nat.c can be converted to use the warning
	function.  As a side effect, this arranges for the output to be sent
	to gdb_stderr.

2022-01-06  Tom Tromey  <tom@tromey.com>

	Clean up some dead code in windows-tdep.c
	windows-tdep.c checks the result of xmalloc, which isn't necessary.  I
	initially removed this dead check, but then went a bit further and
	modified the code so that some "goto"s and explicit memory management
	could be removed.  Then, I added a couple of missing bounds checks.

	I believe this also fixes a possible bug with a missing 0-termination
	of a string.  I am not certain, but that is why I think the existing
	code allocates a buffer that is 1 byte too long -- but then it fails
	to set this byte to 0.

2022-01-06  Tom Tromey  <tromey@adacore.com>

	Avoid crash in language_info
	language_info calls:

	  show_language_command (NULL, 1, NULL, NULL);

	... "knowing" that show_language_command does not use its ui_file
	parameter.  However, this was changed in commit 7514a661
	("Consistently Use ui_file parameter to show callbacks").

	This patch changes language_info to pass a ui_file.

	It took a while to write the test -- this function is only called when
	'verbose' is on and when switching the "expected" language in auto
	mode.

2022-01-06  Tom Tromey  <tromey@adacore.com>

	Fix some failures in langs.exp
	langs.exp currently has some fails for me because the stack trace
	includes full paths to the source files.

	    FAIL: gdb.base/langs.exp: up to foo in langs.exp
	    FAIL: gdb.base/langs.exp: up to cppsub_ in langs.exp
	    FAIL: gdb.base/langs.exp: up to fsub in langs.exp

	This fixes the failures by making the filename regexps a bit more lax.

2022-01-06  Jan Beulich  <jbeulich@suse.com>

	x86: drop NoAVX insn attribute
	To avoid issues like that addressed by 6e3e5c9e4181 ("x86: extend SSE
	check to PCLMULQDQ, AES, and GFNI insns"), base the check on opcode
	attributes and operand types.

	x86: drop NoAVX from POPCNT
	With the introduction of CpuPOPCNT the NoAVX attribute has become
	meaningless for POPCNT.

	x86: drop some "comm" template parameters
	As already indicated in a remark when introducing these templates, the
	"commutative" attribute is ignored for legacy encoding templates. Hence
	it is possible to shorten a number of templates by specifying C directly
	rather than through a template parameter. I think this helps readability
	a bit.

	x86: templatize FMA insn templates
	The operand ordering portion of the mnemonics repeats, causing a flurry
	of almost identical templates. Abstract this out.

	x86-64: restrict PC32 -> PLT32 conversion
	Neither non-64-bit code nor uses with a non-zero offset from a symbol
	should be converted to PLT32, as an eventual PLT entry would not express
	what was requested.

2022-01-06  Lancelot SIX  <lancelot.six@amd.com>

	gdb: Fix copyright year in gdb/testsuite/gdb.base/inferior-clone.exp
	I just realized that I forgot to update the year before pushing the
	patch that created this file.  Since it landed after the global
	copyright year update have been done, this file’s copyright year is
	updated.

	This patch fixes that.

	Change-Id: I280f7d86e02d38425f7afdcf19a1c3500d51c23f

2022-01-06  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: migrate to standard uintXX_t types
	Drop the sim-specific unsignedXX types and move to the standard uintXX_t
	types that C11 provides.

	sim: common: migrate to standard uintXX_t types
	Drop the sim-specific unsignedXX types and move to the standard uintXX_t
	types that C11 provides.

	sim: igen: migrate to standard uintXX_t types
	Move off the custom local 64-bit types and to the standard uintXX_t
	types that C11 provides.

	sim: mips: migrate to standard uintXX_t types
	Move off the sim-specific unsignedXX types and to the standard uintXX_t
	types that C11 provides.

	sim: cris: migrate to standard uintXX_t types
	Move off the sim-specific unsignedXX types and to the standard uintXX_t
	types that C11 provides.

	sim: iq2000: migrate to standard uintXX_t types
	Move off the sim-specific unsignedXX types and to the standard uintXX_t
	types that C11 provides.

	sim: synacor: migrate to standard uintXX_t types
	Move off the sim-specific unsignedXX types and to the standard uintXX_t
	types that C11 provides.

	sim: msp430: migrate to standard uintXX_t types
	Move off the sim-specific unsignedXX types and to the standard uintXX_t
	types that C11 provides.

	sim: riscv: migrate to standard uintXX_t types
	Move off the sim-specific unsignedXX types and to the standard uintXX_t
	types that C11 provides.

	sim: bfin: migrate to standard uintXX_t types
	Move off the sim-specific unsignedXX types and to the standard uintXX_t
	types that C11 provides.

	sim: testsuite: migrate to standard uintXX_t types
	This old code setup its own uintXX types, but since we require C11
	now, we can assume the standard uintXX_t types exist and use them.

	sim: erc32: migrate to standard uintXX_t types
	This old port setup its own uintXX types, but since we require C11
	now, we can assume the standard uintXX_t types exist and use them.

	sim: mn10300: migrate to standard uintXX_t types
	This old port setup its own uintXX types, but since we require C11
	now, we can assume the standard uintXX_t types exist and use them.

	sim: v850: migrate to standard uintXX_t types
	This old port setup its own uintXX types, but since we require C11
	now, we can assume the standard uintXX_t types exist and use them.

2022-01-06  Mike Frysinger  <vapier@gentoo.org>

	sim: m68hc11: migrate to standard uintXX_t types
	This old port setup its own uintXX types, but since we require C11
	now, we can assume the standard uintXX_t types exist and use them.

	Also migrate off the sim-specific unsignedXX types.

2022-01-06  Mike Frysinger  <vapier@gentoo.org>

	sim: d10v: migrate to standard uintXX_t types
	This old port setup its own uintXX types, but since we require C11
	now, we can assume the standard uintXX_t types exist and use them.

	Also migrate off the sim-specific unsignedXX types.

2022-01-06  Mike Frysinger  <vapier@gentoo.org>

	sim: cr16: migrate to standard uintXX_t types
	This old port setup its own uintXX types, but since we require C11
	now, we can assume the standard uintXX_t types exist and use them.

	Also migrate off the sim-specific unsignedXX types.

2022-01-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-05  H.J. Lu  <hjl.tools@gmail.com>

	x86: Add elf_x86_allocate_local_got_info
	Add elf_x86_allocate_local_got_info to allocate x86 GOT info for local
	symbols.

		* elf32-i386.c (elf_i386_check_relocs): Call
		elf_x86_allocate_local_got_info.
		* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
		* elfxx-x86.h (elf_x86_allocate_local_got_info): New.

2022-01-05  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	opcodes: Make i386-dis.c thread-safe
	Improve thread safety in print_insn_i386_att, print_insn_i386_intel and
	print_insn_i386 by removing the use of static variables.

	Tested on x86_64-pc-linux-gnu.

	2022-01-04 Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

		* i386-dis.c: Make print_insn_i386_att, print_insn_i386_intel
		and print_insn_i386 thread-safe

2022-01-05  H.J. Lu  <hjl.tools@gmail.com>

	doc: Replace =frame-interp with =frames-interp
	The actual objdump and readelf option name is =frames-interp, not
	=frames-interp.

		PR binutils/28747
		* doc/debug.options.texi: Replace =frame-interp with
		=frames-interp.

2022-01-05  Tom Tromey  <tromey@adacore.com>

	Change riscv_return_value to use RETURN_VALUE_ABI_PRESERVES_ADDRESS
	Internally, AdaCore has a test that is equivalent to (really a direct
	translation of) gdb.base/gnu_vector.exp.  On 32-bit RISC-V, the
	"return" part of this test fails.

	Joel tracked this down to riscv_return_value returning
	RETURN_VALUE_ABI_RETURNS_ADDRESS.  Using
	RETURN_VALUE_ABI_PRESERVES_ADDRESS is more correct here, and fixes the
	bug.

	I tested this for both 32- and 64-bit RISC-V using the AdaCore
	internal test suite, and Andrew Burgess tested it using
	gnu_vector.exp.

2022-01-05  Tom Tromey  <tom@tromey.com>

	Filtered output cleanup in expression dumping
	Most of the expression-dumping code uses filtered output, but a few
	functions did not.  This patch cleans up these instance.

	Note that this won't cause any behavior change, because the only calls
	to dump_prefix_expression pass in gdb_stdlog.  However, in the long
	run it's easier to audit the code if the number of uses of _unfiltered
	is reduced.

2022-01-05  Tom Tromey  <tom@tromey.com>

	Use filtered output in terminal_info implementations
	This changes one terminal_info implementation, and
	default_terminal_info, to use filtered output.  Other implementations
	of this method already use filtered output.

	I can't compile go32-nat.c, so this is a 'best effort' patch.

2022-01-05  Tom Tromey  <tom@tromey.com>

	Use filtered output in gnu-nat.c commands
	gnu-nat.c has a number of ordinary commands that should use filtered
	output.  In a few cases, I changed the output to use gdb_stderr as
	well.  I can't compile this file, so this patch is split out as a
	"best effort".

	Use filtered output in *-tdep commands
	Various targets introduce their own commands, which then use
	unfiltered output.  It's better to use filtered output by default, so
	this patch fixes the instances I found.

	Use filtered output in btrace-related commands
	This changes btrace.c and record-btrace.c to use filtered output in
	the commands implemented there.

	Use filtered output in some dumping commands
	There are several commands that may optionally send their output to a
	file -- they take an optional filename argument and open a file.  This
	patch changes these commands to use filtered output.  The rationale
	here is that, when printing to gdb_stdout, filtering is appropriate --
	it is, and should be, the default for all commands.  And, when writing
	to a file, paging will not happen anyway (it only happens when the
	stream==gdb_stdout), so using the _filtered form will not change
	anything.

	Use filtered output in kill command
	This changes the kill command to use filtered output.  I split this
	one into its own patch because, out of an abundance of caution, I
	changed the function to call bfd_cache_close_all a bit earlier, in
	case pagination caused an exception.

2022-01-05  Tom Tromey  <tom@tromey.com>

	Use filtered output in ordinary commands
	Many otherwise ordinary commands choose to use unfiltered output
	rather than filtered.  I don't think there's any reason for this, so
	this changes many such commands to use filtered output instead.

	Note that complete_command is not touched due to a comment there
	explaining why unfiltered output is believed to be used.

2022-01-05  Tom Tromey  <tom@tromey.com>

	Use filtered output in language_info
	Change language_info to use filtered output.  This is ok because the
	sole caller uses filtered output elsewhere, and because this function
	calls show_language_command, which also uses filtered output.

	Use filtered output in files_info implementations
	This changes the implementations of the target files_info method to
	use filtered output.  This makes sense because the sole caller of this
	method is an ordinary command (info_program_command).  This patch
	changes this command to use filtered output as well.

	Use filtered output in target-descriptions.c
	target-descriptions.c uses unfiltered output.  However, if you happen
	to invoke this command interactively, it's probably better for it to
	use filtering.  For non-interactive use, this doesn't matter.

	Use filtered output for gdbarch dump
	This changes gdbarch dumping to use filtered output.  This seems a bit
	better to me, both on the principle that this is an ordinary command,
	and because the output can be voluminous, so it may be nice to stop in
	the middle.

2022-01-05  Tom Tromey  <tom@tromey.com>

	Implement putstr and putstrn in ui_file
	In my tour of the ui_file subsystem, I found that fputstr and fputstrn
	can be simplified.  The _filtered forms are never used (and IMO
	unlikely to ever be used) and so can be removed.  And, the interface
	can be simplified by removing a callback function and moving the
	implementation directly to ui_file.

	A new self-test is included.  Previously, I think nothing was testing
	this code.

	Regression tested on x86-64 Fedora 34.

2022-01-05  Tom Tromey  <tromey@adacore.com>

	Change how versioned symbols are recorded
	A change to BFD caused a gdb regression when using the Ada "catch
	exception" feature.  The bug is visible when a shared library throws
	an exception that is caught in the main executable.

	This was discussed here:

	https://sourceware.org/pipermail/binutils/2021-July/117538.html

	This patch implements Alan's proposed fix, namely to use VERSYM_HIDDEN
	rather than the name when deciding to install a version-less symbol.

	The internal test case is identical to the catch_ex_std.exp that is
	in-tree, so I haven't added a new test.  I could not make that one
	fail on x86-64 Linux, though.  It's possible that maybe I'd have to
	update the system linker first, but I didn't want to try that.

	Regression tested on x86-64 Fedora 32.

2022-01-05  Hannes Domani  <ssbssa@yahoo.de>

	Fix inferior_thread attribute in new_thread event
	Commit 72ee03ff58 fixed a use-after-move bug in add_thread_object, but
	it changed the inferior_thread attribute to contain the inferior instead
	of the actual thread.
	This now uses the thread_obj in its new location instead.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28429

2022-01-05  Tom Tromey  <tom@tromey.com>

	Simplify execute_control_commands_to_string
	execute_control_commands_to_string can be rewritten in terms of
	execute_fn_to_string, which consolidates some knowledge about which
	streams to redirect.

	Regression tested on x86-64 Fedora 34.

2022-01-05  Tom Tromey  <tromey@adacore.com>

	Do not print anything when self-backtrace unavailable
	Right now, gdb's self-backtrace feature will still print something
	when a backtrace is unavailable:

	   sig_write (_("----- Backtrace -----\n"));
	[...]
	     sig_write (_("Backtrace unavailable\n"));
	    sig_write ("---------------------\n");

	However, if GDB_PRINT_INTERNAL_BACKTRACE is undefined, it seems better
	to me to print nothing at all.

	This patch implements this change.  It also makes a couple of other
	small changes in this same module: it adds a header guard to
	bt-utils.h, and it protects the definitions of
	gdb_internal_backtrace_1 with a check of GDB_PRINT_INTERNAL_BACKTRACE.

2022-01-05  Tom Tromey  <tromey@adacore.com>

	Fix pager regression
	The patch to fix paging with redirection caused a regression in the
	internal AdaCore test suite.  The problem occurs when running an MI
	command from the CLI using interpreter-exec, when paging is enabled.
	This scenario isn't covered by the current test suite, so this patch
	includes a new test.

	The problem is that, in this situation, MI does:

	  fputs_unfiltered (strcmp (context->command, "target-select") == 0
			     ? "^connected" : "^done", mi->raw_stdout);

	Here raw_stdout is a stdio_file wrapping stdout, so the pager thinks
	that it is ok to buffer the output.  However, in this setup, it isn't
	ok, and flushing the wrap buffer doesn't really work properly.  Also,
	MI next does:

	  mi_out_put (uiout, mi->raw_stdout);

	... but this uses ui_file::write, which also doesn't flush the wrap
	buffer.

	I think all this will be fixed by the pager rewrite series I'm working
	on.  However, in the meantime, adding the old gdb_stdout check back to
	the pager fixes this problem.

	Regression tested on x86-64 Fedora 34.

2022-01-05  H.J. Lu  <hjl.tools@gmail.com>

	elf: Set p_align to the minimum page size if possible
	Currently, on 32-bit and 64-bit ARM, it seems that ld generates p_align
	values of 0x10000 even if no section alignment is greater than 0x1000.
	The issue is more general and probably affects other targets with multiple
	page sizes.

	While file layout absolutely must take 64K page size into account, that
	does not have to be reflected in the p_align value.  If running on a 64K
	kernel, the file will be loaded at a 64K page boundary by necessity. On
	a 4K kernel, 64K alignment is not needed.

	The glibc loader has been fixed to honor p_align:

	https://sourceware.org/bugzilla/show_bug.cgi?id=28676

	similar to kernel:

	commit ce81bb256a224259ab686742a6284930cbe4f1fa
	Author: Chris Kennelly <ckennelly@google.com>
	Date:   Thu Oct 15 20:12:32 2020 -0700

	    fs/binfmt_elf: use PT_LOAD p_align values for suitable start address

	This means that on 4K kernels, we will start to do extra work for 64K
	p_align, but this pointless for pretty much all binaries (whose section
	alignment rarely exceeds 16).

	The minimum page size is used, instead of the maximum section alignment
	due to this glibc bug:

	https://sourceware.org/bugzilla/show_bug.cgi?id=28688

	It has been fixed in glibc 2.35.  But linker output must work on existing
	glibc binaries.

	1. Set p_align to the minimum page size while laying out segments aligning
	to the maximum page size or section alignment.  The run-time loader can
	align segments to the minimum page size or above, depending on system page
	size.
	2. If -z max-page-size=NNN is used, p_align will be set to the maximum
	page size or the largest section alignment.
	3. If a section requires alignment higher than the minimum page size,
	don't set p_align to the minimum page size.
	4. If a section requires alignment higher than the maximum page size,
	set p_align to the section alignment.
	5. For objcopy, when the minimum page size != the maximum page size,
	p_align may be set to the minimum page size while segments are aligned
	to the maximum page size.  In this case, the input p_align will be
	ignored and the maximum page size will be used to align the ouput
	segments.
	6. Update linker to disallow the common page size > the maximum page size.
	7. Update linker to avoid the common page size > the maximum page size.
	8. Adjust pru_irq_map-1.d to expect p_align == sh_addralign:

	Section Headers:
	  [Nr] Name   Type            Addr     Off    Size   ES Flg Lk Inf Al
	  [ 0]        NULL            00000000 000000 000000 00      0   0  0
	  [ 1] .text  PROGBITS        20000000 00007c 000004 00  AX  0   0  4
	...
	Program Headers:
	  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
	  LOAD           0x000074 0x00000000 0x00000000 0x00008 0x00008 RW  0x1
	  LOAD           0x00007c 0x20000000 0x20000000 0x00004 0x00004 R E 0x4

	vs.

	Section Headers:
	  [Nr] Name   Type            Addr     Off    Size   ES Flg Lk Inf Al
	  [ 0]        NULL            00000000 000000 000000 00      0   0  0
	  [ 1] .text  PROGBITS        20000000 00007c 000004 00  AX  0   0  4
	...
	Program Headers:
	  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
	  LOAD           0x000074 0x00000000 0x00000000 0x00008 0x00008 RW  0x1
	  LOAD           0x00007c 0x20000000 0x20000000 0x00004 0x00004 R E 0x1

	To enable this linker optimization, the backend should define ELF_P_ALIGN
	to ELF_MINPAGESIZE.

	bfd/

		PR ld/28689
		PR ld/28695
		* elf-bfd.h (elf_backend_data): Add p_align.
		* elf.c (assign_file_positions_for_load_sections): Set p_align
		to the default p_align value while laying out segments aligning
		to maximum page size or section alignment.
		(elf_is_p_align_valid): New function.
		(copy_elf_program_header): Call elf_is_p_align_valid to determine
		if p_align is valid.
		* elfxx-target.h (ELF_P_ALIGN): New.  Default to 0.
		(elfNN_bed): Add ELF_P_ALIGN.
		* elfxx-x86.h (ELF_P_ALIGN): New.  Set to ELF_MINPAGESIZE.

	include/

		PR ld/28689
		PR ld/28695
		* bfdlink.h (bfd_link_info): Add maxpagesize_is_set.

	ld/

		PR ld/28689
		PR ld/28695
		* emultempl/elf.em (gld${EMULATION_NAME}_handle_option): Set
		link_info.maxpagesize_is_set for -z max-page-size=NNN.
		* ldelf.c (ldelf_after_parse): Disallow link_info.commonpagesize
		> link_info.maxpagesize.
		* testsuite/ld-elf/elf.exp: Pass -z max-page-size=0x4000 to
		linker to build mbind2a and mbind2b.
		* testsuite/ld-elf/header.d: Add -z common-page-size=0x100.
		* testsuite/ld-elf/linux-x86.exp: Add PR ld/28689 tests.
		* testsuite/ld-elf/p_align-1.c: New file.
		* testsuite/ld-elf/page-size-1.d: New test.
		* testsuite/ld-elf/pr26936.d: Add -z common-page-size=0x1000.
		* testsuite/ld-elf/seg.d: Likewise.
		* testsuite/ld-scripts/rgn-at5.d: Likewise.
		* testsuite/ld-pru/pru_irq_map-1.d: Append 1 to name.  Adjust
		expected PT_LOAD segment alignment.
		* testsuite/ld-pru/pru_irq_map-2.d: Append 2 to name.
		* testsuite/ld-scripts/pr23571.d: Add -z max-page-size=0x1000.

2022-01-05  Alan Modra  <amodra@gmail.com>

	Adjust quoted-sym-names test
	Some targets restrict symbol addresses in .text to instruction
	boundaries.

		* testsuite/gas/all/quoted-sym-names.s: Define syms in .data.
		* testsuite/gas/all/quoted-sym-names.d: Adjust to suit.

2022-01-05  Alan Modra  <amodra@gmail.com>

	infinite recursion detected in gold testcase
	gold/testsuite/icf_test.cc:32:5: error: infinite recursion detected [-Werror=infinite-recursion]
	   32 | int kept_func()
	      |     ^~~~~~~~~

		* testsuite/icf_test.cc: Avoid infinite recursion error.

2022-01-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-04  H.J. Lu  <hjl.tools@gmail.com>

	ld/x86: Update -z report-relative-reloc
	Use 0x%v, instead of bfd_sprintf_vma, to report relative relocations.
	Change linker relative relocations report from

	tmpdir/dump: R_X86_64_IRELATIVE (offset: 0x0000000000002000, info: 0x0000000000000025, addend: 0x0000000000001007) against 'ifunc' for section '.data.rel.ro.local' in tmpdir/report-reloc-1.o

	to

	tmpdir/dump: R_X86_64_IRELATIVE (offset: 0x2000, info: 0x25, addend: 0x1007) against 'ifunc' for section '.data.rel.ro.local' in tmpdir/report-reloc-1.o

	bfd/

		* elfxx-x86.c (_bfd_x86_elf_link_report_relative_reloc): Use
		0x%v instead of bfd_sprintf_vma.

	ld/

		* testsuite/ld-i386/report-reloc-1.l: Updated.
		* testsuite/ld-x86-64/report-reloc-1.l: Likewise.

2022-01-04  H.J. Lu  <hjl.tools@gmail.com>

	ld: Improve thin archive member error message
	Improve thin archive member error message with:

	ld: libbar.a(bar.o): error opening thin archive member: No such file or directory

	instead of

	ld: libbar.a: error adding symbols: No such file or directory

		PR ld/28722
		* archive.c (_bfd_get_elt_at_filepos): Add a pointer argument
		for struct bfd_link_info.  Call linker callback when failing to
		open thin archive member.
		(_bfd_generic_get_elt_at_index): Pass NULL to
		_bfd_get_elt_at_filepos.
		(bfd_generic_openr_next_archived_file): Likewise.
		* coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Add a pointer
		argument for struct bfd_link_info and pass it to
		_bfd_get_elt_at_filepos.
		(alpha_ecoff_openr_next_archived_file): Pass NULL to
		_bfd_get_elt_at_filepos.
		(alpha_ecoff_get_elt_at_index): Likewise.
		* coff-rs6000.c (_bfd_xcoff_openr_next_archived_file): Likewise.
		* ecoff.c (ecoff_link_add_archive_symbols): Pass info to
		backend->get_elt_at_filepos.
		* elflink.c (elf_link_is_defined_archive_symbol): info to
		_bfd_get_elt_at_filepos.
		* libbfd-in.h (_bfd_get_elt_at_filepos): Add a pointer argument
		for struct bfd_link_info.
		* libbfd.h: Regenerate.
		* libecoff.h (ecoff_backend_data): Add a pointer argument for
		struct bfd_link_info to get_elt_at_filepos.
		* linker.c (_bfd_generic_link_add_archive_symbols): Pass info to
		_bfd_get_elt_at_filepos.

2022-01-04  Lancelot SIX  <lancelot.six@amd.com>

	gdb/testsuite: fix inferior-clone.exp for native-extended-gdbserver
	003aae076207dbf32f98ba846158fc32669ef85f (gdb: Copy inferior properties
	in clone-inferior) introduced a testcase that fails when testing with
	the native-extended-gdbserver board:

	    Running ../gdb/testsuite/gdb.base/inferior-clone.exp ...
	    FAIL: gdb.base/inferior-clone.exp: inferior 2: clone-inferior
	    FAIL: gdb.base/inferior-clone.exp: inferior 3: clone-inferior

	The error is as follows:

	    clone-inferior
	    [New inferior 2]
	    Added inferior 2 on connection 1 (extended-remote localhost:2346)
	    (gdb) FAIL: gdb.base/inferior-clone.exp: inferior 2: clone-inferior

	This fails because the testcase only expect the 'Added inferior 2' part
	of the message.  The 'on connection 1 [...]' part is unexpected.

	Fix by adjusting the testcase to a account for the possible trailing
	part of the message.

	Tested on x86_64-linux with native-extende-gdbserver and unix boards.

	Change-Id: Ie3d6f04c9ffe9cab1fbda8ddf4935ee09b858c7a

2022-01-04  Nick Clifton  <nickc@redhat.com>

	Add ATTRIBUTE_UNUSED to load_build_id_debug_file()'s main_filename parameter.

2022-01-04  Andrew Burgess  <aburgess@redhat.com>

	gdb: don't pass nullptr to sigwait
	I tried building GDB on GNU/Hurd, and ran into this warning:

	  gdbsupport/scoped_ignore_signal.h:78:16: error: null argument where non-null required (argument 2) [-Werror=nonnull]

	This is because in this commit:

	  commit 99624310dd82542c389c89c2e55d8cae36bb74e1
	  Date:   Sun Jun 27 15:13:14 2021 -0400

	      gdb: fall back on sigpending + sigwait if sigtimedwait is not available

	A call to sigwait was introduced that passes nullptr as the second
	argument, this call is only reached if sigtimedwait is not supported.

	The original patch was written for macOS, I assume on that target
	passing nullptr as the second argument is fine.

	On my GNU/Linux box, the man-page for sigwait doesn't mention that
	nullptr is allowed for the second argument, so my assumption would be
	that nullptr is not OK, and, if I change the '#ifdef
	HAVE_SIGTIMEDWAIT' introduced by the above patch to '#if 0', and
	rebuild on GNU/Linux, I see the same warning that I see on GNU/Hurd.

	I propose that we stop passing nullptr as the second argument to
	sigwait, and instead pass a valid int pointer.  The value returned in
	the int can then be used in an assert.

	For testing, I (locally) made the change to the #ifdef I mentioned
	above, compiled GDB, and ran the usual tests, this meant I was using
	sigwait instead on sigtimedwait on GNU/Linux, I saw no regressions.

2022-01-04  Nick Clifton  <nickc@redhat.com>

	Remove a spurious debugging message.
		PR 28716
		* dwarf.c (load_build_id_debug_file): Remove spurious printf.

2022-01-04  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Fix build breaker in gdb/cli/cli-logging.c
	Fix build breaker in gdb/cli/cli-logging.c:
	...
	gdb/cli/cli-logging.c: In function \
	  ‘void show_logging_enabled(ui_file*, int, cmd_list_element*, const char*)’:
	gdb/gdbsupport/gdb_locale.h:28:28: error: cannot convert ‘char*’ to ‘ui_file*’
	   28 | # define _(String) gettext (String)
	      |                    ~~~~~~~~^~~~~~~~
	      |                            |
	      |                            char*
	gdb/cli/cli-logging.c:202:25: note: in expansion of macro ‘_’
	  202 |     fprintf_unfiltered (_("on: Logging is enabled.\n"));
	      |                         ^
	...

	Build and tested on x86_64-linux.

	Fixes: 45aec4e5ed8 ("[gdb/cli] Improve show logging output")

2022-01-04  Jan Beulich  <jbeulich@suse.com>

	x86/Intel: correct VFPCLASSP{S,D} handling when displacement is present
	fits_in_disp8() can be called before ambiguous operands get resolved
	or rejected (in process_suffix()), which requires that i.memshift be
	non-negative to avoid an internal error. This case wasn't covered by
	6c0946d0d28d ("x86: correct VFPCLASSP{S,D} operand size handling").

2022-01-04  Jan Beulich  <jbeulich@suse.com>

	gas: rework handling of backslashes in quoted symbol names
	Strange effects can result from the present handling, e.g.:

	.if 1
	"backslash\\":
	.endif

	yields first (correctly) "missing closing `"'" but then also "invalid
	character '\' in mnemonic" and further "end of file inside conditional".
	Symbols names ending in \ are in principle not expressable with that
	scheme.

	Instead of recording whether a backslash was seen, inspect the
	subsequent character right away. Only accept \\ (meaning a single
	backslash in the resulting symbol name) and \" (meaning an embedded
	double quote in the resulting symbol name) for now, warning about any
	other combination.

	While perhaps not necessary immediately, also permit concatenated
	strings to form a symbol name. This may become useful if going forward
	we would want to support \<octal> or \x<hex> sequences, where closing
	and re-opening quotes can be useful to delimit such sequences.

	The ELF "Multibyte symbol names" test gets switched away from using
	.set, as that would now also mean excluding nios2 and pru. By using
	.equiv instead, even the existing #notarget can be dropped. (For h8300
	the .section directive additionally needs attributes specified, to avoid
	a target specific warning.)

2022-01-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-03  Tom de Vries  <tdevries@suse.de>

	[gdb/cli] Improve show logging output
	Before commit 3b6acaee895 "Update more calls to add_prefix_cmd" we had the
	following output for "show logging":
	...
	$ gdb -q -batch -ex "set trace-commands on" \
	    -ex "set logging off" \
	    -ex "show logging" \
	    -ex "set logging on" \
	    -ex "show logging"
	+set logging off
	+show logging
	Future logs will be written to gdb.txt.
	Logs will be appended to the log file.
	Output will be logged and displayed.
	Debug output will be logged and displayed.
	+set logging on
	+show logging
	Currently logging to "gdb.txt".
	Logs will be appended to the log file.
	Output will be logged and displayed.
	Debug output will be logged and displayed.
	...

	After that commit we have instead:
	...
	+set logging off
	+show logging
	debugredirect:  The logging output mode is off.
	file:  The current logfile is "gdb.txt".
	overwrite:  Whether logging overwrites or appends to the log file is off.
	redirect:  The logging output mode is off.
	+set logging on
	+show logging
	debugredirect:  The logging output mode is off.
	file:  The current logfile is "gdb.txt".
	overwrite:  Whether logging overwrites or appends to the log file is off.
	redirect:  The logging output mode is off.
	...
	which gives less clear output for some subcommands.

	OTOH, it's explicit about whether boolean values are on or off.

	The new text seems to have been chosen to match the set/show help texts:
	...
	(gdb) help show logging
	Show logging options.

	List of show logging subcommands:

	show logging debugredirect -- Show the logging debug output mode.
	show logging file -- Show the current logfile.
	show logging overwrite -- \
	  Show whether logging overwrites or appends to the log file.
	show logging redirect -- Show the logging output mode.
	...

	Make the show logging messages more clear, while still keep the boolean
	values explicit, such that we have:
	...
	$ ./gdb.sh -q -batch -ex "show logging"
	logging debugredirect:  off: \
	  Debug output will go to both the screen and the log file.
	logging enabled:  off: Logging is disabled.
	logging file:  The current logfile is "gdb.txt".
	logging overwrite:  off: Logging appends to the log file.
	logging redirect:  off: Output will go to both the screen and the log file.
	...

	Tested on x86_64-linux.

2022-01-03  Tom Tromey  <tromey@adacore.com>

	Fix use of 'printf' in gdbtypes.c
	An earlier patch of mine, commit 64b7cc50 ("Remove
	gdb_print_host_address") inadvertently changed a function in
	gdbtypes.c to use printf rather than printf_filtered.  This patch
	fixes the problem.

	Fix regression in page-logging.exp
	Simon and Tom pointed out that page-logging.exp failed on their
	machines.  Tom tracked this down to the "width" setting.  Since
	there's no need in the test to change the width, it seems simplest to
	remove the setting.  I confirmed that the test still fails if the fix
	is backed out, ensuring that the test is still testing what it
	purports to.

	Small indentation fix in eval.c
	I noticed that the AdaCore tree had a small divergence in eval.c -- it
	had a fix for an indentation problem in binop_promote.  I'm checking
	in this small fix as obvious.

2022-01-03  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle for loop initial decl with gcc 4.8.5
	When running test-case gdb.threads/schedlock-thread-exit.exp on a system with
	system compiler gcc 4.8.5, I run into:
	...
	src/gdb/testsuite/gdb.threads/schedlock-thread-exit.c:33:3: error: \
	  'for' loop initial declarations are only allowed in C99 mode
	...

	Fix this by:
	- using -std=c99, or
	- using -std=gnu99, in case that's required, or
	- in the case of the jit test-cases, rewriting the for loops.

	Tested on x86_64-linux, both with gcc 4.8.5 and gcc 7.5.0.

2022-01-03  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-02  Tom Tromey  <tom@tromey.com>

	Update copying.awk for _initialize declaration patch
	Commit 6c265988 ("gdb: add back declarations for _initialize
	functions") modified copying.c, but not copying.awk.  This patch
	updates copying.awk to backport the appropriate fix.  This way, if
	copying.awk is run again, it will create the correct output.

	I'm checking this in as obvious.

2022-01-02  Tom Tromey  <tom@tromey.com>

	Use filtered output in print_i387_ext
	print_i387_ext mostly uses filtered output, but one call in the middle
	of the function uses the _unfiltered form.  This patch fixes this
	call.  I'm checking this in as obvious.

2022-01-02  Alan Modra  <amodra@gmail.com>

	Update year range in copyright notice of binutils files
	The result of running etc/update-copyright.py --this-year, fixing all
	the files whose mode is changed by the script, plus a build with
	--enable-maintainer-mode --enable-cgen-maint=yes, then checking
	out */po/*.pot which we don't update frequently.

	The copy of cgen was with commit d1dd5fcc38ead reverted as that commit
	breaks building of bfp opcodes files.

2022-01-02  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2022-01-01  Mike Frysinger  <vapier@gentoo.org>

	gdb: copyright: fix a few comment typos

	sim: ppc: drop natural types
	These are almost entirely unused.  For the very few places using them,
	replace with explicit signed types.  This matches what was done in the
	common sim code.

	sim: mips: clean up bad style/whitespace
	This doesn't fix all the problems, but grabs a bunch of the more
	obvious ones.

	sim: tweak copyright lines for gnulib update-copyright
	The regex it uses does not like so many leading spaces which causes
	it to think the files lack copyright.  Trim them down so the script
	can find & update them accordingly.

	gdb: update sim mips testsuite copyright exemption
	The sim testsuite was reorganized last year, so update the path.

2022-01-01  Mike Frysinger  <vapier@gentoo.org>

	unify 64-bit bfd checks
	Move the 64-bit bfd logic out of bfd/configure.ac and into bfd64.m4
	under config so it can be shared between all the other subdirs.

	This replaces want64 with enable_64_bit_bfd which was already being
	declared, but not used directly.

2022-01-01  Joel Brobecker  <brobecker@adacore.com>

	Update Copyright year in gdb/testsuite/gdb.arch/powerpc-power10.exp
	This commit updates the copyright year range in the script
	gdb/testsuite/gdb.arch/powerpc-power10.exp. The update was
	performed by running gdb/copyright.py again, to make sure
	that the copyright year range will be automatically updated
	in years forward.

2022-01-01  Joel Brobecker  <brobecker@adacore.com>

	Fix copyright header in gdb/testsuite/gdb.arch/powerpc-power10.exp
	The copyright year and holder line is slight malformed, missing
	a space after a comma, and this is sufficient for gdb's
	copyright.py script to miss this file during its automated
	copyright year update.

	This commit fixes this.

2022-01-01  Joel Brobecker  <brobecker@adacore.com>

	gdb/copyright.py: Add update-netbsd.sh to MULTIPLE_COPYRIGHT_HEADERS
	Add gdb/syscalls/update-netbsd.sh to the reminder printed
	at the end of the execution listing all the files where
	a manual update of the copyright header is needed. This
	scripts contains some inline code which includes a copyright
	header.

	Manual copyright year update of various GDB files
	This commit updates the copyright year in some files where
	we have a copyright year outside of the copyright year,
	and thus are not included in gdb's copyright.py script.

2022-01-01  Joel Brobecker  <brobecker@adacore.com>

	Automatic Copyright Year update after running gdb/copyright.py
	This commit brings all the changes made by running gdb/copyright.py
	as per GDB's Start of New Year Procedure.

	For the avoidance of doubt, all changes in this commits were
	performed by the script.

2022-01-01  Joel Brobecker  <brobecker@adacore.com>

	Update Copyright Year in gdb, gdbserver and gdbreplay version output
	This commit changes the copyright year printed by gdb, gdbserver
	and gdbreplay when printing the tool's version.

2022-01-01  Alan Modra  <amodra@gmail.com>

	ubsan: next_char_of_string signed integer overflow
	Squash another totally useless fuzz report that I should have ignored.

		* read.c (next_char_of_string): Avoid integer overflow.

2022-01-01  Alan Modra  <amodra@gmail.com>

	ubsan: bfd_mach_o_build_commands shift exponent 64 is too large
		* mach-o.c (bfd_mach_o_read_section_32): Limit alignment further.
		(bfd_mach_o_read_section_64): Likewise.

2022-01-01  Alan Modra  <amodra@gmail.com>

	ubsan: signed integer multiply overflow
	9223371018427387904 * 2 cannot be represented in type 'long', yes, but
	we don't care.

		* expr.c (expr): Avoid signed overflow.

2022-01-01  Alan Modra  <amodra@gmail.com>

	asan: Null-dereference in _bfd_xcoff_copy_private_bfd_data
	sec->output_section will be NULL when objcopy removes sections.

		* coff-rs6000.c (_bfd_xcoff_copy_private_bfd_data): Protect against
		objcopy removing sections.

2022-01-01  Alan Modra  <amodra@gmail.com>

	ubsan: integer overflow in section filepos subtraction
		* elf.c (assign_file_positions_for_non_load_sections): Avoid
		signed integer overflow.

2022-01-01  Alan Modra  <amodra@gmail.com>

	Remove unnecessary ELF_MINPAGESIZE defines
	The idea of this patch is to make it easy to see which targets (just
	sparc) have ELF_MINPAGESIZE != ELF_COMMONPAGESIZE.

		* elf32-arm.c (ELF_MINPAGESIZE): Don't define.
		* elf32-metag.c: Likewise.
		* elfnn-aarch64.c: Likewise.
		* elf64-x86-64.c: Likewise.  Also don't redefine a bunch of other
		macros for l1om elf64-target.h use that are unchanged from default.

2022-01-01  H.J. Lu  <hjl.tools@gmail.com>

	ld-x86-64: Pass options to linker with "-Wl,"
		* testsuite/ld-x86-64/x86-64.exp: Pass options to linker with
		"-Wl,".

2022-01-01  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-31  Tom Tromey  <tom@tromey.com>

	Do not call reinitialize_more_filter from avr_io_reg_read_command
	avr_io_reg_read_command is an ordinary gdb command, and so should not
	be calling reinitialize_more_filter.  This patch removes it.  I'm
	checking this in as obvious.  Tested by rebuilding.

2021-12-31  H.J. Lu  <hjl.tools@gmail.com>

	x86: Define check_relocs_failed in elfxx-x86.h
		* elf32-i386.c (check_relocs_failed): Moved to ...
		* elfxx-x86.h (check_relocs_failed): Here.  New.
		* elf64-x86-64.c (check_relocs_failed): Removed.

	Define X86_PCREL_TYPE_P/X86_SIZE_TYPE_P in elfxx-x86.h
		* elf32-i386.c: Don't include "elf/i386.h".
		(X86_PCREL_TYPE_P): Removed.
		(X86_SIZE_TYPE_P): Likewise.
		(elf_i386_check_relocs): Pass false to NEED_DYNAMIC_RELOCATION_P.
		(elf_i386_relocate_section): Pass false to
		GENERATE_DYNAMIC_RELOCATION_P and COPY_INPUT_RELOC_P.
		* elf64-x86-64.c: Don't include "elf/x86-64.h".
		(X86_PCREL_TYPE_P): Removed.
		(X86_SIZE_TYPE_P): Likewise.
		(elf_x86_64_check_relocs): Pass true to NEED_DYNAMIC_RELOCATION_P
		and X86_PCREL_TYPE_P.
		(elf_x86_64_relocate_section): Pass true to X86_PCREL_TYPE_P,
		X86_SIZE_TYPE_P, GENERATE_DYNAMIC_RELOCATION_P and
		COPY_INPUT_RELOC_P.
		* elfxx-x86.c: Don't include "elf/i386.h" nor "elf/x86-64.h".
		* elfxx-x86.h (X86_64_PCREL_TYPE_P): New.
		(I386_PCREL_TYPE_P): Likewise.
		(X86_PCREL_TYPE_P): Likewise.
		(X86_64_SIZE_TYPE_P): Likewise.
		(I386_SIZE_TYPE_P): Likewise.
		(X86_SIZE_TYPE_P): Likewise.
		(NEED_DYNAMIC_RELOCATION_P): Add IS_X86_64 and pass it to
		X86_PCREL_TYPE_P.
		(COPY_INPUT_RELOC_P): Likewise.
		(GENERATE_DYNAMIC_RELOCATION_P): Add IS_X86_64, pass it to
		X86_PCREL_TYPE_P and X86_SIZE_TYPE_P.

2021-12-31  Tamar Christina  <tamar.christina@arm.com>

	ld: fix coff PE SEH
	COFF_WITH_pex64 and COFF_WITH_peAArch64 can't be true at the same time.
	That means that two conditionals that control the sorting of the .pdata section
	became a falsum.

	The testsuite doesn't catch this because the linker does the sorting and to link
	you require library support from the unwinder so we can't test from binutils in
	isolation.

	bfd/ChangeLog:

	2021-12-31  Tamar Christina  <tamar.christina@arm.com>

		PR ld/28682
		* peXXigen.c: Fix conditional.

2021-12-31  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-30  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-29  Tom Tromey  <tom@tromey.com>

	Use filtered output in show callbacks
	"show" command callbacks, like most ordinary gdb commands, should use
	filtered output.  I found a few that did not, so this patch changes
	them to use the filtered form.

2021-12-29  Tom Tromey  <tom@tromey.com>

	Consistently Use ui_file parameter to show callbacks
	I happened to notice that one "show" callback was printing to
	gdb_stdout rather than to the passed-in ui_file parameter.  I went
	through all such callbacks and fixed them to consistently use the
	ui_file.

	Regression tested on x86-64 Fedora 34.

2021-12-29  Tom Tromey  <tom@tromey.com>

	Use gdb_stdlog for MI debugging
	When MI debugging is enabled, the logging output should be sent to
	gdb_stdlog.  This is part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Use debug_prefixed_printf_cond_nofunc in index-cache
	This changes index-cache.c to use debug_prefixed_printf_cond_nofunc.
	As a side effect, logs are now written to gdb_stdlog.  This is part of
	PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Send minsym logging to gdb_stdlog
	This changes minsyms.c to send logging output to gdb_stdlog.  This is
	part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Use gdb_stdlog for separate debug file logging
	This changes the separate debug file logging code (spread across two
	files) to use gdb_stdlog for its output.  This is part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Use debug_prefixed_printf_cond_nofunc in machoread
	This changes machoread.c to use debug_prefixed_printf_cond_nofunc.  As
	a side effect, the logs are now written to gdb_stdlog.  This is part
	of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Use debug_prefixed_printf_cond_nofunc in microblaze.c
	This changes microblaze.c to use the standard logging macro.  As a
	side effect, logs will now go to gdb_stdlog.  This is part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Send debugging data to gdb_stdlog in mips-linux-nat.c
	This changes mips-linux-nat.c to send some logging output to
	gdb_stdlog, rather than stdout.  This is part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Send arch-utils error messages to gdb_stderr
	This changes arch-utils.c to send some error messages to gdb_stderr.
	This is part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Use correct stream for process record output
	The process record code often emits unfiltered output.  In some cases,
	this output ought to go to gdb_stderr (but see below).  In other
	cases, the output is guarded by a logging variable and so ought to go
	to gdb_stdlog.  This patch makes these changes.

	Note that in many cases, the output to stderr is followed by a
	"return -1", which is how process record indicates an error.  It seems
	to me that calling error here would be preferable, because, in many
	cases, that's all the caller does when it sees a -1.  However, I
	haven't made this change.

	This is part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Send jit.c errors to gdb_stderr
	jit.c writes some error messages to gdb_stdout, but using gdb_stderr
	is better.  This is part of PR gdb/7233.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

2021-12-29  Tom Tromey  <tom@tromey.com>

	Fix logging redirection bug with pager
	I noticed yesterday that if gdb output is redirected to a file, the
	pager will still be active.  This is irritating, because the output
	isn't actually visible -- just the pager prompt.  Looking in bugzilla,
	I found that this had been filed 17 years ago, as PR cli/8798.

	This patch fixes the bug.  It changes the pagination code to query the
	particular ui-file to see if paging is allowable.  The ui-file
	implementations are changed so that only the stdout implementation and
	a tee (where one sub-file is stdout) can page.

	Regression tested on x86-64 Fedora 34.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=8798

2021-12-29  Tom Tromey  <tom@tromey.com>

	Remove unusual use of core_addr_eq and core_addr_hash
	gdbtypes.h uses core_addr_eq and core_addr_hash in a weird way: taking
	the address of a member and then passing this (as a void*) to these
	functions.

	It seems better to simply inline the ordinary code here.  CORE_ADDR is
	a scalar so it can be directly compared, and the identity hash
	function seems safe to assume as well.

	After this, core_addr_eq and core_addr_hash are unused, so this patch
	removes them.

2021-12-29  Lancelot SIX  <lancelot.six@amd.com>

	gdb: Copy inferior properties in clone-inferior
	This commit ensures that the following settings are cloned from one
	inferior to the new one when processing the clone-inferior command:
	  - inferior-tty
	  - environment variables
	  - cwd
	  - args

	Some of those parameters can be passed as command line arguments to GDB
	(-args and -tty), so one could expect the clone-inferior to respect
	those flags.  The following debugging session illustrates that:

	    gdb -nx -quiet -batch \
	         -ex "show args" \
	         -ex "show inferior-tty" \
	         -ex "clone-inferior" \
	         -ex "inferior 2" \
	         -ex "show args" \
	         -ex "show inferior-tty" \
	         -tty=/some/tty \
	         -args echo foo bar
	    Argument list to give program being debugged when it is started is "foo bar".
	    Terminal for future runs of program being debugged is "/some/tty".
	    [New inferior 2]
	    Added inferior 2.
	    [Switching to inferior 2 [<null>] (/bin/echo)]
	    Argument list to give program being debugged when it is started is "".
	    Terminal for future runs of program being debugged is "".

	The other properties this commit copies on clone (i.e. CWD and the
	environment variables) are included since they are related (in the sense
	that they influence the runtime behavior of the program) even if they
	cannot be directly set using command line switches.

	There is a chance that this patch changes existing user workflow.  I
	think that this change is mostly harmless.  If users want to start a new
	inferior based on an existing one, they probably already propagate those
	settings to the new inferior in some way.

	Tested on x86_64-linux.

	Change-Id: I3b1f28b662f246228b37bb24c2ea1481567b363d

2021-12-29  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-28  H.J. Lu  <hjl.tools@gmail.com>

	elf32-i386: Fix a typo in GOT comments
	Entry offsets in the global offset table are multiples of 4, not 8.

		* elf32-i386.c (elf_i386_relocate_section): Fix a typo in GOT
		comments.

2021-12-28  H.J. Lu  <hjl.tools@gmail.com>

	bfd: Don't check non-thin archive member file size
	There is no need to check member file size for thin archive member.

		* bfdio.c (bfd_bread): Don't check non-thin archive member file
		size.

2021-12-28  Alan Modra  <amodra@gmail.com>

	gas reloc sorting
	In some cases, eg. riscv_pre_output_hook, gas generates out-of-order
	relocations.  Various places in the linker assume relocs are sorted
	by increasing r_offset, which is normally the case.  Provide
	GAS_SORT_RELOCS to handle unsorted relocs.

	bfd/
		PR 28709
		* elf32-nds32.c (nds32_insertion_sort): Make static.
		* elf32-nds32.h (nds32_insertion_sort): Delete declaration.
	gas/
		PR 28709
		* write.c (write_relocs): Implement reloc sorting by r_offset
		when GAS_SORT_RELOCS.
		* config/tc-nds32.c (compar_relent, nds32_set_section_relocs): Delete.
		* config/tc-nds32.h (nds32_set_section_relocs): Don't declare.
		(SET_SECTION_RELOCS): Don't define.
		(GAS_SORT_RELOCS): Define.
		* config/tc-riscv.h (GAS_SORT_RELOCS): Define.

2021-12-28  jiawei  <jiawei@iscas.ac.cn>

	ld: Fix testcase errors due to -shared not support.
	Reviewed-by: Jim Wilson <jim.wilson.gcc@gmail.com>

	ld/ChangeLog:

	        * testsuite/ld-ctf/ctf.exp: Add shared lib check.
	        * testsuite/ld-plugin/lto.exp: Add lto shared check.

2021-12-28  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-27  H.J. Lu  <hjl.tools@gmail.com>

	elf: Update comments for check_relocs in elf_backend_data
	Since

	commit 5c3261b0e834647cf9eb555320e20871b7854f98
	Author: H.J. Lu <hjl.tools@gmail.com>
	Date:   Mon Oct 16 03:49:54 2017 -0700

	    ELF: Call check_relocs after opening all inputs

	check_relocs is called after opening all inputs.

		* elf-bfd.h (elf_backend_data::check_relocs): Update comments.

2021-12-27  H.J. Lu  <hjl.tools@gmail.com>

	ld: Remove emultempl/linux.em
	Remove emultempl/linux.em whose last usage was removed by

	commit c65c21e1ffd1e02d9970a4bca0b7e384788a50f0
	Author: Alan Modra <amodra@gmail.com>
	Date:   Mon Apr 16 22:14:01 2018 +0930

	    various i386-aout and i386-coff target removal

	    Also tidies some other aout leftovers in binutils-common.exp.

2021-12-27  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-26  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-25  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-24  Tom Tromey  <tom@tromey.com>

	Remove gdb_print_host_address
	gdb_print_host_address is just a simple wrapper around
	fprintf_filtered.  However, it is readily replaced in all callers by a
	combination of %s and call to host_address_to_string.  This also
	simplifies the code, so I think it's worthwhile to remove this
	function.

	Regression tested on x86-64 Fedora 64.

2021-12-24  Tom Tromey  <tom@tromey.com>

	Move gdb_bfd_errmsg to gdb_bfd.c
	gdb_bfd.c contains most of gdb's BFD-related utility functions.
	However, gdb_bfd_errmsg is in utils.c.  It seemed better to me to move
	this out of util.[ch] and into the BFD-related file instead.

	Tested by rebuilding.

2021-12-24  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Rewrite the csr testcases.
	Maskray (Fangrui Song) had suggested me before that we should combine
	multiple testcases into one file as possible as we can.  So that we can
	more easily understand what these test cases are testing, and easier to
	maintain.  Therefore, this patch rewrites all csr testcases, to make them
	more clean.

	gas/
		* testsuite/gas/riscv/csr-fail-nonexistent.d: Renamed from
		priv-reg-fail-nonexistent testcase.
		* testsuite/gas/riscv/csr-fail-nonexistent.: Likewise.
		* testsuite/gas/riscv/csr-fail-nonexistent.s: Likewise.
		* testsuite/gas/riscv/csr-insns-pseudo-noalias.d: Renamed from
		priv-reg-pseudo testcase.
		* testsuite/gas/riscv/csr-insns-pseudo.d: Likewise.
		* testsuite/gas/riscv/csr-insns-pseudo.s: Likewise.
		* testsuite/gas/riscv/csr-insns-read-only.d: Renamed from
		priv-reg-fail-read-only-02 testcase.
		* testsuite/gas/riscv/csr-insns-read-only.l: Likewise.
		* testsuite/gas/riscv/csr-insns-read-only.s: Likewise.
		* testsuite/gas/riscv/h-ext-32.d: Moved hypervisor csrs to csr.s.
		* testsuite/gas/riscv/h-ext-32.s: Likewise.
		* testsuite/gas/riscv/h-ext-64.d: Likewise.
		* testsuite/gas/riscv/h-ext-64.s: Likewise.
		* testsuite/gas/riscv/csr.s: Renamed from priv-reg.s, and then
		added the hypervisor csrs.
		* testsuite/gas/riscv/csr-version-1p9p1.d: The csr testcase when
		the privileged spec is 1.9.1.  Also tested all invalid csr warnings
		when -mcsr-check is enabled.
		* testsuite/gas/riscv/csr-version-1p9p1.l: Likewise.
		* testsuite/gas/riscv/csr-version-1p10.d: Likewise, but the
		privileged spec is 1.10..
		* testsuite/gas/riscv/csr-version-1p10.l: Likewise.
		* testsuite/gas/riscv/csr-version-1p11.d: Likewise, but the
		privileged spec is 1.11.
		* testsuite/gas/riscv/csr-version-1p11.l: Likewise.
		* testsuite/gas/riscv/csr-version-1p12.d: Likewise, but the
		privileged spec is 1.12.
		* testsuite/gas/riscv/csr-version-1p12.l: Likewise.
		* testsuite/gas/riscv/priv-reg*: Removed or Renamed.

2021-12-24  Vineet Gupta  <vineetg@rivosinc.com>

	RISC-V: Hypervisor ext: support Privileged Spec 1.12
	This is the Hypervisor Extension 1.0

	 - Hypervisor Memory-Management Instructions
	   HFENCE.VVMA, HFENCE.GVMA,

	 - Hypervisor Virtual Machine Load and Store Instructions
	   HLV.B, HLV.BU,          HSV.B,
	   HLV.H, HLV.HU, HLVX.HU, HSB.H,
	   HLV.W, HLV.WU, HLVX.WU, HSV.W,
	   HLV.D,                  HSV.D

	 - Hypervisor CSRs (some new, some address changed)
	   hstatus, hedeleg, hideleg, hie, hcounteren, hgeie, htval, hip, hvip,
	   htinst, hgeip, henvcfg, henvcfgh, hgatp, hcontext, htimedelta, htimedeltah,
	   vsstatus, vsie, vstvec, vsscratch, vsepc, vscause, vstval, vsip, vsatp,

	Note that following were added already as part of svinval extension
	support:
	   HINVAL.GVMA, HINVAL.VVMA

	Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
	Reviewed-by: Nelson Chu <nelson.chu@sifive.com>

	bfd/
		* cpu-riscv.c (riscv_priv_specs): Added entry for 1.12.
		* cpu-riscv.h (enum riscv_spec_class): Added PRIV_SPEC_CLASS_1P12.
	gas/
		* config/tc-riscv.c (abort_version): Updated comment.
		(validate_riscv_insn): Annotate switch-break.
		* testsuite/gas/riscv/h-ext-32.d: New testcase for hypervisor.
		* testsuite/gas/riscv/h-ext-32.s: Likewise.
		* testsuite/gas/riscv/h-ext-64.d: Likewise.
		* testsuite/gas/riscv/h-ext-64.s: Likewise.
	include/
		* opcode/riscv-opc.h: Added encodings for hypervisor csrs and
		instrcutions.
	opcodes/
		* riscv-opc.c (riscv_opcodes): Added hypervisor instrcutions.

2021-12-24  Vineet Gupta  <vineetg@rivosinc.com>

	RISC-V: Hypervisor ext: drop Privileged Spec 1.9.1 implementation/tests
	This makes way for a clean 1.12 based Hypervisor Ext support.

	There are no known implementors of 1.9.1 H-ext. (Per Jim, kendryte k210
	is based on priv spec 1.9.1, but it seems unlikely that they implemented
	H-ext).

	Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
	Reviewed-by: Nelson Chu <nelson.chu@sifive.com>

	gas/
		* testsuite/gas/riscv/csr-dw-regnums.d: Drop the hypervisor csrs
		defined in the privileged spec 1.9.1.
		* testsuite/gas/riscv/csr-dw-regnums.s: Likewise.
		* testsuite/gas/riscv/priv-reg-fail-read-only-01.s: Likewise.
		* testsuite/gas/riscv/priv-reg-fail-version-1p10.l: Likewise.
		* testsuite/gas/riscv/priv-reg-fail-version-1p11.l: Likewise.
		* testsuite/gas/riscv/priv-reg-version-1p10.d: Likewise.
		* testsuite/gas/riscv/priv-reg-version-1p11.d: Likewise.
		* testsuite/gas/riscv/priv-reg-version-1p9p1.d: Likewise.
		* testsuite/gas/riscv/priv-reg.s: Likewise.
	include/
		* opcode/riscv-opc.h: Drop the hypervisor csrs defined in the
		privileged spec 1.9.1.

2021-12-24  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-23  Andrew Burgess  <aburgess@redhat.com>

	gdb/testsuite: resolve some duplicate testnames in gdb.mi
	Set of fixes to resolve some duplicate test names in the gdb.mi/
	directory.  There should be no real test changes after this set of
	fixes, they are all either:

	  - Adding with_test_prefix type constructs to make test names unique,
	    or

	  - Changing the test name to be more descriptive, or better reflect
	    the test being run.

2021-12-23  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/remote: handle attach when stop packet lacks thread-id
	Bug PR gdb/28405 reports a regression when using attach with an
	extended-remote target.  In this case the target is not including a
	thread-id in the stop packet it sends back after the attach.

	The regression was introduced with this commit:

	  commit 8f66807b98f7634c43149ea62e454ea8f877691d
	  Date:   Wed Jan 13 20:26:58 2021 -0500

	      gdb: better handling of 'S' packets

	The problem is that when GDB processes the stop packet, it sees that
	there is no thread-id and so has to "guess" which thread the stop
	should apply to.

	In this case the target only has one thread, so really, there's no
	guessing needed, but GDB still runs through the same process, this
	shouldn't cause us any problems.

	However, after the above commit, GDB now expects itself to be more
	internally consistent, specifically, only a thread that GDB thinks is
	resumed, can be a candidate for having stopped.

	It turns out that, when GDB attaches to a process through an
	extended-remote target, the threads of the process being attached too,
	are not, initially, marked as resumed.

	And so, when GDB tries to figure out which thread the stop might apply
	too, it finds no threads in the processes marked resumed, and so an
	assert triggers.

	In extended_remote_target::attach we create a new thread with a call
	to add_thread_silent, rather than remote_target::remote_add_thread,
	the reason is that calling the latter will result in a call to
	'add_thread' rather than 'add_thread_silent'.  However,
	remote_target::remote_add_thread includes additional
	actions (i.e. calling remote_thread_info::set_resumed and set_running)
	which are missing from extended_remote_target::attach.  These missing
	calls are what would serve to mark the new thread as resumed.

	In this commit I propose that we add an extra parameter to
	remote_target::remote_add_thread.  This new parameter will force the
	new thread to be added with a call to add_thread_silent.  We can now
	call remote_add_thread from the ::attach method, the extra
	actions (listed above) will now be performed, and the thread will be
	left in the correct state.

	Additionally, in PR gdb/28405, a segfault is reported.  This segfault
	triggers when 'set debug remote 1' is used before trying to reproduce
	the original assertion failure.  The cause of this is in
	remote_target::select_thread_for_ambiguous_stop_reply, where we do
	this:

	  remote_debug_printf ("first resumed thread is %s",
			       pid_to_str (first_resumed_thread->ptid).c_str ());
	  remote_debug_printf ("is this guess ambiguous? = %d", ambiguous);

	  gdb_assert (first_resumed_thread != nullptr);

	Notice that when debug printing is on we dereference
	first_resumed_thread before we assert that the pointer is not
	nullptr.  This is the cause of the segfault, and is resolved by moving
	the assert before the debug printing code.

	I've extended an existing test, ext-attach.exp, so that the original
	test is run multiple times; we run in the original mode, as normal,
	but also, we now run with different packets disabled in gdbserver.  In
	particular, disabling Tthread would trigger the assertion as it was
	reported in the original bug.  I also run the test in all-stop and
	non-stop modes now for extra coverage, we also run the tests with
	target-async enabled, and disabled.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28405

2021-12-23  Andrew Burgess  <aburgess@redhat.com>

	gdb: on x86-64 non-trivial C++ objects are returned in memory
	Fixes PR gdb/28681.  It was observed that after using the `finish`
	command an incorrect value was displayed in some cases.  Specifically,
	this behaviour was observed on an x86-64 target.

	Consider this test program:

	  struct A
	  {
	    int i;

	    A ()
	    { this->i = 0; }
	    A (const A& a)
	    { this->i = a.i; }
	  };

	  A
	  func (int i)
	  {
	    A a;
	    a.i = i;
	    return a;
	  }

	  int
	  main ()
	  {
	    A a = func (3);
	    return a.i;
	  }

	And this GDB session:

	  $ gdb -q ex.x
	  Reading symbols from ex.x...
	  (gdb) b func
	  Breakpoint 1 at 0x401115: file ex.cc, line 14.
	  (gdb) r
	  Starting program: /home/andrew/tmp/ex.x

	  Breakpoint 1, func (i=3) at ex.cc:14
	  14	  A a;
	  (gdb) finish
	  Run till exit from #0  func (i=3) at ex.cc:14
	  main () at ex.cc:23
	  23	  return a.i;
	  Value returned is $1 = {
	    i = -19044
	  }
	  (gdb) p a
	  $2 = {
	    i = 3
	  }
	  (gdb)

	Notice how after the `finish` the contents of $1 are junk, but, when I
	immediately ask for the value of `a`, I get back the correct value.

	The problem here is that after the finish command GDB calls the
	function amd64_return_value to figure out where the return value can
	be found (on x86-64 targets anyway).

	This function makes the wrong choice for the struct A in our case, as
	sizeof(A) <= 8, then amd64_return_value decides that A will be
	returned in a register.  GDB then reads the return value register an
	interprets the contents as an instance of A.

	Unfortunately, A is not trivially copyable (due to its copy
	constructor), and the sys-v specification for argument and return
	value passing, says that any non-trivial C++ object should have space
	allocated for it by the caller, and the address of this space is
	passed to the callee as a hidden first argument.  The callee should
	then return the address of this space as the return value.

	And so, the register that GDB is treating as containing an instance of
	A, actually contains the address of an instance of A (in this case on
	the stack), this is why GDB shows the incorrect result.

	The call stack within GDB for where we actually go wrong is this:

	  amd64_return_value
	    amd64_classify
	      amd64_classify_aggregate

	And it is in amd64_classify_aggregate that we should be classifying
	the type as AMD64_MEMORY, instead of as AMD64_INTEGER as we currently
	do (via a call to amd64_classify_aggregate_field).

	At the top of amd64_classify_aggregate we already have this logic:

	  if (TYPE_LENGTH (type) > 16 || amd64_has_unaligned_fields (type))
	    {
	      theclass[0] = theclass[1] = AMD64_MEMORY;
	      return;
	    }

	Which handles some easy cases where we know a struct will be placed
	into memory, that is (a) the struct is more than 16-bytes in size,
	or (b) the struct has any unaligned fields.

	All we need then, is to add a check here to see if the struct is
	trivially copyable.  If it is not then we know the struct will be
	passed in memory.

	I originally structured the code like this:

	  if (TYPE_LENGTH (type) > 16
	      || amd64_has_unaligned_fields (type)
	      || !language_pass_by_reference (type).trivially_copyable)
	    {
	      theclass[0] = theclass[1] = AMD64_MEMORY;
	      return;
	    }

	This solved the example from the bug, and my small example above.  So
	then I started adding some more extensive tests to the GDB testsuite,
	and I ran into a problem.  I hit this error:

	  gdbtypes.h:676: internal-error: loc_bitpos: Assertion `m_loc_kind == FIELD_LOC_KIND_BITPOS' failed.

	This problem is triggered from:

	  amd64_classify_aggregate
	    amd64_has_unaligned_fields
	      field::loc_bitpos

	Inside the unaligned field check we try to get the bit position of
	each field.  Unfortunately, in some cases the field location is not
	FIELD_LOC_KIND_BITPOS, but is FIELD_LOC_KIND_DWARF_BLOCK.

	An example that shows this bug is:

	  struct B
	  {
	    short j;
	  };

	  struct A : virtual public B
	  {
	    short i;

	    A ()
	    { this->i = 0; }
	    A (const A& a)
	    { this->i = a.i; }
	  };

	  A
	  func (int i)
	  {
	    A a;
	    a.i = i;
	    return a;
	  }

	  int
	  main ()
	  {
	    A a = func (3);
	    return a.i;
	  }

	It is the virtual base class, B, that causes the problem.  The base
	class is represented, within GDB, as a field within A.  However, the
	location type for this field is a DWARF_BLOCK.

	I spent a little time trying to figure out how to convert the
	DWARF_BLOCK to a BITPOS, however, I realised that, in this case at
	least, conversion is not needed.

	The C++ standard says that a class is not trivially copyable if it has
	any virtual base classes.  And so, in this case, even if I could
	figure out the BITPOS for the virtual base class fields, I know for
	sure that I would immediately fail the trivially_copyable check.  So,
	lets just reorder the checks in amd64_classify_aggregate to:

	  if (TYPE_LENGTH (type) > 16
	      || !language_pass_by_reference (type).trivially_copyable
	      || amd64_has_unaligned_fields (type))
	    {
	      theclass[0] = theclass[1] = AMD64_MEMORY;
	      return;
	    }

	Now, if we have a class with virtual bases we will fail quicker, and
	avoid the unaligned fields check completely.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28681

2021-12-23  Andrew Burgess  <aburgess@redhat.com>

	gdb: make use of SCOPE_EXIT to manage thread executing state
	While working on another patch relating to how GDB manages threads
	executing and resumed state, I spotted the following code in
	record-btrace.c:

	  executing = tp->executing ();
	  set_executing (proc_target, inferior_ptid, false);

	  id = null_frame_id;
	  try
	    {
	      id = get_frame_id (get_current_frame ());
	    }
	  catch (const gdb_exception &except)
	    {
	      /* Restore the previous execution state.  */
	      set_executing (proc_target, inferior_ptid, executing);

	      throw;
	    }

	  /* Restore the previous execution state.  */
	  set_executing (proc_target, inferior_ptid, executing);

	  return id;

	I notice that we only catch the exception so we can call
	set_executing, and this is the same call to set_executing that we need
	to perform in the non-exception return path.

	This would be much cleaner if we could use SCOPE_EXIT to avoid the
	try/catch, so lets do that.

	While cleaning this up, I also applied a similar patch to
	record-full.c, though there's no try/catch in that case, but using
	SCOPE_EXIT makes the code safe if, in the future, we do start throwing
	exceptions.

	There should be no user visible changes after this commit.

2021-12-23  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-22  Andrew Burgess  <aburgess@redhat.com>

	gdb/doc: add some index entries relating to mi-async setting
	I noticed that the mi-async setting was not referenced from the index
	in any way, this commit tries to rectify that a bit.

	The @cindex lines I think are not controversial, these same index
	entries are used elsewhere in the manual for async related topics (see
	@node Background Execution).

	The only bit that might be controversial is that I've added a @kindex
	entry for 'set mi-async' when the command is documented as '-gdb-set
	mi-async' (with a similar difference for the show/-gdb-show).

	My reasoning here is that nothing else is indexed under -gdb-set or
	-gdb-show, and as -gdb-set/-gdb-show are just the MI equivalent for
	set/show anything that is documented under set/show can be adjusted
	using -gdb-set/-gdbshow, and so, I've tried to keep the index
	consistent for mi-async.

2021-12-22  Andrew Burgess  <aburgess@redhat.com>

	gdb: convert 'set debug lin-lwp' to a boolean command
	Convert the 'set debug lin-lwp' command to a boolean.  Adds a new
	LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT macro, and makes use of it in one
	place (linux_nat_target::stop).

	The manual entry for 'set debug lin-lwp' is already vague about
	exactly what arguments this command takes, and the description talks
	about turning debug on and off, so I don't think there's any updates
	required there.

	I have updated the doc strings shown when the users enters 'help show
	debug lin-lwp' or 'help show debug lin-lwp'.  The old title lines used
	to talk about the 'GNU/Linux lwp module', but this debug flag is now
	used for any native linux target debug, so we now talk about
	'GNU/Linux native target'.  The body string for this setting has been
	changed from 'Enables printf debugging output.' to 'When on, print
	debug messages relating to the GNU/Linux native target.', the old
	value looks like a cut&paste error to me.

2021-12-22  Andrew Burgess  <aburgess@redhat.com>

	gdb: add threads debugging switch
	Add new commands:

	  set debug threads on|off
	  show debug threads

	Prints additional debug information relating to thread creation and
	deletion.

	GDB already announces when threads are created of course.... most of
	the time, but sometimes threads are added silently, in which case this
	debug message is the only mechanism to see the thread being added.
	Also, though GDB does announce when a thread exits, it doesn't
	announce when the thread object is deleted, I've added a debug message
	for that.

	Additionally, having message printed through the debug system will
	cause the messages to be nested to an appropriate depth when other
	debug sub-systems are turned on (especially things like `infrun` and
	`lin-lwp`).

2021-12-22  jiawei  <jiawei@iscas.ac.cn>

	RISC-V: Update Scalar Crypto testcases.
	Add opcodes in testcases to make sure every instruction generate
	right opcode after disassemble.

	gas/ChangeLog:

	        * testsuite/gas/riscv/k-ext-64.d: Add opcode detect.
	        * testsuite/gas/riscv/k-ext.d: Ditto.
	        * testsuite/gas/riscv/zbkb-32.d: Ditto.
	        * testsuite/gas/riscv/zbkb-64.d: Ditto.
	        * testsuite/gas/riscv/zbkc-32.d: Ditto.
	        * testsuite/gas/riscv/zbkc-64.d: Ditto.
	        * testsuite/gas/riscv/zbkx-32.d: Ditto.
	        * testsuite/gas/riscv/zbkx-64.d: Ditto.
	        * testsuite/gas/riscv/zknd-32.d: Ditto.
	        * testsuite/gas/riscv/zknd-64.d: Ditto.
	        * testsuite/gas/riscv/zkne-32.d: Ditto.
	        * testsuite/gas/riscv/zkne-64.d: Ditto.
	        * testsuite/gas/riscv/zknh-32.d: Ditto.
	        * testsuite/gas/riscv/zknh-64.d: Ditto.
	        * testsuite/gas/riscv/zksed-32.d: Ditto.
	        * testsuite/gas/riscv/zksed-64.d: Ditto.
	        * testsuite/gas/riscv/zksh-32.d: Ditto.
	        * testsuite/gas/riscv/zksh-64.d: Ditto.

2021-12-22  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbarch-components.py: change empty "params" tuples to empty lists
	During review, it was suggested to change the "params" parameter from a
	tuple to a list, for esthetic reasons.  The empty ones are still tuples
	though, they should probably be changed to be empty lists, for
	consistency.  It does not change anything in the script result.

	Change-Id: If13c6c527aa167a5ee5b45740e5f1bda1e9517e4

2021-12-22  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-21  Luis Machado  <luis.machado@linaro.org>

	[AArch64] Fix typo in error messages
	Fix mispelling of PROT_ME to PROT_MTE in the error messages.

2021-12-21  Joel Sherrill  <joel@rtems.org>

	Obsolete m32c-rtems and m32r-rtems
	2020-12-20  Joel Sherrill <joel@rtems.org>

	bfd/
		* config.bfd (m32c-*-rtems*): Remove target.

	ld/
		* configure.tgt (m32c-*-rtems*): Remove target.
		* configure.tgt (m32r-*-rtems*): Remove target.

2021-12-21  Jan Beulich  <jbeulich@suse.com>

	x86: -mfence-as-lock-add=yes doesn't work for 16-bit mode
	Rather than trying to fix this (which would require making an assumption
	on the upper half of %esp being zero), simply issue an error. While at
	it, since the generated code is in conflict with -momit-lock-prefix=yes,
	issue an error in that case as well.

	gas/ELF: avoid below-base ref in obj_elf_parse_section_letters()
	We would better be prepared for 'm' being the first character of the
	incoming string.

2021-12-21  Alan Modra  <amodra@gmail.com>

	Typo fixes in binutils doc
		* doc/binutils.texi: Fix typos.

2021-12-21  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-20  Tom Tromey  <tom@tromey.com>

	Remove print_spaces
	This removes the print_spaces helper function, in favor of using the
	"*%s" idiom that's already used in many places in gdb.  One spot (in
	symmisc.c) is changed to use print_spaces_filtered, because the rest
	of that function is using filtered output.  (This highlights one way
	that the printf idiom is better -- this error is harder to make when
	using that.)

	Regression tested on x86-64 Fedora 34.

2021-12-20  Tom Tromey  <tom@tromey.com>

	Remove puts_debug
	I noticed that puts_debug isn't used in the tree.  git log tells me
	that the last use was removed in 2015:

	    commit 40e0b27177e747600d3ec186458fe0e482a1cf77
	    Author: Pedro Alves <palves@redhat.com>
	    Date:   Mon Aug 24 15:40:26 2015 +0100

		Delete the remaining ROM monitor targets

	... and this commit mentions that the code being removed here probably
	hadn't worked for 6 years prior to that.

	Based on this, I'm removing puts_debug.  I don't think it's useful.
	Tested by rebuilding.

2021-12-20  Tom Tromey  <tom@tromey.com>

	Make n_spaces return a const char *
	n_spaces keeps the spaces in a static buffer.  If a caller overwrites
	these, it may give an incorrect result to a subsequent caller.  So,
	make the return type const to help avoid this outcome.

2021-12-20  Enze Li  <lienze2010@hotmail.com>

	Add Enze Li to gdb/MAINTAINERS

2021-12-20  Joel Brobecker  <brobecker@adacore.com>

	gdb/ada-exp.y: Reformat comment to follow GDB's coding standards
	This commit reformats a comment in gdb/ada-exp.y to avoid
	the leading '*' at the beginning of each line of the comment.

	gdb/ada-lang.h: Reformat comment to follow coding standards
	This commit reformats a comment in gdb/ada-lang.h to avoid
	the leading '*' at the beginning of each line of the comment.

2021-12-20  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-19  Alan Modra  <amodra@gmail.com>

	Obsolete m32c-rtems

	readelf: avoid a possible divide by zero
		* readelf.c (process_section_headers): Check SHT_RELR entsize.

2021-12-19  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-18  Enze Li  <lienze2010@hotmail.com>

	gdb: add "exit" command as an alias for "quit"
	This command adds the "exit" command as an alias for the "quit"
	command, as requested in PR gdb/28406.

	The documentation is also updated to mention this new command.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28406

2021-12-18  Andrew Burgess  <aburgess@redhat.com>

	gdb: add assert in remote_target::wait relating to async being off
	While working on another patch I ended up in a situation where I had
	async mode disabled (with 'maint set target-async off'), but the async
	event token got marked anyway.

	In this situation GDB was continually calling into
	remote_target::wait, however, the async token would never become
	unmarked as the unmarking is guarded by target_is_async_p.

	We could just unconditionally unmark the token, but that would feel
	like just ignoring a bug, so, instead, lets assert that if
	!target_is_async_p, then the async token should not be marked.

	This assertion would have caught my earlier mistake.

	There should be no user visible changes with this commit.

2021-12-18  Andrew Burgess  <aburgess@redhat.com>

	gdb/remote: some fixes for 'maint set target-async off'
	While working on another patch relating to remote targets, I wanted to
	test with 'maint set target-async off' in place.  Unfortunately I ran
	into some problems.  This commit is an attempt to fix one of the
	issues I hit.

	In my particular case I was actually running with:

	  maint set target-async off
	  maint set target-non-stop off

	that is, we're telling GDB to force the targets to operate in
	non-async mode, and in all-stop mode.  Here's my GDB session showing
	the problem:

	  (gdb) maintenance set target-async off
	  (gdb) maintenance set target-non-stop off
	  (gdb) target extended-remote :54321
	  Remote debugging using :54321
	  (gdb) attach 2365960
	  Attaching to process 2365960
	  No unwaited-for children left.
	  (gdb)

	Notice the 'No unwaited-for children left.' error, this is the
	problem.  There's no reason why GDB should not be able to attach to
	the process.

	The problem is this:

	  1. The user runs 'attach PID' and this sends GDB into attach_command
	  in infcmd.c.  From here we call the ::attach method on the attach
	  target, which will be the extended_remote_target.

	  2. In extended_remote_target::attach, we attach to the remote target
	  and get the first reply (which is a stop packet).  We put off
	  processing the stop packet until the end of ::attach.  We setup the
	  inferior and thread to represent the process we attached to, and
	  download the target description.  Finally, we process the initial
	  stop packet.

	  If '!target_is_non_stop_p ()' and '!target_can_async_p ()', which is
	  the case for us given the maintenance commands we used, we cache the
	  stop packet within the remote_state::buf for later processing.

	  3. Back in attach_command, if 'target_is_non_stop_p ()' then we
	  request that the target stops.  This will either process any cached
	  stop replies, or request that the target stops, and process the stop
	  replies.  However, this code is not what we use due to non-stop mode
	  being disabled.  So, we skip to the next step which is to call
	  validate_exec_file.

	  4. Calling validate_exec_file can cause packets to be sent to the
	  remote target, and replies received, the first path I hit is the
	  call to target_pid_to_exec_file, which calls
	  remote_target::pid_to_exec_file, which can then try to read the
	  executable from the remote.  Sending an receiving packets will make
	  use of the remote_state::buf object.

	  5. The attempt to attach continues, but the damage is already done...

	So, the problem is that, in step #2 we cache a stop reply in the
	remote_state::buf, and then in step #4 we reuse the remote_state::buf
	object, discarding any cached stop reply.  As a result, the initial
	stop, which is sent when GDB first attaches to the target, is lost.

	This problem can clearly be seen, I feel, by looking at the
	remote_state::cached_wait_status flag.  This flag tells GDB if there
	is a wait status cached in remote_state::buf.  However, in
	remote_target::putpkt_binary and remote_target::getpkt_or_notif_sane_1
	this flag is just set back to 0, doing this immediately discards any
	cached data.

	I don't know if this scheme ever made sense,  looking at commit
	2d717e4f8a54, where the cached_wait_status flag was added, it appears
	that there was nothing between where the stop was cached, and where
	the stop was consumed, so, I suspect, there never was a situation
	where we ended up in putpkt_binary or getpkt_or_notif_sane_1 and
	needed to clear to the flag, maybe the clearing was added "just in
	case".  Whatever the history, I claim that this clearing this flag is
	no longer a good idea.

	So, my first step toward fixing this issue was to replace the two
	instances of 'rs->cached_wait_status = 0;' in ::putpkt_binary and
	::getpkt_or_notif_sane_1 with 'gdb_assert (rs->cached_wait_status ==
	0);', this, at least would show me when GDB was doing something
	dangerous, and indeed, this assert is now hit in my test case above.

	I did play with using some kind of scoped restore to backup, and
	restore the remote_state::buf object in all the places within remote.c
	that I was hitting where the ::buf was being corrupted.  The first
	problem with this is that, where the ::cached_wait_status flag is
	reset is _not_ where ::buf is corrupted.  For the ::putpkt_binary
	case, by the time we get to the method the buffer has already been
	corrupted in many cases, so we end up needing to add the scoped
	save/restore within the callers, which means we need the save/restore
	in _lots_ of places.

	Plus, using this save/restore model feels like the wrong solution.  I
	don't think that it's obvious that the buffer might be holding cached
	data, and I think it would be too easy for new corruptions of the
	buffer to be introduced, which could easily go unnoticed for a long
	time.

	So, I really wanted a solution that didn't require us to cache data in
	the ::buf object.

	Luckily, I think we already have such a solution in place, the
	remote_state::stop_reply_queue, it seems like this does exactly the
	same task, just in a slightly different way.  With the
	::stop_reply_queue, the stop packets are processed upon receipt and
	the stop_reply object is added to the queue.  With the ::buf cache
	solution, the unprocessed stop reply is cached in the ::buf, and
	processed later.

	So, finally, in this commit, I propose to remove the
	remote_state::cached_wait_status flag and to stop using the ::buf to
	cache stop replies.  Instead, stop replies will now always be stored
	in the ::stop_reply_queue.

	There are two places where we use the ::buf to hold a cached stop
	reply, the first is in the ::attach method, and the second is in
	remote_target::start_remote, however, the second of these cases is far
	less problematic, as after caching the stop reply in ::buf we call the
	global start_remote function, which does very little work before
	calling normal_stop, which processes the cached stop reply.  However,
	my plan is to switch both users over to using ::stop_reply_queue so
	that the old (unsafe) ::cached_wait_status mechanism can be completely
	removed.

	The next problem is that the ::stop_reply_queue is currently only used
	for async-mode, and so, in remote_target::push_stop_reply, where we
	push stop_reply objects into the ::stop_reply_queue, we currently also
	mark the async event token.  I've modified this so we only mark the
	async event token if 'target_is_async_p ()' - note, _is_, not _can_
	here. The ::push_stop_reply method is called in places where async
	mode has been temporarily disabled, but, when async mode is switched
	back on (see remote_target::async) we will mark the event token if
	there are events in the queue.

	Another change of interest is in remote_target::remote_interrupt_as.
	Previously this code checked ::cached_wait_status, but didn't check
	for events in the ::stop_reply_queue.  Now that ::cached_wait_status
	has been removed we now check the queue length instead, which should
	have the same result.

	Finally, in remote_target::wait_as, I've tried to merge the processing
	of the ::stop_reply_queue with how we used to handle the
	::cached_wait_status flag.

	Currently, when processing the ::stop_reply_queue we call
	process_stop_reply and immediately return.  However, when handling
	::cached_wait_status we run through the whole of ::wait_as, and return
	at the end of the function.

	If we consider a standard stop packet, the two differences I see are:

	  1. Resetting of the remote_state::waiting_for_stop_reply, flag; this
	  is not currently done when processing a stop from the
	  ::stop_reply_queue.

	  2. The final return value has the possibility of being adjusted at
	  the end of ::wait_as, as well as there being calls to
	  record_currthread, non of which are done if we process a stop from
	  the ::stop_reply_queue.

	After discussion on the mailing list:

	  https://sourceware.org/pipermail/gdb-patches/2021-December/184535.html

	it was suggested that, when an event is pushed into the
	::stop_reply_queue, the ::waiting_for_stop_reply flag is never going
	to be set.  As a result, we don't need to worry about the first
	difference.  I have however, added a gdb_assert to validate the
	assumption that the flag is never going to be set.  If in future the
	situation ever changes, then we should find out pretty quickly.

	As for the second difference, I have resolved this by having all stop
	packets taken from the ::stop_reply_queue, pass through the return
	value adjustment code at the end of ::wait_as.

	An example of a test that reveals the benefits of this commit is:

	  make check-gdb \
	    RUNTESTFLAGS="--target_board=native-extended-gdbserver \
	                  GDBFLAGS='-ex maint\ set\ target-async\ off \
	                            -ex maint\ set\ target-non-stop\ off' \
	                  gdb.base/attach.exp"

	For testing I've been running test on x86-64/GNU Linux, and run with
	target boards unix, native-gdbserver, and native-extended-gdbserver.
	For each board I've run with the default GDBFLAGS, as well as with:

	  GDBFLAGS='-ex maint\ set\ target-async\ off \
	            -ex maint\ set\ target-non-stop\ off' \

	Though running with the above GDBFLAGS is clearly a lot more unstable
	both before and after my patch, I'm not seeing any consistent new
	failures with my patch, except, with the native-extended-gdbserver
	board, where I am seeing new failures, but only because more tests are
	now running.  For that configuration alone I see the number of
	unresolved go down by 49, the number of passes goes up by 446, and the
	number of failures also increases by 144.  All of the failures are new
	tests as far as I can tell.

2021-12-18  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	x86: Terminate mnemonicendp in swap_operand()
	Tested on x86_64-pc-linux-gnu.

	opcodes/ChangeLog:
	2021-12-17 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

		* i386-dis.c (swap_operand): Terminate mnemonicendp.

	gas/ChangeLog:
	2021-12-17 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

		* testsuite/gas/i386/opts-intel.d: Updated expected disassembly.
		* testsuite/gas/i386/opts.d: Likewise.
		* testsuite/gas/i386/sse2avx-opts-intel.d: Likewise.
		* testsuite/gas/i386/sse2avx-opts.d: Likewise.
		* testsuite/gas/i386/x86-64-opts-intel.d: Likewise.
		* testsuite/gas/i386/x86-64-opts.d: Likewise.
		* testsuite/gas/i386/x86-64-sse2avx-opts-intel.d: Likewise.
		* testsuite/gas/i386/x86-64-sse2avx-opts.d: Likewise.

2021-12-18  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-17  Tom Tromey  <tom@tromey.com>

	Document gdbarch-components.py
	This adds a comment to document how to update gdbarch.

	Remove gdbarch.sh
	This patch runs gdbarch.py and removes gdbarch.sh.

2021-12-17  Simon Marchi  <simon.marchi@efficios.com>

	Add new gdbarch generator
	The new gdbarch generator is a Python program.  It reads the
	"components.py" that was created in the previous patch, and generates
	gdbarch.c and gdbarch-gen.h.

	This is a relatively straightforward translation of the existing .sh
	code.  It doesn't try very hard to be idiomatic Python or to be
	especially smart.

	It is, however, incredibly faster:

	    $ time ./gdbarch.sh

	    real	0m8.197s
	    user	0m5.779s
	    sys	0m3.384s

	    $ time ./gdbarch.py

	    real	0m0.065s
	    user	0m0.053s
	    sys	0m0.011s

	Co-Authored-By: Tom Tromey <tom@tromey.com>

2021-12-17  Tom Tromey  <tom@tromey.com>

	Generate new gdbarch-components.py from gdbarch.sh
	The new gdbarch.sh approach will be to edit a Python file, rather than
	adding a line to a certain part of gdbarch.sh.  We use the existing sh
	code, though, to generate the first draft of this .py file.

	Documentation on the format will come in a subsequent patch.

	Note that some info (like "staticdefault") in the current code is
	actually unused, and so is ignored by this new generator.

2021-12-17  Tom Tromey  <tom@tromey.com>

	Do not sort the fields in gdbarch_dump
	This changes gdbarch.sh so that it no longer sorts the fields in
	gdbarch_dump.  This sorting isn't done anywhere else by gdbarch.sh,
	and this simplifies the new generator a little bit.

	Do not generate gdbarch.h
	Now that gdbarch.h has been split, we no longer need the generator
	code in gdbarch.sh, so remove it.

2021-12-17  Tom Tromey  <tom@tromey.com>

	Split gdbarch.h into two files
	This patch splits gdbarch.h into two files -- gdbarch.h now is
	editable and hand-maintained, and the new gdbarch-gen.h file is the
	only thing generated by gdbarch.sh.  This lets us avoid maintaining
	boilerplate in the gdbarch.sh file.

	Note that gdbarch.sh still generates gdbarch.h after this patch.  This
	makes it easier to re-run when rebasing.  This code is removed in a
	subsequent patch.

2021-12-17  Tom Tromey  <tom@tromey.com>

	Move ordinary gdbarch code to arch-utils
	While I think it makes sense to generate gdbarch.c, at the same time I
	think it is better for ordinary code to be editable in a C file -- not
	as a hunk of C code embedded in the generator.

	This patch moves this sort of code out of gdbarch.sh and gdbarch.c and
	into arch-utils.c, then has arch-utils.c include gdbarch.c.

2021-12-17  Maciej W. Rozycki  <macro@embecosm.com>

	Avoid redundant operations in `fortran_array_walker'
	Move inner dimension's element type determination outside the respective
	loops in `fortran_array_walker'.  The operation is exactly the same with
	each iteration, so there is no point in redoing it for each element and
	while a smart compiler might be able to move it outside the loop it is
	regardless a bad coding style.  No functional change.

	Initialize `m_ndimensions' in the member initializer list
	Following our coding convention initialize the `m_ndimensions' member in
	the member initializer list rather than in the body of the constructor
	of the `fortran_array_walker' class.  No functional change.

2021-12-17  Lancelot SIX  <lancelot.six@amd.com>
	    Pedro Alves  <pedro@palves.net>

	gdb/tui: install SIGWINCH only when connected to a TTY
	PR26056 reports that when GDB is connected to non-TTY stdin/stdout, it
	crashes when it receives a SIGWINCH signal.

	This can be reproduced as follows:

	    $ gdb/gdb -nx -batch -ex 'run' --args sleep 60 </dev/null 2>&1 | cat

	    # from another terminal:
	    $ kill -WINCH %(pidof gdb)

	When doing so, the process crashes in a call to rl_resize_terminal:

	    void
	    rl_resize_terminal (void)
	    {
	      _rl_get_screen_size (fileno (rl_instream), 1);
	      ...
	    }

	The problem is that at this point rl_instream has the value NULL.

	The rl_instream variable is supposed to be initialized during a call to
	readline_initialize_everything, which in a normal startup sequence is
	called under this call chain:

	    tui_interp::init
	      tui_ensure_readline_initialized
	        rl_initialize
	          readline_initialize_everything

	In tui_interp::init, we have the following sequence:

	    tui_initialize_io ();
	    tui_initialize_win ();                // <- Installs SIGWINCH
	    if (gdb_stdout->isatty ())
	      tui_ensure_readline_initialized (); // <- Initializes rl_instream

	This function unconditionally installs the SIGWINCH signal handler (this
	is done by tui_initialize_win), and then if gdb_stdout is a TTY it
	initializes readline.  Therefore, if stdout is not a TTY, SIGWINCH is
	installed but readline is not initialized.  In such situation
	rl_instream stays NULL, and when GDB receives a SIGWINCH it calls its
	handler and in fine tries to access rl_instream leading to the crash.

	This patch proposes to fix this issue by installing the SIGWINCH signal
	handler only if GDB is connected to a TTY.  Given that this
	initialization it the only task of tui_initialize_win, this patch moves
	tui_initialize_win just after the call to
	tui_ensure_readline_initialized.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26056
	Change-Id: I6458acef7b0d9beda2a10715d0345f02361076d9

2021-12-17  Alan Modra  <amodra@gmail.com>

	asan: NULL dereference in bfd_elf_set_group_contents
		* elf-bfd.h (struct output_elf_obj_tdata): Make num_section_syms
		unsigned.
		* elf.c (bfd_elf_set_group_contents): Bounds check sec->index
		and check that entry in elf_section_syms for sec is non-NULL.
		(_bfd_elf_symbol_from_bfd_symbol): Adjust.

2021-12-17  Alan Modra  <amodra@gmail.com>

	asan: use after free in _bfd_elf_mips_get_relocated_section_contents
	Leaving entries on mips_hi16_list from a previous pass over relocs
	leads to confusing bugs.

		* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
		Free mips_hi16_list entries on error exit.

2021-12-17  Alan Modra  <amodra@gmail.com>

	asan: abort in wasm_scan_name_function_section
	Macros like READ_LEB128 in wasm-module.c that alter control flow are
	evil.  Maintainers will break your code if you have hidden ways to
	reach labels.

		* wasm-module.c (wasm_scan_name_function_section): Don't
		attempt to bfd_release NULL.

2021-12-17  Alan Modra  <amodra@gmail.com>

	asan: heap-buffer-overflow in bpf_elf_generic_reloc
	The bpf reloc howtos are a bit weird, using bitpos to specify an
	offset from r_offset that is outside the size of the reloc as given by
	howto.size.  That means bfd_get_reloc_size gives the wrong answer for
	range checking, and thus bfd_reloc_offset_in_range can't be used.

		* elf64-bpf.c (bpf_elf_generic_reloc): Handle bitpos offset reloc
		range checking.

2021-12-17  Alan Modra  <amodra@gmail.com>

	ubsan: bfd.c:2519:8: shift exponent 34 is too large
		* bfd.c (bfd_update_compression_header): Avoid integer overflow.

	asan: buffer overflow in mmo_get_symbols
		* mmo.c (mmo_get_symbols): Error on symbol name exceeding max length.

2021-12-17  Alan Modra  <amodra@gmail.com>

	asan: buffer overflow in elfnn-aarch64.c get_plt_type
	We can't assume .dynamic is a multiple of ElfNN_External_Dyn, at least
	not when presented with fuzzed object files.

		* elfnn-aarch64.c (get_plt_type): Don't access past end of
		improperly sized .dynamic.

2021-12-17  Alan Modra  <amodra@gmail.com>

	try_build_id_prefix gcc-10 -Wformat-security errors
	dwarf.c:11300:3: error: format not a string literal and no format arguments [-Werror=format-security]
	11300 |   f += sprintf (f, prefix);

		PR 28697
		* dwarf.c (try_build_id_prefix): Avoid -Wformat-security error.

2021-12-17  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-16  Nick Clifton  <nickc@redhat.com>

	Fix AVR assembler so that it creates relocs that will work with linker relaxation.
		PR 28686
	gas	* config/tc-avr.h (tc_fix_adjustable): Define.
		* config/tc-avr.c (avr_fix_adjustable): New function.
		* testsuite/gas/all/gas.exp: Skip tests that need adjustable fixups.
		* testsuite/gas/elf/elf.exp: Likewise.
		* testsuite/gas/avr/diffreloc_withrelax.d: Adjust expected output.
		* testsuite/gas/avr/pc-relative-reloc.d: Adjust expected output.

	ld	* testsuite/ld-avr/avr-prop-7.d: Adjust expected output.
		* testsuite/ld-avr/avr-prop-8.d: Likewise.
		* testsuite/ld-avr/pr13402.d: Likewise.

2021-12-16  Nick Clifton  <nickc@redhat.com>

	When loading separate debug info files, also attempt to locate a file based upon the build-id.
		PR 28697
		* dwarf.c (load_build_id_debug_file): New function.
		(try_build_id_prefix): New function.
		(check_for_and_load_links): Call load_build_id_debug_file.
		(debug_displays): Add entry for .note.gnu.build-id.
		* dwarf.h (enum dwarf_section_display_enum): Add
		note_gnu_build_id.
		* testsuite/binutils-all/debuginfod.exp (test_fetch_debuglink):
		Fix regexp for loads via debuglink section.

2021-12-16  Richard Sandiford  <richard.sandiford@arm.com>

	arm: Add support for Armv9.1-A to Armv9.3-A
	This patch adds AArch32 support for -march=armv9.[123]-a.
	The behaviour of the new options can be expressed using a
	combination of existing feature flags and tables.

	The cpu_arch_ver entries for ARM_ARCH_V9_2A and ARM_ARCH_V9_3A
	are technically redundant but it seemed less surprising to include
	them anyway.

	include/
		* opcode/arm.h (ARM_ARCH_V9_1A, ARM_ARCH_V9_2A): New macros.
		(ARM_ARCH_V9_3A): Likewise.

	gas/
		* doc/c-arm.texi: Add armv9.1-a, armv9.2-a and armv9.3-a.
		* config/tc-arm.c (armv91a_ext_table, armv92a_ext_table): New macros.
		(armv93a_ext_table): Likewise.
		(arm_archs): Add armv9.1-a, armv9.2-a and armv9.3-a.
		(cpu_arch_ver): Add ARM_ARCH_V9_1A, ARM_ARCH_V9_2A and ARM_ARCH_V9_3A.
		* NEWS: Mention the above.
		* testsuite/gas/arm/attr-march-armv9_1-a.d: New test.
		* testsuite/gas/arm/attr-march-armv9_2-a.d: Likewise.
		* testsuite/gas/arm/attr-march-armv9_3-a.d: Likewise.
		* testsuite/gas/arm/bfloat16-armv9.1-a.d: Likewise.
		* testsuite/gas/arm/bfloat16-armv9.2-a.d: Likewise.
		* testsuite/gas/arm/bfloat16-armv9.3-a.d: Likewise.
		* testsuite/gas/arm/i8mm-armv9.1-a.d: Likewise.
		* testsuite/gas/arm/i8mm-armv9.2-a.d: Likewise.
		* testsuite/gas/arm/i8mm-armv9.3-a.d: Likewise.

2021-12-16  Richard Sandiford  <richard.sandiford@arm.com>

	arm: Add support for Armv8.7-A and Armv8.8-A
	This patch adds AArch32 support for -march=armv8.[78]-a.
	The behaviour of the new options can be expressed using a
	combination of existing feature flags and tables.

	The cpu_arch_ver entries are technically redundant but
	it seemed less surprising to include them anyway.

	include/
		* opcode/arm.h (ARM_ARCH_V8_7A, ARM_ARCH_V8_8A): New macros.

	gas/
		* doc/c-arm.texi: Add armv8.7-a and armv8.8-a.
		* config/tc-arm.c (armv87a_ext_table, armv88a_ext_table): New macros.
		(arm_archs): Add armv8.7-a and armv8.8-a.
		(cpu_arch_ver): Add ARM_ARCH_V8_7A and ARM_ARCH_V8_8A.
		* NEWS: Mention the above.
		* testsuite/gas/arm/attr-march-armv8_7-a.d: New test.
		* testsuite/gas/arm/attr-march-armv8_8-a.d: Likewise.
		* testsuite/gas/arm/bfloat16-armv8.7-a.d: Likewise.
		* testsuite/gas/arm/bfloat16-armv8.8-a.d: Likewise.
		* testsuite/gas/arm/i8mm-armv8.7-a.d: Likewise.
		* testsuite/gas/arm/i8mm-armv8.8-a.d: Likewise.

2021-12-16  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add support for Armv9.1-A to Armv9.3-A
	This patch adds AArch64 support for -march=armv9.[123]-a.
	The behaviour of the new options can be expressed using a
	combination of existing feature flags, so we don't need to
	eat into the vanishing number of spare AARCH64_FEATURE_* bits.
	Hoewver, it was more convenient to separate out the |s of
	feature flags so that Armv9.1-A could reuse the set for
	Armv8.6-A, and so on.

	include/
		* opcode/aarch64.h (AARCH64_ARCH_V8_FEATURES): New macro,
		split out from...
		(AARCH64_ARCH_V8): ...here.
		(AARCH64_ARCH_V8_1_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_1): ...here.
		(AARCH64_ARCH_V8_2_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_2): ...here.
		(AARCH64_ARCH_V8_3_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_3): ...here.
		(AARCH64_ARCH_V8_4_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_4): ...here.
		(AARCH64_ARCH_V8_5_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_5): ...here.
		(AARCH64_ARCH_V8_6_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_6): ...here.
		(AARCH64_ARCH_V8_7_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_7): ...here.
		(AARCH64_ARCH_V8_8_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V8_8): ...here.
		(AARCH64_ARCH_V9_FEATURES): New macro, split out from...
		(AARCH64_ARCH_V9): ...here.
		(AARCH64_ARCH_V9_1_FEATURES, AARCH64_ARCH_V9_1): New macros.
		(AARCH64_ARCH_V9_2_FEATURES, AARCH64_ARCH_V9_2): New macros.
		(AARCH64_ARCH_V9_3_FEATURES, AARCH64_ARCH_V9_3): New macros.

	gas/
		* doc/c-aarch64.texi: Add armv9.1-a, armv9-2-a and armv9.3-a.
		* config/tc-aarch64.c (aarch64_archs): Likewise.
		* NEWS: Mention the above.
		* testsuite/gas/aarch64/armv9_invalid.d,
		testsuite/gas/aarch64/armv9_invalid.s,
		testsuite/gas/aarch64/armv9_invalid.l: New test.
		* testsuite/gas/aarch64/armv9_1.d,
		testsuite/gas/aarch64/armv9_1.s: Likewise.
		* testsuite/gas/aarch64/armv9_1_invalid.d,
		testsuite/gas/aarch64/armv9_1_invalid.s,
		testsuite/gas/aarch64/armv9_1_invalid.l: Likewise.
		* testsuite/gas/aarch64/armv9_2.d,
		testsuite/gas/aarch64/armv9_2.s: Likewise.
		* testsuite/gas/aarch64/armv9_2_invalid.d,
		testsuite/gas/aarch64/armv9_2_invalid.s,
		testsuite/gas/aarch64/armv9_2_invalid.l: Likewise.
		* testsuite/gas/aarch64/armv9_3.d,
		testsuite/gas/aarch64/armv9_3.s: Likewise.

2021-12-16  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Support svinval extension with frozen version 1.0.
	According to the privileged spec, there are five new instructions for
	svinval extension.  Two of them (HINVAL.VVMA and HINVAL.GVMA) need to
	enable the hypervisor extension.  But there is no implementation of
	hypervisor extension in mainline for now, so let's consider the related
	issues later.

	                31..25  24..20 19..15 14..12 11...7 6..2  1..0
	sinval.vma      0001011 rs2    rs1    000    00000  11100 11
	sfence.w.inval  0001100 00000  00000  000    00000  11100 11
	sfence.inval.ir 0001100 00001  00000  000    00000  11100 11
	hinval.vvma     0010011 rs2    rs1    000    00000  11100 11
	hinval.gvma     0110011 rs2    rs1    000    00000  11100 11

	This patch is cherry-picked from the riscv integration branch since the
	svinval extension is frozen for now.  Besides, we fix the funct7 encodings
	of hinval.vvma and hinval.gvma, from 0x0011011 and 0x0111011 to 0x0010011
	and 0x0110011.

	bfd/
		* elfxx-riscv.c (riscv_supported_std_s_ext): Added svinval.
		(riscv_multi_subset_supports): Handle INSN_CLASS_SVINVAL.
	gas/
		* testsuite/gas/riscv/svinval.d: New testcase.
		* testsuite/gas/riscv/svinval.s: Likewise.
	include/
		* opcode/riscv-opc.h: Added encodings for svinval.
		* opcode/riscv.h (enum riscv_insn_class): Added INSN_CLASS_SVINVAL.
	opcodes/
		* riscv-opc.c (riscv_opcodes): Added svinval instructions.

2021-12-16  Mike Frysinger  <vapier@gentoo.org>

	sim: mips/or1k: drop redundant arg to bitsize macro
	These are just using the default behavior for the 3rd arg, so drop
	it to make it more clear.  This also makes them match all other
	ports that only use the first 2 arguments.

2021-12-16  Mike Frysinger  <vapier@gentoo.org>

	bfd: unify texi generation rules
	The logic between these rules are extremely similar, so unify them
	into a single variable by leveraging make $@ and $< variables.

	Also add automake silent rule support while we're here.

2021-12-16  Mike Frysinger  <vapier@gentoo.org>

	sim: fix mingw builds with replacement gnulib open
	The header shuffling in here broke the workaround for gnulib defining
	"open".  Move it back before the sim-specific includes to fix.  This
	is because the callback struct in the headers has an "open" member and
	this file tries to call that.

2021-12-16  Sandra Loosemore  <sandra@codesourcery.com>

	Adjust compare_link_order for unstable qsort
	In a cross toolchain for nios2-elf target and x86_64-w64-mingw32 host
	using binutils 2.37, we observed a failure that didn't show up on
	x86_64-linux-gnu host:  testcase pr25490-5.s was failing with

	C:\path\to\nios2-elf-ld.exe: looping in map_segments
	FAIL: __patchable_function_entries section 5

	    	* ldelfgen.c (compare_link_order): Don't use section id in
		sorting.  Keep original ordering instead.  Update comments.

2021-12-16  Alan Modra  <amodra@gmail.com>

	Re: Fix an undefined behaviour in the BFD library's DWARF parser
	Using an unsigned int cast (to 32 bits) on a pointer difference (of
	possibly 64 bits) is wrong.  Even though it will work on all real
	object files, the fuzzers will eventually find this hole.

		PR 28687
		* dwarf1.c (parse_die): Cast pointer difference to size_t.
		Catch another possible pointer overflow.

2021-12-16  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: re-format with black 21.12b0
	Run black 21.12b0 on gdb/, there is a single whitespace change.  I will
	update the wiki [1] in parallel to bump the version of black to 21.12b0.

	[1] https://sourceware.org/gdb/wiki/Internals%20GDB-Python-Coding-Standards

	Change-Id: Ib3b859e3506c74a4f15d16f1e44ef402de3b98e2

2021-12-16  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: re-format with black 21.9b0
	Run black 21.9b0 on gdb/ (this is the version currently mentioned on the
	wiki [1], the subsequent commit will bump that version).

	[1] https://sourceware.org/gdb/wiki/Internals%20GDB-Python-Coding-Standards

	Change-Id: I5ceaab42c42428e053e2572df172aa42a88f0f86

2021-12-16  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-15  Alan Modra  <amodra@gmail.com>

	PR28691, validate dwarf attribute form
	PR28691 is a fuzzing PR that triggers a non-problem of "output changes
	per run" with PIEs and/or different compilers.  I've closed similar
	PRs before as wontfix, but I guess there will be no end of this type
	of PR.  The trigger is an attribute that usually takes one of the
	offset/constant reference DW_FORMs being given an indexed string
	DW_FORM.  The bfd reader doesn't support indexed strings and returns
	an error string instead.  The address of the string varies with PIE
	runs and/or compiler, and we allow that address to appear in output.
	Fix this by validating integer attribute forms, as we do for string
	form attributes.

		PR 28691
		* dwarf2.c (is_str_attr): Rename to..
		(is_str_form): ..this.  Change param type.  Update calls.
		(is_int_form): New function.
		(read_attribute_value): Handle DW_FORM_addrx2.
		(find_abstract_instance): Validate form when using attr.u.val.
		(scan_unit_for_symbols, parse_comp_unit): Likewise.

2021-12-15  Luis Machado  <luis.machado@linaro.org>

	New --enable-threading configure option to control use of threads in GDB/GDBserver
	Add the --enable-threading configure option so multithreading can be disabled
	at configure time. This is useful for statically-linked builds of
	GDB/GDBserver, since the thread library doesn't play well with that setup.

	If you try to run a statically-linked GDB built with threading, it will crash
	when setting up the number of worker threads.

	This new option is also convenient when debugging GDB in a system with lots of
	threads, where the thread discovery code in GDB will emit too many messages,
	like so:

	[New Thread 0xfffff74d3a50 (LWP 2625599)]

	If you have X threads, that message will be repeated X times.

	The default for --enable-threading is "yes".

2021-12-15  Nikita Popov  <npv1310@gmail.com>

	Fix an undefined behaviour in the BFD library's DWARF parser.
		PR 28687
		* dwarf1.c (parse_die): Fix undefined behaviour in range tests.

2021-12-15  Alan Modra  <amodra@gmail.com>

	PR28694, Out-of-bounds write in stab_xcoff_builtin_type
		PR 28694
		* stabs.c (stab_xcoff_builtin_type): Make typenum unsigned.
		Negate typenum earlier, simplifying bounds checking.  Correct
		off-by-one indexing.  Adjust switch cases.

2021-12-15  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-14  Alan Modra  <amodra@gmail.com>

	loongarch32 build failure on 32-bit host
	gas/config/tc-loongarch.c: In function ‘assember_macro_helper’:
	gas/config/tc-loongarch.c:915:28: error: right shift count >= width of type [-Werror=shift-count-overflow]
	  915 |       hi32 = insn->args[1] >> 32;
	      |                            ^~

	One possible fix is to make offsetT a 64-bit type for loongarch32.
	This also makes bfd/targmatch.h (generated from bfd/config.bfd)
	consistent since the loongarch32 match is inside #ifdef BFD64.

		* config.bfd (loongarch32-*): Set want64.

2021-12-14  Alan Modra  <amodra@gmail.com>

	loongarch64 build failure on 32-bit host
	gas/config/tc-loongarch.c: In function ‘loongarch_args_parser_can_match_arg_helper’:
	gas/config/tc-loongarch.c:661:13: error: cast from pointer to integer of different size [-Werror=pointer
	-to-int-cast]
	  661 |       imm = (offsetT) str_hash_find (r_htab, arg);
	      |             ^

	Cast it to the correct size int, relying on normal integer promotions
	if offsetT is larger than a pointer.

		* config/tc-loongarch.c (loongarch_args_parser_can_match_arg_helper):
		Cast return from str_hash_find to intptr_t, not offsetT.

2021-12-14  Alan Modra  <amodra@gmail.com>

	XCOFF C_STSYM test failure on 32-bit host
	This test was failing here and on another similar symbol:
	[  4](sec  1)(fl 0x00)(ty   0)(scl 143) (nx 0) 0x05d1745d11745d21 .bs
	where correct output is
	[  4](sec  1)(fl 0x00)(ty   0)(scl 143) (nx 0) 0x000000000000000a .bs

	The problem is caused by a 32-bit host pointer being sign-extended
	when stored into a 64-bit bfd_vma, and then that value not being
	trimmed back to 32 bits when used.  The following belt-and-braces
	patch fixes both the store and subsequent reads.

		* coffcode.h (coff_slurp_symbol_table): Do not sign extend
		when storing a host pointer to syment.n_value.
		* coffgen.c (coff_get_symbol_info): Cast syment.n_value to a
		bfd_hostptr_t before using in arithmetic.
		(coff_print_symbol): Likewise.

2021-12-14  Simon Marchi  <simon.marchi@efficios.com>

	gdbserver/tracepoint.cc: use snprintf in gdb_agent_socket_init
	If we modify tracepoint.cc to try to use a too long unix socket name,
	for example by modifying SOCK_DIR to be:

	    #define SOCK_DIR "/tmp/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut/salut"

	... trying to start an application with libinproctrace.so loaded
	crashes:

	    $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.6:./libinproctrace.so /bin/ls
	    /home/smarchi/src/binutils-gdb/gdbserver/../gdbsupport/common-utils.cc:69: A problem internal to GDBserver in-process agent has been detected.
	    xsnprintf: Assertion `ret < size' failed.

	Looking at the rest of the socket initialization code, the intent seems
	to be that if something goes wrong, we warn but let the program
	execute.  So crashing on this failed assertions seems against the intent.

	Commit 6cebaf6e1ae4 ("use xsnprintf instead of snprintf.") changed this
	code to use xsnprintf instead of snprintf, introducing this assertion.
	Before that, snprintf would return a value bigger that UNIX_PATH_MAX and
	the "if" after would catch it and emit a warning, which is exactly what
	we want.  That change was done because LynxOS didn't have snprintf.
	Since LynxOS isn't supported anymore, we can simply revert to use
	snprintf there.

	With this patch, we get a warning (printed by the caller of
	gdb_agent_socket_init), but the program keeps executing:

	    $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.6:./libinproctrace.so /bin/ls
	    ipa: could not create sync socket
	    ...

	Change-Id: I78bca52d5dc3145335abeae45a42052701e3f5dd

2021-12-14  Simon Marchi  <simon.marchi@efficios.com>

	gdbserver/tracepoint.cc: work around -Wstringop-truncation error
	When building gdb with  on AArch64 with g++ 11.1.0 (and some preceding
	versions too), -O2 and -fsanitize=address, I get this error.

	      CXX    tracepoint-ipa.o
	    cc1plus: warning: command-line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
	    In file included from /usr/include/string.h:519,
	                     from ../gnulib/import/string.h:41,
	                     from /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/common-defs.h:95,
	                     from /home/simark/src/binutils-gdb/gdbserver/server.h:22,
	                     from /home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:19:
	    In function ‘char* strncpy(char*, const char*, size_t)’,
	        inlined from ‘int init_named_socket(const char*)’ at /home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:6902:11,
	        inlined from ‘int gdb_agent_socket_init()’ at /home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:6953:26,
	        inlined from ‘void* gdb_agent_helper_thread(void*)’ at /home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:7204:41:
	    /usr/include/bits/string_fortified.h:95:34: error: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output may be truncated copying 107 bytes from a string of length 107 [-Werror=stringop-truncation]
	       95 |   return __builtin___strncpy_chk (__dest, __src, __len,
	          |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
	       96 |                                   __glibc_objsize (__dest));
	          |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~

	Note that _FORTIFY_SOURCE changes the message a bit, but I get a similar
	error if I use -D_FORTIFY_SOURCE=0.

	I am pretty sure it's spurious and might be related to this GCC bug:

	  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88780

	From what I can see, we are copying from a static 108 bytes long buffer
	(the global array agent_socket_name) to a 108 bytes long array,
	sockaddr_un::sun_path.  I don't see anything wrong.

	Still, it would make things easier if we didn't see this error.  Change
	the code to check that the source string length is smaller than the
	destination buffer (including space for the NULL byte) and use strcpy.

	For anybody who would like to try to reproduce, the full command line
	is:

	    g++     -I. -I/home/simark/src/binutils-gdb/gdbserver -I/home/simark/src/binutils-gdb/gdbserver/../gdb/regformats -I/home/simark/src/binutils-gdb/gdbserver/.. -I/home/simark/src/binutils-gdb/gdbserver/../include -I/home/simark/src/binutils-gdb/gdbserver/../gdb -I/home/simark/src/binutils-gdb/gdbserver/../gnulib/import -I../gnulib/import -I/home/simark/src/binutils-gdb/gdbserver/.. -I..   -pthread -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized -Wno-mismatched-tags -Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local -Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wmissing-declarations -Wmissing-prototypes -Wstrict-null-sentinel -Wformat -Wformat-nonliteral -Werror -DGDBSERVER  -DCONFIG_UST_GDB_INTEGRATION -Drpl_strerror_r=strerror_r -Drpl_free=free -fPIC -DIN_PROCESS_AGENT -fvisibility=hidden -g3 -O2 -fsanitize=address   -c -o tracepoint-ipa.o -MT tracepoint-ipa.o -MMD -MP -MF ./.deps/tracepoint-ipa.Tpo /home/simark/src/binutils-gdb/gdbserver/tracepoint.cc

	Change-Id: I18e86c0487feead7e7677e69398405e7057cf464

2021-12-14  Simon Marchi  <simon.marchi@polymtl.ca>

	bfd: fix -Wunused errors with clang 13+
	Clang 13 and 14 produce some -Wunused-but-set-{variable,parameter} for
	situations where gcc doesn't.  In particular, when a variable is set and
	then used in a way to update its own value.  For example, if `i` is only
	used in this way:

	  int i = 2;
	  i++;
	  i = i + 1;

	gcc won't warn, but clang will.

	Fix all such errors found in an --enable-targets=all build.  It would be
	important for somebody who knows what they're doing to just make sure
	that these variables can indeed be deleted, and that there a no cases
	where it's a bug, and the variable should actually be used.

	The first instance of this error fix by this patch is:

	      CC       elf32-score.lo
	    /home/simark/src/binutils-gdb/bfd/elf32-score.c:450:11: error: variable 'relocation' set but not used [-Werror,-Wunused-but-set-variable]
	      bfd_vma relocation;
	              ^

	Change-Id: I2f233ce20352645cf388aff3dfa08a651d21a6b6

2021-12-14  Andrew Burgess  <aburgess@redhat.com>

	gdb/mi: rename build_table to add_builtin_mi_commands
	Just give the function build_table a more descriptive name.  There
	should be no user visible changes after this commit.

2021-12-14  Jan Vrany  <jan.vrany@labware.com>

	gdb/mi: rename mi_cmd to mi_command
	Just give this class a new name, more inline with the name of the
	sub-classes.  I've also updated mi_cmd_up to mi_command_up in
	mi-cmds.c inline with this new naming scheme.

	There should be no user visible changes after this commit.

2021-12-14  Jan Vrany  <jan.vrany@labware.com>

	gdb/mi: use separate classes for different types of MI command
	This commit changes the infrastructure in mi-cmds.{c,h} to add new
	sub-classes for the different types of MI command.  Instances of these
	sub-classes are then created and added into mi_cmd_table.

	The existing mi_cmd class becomes the abstract base class, this has an
	invoke method and takes care of the suppress notifications handling,
	before calling a do_invoke virtual method which is implemented by all
	of the sub-classes.

	There's currently two different sub-classes, one of pure MI commands,
	and a second for MI commands that delegate to CLI commands.

	There should be no user visible changes after this commit.

2021-12-14  Andrew Burgess  <aburgess@redhat.com>

	gdb/mi: int to bool conversion in mi_execute_cli_command
	Change an argument of mi_execute_cli_command from int to bool.  Update
	the callers to take this into account.  Within mi_execute_cli_command,
	update a comparison of a pointer to 0 with a comparison to nullptr,
	and add an assert, if we are not using the argument string then the
	string should be nullptr.  Also removed a cryptic 'gdb_????' comment,
	which isn't really helpful.

	There should be no user visible changes after this commit.

2021-12-14  Jan Vrany  <jan.vrany@labware.com>

	gdb/mi: use std::map for MI commands in mi-cmds.c
	This changes the hashmap used in mi-cmds.c from a custom structure to
	std::map.  Not only is replacing a custom container with a standard
	one an improvement, but using std::map will make it easier to
	dynamically add commands; which is something that is planned for a
	later series, where we will allow MI commands to be implemented in
	Python.

	There should be no user visible changes after this commit.

2021-12-14  Jan Vrany  <jan.vrany@labware.com>

	gdb/mi: rename mi_lookup to mi_cmd_lookup
	Lets give this function a more descriptive name.  I've also improved
	the comments in the header and source files.

	There should be no user visible changes after this commit.

2021-12-14  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Added ld testcases for the medlow and medany code models.
	There are two linker scripts, code-model-01.ld and code-model-02.ld,
	which are corresponding to the two different memory layouts,

	* code-model-01.ld: the text section is in the 32-bit address range, but
	  the data section is far away from the text section, which means the data
	  section is over the 32-bit address range.

	* code-model-02.ld: the text section is over the 32-bit address range, but
	  the data section is placed nearly zero address.

	We use the two linker scripts, to test the current medlow and medany behaviors
	of GNU ld, including the weak symbol references and the relaxations behaviors.
	Besides, these testcases also show the limits of the current medlow and medany
	code models, that is - we may get the truncated to fit errors when linking
	with the above two linker scripts.

	ld/
		* testsuite/ld-riscv-elf/code-model-01.ld: New testcases to test the
		behaviors of the current medlow and medany code models.
		* testsuite/ld-riscv-elf/code-model-02.ld: Likewise.
		* testsuite/ld-riscv-elf/code-model-medany-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-medany-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-medany-weakref-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-medany-weakref-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-medlow-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-medlow-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-medlow-weakref-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-medlow-weakref-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medany-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medany-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medany-weakref-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medany-weakref-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medlow-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medlow-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medlow-weakref-01.d: Likewise.
		* testsuite/ld-riscv-elf/code-model-relax-medlow-weakref-02.d: Likewise.
		* testsuite/ld-riscv-elf/code-model.s: Likewise.
		* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.

2021-12-14  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-13  H.J. Lu  <hjl.tools@gmail.com>

	x86: Adjust linker tests for --disable-separate-code
	Adjust linker tests for linker configured with --disable-separate-code:

	1. Update expected outputs.
	2. Pass -z max-page-size=0x1000 -z separate-code" to linker.

		* testsuite/ld-i386/report-reloc-1.l: Updated.
		* testsuite/ld-x86-64/report-reloc-1.l: Likewise.
		* testsuite/ld-x86-64/pe-x86-64.exp: Pass
		"-z max-page-size=0x1000 -z separate-code" to linker.
		* testsuite/ld-x86-64/pr19609-4e.d: Likewise.
		* testsuite/ld-x86-64/pr19609-6a.d: Likewise.
		* testsuite/ld-x86-64/pr19609-6b.d: Likewise.
		* testsuite/ld-x86-64/pr19609-7b.d: Likewise.
		* testsuite/ld-x86-64/pr19609-7d.d: Likewise.

2021-12-13  Carl Love  <cel@us.ibm.com>

	gdb: Powerpc mark xfail in gdb.base/catch-syscall.exp
	Powerpc is not reporting the

	  Catchpoint 1 (returned from syscall execve),  ....

	as expected.  The issue appears to be with the kernel not returning the
	expected result.  This patch marks the test failure as an xfail.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28623

2021-12-13  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: improve reuse of value contents when fetching array elements
	While working on a Python script, which was interacting with a remote
	target, I noticed some weird slowness in GDB.  In my program I had a
	structure something like this:

	  struct foo_t
	  {
	    int array[5];
	  };

	  struct foo_t global_foo;

	Then in the Python script I was fetching a complete copy of global
	foo, like:

	  val = gdb.parse_and_eval('global_foo')
	  val.fetch_lazy()

	Then I would work with items in foo_t.array, like:

	  print(val['array'][1])

	I called the fetch_lazy method specifically because I knew I was going
	to end up accessing almost all of the contents of val, and so I wanted
	GDB to do a single remote protocol call to fetch all the contents in
	one go, rather than trying to do lazy fetches for a couple of bytes at
	a time.

	What I observed was that, after the fetch_lazy call, GDB does,
	correctly, fetch the entire contents of global_foo, including all of
	the contents of array, however, when I access val.array[1], GDB still
	goes and fetches the value of this element from the remote target.

	What's going on is that in valarith.c, in value_subscript, for C like
	languages, we always end up treating the array value as a pointer, and
	then doing value_ptradd, and value_ind, the second of these calls
	always returns a lazy value.

	My guess is that this approach allows us to handle indexing off the
	end of an array, when working with zero element arrays, or when
	indexing a raw pointer as an array.  And, I agree, that in these
	cases, where, even when the original value is non-lazy, we still will
	not have the content of the array loaded, we should be using the
	value_ind approach.

	However, for cases where we do have the array contents loaded, and we
	do know the bounds of the array, I think we should be using
	value_subscripted_rvalue, which is what we use for non C like
	languages.

	One problem I did run into, exposed by gdb.base/charset.exp, was that
	value_subscripted_rvalue stripped typedefs from the element type of
	the array, which means the value returned will not have the same type
	as an element of the array, but would be the raw, non-typedefed,
	type.  In charset.exp we got back an 'int' instead of a
	'wchar_t' (which is a typedef of 'int'), and this impacts how we print
	the value.  Removing typedefs from the resulting value just seems
	wrong, so I got rid of that, and I don't see any test regressions.

	With this change in place, my original Python script is now doing no
	additional memory accesses, and its performance increases about 10x!

2021-12-13  Andrew Burgess  <aburgess@redhat.com>

	gdb: update gdb-gdb.py.in for latest changes to struct field
	This commit updates uses of 'loc' and 'loc_kind' to 'm_loc' and
	'm_loc_kind' respectively, in gdb-gdb.py.in, which is required after
	this commit:

	  commit cd3f655cc7a55437a05aa8e7b1fcc9051b5fe404
	  Date:   Thu Sep 30 22:38:29 2021 -0400

	      gdb: add accessors for field (and call site) location

	I have also incorporated this change:

	  https://sourceware.org/pipermail/gdb-patches/2021-September/182171.html

	Which means we print 'm_name' instead of 'name' when displaying the
	'm_name' member variable.

	Finally, I have also added support for the new TYPE_SPECIFIC_INT
	fields, which were added with this commit:

	  commit 20a5fcbd5b28cca88511ac5a9ad5e54251e8fa6d
	  Date:   Wed Sep 23 09:39:24 2020 -0600

	      Handle bit offset and bit size in base types

	I updated the gdb.gdb/python-helper.exp test to cover all of these
	changes.

2021-12-13  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	gdbserver/linux-low: replace direct assignment to current_thread
	Use scoped_restore_current_thread and switch_to_thread in
	linux_process_target::wait_for_sigstop.

2021-12-13  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	gdbserver: replace direct assignments to current_thread
	Replace the direct assignments to current_thread with
	switch_to_thread.  Use scoped_restore_current_thread when appropriate.
	There is one instance remaining in linux-low.cc's wait_for_sigstop.
	This will be handled in a separate patch.

	Regression-tested on X86-64 Linux using the native-gdbserver and
	native-extended-gdbserver board files.

2021-12-13  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	gdbserver: introduce scoped_restore_current_thread and switch_to_thread
	Introduce a class for restoring the current thread and a function to
	switch to the given thread.  This is a preparation for a refactoring
	that aims to remove direct assignments to 'current_thread'.

2021-12-13  Andrew Burgess  <aburgess@redhat.com>

	gdb: make post_startup_inferior a virtual method on inf_ptrace_target
	While working on a later patch that required me to understand how GDB
	starts up inferiors, I was confused by the
	target_ops::post_startup_inferior method.

	The post_startup_inferior target function is only called from
	inf_ptrace_target::create_inferior.

	Part of the target class hierarchy looks like this:

	  inf_child_target
	     |
	     '-- inf_ptrace_target
	            |
	            |-- linux_nat_target
	            |
	            |-- fbsd_nat_target
	            |
	            |-- nbsd_nat_target
	            |
	            |-- obsd_nat_target
	            |
	            '-- rs6000_nat_target

	Every sub-class of inf_ptrace_target, except rs6000_nat_target,
	implements ::post_startup_inferior.  The rs6000_nat_target picks up
	the implementation of ::post_startup_inferior not from
	inf_ptrace_target, but from inf_child_target.

	No descendent of inf_child_target, outside the inf_ptrace_target
	sub-tree, implements ::post_startup_inferior, which isn't really
	surprising, as they would never see the method called (remember, the
	method is only called from inf_ptrace_target::create_inferior).

	What I find confusing is the role inf_child_target plays in
	implementing, what is really a helper function for just one of its
	descendents.

	In this commit I propose that we formally make ::post_startup_inferior
	a helper function of inf_ptrace_target.  To do this I will remove the
	::post_startup_inferior from the target_ops API, and instead make this
	a protected, pure virtual function on inf_ptrace_target.

	I'll remove the empty implementation of ::post_startup_inferior from
	the inf_child_target class, and add a new empty implementation to the
	rs6000_nat_target class.

	All the other descendents of inf_ptrace_target already provide an
	implementation of this method and so don't need to change beyond
	making the method protected within their class declarations.

	To me, this makes much more sense now.  The helper function, which is
	only called from within the inf_ptrace_target class, is now a part of
	the inf_ptrace_target class.

	The only way in which this change is visible to a user is if the user
	turns on 'set debug target 1'.  With this debug flag on, prior to this
	patch the user would see something like:

	  -> native->post_startup_inferior (...)
	  <- native->post_startup_inferior (2588939)

	After this patch these lines are no longer present, as the
	post_startup_inferior is no longer a top level target method.  For me,
	this is an acceptable change.

2021-12-13  Andrew Burgess  <aburgess@redhat.com>

	gdb: have mips_nbsd_nat_target inherit from nbsd_nat_target
	While working on another patch I had reason to look at
	mips-netbsd-nat.c, and noticed that the class mips_nbsd_nat_target
	inherits directly from inf_ptrace_target.

	This is a little strange as alpha_bsd_nat_target,
	arm_netbsd_nat_target, hppa_nbsd_nat_target, m68k_bsd_nat_target,
	ppc_nbsd_nat_target, sh_nbsd_nat_target, and vax_bsd_nat_target all
	inherit from nbsd_nat_target.

	Originally, in this commit:

	  commit f6ac5f3d63e03a81c4ff3749aba234961cc9090e
	  Date:   Thu May 3 00:37:22 2018 +0100

	      Convert struct target_ops to C++

	When the target tree was converted to C++, all of the above classes
	inherited from inf_ptrace_target except for hppa_nbsd_nat_target,
	which was the only class that originally inherited from
	nbsd_nat_target.

	Later on all the remaining targets (except mips) were converted to
	inherit from nbsd_nat_target, these are the commits:

	  commit 4fed520be264b60893aa674071947890f8172915
	  Date:   Sat Mar 14 16:05:24 2020 +0100

	      Inherit alpha_netbsd_nat_target from nbsd_nat_target

	  commit 6018d381a00515933016c539d2fdc18ad0d304b8
	  Date:   Sat Mar 14 14:50:51 2020 +0100

	      Inherit arm_netbsd_nat_target from nbsd_nat_target

	  commit 01a801176ea15ddfc988cade2e3d84c3b0abfec3
	  Date:   Sat Mar 14 16:54:42 2020 +0100

	      Inherit m68k_bsd_nat_target from nbsd_nat_target

	  commit 9faa006d11a5e08264a007463435f84b77864c9c
	  Date:   Thu Mar 19 14:52:57 2020 +0100

	      Inherit ppc_nbsd_nat_target from nbsd_nat_target

	  commit 9809762324491b851332ce600ae9bde8dd34f601
	  Date:   Tue Mar 17 15:07:39 2020 +0100

	      Inherit sh_nbsd_nat_target from nbsd_nat_target

	  commit d5be5fa4207da00d039a1d5a040ba316e7092cbd
	  Date:   Sat Mar 14 13:21:58 2020 +0100

	      Inherit vax_bsd_nat_target from nbsd_nat_target

	I could only find mailing list threads for ppc and sh in the archive ,
	and unfortunately, none of the commits has any real detail that might
	explain why mips was missed out, the only extra context I could find
	was this message:

	  https://sourceware.org/pipermail/gdb-patches/2020-March/166853.html

	Which says that "proper" OS support is going to be added to
	nbsd_nat_target, hence the need to inherit from that class.

	My guess is that leaving mips_nbsd_nat_target unchanged was an
	oversight, so, in this commit, I propose changing mips_nbsd_nat_target
	to inherit from nbsd_nat_target just like all the other nbsd targets.

	My motivation for this patch relates to the post_startup_inferior
	target method.  In a future commit I want to change how this method is
	handled.  Currently the mips_nbsd_nat_target will pick up the empty
	implementation of inf_child_target::post_startup_inferior rather than
	the version in netbsd-nat.c.  This feels like a bug to me, as surely,
	enabling of proc events is something that would need to be done for
	all netbsd targets, regardless of architecture.

	In my future patch I have a choice then, either (a) add a new, empty
	implementation of post_startup_inferior to mips_nbsd_nat_target,
	or (b) this commit, have mips_nbsd_nat_target inherit from
	nbsd_nat_target.  Option (b) seems like the right way to go, hence,
	this commit.

	I've done absolutely no testing for this change, not even building it,
	as that would require at least an environment in which I can x-build
	mips-netbsd applications, which I have no idea how to set up.

2021-12-13  Andrew Burgess  <aburgess@redhat.com>

	gdb: only include mips and riscv targets if building with 64-bit bfd
	While testing another patch I was trying to build different
	configurations of GDB, and, during one test build I ran into a
	problem, I configured with `--enable-targets=all
	--host=i686-w64-mingw32` and saw this error while linking GDB:

	  .../i686-w64-mingw32/bin/ld: mips-tdep.o: in function `mips_gdbarch_init':
	  .../src/gdb/mips-tdep.c:8730: undefined reference to `disassembler_options_mips'
	  .../i686-w64-mingw32/bin/ld: riscv-tdep.o: in function `riscv_gdbarch_init':
	  .../src/gdb/riscv-tdep.c:3851: undefined reference to `disassembler_options_riscv'

	So the `disassembler_options_mips` and `disassembler_options_riscv`
	symbols are missing.

	This turns out to be because mips-dis.c and riscv-dis.c, in which
	these symbols are defined, are in the TARGET64_LIBOPCODES_CFILES list
	in opcodes/Makefile.am, these files are only built when we are
	building with a 64-bit bfd.

	If we look further, into bfd/Makefile.am, we can see that all the
	files matching elf*-riscv.lo are in the BFD64_BACKENDS list, as are
	the elf*-mips.lo files, and (I know because I tried), the two
	disassemblers do, not surprisingly, depend on features supplied from
	libbfd.

	So, though we can build most of GDB just fine for riscv and mips with
	a 32-bit bfd, if I understand correctly, the final GDB
	executable (assuming we could get it to link) would not understand
	these architectures at the bfd level, nor would there be any
	disassembler available.  This sounds like a pretty useless GDB to me.

	So, in this commit, I move the riscv and mips targets into GDB's list
	of targets that require a 64-bit bfd.  After this I can build GDB just
	fine with the configure options given above.

	This was discussed on the mailing list in a couple of threads:

	  https://sourceware.org/pipermail/gdb-patches/2021-December/184365.html
	  https://sourceware.org/pipermail/binutils/2021-November/118498.html

	and it is agreed, that it is unfortunate that the 32-bit riscv and
	32-bit mips targets require a 64-bit bfd.  If in the future this
	situation ever changes then it would be expected that some (or all) of
	this patch would be reverted.  Until then though, this patch allows
	GDB to build when configured with --enable-targets=all, and when using
	a 32-bit libbfd.

2021-12-13  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-12  Tom Tromey  <tom@tromey.com>

	C++-ify path substitution code
	I found some uses of xfree in the path substitution code in source.c.
	C++-ifying struct substitute_path_rule both simplifies the code and
	removes manual memory management.

	Regression tested on x86-64 Fedora 34.

2021-12-12  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-11  Alan Modra  <amodra@gmail.com>

	[GOLD] PowerPC64 @notoc in non-power10 code
	Gold version of commit 7aba54da42.

	elfcpp/
		* powerpc.h (R_PPC64_REL24_P9NOTOC): Define.
	gold/
		* powerpc.cc (Target_powerpc::maybe_skip_tls_get_addr_call,
		is_branch_reloc, max_branch_delta): Handle R_PPC64_REL24_P9NOTOC.
		(Target_powerpc::Branch_info::make_stub): Likewise.
		(struct Plt_stub_ent): Add p9notoc_, p9off_, tsize_.
		(struct Branch_stub_ent): Add p9notoc_, p9off_.
		(Stub_table::add_plt_call_entry): Handle R_PPC64_REL24_P9NOTOC.
		(Stub_table::add_long_branch_entry): Likewise.
		(Stub_table::add_eh_frame): Likewise.
		(Stub_table::plt_call_size): Return aligned size.  Adjust callers.
		Handle p9notoc_ sizing.
		(Stub_table::do_write): Write out p9notoc_ stubs.
		(Target_powerpc::Scan::get_reference_flags, local, global):
		Handle R_PPC64_REL24_P9NOTOC.
		(Target_powerpc::Relocate::relocate): Likewise.

2021-12-11  H.J. Lu  <hjl.tools@gmail.com>

	Don't return the main file as the separate debug info
	On Fedora 35,

	$ readelf -d /usr/bin/npc

	caused readelf to run out of stack since load_separate_debug_info
	returned the input main file as the separate debug info:

	(gdb) bt
	 #0  load_separate_debug_info (
	    main_filename=main_filename@entry=0x510f50 "/export/home/hjl/.cache/debuginfod_client/dcc33c51c49e7dafc178fdb5cf8bd8946f965295/debuginfo",
	    xlink=xlink@entry=0x4e5180 <debug_displays+4480>,
	    parse_func=parse_func@entry=0x431550 <parse_gnu_debuglink>,
	    check_func=check_func@entry=0x432ae0 <check_gnu_debuglink>,
	    func_data=func_data@entry=0x7fffffffdb60, file=file@entry=0x51d430)
	    at /export/gnu/import/git/sources/binutils-gdb/binutils/dwarf.c:11057
	 #1  0x000000000043328d in check_for_and_load_links (file=0x51d430,
	    filename=0x510f50 "/export/home/hjl/.cache/debuginfod_client/dcc33c51c49e7dafc178fdb5cf8bd8946f965295/debuginfo")
	    at /export/gnu/import/git/sources/binutils-gdb/binutils/dwarf.c:11381
	 #2  0x00000000004332ae in check_for_and_load_links (file=0x51b070,
	    filename=0x518dd0 "/export/home/hjl/.cache/debuginfod_client/dcc33c51c49e7dafc178fdb5cf8bd8946f965295/debuginfo")

	Return NULL if the separate debug info is the same as the input main
	file to avoid infinite recursion.

		PR binutils/28679
		* dwarf.c (load_separate_debug_info): Don't return the input
		main file.

2021-12-11  Alan Modra  <amodra@gmail.com>

	Don't edit bogus sh_link on reading relocatable objects (Oracle fix)
	This reverts a 1995 fix to handle bogus object files.  Presumably such
	object files have long gone.

		* elf.c (bfd_section_from_shdr): Remove old hack for Oracle
		libraries.

2021-12-11  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-10  Jan Vrany  <jan.vrany@labware.com>

	gdb/testsuite: respect GDBSERVER variable in remote-stdio-gdbserver "board"
	The comment on top of gdb/testsuite/boards/remote-stdio-gdbserver.exp says
	that user can specify path to gdbserver on remote system by setting
	GDBSERVER variable. However, this variable was ignored and /usr/bin/gdbserver
	was used unconditionally.

	This commit updates the code to respect GDBSERVER if set and fall back to
	/usr/bin/gdbserver if not.

2021-12-10  Simon Marchi  <simon.marchi@polymtl.ca>

	Revert "gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT`"
	This reverts commit fe72c32765e1190c8a17d309fc3a7e1882d6a430.

	It turns out it was wrong, libinproctrace.so does build its own
	gdbsupport/tdesc.cc.  This broke the build:

	    make[1]: Entering directory '/home/simark/build/binutils-gdb-one-target/gdbserver'
	      CXXLD  libinproctrace.so
	    /usr/bin/ld: gdbsupport/tdesc-ipa.o: in function `print_xml_feature::visit_pre(target_desc const*)':
	    /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:407: undefined reference to `tdesc_architecture_name(target_desc const*)'
	    /usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:408: undefined reference to `tdesc_architecture_name(target_desc const*)'
	    /usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:411: undefined reference to `tdesc_osabi_name(target_desc const*)'
	    /usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:416: undefined reference to `tdesc_compatible_info_list(target_desc const*)'
	    /usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:418: undefined reference to `tdesc_compatible_info_arch_name(std::unique_ptr<tdesc_compatible_info, std::default_delete<tdesc_compatible_info> > const&)'

2021-12-10  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-09  Alan Modra  <amodra@gmail.com>

	PR28674, objdump crash
	Not returning an error indication here leaves the attribute
	uninitialised, which then leads to intemperate behaviour.

		PR 28674
		* dwarf2.c (read_attribute_value): Return NULL on trying to read
		past end of attributes.

2021-12-09  Alan Modra  <amodra@gmail.com>

	Set sh_link for reloc sections created as normal sections
	binutils-all/strip-13 and binutils-all/strip-14 tests create
	SHT_REL/SHT_RELA sections by hand.  These don't have sh_link set to
	the .symtab section as they should, leading to readelf warnings if you
	happen to be looking at the object files.

		* elf.c (assign_section_numbers): Formatting.  Set sh_link for
		reloc sections created as normal sections in relocatable
		objects.

2021-12-09  Simon Marchi  <simon.marchi@efficios.com>

	gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT`
	I suppose this code was copied from GDBserver and this ifndef was left
	there.  As far as I know, IN_PROCESS_AGENT will never be defined when
	building this file, so we can remove this.

	Change-Id: I84fc408e330b3a29106df830a09342861cadbaf6

2021-12-09  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/microblaze-tdep.c: fix -Wunused-but-set-variable
	Fix this, seen when building with clang 14:

	      CXX    microblaze-tdep.o
	    /home/simark/src/binutils-gdb/gdb/microblaze-tdep.c:207:7: error: variable 'flags' set but not used [-Werror,-Wunused-but-set-variable]
	      int flags = 0;
	          ^

	Change-Id: I59f726ed33e924912748bc475b6fd9a9394fc0d0

2021-12-09  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/csky-tdep.c: fix -Wunused-but-set-variable error
	Fix these, seen when building with clang 14:

	      CXX    csky-tdep.o
	    /home/simark/src/binutils-gdb/gdb/csky-tdep.c:332:7: error: variable 'need_dummy_stack' set but not used [-Werror,-Wunused-but-set-variable]
	      int need_dummy_stack = 0;
	          ^
	    /home/simark/src/binutils-gdb/gdb/csky-tdep.c:805:12: error: variable 'offset' set but not used [-Werror,-Wunused-but-set-variable]
	                  int offset = 0;
	                      ^

	Change-Id: I6703bcb50e83c50083f716f4084ef6aa30d659c4

2021-12-09  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: fix default behavior of runto
	The documented behavior of proc runto is to not emit a PASS when
	succeeding to to run to the specified location, but emit a FAIL when
	failing to do so.  I suppose the intent is that it won't pollute the
	results normally passing tests (although I don't see why we would care),
	but make visible any problems.

	However, it seems like the implementation makes it default to never
	print anything.  "no-message" is prependend to "args", so if "message"
	is not passed, we will always take the   path that sets print_fail to 0,
	which will silence any failure.

	This unfortunately means that tests relying on runto_main won't emit a
	FAIL if failing to run to main.  And since commit 4dfef5be6812
	("gdb/testsuite: make runto_main not pass no-message to runto"), tests
	don't emit a FAIL themselves when failing to run to main.  This means
	that tests failing to run to main just fail silently, and that's bad.

	This can be reproduced by hacking gdb.base/template.exp like so:

	    diff --git a/gdb/testsuite/gdb.base/template.c b/gdb/testsuite/gdb.base/template.c
	    index bcf39c377d92..052be5b79d73 100644
	    --- a/gdb/testsuite/gdb.base/template.c
	    +++ b/gdb/testsuite/gdb.base/template.c
	    @@ -15,6 +15,14 @@
	        You should have received a copy of the GNU General Public License
	        along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

	    +#include <stdlib.h>
	    +
	    +__attribute__((constructor))
	    +static void c (void)
	    +{
	    +  exit (1);
	    +}
	    +
	     int
	     main (void)
	     {

	Running the modified gdb.base/template.exp shows that it exits without
	printing any result.

	Remove the line that prepends no-message to args, that should make
	runto's behavior match its documentation.

	This patch will appear to add many failures, but in reality they already
	existed, they were just silenced.

	Change-Id: I2a730d5bc72b6ef0698cd6aad962d9902aa7c3d6

2021-12-09  Carl Love  <cel@us.ibm.com>

	gdb fix elfv1 Powerpc gdb.dwarf2/frame-inlined-in-outer-frame.exp
	On ELFv1, the _start symbol must point to the *function descriptor* (in
	the .opd section), not to the function code (in the .text section) like
	with ELFv2 and other architectures.

2021-12-09  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/maint.exp with -readnow
	With test-case gdb.base/maint.exp and target board -readnow, I run into:
	...
	FAIL: gdb.base/maint.exp: maint info line-table w/o a file name
	...

	The problem is that this and other regexps anchored using '^':
	...
	    -re "^$gdb_prompt $" {
	...
	don't trigger because other regexps don't consume the entire preceding line.

	This is partly due to the addition of the IS-STMT column.

	Fix this by making the regexps consume entire lines.

	Tested on x86_64-linux with native and target board readnow, as well as
	check-read1 and check-readmore.

2021-12-09  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/include-main.exp with -readnow
	With test-case gdb.base/include-main.exp and target board readnow, I run into:
	...
	FAIL: gdb.base/include-main.exp: maint info symtab
	...

	The corresponding check in gdb.base/include-main.exp:
	...
	gdb_test_no_output "maint info symtab"
	...
	checks that no CU was expanded, while -readnow ensures that all CUs are
	expanded.

	Fix this by skipping the check with -readnow.

	Tested on x86_64-linux, with native and target board readnow.

2021-12-09  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Clarify the behavior of .option arch directive.
	* To be consistent with -march option, removed the "=" operator when
	user want to reset the whole architecture string.  So the formats are,

	.option arch, +<extension><version>, ...
	.option arch, -<extension>
	.option arch, <ISA string>

	* Don't allow to add or remove the base extensions in the .option arch
	directive.  Instead, users should reset the whole architecture string
	while they want to change the base extension.

	* The operator "+" won't update the version of extension, if the
	extension is already in the subset list.

	bfd/
		* elfxx-riscv.c (riscv_add_subset): Don't update the version
		if the extension is already in the subset list.
		(riscv_update_subset): To be consistent with -march option,
		removed the "=" operator when user want to reset the whole
		architecture string.  Besides, Don't allow to add or remove
		the base extensions in the .option arch directive.
	gas/
		* testsuite/gas/riscv/option-arch-01.s: Updated since we cannot
		add or remove the base extensions in the .option arch directive.
		* testsuite/gas/riscv/option-arch-02.s: Likewise.
		* testsuite/gas/riscv/option-arch-fail.l: Likewise.
		* testsuite/gas/riscv/option-arch-fail.s: Likewise.
		* testsuite/gas/riscv/option-arch-01a.d: Set -misa-spec=2.2.
		* testsuite/gas/riscv/option-arch-01b.d: Likewise.
		* testsuite/gas/riscv/option-arch-02.d: Updated since the .option
		arch, + won't change the version of extension, if the extension is
		already in the subset list.
		* testsuite/gas/riscv/option-arch-03.s: Removed the "=" operator
		when resetting the whole architecture string.

2021-12-09  Mike Frysinger  <vapier@gentoo.org>

	sim: use ## for automake comments
	The ## marker tells automake to not include the comment in its
	generated output, so use that in most places where the comment
	only makes sense in the inputs.

2021-12-09  Simon Marchi  <simon.marchi@efficios.com>

	gdb, gdbserver: detach fork child when detaching from fork parent
	While working with pending fork events, I wondered what would happen if
	the user detached an inferior while a thread of that inferior had a
	pending fork event.  What happens with the fork child, which is
	ptrace-attached by the GDB process (or by GDBserver), but not known to
	the core?  Sure enough, neither the core of GDB or the target detach the
	child process, so GDB (or GDBserver) just stays ptrace-attached to the
	process.  The result is that the fork child process is stuck, while you
	would expect it to be detached and run.

	Make GDBserver detach of fork children it knows about.  That is done in
	the generic handle_detach function.  Since a process_info already exists
	for the child, we can simply call detach_inferior on it.

	GDB-side, make the linux-nat and remote targets detach of fork children
	known because of pending fork events.  These pending fork events can be
	stored in:

	 - thread_info::pending_waitstatus, if the core has consumed the event
	   but then saved it for later (for example, because it got the event
	   while stopping all threads, to present an all-stop stop on top of a
	   non-stop target)
	 - thread_info::pending_follow: if we ran to a "catch fork" and we
	   detach at that moment

	Additionally, pending fork events can be in target-specific fields:

	 - For linux-nat, they can be in lwp_info::status and
	   lwp_info::waitstatus.
	 - For the remote target, they could be stored as pending stop replies,
	   saved in `remote_state::notif_state::pending_event`, if not
	   acknowledged yet, or in `remote_state::stop_reply_queue`, if
	   acknowledged.  I followed the model of remove_new_fork_children for
	   this: call remote_notif_get_pending_events to process /
	   acknowledge any unacknowledged notification, then look through
	   stop_reply_queue.

	Update the gdb.threads/pending-fork-event.exp test (and rename it to
	gdb.threads/pending-fork-event-detach.exp) to try to detach the process
	while it is stopped with a pending fork event.  In order to verify that
	the fork child process is correctly detached and resumes execution
	outside of GDB's control, make that process create a file in the test
	output directory, and make the test wait $timeout seconds for that file
	to appear (it happens instantly if everything goes well).

	This test catches a bug in linux-nat.c, also reported as PR 28512
	("waitstatus.h:300: internal-error: gdb_signal target_waitstatus::sig()
	const: Assertion `m_kind == TARGET_WAITKIND_STOPPED || m_kind ==
	TARGET_WAITKIND_SIGNALLED' failed.).  When detaching a thread with a
	pending event, get_detach_signal unconditionally fetches the signal
	stored in the waitstatus (`tp->pending_waitstatus ().sig ()`).  However,
	that is only valid if the pending event is of type
	TARGET_WAITKIND_STOPPED, and this is now enforced using assertions (iit
	would also be valid for TARGET_WAITKIND_SIGNALLED, but that would mean
	the thread does not exist anymore, so we wouldn't be detaching it).  Add
	a condition in get_detach_signal to access the signal number only if the
	wait status is of kind TARGET_WAITKIND_STOPPED, and use GDB_SIGNAL_0
	instead (since the thread was not stopped with a signal to begin with).

	Add another test, gdb.threads/pending-fork-event-ns.exp, specifically to
	verify that we consider events in pending stop replies in the remote
	target.  This test has many threads constantly forking, and we detach
	from the program while the program is executing.  That gives us some
	chance that we detach while a fork stop reply is stored in the remote
	target.  To verify that we correctly detach all fork children, we ask
	the parent to exit by sending it a SIGUSR1 signal and have it write a
	file to the filesystem before exiting.  Because the parent's main thread
	joins the forking threads, and the forking threads wait for their fork
	children to exit, if some fork child is not detach by GDB, the parent
	will not write the file, and the test will time out.  If I remove the
	new remote_detach_pid calls in remote.c, the test fails eventually if I
	run it in a loop.

	There is a known limitation: we don't remove breakpoints from the
	children before detaching it.  So the children, could hit a trap
	instruction after being detached and crash.  I know this is wrong, and
	it should be fixed, but I would like to handle that later.  The current
	patch doesn't fix everything, but it's a step in the right direction.

	Change-Id: I6d811a56f520e3cb92d5ea563ad38976f92e93dd
	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28512

2021-12-09  Simon Marchi  <simon.marchi@efficios.com>

	gdb: move clearing of tp->pending_follow to follow_fork_inferior
	A following patch will change targets so that when they detach an
	inferior, they also detach any pending fork children this inferior may
	have.  While doing this, I hit a case where we couldn't differentiate
	two cases, where in one we should detach the fork detach but not in the
	other.

	Suppose we continue past a fork with "follow-fork-mode == child" &&
	"detach-on-fork on".  follow_fork_inferior calls target_detach to detach
	the parent.  In that case the target should not detach the fork
	child, as we'll continue debugging the child.  As of now, the
	tp->pending_follow field of the thread who called fork still contains
	the details about the fork.

	Then, suppose we run to a fork catchpoint and the user types "detach".
	In that case, the target should detach the fork child in addition to the
	parent.  In that case as well, the tp->pending_follow field contains
	the details about the fork.

	To allow targets to differentiate the two cases, clear
	tp->pending_follow a bit earlier, when following a fork.  Targets will
	then see that tp->pending_follow contains TARGET_WAITKIND_SPURIOUS, and
	won't detach the fork child.

	As of this patch, no behavior changes are expected.

	Change-Id: I537741859ed712cb531baaefc78bb934e2a28153

2021-12-09  Simon Marchi  <simon.marchi@efficios.com>

	gdb/remote.c: refactor pending fork status functions
	In preparation for a following patch, refactor a few things that I did
	find a bit awkward, and to make them a bit more reusable.

	 - Pass an inferior to kill_new_fork_children instead of a pid.  That
	   allows iterating on only this inferior's threads and avoid further
	   filtering on the thread's pid.
	 - Change thread_pending_fork_status to return a non-nullptr value only
	   if the thread does have a pending fork status.
	 - Remove is_pending_fork_parent_thread, as one can just use
	   thread_pending_fork_status and check for nullptr.
	 - Replace is_pending_fork_parent with is_fork_status, which just
	   returns if the given target_waitkind if a fork or a vfork.  Push
	   filtering on the pid to the callers, when it is necessary.

	Change-Id: I0764ccc684d40f054e39df6fa5458cc4c5d1cd7b

2021-12-09  Simon Marchi  <simon.marchi@efficios.com>

	gdb/remote.c: move some things up
	Move the stop_reply and a few functions up.  Some code above them in the
	file will need to use them in a following patch.  No behavior changes
	expected here.

	Change-Id: I3ca57d0e3ec253f56e1ba401289d9d167de14ad2

2021-12-09  Simon Marchi  <simon.marchi@efficios.com>

	gdb/linux-nat: factor ptrace-detach code to new detach_one_pid function
	The following patch will add some code paths that need to ptrace-detach
	a given PID.  Factor out the code that does this and put it in its own
	function, so that it can be re-used.

	Change-Id: Ie65ca0d89893b41aea0a23d9fc6ffbed042a9705

2021-12-09  Simon Marchi  <simon.marchi@efficios.com>

	gdbserver: hide fork child threads from GDB
	This patch aims at fixing a bug where an inferior is unexpectedly
	created when a fork happens at the same time as another event, and that
	other event is reported to GDB first (and the fork event stays pending
	in GDBserver).  This happens for example when we step a thread and
	another thread forks at the same time.  The bug looks like (if I
	reproduce the included test by hand):

	    (gdb) show detach-on-fork
	    Whether gdb will detach the child of a fork is on.
	    (gdb) show follow-fork-mode
	    Debugger response to a program call of fork or vfork is "parent".
	    (gdb) si
	    [New inferior 2]
	    Reading /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.threads/step-while-fork-in-other-thread/step-while-fork-in-other-thread from remote target...
	    Reading /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.threads/step-while-fork-in-other-thread/step-while-fork-in-other-thread from remote target...
	    Reading symbols from target:/home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.threads/step-while-fork-in-other-thread/step-while-fork-in-other-thread...
	    [New Thread 965190.965190]
	    [Switching to Thread 965190.965190]
	    Remote 'g' packet reply is too long (expected 560 bytes, got 816 bytes): ... <long series of bytes>

	The sequence of events leading to the problem is:

	 - We are using the all-stop user-visible mode as well as the
	   synchronous / all-stop variant of the remote protocol
	 - We have two threads, thread A that we single-step and thread B that
	   calls fork at the same time
	 - GDBserver's linux_process_target::wait pulls the "single step
	   complete SIGTRAP" and the "fork" events from the kernel.  It
	   arbitrarily choses one event to report, it happens to be the
	   single-step SIGTRAP.  The fork stays pending in the thread_info.
	 - GDBserver send that SIGTRAP as a stop reply to GDB
	 - While in stop_all_threads, GDB calls update_thread_list, which ends
	   up querying the remote thread list using qXfer:threads:read.
	 - In the reply, GDBserver includes the fork child created as a result
	   of thread B's fork.
	 - GDB-side, the remote target sees the new PID, calls
	   remote_notice_new_inferior, which ends up unexpectedly creating a new
	   inferior, and things go downhill from there.

	The problem here is that as long as GDB did not process the fork event,
	it should pretend the fork child does not exist.  Ultimately, this event
	will be reported, we'll go through follow_fork, and that process will be
	detached.

	The remote target (GDB-side), has some code to remove from the reported
	thread list the threads that are the result of forks not processed by
	GDB yet.  But that only works for fork events that have made their way
	to the remote target (GDB-side), but haven't been consumed by the core
	yet, so are still lingering as pending stop replies in the remote target
	(see remove_new_fork_children in remote.c).  But in our case, the fork
	event hasn't made its way to the GDB-side remote target.  We need to
	implement the same kind of logic GDBserver-side: if there exists a
	thread / inferior that is the result of a fork event GDBserver hasn't
	reported yet, it should exclude that thread / inferior from the reported
	thread list.

	This was actually discussed a while ago, but not implemented AFAIK:

	    https://pi.simark.ca/gdb-patches/1ad9f5a8-d00e-9a26-b0c9-3f4066af5142@redhat.com/#t
	    https://sourceware.org/pipermail/gdb-patches/2016-June/133906.html

	Implementation details-wise, the fix for this is all in GDBserver.  The
	Linux layer of GDBserver already tracks unreported fork parent / child
	relationships using the lwp_info::fork_relative, in order to avoid
	wildcard actions resuming fork childs unknown to GDB.  This information
	needs to be made available to the handle_qxfer_threads_worker function,
	so it can filter the reported threads.  Add a new thread_pending_parent
	target function that allows the Linux target to return the parent of an
	eventual fork child.

	Testing-wise, the test replicates pretty-much the sequence of events
	shown above.  The setup of the test makes it such that the main thread
	is about to fork.  We stepi the other thread, so that the step completes
	very quickly, in a single event.  Meanwhile, the main thread is resumed,
	so very likely has time to call fork.  This means that the bug may not
	reproduce every time (if the main thread does not have time to call
	fork), but it will reproduce more often than not.  The test fails
	without the fix applied on the native-gdbserver and
	native-extended-gdbserver boards.

	At some point I suspected that which thread called fork and which thread
	did the step influenced the order in which the events were reported, and
	therefore the reproducibility of the bug.  So I made the test try  both
	combinations: main thread forks while other thread steps, and vice
	versa.  I'm not sure this is still necessary, but I left it there
	anyway.  It doesn't hurt to test a few more combinations.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28288
	Change-Id: I2158d5732fc7d7ca06b0eb01f88cf27bf527b990

2021-12-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-08  Tom Tromey  <tom@tromey.com>

	Use for-each more in gdb
	There are some loops in gdb that use ARRAY_SIZE (or a wordier
	equivalent) to loop over a static array.  This patch changes some of
	these to use foreach instead.

	Regression tested on x86-64 Fedora 34.

2021-12-08  Tom Tromey  <tromey@adacore.com>

	Fix error in file_and_directory patch
	In my earlier C++-ization patch for file_and_directory, I introduced
	an error:

	-  if (strcmp (fnd.name, "<unknown>") != 0)
	+  if (fnd.is_unknown ())

	This change inverted the sense of the test, which causes failures with
	.debug_names.

	This patch fixes the bug.  Regression tested on x86-64 Fedora 34.  I
	also tested it using the AdaCore internal test suite, with
	.debug_names -- this was failing before, and now it works.

2021-12-08  Andrew Burgess  <aburgess@redhat.com>

	gdb/python: Use tp_init instead of tp_new to setup gdb.Value
	The documentation suggests that we implement gdb.Value.__init__,
	however, this is not currently true, we really implement
	gdb.Value.__new__.  This will cause confusion if a user tries to
	sub-class gdb.Value.  They might write:

	  class MyVal (gdb.Value):
	      def __init__ (self, val):
	          gdb.Value.__init__(self, val)

	  obj = MyVal(123)
	  print ("Got: %s" % obj)

	But, when they source this code they'll see:

	  (gdb) source ~/tmp/value-test.py
	  Traceback (most recent call last):
	    File "/home/andrew/tmp/value-test.py", line 7, in <module>
	      obj = MyVal(123)
	    File "/home/andrew/tmp/value-test.py", line 5, in __init__
	      gdb.Value.__init__(self, val)
	  TypeError: object.__init__() takes exactly one argument (the instance to initialize)
	  (gdb)

	The reason for this is that, as we don't implement __init__ for
	gdb.Value, Python ends up calling object.__init__ instead, which
	doesn't expect any arguments.

	The Python docs suggest that the reason why we might take this
	approach is because we want gdb.Value to be immutable:

	   https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_new

	But I don't see any reason why we should require gdb.Value to be
	immutable when other types defined in GDB are not.  This current
	immutability can be seen in this code:

	  obj = gdb.Value(1234)
	  print("Got: %s" % obj)
	  obj.__init__ (5678)
	  print("Got: %s" % obj)

	Which currently runs without error, but prints:

	  Got: 1234
	  Got: 1234

	In this commit I propose that we switch to using __init__ to
	initialize gdb.Value objects.

	This does introduce some additional complexity, during the __init__
	call a gdb.Value might already be associated with a gdb value object,
	in which case we need to cleanly break that association before
	installing the new gdb value object.  However, the cost of doing this
	is not great, and the benefit - being able to easily sub-class
	gdb.Value seems worth it.

	After this commit the first example above works without error, while
	the second example now prints:

	  Got: 1234
	  Got: 5678

	In order to make it easier to override the gdb.Value.__init__ method,
	I have tweaked the definition of gdb.Value.__init__.  The second,
	optional argument to __init__ is a gdb.Type, if this argument is not
	present then GDB figures out a suitable type.

	However, if we want to override the __init__ method in a sub-class,
	and still support the default argument, it is easier to write:

	  class MyVal (gdb.Value):
	      def __init__ (self, val, type=None):
	          gdb.Value.__init__(self, val, type)

	Currently, passing None for the Type will result in an error:

	  TypeError: type argument must be a gdb.Type.

	After this commit I now allow the type argument to be None, in which
	case GDB figures out a suitable type just as if the type had not been
	passed at all.

	Unless a user is trying to reinitialize a value, or create sub-classes
	of gdb.Value, there should be no user visible changes after this
	commit.

2021-12-08  Andrew Burgess  <aburgess@redhat.com>

	gdb: use try/catch around a gdb_disassembler::print_insn call
	While investigating some disassembler problems I ran into this case;
	GDB compiled on a 32-bit arm target, with --enable-targets=all.  Then
	in GDB:

	  (gdb) set architecture i386
	  (gdb) disassemble 0x0,+4
	  unknown disassembler error (error = -1)

	This is interesting because it shows a case where the libopcodes
	disassembler is returning -1 without first calling the
	memory_error_func callback.  Indeed, the return from libopcodes
	happens from this code snippet in i386-dis.c in the print_insn
	function:

	  if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
	    {
	      (*info->fprintf_func) (info->stream,
				     _("64-bit address is disabled"));
	      return -1;
	    }

	Notice how, prior to the return the disassembler tries to print a
	helpful message out, but GDB doesn't print this message.

	The reason this message goes missing is the call stack, it looks like
	this:

	  gdb_pretty_print_disassembler::pretty_print_insn
	    gdb_disassembler::print_insn
	      gdbarch_print_insn
	        ...
	          i386-dis.c:print_insn

	When i386-dis.c:print_insn returns -1 this is handled in
	gdb_disassembler::print_insn, where an exception is thrown.  However,
	the actual printing of the disassembler output is done in
	gdb_pretty_print_disassembler::pretty_print_insn, and is only done if
	an exception is not thrown.

	In this commit I change this.  The pretty_print_insn now uses
	try/catch around the call to gdb_disassembler::print_insn, if we catch
	an error then we first print any pending output in the instruction
	buffer, before rethrowing the exception.  As a result, even if an
	exception is thrown we still print any pending disassembler output to
	the screen; in the above case the helpful message will now be shown.

	Before my patch we might expect to see this output:

	  (gdb) disassemble 0x0,+4
	  Dump of assembler code from 0x0 to 0x4:
	     0x0000000000000000:	unknown disassembler error (error = -1)
	  (gdb)

	But now we see this:

	  (gdb) disassemble 0x0,+4
	  Dump of assembler code from 0x0 to 0x4:
	     0x0000000000000000:	64-bit address is disabled
	  unknown disassembler error (error = -1)

	If the disassembler returns -1 without printing a helpful message then
	we would still expect a change in output, something like:

	  (gdb) disassemble 0x0,+4
	  Dump of assembler code from 0x0 to 0x4:
	     0x0000000000000000:
	  unknown disassembler error (error = -1)

	Which I think is still acceptable, though at this point I think a
	strong case can be made that this is a disassembler bug (not printing
	anything, but still returning -1).

	Notice however, that the error message is always printed on a new line
	now.  This is also true for the memory error case, where before we
	might see this:

	  (gdb) disassemble 0x0,+4
	  Dump of assembler code from 0x0 to 0x4:
	     0x00000000:	Cannot access memory at address 0x0

	We now get this:

	  (gdb) disassemble 0x0,+4
	  Dump of assembler code from 0x0 to 0x4:
	     0x00000000:
	  Cannot access memory at address 0x0

	For me, I'm happy to accept this change, having the error on a line by
	itself, rather than just appended to the end of the previous line,
	seems like an improvement, but I'm aware others might feel
	differently, so I'd appreciate any feedback.

2021-12-08  Jan Vrany  <jan.vrany@labware.com>

	ppc: recognize all program traps
	Permanent program breakpoints (ones inserted into the code) other than
	the one GDB uses for POWER (0x7fe00008) did not result in stop but
	caused GDB to loop infinitely.

	This was because GDB did not recognize trap instructions other than
	"trap". For example, "tw 12, 4, 4" was not be recognized, causing GDB
	to loop forever.

	This commit fixes this by providing POWER specific hook
	(gdbarch_program_breakpoint_here_p) recognizing all tw, twi, td and tdi
	instructions.

	Tested on Linux on PowerPC e500 and on QEMU PPC64le.

2021-12-08  Jan Vrany  <jan.vrany@labware.com>

	ppc: use "trap" ("tw, 31, 0, 0") as breakpoint instruction
	Power ISA 3.0 B spec [1], sections 3.3.11 "Fixed-Point Trap Instructions"
	and section C.6 "Trap Mnemonics" specify "tw, 31, 0, 0" (encoded as
	0x7fe00008) as canonical unconditional trap instruction.

	This commit changes the breakpoint instruction used by GDB from
	"tw 12, r2, r2" to unconditional "trap".

	[1]: https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0

2021-12-08  Fangrui Song  <maskray@google.com>

	bfd_section_from_shdr: Support SHT_RELR sections
	If a.so contains an SHT_RELR section, objcopy a.so will fail with:

	    a.so: unknown type [0x13] section `.relr.dyn'

	This change allows objcopy to work.

	bfd/
	    * elf.c (bfd_section_from_shdr): Support SHT_RELR.

2021-12-08  Alan Modra  <amodra@gmail.com>

	PR28673, input file 'gcov' is the same as output file
		PR 28673
		* ldlang.c (open_output): Use local_sym_name when checking
		output against input files rather than filename.

2021-12-08  Tom Tromey  <tom@tromey.com>

	Fix bug in source.c change
	My earlier change to source.c ("Remove an xfree from add_path")
	introduced a regression.  This patch fixes the problem.

2021-12-08  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make struct linespect contain vectors, not pointers to vectors
	struct linespec contains pointers to vectors, instead of containing
	vectors directly.  This is probably historical, when linespec_parser
	(which contains a struct linespec field) was not C++-ified yet.  But it
	seems easy to change the pointers to vectors to just vectors today.
	This simplifies the code, we don't need to manually allocate and delete
	the vectors and there's no pointer that can be NULL.

	As far as I understand, there was not meaningful distinction between a
	NULL pointer to vector and an empty vector.  So all NULL checks are
	changed for !empty checks.

	Change-Id: Ie759707da14d9d984169b93233343a86e2de9ee6

2021-12-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-07  Tom Tromey  <tom@tromey.com>

	Remove an xfree from add_path
	This removes a temporary \0 assignment and an xfree from add_path,
	replacing it with a simpler use of std::string.

2021-12-07  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/linespec.c: simplify condition
	We can remove the empty check: if the vector has size 1, it is obviously
	not empty.  This code ended up like this because the empty check used to
	be a NULL check.

	Change-Id: I1571bd0228818ca93f6a6b444e9b010dc2da4c08

2021-12-07  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: rename "maint agent" functions
	Functions agent_eval_command and agent_command are used to implement
	maintenance commands, rename them accordingly (with the maint_ prefix),
	as well as the agent_command_1 helper function.

	Change-Id: Iacf96d4a0a26298e8dd4648a0f38da649ea5ef61

2021-12-07  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make set_raw_breakpoint static
	set_raw_breakpoint is only used in breakpoint.c, make it static.

	Change-Id: I7fbeda067685309a30b88aceaf957eff7a28e310

2021-12-07  John Baldwin  <jhb@FreeBSD.org>

	Support AT_FXRNG and AT_KPRELOAD on FreeBSD.
	FreeBSD's kernel has recently added two new ELF auxiliary vector
	entries.  AT_FXRNG points to a root seed version for the kernel's
	PRNG.  Userland can use this to reseed a userland PRNG after the
	kernel's PRNG has reseeded.  AT_KPRELOAD is the base address of a
	kernel-provided vDSO.

	This change displays the proper name and description of these entries
	in 'info auxv'.

	include/ChangeLog:

		* elf/common.h (AT_FREEBSD_FXRNG, AT_FREEBSD_KPRELOAD): Define.

2021-12-07  Tom Tromey  <tromey@adacore.com>

	Avoid extra work in global_symbol_searcher::expand_symtabs
	I noticed that global_symbol_searcher::expand_symtabs always passes a
	file matcher to expand_symtabs_matching.  However, if 'filenames' is
	empty, then this always returns true.  It's slightly more efficient to
	pass a null file matcher in this case, because that lets the "quick"
	symbol implementations skip any filename checks.

	Regression tested on x86-64 Fedora 34.

2021-12-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix options arg handling in compile_jit_elf_main_as_so
	In commit 80ad340c902 ("[gdb/testsuite] use -Ttext-segment for jit-elf tests")
	the following change was made:
	...
	 proc compile_jit_elf_main_as_so {main_solib_srcfile main_solib_binfile options} {
	-    set options [concat $options debug]
	+    global jit_load_address jit_load_increment
	+
	+    set options [list \
	+       additional_flags="-DMAIN=jit_dl_main" \
	+       additional_flags=-DLOAD_ADDRESS=$jit_load_address \
	+       additional_flags=-DLOAD_INCREMENT=$jit_load_increment \
	+       debug]
	...

	Before the change, the options argument was used, but after the change not
	anymore.

	Fix this by reverting back to using "set options [concat $options ...]".

	Fixing this gets us twice the -DMAIN=jit_dl_main bit, once from a caller, and
	once from compile_jit_elf_main_as_so.  Fix this by removing the bit from
	compile_jit_elf_main_as_so, which makes the code similar to compile_jit_main.

	Tested on x86_64-linux.

2021-12-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAIL in gdb.tui/basic.exp
	On openSUSE Leap 15.2 aarch64 I ran into:
	...
	FAIL: gdb.tui/basic.exp: check main is where we expect on the screen
	...
	while this is passing on x86_64.

	On x86_64-linux we have at the initial screen dump for "list -q main":
	...
	 0 +-/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.tui/tui-layout.c--+
	 1 |       15     You should have received a copy of the GNU General Public |
	 2 |       16     along with this program.  If not, see <http://www.gnu.org/|
	 3 |       17                                                               |
	 4 |       18  int                                                          |
	 5 |       19  main ()                                                      |
	 6 |       20  {                                                            |
	 7 |       21    return 0;                                                  |
	 8 |       22  }                                                            |
	 9 |       23                                                               |
	...
	but on aarch64:
	...
	 0 +-/home/tdevries/gdb/src/gdb/testsuite/gdb.tui/tui-layout.c--------------+
	 1 |       16     along with this program.  If not, see <http://www.gnu.org/|
	 2 |       17                                                               |
	 3 |       18  int                                                          |
	 4 |       19  main ()                                                      |
	 5 |       20  {                                                            |
	 6 |       21    return 0;                                                  |
	 7 |       22  }                                                            |
	 8 |       23                                                               |
	 9 |       24                                                               |
	...

	The cause of the diffferent placement is that we have as line number for main
	on x86_64:
	...
	$ gdb -q -batch outputs/gdb.tui/basic/basic -ex "info line main"
	Line 20 of "tui-layout.c" starts at address 0x4004a7 <main> \
	  and ends at 0x4004ab <main+4>.
	...
	and on aarch64 instead:
	...
	$ gdb -q -batch outputs/gdb.tui/basic/basic -ex "info line main"
	Line 21 of "tui-layout.c" starts at address 0x4005f4 <main> \
	  and ends at 0x4005f8 <main+4>.
	...

	Fix this by using a new source file main-one-line.c, that implements the
	entire main function on a single line, in order to force the compiler to use
	that line number.

	Also try to do less hard-coding in the test-case.

	Tested on x86_64-linux and aarch64-linux.

2021-12-07  Tom de Vries  <tdevries@suse.de>

	[gdb/tdep] Fix inferior plt calls in PIE for i386
	Consider test-case test.c:
	...
	int main (void) {
	  void *p = malloc (10);
	  return 0;
	}
	...

	When compiled to a non-PIE exec:
	...
	$ gcc -m32 test.c
	...
	the call sequence looks like:
	...
	 8048447:       83 ec 0c                sub    $0xc,%esp
	 804844a:       6a 0a                   push   $0xa
	 804844c:       e8 bf fe ff ff          call   8048310 <malloc@plt>
	...
	which calls to:
	...
	08048310 <malloc@plt>:
	 8048310:       ff 25 0c a0 04 08       jmp    *0x804a00c
	 8048316:       68 00 00 00 00          push   $0x0
	 804831b:       e9 e0 ff ff ff          jmp    8048300 <.plt>
	...
	where the first insn at 0x8048310 initially jumps to the following address
	0x8048316, read from the .got.plt @ 0x804a00c:
	...
	 804a000 0c9f0408 00000000 00000000 16830408  ................
	 804a010 26830408                             &...
	...

	Likewise, when compiled as a PIE:
	...
	$ gcc -m32 -fPIE -pie test.c
	...
	we have this call sequence (with %ebx setup to point to the .got.plt):
	...
	0000055d <main>:
	 579:   83 ec 0c                sub    $0xc,%esp
	 57c:   6a 0a                   push   $0xa
	 57e:   89 c3                   mov    %eax,%ebx
	 580:   e8 6b fe ff ff          call   3f0 <malloc@plt>
	...
	which calls to:
	...
	000003f0 <malloc@plt>:
	 3f0:   ff a3 0c 00 00 00       jmp    *0xc(%ebx)
	 3f6:   68 00 00 00 00          push   $0x0
	 3fb:   e9 e0 ff ff ff          jmp    3e0 <.plt>
	...
	where the insn at 0x3f0 initially jumps to following address 0x3f6, read from
	the .got.plt at offset 0xc:
	...
	 2000 f41e0000 00000000 00000000 f6030000  ................
	 2010 06040000                             ....
	...

	When instead doing an inferior call to malloc (with nosharedlib to force
	malloc to resolve to malloc@plt rather than the functions in ld.so or libc.so)
	with the non-PIE exec, we have the expected:
	...
	$ gdb -q -batch a.out -ex start -ex nosharedlib -ex "p /x (void *)malloc (10)"
	Temporary breakpoint 1 at 0x8048444

	Temporary breakpoint 1, 0x08048444 in main ()
	$1 = 0x804b160
	...

	But with the PIE exec, we run into:
	...
	$ gdb -q -batch a.out -ex start -ex nosharedlib -ex "p /x (void *)malloc (10)"
	Temporary breakpoint 1 at 0x56c

	Temporary breakpoint 1, 0x5655556c in main ()

	Program received signal SIGSEGV, Segmentation fault.
	0x565553f0 in malloc@plt ()
	...

	The segfault happens because:
	- the inferior call mechanism doesn't setup %ebx
	- %ebx instead is 0
	- the jump to "*0xc(%ebx)" reads from memory at 0xc

	Fix this by setting up %ebx properly in i386_thiscall_push_dummy_call.

	Fixes this failure with target board unix/-m32/-pie/-fPIE reported in
	PR28467:
	...
	FAIL: gdb.base/nodebug.exp: p/c (int) array_index("abcdef",2)
	...

	Tested on x86_64-linux, with target board unix/-m32 and unix/-m32/-fPIE/-pie.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28467

2021-12-07  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Support -readnow during reread
	When running test-case gdb.base/cached-source-file.exp with target board
	readnow, we run into:
	...
	FAIL: gdb.base/cached-source-file.exp: rerun program (the program exited)
	...

	The problem is that when rereading, the readnow is ignored.

	Fix this by copying the readnow handling code from symbol_file_add_with_addrs
	to reread_symbols.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26800

2021-12-07  Tom de Vries  <tdevries@suse.de>

	[gdb/ada] Fix assert in ada_is_unconstrained_packed_array_type
	On openSUSE Leap 42.3, with system compiler gcc 4.8.5 I run into:
	...
	(gdb) print u_one_two_three^M
	src/gdb/gdbtypes.h:1050: internal-error: field: \
	 Assertion `idx >= 0 && idx < num_fields ()' failed.^M
	...

	We run into trouble while doing this in
	ada_is_unconstrained_packed_array_type:
	...
	1953          return TYPE_FIELD_BITSIZE (type, 0) > 0;
	...
	which tries to get field 0 from a type without fields:
	...
	(gdb) p type->num_fields ()
	$6 = 0
	...
	which is the case because the type is a typedef:
	...
	(gdb) p type->code ()
	$7 = TYPE_CODE_TYPEDEF
	...

	Fix this by using the type referenced by the typedef instead.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28323

2021-12-07  Alan Modra  <amodra@gmail.com>

	Re: Add support for AArch64 EFI (efi-*-aarch64)
	Commit b69c9d41e8 was broken in multiple ways regarding the realloc
	of the target string, most notably in that "-little" wasn't actually
	appended to the input_target or output_target.  This caused asan
	errors and "FAIL: Check if efi app format is recognized".  I also
	noticed that the input_target string wasn't being copied but rather
	the output_target when dealing with the input target.  Fix that too.

		PR 26206
		* objcopy.c (convert_efi_target): Rewrite.  Allocate modified
		target strings here..
		(copy_main): ..rather than here.  Do handle input_target,
		not output_target for input.

2021-12-07  Alan Modra  <amodra@gmail.com>

	Error on ld output file name matching input file name
	It's not foolproof, for example we don't catch output to a linker
	script, to a library specified with -l, or to an element of a thin
	archive.

		* ldlang.c (open_output): Exit with error on output file matching
		an input file.
		* testsuite/ld-misc/just-symbols.exp: Adjust ld -r test to suit.

2021-12-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-06  Carl Love  <cel@us.ibm.com>

	gdb: Add PowerPC support to gdb.dwarf2/frame-inlined-in-outer-frame
	This patch adds an #elif defined for PowerPC to setup the exit_0 macro.
	This patch addes the needed macro definitionald logic to handle both elfV1
	and elfV2.

	The patch has been successfully tested on both PowerPC BE, Powerpc LE and
	X86_64 with no regressions.

2021-12-06  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use precise align in gdb.arch/i386-{avx,sse}.exp
	Test-cases gdb.arch/i386-{avx,sse}.exp use assembly instructions that require
	the memory operands to be aligned to a certain boundary, and the test-cases
	use C11's _Alignas to make that happen.

	The draw-back of using _Alignas is that while it does enforce a minimum
	alignment, the actual alignment may be bigger, which makes the following
	scenario possible:
	- copy say, gdb.arch/i386-avx.c as basis for a new test-case
	- run the test-case and observe a PASS
	- commit the new test-case in the supposition that the test-case is correct
	  and well-tested
	- run later into a failure on a different test setup (which may be a setup
	  where reproduction and investigation is more difficult and time-consuming),
	  and find out that the specified alignment was incorrect and should have been
	  updated to say, 64 bytes.  The initial PASS occurred only because the actual
	  alignment happened to be greater than required.

	The idea of having precise alignment as a means of having more predictable
	execution which allows flushing out bugs earlier, has been filed as PR
	gcc/103095.

	Add a new file lib/precise-aligned-alloc.c with functions
	precise_aligned_alloc and precise_aligned_dup, to support precise alignment.

	Use precise_aligned_dup in aforementioned test-cases to:
	- verify that the specified alignment is indeed sufficient, rather
	  than too little but accidentally over-aligned.
	- prevent the same type of problems in any new test-cases based on these

	Tested on x86_64-linux, with both gcc and clang.

2021-12-06  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix data alignment in gdb.arch/i386-{avx,sse}.exp
	When running test-case gdb.arch/i386-avx.exp with clang I ran into:
	...
	(gdb) PASS: gdb.arch/i386-avx.exp: set first breakpoint in main
	continue^M
	Continuing.^M
	^M
	Program received signal SIGSEGV, Segmentation fault.^M
	0x000000000040052b in main (argc=1, argv=0x7fffffffd3c8) at i386-avx.c:54^M
	54        asm ("vmovaps 0(%0), %%ymm0\n\t"^M
	(gdb) FAIL: gdb.arch/i386-avx.exp: continue to breakpoint: \
	  continue to first breakpoint in main
	...

	The problem is that the vmovaps insn requires an 256-bit (or 32-byte) aligned
	address, and it's only 16-byte aligned:
	...
	(gdb) p /x $rax
	$1 = 0x601030
	...

	Fix this by using a sufficiently aligned address, using _Alignas.

	Compile using -std=gnu11 to support _Alignas.

	Likewise in gdb.arch/i386-sse.exp.

	Tested on x86_64-linux, with both gcc and clang.

2021-12-06  Alan Modra  <amodra@gmail.com>

	[GOLD] PowerPC64 inline plt sequences
	The fixes gold failures to handle inline PLT sequences properly.
	PowerPC gold was always turning these back into direct calls due to
	gsym->use_plt_offset() returning false.  This is fixed for dynamic
	linking by correcting get_reference_flags, and for static linking by
	overriding use_plt_offset() in relocate().  The rest of the patch
	revolves around needing to create PLT entries for inline PLT calls
	when statically linking (for gcc -mlongcall).  The lplt section
	handled that for local symbols, now it does globals too.

		* powerpc.cc (Target_powerpc::plt_off): Return proper section
		for static link.
		(Target_powerpc::symval_for_branch): Make public.
		(Target_powerpc::make_lplt_section): Add Symbol_table* param.
		Adjust all calls.
		(Target_powerpc::make_local_plt_entry): Likewise.
		(Target_powerpc::make_local_plt_entry): New variant for global syms.
		(Powerpc_relobj::do_relocate_sections): Don't write lplt contents.
		(Output_data_plt_powerpc::do_write): Write lplt contents here.
		(Output_data_plt_powerpc::Output_data_plt_powerpc): Save
		symbol table pointer.  Adjust all uses.
		(Output_data_plt_powerpc::add_entry): Add stash parameter.  Don't
		do dynamic reloc handling when no reloc section.  Save symbol
		for local plt entries.
		(Output_data_plt_powerpc::add_local_entry): Save symbol.
		(Output_data_plt_powerpc::Local_plt_ent): New class.
		(Output_data_plt_powerpc::sym_ents_): New vector.
		(Target_powerpc::Scan::get_reference_flags): Return
		FUNCTION_CALL|RELATIVE_REF for inline plt relocs.
		(Target_powerpc::Scan::global): Make entries in lplt for inline
		plt call relocation symbols.
		(Target_powerpc::Relocate::relocate): Rename has_plt_offset to
		use_plt_offset.  Set use_plt_offset for inline plt relocs.

2021-12-06  Clément Chigot  <clement.chigot@atos.net>

	ld: improve shared tests for AIX
	It's now possible to refer symbols in the main program from the
	shared library. However, it still impossible to have the same
	overriden features between shared objects and mains than ELF,
	without using the runtime linking feature which isn't yet fully
	available.

	ld/ChangeLog:

		* testsuite/ld-shared/shared.exp: Improve XCOFF support
		* testsuite/ld-shared/main.c: Likewise.
		* testsuite/ld-shared/sh1.c: Likewise.
		* testsuite/ld-shared/xcoff.dat: Likewise.

2021-12-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-05  Tom Tromey  <tom@tromey.com>

	Preserve artificial CU name in process_psymtab_comp_unit_reader
	This fixes a use-after-free that Simon pointed out.
	process_psymtab_comp_unit_reader was allocating an artificial name for
	a CU, and then discarding it.  However, this name was preserved in the
	cached file_and_directory.  This patch arranges for the allocated name
	to be preserved there.

2021-12-05  Mike Frysinger  <vapier@gentoo.org>

	sim: include ansidecl.h when needed
	Avoid implicit include deps with this to help untangle sim headers
	so we can get rid of arch-specific sim-main.h.

	sim: include stdint.h when needed
	Avoid implicit include deps with this to help untangle sim headers
	so we can get rid of arch-specific sim-main.h.

	sim: include stdarg.h when used
	Avoid implicit include deps with this to help untangle sim headers
	so we can get rid of arch-specific sim-main.h.

2021-12-05  Mike Frysinger  <vapier@gentoo.org>

	sim: reorder header includes
	We're including system headers after local headers in a bunch of
	places, but this leads to conflicts when our local headers happen
	to define symbols that show up in the system headers.

	Use the more standard order of:
	* config.h (via defs.h)
	* system headers
	* local library headers (e.g. bfd & libiberty)
	* sim specific headers

2021-12-05  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: fix memory leak in create_file_handler when re-using file handler
	ASan made me notice a memory leak, where the memory tied to the file
	handle name string wasn't freed.  When register a file handler with an
	fd that is already registered, we re-use the file_handler object, so we
	ended up creating a new std::string object and overwriting the
	file_handler::name pointer, without free-ing the old std::string.

	Fix this by allocating file_handler with new, deleting it with
	delete, and making file_handler::name not a pointer.

	Change-Id: Ie304cc78ab5ae5dfad9a1366e9890c09de651f43

2021-12-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-04  Mike Frysinger  <vapier@gentoo.org>

	sim: moxie: hoist dtb rules up to common builds
	These rules don't depend on the target compiler settings, so hoist
	the build logic up to the common builds for better parallelization.

	sim: m68hc11: delete unused profile flags
	These were moved to the common configure script a while ago and have
	the same default as these, so just delete it.

	sim: msp430: delete redundant comments & settings
	These were copied from the example docs, so aren't adding any value.

	sim: erc32: drop old configure target
	There is no configure script in here anymore to regenerate.

	sim: m32c/rl78: drop redundant -Wall settings
	We already turn these on in the configure script.

2021-12-04  Tom Tromey  <tom@tromey.com>

	Cache the result of find_file_and_directory
	This changes the DWARF reader to cache the result of
	find_file_and_directory.  This is not especially important now, but it
	will help the new DWARF indexer.

	Move file_and_directory to new file and C++-ize
	This moves file_and_directory to a new file, and then C++-izes it --
	replacing direct assignments with methods, and arranging for it to own
	any string that must be computed.  Finally, the CU's objfile will only
	be used on demand; this is an important property for the new DWARF
	indexer's parallel mode.

	Remove Irix case from find_file_and_directory
	find_file_and_directory has a special case for the Irix 6.2 compiler.
	Since this is long obsolete, this patch removes it.

2021-12-04  Mike Frysinger  <vapier@gentoo.org>

	sim: frv: split up testsuite a bit
	Running frv's allinsn in serial is quite slow due to the sheer number
	of tests it contains.  By splitting it up and running in parallel, the
	execution time on my system goes from ~100sec to ~60sec.

2021-12-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: don't show deprecated aliases
	I don't think it's very useful to show deprecated aliases to the
	user.  It encourages the user to use them, when the goal is the
	opposite.

	For example, before:

	    (gdb) help set index-cache enabled
	    set index-cache enabled, set index-cache off, set index-cache on
	      alias set index-cache off = set index-cache enabled off
	      alias set index-cache on = set index-cache enabled on
	    Enable the index cache.
	    When on, enable the use of the index cache.

	    (gdb) help set index-cache on
	    Warning: 'set index-cache on', an alias for the command 'set index-cache enabled', is deprecated.
	    Use 'set index-cache enabled on'.

	    set index-cache enabled, set index-cache off, set index-cache on
	      alias set index-cache off = set index-cache enabled off
	      alias set index-cache on = set index-cache enabled on
	    Enable the index cache.
	    When on, enable the use of the index cache.

	After:

	    (gdb) help set index-cache enabled
	    Enable the index cache.
	    When on, enable the use of the index cache.
	    (gdb) help set index-cache on
	    Warning: 'set index-cache on', an alias for the command 'set index-cache enabled', is deprecated.
	    Use 'set index-cache enabled on'.

	    Enable the index cache.
	    When on, enable the use of the index cache.

	Change-Id: I989b618a5ad96ba975367e9d16db95523cd57a4c

2021-12-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: fix two "maint info line-table"-related tests
	Commit 92228a334ba2 ("gdb: small "maintenance info line-table"
	readability improvements") change the output format of "maint info
	line-table" slightly, adding some empty lines between each
	line-table.  This causes two tests to start failing, update them to
	account for those empty lines.

	Change-Id: I9d33a58fce3e860ba0554b25f5582e8066a5c519

2021-12-04  Simon Marchi  <simon.marchi@efficios.com>

	gdb: revert one array_view copy change in ada-lang.c
	Commit 4bce7cdaf481 ("gdbsupport: add array_view copy function") caused
	an internal error when running gdb.ada/packed_array_assign.exp:

	    print pra(1) := pr^M
	    /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/array-view.h:217: internal-error: copy: Assertion `dest.size () == src.size ()' failed.^M

	I am not sure what's the root cause of this, whether it is a GDB bug
	exposed by using the array_view copy function or not.  Back out the
	change that triggers the internal error for now, while we investigate
	it.

	Change-Id: I055ab14143e4cfd3ca7ce8f4855c6c3c05db52a7

2021-12-04  Mike Frysinger  <vapier@gentoo.org>

	bfd: unify header generation rules
	The logic between these rules are extremely similar, so unify them
	into a single variable.

2021-12-04  Mike Frysinger  <vapier@gentoo.org>

	bfd: move header updates up a directory
	The rules for rebuilding the bfd headers live in the doc/ subdir
	(most likely) because they rely on the chew & related tools.  But
	we can collapse them into the main Makefile while keeping the tools
	in the doc subdir easily enough.  This makes the code simpler and
	allows for rebuilding them in parallel.

	Also add automake silent rule support while we're here.

2021-12-04  Mike Frysinger  <vapier@gentoo.org>

	bfd: convert bfdver.h to silent automake rules

2021-12-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: small "maintenance info line-table" readability improvements
	 - separate each entry with a newline, to visually separate them
	 - style filenames with the filename style
	 - print the name of the compunit_symtab

	A header now looks like this, with the compunit_symtab name added (and
	the coloring, but you can't really see it here):

	    objfile: /home/simark/build/babeltrace/src/cli/.libs/babeltrace2 ((struct objfile *) 0x613000005980)
	    compunit_symtab: babeltrace2-cfg-cli-args.c ((struct compunit_symtab *) 0x62100da1ed10)
	    symtab: /usr/include/glib-2.0/glib/gdatetime.h ((struct symtab *) 0x62100d9ee530)
	    linetable: ((struct linetable *) 0x0):

	Change-Id: Idc23e10aaa66e2e692adb0a6a74144f72c4fa1c7

2021-12-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: change some alias functions parameters to const-reference
	Now that we use intrusive list to link aliases, it becomes easier to
	pass cmd_list_element arguments by const-reference rather than by
	pointer to some functions, change a few.

	Change-Id: Id0df648ed26e9447da0671fc2c858981cda31df8

2021-12-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: use intrusive_list for cmd_list_element aliases list
	Change the manually-implemented linked list to use intrusive_list.  This
	is not strictly necessary, but it makes the code much simpler.

	Change-Id: Idd08090ebf2db8bdcf68e85ef72a9635f1584ccc

2021-12-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: trivial changes to use array_view
	Change a few relatively obvious spots using value contents to propagate
	the use array_view a bit more.

	Change-Id: I5338a60986f06d5969fec803d04f8423c9288a15

2021-12-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make extract_integer take an array_view
	I think it would make sense for extract_integer, extract_signed_integer
	and extract_unsigned_integer to take an array_view.  This way, when we
	extract an integer, we can validate that we don't overflow the buffer
	passed by the caller (e.g. ask to extract a 4-byte integer but pass a
	2-byte buffer).

	 - Change extract_integer to take an array_view
	 - Add overloads of extract_signed_integer and extract_unsigned_integer
	   that take array_views.  Keep the existing versions so we don't
	   need to change all callers, but make them call the array_view
	   versions.

	This shortens some places like:

	  result = extract_unsigned_integer (value_contents (result_val).data (),
					     TYPE_LENGTH (value_type (result_val)),
					     byte_order);

	into

	  result = extract_unsigned_integer (value_contents (result_val), byte_order);

	value_contents returns an array view that is of length
	`TYPE_LENGTH (value_type (result_val))` already, so the length is
	implicitly communicated through the array view.

	Change-Id: Ic1c1f98c88d5c17a8486393af316f982604d6c95

2021-12-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: add array_view copy function
	An assertion was recently added to array_view::operator[] to ensure we
	don't do out of bounds accesses.  However, when the array_view is copied
	to or from using memcpy, it bypasses that safety.

	To address this, add a `copy` free function that copies data from an
	array view to another, ensuring that the destination and source array
	views have the same size.  When copying to or from parts of an
	array_view, we are expected to use gdb::array_view::slice, which does
	its own bounds check.  With all that, any copy operation that goes out
	of bounds should be caught by an assertion at runtime.

	copy is implemented using std::copy and std::copy_backward, which, at
	least on libstdc++, appears to pick memmove when copying trivial data.
	So in the end there shouldn't be much difference vs using a bare memcpy,
	as we do right now.  When copying non-trivial data, std::copy and
	std::copy_backward assigns each element in a loop.

	To properly support overlapping ranges, we must use std::copy or
	std::copy_backward, depending on whether the destination is before the
	source or vice-versa.  std::copy and std::copy_backward don't support
	copying exactly overlapping ranges (where the source range is equal to
	the destination range).  But in this case, no copy is needed anyway, so
	we do nothing.

	The order of parameters of the new copy function is based on std::copy
	and std::copy_backward, where the source comes before the destination.

	Change a few randomly selected spots to use the new function, to show
	how it can be used.

	Add a test for the new function, testing both with arrays of a trivial
	type (int) and of a non-trivial type (foo).  Test non-overlapping
	ranges as well as three kinds of overlapping ranges: source before dest,
	dest before source, and dest == source.

	Change-Id: Ibeaca04e0028410fd44ce82f72e60058d6230a03

2021-12-03  Simon Marchi  <simon.marchi@efficios.com>

	gdb: change store_waitstatus to return a target_waitstatus by value
	store_waitstatus is basically a translation function between a status
	integer and an equivalent target_waitstatus object.  It would make sense
	for it to take the integer as a parameter and return the
	target_waitstatus by value.  Do that, and rename to
	host_status_to_waitstatus.  Users can then do:

	  ws = host_status_to_waitstatus (status)

	which does the right thing, given the move constructor of
	target_waitstatus.

	Change-Id: I7a07d59d3dc19d3ed66929642f82f44f3e85d61b

2021-12-03  Simon Marchi  <simon.marchi@efficios.com>

	gdb: return *this in target_waitstatus setters
	While playing with some code creating target_waitstatus objects, I was
	mildly annoyed by the fact that we can't just return a new
	target_waitstatus object.  We have to do:

	    target_waitstatus ws;
	    ws.set_exited (123);
	    return ws;

	Make the setters return the "this" object as a reference, such that it's
	possible to do:

	    return target_waitstatus ().set_exited (123);

	I initially thought of adding static creation functions, which you would
	use like:

	    return target_waitstatus::make_exited (123);

	However, making the setters return a reference to the object achieves
	pretty much the same thing, with less new code.

	Change-Id: I45159b7f9fcd9db5b20603480e323020b14ed147

2021-12-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make saved_filename an std::string
	Make this variable an std::string, avoiding manual memory management.

	Change-Id: Ie7a8d7381449ab9c4dfc4cb8b99e63b9ffa8f947

2021-12-03  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Fix uninitialised memory
	AARCH64_OPDE_EXPECTED_A_AFTER_B and AARCH64_OPDE_A_SHOULD_FOLLOW_B
	are not paired with an error string, but we had an assert that the
	error was nonnull.  Previously this assert was testing uninitialised
	memory and so could pass or fail arbitrarily.

	opcodes/
		* aarch64-opc.c (verify_mops_pme_sequence): Initialize the error
		field to null for AARCH64_OPDE_EXPECTED_A_AFTER_B and
		AARCH64_OPDE_A_SHOULD_FOLLOW_B.
		* aarch64-dis.c (print_verifier_notes): Move assert.

2021-12-03  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: make value_subscripted_rvalue static
	The function value_subscripted_rvalue is only used in valarith.c, so
	lets make it a static function.

	There should be no user visible change after this commit.

2021-12-03  Andrew Burgess  <aburgess@redhat.com>

	gdb/testsuite: give a test a real name
	A test in gdb.python/py-send-packet.exp added in this commit:

	  commit 24b2de7b776f8f23788d855b1eec290c6e208821
	  Date:   Tue Aug 31 14:04:36 2021 +0100

	      gdb/python: add gdb.RemoteTargetConnection.send_packet

	included a large amount of binary data in the command sent to GDB.  As
	this test didn't have a real test name the binary data was included in
	the gdb.sum file.  The contents of the binary data could change
	between different runs of GDB, and this makes comparing results
	harder.

	This commit gives the test a real test name.

2021-12-03  Andrew Burgess  <aburgess@redhat.com>

	gdb/remote: fix use after free bug
	This commit:

	  commit 288712bbaca36bff6578bc839ebcdc3707662f81
	  Date:   Mon Nov 22 15:16:27 2021 +0000

	      gdb/remote: use scoped_restore to control starting_up flag

	introduced a use after free bug.  The scoped restore added in the
	above commit resets a flag within a remote_target's remote_state
	object.

	However, in some situations, the remote_target can be unpushed before
	the error is thrown.  If the only reference to the target is the one
	in the target stack, then unpushing the target will cause the
	remote_target to be deleted, which, in turn, will delete the
	remote_state object.  The scoped restore will then try to reset the
	flag within a deleted object.

	This problem was caught in the gdb.server/server-connect.exp test,
	which, when run with the address sanitizer enabled, highlights the
	write after free bug described above.

	This commit resolves this issue by adding a new class specifically for
	the purpose of managing the starting_up flag.  As well as setting, and
	then clearing the starting_up flag, this new class increments, and
	then decrements the reference count on the remote_target object.  This
	prevents the remote_target from being deleted until after the flag has
	been reset.

	The gdb.server/server-connect.exp now runs cleanly with the address
	sanitizer enabled.

2021-12-03  Mike Frysinger  <vapier@gentoo.org>

	libctf: workaround automake bug with conditional info pages
	It looks like automake makes assumptions about its ability to build info
	pages based on the GNU standard behavior of shipping info pages with the
	distributions.  So even though the info pages were conditionalized, and
	automake disabled some of the targets, it was still creeping in by way
	of unconditional INFO_DEPS settings.

	We can workaround this by adding a stub target for the info page when
	building info pages are disabled.  This tricks automake into disabling
	its own extended generation target.  I'll follow up with the automake
	folks to see what they think.

2021-12-03  Chenghua Xu  <xuchenghua@loongson.cn>

	Add myself and Zhensong Liu as the LoongArch port maintainer.

2021-12-03  Alan Modra  <amodra@gmail.com>

	Revert "Re: Don't compile some opcodes files when bfd is 32-bit only"
	This reverts commit 7a53275579e7cec9389ccb924f5ecf69e8d89d41.
	The bpf sim doesn't work with a 32-bit bfd after all.

2021-12-03  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-02  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove unexpected xstrdup in _initialize_maint_test_settings
	That xstrdup is not correct, since we are assigning an std::string.  The
	result of xstrdup is used to initialize the string, and then lost
	forever.  Remove it.

	Change-Id: Ief7771055e4bfd643ef3b285ec9fb7b1bfd14335

2021-12-02  Nick Clifton  <nickc@redhat.com>

	Fix illegal memory access whilst parsing corrupt DWARF debug information.
		PR 28645
		* dwarf.c (process_cu_tu_index): Add test for overruning section
		whilst processing slots.

2021-12-02  Tom de Vries  <tdevries@suse.de>

	[gdb/tdep] Fix avx512 -m32 support in gdbserver
	PR27257 reports a problem that can be reproduced as follows:
	- use x86_64 machine with avx512 support
	- compile a hello world with -m32 to a.out
	- start a gdbserver session with a.out
	- use gdb to connect to the gdbserver session

	This makes us run into:
	...
	Listening on port 2346
	Remote debugging from host ::1, port 34940
	src/gdbserver/regcache.cc:257: \
	  A problem internal to GDBserver has been detected.
	Unknown register zmm16h requested
	...

	The problem is that i387_xsave_to_cache in gdbserver/i387-fp.cc can't find a
	register zmm16h in the register cache.

	To understand how this happens, first some background.

	SSE has 16 128-bit wide xmm registers.

	AVX extends the SSE registers set as follows:
	- it extends the 16 existing 128-bit wide xmm registers to 256-bit wide ymm
	  registers.

	AVX512 extends the AVX register set as follows:
	- it extends the 16 existing 256-bit wide ymm registers to 512-bit wide zmm
	  registers.
	- it adds 16 additional 512-bit wide zmm registers (with corresponding ymm and
	  xmm subregisters added as well)

	However, in 32-bit mode, there are only 8 xmm/ymm/zmm registers.

	The problem we're running into is that gdbserver/i387-fp.cc uses these
	constants to describe the size of the register file:
	...
	static const int num_avx512_zmmh_low_registers = 16;
	static const int num_avx512_zmmh_high_registers = 16;
	static const int num_avx512_ymmh_registers = 16;
	static const int num_avx512_xmm_registers = 16;
	...
	which are all incorrect for the 32-bit case.

	Fix this by replacing the constants with variables that have the appropriate
	values in 64-bit and 32-bit mode.

	Tested on x86_64-linux with native and unix/-m32.

2021-12-02  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: update tests looking for "DWARF 2" debug format
	Commit ab557072b8ec ("gdb: use actual DWARF version in compunit's
	debugformat field") changes the debug format string in "info source" to
	show the actual DWARF version, rather than always show "DWARF 2".

	However, it failed to consider that some tests checked for the "DWARF 2"
	string to see if the test program is compiled with DWARF debug
	information.  Since everything is compiled with DWARF 4 or 5 nowadays,
	that changed the behavior of those tests.  Notably, it prevent the
	tests using skip_inline_var_tests to run.

	Grep through the testsuite for "DWARF 2" and change all occurrences I
	could find to use "DWARF [0-9]" instead (that string is passed to TCL's
	string match).

	Change-Id: Ic7fb0217fb9623880c6f155da6becba0f567a885

2021-12-02  Joel Brobecker  <brobecker@adacore.com>

	(PPC64) fix handling of fixed-point values when using "return" command
	In the gdb.ada/fixed_points_function.exp testcase, we have the following
	Ada code...

	   type FP1_Type is delta 0.1 range -1.0 .. +1.0; --  Ordinary
	   function Call_FP1 (F : FP1_Type) return FP1_Type is
	   begin
	      FP1_Arg := F;
	      return FP1_Arg;
	   end Call_FP1;

	... used as follow:

	   F1 : FP1_Type := 1.0;
	   F1 := Call_FP1 (F1);

	The testcase, among other things, verifies that "return" works
	properly as follow:

	    | (gdb) return 1.0
	    | Make pck.call_fp1 return now? (y or n) y
	    | [...]
	    | 9          F1 := Call_FP1 (F1);
	    | (gdb) next
	    | (gdb) print f1
	    | $1 = 0.0625

	The output of the last command shows that we returned the wrong
	value. The value printed gives a clue about the problem, since
	it is 1/16th of the value we expected, where 1/16 is FP1_Type's
	scaling factor.

	The problem, here, comes from the fact that the function
	handling return values for base types (ppc64_sysv_abi_return_value_base)
	writes the return value using unpack_long which, upon seeing that
	the value being unpacked is a fixed point type, applies the scaling
	factor, to get the integer-representation of our fixed-point value
	(similar to what it does with floats, for instance).

	So, the fix consists in teaching ppc64_sysv_abi_return_value_base
	about fixed-point types, and to avoid the unwanted application
	of the scaling factor.

	Note that the "finish" function, on the other hand, does not
	suffer from this issue, simply becaue the value returned by
	the function is read from register without the use of a type,
	thus avoiding an unwanted application of a scaling factor.

	No test added, as this change is already tested by
	gdb.ada/fixed_points_function.exp.

	Co-Authored-By: Tristan Gingold <gingold@adacore.com>

2021-12-02  Joel Brobecker  <brobecker@adacore.com>

	(RISCV) fix handling of fixed-point type return values
	This commit adds support for TYPE_CODE_FIXED_POINT types for
	"finish" and "return" commands.

	Consider the following Ada code...

	   type FP1_Type is delta 0.1 range -1.0 .. +1.0; --  Ordinary
	   function Call_FP1 (F : FP1_Type) return FP1_Type is
	   begin
	      FP1_Arg := F;
	      return FP1_Arg;
	   end Call_FP1;

	... used as follow:

	   F1 : FP1_Type := 1.0;
	   F1 := Call_FP1 (F1);

	"finish" currently behaves as follow:

	    | (gdb) finish
	    | [...]
	    | Value returned is $1 = 0

	We expect the returned value to be "1".

	Similarly, "return" makes the function return the wrong value:

	    | (gdb) return 1.0
	    | Make pck.call_fp1 return now? (y or n) y
	    | [...]
	    | 9          F1 := Call_FP1 (F1);
	    | (gdb) next
	    | (gdb) print f1
	    | $1 = 0.0625

	(we expect it to print "1" instead).

	This problem comes from the handling of integral return values
	when the return value is actually fixed point type. Our type
	here is actually a range of a fixed point type, but the same
	principles should also apply to pure fixed-point types. For
	the record, here is what the debugging info looks like:

	 <1><238>: Abbrev Number: 2 (DW_TAG_subrange_type)
	    <239>   DW_AT_lower_bound : -16
	    <23a>   DW_AT_upper_bound : 16
	    <23b>   DW_AT_name        : pck__fp1_type
	    <23f>   DW_AT_type        : <0x248>

	 <1><248>: Abbrev Number: 4 (DW_TAG_base_type)
	    <249>   DW_AT_byte_size   : 1
	    <24a>   DW_AT_encoding    : 13      (signed_fixed)
	    <24b>   DW_AT_binary_scale: -4
	    <24c>   DW_AT_name        : pck__Tfp1_typeB
	    <250>   DW_AT_artificial  : 1

	... where the scaling factor is 1/16.

	Looking at the "finish" command, what happens is that riscv_arg_location
	determines that our return value should be returned by parameter using
	an integral convention (via builtin type long). And then,
	riscv_return_value uses a cast to that builtin type long to
	store the value of into a buffer with the right register size.
	This doesn't work in our case, because the underlying value
	returned by the function is unscaled, which means it is 16,
	and thus the cast is like doing:

	   arg_val = (FP1_Type) 16

	... In other words, it is trying to create an FP1_Type enty whose
	value is 16. Applying the scaling factor, that's 256, and because
	the size of FP1_Type is 1 byte, we overflow and thus it ends up
	being zero.

	The same happen with the "return" function, but the other way around.

	The fix consists in handling fixed-point types separately from
	integral types.

2021-12-02  Joel Brobecker  <brobecker@adacore.com>

	(ARM/fixed-point) wrong value shown by "finish" command:
	Consider the following Ada code:

	   type FP1_Type is delta 0.1 range -1.0 .. +1.0; --  Ordinary
	   FP1_Arg : FP1_Type := 0.0;

	   function Call_FP1 (F : FP1_Type) return FP1_Type is
	   begin
	      FP1_Arg := F;
	      return FP1_Arg;
	   end Call_FP1;

	After having stopped inside function Call_FP1 as follow:

	    Breakpoint 1, pck.call_fp1 (f=1) at /[...]/pck.adb:5
	    5             FP1_Arg := F;

	Returning from that function call using "finish" should show
	that the function return "1.0" (the same value as was passed
	as an argument). However, this is not the case:

	    (gdb) finish
	    Run till exit from #0  pck.call_fp1 (f=1)
	    [...]
	    9          F1 := Call_FP1 (F1);
	    Value returned is $1 = 0

	This patch enhances the extraction of the return value to know about
	fixed point types.

2021-12-02  Xavier Roirand  <roirand@adacore.com>

	(Ada/AArch64) fix fixed point argument passing in inferior funcall
	Consider the following code:

	   type FP1_Type is delta 0.1 range -1.0 .. +1.0; --  Ordinary

	   function Call_FP1 (F : FP1_Type) return FP1_Type is
	   begin
	      return F;
	   end Call_FP1;

	When the default in GCC is to generate proper DWARF info for fixed point
	types, then in gdb, printing the result of a call to call_fp1 with a
	decimal parameter leads to:

	  (gdb) p call_fp1(0.5)
	  $1 = 0

	The displayed value is wrong, and we actually expected:

	  (gdb) p call_fp1(0.5)
	  $1 = 0.5

	What happened is that our fixed point type parameter got promoted to a
	32bit integer because we detected that the length of that object was less
	than 4 bytes. The compiler does not perform this promotion and therefore
	GDB should not either.

	This patch fixes the behavior described above.

2021-12-02  Tom Tromey  <tromey@adacore.com>

	Implement 'task apply'
	This adds a 'task apply' command, which is the Ada tasking analogue of
	'thread apply'.  Unlike 'thread apply', it doesn't offer the
	'ascending' flag; but otherwise it's essentially the same.

	Add "task" keyword to the "watch" command
	Breakpoints in gdb can be made specific to an Ada task using the
	"task" qualifier.  This patch applies this same idea to watchpoints.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Update gas/NEWS for recent changes
	gas/
		* NEWS: Mention support for Armv8.8-A and for new system registers.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add BC instruction
	This patch adds support for the Armv8.8-A BC instruction.
	[https://developer.arm.com/documentation/ddi0596/2021-09/Base-Instructions/BC-cond--Branch-Consistent-conditionally-?lang=en]

	include/
		* opcode/aarch64.h (AARCH64_FEATURE_HBC): New macro.
		(AARCH64_ARCH_V8_8): Make armv8.8-a imply AARCH64_FEATURE_HBC.

	opcodes/
		* aarch64-tbl.h (aarch64_feature_hbc): New variable.
		(HBC, HBC_INSN): New macros.
		(aarch64_opcode_table): Add BC.C.
		* aarch64-dis-2.c: Regenerate.

	gas/
		* doc/c-aarch64.texi: Document +hbc.
		* config/tc-aarch64.c (aarch64_features): Add "hbc".
		* testsuite/gas/aarch64/hbc.s, testsuite/gas/aarch64/hbc.d: New test.
		* testsuite/gas/aarch64/hbc-invalid.s,
		testsuite/gas/aarch64/hbc-invalid.l,
		testsuite/gas/aarch64/hbc-invalid.d: New test.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Enforce P/M/E order for MOPS instructions
	The MOPS instructions should be used as a triple, such as:

	       cpyfp [x0]!, [x1]!, x2!
	       cpyfm [x0]!, [x1]!, x2!
	       cpyfe [x0]!, [x1]!, x2!

	The registers should also be the same for each writeback operand.
	This patch adds a warning for code that doesn't follow this rule,
	along similar lines to the warning that we already emit for
	invalid uses of MOVPRFX.

	include/
		* opcode/aarch64.h (C_SCAN_MOPS_P, C_SCAN_MOPS_M, C_SCAN_MOPS_E)
		(C_SCAN_MOPS_PME): New macros.
		(AARCH64_OPDE_A_SHOULD_FOLLOW_B): New aarch64_operand_error_kind.
		(AARCH64_OPDE_EXPECTED_A_AFTER_B): Likewise.
		(aarch64_operand_error): Make each data value a union between
		an int and a string.

	opcodes/
		* aarch64-tbl.h (MOPS_CPY_OP1_OP2_INSN): Add scan flags.
		(MOPS_SET_OP1_OP2_INSN): Likewise.
		* aarch64-opc.c (set_out_of_range_error): Update after change to
		aarch64_operand_error.
		(set_unaligned_error, set_reg_list_error): Likewise.
		(init_insn_sequence): Use a 3-instruction sequence for
		MOPS P instructions.
		(verify_mops_pme_sequence): New function.
		(verify_constraints): Call it.
		* aarch64-dis.c (print_verifier_notes): Handle
		AARCH64_OPDE_A_SHOULD_FOLLOW_B and AARCH64_OPDE_EXPECTED_A_AFTER_B.

	gas/
		* config/tc-aarch64.c (operand_mismatch_kind_names): Add entries
		for AARCH64_OPDE_A_SHOULD_FOLLOW_B and AARCH64_OPDE_EXPECTED_A_AFTER_B.
		(operand_error_higher_severity_p): Check that
		AARCH64_OPDE_A_SHOULD_FOLLOW_B and AARCH64_OPDE_EXPECTED_A_AFTER_B
		come between AARCH64_OPDE_RECOVERABLE and AARCH64_OPDE_SYNTAX_ERROR;
		their relative order is not significant.
		(record_operand_error_with_data): Update after change to
		aarch64_operand_error.
		(output_operand_error_record): Likewise.  Handle
		AARCH64_OPDE_A_SHOULD_FOLLOW_B and AARCH64_OPDE_EXPECTED_A_AFTER_B.
		* testsuite/gas/aarch64/mops_invalid_2.s,
		testsuite/gas/aarch64/mops_invalid_2.d,
		testsuite/gas/aarch64/mops_invalid_2.l: New test.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add support for +mops
	This patch adds support for FEAT_MOPS, an Armv8.8-A extension
	that provides memcpy and memset acceleration instructions.

	I took the perhaps controversial decision to generate the individual
	instruction forms using macros rather than list them out individually.
	This becomes useful with a follow-on patch to check that code follows
	the correct P/M/E sequence.
	[https://developer.arm.com/documentation/ddi0596/2021-09/Base-Instructions?lang=en]

	include/
		* opcode/aarch64.h (AARCH64_FEATURE_MOPS): New macro.
		(AARCH64_ARCH_V8_8): Make armv8.8-a imply AARCH64_FEATURE_MOPS.
		(AARCH64_OPND_MOPS_ADDR_Rd): New aarch64_opnd.
		(AARCH64_OPND_MOPS_ADDR_Rs): Likewise.
		(AARCH64_OPND_MOPS_WB_Rn): Likewise.

	opcodes/
		* aarch64-asm.h (ins_x0_to_x30): New inserter.
		* aarch64-asm.c (aarch64_ins_x0_to_x30): New function.
		* aarch64-dis.h (ext_x0_to_x30): New extractor.
		* aarch64-dis.c (aarch64_ext_x0_to_x30): New function.
		* aarch64-tbl.h (aarch64_feature_mops): New feature set.
		(aarch64_feature_mops_memtag): Likewise.
		(MOPS, MOPS_MEMTAG, MOPS_INSN, MOPS_MEMTAG_INSN)
		(MOPS_CPY_OP1_OP2_PME_INSN, MOPS_CPY_OP1_OP2_INSN, MOPS_CPY_OP1_INSN)
		(MOPS_CPY_INSN, MOPS_SET_OP1_OP2_PME_INSN, MOPS_SET_OP1_OP2_INSN)
		(MOPS_SET_INSN): New macros.
		(aarch64_opcode_table): Add MOPS instructions.
		(aarch64_opcode_table): Add entries for AARCH64_OPND_MOPS_ADDR_Rd,
		AARCH64_OPND_MOPS_ADDR_Rs and AARCH64_OPND_MOPS_WB_Rn.
		* aarch64-opc.c (aarch64_print_operand): Handle
		AARCH64_OPND_MOPS_ADDR_Rd, AARCH64_OPND_MOPS_ADDR_Rs and
		AARCH64_OPND_MOPS_WB_Rn.
		(verify_three_different_regs): New function.
		* aarch64-asm-2.c: Regenerate.
		* aarch64-dis-2.c: Likewise.
		* aarch64-opc-2.c: Likewise.

	gas/
		* doc/c-aarch64.texi: Document +mops.
		* config/tc-aarch64.c (parse_x0_to_x30): New function.
		(parse_operands): Handle AARCH64_OPND_MOPS_ADDR_Rd,
		AARCH64_OPND_MOPS_ADDR_Rs and AARCH64_OPND_MOPS_WB_Rn.
		(aarch64_features): Add "mops".
		* testsuite/gas/aarch64/mops.s, testsuite/gas/aarch64/mops.d: New test.
		* testsuite/gas/aarch64/mops_invalid.s,
		* testsuite/gas/aarch64/mops_invalid.d,
		* testsuite/gas/aarch64/mops_invalid.l: Likewise.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add Armv8.8-A system registers
	Armv8.8-A defines two new system registers: allint and icc_nmiar1_el1.
	Both of them were previously unmapped.  allint supports a 0/1 immediate.
	[https://developer.arm.com/documentation/ddi0595/2021-09/AArch64-Registers/ALLINT--All-Interrupt-Mask-Bit?lang=en]
	[https://developer.arm.com/documentation/ddi0595/2021-09/AArch64-Registers/ICC-NMIAR1-EL1--Interrupt-Controller-Non-maskable-Interrupt-Acknowledge-Register-1?lang=en]

	opcodes/
		* aarch64-opc.c (SR_V8_8): New macro.
		(aarch64_sys_regs): Add allint and icc_nmiar1_el1.
		(aarch64_pstatefields): Add allint.

	gas/
		* testsuite/gas/aarch64/armv8_8-a-sysregs.s,
		* testsuite/gas/aarch64/armv8_8-a-sysregs.d: New test.
		* testsuite/gas/aarch64/armv8_8-a-sysregs-invalid.s,
		* testsuite/gas/aarch64/armv8_8-a-sysregs-invalid.l,
		* testsuite/gas/aarch64/armv8_8-a-sysregs-invalid.d: New test.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add id_aa64isar2_el1
	Armv8.8-A defines a read-only system register called id_aa64isar2_el1.
	The register was previously RES0 and should therefore be accepted
	at all architecture levels.
	[https://developer.arm.com/documentation/ddi0595/2021-09/AArch64-Registers/ID-AA64ISAR2-EL1--AArch64-Instruction-Set-Attribute-Register-2?lang=en]

	opcodes/
		* aarch64-opc.c (aarch64_sys_regs): Add id_aa64isar2_el1.

	gas/
		* testsuite/gas/aarch64/sysreg-diagnostic.s: Test writes to
		id_aa64isar2_el1.
		* testsuite/gas/aarch64/sysreg-diagnostic.d: Update accordingly.
		* testsuite/gas/aarch64/sysreg-diagnostic.l: Likewise.
		* testsuite/gas/aarch64/sysreg.s: Test reads from
		id_aa64isar2_el1.
		* testsuite/gas/aarch64/sysreg.d: Update accordingly.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add support for Armv8.8-A
	This patch adds skeleton support for -march=armv8.8-a, testing only
	that it correctly inherits from armv8.7-a.

	include/
		* opcode/aarch64.h (AARCH64_FEATURE_V8_8): New macro.
		(AARCH64_ARCH_V8_8): Likewise.

	gas/
		* doc/c-aarch64.texi: Document armv8.8-a.
		* config/tc-aarch64.c (aarch64_archs): Add armv8-8-a
		* testsuite/gas/aarch64/v8-8-a.s,
		* testsuite/gas/aarch64/v8-8-a.d: New test.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Provide line info for unclosed sequences
	We warn about MOVPRFX instructions that have no following
	instruction.  This patch adds a line number to the message,
	which is useful if the assembly code has multiple text sections.

	The new code is unconditional since OBJ_ELF is always defined
	for aarch64.

	gas/
		* config/tc-aarch64.h (aarch64_segment_info_type): Add last_file
		and last_line.
		* config/tc-aarch64.c (now_instr_sequence): Delete.
		(force_automatic_sequence_close): Provide a line number when
		reporting unclosed sequences.
		(md_assemble): Record the location of the instruction in
		tc_segment_info.
		* testsuite/gas/aarch64/sve-movprfx_4.l: Add line number to error
		message.
		* testsuite/gas/aarch64/sve-movprfx_7.l: Likewise.
		* testsuite/gas/aarch64/sve-movprfx_8.l: Likewise.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Tweak insn sequence code
	libopcodes has some code to check constraints across sequences
	of consecutive instructions.  It was added to support MOVPRFX
	sequences but is going to be useful for the Armv8.8-A MOPS
	feature as well.

	Currently the structure has one field to record the instruction
	that started a sequence and another to record the remaining
	instructions in the sequence.  It's more convenient for the
	MOPS code if we put the instructions into a single array instead.

	No functional change intended.

	include/
		* opcode/aarch64.h (aarch64_instr_sequence): Replace num_insns
		and current_insns with num_added_insns and num_allocated_insns.

	opcodes/
		* aarch64-opc.c (add_insn_to_sequence): New function.
		(init_insn_sequence): Update for new aarch64_instr_sequence layout.
		Add the first instruction to the inst array.
		(verify_constraints): Update for new aarch64_instr_sequence layout.
		Don't add the last instruction to the array.

2021-12-02  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add maximum immediate value to aarch64_sys_reg
	The immediate form of MSR has a 4-bit immediate field (in CRm).
	However, many forms of MSR require a smaller immediate.  These cases
	are identified by value in operand_general_constraint_met_p,
	but they're now the common case rather than the exception.

	This patch therefore adds the maximum value to the sys_reg
	description and gets the range from there.  It also enforces
	the minimum of 0, which avoids a situation in which:

	  msr dit, #2

	would give the expected:

	  Error: immediate value out of range 0 to 1

	whereas:

	  msr dit, #-1

	would give:

	  Error: immediate value out of range 0 to 15

	(from the later UIMM4 checking).

	Also:

	- we were reporting the first error above against the wrong operand
	- TCO takes a single-bit immediate, but we previously allowed
	  all 16 values.
	  [https://developer.arm.com/documentation/ddi0596/2021-09/Base-Instructions/MSR--immediate---Move-immediate-value-to-Special-Register-?lang=en]

	opcodes/
		* aarch64-opc.h (F_REG_MAX_VALUE, F_GET_REG_MAX_VALUE): New macros.
		* aarch64-opc.c (operand_general_constraint_met_p): Read the
		maximum MSR immediate value from aarch64_pstatefields.
		(aarch64_pstatefields): Add the maximum immediate value
		for each register.

	gas/
		* testsuite/gas/aarch64/sysreg-4.s: Use an immediate value of 1
		rather than 8 for the TCO test.
		* testsuite/gas/aarch64/sysreg-4.d: Update accordingly.
		* testsuite/gas/aarch64/armv8_2-a-illegal.l: Fix operand number
		in MSR immediate error messages.
		* testsuite/gas/aarch64/diagnostic.l: Likewise.
		* testsuite/gas/aarch64/pan-illegal.l: Likewise.
		* testsuite/gas/aarch64/ssbs-illegal1.l: Likewise.
		* testsuite/gas/aarch64/illegal-sysreg-4b.s,
		* testsuite/gas/aarch64/illegal-sysreg-4b.d,
		* testsuite/gas/aarch64/illegal-sysreg-4b.l: New test.

2021-12-02  Marcus Nilsson  <brainbomb@gmail.com>

	Allow the --visualize-jumps feature to work with the AVR disassembler.
		* avr-dis.c (avr_operand); Pass in disassemble_info and fill
		in insn_type on branching instructions.

2021-12-02  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb, include: replace pragmas with DIAGNOSTIC macros, fix build with g++ 4.8
	When introducing this code, I forgot that we had some macros for this.
	Replace some "manual" pragma diagnostic with some DIAGNOSTIC_* macros,
	provided by include/diagnostics.h.

	In diagnostics.h:

	 - Add DIAGNOSTIC_ERROR, to enable a diagnostic at error level.
	 - Add DIAGNOSTIC_ERROR_SWITCH, to enable -Wswitch at error level, for
	   both gcc and clang.

	Additionally, using DIAGNOSTIC_PUSH, DIAGNOSTIC_ERROR_SWITCH and
	DIAGNOSTIC_POP seems to misbehave with g++ 4.8, where we see these
	errors:

	      CXX    ada-tasks.o
	    /home/smarchi/src/binutils-gdb/gdb/ada-tasks.c: In function void read_known_tasks():
	    /home/smarchi/src/binutils-gdb/gdb/ada-tasks.c:998:10: error: enumeration value ADA_TASKS_UNKNOWN not handled in switch [-Werror=switch]
	       switch (data->known_tasks_kind)
	              ^

	Because of the POP, the diagnostic should go back to being disabled,
	since it was disabled in the beginning, but that's not what we see
	here.  Versions of GCC >= 5 compile correctly.

	Work around this by making DIAGNOSTIC_ERROR_SWITCH a no-op for GCC < 5.

	Note that this code (already as it exists in master today) enables
	-Wswitch at the error level even if --disable-werror is passed.  It
	shouldn't be a problem, as it's not like a new enumerator will appear
	out of nowhere and cause a build error if building with future
	compilers.  Still, for correctness, we would ideally want to ask the
	compiler to enable -Wswitch at its default level (as if the user had
	passed -Wswitch on the command-line).  There doesn't seem to be a way to
	do this.

	Change-Id: Id33ebec3de39bd449409ea0bab59831289ffe82d

2021-12-02  Simon Marchi  <simon.marchi@polymtl.ca>

	gas: re-generate configure
	When configuring gas, I get:

	  config.status: error: cannot find input file: `doc/Makefile.in'

	This is because configure is out-of-date, re-generate it.

	Change-Id: Iaa5980c282900d9fd23b90f0df25bf8ba3676498

2021-12-02  Simon Marchi  <simon.marchi@polymtl.ca>

	libctf: re-generate configure
	When configuring libctf, I get:

	  config.status: error: cannot find input file: `doc/Makefile.in'

	This is because configure is out-of-date, re-generate it.

	Change-Id: Ie69acd33012211a4620661582c7d24ad6d2cd169

2021-12-02  H.J. Lu  <hjl.tools@gmail.com>

	x86: Skip __[start|stop]_SECNAME for --gc-sections -z start-stop-gc
	Don't convert memory load to immediate load on __start_SECNAME and
	__stop_SECNAME for --gc-sections -z start-stop-gc if all SECNAME
	sections been garbage collected.

	bfd/

		PR ld/27491
		* elf32-i386.c (elf_i386_convert_load_reloc): Skip __start_SECNAME
		and __stop_SECNAME for --gc-sections -z start-stop-gc if the input
		section been garbage collected.
		* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
		* elfxx-x86.h (elf_x86_start_stop_gc_p): New function.

	ld/
		PR ld/27491
		* testsuite/ld-i386/i386.exp: Run PR ld/27491 tests.
		* testsuite/ld-x86-64/x86-64.exp: Likewise.
		* testsuite/ld-i386/pr27491-1.s: New file.
		* testsuite/ld-i386/pr27491-1a.d: Likewise.
		* testsuite/ld-i386/pr27491-1b.d: Likewise.
		* testsuite/ld-i386/pr27491-1c.d: Likewise.
		* testsuite/ld-i386/pr27491-2.d: Likewise.
		* testsuite/ld-i386/pr27491-2.s: Likewise.
		* testsuite/ld-i386/pr27491-3.d: Likewise.
		* testsuite/ld-i386/pr27491-3.s: Likewise.
		* testsuite/ld-i386/pr27491-4.d: Likewise.
		* testsuite/ld-i386/pr27491-4a.s: Likewise.
		* testsuite/ld-i386/pr27491-4b.s: Likewise.
		* testsuite/ld-x86-64/pr27491-1.s: Likewise.
		* testsuite/ld-x86-64/pr27491-1a.d: Likewise.
		* testsuite/ld-x86-64/pr27491-1b.d: Likewise.
		* testsuite/ld-x86-64/pr27491-1c.d: Likewise.
		* testsuite/ld-x86-64/pr27491-2.d: Likewise.
		* testsuite/ld-x86-64/pr27491-2.s: Likewise.
		* testsuite/ld-x86-64/pr27491-3.d: Likewise.
		* testsuite/ld-x86-64/pr27491-3.s: Likewise.
		* testsuite/ld-x86-64/pr27491-4.d: Likewise.
		* testsuite/ld-x86-64/pr27491-4a.s: Likewise.
		* testsuite/ld-x86-64/pr27491-4b.s: Likewise.

2021-12-02  Mike Frysinger  <vapier@gentoo.org>

	bfd: delete unused proto settings
	These have been around for decades but don't appear to be used, and
	trying to build them (e.g. `make archive.p archive.ip`) doesn't work,
	so just delete it all.

	gas: merge doc subdir up a level
	This avoids a recursive make into the doc subdir and speeds up the
	build slightly.  It also allows for more parallelism.

	libctf: merge doc subdir up a level
	This avoids a recursive make into the doc subdir and speeds up the
	build slightly.  It also allows for more parallelism.

2021-12-02  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: use actual DWARF version in compunit's debugformat field
	The "info source" command, with a DWARF-compile program, always show
	that the debug info is "DWARF 2":

	    (gdb) info source
	    Current source file is test.c
	    Compilation directory is /home/smarchi/build/binutils-gdb/gdb
	    Located in /home/smarchi/build/binutils-gdb/gdb/test.c
	    Contains 2 lines.
	    Source language is c.
	    Producer is GNU C17 9.3.0 -mtune=generic -march=x86-64 -g3 -gdwarf-5 -O0 -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protection.
	    Compiled with DWARF 2 debugging format.
	    Includes preprocessor macro info.

	Change it to display the actual DWARF version:

	    (gdb) info source
	    Current source file is test.c
	    Compilation directory is /home/smarchi/build/binutils-gdb/gdb
	    Located in /home/smarchi/build/binutils-gdb/gdb/test.c
	    Contains 2 lines.
	    Source language is c.
	    Producer is GNU C17 9.3.0 -mtune=generic -march=x86-64 -g3 -gdwarf-5 -O0 -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protection.
	    Compiled with DWARF 5 debugging format.
	    Includes preprocessor macro info.

	The comp_unit_head::version field is guaranteed to be between 2 and 5,
	thanks to the check in read_comp_unit_head.  So we can still use static
	strings to pass to record_debugformat, and keep it efficient.

	In the future, when somebody will update GDB to support DWARF 6, they'll
	hit this assert and have to update this code.

	Change-Id: I3270b7ebf5e9a17b4215405bd2e365662a4d6172

2021-12-02  H.J. Lu  <hjl.tools@gmail.com>

	elf: Discard input .note.gnu.build-id sections
	1. Discard input .note.gnu.build-id sections.
	2. Clear the build ID field before writing.
	3. Use bfd_make_section_anyway_with_flags to create the output
	.note.gnu.build-id section.

		PR ld/28639
		* ldelf.c (ldelf_after_open): Discard input .note.gnu.build-id
		sections, excluding the first one.
		(write_build_id): Clear the build ID field before writing.
		(ldelf_setup_build_id): Use bfd_make_section_anyway_with_flags
		to create the output .note.gnu.build-id section.
		* testsuite/ld-elf/build-id.exp: New file.
		* testsuite/ld-elf/pr28639a.rd: Likewise.
		* testsuite/ld-elf/pr28639b.rd: Likewise.
		* testsuite/ld-elf/pr28639c.rd: Likewise.
		* testsuite/ld-elf/pr28639d.rd: Likewise.

2021-12-02  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-12-01  Mike Frysinger  <vapier@gentoo.org>

	binutils: add missing prefix for binutils/index.html rule

2021-12-01  Luca Boccassi  <luca.boccassi@gmail.com>

	readelf: recognize FDO Packaging Metadata ELF note.  (Correcting snafu during patch application)

2021-12-01  Luca Boccassi  <luca.boccassi@gmail.com>

	readelf: recognize FDO Packaging Metadata ELF note
	As defined on: https://systemd.io/COREDUMP_PACKAGE_METADATA/
	this note will be used starting from Fedora 36. Allow
	readelf --notes to pretty print it:

	Displaying notes found in: .note.package
	  Owner                Data size 	Description
	  FDO                  0x00000039	FDO_PACKAGING_METADATA
	    Packaging Metadata: {"type":"deb","name":"fsverity-utils","version":"1.3-1"}

2021-12-01  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix typo in gdb.multi/multi-arch-exec.exp
	With gdb.multi/multi-arch-exec.exp I run into:
	...
	Running src/gdb/testsuite/gdb.multi/multi-arch-exec.exp ...
	ERROR: tcl error sourcing src/gdb/testsuite/gdb.multi/multi-arch-exec.exp.
	ERROR: wrong # args: extra words after "else" clause in "if" command
	    while executing
	"if [istarget "powerpc64*-*-*"] {
	        set march "-m64"
	    } else if [istarget "s390*-*-*"] {
	        set march "-m31"
	    } else {
	        set march "-m32"
	    }"
	...

	Fix the else if -> elseif typo.

	Tested on x86_64-linux.

2021-12-01  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.arch/i386-pkru.exp on linux
	When running test-case gdb.arch/i386-pkru.exp on a machine with "Memory
	Protection Keys for Userspace" support, we run into:
	...
	(gdb) PASS: gdb.arch/i386-pkru.exp: probe PKRU support
	print $pkru^M
	$2 = 1431655764^M
	(gdb) FAIL: gdb.arch/i386-pkru.exp: pkru register
	...

	The test-case expects the $pkru register to have the default value 0, matching
	the "init state" of 0 defined by the XSAVE hardware.

	Since linux kernel version v4.9 containing commit acd547b29880 ("x86/pkeys:
	Default to a restrictive init PKRU"), the register is set to 0x55555554 by
	default (which matches the printed decimal value above).

	Fix the FAIL by accepting this value for linux.

	Tested on x86_64-linux.

2021-12-01  Nick Clifton  <nickc@redhat.com>

	Fix the fields in the x_n union inside the the x_file structure so that pointers can be stored.
		PR 28630
		* coff/internal.h (x_n): Use bfd_hostptr_t for the fields in this
		structure.

2021-12-01  Andrew Burgess  <aburgess@redhat.com>

	gdb/remote: use scoped_restore to control starting_up flag
	This commit makes use of a scoped_restore object to control the
	remote_state::starting_up flag within the remote_target::start_remote
	method.

	Ideally I would have liked to create the scoped_restore inside
	start_remote and just leave the restore in place until the end of the
	scope, however, I'm worried that doing this would change the behaviour
	of GDB.  Specifically, in start_remote, the following code is executed
	once the starting_up flag has been restored to its previous value:

	  if (breakpoints_should_be_inserted_now ())
	    insert_breakpoints ();

	I think (but am not 100% sure) that calling install_breakpoints could
	end up back inside remote_target::can_download_tracepoint, which does
	check the value of remote_state::starting_up.  And so, I'm concerned
	that leaving the scoped_restore in place until the end of start_remote
	will cause a possible change in behaviour.

	To avoid this, and to leave things as close to the current behaviour
	as possible, I've split remote_target::start_remote into two, there's
	the main function body which moves into remote_target::start_remote_1,
	this function uses the scoped_restore to change the ::starting_up
	flag, then there's the old remote_target::start_remote, which now just
	calls ::start_remote_1, and then does the insert_breakpoints call.

	There should be no user visible changes after this commit, unless
	there's a situation where the ::starting_up flag could previously have
	been left set, if this was the case, then this situation should no
	longer be possible.

2021-12-01  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb.base/corefile-buildid.exp: fix DUPLICATEs when failing to generate a core file
	When my system isn't properly configured to generate core files in the
	local directory, I see these DUPLICATEs:

	    DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file

	Fix that by having a single with_test_prefix around that message and
	what follows.

	Change-Id: I4ac245fcce1c666db56e3bad3582aa17f183dcba

2021-12-01  Mike Frysinger  <vapier@gentoo.org>

	gold: enable silent build rules

2021-12-01  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-30  Carl Love  <cel@us.ibm.com>

	gdb: Powerpc fix gdb.multi/multi-arch-exec.exp test
	The expect file has a procedure append_arch_options which sets march based
	the istarget.  The current if / else statement does not check for
	powerpc64.  The else statement is hit which sets march to -m32.  This
	results in compilation errors on 64-bit PowerPC.

	This patch adds an if statement to check for powerpc64 and if true sets mach
	to -m64.

	The patch was tested on a Power 10 system.  No compile errors were generated.
	The test completes with 1 expected pass and no failures.

2021-11-30  Mike Frysinger  <vapier@gentoo.org>

	binutils: regenerate Makefile.in after doc/ changes

2021-11-30  Roland McGrath  <mcgrathr@google.com>

	Fix missing build dependency for binutils man pages
	binutils/
		* doc/local.mk: Give each man page target its missing dependency on
		doc/$(am__dirstamp).

2021-11-30  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Add missing system registers [PR27145]
	This patch adds support for various system registers, up to Armv8.7-A.
	This includes all the registers that were mentioned in the PR and that
	hadn't become supported since.

	opcodes/
		PR aarch64/27145
		* aarch64-opc.c (SR_V8_4): Remove duplicate definition.
		(SR_V8_6, SR_V8_7, SR_GIC, SR_AMU): New macros.
		(aarch64_sys_regs): Add missing entries (up to Armv8.7-A).

	gas/
		PR aarch64/27145
		* testsuite/gas/aarch64/sysreg-8.s,
		* testsuite/gas/aarch64/sysreg-8.d,
		* testsuite/gas/aarch64/illegal-sysreg-8.s,
		* testsuite/gas/aarch64/illegal-sysreg-8.d,
		* testsuite/gas/aarch64/illegal-sysreg-8.l,
		* testsuite/gas/aarch64/illegal-sysreg-8b.s,
		* testsuite/gas/aarch64/illegal-sysreg-8b.d,
		* testsuite/gas/aarch64/illegal-sysreg-8b.l: New tests.
		* testsuite/gas/aarch64/sysreg.s: Change system register numbers
		to ones that are still unallocated.
		* testsuite/gas/aarch64/sysreg.d: Update accordingly.

2021-11-30  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Make LOR registers conditional on +lor
	We have a +lor feature flag for the Limited Ordering Regions
	extension, but the associated registers didn't use it.

	opcodes/
		* aarch64-opc.c (SR_LOR): New macro.
		(aarch64_sys_regs): Use it for lorc_el1, lorea_el1, lorn_el1 and
		lorsa_el1.

	gas/
		* testsuite/gas/aarch64/sysreg-7.s: Enable +lor.
		* testsuite/gas/aarch64/illegal-sysreg-7.s: Test for LOR registers
		without +lor.
		* testsuite/gas/aarch64/illegal-sysreg-7.d: Update accordingly.
		* testsuite/gas/aarch64/illegal-sysreg-7.l: Likewise.

2021-11-30  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Remove ZIDR_EL1
	ZIDR_EL1 was part of an early version of SVE, but didn't make
	it to the final release.

	opcodes/
		* aarch64-opc.c (aarch64_sys_regs): Remove zidr_el1 entry.

	gas/
		* testsuite/gas/aarch64/sve-sysreg.s: Remove zidr_el1.
		* testsuite/gas/aarch64/sve-sysreg.d: Update accordingly.
		* testsuite/gas/aarch64/sve-sysreg-invalid.l: Likewise.

2021-11-30  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Allow writes to MFAR_EL3
	MFAR_EL3 is a read/write register, but was incorrectly marked as
	read-only
	[https://developer.arm.com/documentation/ddi0601/2021-09/AArch64-Registers/MFAR-EL3--PA-Fault-Address-Register?lang=en]

	opcodes/
		* aarch64-opc.c (aarch64_sys_regs): Mark mfar_el3 as read-write.

	gas/
		* testsuite/gas/aarch64/rme.s: Test writing to mfar_el3.
		* testsuite/gas/aarch64/rme.d: Update accordingly.
		* testsuite/gas/aarch64/rme-invalid.s: Delete.
		* testsuite/gas/aarch64/rme-invalid.l: Likewise.
		* testsuite/gas/aarch64/rme-invalid.d: Likewise.

2021-11-30  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Mark PMSIDR_EL1 as read-only
	We were incorrectly allowing writes to PMSIDR_EL1, which is
	a read-only register.
	[https://developer.arm.com/documentation/ddi0595/2021-09/AArch64-Registers/PMSIDR-EL1--Sampling-Profiling-ID-Register?lang=en]

	opcodes/
		* aarch64-opc.c (aarch64_sys_regs): Make pmsidr_el1 as F_REG_READ.

	gas/
		* testsuite/gas/aarch64/msr.s: Remove write to pmsidr_el1.
		* testsuite/gas/aarch64/msr.d: Update accordingly.
		* testsuite/gas/aarch64/illegal-sysreg-2.s,
		* testsuite/gas/aarch64/illegal-sysreg-2.d,
		* testsuite/gas/aarch64/illegal-sysreg-2.l: New test.

2021-11-30  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Remove duplicate system register entries
	There is a lot of overlap between the ETM and ETE system registers,
	so some registers were listed twice.

	Already tested by etm.[sd] and ete.[sd].

	opcodes/
		* aarch64-opc.c (aarch64_sys_regs): Combine ETE and ETM blocks
		and remove redundant entries.

	gas/
		* testsuite/gas/aarch64/etm.s: Remove duplicated test.
		* testsuite/gas/aarch64/etm.d: Update accordingly.

2021-11-30  Richard Sandiford  <richard.sandiford@arm.com>

	aarch64: Check for register aliases before mnemonics
	Previously we would not accept:

		A .req B

	if A happened to be the name of an instruction.  Adding new
	instructions could therefore invalidate existing register aliases.

	I noticed this with a test that used "zero" as a register alias
	for "xzr", where "zero" is now also the name of an SME instruction.
	I don't have any evidence that "real" code is doing this, but it
	seems at least plausible.

	This patch switches things so that we check for register aliases
	first.  It might slow down parsing slightly, but the difference
	is unlikely to be noticeable.

	Things like:

		b	.req + 0

	still work, since create_register_alias checks for " .req ",
	and with the input scrubber, we'll only keep whitespace after
	.req if it's followed by another name.  If there's some valid
	expression that I haven't thought about that is scrubbed to
	" .req ", users could avoid the ambiguity by wrapping .req
	in parentheses.

	The new test for invalid aliases already passed.  I just wanted
	something to exercise the !dot condition.

	I can't find a way of exercising the (existing) p == base condition,
	but I'm not brave enough to say that it can never happen.  If it does
	happen, get_mnemonic_name would return an empty string.

	gas/
		* config/tc-aarch64.c (opcode_lookup): Move mnemonic extraction
		code to...
		(md_assemble): ...here.  Check for register aliases first.
		* testsuite/gas/aarch64/register_aliases.d,
		testsuite/gas/aarch64/register_aliases.s: Test for a register
		alias called "zero".
		* testsuite/gas/aarch64/register_aliases_invalid.d,
		testsuite/gas/aarch64/register_aliases_invalid.l,
		testsuite/gas/aarch64/register_aliases_invalid.s: New test.

2021-11-30  Andrew Burgess  <aburgess@redhat.com>

	gdb/python: don't use the 'p' format for parsing args
	When running the gdb.python/py-arch.exp tests on a GDB built
	against Python 2 I ran into some errors.  The problem is that this
	test script exercises the gdb.Architecture.integer_type method, and
	this method uses 'p' as an argument format specifier in a call to
	gdb_PyArg_ParseTupleAndKeywords.

	Unfortunately this specified was only added in Python 3.3, so will
	cause an error for earlier versions of Python.

	This commit switches to use the 'O' specifier to collect a PyObject,
	and then uses PyObject_IsTrue to convert the object to a boolean.

	An earlier version of this patch incorrectly switched from using 'p'
	to use 'i', however, it was pointed out during review that this would
	cause some changes in behaviour, for example both of these will work
	with 'p', but not with 'i':

	  gdb.selected_inferior().architecture().integer_type(32, None)
	  gdb.selected_inferior().architecture().integer_type(32, "foo")

	The new approach of using 'O' works fine with these cases.  I've added
	some new tests to cover both of the above.

	There should be no user visible changes after this commit.

2021-11-30  Tom de Vries  <tdevries@sdflex.arch.suse.de>

	[gdb/testsuite] Fix gdb.base/style.exp with stub-termcap
	When running test-case gdb.base/style.exp with a gdb build using
	stub-termcap.c, we run into:
	...
	(gdb) PASS: gdb.base/style.exp: all styles enabled: frame when width=20
	^M<et width 30^M
	(gdb) FAIL: gdb.base/style.exp: all styles enabled: set width 30
	...

	The problem is that we're trying to issue the command "set width 30" while
	width is set to 20, which causes horizontal scrolling.

	Fix this by resetting the width to 0 before issuing the "set width 30"
	command.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24582

2021-11-30  Nick Clifton  <nickc@redhat.com>

	Use dwarf_vma type for offsets, ranges and section sizes in DWARF decoder.
		* dwarf.c (find_debug_info_for_offset): Use dwarf_vma type for
		offsets, sizes and ranges.
		(display_loc_list): Likewise.  Also use print_dwarf_vma to print
		the offset.
		(display_loclists_list): Likewise.
		(display_loc_list_dwo): Likewise.
		(display_debug_str): Likewise.
		(display_debug_aranges): Likewise.
		(display_debug_ranges_list): Likewise.
		(display_debug_rnglists_list): Likewise.
		(display_debug_ranges): Likewise.

	ld: pru: Add pru_irq_map output section
		* scripttempl/pru.sc (.pru_irq_map): Define output section.
		* testsuite/ld-pru/pru_irq_map-1.d: New test.
		* testsuite/ld-pru/pru_irq_map-2.d: New test.
		* testsuite/ld-pru/pru_irq_map.s: New test.

2021-11-30  Andrew Burgess  <aburgess@redhat.com>

	gdb/testsuite: check the python module is available before using it
	The gdb.python/py-inferior-leak.exp test makes use of the tracemalloc
	module.  When running the Python tests with a GDB built against Python
	2 I ran into a test failure due to the tracemalloc module not being
	available.

	This commit adds a new helper function to lib/gdb-python.exp that
	checks if a named module is available.  Using this we can then skip
	the py-inferior-leak.exp test when the tracemalloc module is not
	available.

2021-11-30  Andrew Burgess  <aburgess@redhat.com>

	gdb: fix disassembler regressions for 32-bit arm
	After this commit:

	  commit 76b43c9b5c2b275cbf4f927bfc25984410cb5dd5
	  Date:   Tue Oct 5 15:10:12 2021 +0100

	      gdb: improve error reporting from the disassembler

	We started seeing FAILs in the gdb.base/all-architectures*.exp tests,
	when running on a 32-bit ARM target, though I suspect running on any
	target that compiles such that bfd_vma is 32-bits would also trigger
	the failures.

	The problem is that the test is expected GDB's disassembler to print
	an error like this:

	  Cannot access memory at address 0x0

	However, after the above commit we see an error like:

	  unknown disassembler error (error = -1)

	The reason for this is this code in opcodes/i386-dis.c (in the
	print_insn function):

	  if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
	    {
	      (*info->fprintf_func) (info->stream,
	                             _("64-bit address is disabled"));
	      return -1;
	    }

	This code effectively disallows us from ever disassembling 64-bit x86
	code if we compiled GDB with a 32-bit bfd_vma.  Notice we return
	-1 (indicating a failure to disassemble), but never call the
	memory_error_func callback.

	Prior to the above commit GDB, when it received the -1 return value
	would assume that a memory error had occurred and just print whatever
	value happened to be in the memory error address variable, the default
	value of 0 just happened to be fine because the test had asked GDB to
	do this 'disassemble 0x0,+4'.

	If we instead change the test to do 'disassemble 0x100,+4' then GDB
	would (previously) have still reported:

	  Cannot access memory at address 0x0

	which makes far less sense.

	In this commit I propose to fix this issue by changing the test to
	accept either the "Cannot access memory ..." string, or the newer
	"unknown disassembler error ..." string.  With this change done the
	test now passes.

	However, there is one weakness with this strategy; if GDB broke such
	that we _always_ reported "unknown disassembler error ..." we would
	never notice.  This clearly would be bad.  To avoid this issue I have
	adjusted the all-architectures*.exp tests so that, when we disassemble
	for the default architecture (the one selected by "auto") we _only_
	expect to get the "Cannot access memory ..." error string.

	[ Note: In an ideal world we should be able to disassemble any
	  architecture at all times.  There's no reason why the 64-bit x86
	  disassembler requires a 64-bit bfd_vma, other than the code happens
	  to be written that way.  We could rewrite the disassemble to not
	  have this requirement, but, I don't plan to do that any time soon. ]

	Further, I have changed the all-architectures*.exp test so that we now
	disassemble at address 0x100, this should avoid us being able to pass
	by printing a default address of 0x0.  I did originally change the
	address we disassembled at to 0x4, however, some architectures,
	e.g. ia64, have a default instruction alignment that is greater than
	4, so would still round down to 0x0.  I could have just picked 0x8 as
	an address, but I figured that 0x100 was likely to satisfy most
	architectures alignment requirements.

2021-11-30  Andrew Burgess  <aburgess@redhat.com>

	gdb/python: add gdb.RemoteTargetConnection.send_packet
	This commits adds a new sub-class of gdb.TargetConnection,
	gdb.RemoteTargetConnection.  This sub-class is created for all
	'remote' and 'extended-remote' targets.

	This new sub-class has one additional method over its base class,
	'send_packet'.  This new method is equivalent to the 'maint
	packet' CLI command, it allows a custom packet to be sent to a remote
	target.

	The outgoing packet can either be a bytes object, or a Unicode string,
	so long as the Unicode string contains only ASCII characters.

	The result of calling RemoteTargetConnection.send_packet is a bytes
	object containing the reply that came from the remote.

2021-11-30  Andrew Burgess  <aburgess@redhat.com>

	gdb: make packet_command function available outside remote.c
	In a later commit I will add a Python API to access the 'maint packet'
	functionality, that is, sending a user specified packet to the target.

	To make implementing this easier, this commit refactors how this
	command is currently implemented so that the packet_command function
	is now global.

	The new global send_remote_packet function takes an object that is an
	implementation of an abstract interface.  Two functions within this
	interface are then called, one just before a packet is sent to the
	remote target, and one when the reply has been received from the
	remote target.  Using an interface object in this way allows (1) for
	the error checking to be done before the first callback is made, this
	means we only print out what packet it being sent once we know we are
	going to actually send it, and (2) we don't need to make a copy of the
	reply if all we want to do is print it.

	One user visible changes after this commit are the error
	messages, which I've changed to be less 'maint packet' command
	focused, this will make them (I hope) better for when
	send_remote_packet can be called from Python code.

	So:      "command can only be used with remote target"
	Becomes: "packets can only be sent to a remote target"

	And:     "remote-packet command requires packet text as argument"
	Becomes: "a remote packet must not be empty"

	Additionally, in this commit, I've added support for packet replies
	that contain binary data.  Before this commit, the code that printed
	the reply treated the reply as a C string, it assumed that the string
	only contained printable characters, and had a null character only at
	the end.

	One way to show the problem with this is if we try to read the auxv
	data from a remote target, the auxv data is binary, so, before this
	commit:

	  (gdb) target remote :54321
	  ...
	  (gdb) maint packet qXfer:auxv:read::0,1000
	  sending: "qXfer:auxv:read::0,1000"
	  received: "l!"
	  (gdb)

	And after this commit:

	  (gdb) target remote :54321
	  ...
	  (gdb) maint packet qXfer:auxv:read::0,1000
	  sending: "qXfer:auxv:read::0,1000"
	  received: "l!\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xfc\xf7\xff\x7f\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\xff\xf>
	  (gdb)

	The binary contents of the reply are now printed as escaped hex.

2021-11-30  Andrew Burgess  <aburgess@redhat.com>

	gdb/python: introduce gdb.TargetConnection object type
	This commit adds a new object type gdb.TargetConnection.  This new
	type represents a connection within GDB (a connection as displayed by
	'info connections').

	There's three ways to find a gdb.TargetConnection, there's a new
	'gdb.connections()' function, which returns a list of all currently
	active connections.

	Or you can read the new 'connection' property on the gdb.Inferior
	object type, this contains the connection for that inferior (or None
	if the inferior has no connection, for example, it is exited).

	Finally, there's a new gdb.events.connection_removed event registry,
	this emits a new gdb.ConnectionEvent whenever a connection is removed
	from GDB (this can happen when all inferiors using a connection exit,
	though this is not always the case, depending on the connection type).
	The gdb.ConnectionEvent has a 'connection' property, which is the
	gdb.TargetConnection being removed from GDB.

	The gdb.TargetConnection has an 'is_valid()' method.  A connection
	object becomes invalid when the underlying connection is removed from
	GDB (as discussed above, this might be when all inferiors using a
	connection exit, or it might be when the user explicitly replaces a
	connection in GDB by issuing another 'target' command).

	The gdb.TargetConnection has the following read-only properties:

	  'num': The number for this connection,

	  'type': e.g. 'native', 'remote', 'sim', etc

	  'description': The longer description as seen in the 'info
	                 connections' command output.

	  'details': A string or None.  Extra details for the connection, for
	             example, a remote connection's details might be
	             'hostname:port'.

2021-11-30  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: The vtype immediate with more than the defined 8 bits are preserved.
	According the rvv spec,
	https://github.com/riscv/riscv-v-spec/blob/master/vtype-format.adoc

	The bits of vtype immediate from 8 to (xlen - 1) should be reserved.
	Therefore, we should also dump the vtype immediate as numbers, when
	they are set over 8-bits.  I think this is a bug that we used to support
	vediv extension and use the bit 8 and 9 of vtype, but forgot to update
	the behavior when removing the vediv.

	Consider the testcases,

	vsetvli  a0, a1,  0x700    # the reserved bit 10, 9 and 8 are used.
	vsetvli  a0, a1,  0x400    # the reserved bit 10 is used.
	vsetvli  a0, a1,  0x300    # the reserved bit 9 and 8 are used.
	vsetvli  a0, a1,  0x100    # the reserved bit 8 is used.
	vsetivli a0, 0xb, 0x300    # the reserved bit 9 and 8 are used.
	vsetivli a0, 0xb, 0x100    # the reserved bit 8 is used.

	The original objdump shows the following result,

	0000000000000000 <.text>:
	   0:   7005f557                vsetvli a0,a1,1792
	   4:   4005f557                vsetvli a0,a1,1024
	   8:   3005f557                vsetvli a0,a1,e8,m1,tu,mu
	   c:   1005f557                vsetvli a0,a1,e8,m1,tu,mu
	  10:   f005f557                vsetivli        a0,11,e8,m1,tu,mu
	  14:   d005f557                vsetivli        a0,11,e8,m1,tu,mu

	But in fact the correct result should be,

	0000000000000000 <.text>:
	   0:   7005f557                vsetvli a0,a1,1792
	   4:   4005f557                vsetvli a0,a1,1024
	   8:   3005f557                vsetvli a0,a1,768
	   c:   1005f557                vsetvli a0,a1,256
	  10:   f005f557                vsetivli        a0,11,768
	  14:   d005f557                vsetivli        a0,11,256

	gas/
		* testsuite/gas/riscv/vector-insns.d: Added testcases to
		test the reserved bit 8 to (xlen-1) of vtype.
		* testsuite/gas/riscv/vector-insns.s: Likewise.
	include/
		* opcode/riscv.h: Removed OP_MASK_VTYPE_RES and OP_SH_VTYPE_RES,
		since they are different for operand Vc and Vb.
	opcodes/
		* riscv-dis.c (print_insn_args): Updated imm_vtype_res to
		extract the reserved immediate of vtype correctly.

2021-11-30  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Dump vset[i]vli immediate as numbers once vsew or vlmul is reserved.
	Consider the following case,

	vsetvli  a0, a1,  0x4           # unrecognized vlmul
	vsetvli  a0, a1,  0x20          # unrecognized vsew
	vsetivli a0, 0xb, 0x4           # unrecognized vlmul
	vsetivli a0, 0xb, 0x20          # unrecognized vsew

	For the current dis-assembler, we get the result,

	0000000000000000 <.text>:
	   0:   0045f557                vsetvli a0,a1,e8,(null),tu,mu
	   4:   0205f557                vsetvli a0,a1,e128,m1,tu,mu
	   8:   c045f557                vsetivli        a0,11,e8,(null),tu,mu
	   c:   c205f557                vsetivli        a0,11,e128,m1,tu,mu

	The vsew e128 and vlmul (null) are preserved according to the spec,
	so dump these fields looks wrong.  Consider that we are used to dump
	the unrecognized csr as csr numbers directly, we should also dump
	the whole vset[i]vli immediates as numbers, once the vsew or vlmul
	is reserved.  Therefore, following is what I expected,

	0000000000000000 <.text>:
	   0:   0045f557                vsetvli a0,a1,4
	   4:   0205f557                vsetvli a0,a1,32
	   8:   c045f557                vsetivli        a0,11,4
	   c:   c205f557                vsetivli        a0,11,32

	gas/
		* testsuite/gas/riscv/vector-insns.d: Rewrite the vset[i]vli
		testcases since we should dump the immediate as numbers once
		the vsew or vlmul is reserved.
		* testsuite/gas/riscv/vector-insns.s: Likewise.
	opcodes/
		* riscv-dis.c (print_insn_args): The reserved vsew and vlmul
		are NULL string in the riscv_vsew and riscv_vlmul, so dump the
		whole imm as numbers once one of them is NULL.
		* riscv-opc.c (riscv_vsew): Set the reserved vsew to NULL.
		(riscv_vlmul): Set the reserved vlmul to NULL.

2021-11-30  Mike Frysinger  <vapier@gentoo.org>

	zlib: enable silent build rules

	ld: enable silent build rules
	Also add $(AM_V_xxx) to various manual rules in here.

	libctf: enable silent build rules
	Also add $(AM_V_xxx) to various manual rules in here.

	gprof: enable silent build rules
	Also add $(AM_V_xxx) to various manual rules in here.

	binutils: merge doc subdir up a level
	This avoids a recursive make into the doc subdir and speeds up the
	build slightly.  It also allows for more parallelism.

	binutils: enable silent build rules
	Also add $(AM_V_xxx) to various manual rules in here.

	bfd: enable silent build rules
	Also add $(AM_V_xxx) to various manual rules in here.

	opcodes: enable silent build rules
	Also add $(AM_V_xxx) to various manual rules in here.

2021-11-30  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-29  Tom Tromey  <tom@tromey.com>

	Allow DW_ATE_UTF for Rust characters
	The Rust compiler plans to change the encoding of a Rust 'char' type
	to use DW_ATE_UTF.  You can see the discussion here:

	    https://github.com/rust-lang/rust/pull/89887

	However, this fails in gdb.  I looked into this, and it turns out that
	the handling of DW_ATE_UTF is currently fairly specific to C++.  In
	particular, the code here assumes the C++ type names, and it creates
	an integer type.

	This comes from commit 53e710acd ("GDB thinks char16_t and char32_t
	are signed in C++").  The message says:

	    Both places need fixing.  But since I couldn't tell why dwarf2read.c
	    needs to create a new type, I've made it use the per-arch built-in
	    types instead, so that the types are only created once per arch
	    instead of once per objfile.  That seems to work fine.

	... which is fine, but it seems to me that it's also correct to make a
	new character type; and this approach is better because it preserves
	the type name as well.  This does use more memory, but first we
	shouldn't be too concerned about the memory use of types coming from
	debuginfo; and second, if we are, we should implement type interning
	anyway.

	Changing this code to use a character type revealed a couple of
	oddities in the C/C++ handling of TYPE_CODE_CHAR.  This patch fixes
	these as well.

	I filed PR rust/28637 for this issue, so that this patch can be
	backported to the gdb 11 branch.

2021-11-29  Aaron Merey  <amerey@redhat.com>
	    Tom de Vries  <tdevries@suse.de>

	[PR gdb/27026] CTRL-C is ignored when debug info is downloaded
	During debuginfod downloads, ctrl-c should result in the download
	being cancelled and skipped.  However in some cases, ctrl-c fails to
	get delivered to gdb during downloading.  This can result in downloads
	being unskippable.

	Fix this by ensuring that target_terminal::ours is in effect for the
	duration of each download.

	https://sourceware.org/bugzilla/show_bug.cgi?id=27026#c3

2021-11-29  Nick Clifton  <nickc@redhat.com>

	strings: Replace references to -u option with references to -U.
		PR 28632

2021-11-29  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Fix segfault in search_one_symtab
	PR28539 describes a segfault in lambda function search_one_symtab due to
	psymbol_functions::expand_symtabs_matching calling expansion_notify with a
	nullptr symtab:
	...
	          struct compunit_symtab *symtab =
	            psymtab_to_symtab (objfile, ps);

	          if (expansion_notify != NULL)
	            if (!expansion_notify (symtab))
	              return false;
	...

	This happens as follows.  The partial symtab ps is a dwarf2_include_psymtab
	for some header file:
	...
	(gdb) p ps.filename
	$5 = 0x64fcf80 "/usr/include/c++/11/bits/stl_construct.h"
	...

	The includer of ps is a shared symtab for a partial unit, with as user:
	...
	(gdb) p ps.includer().user.filename
	$11 = 0x64fc9f0 \
	  "/usr/src/debug/llvm13-13.0.0-1.2.x86_64/tools/clang/lib/AST/Decl.cpp"
	...

	The call to psymtab_to_symtab expands the Decl.cpp symtab (and consequently
	the shared symtab), but returns nullptr because:
	...
	struct dwarf2_include_psymtab : public partial_symtab
	{
	  ...
	  compunit_symtab *get_compunit_symtab (struct objfile *objfile) const override
	  {
	    return nullptr;
	  }
	...

	Fix this by returning the Decl.cpp symtab instead, which fixes the segfault
	in the PR.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28539

2021-11-29  Nick Clifton  <nickc@redhat.com>

	Update description of string's -n option.
		PR 28632
		* strings.c (usage): Update desciption of -n option.
		* doc/binutils.texi: Likewise.

2021-11-29  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix typo in proc lines
	Proc lines contains a typo:
	...
	  string_form { set $_line_string_form $value }
	...

	Remove the incorrect '$' in '$_line_string_form'.

	Tested on x86_64-linux.

2021-11-29  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use unique files in gdb.dwarf2/dw2-lines.exp
	While debugging a problem in gdb.dwarf2/dw2-lines.exp, I realized that the
	test-case generates all executables and associated temporary files using the
	same filenames.

	Fix this by adding a new proc prefix_id in lib/gdb.exp, and using it in the
	test-case.

	Tested on x86_64-linux.

2021-11-29  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp with -m32
	When running test-case gdb.dwarf2/dw2-lines.exp with target board -unix/-m32,
	we run into another instance of PR28383, where the dwarf assembler generates
	64-bit relocations which are not supported by the 32-bit assembler:
	...
	dw2-lines-dw.S: Assembler messages:^M
	outputs/gdb.dwarf2/dw2-lines/dw2-lines-dw.S:76: Error: \
	  cannot represent relocation type BFD_RELOC_64^M
	...

	Fix this by using _op_offset in _line_finalize_header.

	Tested on x86_64-linux.

2021-11-29  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: drop most specific istarget checks
	We'll rely on the toolchain probing to determine whether each arch's
	tests can be run rather the current configure target.  This allows
	testing all of the ports in a multitarget configuration.

	For now, we don't reformat the files entirely to make it easier to
	review, and in case we need to make adjustments.  Once this feels
	like it's stable, we can flatten the code a bit by removing the if
	statement entirely.

2021-11-29  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: support parallel execution
	Break up the dejagnu logic so that we can parallelize the testsuite.
	This takes a page from gcc & gdb where each .exp is run in isolation
	instead of in serial.

	For most targets, this doesn't make much of a difference as they only
	have a single .exp.  A few (like cris & frv) have multiple .exp though
	and will see a bit of a speed up.

	The real gain is when testing a multitarget build.  This way we can
	run all the targets in parallel and cut the execution time a bit.
	On my system, it goes from ~155sec to ~100sec.

	We can gain further speedups by splitting up some of the larger .exp
	files into smaller groups.  We'll do that in a followup though.

2021-11-29  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: expand arch specific toolchain settings
	Leverage the new per-port toolchain settings to initialize the env
	for eeach set of tests.  This allows us to run all the tests in a
	multitarget build if the user sets up the vars.  If they don't, we
	can still skip all the tests.

2021-11-29  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: setup per-port toolchain settings for multitarget build
	Gas does not support multitarget builds -- it still only supports
	a single input & output format.  ld is a bit better, but requires
	manual flags to select the right output.  This makes it impossible
	to run the complete testsuite in a multitarget build.

	To address this limitation, create a suite of FOR_TARGET variables
	so these can be set to precompiled as & ld programs.  It requires
	a bit of setup ahead of time, but it's a one-time cost, and makes
	running the full testsuite at once much easier.

2021-11-29  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-28  Alan Modra  <amodra@gmail.com>

	PR28629 NIOS2 fallout
	The test exactly matched wrong output.

		PR 28629
		* testsuite/gas/nios2/relax.d: Update expected output.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: add checks to core headers to prevent incorrect common building
	Some of the core sim headers rely on the SIM_AC_OPTION_BITSIZE macro
	which can change the size of core types.  Since these haven't been
	unified across ports, add checks to make sure they aren't accidentally
	included when building for all ports.  This caught the sim-load file
	using poisoned headers that it didn't actually need.

	sim: unify syscall.o building
	Now that we've unified all the syscall tables, this file does not rely
	on any port-specific settings, so move it up to building as part of the
	common step so we only do it once in a multibuild.

	sim: drop unused gentmap & nltvals.def logic
	Now that all ports have switched to target-newlib-* files, there's
	no need for these files & generating things at build time.  So punt
	the logic and make target-newlib-syscall a hard requirement.

	sim: mcore: switch to new target-newlib-syscall
	Use the new target-newlib-syscall module.  This is needed to merge all
	the architectures into a single build, and mcore has a custom syscall
	table for its newlib/libgloss port.

	sim: riscv: switch to new target-newlib-syscall
	Use the new target-newlib-syscall module.  This is needed to merge all
	the architectures into a single build, and riscv has a custom syscall
	table for its newlib/libgloss port.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: cr16: switch to new target-newlib-syscall
	Use the new target-newlib-syscall module.  This is needed to merge all
	the architectures into a single build, and cr16 has a custom syscall
	table for its newlib/libgloss port.

	This allows cleaning up the syscall ifdef logic.  We know these will
	always exist now.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: d10v: switch to new target-newlib-syscall
	Use the new target-newlib-syscall module.  This is needed to merge all
	the architectures into a single build, and d10v has a custom syscall
	table for its newlib/libgloss port.

	This allows cleaning up the syscall ifdef logic.  We know these will
	always exist now.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: sh: switch to new target-newlib-syscall
	Use the new target-newlib-syscall module.  This is needed to merge all
	the architectures into a single build, and sh has a custom syscall
	table for its newlib/libgloss port.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: v850: switch to new target-newlib-syscall
	Use the new target-newlib-syscall module.  This is needed to merge all
	the architectures into a single build, and v850 has a custom syscall
	table for its newlib/libgloss port.

	This allows cleaning up the syscall ifdef logic.  We know these will
	always exist now.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: iq2000/lm32/m32c/moxie/rx: switch to new target-newlib-syscall.h
	Use the new target-newlib-syscall.h to provide the target syscall
	defines.  These code paths are written specifically for the newlib
	ABI rather than being generalized, so switching them to the defines
	rather than trying to go through the dynamic callback conversion
	seems like the best trade-off for now.  Might have to reconsider
	this in the future.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: nltvals: pull target syscalls out into a dedicated source file
	Like we just did for pulling out the errno map, pull out the syscall
	maps into a dedicated common file.  Most newlib ports are using the
	same syscall map, but not all, which means we have to do a bit more
	work to migrate.

	This commit adds the maps and switches the ports using the common
	default syscall table over to it.  Ports using unique syscall tables
	are still using the old targ-map.c logic.

	Switching common ports over is easy by checking NL_TARGET, but the
	ppc code needs a bit more cleanup here hence its larger diff.

2021-11-28  Mike Frysinger  <vapier@gentoo.org>

	sim: frv: resolve syscalls dynamically
	Avoid use of TARGET_<syscall> defines and rely on the callback layers
	to resolve these dynamically so we can support multiple syscall layers
	instead of assuming the newlib/libgloss numbers all the time.

	sim: mn10300: resolve syscalls dynamically
	Avoid use of TARGET_<syscall> defines and rely on the callback layers
	to resolve these dynamically so we can support multiple syscall layers
	instead of assuming the newlib/libgloss numbers all the time.

	sim: nltvals: drop i960
	This port was dropped from gdb/bfd/sim years ago, so stop including
	its syscall constants too.

	sim: moxie: fix datadir handling
	Expand the value at `make` time rather than configure generation time
	so that we handle $(datarootdir) setting properly.

2021-11-28  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-27  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix typos in configure
	The variable names used to restore CFLAGS and LDFLAGS here don't quite
	match the names used above, resulting in losing the original CFLAGS and
	LDFLAGS.  Fix that.

	Change-Id: I9cc2c3b48b1dc30c31a7143563c893fd6f426a0a

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: hw: mark hw_descriptors const

	sim: testsuite: add dedicated flag for init toolchain tests
	As we setup more reliable CC_FOR_TARGET variables for each target, the
	bfin way of overriding it to stuff custom CFLAGS doesn't scale well.
	Add a dedicated CFLAGS_FOR_TARGET_init setting that each set of tests
	can setup if they want to add custom options.

	sim: testsuite: clean up arch specific toolchain settings
	In a multitarget build, we process all targets in order, so make sure
	the toolchain settings from one don't leak into the next.

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: cris: always search for local rvdummy tool
	If the board info sets the sim to a basename that is found via $PATH
	(which is the default dejagnu behavior), the logic here to use its
	dirname to find rvdummy fails because it looks for `./rvdummy`.  So
	switch it to always use the local build of rvdummy which is the one
	we want to be testing against in the first place.

	If we get a request for testing against a different setup, we can
	figure out & document the needs at that point, and then setup some
	config knobs to control it.

2021-11-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAIL in gdb.base/list-missing-source.exp
	In commit f8080fb7a44 "[gdb/testsuite] Add gdb.base/include-main.exp" a
	file gdb.base/main.c was added, which caused the following regression:
	...
	(gdb) list^M
	<gdb.base/main.c>
	(gdb) FAIL: gdb.base/list-missing-source.exp: list
	...

	The problem is that the test-case does not expect to find a file main.c, but
	now it finds gdb.base/main.c.

	Fix this by using the more specific file name list-missing-source.c.

	Tested on x86_64-linux.

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: fix bits-gen EXEEXT handling
	Add missing $(EXEEXT) to dependencies on bits-gen.  These are actually
	build-only tools, but automake doesn't allow for build & host tools, so
	the rules are re-using EXEEXT.

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: initial support for OS-specific tests
	We usually test against the newlib/libgloss environment, but for a
	few ports that also support Linux apps, we want to test that logic
	too.  A lot of the C code is written such that it works with either
	newlib/libgloss or glibc/linux toolchains, but we have some tests
	that end up being Linux-specific.  Cris has been using the target
	tuple as a rough proxy for this (where cris*-*-elf is assumed to be
	newlib/libgloss, and everything else is glibc/linux), but that is a
	bit too rough, and it doesn't work in a multitarget build.

	So lets create a few stub files that we can do compile tests with
	to detect the different setups, and then let tests declare which
	one they require (if they require any at all).

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: unify basic C compiler checks
	Both bfin & cris ports test the C compiler to see if it works, but in
	their own way.  Unify the checks in the common code so we can leverage
	them in more ports in the future, and collapse the bfin & cris code.

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: rework sim_init usage
	The sim_init function was called by runtest for each test when --tool
	was set to sim.  When we changed to --tool '' to collapse the testsuite
	dir, the init function was no longer called on every test.  However, it
	was still being called explicitly by config/default.exp.  It's not clear
	why that explicit call ever existed since, in the past, it meant it was
	redundant.

	Lets drop the single sim_init call in config/default.exp and move it out
	to all our tests.  This replicates the runtest behavior so we can setup
	variables on a per-test basis which allows us to recollapse the sim_path
	logic back.  We'll also leverage this in the future for toolchain setup.

	Also add a few comments clarifying the overall runtime behavior.

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: cris: fix testsuite hang when sim is missing
	If the cris sim hasn't been built yet, trying to run its testsuite
	will hang indefinitely.  The common sim APIs already have this, so
	copy it over to the cris forks of the test+run functions.

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: fix objdir handling
	The tests assume that the cwd is the objdir directory and write its
	intermediates to there all the time.  When using runtest's --objdir
	setting though, this puts the files in the wrong place.  This isn't
	a big problem currently as we never change --objdir, but in order to
	support parallel test execution, we're going to start setting that
	option, so clean up the code ahead of time.

	We also have to tweak some of the cris tests which were making
	assumptions about the argv[0] value.

2021-11-27  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: rename global_sim_options to SIMFLAGS_FOR_TARGET
	Now that all the other toolchain settings have been renamed to match
	the dejagnu settings of XXX_FOR_TARGET, rename global_sim_options to
	SIMFLAGS_FOR_TARGET too.

	sim: testsuite: replace global_ld_options with LDFLAGS_FOR_TARGET
	Only a few tests actually use global_ld_options, but we can replace the
	sim-specific settings with the dejagnu common LDFLAGS_FOR_TARGET and get
	the same result.

2021-11-27  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-26  John David Anglin  <danglin@gcc.gnu.org>

	Fix ifunc test fails on hppa*-*-*
	2021-11-26  John David Anglin  <danglin@gcc.gnu.org>

		PR ld/27442

	ld/ChangeLog:

		* ld/testsuite/ld-ifunc/ifunc.exp (contains_irelative_reloc): Adjust
		regexp.
		Skip static ifunc-using executable test on hppa*-*-*.

2021-11-26  H.J. Lu  <hjl.tools@gmail.com>

	gas: Update commit 4780e5e4933
	Update

	commit 4780e5e4933a2497a5aecc4ceabbbb8e82aaf822
	Author: Tom de Vries <tdevries@suse.de>
	Date:   Fri Nov 26 09:59:45 2021 +0100

	    [gas] Fix file 0 dir with -gdwarf-5

	1. Replace i with j in

	  for (j = 0; i < NUM_MD5_BYTES; ++j)

	2. Pass -W to readelf to force CU: in output due to:

		      if (do_wide || strlen (directory) < 76)
			printf (_("CU: %s/%s:\n"), directory, file_table[0].name);
		      else
			printf ("%s:\n", file_table[0].name);

		PR gas/28629
		* dwarf2dbg.c (out_dir_and_file_list): Fix a typo in commit
		4780e5e4933.
		* testsuite/gas/elf/dwarf-5-nop-for-line-table.d: Pass -W to
		readelf.

2021-11-26  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: replace global_as_options with ASFLAGS_FOR_TARGET
	Only a few tests actually use global_as_options, but we can replace the
	sim-specific settings with the dejagnu common ASFLAGS_FOR_TARGET and get
	the same result.

2021-11-26  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add gdb.base/include-main.exp
	The test-case gdb.ada/dgopt.exp uses the -gnatD switch, in combination with
	-gnatG.

	This causes the source file $src/gdb/testsuite/gdb.ada/dgopt/x.adb to be
	expanded into $build/gdb/testsuite/outputs/gdb.ada/dgopt/x.adb.dg, and the
	debug information should refer to the x.adb.dg file.

	That is the case for the .debug_line part:
	...
	The Directory Table is empty.

	 The File Name Table (offset 0x1c):
	  Entry Dir     Time    Size    Name
	  1     0       0       0       x.adb.dg
	...
	but not for the .debug_info part:
	...
	    <11>   DW_AT_name        : $src/gdb/testsuite/gdb.ada/dgopt/x.adb
	    <15>   DW_AT_comp_dir    : $build/gdb/testsuite/outputs/gdb.ada/dgopt
	...

	Filed as PR gcc/103436.

	In C we can generate similar debug information, using a source file that does
	not contain any code, but includes another one that does:
	...
	 $ cat gdb/testsuite/gdb.base/include-main.c
	 #include "main.c"
	...
	such that in the .debug_line part we have:
	...
	 The Directory Table (offset 0x1c):
	  1     /home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.base

	 The File Name Table (offset 0x57):
	  Entry Dir     Time    Size    Name
	  1     1       0       0       main.c
	...
	and in the .debug_info part:
	...
	    <11>   DW_AT_name        : $src/gdb/testsuite/gdb.base/include-main.c
	    <15>   DW_AT_comp_dir    : $build/gdb/testsuite
	...

	Add a C test-case that mimics gdb.ada/dgopt.exp, that is:
	- generate debug info as described above,
	- issue a list of a line in include-main.c, while the corresponding
	  CU is not expanded yet.

	Tested on x86_64-linux.

2021-11-26  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: drop unused global_cc_options
	Nothing in the testsuite is using this setting, so let's drop it.
	Any code that wants to set compiler flags can use CFLAGS_FOR_TARGET
	instead to get the same effect.

	sim: testsuite: punt unused toolchain variables
	These haven't been used in over 20 years.  The sim testsuite used to
	run these tools itself directly, but back in ~1999 it switched to the
	dejagnu helpers (e.g. target_assemble & target_link), and the dejagnu
	logic only utilizes XXX_FOR_TARGET variables.  Punt them here to avoid
	confusion with dead code.

2021-11-26  Andrew Burgess  <aburgess@redhat.com>
	    Simon Cook  <simon.cook@embecosm.com>

	gdb: add risc-v disassembler options support
	This commit adds support for RISC-V disassembler options to GDB.  This
	commit is based on this patch which was never committed:

	  https://sourceware.org/pipermail/binutils/2021-January/114944.html

	All of the binutils refactoring has been moved to a separate, earlier,
	commit, so this commit is pretty straight forward, just registering
	the required gdbarch hooks.

2021-11-26  Andrew Burgess  <aburgess@redhat.com>
	    Simon Cook  <simon.cook@embecosm.com>

	opcodes/riscv: add disassembler options support to libopcodes
	In preparation for the next commit, which will add GDB support for
	RISC-V disassembler options, this commit restructures how the
	disassembler options are managed within libopcodes.

	The implementation provided here is based on this mailing list patch
	which was never committed:

	  https://sourceware.org/pipermail/binutils/2021-January/114944.html

	which in turn took inspiration from the MIPS implementation of the
	same feature.

	The biggest changes from the original mailing list post are:

	  1. The GDB changes have been split into a separate patch, and

	  2. The `riscv_option_args_privspec` variable, which held the valid
	  priv-spec values is now gone, instead we use the `riscv_priv_specs`
	  array from bfd/cpu-riscv.c instead.


	include/ChangeLog:

		* dis-asm.h (disassembler_options_riscv): Declare.

	opcodes/ChangeLog:

		* riscv-dis.c (enum riscv_option_arg_t): New enum typedef.
		(riscv_options): New static global.
		(disassembler_options_riscv): New function.
		(print_riscv_disassembler_options): Rewrite to use
		disassembler_options_riscv.

2021-11-26  Tom de Vries  <tdevries@suse.de>

	[gas] Fix file 0 dir with -gdwarf-5
	In out_dir_and_file_list, if file 0 is copied from file 1, only the filename
	is copied, and the dir and md5 fields are left to their default values.

	Fix this by adding the copy of the dir and md5 fields.

	gas/ChangeLog:

	2021-11-26  Tom de Vries  <tdevries@suse.de>

		PR 28629
		* dwarf2dbg.c (out_dir_and_file_list): When copying file 1 to file 0,
		also copy dir and md5 fields.
		* testsuite/gas/i386/dwarf5-line-4.d: Adjust expected output.

2021-11-26  Mike Frysinger  <vapier@gentoo.org>

	sim: mips: avoid _ namespace
	Some C libraries export _P symbols in their headers (like older
	newlib and its ctype.h), so use P_ instead to avoid conflicts.

	ld: fix POSIX shell test usage
	POSIX test uses = for compares, not == which is a bashism.

	gas: enable silent build rules

	ld: fix --disable-multiple-abs-defs alignment in help

2021-11-26  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-25  Enze Li  <lienze2010@hotmail.com>

	gdb: ensure extension_language_python is always defined
	In this commit:

	  commit c6a6aad52d9e839d6a84ac31cabe2b7e1a2a31a0
	  Date:   Mon Oct 25 17:25:45 2021 +0100

	      gdb/python: make some global variables static

	building without Python was broken.  The extension_language_python
	global was moved from being always defined, to only being defined when
	the HAVE_PYTHON macro was defined.  As a consequence, building without
	Python support would result in errors like:

	  /usr/bin/ld: extension.o:(.rodata+0x120): undefined reference to `extension_language_python'

	This commit fixes the problem by moving the definition of
	extension_language_python outside of the HAVE_PYTHON macro protection.

2021-11-25  Andrew Burgess  <aburgess@redhat.com>

	Revert "gdb: add assert in remote_target::wait relating to async being off"
	This commit introduced a test failure in gdb.server/attach-flag.exp.
	I didn't spot this failure originally as the problem is fixed by this,
	as yet unpushed patch:

	  https://sourceware.org/pipermail/gdb-patches/2021-November/183768.html

	I unfortunately didn't test each patch in the original series
	independently.  I'll repost this patch after the above patch has been
	merged.

	This reverts commit 32b1f5e8d6b8ddd3be6e471c26dd85a1dac31dda.

2021-11-25  Nick Clifton  <nickc@redhat.com>

	Fix building the AArch64 assembler and disassembler when assertions are disabled.
		PR 28614
		* aarch64-asm.c: Replace assert(0) with real code.
		* aarch64-dis.c: Likewise.
		* aarch64-opc.c: Likewise.

2021-11-25  Bruno Larsen  <blarsen@redhat.com>

	PR gdb/28480: Improve ambiguous member detection
	Basic ambiguity detection assumes that when 2 fields with the same name
	have the same byte offset, it must be an unambiguous request. This is not
	always correct. Consider the following code:

	class empty { };

	class A {
	public:
	  [[no_unique_address]] empty e;
	};

	class B {
	public:
	  int e;
	};

	class C: public A, public B { };

	if we tried to use c.e in code, the compiler would warn of an ambiguity,
	however, since A::e does not demand an unique address, it gets the same
	address (and thus byte offset) of the members, making A::e and B::e have the
	same address. however, "print c.e" would fail to report the ambiguity,
	and would instead print it as an empty class (first path found).

	The new code solves this by checking for other found_fields that have
	different m_struct_path.back() (final class that the member was found
	in), despite having the same byte offset.

	The testcase gdb.cp/ambiguous.exp was also changed to test for this
	behavior.

2021-11-25  Jan W. Jagersma  <jwjagersma@gmail.com>

	coff-go32: consistent 16-byte section alignment
	Section alignment for coff-go32 is inconsistent - The '.text' and
	'.data' sections are 16-byte aligned, but named sections '.text.*' and
	'.data.*' are only 4-byte aligned.  '.gnu.linkonce.r.*' is aligned to
	16 bytes, yet '.rodata' and '.rodata.*' are aligned to 4 bytes.  For
	'.bss' all input sections are only aligned to 4 bytes.

	This primarily can cause trouble when using SSE instructions, which
	require their memory operands to be aligned to 16-byte boundaries.

	This patch solves the issue simply by setting the section alignment
	to 16 bytes, for all code and data sections referenced in the default
	linker script.

		* coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES):  Use partial
		name match for .text, .data.  Add entries for .const, .rodata,
		.bss, .gnu.linkonce.b.

2021-11-25  Alan Modra  <amodra@gmail.com>

	Re: AArch64: Add support for AArch64 EFI (efi-*-aarch64)
	Commit b69c9d41e8 edited bfd/Makefile.in rather than using automake,
	which meant a typo in Makefile.am was not discovered and other
	differences in Makefile.in are seen with a proper regeneration.  One
	difference was lack of an empty line between the pe-aarch64igen.c rule
	and the following $(BFD32_LIBS) etc. dependency rule, in the
	regenerated file.  Not that it matters for proper "make" behaviour,
	but it's nicer with a line between those rules.  Moving the rule
	earlier seems to cure the missing empty line.

		* Makefile.am (BFD64_BACKENDS): Correct typo.
		(BFD_H_DEPS, LOCAL_H_DEPS): Move earlier.  Move rule using these
		deps earlier too.
		* Makefile.in: Regenerate.
		* po/BLD-POTFILES.in: Regenerate.
		* po/SRC-POTFILES.in: Regenerate.

2021-11-25  Nick Clifton  <nickc@redhat.com>

	Updated French translation for the opcodes directory.
		* po/fr.po; Updated French translation.

2021-11-25  Andrew Burgess  <aburgess@redhat.com>

	gdb: rename source_styling_changed observer
	In a later commit I plan to add disassembler styling.  In the same way
	that we have a source_styling_changed observer I would need to add a
	disassembler_styling_changed observer.

	However, currently, these observers would only be notified from
	cli-style.c:set_style_enabled, and observed in tui-winsource.c,
	tui_source_window::style_changed, as a result, having two observers
	seems unnecessary right now, so, in this commit, I plan to rename
	source_styling_changed to just styling_changed, then, in the later
	commit, when disassembler styling is added, I can use the same
	observer for both source styling, and disassembler styling.

	There should be no user visible changes after this commit.

2021-11-25  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: make some global variables static
	Make a couple of global variables static in python/python.c.  To do
	this I had to move the definition of extension_language_python to
	later in the file.

	There should be no user visible changes after this commit.

2021-11-25  Andrew Burgess  <aburgess@redhat.com>

	gdb: add assert in remote_target::wait relating to async being off
	While working on another patch I ended up in a situation where I had
	async mode disabled (with 'maint set target-async off'), but the async
	event token got marked anyway.

	In this situation GDB was continually calling into
	remote_target::wait, however, the async token would never become
	unmarked as the unmarking is guarded by target_is_async_p.

	We could just unconditionally unmark the token, but that would feel
	like just ignoring a bug, so, instead, lets assert that if
	!target_is_async_p, then the async token should not be marked.

	This assertion would have caught my earlier mistake.

	There should be no user visible changes with this commit.

2021-11-25  Andrew Burgess  <aburgess@redhat.com>

	gdb: simplify remote_target::is_async_p
	This commit simplifies remote_target::is_async_p by removing the
	target_async_permitted check.

	In previous commits I have added additional assertions around the
	target_async_permitted flag into target.c, as a result we should now
	be confident that if target_can_async_p returns false, a target will
	never have async mode enabled.  Given this, it should not be necessary
	to check target_async_permitted in remote_target::is_async_p, if this
	flag is false ::is_async_p should return false anyway.  There is an
	assert to this effect in target_is_async_p.

	There should be no user visible change after this commit.

2021-11-25  Andrew Burgess  <aburgess@redhat.com>

	gdb: add asserts in target.c for target_async_permitted
	The target_async_permitted flag allows a user to override whether a
	target can act in async mode or not.  In previous commits I have moved
	the checking of this flag out of the various ::can_async_p methods and
	into the common target.c code.

	In this commit I will add some additional assertions into
	target_is_async_p and target_async.  The rules these assertions are
	checking are:

	  1. A target that returns false for target_can_async_p should never
	  become "async enabled", and so ::is_async_p should always return
	  false.  This is being checked in target_is_async_p.

	  2. GDB should never try to enable async mode for a target that
	  returns false for target_can_async_p, this is checked in
	  target_async.

	There are a few places where we call the ::is_async_p method directly,
	in these cases we will obviously not pass through the assert in
	target_is_async_p, however, there are also plenty of places where we
	do call target_is_async_p so if GDB starts to misbehave we should
	catch it quickly enough.

	There should be no user visible changes after this commit.

2021-11-25  Andrew Burgess  <aburgess@redhat.com>

	gdb: hoist target_async_permitted checks into target.c
	This commit moves the target_async_permitted check out of each targets
	::can_async_p method and into the target_can_async_p wrapper function.

	I've left some asserts in the two ::can_async_p methods that I
	changed, which will hopefully catch any direct calls to these methods
	that might be added in the future.

	There should be no user visible changes after this commit.

2021-11-25  Andrew Burgess  <aburgess@redhat.com>

	gdb: introduce a new overload of target_can_async_p
	There are a few places where we call the target_ops::can_async_p
	member function directly, instead of using the target_can_async_p
	wrapper.

	In some of these places this is because we need to ask before the
	target has been pushed, and in another location (in target.c) it seems
	unnecessary to go through the wrapper when we are already in target.c
	code.

	However, in the next commit I'd like to hoist some common checks out
	of target specific code into target.c.  To achieve this, in this
	commit, I introduce a new overload of target_can_async_p which takes a
	target_ops pointer, and calls the ::can_async_p method directly.  I
	then make use of the new overload where appropriate.

	There should be no user visible changes after this commit.

2021-11-25  Clément Chigot  <clement.chigot@atos.net>

	ld/testsuite/ld-elfvsb: correctly test "weak hidden symbol DSO last"
	The test must be done with the shared object and not with the object
	file which is already being tested above.

	ld/
		* testsuite/ld-elfvsb/elfvsb.exp: use .so file in "weak hidden
		  symbol DSO last"

2021-11-25  Tom de Vries  <tdevries@suse.de>

	[gdb/cli] Add "set logging enabled", deprecate "set logging on/off"
	Before commit 3b6acaee895 "Update more calls to add_prefix_cmd" we had the
	following output for "show logging file":
	...
	$ gdb -q -batch -ex "set trace-commands on" \
	    -ex "set logging off" \
	    -ex "show logging file" \
	    -ex "set logging on" \
	    -ex "show logging file"
	+set logging off
	+show logging file
	Future logs will be written to gdb.txt.
	+set logging on
	+show logging file
	Currently logging to "gdb.txt".
	...

	After that commit we have instead:
	...
	+set logging off
	+show logging file
	The current logfile is "gdb.txt".
	+set logging on
	+show logging file
	The current logfile is "gdb.txt".
	...

	Before the commit, whether logging is enabled or not can be deduced from the
	output of the command.  After the commit, the message is unified and it's no
	longer clear whether logging is enabled or not.

	Fix this by:
	- adding a new command "show logging enabled"
	- adding a corresponding new command "set logging enabled on/off"
	- making the commands "set logging on/off" deprecated aliases of the
	  "set logging enabled on/off" command.

	Update the docs and testsuite to use "set logging enabled".  Mention the new
	and deprecated commands in NEWS.

	Tested on x86_64-linux.

2021-11-25  Tom de Vries  <tdevries@suse.de>

	[gdb/cli] Fix typo in logging overwrite help text
	Currently we have:
	...
	$ gdb -q -batch -ex "help set logging overwrite"
	Set whether logging overwrites or appends to the log file.
	If set, logging overrides the log file.
	...

	Fix overrides -> overwrites typo.

2021-11-25  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-24  Simon Marchi  <simon.marchi@efficios.com>

	gdb: fix help doc for "set index-cache enabled"
	When implementing this command, I put "help doc" as a placeholder for
	the help string, and forgot to update it.  Change it for a real help
	string.

	Change-Id: Id23c2142c5073dc570bd8a706e9ec6fa8c40eb09

2021-11-24  Simon Marchi  <simon.marchi@efficios.com>

	Revert (part of) "gdb fix for catch-syscall.exp"
	This reverts (par of) commit ab198279120fe7937c0970a8bb881922726678f9.
	This commit changed what the test expects when catching the execve
	syscall based on the behavior seen on a Linux PowerPC machine.  That is,
	we get an "entry" event, but no "return" event.  This is not what we get
	on Linux with other architectures, though, and it seems like a
	PowerPC-specific bug.

	Revert the part of the patch related to this, but not the other hunk.

	Change-Id: I4248776e4299f10999487be96d4acd1b33639996

2021-11-24  Nick Clifton  <nickc@redhat.com>

	Fix an illegal memory access parsing a corrupt sysroff file.
		PR 28564
		* sysdump.c (getCHARS): Check for an out of bounds read.

2021-11-24  Andrew Burgess  <aburgess@redhat.com>

	gdb: fix crash when reading ECOFF debug information
	In commit:

	  commit 633cf2548bcd3dafe297e21a1dd3574240280d48
	  Date:   Wed May 9 15:42:28 2018 -0600

	      Remove cleanups from mdebugread.c

	the following change was made in the function parse_partial_symbols in
	mdebugread.c:

	  -  fdr_to_pst = XCNEWVEC (struct pst_map, hdr->ifdMax + 1);
	  -  old_chain = make_cleanup (xfree, fdr_to_pst);
	  +  gdb::def_vector<struct pst_map> fdr_to_pst_holder (hdr->ifdMax + 1);
	  +  fdr_to_pst = fdr_to_pst_holder.data ();

	The problem with this change is that XCNEWVEC calls xcalloc, which in
	turn calls calloc, and calloc zero initializes the allocated memory.
	In contrast, the new line gdb::def_vector<struct pst_map> specifically
	does not initialize the underlying memory.

	This is a problem because, later on in this same function, we
	increment the n_globals field within 'struct pst_map' objects stored
	in the vector.  The incrementing is now being done from an
	uninitialized starting point.

	In this commit we switch from using gdb::def_vector to using
	std::vector, this alone should be enough to ensure that the fields are
	initialized to zero.

	However, for extra clarity, I have also added initial values in the
	'struct pst_map' to make it crystal clear how the struct will start
	up.

	This issue was reported on the mailing list here:

	  https://sourceware.org/pipermail/gdb-patches/2021-November/183693.html

	Co-Authored-By: Lightning <lightningth@gmail.com>

2021-11-24  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-23  Alexandra Hájková  <ahajkova@redhat.com>

	configure.ac: Check for the readline.h explicitly
	When readline development package is missing make fails with
	"configure: error: system readline is not new enough" which
	might be confusing. This patch checks for the readline.h explicitly
	and makes make to warn about the missing package.

2021-11-23  Tamar Christina  <tamar.christina@arm.com>

	AArch64: Add support for AArch64 EFI (efi-*-aarch64).
	This adds support for efi-*-aarch64 by virtue of adding a new PEI target
	pei-aarch64-little.  This is not a full target and only exists to support EFI
	at this time.

	This means that this target does not support relocation processing and is mostly
	a container format.  This format has been added to elf based aarch64 targets
	such that efi images can be made natively on Linux.

	However this target is not valid for use with gas but only with objcopy.

	With these changes the resulting file is recognized as an efi image by
	third party tools:

	>  pecli info hello.efi

	Metadata
	================================================================================
	MD5:            598c32a778b0f0deebe977fef8578c4e
	SHA1:           4580121edd5cb4dc40f51b28f171fd15250df84c
	SHA256:         3154bd7cf42433d1c957f6bf55a17ad8c57ed41b29df2d485703349fd6ff1d5c
	Imphash:
	Size:           47561 bytes
	Type:           PE32+ executable (EFI application) (stripped to external PDB), for MS Windows
	Compile Time:   1970-01-01 00:00:00 (UTC - 0x0       )
	Entry point:    0x2000 (section .text)

	Sections
	================================================================================
	Name      RWX  VirtSize   VirtAddr   RawAddr   RawSize   Entropy  md5
	.text     R-X  0x5bb0     0x2000     0x400     0x5c00      6.39 551fbc264256a3f387de8a891500ae0d
	.reloc    R--  0xc        0x8000     0x6000    0x200       0.02 0c45f6d812d079821c1d54c09ab89e1d
	.data     RW-  0x1d88     0x9000     0x6200    0x1e00      4.18 5d1137c09f01289dc62bf754f7290db3
	.dynamic  RW-  0xf0       0xb000     0x8000    0x200       0.34 5c94ed3206f05a277e6f04fbf131f131
	.rela     R--  0xe58      0xc000     0x8200    0x1000      1.87 8b5c6bc30f3acb7ca7bf2e6789d68519
	.dynsym   R--  0x138      0xd000     0x9200    0x200       0.96 bdcf5101da51aadc663ca8859f88138c

	Imports
	================================================================================

	Any magic number is based on the Microsoft PE specification [1].

	[1] https://docs.microsoft.com/en-us/windows/win32/debug/pe-format

	bfd/ChangeLog:

	2021-10-21  Tamar Christina  <tamar.christina@arm.com>

		PR binutils/26206
		* .gitignore (pe-aarch64igen.c): New.
		* Makefile.am (pei-aarch64.lo, pe-aarch64igen.lo, pei-aarch64.c,
		pe-aarch64igen.c): Add support.
		* Makefile.in: Likewise.
		* bfd.c (bfd_get_sign_extend_vma): Add pei-aarch64-little.
		* coff-aarch64.c: New file.
		* coffcode.h (coff_set_arch_mach_hook, coff_set_flags,
		coff_write_object_contents) Add aarch64 (aarch64_pei_vec) support.
		* config.bfd: Likewise.
		* configure: Likewise.
		* configure.ac: Likewise.
		* libpei.h (GET_OPTHDR_IMAGE_BASE, PUT_OPTHDR_IMAGE_BASE,
		GET_OPTHDR_SIZE_OF_STACK_RESERVE, PUT_OPTHDR_SIZE_OF_STACK_RESERVE,
		GET_OPTHDR_SIZE_OF_STACK_COMMIT, PUT_OPTHDR_SIZE_OF_STACK_COMMIT,
		GET_OPTHDR_SIZE_OF_HEAP_RESERVE, PUT_OPTHDR_SIZE_OF_HEAP_RESERVE,
		GET_OPTHDR_SIZE_OF_HEAP_COMMIT, PUT_OPTHDR_SIZE_OF_HEAP_COMMIT,
		GET_PDATA_ENTRY, _bfd_peAArch64_bfd_copy_private_bfd_data_common,
		_bfd_peAArch64_bfd_copy_private_section_data,
		_bfd_peAArch64_get_symbol_info, _bfd_peAArch64_only_swap_filehdr_out,
		_bfd_peAArch64_print_private_bfd_data_common,
		_bfd_peAArch64i_final_link_postscript,
		_bfd_peAArch64i_only_swap_filehdr_out, _bfd_peAArch64i_swap_aouthdr_in,
		_bfd_peAArch64i_swap_aouthdr_out, _bfd_peAArch64i_swap_aux_in,
		_bfd_peAArch64i_swap_aux_out, _bfd_peAArch64i_swap_lineno_in,
		_bfd_peAArch64i_swap_lineno_out, _bfd_peAArch64i_swap_scnhdr_out,
		_bfd_peAArch64i_swap_sym_in, _bfd_peAArch64i_swap_sym_out,
		_bfd_peAArch64i_swap_debugdir_in, _bfd_peAArch64i_swap_debugdir_out,
		_bfd_peAArch64i_write_codeview_record,
		_bfd_peAArch64i_slurp_codeview_record,
		_bfd_peAArch64_print_ce_compressed_pdata): New.
		* peXXigen.c (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out,
		pe_print_pdata, _bfd_XX_print_private_bfd_data_common,
		_bfd_XX_bfd_copy_private_section_data, _bfd_XXi_final_link_postscript):
		Support COFF_WITH_peAArch64,
		* pei-aarch64.c: New file.
		* peicode.h (coff_swap_scnhdr_in, pe_ILF_build_a_bfd, pe_ILF_object_p):
		Support COFF_WITH_peAArch64.
		(jtab): Add dummy entry that traps.
		* targets.c (aarch64_pei_vec): New.

	binutils/ChangeLog:

	2021-10-21  Tamar Christina  <tamar.christina@arm.com>

		PR binutils/26206
		* NEWS: Add new support.
		* objcopy.c (convert_efi_target): Add efi-*-aarch64 support.
		* testsuite/binutils-all/aarch64/pei-aarch64-little.d: New test.
		* testsuite/binutils-all/aarch64/pei-aarch64-little.s: New test.

	include/ChangeLog:

	2021-10-21  Tamar Christina  <tamar.christina@arm.com>

		PR binutils/26206
		* coff/aarch64.h: New file.
		* coff/pe.h (IMAGE_FILE_MACHINE_ARM64): New.

2021-11-23  Alan Modra  <amodra@gmail.com>

	binutils debuginfod test
	A missing "return" resulted in this non-ELF fail:
	x86_64-w64-mingw32  +FAIL: debuginfod (create separate debug info file)

	Also, the debuginfod I have installed does not appear to handle
	non-native ELF objects, so only run the test when native.

		* testsuite/binutils-all/debuginfod.exp: Don't run test unless
		native ELF.

2021-11-23  Alan Modra  <amodra@gmail.com>

	Update bug reporting address
	https://sourceware.org/bugzilla/ everywhere

	bfd/
		* configure.ac (ACX_BUGURL): Set to https://sourceware.org/bugzilla/
		* po/Make-in (msgid-bugs-address): Likewise.
		* README: Report bugs to the above.
		* configure: Regenerate.
	binutils/
		* po/Make-in (msgid-bugs-address): Update.
	gas/
		* README: Update bug address.  Delete mention of gcc.
		* po/Make-in: Update bug address.
	gold/
		* po/Make-in: Update bug address.
	gprof/
		* po/Make-in: Update bug address.
	ld/
		* po/Make-in: Update bug address.
	opcodes/
		* po/Make-in: Update bug address.

2021-11-23  Jan (janneke) Nieuwenhuizen  <janneke@gnu.org>

	gdb: more compile fixes for gnu-nat.c
	This fixes compile errors like

	    ../../gdb-11.1/gdb/gnu-nat.c: In function void add_task_commands():
	    ../../gdb-11.1/gdb/gnu-nat.c:3204:17: error: no matching function for call to add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)
	     3204 |         &setlist);
	          |                 ^
	    In file included from ../../gdb-11.1/gdb/completer.h:21,
	                     from ../../gdb-11.1/gdb/symtab.h:36,
	                     from ../../gdb-11.1/gdb/infrun.h:21,
	                     from ../../gdb-11.1/gdb/target.h:42,
	                     from ../../gdb-11.1/gdb/inf-child.h:23,
	                     from ../../gdb-11.1/gdb/gnu-nat.h:38,
	                     from ../../gdb-11.1/gdb/gnu-nat.c:24:
	    ../../gdb-11.1/gdb/command.h:160:33: note: candidate: cmd_list_element* add_cmd(const char*, command_class, void (*)(const char*, int), const char*, cmd_list_element**)
	      160 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
	          |                                 ^~~~~~~
	    ../../gdb-11.1/gdb/command.h:161:30: note:   no known conversion for argument 3 from cmd_list_element* to void (*)(const char*, int)
	      161 |       cmd_const_cfunc_ftype *fun,
	          |       ~~~~~~~~~~~~~~~~~~~~~~~^~~
	    ../../gdb-11.1/gdb/command.h:167:33: note: candidate: cmd_list_element* add_cmd(const char*, command_class, const char*, cmd_list_element**)
	      167 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
	          |                                 ^~~~~~~
	    ../../gdb-11.1/gdb/command.h:167:33: note:   candidate expects 4 arguments, 5 provided
	    ../../gdb-11.1/gdb/gnu-nat.c:3210:18: error: no matching function for call to add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)
	     3210 |         &showlist);
	          |                  ^

	Change-Id: Ie9029363d3fb40e34e8f5b1ab503745bc44bfe3f

2021-11-23  Andrea Monaco  <andrea.monaco@autistici.org>

	gnu-nat.c: fix calls to add_info_alias
	Some time ago add_info_alias was changed (commit
	e0f25bd9717c7973197095523db7c1cdc956cea2).  These calls were not updated
	and caused errors on compilation.

	Change-Id: I354ae4e8b8926d785abc94ec7142471ffd76d2de

2021-11-23  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-22  Simon Marchi  <simon.marchi@efficios.com>

	gdb: pass more const target_waitstatus by reference
	While working on target_waitstatus changes, I noticed a few places where
	const target_waitstatus objects could be passed by reference instead of
	by pointers.  And in some cases, places where a target_waitstatus could
	be passed as const, but was not.  Convert them as much as possible.

	Change-Id: Ied552d464be5d5b87489913b95f9720a5ad50c5a

2021-11-22  Simon Marchi  <simon.marchi@efficios.com>

	gdb: introduce target_waitkind_str, use it in target_waitstatus::to_string
	I would like to print target_waitkind values in debug messages, so I
	think that a target_waitkind-to-string function would be useful.  While
	at it, use it in target_waitstatus::to_string.  This changes the output
	of target_waitstatus::to_string a bit, but I think it is for the better.
	The debug messages will show a string matching exactly the
	target_waitkind enumerator (minus the TARGET_WAITKIND prefix).

	As a convenience, make string_appendf return the same reference to
	string it got as a parameter.  This allows doing this:

	  return string_appendf (str, "foo");

	... keeping the code concise.

	Change-Id: I383dffc9c78614e7d0668b1516073905e798eef7

2021-11-22  Simon Marchi  <simon.marchi@efficios.com>

	gdb: rename target_waitstatus_to_string to target_waitstatus::to_string
	Make target_waitstatus_to_string a "to_string" method of
	target_waitstatus, a bit like we have ptid_t::to_string already.  This
	will save a bit of typing.

	Change-Id: Id261b7a09fa9fa3c738abac131c191a6f9c13905

2021-11-22  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Removed the redundant NULL pointer check in the riscv_update_subset.
	If we always use the .option arch to call the riscv_update_subset, then
	it is almost impossible that the input string will be NULL.  Therefore,
	just remove the redundant NULL pointer check in the riscv_update_subset.

	bfd/
		* elfxx-riscv.c (riscv_update_subset): Removed the redundant NULL
		pointer check.

2021-11-22  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Replace .option rvc/norvc with .option arch, +c/-c.
	Since the .option rvc/norvc directives are obsolete, replace them with
	the new proposed diretives: .option arch, +c/-c.  And also reset the
	riscv_opts.rvc flag for the .option arch directives.

	gas/
		* config/tc-riscv.c (s_riscv_option): Reset the riscv_opts.rvc
		for the .option arch directives.
		* testsuite/gas/riscv/align-1.s: Replace the obsolete .option
		rvc/norvc with .option arch, +c/-c.
		* testsuite/gas/riscv/c-add-addi.s: Likewise.
		* testsuite/gas/riscv/c-nonzero-imm.s: Likewise.
		* testsuite/gas/riscv/c-nonzero-reg.s: Likewise.
		* testsuite/gas/riscv/c-zero-imm-64.s: Likewise.
		* testsuite/gas/riscv/c-zero-imm.s: Likewise.
		* testsuite/gas/riscv/c-zero-reg.s: Likewise.
		* testsuite/gas/riscv/ext.s: Likewise.
		* testsuite/gas/riscv/mapping-01.s: Likewise.
		* testsuite/gas/riscv/mapping-02.s: Likewise.
		* testsuite/gas/riscv/mapping-03.s: Likewise.
		* testsuite/gas/riscv/mapping-04.s: Likewise.
		* testsuite/gas/riscv/no-relax-align-2.s: Likewise.
		* testsuite/gas/riscv/shamt-32.s: Likewise.
		* testsuite/gas/riscv/shamt-64.s: Likewise.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Fix x86_64 x32 build
	A build error on x86_64 with x32 abi was reported here (
	https://sourceware.org/pipermail/gdb/2021-November/049787.html ):
	...
	gdb/nat/amd64-linux-siginfo.c:280:42: error: \
	  'struct compat_x32_siginfo_t::<unnamed union>::<unnamed>' has no member \
	  named 'si_addr_bnd'
	280 | #define cpt_si_lower _sifields._sigfault.si_addr_bnd._lower
	| ^~~~~~~~~~~
	gdb/nat/amd64-linux-siginfo.c:337:38: note: in expansion of macro 'cpt_si_lower'
	337 | to->cpt_si_lower = from_ptrace.cpt_si_lower;
	| ^~~~~~~~~~~~
	...

	The problem is that code added in commit d3d7d1ba3bb "[gdb/tdep] Handle
	si_addr_bnd in compat_siginfo_from_siginfo" doesn't compile on an x86_64 x32
	setup, because compat_x32_siginfo_t doesn't have the si_addr_bnd fields.

	Fix this conservatively by disabling the code for x32.

	Tested on x86_64-linux.

2021-11-22  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: PR28610, Fix ASAN heap-buffer-overflow error in riscv_update_subset.
	The architecture parser in riscv_update_subset shouldn't check (or access)
	the pointer space which doesn't exist.

	bfd/
		pr 28610
		* elfxx-riscv.c (riscv_update_subset): The architecture parser
		shouldn't access the pointer space which doesn't exist.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Support .debug_line with DW_FORM_line_strp
	I noticed a new gcc option -gdwarf64 and tried it out (using gcc 11.2.1).

	With a test-case hello.c:
	...
	int
	main (void)
	{
	  printf ("hello\n");
	  return 0;
	}
	...
	compiled like this:
	...
	$ gcc -g -gdwarf64 ~/hello.c
	...
	I ran into:
	...
	$ gdb -q -batch a.out
	DW_FORM_line_strp pointing outside of .debug_line_str section \
	  [in module a.out]
	...

	Debugging gdb revealed that the string offset is:
	...
	(gdb) up
	    objfile=0x182ab70, str_offset=1378684502312,
	    form_name=0xeae9b5 "DW_FORM_line_strp")
	    at src/gdb/dwarf2/section.c:208
	208         error (_("%s pointing outside of %s section [in module %s]"),
	(gdb) p /x str_offset
	$1 = 0x14100000128
	(gdb)
	...
	which is read when parsing a .debug_line entry at 0x1e0.

	Looking with readelf at the 0x1e0 entry, we have:
	...
	 The Directory Table (offset 0x202, lines 2, columns 1):
	  Entry Name
	  0     (indirect line string, offset: 0x128): /data/gdb_versions/devel
	  1     (indirect line string, offset: 0x141): /home/vries
	...
	which in a hexdump looks like:
	...
	  0x00000200 1f022801 00004101 00000201 1f020f02
	...

	What happens is the following:
	- readelf interprets the DW_FORM_line_strp reference to .debug_line_str as
	  a 4 byte value, and sees entries 0x00000128 and 0x00000141.
	- gdb instead interprets it as an 8 byte value, and sees as first entry
	  0x0000014100000128, which is too big so it bails out.

	AFAIU, gdb is wrong.  It assumes DW_FORM_line_strp is 8 bytes on the basis
	that the corresponding CU is 64-bit DWARF.  However, the .debug_line
	contribution has it's own initial_length field, and encodes there that it's
	32-bit DWARF.

	Fix this by using the correct offset size for DW_FORM_line_strp references
	in .debug_line.

	Note: the described test-case does trigger this complaint (both with and
	without this patch):
	...
	$ gdb -q -batch -iex "set complaints 10" a.out
	During symbol reading: intermixed 32-bit and 64-bit DWARF sections
	...

	The reason that the CU has 64-bit dwarf is because -gdwarf64 was passed to
	gcc.  The reason that the .debug_line entry has 32-bit dwarf is because that's
	what gas generates.  Perhaps this is complaint-worthy, but I don't think it
	is wrong.

	Tested on x86_64-linux, using native and target board dwarf64.exp.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add target board dwarf64.exp
	Add a new target board dwarf64.exp, that runs test with -gdwarf64.

	Tested on x86_64-linux.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Support .debug_line v5 in dwarf assembler
	The v5 section version for .debug_line has:
	- two new fields address_size and segment_selector_size
	- a different way to encode the directory and filename tables.

	Add support for this in the dwarf assembler.

	For now, make the v5 directory and filename tables work with the v4 type of
	specification in the test-cases by adding duplicate entries at position 0.

	This will need to be properly fixed with an intrusive fix that changes how
	directory and filename entries are specified in the test-cases, f.i:
	...
	set diridx [include_dir "${srcdir}/${subdir}"]
	set fileidx [file_name "$srcfile" $diridx]
	...

	Tested on x86_64-linux.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Factor out _line_finalize_header
	Rather than generate dwarf immediately in procs include_dir and file_name,
	postpone generation and store the data in variables.  Then handle the
	generation in a new proc _line_finalize_header.

	Tested on x86-64-linux.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Support .debug_line v4 in dwarf assembler
	The .debug_line header got a new field in v4:
	maximum_operations_per_instruction.

	Generate this field in the dwarf assembler, for now hardcoding the value to 1,
	meaning non-VLIW.

	Tested on x86_64-linux.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add test-case gdb.dwarf2/dw2-lines.exp
	Add a new test-case gdb.dwarf2/dw2-lines.exp that tests various .debug_line
	sections.

	Tested on x86_64-linux.

2021-11-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Speed up MACRO_AT_* calls
	Currently, for each MACRO_AT_range or MACRO_AT_func in dwarf assembly the
	following is done:
	- $srcdir/$subdir/$srcfile is compiled to an executable using
	  flags "debug"
	- a new gdb instance is started
	- the new executable is loaded.

	This is inefficient, because the executable is identical within the same
	Dwarf::assemble call.

	Share the gdb instance in the same Dwarf::assemble invocation, which speeds
	up a make check with RUNTESTFLAGS like this to catch all dwarf assembly
	test-cases:
	...
	rtf=$(echo $(cd src/gdb/testsuite; find gdb.* -type f -name "*.exp" \
	      | xargs grep -l Dwarf::assemble))
	...
	from:
	...
	real    1m39.916s
	user    1m25.668s
	sys     0m21.377s
	...
	to:
	...
	real    1m29.512s
	user    1m17.316s
	sys     0m19.100s
	...

	Tested on x86_64-linux.

2021-11-22  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-21  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Remove duplicates in gdb.base/catch-signal.exp
	When running the testsuite I have the following:

	    Running .../gdb/testsuite/gdb.base/catch-signal.exp ...
	    DUPLICATE: gdb.base/catch-signal.exp: SIGHUP: continue
	    DUPLICATE: gdb.base/catch-signal.exp: SIGHUP: continue
	    DUPLICATE: gdb.base/catch-signal.exp: 1: continue
	    DUPLICATE: gdb.base/catch-signal.exp: 1: continue
	    DUPLICATE: gdb.base/catch-signal.exp: SIGHUP SIGUSR2: continue
	    DUPLICATE: gdb.base/catch-signal.exp: SIGHUP SIGUSR2: continue

	This patch removes DUPLICATE in gdb.base/catch-signal.exp by explicitly
	giving names to the offending 'gdb_test "continue"' statements to make
	them distinct.

	Tested on x86_64-linux.

2021-11-21  Mike Frysinger  <vapier@gentoo.org>

	sim: v850: fix cpu_option testsuite handling
	The v850 testsuite code has been testing the $opt variable, but this
	was never actually set anywhere globally or v850-specific.  Instead,
	this was a random variable leaking out of the sh testsuite code.  As
	far as I can tell, it has always been this way.  That means the code
	only ever tested the v850 cpu target (which is the default).

	This failure can be easily seen in practice by running the v850 code
	in isolation and seeing it crash:
	$ runtest v850/allinsns.exp
	...
	Running target unix
	Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
	Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
	Using ../../../sim/testsuite/config/default.exp as tool-and-target-specific interface file.
	WARNING: Assuming target board is the local machine (which is probably wrong).
	You may need to set your DEJAGNU environment variable.
	Running ../../../sim/testsuite/v850/allinsns.exp ...
	ERROR: tcl error sourcing ../../../sim/testsuite/v850/allinsns.exp.
	ERROR: tcl error code TCL LOOKUP VARNAME opt
	ERROR: can't read "opt": no such variable
	    while executing
	"switch -regexp -- $opt {

	Backing up a bit, the reason for this logic in the first place is
	because the common sim testsuite code makes an assumption about the
	assembler options with cpu_option -- the option and its value are
	always separated by an =.  This is not the case with v850.  So tweak
	the core sim logic a bit to support omitting the = so that we can
	switch v850 to the standard all_machs setting and avoid opt entirely.

2021-11-21  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-20  Jeff Law  <jeffreyalaw@gmail.com>

	    Fix intermittent failures on the H8, particularly H8/SX tests.
	    The upstream GCC tester has  showed spurious execution failures on the
	    H8 target for the H8/SX multilibs. I suspected memory corruption or an
	    uninitialized variable early as the same binary would sometimes work and
	    sometimes it got the wrong result. Worse yet, the point where the test
	    determined it was getting the wrong result would change.

	    Because it only happened on the H8/SX variant I was able to zero in on
	    the "mova" support and the "short form" of those instructions in particular.

	    As the code stands it checks if code->op3.type == 0 to try and identify cases
	    where op3 wasn't filled in and thus we've got the short form of the mova
	    instruction.

	    But for the short-form of those instructions we never set any of the "op3"
	    data structure. We get whatever was lying around -- it's usually zero and
	     thus things usually work, but if the stale data was nonzero, then we'd
	    fail to recognize the instruction as a short-form and fail to set up the
	    various fields appropriately.

	    I initially initialized the op3.type field to zero, but didn't like that
	     because it was inconsistent with how other operands were initialized.
	    Bringing consistency meant using -1 as the initializer value and adjusting
	    the check for short form mova appropriately.

	    I've had this in the upstream GCC tester for perhaps a year at this point
	    and haven't seen any of the intermittent failures again.

2021-11-20  Simon Marchi  <simon.marchi@efficios.com>

	gdbsupport: fix array-view compilation with c++11 && _GLIBCXX_DEBUG
	When building with -std=c++11 and -D_GLIBCXX_DEBUG=1, we get some errors
	like:

	      CXX    unittests/array-view-selftests.o
	    In file included from /home/smarchi/src/binutils-gdb/gdb/utils.h:25,
	                     from /home/smarchi/src/binutils-gdb/gdb/defs.h:630,
	                     from /home/smarchi/src/binutils-gdb/gdb/unittests/array-view-selftests.c:20:
	    /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/array-view.h: In instantiation of constexpr gdb::array_view<T> gdb::array_view<T>::slice(gdb::array_view<T>::size_type, gdb::array_view<T>::size_type) const [with T = unsigned char; gdb::array_view<T>::size_type = long unsigned int:
	    /home/smarchi/src/binutils-gdb/gdb/unittests/array-view-selftests.c:532:29:   required from here
	    /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/array-view.h:192:3: error: body of constexpr function constexpr gdb::array_view<T> gdb::array_view<T>::slice(gdb::array_view<T>::size_type, gdb::array_view<T>::size_type) const [with T = unsigned char; gdb::array_view<T>::size_type = long unsigned int not a return-statement
	      192 |   }
	          |   ^

	This is because constexpr functions in c++11 can only consist of a
	single return statement, so we can't have the gdb_assert in there.  Make
	the gdb_assert presence conditional to the __cplusplus version, to
	enable it only for c++14 and later.

	Change-Id: I2ac33f7b4bd1765ddc3ac8d07445b16ac1f340f0

2021-11-20  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Check if libsource-highlight is usable
	When building gdb with g++ 4.8.5, I ran into:
	...
	ld: source-cache.o: in function `source_cache::ensure(symtab*)':
	source-cache.c:207: undefined reference to \
	  srchilite::SourceHighlight::SourceHighlight(std::string const&)
	...

	[ I configured gdb without explicit settings related to source-highlight, so
	we're excercising the enable_source_highlight=auto scenario. ]

	The problem is that:
	- the source-highlight library is build with system compiler
	  g++ 7.5.0 which uses the new libstdc++ library abi (see
	  https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html )
	- gdb is build using g++ 4.8.5 which uses the old abi.

	[ There's a compatibility macro _GLIBCXX_USE_CXX11_ABI, but that doesn't work
	for this case.  Instead, it enables the opposite case where the
	source-highlight library is build with g++ 4.8.5 and gdb is build with
	g++ 7.5.0. ]

	Fix this by checking whether the source-highlight library is usable during
	configuration.

	In the enable_source_highlight=auto scenario, this allows the build to skip
	the unusable library and finish successfully.

	In the enable_source_highlight=yes scenario, this allows the build to error
	out earlier.

	Tested on x86_64-linux.

2021-11-20  Clément Chigot  <clement.chigot@atos.net>

	bfd: remove wrong comment in xcofflink.c
	This comment was long time ago associated to the function
	"xcoff_build_ldsyms" which have since been replaced by
	"xcoff_build_ldsym".

		* xcofflink.c: Remove wrong comment.

2021-11-20  Mike Frysinger  <vapier@gentoo.org>

	sim: bfin: fix short --env usage in testsuite
	Now that we have more than one option that matches "--env", the test
	config here doesn't work.  Use the explicit --environment.

2021-11-20  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-19  H.J. Lu  <hjl.tools@gmail.com>

	elfedit: Align --[in|out]put-abiversion usage
	Align

	  --input-abiversion [0-255]  Set input ABIVERSION
	  --output-abiversion [0-255] Set output ABIVERSION

	instead of

	  --input-abiversion [0-255]
	                              Set input ABIVERSION
	  --output-abiversion [0-255]
	                              Set output ABIVERSION

		* elfedit.c (usage): Align --[in|out]put-abiversion usage.

2021-11-19  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle runto fail in gdb.mi/mi-var-cp.exp
	On OBS I ran into:
	...
	PASS: gdb.mi/mi-var-cp.exp: run to mi-var-cp.cc:81 (set breakpoint)
	UNRESOLVED: gdb.mi/mi-var-cp.exp: unable to start target
	...
	followed by 81 FAILs and two more UNRESOLVEDs.

	I didn't manage to reproduce this, but I did notice that the initial
	problem causing the UNRESOLVED caused all subsequent UNRESOLVEDs and FAILs.

	I emulated the problem by commenting out the send_gdb "run\n" in
	mi_run_cmd_full.

	Fix this by:
	- handling mi_run_cmd failure in mi_get_inline_test
	- handling mi_run_inline_test failure in gdb.mi/mi-var-cp.exp, and
	  other test-cases using mi_get_inline_test

	Tested on x86_64-linux.

2021-11-19  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix 64-bit dwarf test-cases with -m32
	When running test-case gdb.dwarf2/loc-sec-offset.exp with target board -m32,
	I run into:
	...
	builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -m32 \
	  -fdiagnostics-color=never -c -o loc-sec-offset-dw641.o \
	  loc-sec-offset-dw64.S^M
	as: loc-sec-offset-dw641.o: unsupported relocation type: 0x1^M
	loc-sec-offset-dw64.S: Assembler messages:^M
	loc-sec-offset-dw64.S:29: Error: cannot represent relocation type \
	  BFD_RELOC_64^M
	...

	Looking at line 29, we have:
	...
	        .8byte        .Labbrev1_begin   /* Abbrevs */
	...

	It would be nice if the assembler could handle this somehow.  But I guess
	it's not unreasonable that an assembler for a 32-bit architecture will object
	to handling 64-bit labels.

	Instead, work around this in the dwarf assembler by emitting:
	...
	        .4byte        .Labbrev1_begin   /* Abbrevs (lsw) */
	        .4byte        0                 /* Abbrevs (msw) */
	...

	Tested on x86_64-linux with target board unix/-m32.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28383

2021-11-19  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.threads/thread-specific-bp.exp
	On OBS I ran into a failure in test-case gdb.threads/thread-specific-bp.exp:
	...
	(gdb) PASS: gdb.threads/thread-specific-bp.exp: non-stop: continue to end
	info breakpoint^M
	Num     Type           Disp Enb Address            What^M
	1       breakpoint     keep y   0x0000555555555167 in main at $src:36^M
	        breakpoint already hit 1 time^M
	2       breakpoint     keep y   0x0000555555555151 in start at $src:23^M
	        breakpoint already hit 1 time^M
	3       breakpoint     keep y   0x0000555555555167 in main at $src:36 thread 2^M
	        stop only in thread 2^M
	4       breakpoint     keep y   0x000055555555515c in end at $src:29^M
	        breakpoint already hit 1 time^M
	(gdb) [Thread 0x7ffff7db1640 (LWP 19984) exited]^M
	Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M
	FAIL: gdb.threads/thread-specific-bp.exp: non-stop: \
	  thread-specific breakpoint was deleted (timeout)
	...

	Fix this by waiting for the "[Thread 0x7ffff7db1640 (LWP 19984) exited]"
	message before issuing the "info breakpoint command".

	Tested on x86_64-linux.

2021-11-19  Christina Schimpe  <christina.schimpe@intel.com>

	gdb/testsuite: Extend tests for print of cv qualifiers
	This commit supplements whatis and ptype command tests for print of
	const-volatile qualifiers.

	gdb/testsuite/ChangeLog:
	2021-11-16  Christina Schimpe  <christina.schimpe@intel.com>

		* gdb.cp/ptype-cv-cp.cc: New const and volatile typedef
		  variables.
		* gdb.cp/ptype-cv-cp.exp: Add new tests.

2021-11-19  Christina Schimpe  <christina.schimpe@intel.com>

	gdb: Print cv qualifiers if class attributes are substituted
	Make ptype print const/volatile qualifiers when template or typedef
	attributes are substituted.

	For a programm like
	~~~
	template<typename DataT>
	class Cfoo
	{
	  typedef float myfloat;
	public:
	  DataT me0;
	  const DataT me1=1;
	  const myfloat me2=2.0;
	};

	int main()
	{
	  Cfoo<int> cfoo;
	  return 0;
	}
	~~~

	gdb outputs the following type for cfoo's attributes:

	~~~
	(gdb) b 14
	Breakpoint 1 at 0x1170: file tmp.cc, line 14.
	(gdb) run
	Starting program: /tmp

	Breakpoint 1, main () at tmp.cc:14
	14        return 0;
	(gdb) ptype cfoo
	type = class Cfoo<int> [with DataT = int] {
	  public:
	    DataT me0;
	    DataT me1;
	    myfloat me2;

	  private:
	    typedef float myfloat;
	}

	~~~

	The cv qualifiers (const in this case) are ignored for me1 and me2.

	After:
	~~~
	(gdb) ptype cfoo
	type = class Cfoo<int> [with DataT = int] {
	  public:
	    DataT me0;
	    const DataT me1;
	    const myfloat me2;

	  private:
	    typedef float myfloat;
	}
	~~~

	gdb/ChangeLog:
	2021-11-16  Christina Schimpe  <christina.schimpe@intel.com>

		* gdb/c-typeprint.c: Print cv qualifiers in case of parameter
		  substitution.

	gdb/testsuite/ChangeLog:
	2021-11-16  Christina Schimpe  <christina.schimpe@intel.com>

		* gdb.cp/templates.cc: 	New template class Cfoo with const,
		  template, typdef and integer attributes.
		* gdb.cp/templates.exp: Add new test using ptype and ptype/r
		  commmands for template class CFoo.

2021-11-19  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Support new .option arch directive.
	https://github.com/riscv/riscv-asm-manual/pull/67

	Format:
	.option arch, +<extension><version>, ...
	.option arch, -<extension>
	.option arch, =<ISA string>

	The new direcitve is used to enable/disable extensions for the specific
	code region.  For example,

	.attribute arch, "rv64ic"   # arch = rv64i2p0_c2p0
	.option push
	.option arch, +d2p0, -c     # arch = rv64i2p0_f2p0_d2p0, f is added implied
	.option arch, =rv32gc       # arch = rv32i2p0_m2p0_a2p0_f2p0_d2p0_c2p0
	.option pop                 # arch = rv64i2p0_c2p0

	Note that,
	1. ".option rvc/norvc" have the same behavior as ".option arch +c/-c".
	2. ".option arch -i" is illegal, since we cannot remove base i extension.
	3. If arch=rv64i2p0, then ".option arch, +i3p0" will update the i's version
	   from 2.0 to 3.0.
	4. If arch=rv64i3p0, then ".option arch, +i" will update the i's version
	   from 2.0 to the default one according to the chosen isa spec.

	bfd/
		* elfxx-riscv.c (riscv_add_subset): If the subset is already added,
		and the new versions are not RISCV_UNKNOWN_VERSION, then update the
		versions to the subset list.
		(riscv_copy_subset): New function.  Copy the subset from list.
		(riscv_copy_subset_list): New function.  Return the new copyed list.
		(riscv_update_subset): Updated to make .option arch directives workable.
		* elfxx-riscv.h: Updated.
	gas/
		* config/tc-riscv.c (riscv_subsets): Defined as a pointer.
		(riscv_rps_as): Init the subset_list to NULL, we will set it later
		once riscv_opts_stack is created or updated.
		(struct riscv_option_stack, riscv_opts_stack): Moved forward.
		(riscv_set_arch): Updated.
		(s_riscv_option): Support new .option arch directive, to add, remove
		or update subsets for the specific code region.
		(riscv_write_out_attrs): Updated.
		* doc/c-riscv.texi: Added document for new .option arch directive.
		* testsuite/gas/riscv/option-arch-01a.d: New testcase.
		* testsuite/gas/riscv/option-arch-01b.d: Likewise.
		* testsuite/gas/riscv/option-arch-01.s: Likewise..
		* testsuite/gas/riscv/option-arch-02.d: Likewise.
		* testsuite/gas/riscv/option-arch-02.s: Likewise.
		* testsuite/gas/riscv/option-arch-fail.d: Likewise.
		* testsuite/gas/riscv/option-arch-fail.l: Likewise.
		* testsuite/gas/riscv/option-arch-fail.s: Likewise.

2021-11-19  Alan Modra  <amodra@gmail.com>

	Re: Add multibyte character warning option to the assembler.
	On hppa*-hp-hpux* run_dump_test edits the test file, adjusting .comm
	directives to suit those target's unusual syntax.  Thus gas is passed
	a temporary file name.

		* testsuite/gas/all/multibyte1.l: Ignore file name.

2021-11-19  Mike Frysinger  <vapier@gentoo.org>

	sim: install various doc files

2021-11-19  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Support STO_RISCV_VARIANT_CC and DT_RISCV_VARIANT_CC.
	This is the original discussion,
	https://github.com/riscv/riscv-elf-psabi-doc/pull/190

	And here is the glibc part,
	https://sourceware.org/pipermail/libc-alpha/2021-August/129931.html

	For binutils part, we need to support a new direcitve: .variant_cc.
	The function symbol marked by .variant_cc means it need to be resolved
	directly without resolver for dynamic linker.  We also add a new dynamic
	entry, STO_RISCV_VARIANT_CC, to indicate there are symbols with the
	special attribute in the dynamic symbol table of the object.

	I heard that llvm already have supported this in their mainline, so
	I think it's time to commit this.

	bfd/
		* elfnn-riscv.c (riscv_elf_link_hash_table): Added variant_cc
		flag. It is used to check if relocations for variant CC symbols
		may be present.
		(allocate_dynrelocs): If the symbol has STO_RISCV_VARIANT_CC
		flag, then raise the variant_cc flag of riscv_elf_link_hash_table.
		(riscv_elf_size_dynamic_sections): Added dynamic entry for
		variant_cc.
		(riscv_elf_merge_symbol_attribute): New function, used to merge
		non-visibility st_other attributes, including STO_RISCV_VARIANT_CC.
	binutils/
		* readelf.c (get_riscv_dynamic_type): New function.
		(get_dynamic_type): Called get_riscv_dynamic_type for riscv targets.
		(get_riscv_symbol_other): New function.
		(get_symbol_other): Called get_riscv_symbol_other for riscv targets.
	gas/
		* config/tc-riscv.c (s_variant_cc): Marked symbol that it follows a
		variant CC convention.
		(riscv_elf_copy_symbol_attributes): Same as elf_copy_symbol_attributes,
		but without copying st_other.  If a function symbol has special st_other
		value set via directives, then attaching an IFUNC resolver to that symbol
		should not override the st_other setting.
		(riscv_pseudo_table): Support variant_cc diretive.
		* config/tc-riscv.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Defined.
		* testsuite/gas/riscv/variant_cc-set.d: New testcase.
		* testsuite/gas/riscv/variant_cc-set.s: Likewise.
		* testsuite/gas/riscv/variant_cc.d: Likewise.
		* testsuite/gas/riscv/variant_cc.s: Likewise.
	include/
		* elf/riscv.h (DT_RISCV_VARIANT_CC): Defined to (DT_LOPROC + 1).
		(STO_RISCV_VARIANT_CC): Defined to 0x80.
	ld/
		* testsuite/ld-riscv-elf/variant_cc-1.s: New testcase.
		* testsuite/ld-riscv-elf/variant_cc-2.s: Likewise.
		* testsuite/ld-riscv-elf/variant_cc-now.d: Likewise.
		* testsuite/ld-riscv-elf/variant_cc-r.d: Likewise.
		* testsuite/ld-riscv-elf/variant_cc-shared.d: Likewise.
		* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.

2021-11-19  Mike Frysinger  <vapier@gentoo.org>

	sim: use program_transform_name for libsim
	Instead of always using target_alias as a prefix on the name, use
	program_transform_name instead so that the library is scoped in the
	same way as the run program.

	sim: avoid installing headers when there is no sim
	If we aren't building any sims, don't install the sim headers as they
	won't be useful to anyone.

2021-11-19  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-18  Kevin Buettner  <kevinb@redhat.com>

	dprintf-execution-x-script.exp: Adjust test for native-extended-gdbserver
	Without this commit, doing...

	make check RUNTESTFLAGS="--target_board=native-extended-gdbserver" \
	           TESTS="gdb.base/dprintf-execution-x-script.exp"

	...will show one failure.

	Here's a snippet from gdb.log showing the circumstances - I've trimmed
	the paths for readability:

	builtin_spawn gdb -nw -nx -data-directory data-directory -iex set height 0 -iex set width 0 -iex set auto-connect-native-target off -iex set sysroot -ex set height unlimited -x testsuite/gdb.base/dprintf-execution-x-script.gdb --args testsuite/outputs/gdb.base/dprintf-execution-x-script/dprintf-execution-x-script
	...
	Reading symbols from testsuite/outputs/gdb.base/dprintf-execution-x-script/dprintf-execution-x-script...
	Dprintf 1 at 0x40116e: file testsuite/gdb.base/dprintf-execution-x-script.c, line 38.
	Breakpoint 2 at 0x40113a: file testsuite/gdb.base/dprintf-execution-x-script.c, line 26.
	testsuite/gdb.base/dprintf-execution-x-script.gdb:21: Error in sourced command file:
	Don't know how to run.  Try "help target".
	(gdb) FAIL: gdb.base/dprintf-execution-x-script.exp: load and run script with -x
	...
	GNU gdb (GDB) 12.0.50.20211118-git
	Copyright (C) 2021 Free Software Foundation, Inc.
	...
	(gdb) set height 0
	(gdb) set width 0
	(gdb) builtin_spawn gdbserver/gdbserver --once --multi localhost:2346
	Listening on port 2346
	target extended-remote localhost:2346
	Remote debugging using localhost:2346
	...
	[Tests after this point will pass.]

	Note that the command which spawns gdb prevents the gdb script from
	using the native target via "-iex set auto-connect-native-target off".

	Moreover, the script in question contains a "run" command, so GDB
	doesn't know how to run (since it's prevented from using the native
	target and no alternate "target" command has been issued.  But, once
	GDB finishes starting up, the test will spawn a gdbserver and then
	connect to it.  The other (two) tests after this point both pass.

	I've fixed this by using gdb_test_multiple instead of gdb_test.
	When a "Don't know how to run message" is received, the test is
	unsupported.

	I've also added a comment explaining the reason for needing to check
	for "Don't know how to run" despite bailing out at the top of the test
	via:

	  if ![target_can_use_run_cmd] {
	      return 0
	  }

2021-11-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix array-view-selftests.c build with g++ 4.8
	When building with g++ 4.8, I get:

	    CXX    unittests/array-view-selftests.o
	  /home/smarchi/src/binutils-gdb/gdb/unittests/array-view-selftests.c:123:42: error: expected 'class' before 'Container'
	   template<template<typename ...> typename Container>
						    ^

	I am no C++ template expert, but it looks like if I change "typename" for
	"class", as the compiler kind of suggests, the code compiles.

	Change-Id: I9c3edd29fb2b190069f0ce0dbf3bc3604d175f48

2021-11-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix ia64-tdep.c build with g++ 4.8
	When building with g++ 4.8, I get:

	      CXX    ia64-tdep.o
	    /home/smarchi/src/binutils-gdb/gdb/ia64-tdep.c:3862:1: error: could not convert '{ia64_allocate_new_rse_frame, ia64_store_argument_in_slot, ia64_set_function_addr}' from '<brace
	-enclosed initializer list>' to 'const ia64_infcall_ops'
	     };
	     ^

	This happens since commit 345bd07cce3 ("gdb: fix gdbarch_tdep ODR
	violation"), which added default values for ia64_infcall_ops fields.  It
	looks like g++ 4.8 doesn't like initializing the ia64_infcall_ops object
	using the brace-enclosed initializer list when the ia64_infcall_ops
	fields are assigned default values.

	Later compilers don't have a problem with that, so I suppose that the
	code is correct, but still, change it to make gcc 4.8 happy.  Don't
	initialize the fields of ia64_infcall_ops directly, instead
	default-initialize ia64_gdbarch_tdep::infcall_ops.

	Change-Id: I35e3a61abd7b7bbcafe6cb207078c738c5266d76

2021-11-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: move AIX_TEXT_SEGMENT_BASE to rs6000-aix-tdep.c, remove rs6000-tdep.h
	The contents of rs6000-tdep.h (AIX_TEXT_SEGMENT_BASE) is AIX-specific,
	so I thought that this file should be named rs6000-aix-tdep.h.  But
	there's already a rs6000-aix-tdep.h, so then I though
	AIX_TEXT_SEGMENT_BASE should simply be moved there, and rs6000-tdep.h
	deleted.  But then I realized that AIX_TEXT_SEGMENT_BASE is only used in
	rs6000-aix-tdep.c, so move it to the beginning of that file.

	Change-Id: Ia212c6fae202f31aedb46575821cd642beeda7a3

2021-11-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: rename rs6000-nat.c to rs6000-aix-nat.c
	This file seems to be AIX-specific, according to its contents and
	configure.nat.  Rename it to rs6000-aix-nat.c, to make that clear (and
	to follow the convention).

	Change-Id: Ib418dddc6b79b2e28f64431121742b5e87f5f4f5

2021-11-18  Tom de Vries  <tdevries@suse.de>

	[gdb/doc] Fix negative repeat count examining memory example
	The documentation for the examining memory command x contains an example:
	...
	You can also specify a negative repeat count to examine memory backward from
	the given address.  For example, 'x/-3uh 0x54320' prints three halfwords (h)
	at 0x54314, 0x54328, and 0x5431c.
	...

	The 0x54328 looks like a typo, which was intended to be 0x54318.

	But the series uses a 4-byte distance, while the halfword size used in the
	command means a 2-byte distance, so the series should be:
	...
	0x5431a, 0x5431c, and 0x5431e.
	...

	Fix this by updating the addresses in the example accordingly.

	Reported here ( https://sourceware.org/pipermail/gdb/2021-November/049784.html
	).

2021-11-18  Nick Clifton  <nickc@redhat.com>

	Add multibyte character warning option to the assembler.
		* as.c (parse_args): Add support for --multibyte-handling.
		* as.h (multibyte_handling): Declare.
		* app.c (scan_for_multibyte_characters): New function.
		(do_scrub_chars): Call the new function if multibyte warning is
		enabled.
		* input-scrub,c (input_scrub_next_buffer): Call the multibyte
		scanning function if multibyte warnings are enabled.
		* symbols.c (struct symbol_flags): Add multibyte_warned bit.
		(symbol_init): Call the multibyte scanning function if multibyte
		symbol warnings are enabled.
		(S_SET_SEGMENT): Likewise.
		* NEWS: Mention the new feature.
		* doc/as.texi: Document the new feature.
		* testsuite/gas/all/multibyte.s: New test source file.
		* testsuite/gas/all/multibyte1.d: New test driver file.
		* testsuite/gas/all/multibyte1.l: New test expected output.
		* testsuite/gas/all/multibyte2.d: New test driver file.
		* testsuite/gas/all/multibyte2.l: New test expected output.
		* testsuite/gas/all/gas.exp: Run the new tests.

2021-11-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: include gdbarch.h in all files extending gdbarch_tdep
	Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") made a bunch
	of files define a *_gdbarch_tdep class that inherits from a gdbarch_tdep
	base.  But some of these files don't include gdbarch.h, where
	gdbarch_tdep is defined.  This may cause build errors if gdbarch.h isn't
	already included by chance by some other header file.  Avoid this by
	making them include gdbarch.h.

	Change-Id: If433d302007e274daa4f656cfc94f769cf1aa68a

2021-11-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: make gdb_assert_not_reached accept a format string
	Change gdb_assert_not_reached to accept a format string plus
	corresponding arguments.  This allows giving more precise messages.

	Because the format string passed by the caller is prepended with a "%s:"
	to add the function name, the callers can no longer pass a translated
	string (`_(...)`).  Make the gdb_assert_not_reached include the _(),
	just like the gdb_assert_fail macro just above.

	Change-Id: Id0cfda5a57979df6cdaacaba0d55dd91ae9efee7

2021-11-18  Carl Love  <cel@us.ibm.com>

	gdb fix for catch-syscall.exp
	Remove check_continue "execve" from Proc test_catch_syscall_execve.

	The check_continue proceedure checs that the command, execve, starts and
	checks for the return from the command.  The execve command starts a new
	program and thus the return from the command causing the test to fail.

	The call to proc check_continue "execve" is removed and replaced with
	just the call to check_call_to_syscall "execve" to verify the command
	executed.  The next test in proc test_catch_syscall_execve verifies that
	the new program started and hit the break point in main.

	Update the check for the PowerPC architecture.  Power Little Endian systems
	include "le" in the name.  The istarget "power64-*-linux*" check fails to
	match LE sytems.  The expected string is updated to capture both Big Endian
	and Little Endian systems.  Power 10 LE istarget prints as:
	powerpc64le-unknown-linux-gnu.

	This patch fixes three failures and the error:

	    ERROR: can't read "arch1": no such variable

	Patch tested on Power 10 ppc64le GNU/Linux platform.

2021-11-18  Carl Love  <cel@us.ibm.com>

	gdb: PowerPC fix gdb.base/break-interp.exp
	This patch fixes eight test failures on PowerPC for the test
	gdb.base/break-interp.exp. The patch adds a funtion and registers it to
	setup the displaced stepping for ppc-linux platform.  The patch moves the
	struct ppc_inferior_data to the ppc-tdep.h include file to make it visible
	to the ppc-linux-tdep.c and rs6000-tdep.c files.  Additionally the function
	get_ppc_per_inferior is made external in ppc-tdep.h to make it visible in
	both files.

	Tested on Power 10 ppc64le-linux with no regressions.

2021-11-18  Carl Love  <cel@us.ibm.com>

	gdb fix PowerPC test gdb.arch/ppc-longdouble.exp
	The test complains of duplicate tests.

	DUPLICATE: gdb.arch/ppc-longdouble.exp: continue to breakpoint: return

	The do_test calls gdb_continue_to_breakpoint "return".  The duplicates
	are the result of calling do_test three times with different arguments.

	This patch fixes the duplicate tests by adding $name to the
	gdb_continue_to_breakpoint argument.

	Patch tested on Power 10  ppc64le GNU/Linux, no duplicate tests reported,
	no new regression errors.

2021-11-18  H.J. Lu  <hjl.tools@gmail.com>

	elf/x86: Issue an error on discarded output .plt section
	Issue an error, instead of crash, on discarded output .plt section.

	bfd/

		PR ld/28597
		* elf32-i386.c (elf_i386_finish_dynamic_sections): Issue an error
		on discarded output .plt section.
		* elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.

	ld/

		PR ld/28597
		* testsuite/ld-elf/pr28597.d: New file.
		* testsuite/ld-elf/pr28597.s: Likewise.
		* testsuite/ld-elf/pr28597.t: Likewise.

2021-11-18  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add missing wait in gdb.base/signals-state-child.exp
	On OBS I ran into:
	...
	(gdb) shell diff -s outputs/gdb.base/signals-state-child/standalone.txt \
	  outputs/gdb.base/signals-state-child/gdb.txt^M
	diff: outputs/gdb.base/signals-state-child/standalone.txt: \
	  No such file or directory^M
	(gdb) FAIL: gdb.base/signals-state-child.exp: signals states are identical
	...

	I managed to reproduce this by adding "sleep (5)" at the start of main in
	signals-state-child.c.

	Fix this by waiting on the result of the spawned command.

	Tested on x86_64-linux.

2021-11-18  Alan Modra  <amodra@gmail.com>

	Re: Don't compile some opcodes files when bfd is 32-bit only
	Put bpf back in the 32-bit targets, even though bpf requires a 64-bit
	bfd.  bpf sim support apparently works without being 64-bit.

		* Makefile.am (TARGET64_LIBOPCODES_CFILES): Move bpf files..
		(TARGET32_LIBOPCODES_CFILES): ..to here.
		* Makefile.in: Regenerate.

2021-11-18  Alan Modra  <amodra@gmail.com>

	Pass DEBUGINFOD_CFLAGS when compiling dwarf.c
	Pick up the elfutils/debuginfod.h install location -I flags from
	a variable set by debuginfod.m4 (via pkg.m4 and pkg-config).

		* Makefile.am (DEBUGINFOD_CFLAGS): Define.
		(dwarf.@OBJECT@): New rule.

2021-11-18  jiawei  <jiawei@iscas.ac.cn>

	RISC-V: Add testcases for z[fdq]inx
	Use gpr when the zfinx enable, the testcases contain float
	instructions that reuse by z[fdq]inx.

	gas/ChangeLog:

	* testsuite/gas/riscv/zdinx.d: New test.
	* testsuite/gas/riscv/zdinx.s: New test.
	* testsuite/gas/riscv/zfinx.d: New test.
	* testsuite/gas/riscv/zfinx.s: New test.
	* testsuite/gas/riscv/zqinx.d: New test.
	* testsuite/gas/riscv/zqinx.s: New test.

	Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>

2021-11-18  jiawei  <jiawei@iscas.ac.cn>

	RISC-V: Add instructions and operand set for z[fdq]inx
	Reuse float instructions in INSN_CLASS_F/D/Q, use riscv_subset_supports to
	verify if z*inx enabled and use gpr instead of fpr when z*inx is enable.

	bfd/ChangeLog:

	* elfxx-riscv.c (riscv_multi_subset_supports): Added support for
	  z*inx extension.

	gas/ChangeLog:

	* config/tc-riscv.c (riscv_ip): Added register choice for z*inx.

	include/ChangeLog:

	* opcode/riscv.h (enum riscv_insn_class): Reused INSN_CLASS_* for z*inx.

	opcodes/ChangeLog:

	* riscv-dis.c (riscv_disassemble_insn): Added disassemble check for
	  z*inx.
	* riscv-opc.c: Reused INSN_CLASS_* for z*inx.

	Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>

2021-11-18  jiawei  <jiawei@iscas.ac.cn>

	RISC-V: Add mininal support for z[fdq]inx
	Minimal support for zfinx, zdinx, zqinx. Like f/d/q, the zqinx
	imply zdinx and zdinx imply zfinx, where zfinx are not compatible
	with f/d/q.

	bfd/ChangeLog:

	* elfxx-riscv.c (riscv_implicit_subsets): Added implicit rules
	for z*inx extensions.
	(riscv_supported_std_z_ext): Added entries for z*inx.
	(riscv_parse_check_conflicts): Added conflict check for z*inx.

	Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>

2021-11-18  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] SVE2 instructions added to support SME
	This patch is adding new SVE2 instructions added to support SME extension.
	The following SVE2 instructions are added by the SME architecture:
	* PSEL,
	* REVD, SCLAMP and UCLAMP.

	gas/ChangeLog:

		* config/tc-aarch64.c (parse_sme_pred_reg_with_index):
		New parser.
		(parse_operands): New parser.
		* testsuite/gas/aarch64/sme-9-illegal.d: New test.
		* testsuite/gas/aarch64/sme-9-illegal.l: New test.
		* testsuite/gas/aarch64/sme-9-illegal.s: New test.
		* testsuite/gas/aarch64/sme-9.d: New test.
		* testsuite/gas/aarch64/sme-9.s: New test.

	include/ChangeLog:

		* opcode/aarch64.h (enum aarch64_opnd): New operand
		AARCH64_OPND_SME_PnT_Wm_imm.

	opcodes/ChangeLog:

		* aarch64-asm.c (aarch64_ins_sme_pred_reg_with_index):
		New inserter.
		* aarch64-dis.c (aarch64_ext_sme_pred_reg_with_index):
		New extractor.
		* aarch64-opc.c (aarch64_print_operand): Printout of
		OPND_SME_PnT_Wm_imm.
		* aarch64-opc.h (enum aarch64_field_kind): New bitfields
		FLD_SME_Rm, FLD_SME_i1, FLD_SME_tszh, FLD_SME_tszl.
		* aarch64-tbl.h (OP_SVE_NN_BHSD): New qualifier.
		(OP_SVE_QMQ): New qualifier.
		(struct aarch64_opcode): New instructions PSEL, REVD,
		SCLAMP and UCLAMP.
		aarch64-asm-2.c: Regenerate.
		aarch64-dis-2.c: Regenerate.
		aarch64-opc-2.c: Regenerate.

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] Add new SME system registers
	This patch is adding miscellaneous SME related system registers.

	gas/ChangeLog:

		* testsuite/gas/aarch64/sme-sysreg.d: New test.
		* testsuite/gas/aarch64/sme-sysreg.s: New test.
		* testsuite/gas/aarch64/sme-sysreg-illegal.d: New test.
		* testsuite/gas/aarch64/sme-sysreg-illegal.l: New test.
		* testsuite/gas/aarch64/sme-sysreg-illegal.s: New test.

	opcodes/ChangeLog:

		* aarch64-opc.c: New system registers id_aa64smfr0_el1,
		smcr_el1, smcr_el12, smcr_el2, smcr_el3, smpri_el1,
		smprimap_el2, smidr_el1, tpidr2_el0 and mpamsm_el1.

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] Add SME mode selection and state access instructions
	This patch is adding new SME mode selection and state access instructions:
	* Add SMSTART and SMSTOP instructions.
	* Add SVCR system register.

	gas/ChangeLog:

		* config/tc-aarch64.c (parse_sme_sm_za): New parser.
		(parse_operands): New parser.
		* testsuite/gas/aarch64/sme-8-illegal.d: New test.
		* testsuite/gas/aarch64/sme-8-illegal.l: New test.
		* testsuite/gas/aarch64/sme-8-illegal.s: New test.
		* testsuite/gas/aarch64/sme-8.d: New test.
		* testsuite/gas/aarch64/sme-8.s: New test.

	include/ChangeLog:

		* opcode/aarch64.h (enum aarch64_opnd): New operand
		AARCH64_OPND_SME_SM_ZA.
		(enum aarch64_insn_class): New instruction classes
		sme_start and sme_stop.

	opcodes/ChangeLog:

		* aarch64-asm.c (aarch64_ins_pstatefield): New inserter.
		(aarch64_ins_sme_sm_za): New inserter.
		* aarch64-dis.c (aarch64_ext_imm): New extractor.
		(aarch64_ext_pstatefield): New extractor.
		(aarch64_ext_sme_sm_za): New extractor.
		* aarch64-opc.c (operand_general_constraint_met_p):
		New pstatefield value for SME instructions.
		(aarch64_print_operand): Printout for OPND_SME_SM_ZA.
		(SR_SME): New register SVCR.
		* aarch64-opc.h (F_REG_IN_CRM): New register endcoding.
		* aarch64-opc.h (F_IMM_IN_CRM): New immediate endcoding.
		(PSTATE_ENCODE_CRM): Encode CRm field.
		(PSTATE_DECODE_CRM): Decode CRm field.
		(PSTATE_ENCODE_CRM_IMM): Encode CRm immediate field.
		(PSTATE_DECODE_CRM_IMM): Decode CRm immediate field.
		(PSTATE_ENCODE_CRM_AND_IMM): Encode CRm and immediate
		field.
		* aarch64-tbl.h (struct aarch64_opcode): New SMSTART
		and SMSTOP instructions.
		aarch64-asm-2.c: Regenerate.
		aarch64-dis-2.c: Regenerate.
		aarch64-opc-2.c: Regenerate.

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] Add LD1x, ST1x, LDR and STR instructions
	This patch is adding new loads and stores defined by SME instructions.

	gas/ChangeLog:

		* config/tc-aarch64.c (parse_sme_address): New parser.
		(parse_sme_za_hv_tiles_operand_with_braces): New parser.
		(parse_sme_za_array): New parser.
		(output_operand_error_record): Print error details if
		present.
		(parse_operands): Support new operands.
		* testsuite/gas/aarch64/sme-5-illegal.d: New test.
		* testsuite/gas/aarch64/sme-5-illegal.l: New test.
		* testsuite/gas/aarch64/sme-5-illegal.s: New test.
		* testsuite/gas/aarch64/sme-5.d: New test.
		* testsuite/gas/aarch64/sme-5.s: New test.
		* testsuite/gas/aarch64/sme-6-illegal.d: New test.
		* testsuite/gas/aarch64/sme-6-illegal.l: New test.
		* testsuite/gas/aarch64/sme-6-illegal.s: New test.
		* testsuite/gas/aarch64/sme-6.d: New test.
		* testsuite/gas/aarch64/sme-6.s: New test.
		* testsuite/gas/aarch64/sme-7-illegal.d: New test.
		* testsuite/gas/aarch64/sme-7-illegal.l: New test.
		* testsuite/gas/aarch64/sme-7-illegal.s: New test.
		* testsuite/gas/aarch64/sme-7.d: New test.
		* testsuite/gas/aarch64/sme-7.s: New test.

	include/ChangeLog:

		* opcode/aarch64.h (enum aarch64_opnd): New operands.
		(enum aarch64_insn_class): Added sme_ldr and sme_str.
		(AARCH64_OPDE_UNTIED_IMMS): New operand error kind.

	opcodes/ChangeLog:

		* aarch64-asm.c (aarch64_ins_sme_za_hv_tiles): New inserter.
		(aarch64_ins_sme_za_list): New inserter.
		(aarch64_ins_sme_za_array): New inserter.
		(aarch64_ins_sme_addr_ri_u4xvl): New inserter.
		* aarch64-asm.h (AARCH64_DECL_OPD_INSERTER): Added
		ins_sme_za_list, ins_sme_za_array and ins_sme_addr_ri_u4xvl.
		* aarch64-dis.c (aarch64_ext_sme_za_hv_tiles): New extractor.
		(aarch64_ext_sme_za_list): New extractor.
		(aarch64_ext_sme_za_array): New extractor.
		(aarch64_ext_sme_addr_ri_u4xvl): New extractor.
		* aarch64-dis.h (AARCH64_DECL_OPD_EXTRACTOR): Added
		ext_sme_za_list, ext_sme_za_array and ext_sme_addr_ri_u4xvl.
		* aarch64-opc.c (operand_general_constraint_met_p):
		(aarch64_match_operands_constraint): Handle sme_ldr, sme_str
		and sme_misc.
		(aarch64_print_operand): New operands supported.
		* aarch64-tbl.h (OP_SVE_QUU): New qualifier.
		(OP_SVE_QZU): New qualifier.
		aarch64-asm-2.c: Regenerate.
		aarch64-dis-2.c: Regenerate.
		aarch64-opc-2.c: Regenerate.

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] Add ZERO instruction
	This patch is adding ZERO (a list of 64-bit element ZA tiles)
	instruction.

	gas/ChangeLog:

		* config/tc-aarch64.c (parse_sme_list_of_64bit_tiles):
		New parser.
		(parse_operands): Handle OPND_SME_list_of_64bit_tiles.
		* testsuite/gas/aarch64/sme-4-illegal.d: New test.
		* testsuite/gas/aarch64/sme-4-illegal.l: New test.
		* testsuite/gas/aarch64/sme-4-illegal.s: New test.
		* testsuite/gas/aarch64/sme-4.d: New test.
		* testsuite/gas/aarch64/sme-4.s: New test.

	include/ChangeLog:

		* opcode/aarch64.h (enum aarch64_opnd): New operand
		AARCH64_OPND_SME_list_of_64bit_tiles.

	opcodes/ChangeLog:

		* aarch64-opc.c (print_sme_za_list): New printing function.
		(aarch64_print_operand): Handle OPND_SME_list_of_64bit_tiles.
		* aarch64-opc.h (enum aarch64_field_kind): New bitfield
		FLD_SME_zero_mask.
		* aarch64-tbl.h (struct aarch64_opcode): New ZERO instruction.
		aarch64-asm-2.c: Regenerate.
		aarch64-dis-2.c: Regenerate.
		aarch64-opc-2.c: Regenerate.

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] Add MOV and MOVA instructions
	This patch is adding new MOV (alias) and MOVA SME instruction.

	gas/ChangeLog:

		* config/tc-aarch64.c (enum sme_hv_slice): new enum.
		(struct reloc_entry): Added ZAH and ZAV registers.
		(parse_sme_immediate): Immediate parser.
		(parse_sme_za_hv_tiles_operand): ZA tile parser.
		(parse_sme_za_hv_tiles_operand_index): Index parser.
		(parse_operands): Added ZA tile parser calls.
		(REGNUMS): New macro. Regs with suffix.
		(REGSET16S): New macro. 16 regs with suffix.
		* testsuite/gas/aarch64/sme-2-illegal.d: New test.
		* testsuite/gas/aarch64/sme-2-illegal.l: New test.
		* testsuite/gas/aarch64/sme-2-illegal.s: New test.
		* testsuite/gas/aarch64/sme-2.d: New test.
		* testsuite/gas/aarch64/sme-2.s: New test.
		* testsuite/gas/aarch64/sme-2a.d: New test.
		* testsuite/gas/aarch64/sme-2a.s: New test.
		* testsuite/gas/aarch64/sme-3-illegal.d: New test.
		* testsuite/gas/aarch64/sme-3-illegal.l: New test.
		* testsuite/gas/aarch64/sme-3-illegal.s: New test.
		* testsuite/gas/aarch64/sme-3.d: New test.
		* testsuite/gas/aarch64/sme-3.s: New test.
		* testsuite/gas/aarch64/sme-3a.d: New test.
		* testsuite/gas/aarch64/sme-3a.s: New test.

	include/ChangeLog:

		* opcode/aarch64.h (enum aarch64_opnd): New enums
		AARCH64_OPND_SME_ZA_HV_idx_src and
		AARCH64_OPND_SME_ZA_HV_idx_dest.
		(struct aarch64_opnd_info): New ZA tile vector struct.

	opcodes/ChangeLog:

		* aarch64-asm.c (aarch64_ins_sme_za_hv_tiles):
		New inserter.
		* aarch64-asm.h (AARCH64_DECL_OPD_INSERTER):
		New inserter ins_sme_za_hv_tiles.
		* aarch64-dis.c (aarch64_ext_sme_za_hv_tiles):
		New extractor.
		* aarch64-dis.h (AARCH64_DECL_OPD_EXTRACTOR):
		New extractor ext_sme_za_hv_tiles.
		* aarch64-opc.c (aarch64_print_operand):
		Handle SME_ZA_HV_idx_src and SME_ZA_HV_idx_dest.
		* aarch64-opc.h (enum aarch64_field_kind): New enums
		FLD_SME_size_10, FLD_SME_Q, FLD_SME_V and FLD_SME_Rv.
		(struct aarch64_operand): Increase fields size to 5.
		* aarch64-tbl.h (OP_SME_BHSDQ_PM_BHSDQ): New qualifiers
		aarch64-asm-2.c: Regenerate.
		aarch64-dis-2.c: Regenerate.
		aarch64-opc-2.c: Regenerate.

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] Add SME instructions
	Patch is adding new SME matrix instructions. Please note additional
	instructions will be added in following patches.

	gas/ChangeLog:

		* config/tc-aarch64.c (parse_sme_zada_operand):
		New parser.
		* config/tc-aarch64.c (parse_reg_with_qual):
		New reg parser.
		* config/tc-aarch64.c (R_ZA): New egister type.
		(parse_operands): New parser.
		* testsuite/gas/aarch64/sme-illegal.d: New test.
		* testsuite/gas/aarch64/sme-illegal.l: New test.
		* testsuite/gas/aarch64/sme-illegal.s: New test.
		* testsuite/gas/aarch64/sme.d: New test.
		* testsuite/gas/aarch64/sme.s: New test.
		* testsuite/gas/aarch64/sme-f64.d: New test.
		* testsuite/gas/aarch64/sme-f64.s: New test.
		* testsuite/gas/aarch64/sme-i64.d: New test.
		* testsuite/gas/aarch64/sme-i64.s: New test.

	include/ChangeLog:

		* opcode/aarch64.h (enum aarch64_opnd): New operands
		AARCH64_OPND_SME_ZAda_2b, AARCH64_OPND_SME_ZAda_3b and
		AARCH64_OPND_SME_Pm.
		(enum aarch64_insn_class): New instruction class sme_misc.

	opcodes/ChangeLog:

		* aarch64-opc.c (aarch64_print_operand):
		Print OPND_SME_ZAda_2b and OPND_SME_ZAda_3b operands.
		(verify_constraints): Handle OPND_SME_Pm.
		* aarch64-opc.h (enum aarch64_field_kind):
		New bit fields FLD_SME_ZAda_2b, FLD_SME_ZAda_3b and FLD_SME_Pm.
		* aarch64-tbl.h (OP_SME_ZADA_PN_PM_ZN_S): New qualifier set.
		(OP_SME_ZADA_PN_PM_ZN_D): New qualifier.
		(OP_SME_ZADA_PN_PM_ZN_ZM): New qualifier.
		(OP_SME_ZADA_S_PM_PM_S_S): New qualifier.
		(OP_SME_ZADA_D_PM_PM_D_D): New qualifier.
		(OP_SME_ZADA_S_PM_PM_H_H): New qualifier.
		(OP_SME_ZADA_S_PM_PM_B_B): New qualifier.
		(OP_SME_ZADA_D_PM_PM_H_H): New qualifier.
		(SME_INSN): New instruction macro.
		(SME_F64_INSN): New instruction macro.
		(SME_I64_INSN): New instruction macro.
		(SME_INSNC): New instruction macro.
		(struct aarch64_opcode): New SME instructions.
		aarch64-asm-2.c: Regenerate.
		aarch64-dis-2.c: Regenerate.
		aarch64-opc-2.c: Regenerate.

2021-11-17  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: [SME] Add +sme option to -march
	This series of patches (tagged [SME]) add support for the Scalable
	Matrix Extension. Patch introduces new command line options: +sme, +sme-f64 and
	+sme-i64 to -march command line options.

	gas/ChangeLog:

		* NEWS: Updated docs.
		* config/tc-aarch64.c: New SME command line options.
		* doc/c-aarch64.texi: Update docs.

	include/ChangeLog:

		* opcode/aarch64.h (AARCH64_FEATURE_SME): New flag.
		(AARCH64_FEATURE_SME_F64): New flag.
		(AARCH64_FEATURE_SME_I64): New flag.

	opcodes/ChangeLog:

		* aarch64-tbl.h (SME): New feature object.

2021-11-17  Jeremy Drake  <cygwin@jdrake.com>

	Set the default DLL chracteristics to 0 for Cygwin based targets.
		* emultempl/pep.em (DEFAULT_DLL_CHARACTERISTICS): Set to 0 for
		Cygwin targets.
		* emultempl/pep.em (DEFAULT_DLL_CHARACTERISTICS): Likewise.

2021-11-17  Nick Clifton  <nickc@redhat.com>

	Fix the linker script parser so that it will recognise the PT_GNU_RELRO segment type, and the linker itself so that it will gracefully handle being unable to assign any sections to such a segment.
		PR 28452
	bfd	* elf.c (assign_file_positions_for_non_load_sections): Replace
		assertion with a warning message.

	ld	* ldgram.y: Add support for PT_GNU_RELRO and PT_GNU_PROPERTY.
		* ldgram.c: Regenerate.

2021-11-17  Andreas Arnez  <arnez@linux.ibm.com>

	[gdb/build, s390x] Fix build after gdbarch_tdep changes
	Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") changes a
	declaration in s390-tdep.h from

	   struct gdbarch_tdep { ... };

	to

	   struct s390_gdbarch_tdep : gdbarch_tdep { ... };

	and now requires that gdbarch_tdep has been declared before.  Which is
	usually the case, except when compiling s390-linux-nat.c, where
	s390-tdep.h is included before gdbarch.h.  Thus the s390x build errors out
	with the compiler complaining about a missing class name after the colon.

	Fix this in s390-linux-nat.c, by including gdbarch.h before s390-tdep.h.

2021-11-17  Luis Machado  <luis.machado@linaro.org>

	Expose the BTI BTYPE more explicitly in the registers
	Augment the register description XML to expose the BTI BTYPE field contained
	in the CPSR register. It will be displayed like so:

	cpsr           0x60001000          [ EL=0 BTYPE=0 SSBS C Z ]

2021-11-17  H.J. Lu  <hjl.tools@gmail.com>

	elfedit: Add --output-abiversion option to update ABIVERSION
		* NEWS: Mention --output-abiversion.
		* elfedit.c (input_elf_abiversion): New.
		(output_elf_abiversion): Likewise.
		(update_elf_header): Update EI_ABIVERSION.
		(command_line_switch): Add OPTION_INPUT_ABIVERSION and
		OPTION_OUTPUT_ABIVERSION.
		(options): Add --input-abiversion and --output-abiversion.
		(usage): Likewise.
		(main): Handle --input-abiversion and --output-abiversion.
		* doc/binutils.texi: Document --input-abiversion and
		--output-abiversion.
		* testsuite/binutils-all/elfedit.exp: Run elfedit-6.
		* testsuite/binutils-all/elfedit-6.d: New file.

2021-11-17  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Support rvv extension with released version 1.0.
	2021-11-17  Jim Wilson  <jimw@sifive.com>
	            Kito Cheng  <kito.cheng@sifive.com>
	            Nelson Chu  <nelson.chu@sifive.com>

	This patch is porting from the following riscv github,
	https://github.com/riscv/riscv-binutils-gdb/tree/rvv-1.0.x

	And here is the vector spec,
	https://github.com/riscv/riscv-v-spec

	bfd/
		* elfxx-riscv.c (riscv_implicit_subsets): Added imply rules
		of v, zve and zvl extensions.
		(riscv_supported_std_ext): Updated verison of v to  1.0.
		(riscv_supported_std_z_ext): Added zve and zvl extensions.
		(riscv_parse_check_conflicts): The zvl extensions need to
		enable either v or zve extension.
		(riscv_multi_subset_supports): Check the subset list to know
		if the INSN_CLASS_V and INSN_CLASS_ZVEF instructions are supported.
	gas/
		* config/tc-riscv.c (enum riscv_csr_class): Added CSR_CLASS_V.
		(enum reg_class): Added RCLASS_VECR and RCLASS_VECM.
		(validate_riscv_insn): Check whether the rvv operands are valid.
		(md_begin): Initialize register hash for rvv registers.
		(macro_build): Added rvv operands when expanding rvv pseudoes.
		(vector_macro): Expand rvv macros into one or more instructions.
		(macro): Likewise.
		(my_getVsetvliExpression): Similar to my_getVsetvliExpression,
		but used for parsing vsetvli operands.
		(riscv_ip): Parse and encode rvv operands.  Besides, The rvv loads
		and stores with EEW 64 cannot be used when zve32x is enabled.
		* testsuite/gas/riscv/priv-reg-fail-version-1p10.d: Updated -march
		to rv32ifv_zkr.
		* testsuite/gas/riscv/priv-reg-fail-version-1p11.d: Likewise.
		* testsuite/gas/riscv/priv-reg-fail-version-1p9p1.d: Likewise.
		* testsuite/gas/riscv/priv-reg.s: Added rvv csr testcases.
		* testsuite/gas/riscv/priv-reg-version-1p10.d: Likewise.
		* testsuite/gas/riscv/priv-reg-version-1p11.d: Likewise.
		* testsuite/gas/riscv/priv-reg-version-1p9p1.d: Likewise.
		* testsuite/gas/riscv/march-imply-v.d: New testcase.
		* testsuite/gas/riscv/vector-insns-fail-zve32xf.d: Likewise.
		* testsuite/gas/riscv/vector-insns-fail-zve32xf.l: Likewise.
		* testsuite/gas/riscv/vector-insns-fail-zvl.d: Likewise.
		* testsuite/gas/riscv/vector-insns-fail-zvl.l: Likewise.
		* testsuite/gas/riscv/vector-insns-vmsgtvx.d: Likewise.
		* testsuite/gas/riscv/vector-insns-vmsgtvx.s: Likewise.
		* testsuite/gas/riscv/vector-insns-zero-imm.d: Likewise.
		* testsuite/gas/riscv/vector-insns-zero-imm.s: Likewise.
		* testsuite/gas/riscv/vector-insns.d: Likewise.
		* testsuite/gas/riscv/vector-insns.s: Likewise.
	include/
		* opcode/riscv-opc.h: Defined mask/match encodings and csrs for rvv.
		* opcode/riscv.h: Defined rvv immediate encodings and fields.
		(enum riscv_insn_class): Added INSN_CLASS_V and INSN_CLASS_ZVEF.
		(INSN_V_EEW64): Defined.
		(M_VMSGE, M_VMSGEU): Added for the rvv pseudoes.
	opcodes/
		* riscv-dis.c (print_insn_args): Dump the rvv operands.
		* riscv-opc.c (riscv_vecr_names_numeric): Defined rvv registers.
		(riscv_vecm_names_numeric): Likewise.
		(riscv_vsew): Likewise.
		(riscv_vlmul): Likewise.
		(riscv_vta): Likewise.
		(riscv_vma): Likewise.
		(match_vs1_eq_vs2): Added for rvv Vu operand.
		(match_vd_eq_vs1_eq_vs2): Added for rvv Vv operand.
		(riscv_opcodes): Added rvv v1.0 instructions.

2021-11-17  Sergei Trofimovich  <siarheit@google.com>

	gdb/nat/linux-osdata.c: fix build on gcc-12 (string overfow)
	On gcc-12 build fails as:

	    ../../gdbserver/../gdb/nat/linux-osdata.c: In function 'void linux_xfer_osdata_processes(buffer*)':
	    ../../gdbserver/../gdb/nat/linux-osdata.c:330:39: error:
	      '__builtin___sprintf_chk' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
	      330 |                 sprintf (core_str, "%d", i);
	          |                                       ^

	It's an off-by-one case in an infeasible scenario for negative
	huge core count. The change switches to std::string for memory
	handling.

	Tested by running 'info os processes' and checking CPU cores column.

2021-11-17  Aaron Merey  <amerey@redhat.com>

	gdb: Add aliases for read_core_file_mappings callbacks
	Add aliases read_core_file_mappings_loop_ftype and
	read_core_file_mappings_pre_loop_ftype.  Intended for use with
	read_core_file_mappings.

	Also add build_id parameter to read_core_file_mappings_loop_ftype.

2021-11-17  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: add support for $pwd replacements
	Extend the common test framework to support $pwd replacements in
	settings.  This allows replacing the custom cris @exedir@ with it.

	sim: cris: replace @srcdir@ test extension with $srcdir/$subdir
	The common framework supports $srcdir & $subdir replacements already,
	so replace the custom @srcdir@ logic with those.  Since the replace
	happens in slurp_options that cris already uses, we don't have any
	logic to port over there.  We have to duplicate that into the cris
	slurp_rv helper though.

2021-11-17  Mike Frysinger  <vapier@gentoo.org>

	sim: cris: drop custom "dynamic" test field
	This tag is used to force tests to be built dynamically (i.e. without
	-static linking).  This is because cris-sim.exp in dejagnu turns on
	static linking in ldflags.

	The default configs and runtest flags shouldn't load these boards.
	If these settings are still needed, we should figure out a different
	way of suppressing the stock settings wholesale.  We want these to
	all pass out of the box with little to no configuration so that they
	can run in a multitarget build.

	With dropping "dynamic", it'll be easier to merge the custom cris
	test logic with the common sim test logic.

2021-11-17  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: add more silent build rules
	site.exp is still verbose, but that comes from automake, so have
	to get it fixed upstream.

2021-11-17  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-16  Sergei Trofimovich  <siarheit@google.com>

	sim: cr16: fix build on gcc-12 (NULL comparison)
	On gcc-12 build fails as:

	    sim/cr16/interp.c: In function 'lookup_hash':
	    sim/cr16/interp.c:89:25: error:
	      the comparison will always evaluate as 'true'
	      for the address of 'mnimonic' will never be NULL [-Werror=address]
	       89 |   if ((h->ops->mnimonic != NULL) &&
	          |                         ^~

	'mnimonic' is a sharr array within ops. It can never be NULL.

	While at it renamed 'mnimonic' to 'mnemonic'.

2021-11-16  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix length of array view returned by some value_contents functions
	In commit 50888e42dcd3 ("gdb: change functions returning value contents
	to use gdb::array_view"), I believe I made a mistake with the length of
	the array views returned by some functions.  All functions return a view
	of `TYPE_LENGTH (value_type (type))` length.  This is not correct when
	the value's enclosing type is larger than the value's type.  In that
	case, the value's contents buffer is of the size of the enclosing type,
	and the value's actual contents is a slice of that (as returned by
	value_contents).  So, functions value_contents_all_raw,
	value_contents_for_printing and value_contents_for_printing_const are
	not correct.  Since they are meant to return the value's contents buffer
	as a whole, they should have the size of the enclosing type.

	There is nothing that uses the returned array view size at the moment,
	so this didn't cause a problem.  But it became apparent when trying to
	adjust some callers.

	Change-Id: Ib4e8837e1069111d2b2784d3253d5f3002419e68

2021-11-16  Fangrui Song  <maskray@google.com>

	readelf: Support SHT_RELR/DT_RELR for -r
	The -r output for SHT_RELR looks like:

	Relocation section '.relr.dyn' at offset 0x530 contains 4 entries:
	  7 offsets
	00000000000028c0
	00000000000028c8
	0000000000003ad0
	0000000000003ad8
	0000000000003ae0
	0000000000003ae8
	0000000000003af0

	For --use-dynamic, the header looks like

	    'RELR' relocation section at offset 0x530 contains 32 bytes:

	include/
	    * elf/common.h (DT_ENCODING): Bump to 38.
	    * elf/external.h (Elf32_External_Relr): New.
	    (Elf64_External_Relr): New.
	binutils/
	    * readelf.c (enum relocation_type): New.
	    (slurp_relr_relocs): New.
	    (dump_relocations): Change is_rela to rel_type.
	    Dump RELR.
	    (dynamic_relocations): Add DT_RELR.
	    (process_relocs): Check SHT_RELR and DT_RELR.
	    (process_dynamic_section): Store into dynamic_info for
	    DT_RELR/DT_RELRENT/DT_RELRSZ.

2021-11-16  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: remove FUNCTION_NAME
	__func__ is standard C++11:

	    https://en.cppreference.com/w/cpp/language/function

	Also, in C++11, __func__ expands to the demangled function name, so the
	mention in the comment above FUNCTION_NAME doesn't apply anymore.
	Finally, in places where FUNCTION_NAME is used, I think it's enough to
	print the function name, no need to print the whole signature.
	Therefore, I propose to just remove FUNCTION_NAME and update users to
	use the standard __func__.

	Change-Id: I778f28155422b044402442dc18d42d0cded1017d

2021-11-16  Andrew Burgess  <aburgess@redhat.com>

	gdb/gdbsupport: make xstrprintf and xstrvprintf return a unique_ptr
	The motivation is to reduce the number of places where unmanaged
	pointers are returned from allocation type routines.  All of the
	callers are updated.

	There should be no user visible changes after this commit.

2021-11-16  Andrew Burgess  <aburgess@redhat.com>

	gdbsupport: move xfree into its own file
	In the next commit I'd like to reference gdb_unique_ptr within the
	common-utils.h file.  However, this requires that I include
	gdb_unique_ptr.h, which requires that xfree be defined.

	Interestingly, gdb_unique_ptr.h doesn't actually include anything that
	defines xfree, but I was finding that when I added a gdb_unique_ptr.h
	include to common-utils.h I was getting a dependency cycle; before my
	change xfree was defined when gdb_unique_ptr.h was processed, while
	after my change it was not, and this made g++ unhappy.

	To break this cycle, I propose to move xfree into its own header file,
	gdb-xfree.h, which I'll then include into gdb_unique_ptr.h and
	common-utils.cc.

2021-11-16  Andrew Burgess  <aburgess@redhat.com>

	gdb: throw OPTIMIZED_OUT_ERROR rather than GENERIC_ERROR
	While reviewing this patch:

	  https://sourceware.org/pipermail/gdb-patches/2021-November/183227.html

	I spotted that the patch could be improved if we threw
	OPTIMIZED_OUT_ERROR rather than GENERIC_ERROR in a few places.

	This commit updates error_value_optimized_out and
	require_not_optimized_out to throw OPTIMIZED_OUT_ERROR.

	I ran the testsuite and saw no regressions.  This doesn't really
	surprise me, we don't usually write code like:

	  catch (const gdb_exception_error &ex)
	    {
	      (if ex.error == GENERIC_ERROR)
	        ...
	      else
	        ...
	    }

	There are a three places where we write something like:

	  catch (const gdb_exception_error &ex)
	    {
	      (if ex.error == OPTIMIZED_OUT_ERROR)
	        ...
	    }

	In frame.c:unwind_pc, stack.c:info_frame_command_core, and
	value.c:value_optimized_out, but if we are hitting these cases then
	it's not significantly changing GDB's behaviour.

2021-11-16  Tom Tromey  <tromey@adacore.com>

	Remove config.cache in gdbserver's "distclean"
	PR gdb/28586 points out that "make distclean" fails to delete
	config.cache from gdbserver/.  This patch fixes the bug, and removes a
	duplicate "Makefile" deletion that was also pointed out in the PR.

2021-11-16  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Remove inferior output in gdb.base/foll-vfork.exp
	Test-case gdb.base/foll-vfork.exp has inferior output that is not needed, but
	which makes the regexp matching more difficult (see commit 1f28b70def1
	"[gdb/testsuite] Fix regexp in gdb.base/foll-vfork.exp").

	Remove the inferior output, and revert commit 1f28b70def1 to make the matching
	more restrictive.

	Tested on x86_64-linux.

2021-11-16  H.J. Lu  <hjl.tools@gmail.com>

	x86: Don't allow KMOV in TLS code sequences
	Don't allow KMOV in TLS code sequences which require integer MOV
	instructions.

		PR target/28595
		* config/tc-i386.c (match_template): Don't allow KMOV in TLS
		code sequences.
		* testsuite/gas/i386/i386.exp: Run inval-tls and x86-64-inval-tls
		tests.
		* testsuite/gas/i386/inval-tls.l: New file.
		* testsuite/gas/i386/inval-tls.s: Likewise.
		* testsuite/gas/i386/x86-64-inval-tls.l: Likewise.
		* testsuite/gas/i386/x86-64-inval-tls.s: Likewise.

2021-11-16  Mike Frysinger  <vapier@gentoo.org>

	sim: run: support concise env var settings
	Support the same syntax as other common utilities where env vars can
	be specified before the program to be run without an explicit option.

	This behavior can be suppressed by using the -- marker.

2021-11-16  Mike Frysinger  <vapier@gentoo.org>

	sim: nrun: add --env-{set,unset,clear} command line options
	Provide explicit control over the program's environment with the
	basic set/unset/clear options.  These are a bit clunky to use,
	but they're functional.

	The env set operation is split out into a separate function as it'll
	be used in the next commit.

	With these in place, we can adjust the custom cris testsuite to use
	the now standard options and not its one-off hack.

2021-11-16  Mike Frysinger  <vapier@gentoo.org>

	sim: syscall: hoist argc/argn/argnlen to common code
	Now that the callback framework supports argv & envp, we can move
	the Blackfin implementation of these syscalls to the common code.

	sim: syscall: fix argvlen & argv implementation
	Now that we have access to the argv & envp strings, finish implementing
	these syscalls.  Delete unused variables, fix tbuf by incrementing the
	pointer instead of setting to the length, and make sure we don't write
	more data than the bufsize says is available.

	sim: callback: expose argv & environ
	Pass the existing strings data to the callbacks so that common
	libgloss syscalls can be implemented (which we'll do shortly).

2021-11-16  Mike Frysinger  <vapier@gentoo.org>

	sim: keep track of program environment strings
	We've been passing the environment strings to sim_create_inferior,
	but most ports don't do anything with them.  A few will use ad-hoc
	logic to stuff the stack for user-mode programs, but that's it.

	Let's formalize this across the board by storing the strings in the
	normal sim state.  This will allow (in future commits) supporting
	more functionality in the run interface, and to unify some of the
	libgloss syscalls.

2021-11-16  Mike Frysinger  <vapier@gentoo.org>

	sim: iq2000: fix some missing prototypes warnings
	Turns out some of these were hiding real bugs like not passing the
	pc variable down.

2021-11-16  jiawei  <jiawei@iscas.ac.cn>

	RISC-V: Scalar crypto instruction and entropy source CSR testcases.
	Add testcases for Scalar Crypto extension, with total testcase contain all
	instructions in k-ext/k-ext-64 and sub-extension testcase for zbk* zk*. Also
	add testcase for new CSR name 'seed' which is the Entropy Source in zkr.

	In fact these whole testcases can be combined into one file, after we have
	supported the .option arch +-= directives.

	gas/
		* testsuite/gas/riscv/k-ext-64.d: New testcase for crypto instructions.
		* testsuite/gas/riscv/k-ext-64.s: Likewise.
		* testsuite/gas/riscv/k-ext.d: Likewise.
		* testsuite/gas/riscv/k-ext.s: Likewise.
		* testsuite/gas/riscv/zbkb-32.d: Likewise.
		* testsuite/gas/riscv/zbkb-32.s: Likewise.
		* testsuite/gas/riscv/zbkb-64.d: Likewise.
		* testsuite/gas/riscv/zbkb-64.s: Likewise.
		* testsuite/gas/riscv/zbkc-32.d: Likewise.
		* testsuite/gas/riscv/zbkc-64.d: Likewise.
		* testsuite/gas/riscv/zbkc.s: Likewise.
		* testsuite/gas/riscv/zbkx-32.d: Likewise.
		* testsuite/gas/riscv/zbkx-64.d: Likewise.
		* testsuite/gas/riscv/zbkx.s: Likewise.
		* testsuite/gas/riscv/zknd-32.d: Likewise.
		* testsuite/gas/riscv/zknd-32.s: Likewise.
		* testsuite/gas/riscv/zknd-64.d: Likewise.
		* testsuite/gas/riscv/zknd-64.s: Likewise.
		* testsuite/gas/riscv/zkne-32.d: Likewise.
		* testsuite/gas/riscv/zkne-32.s: Likewise.
		* testsuite/gas/riscv/zkne-64.d: Likewise.
		* testsuite/gas/riscv/zkne-64.s: Likewise.
		* testsuite/gas/riscv/zknh-32.d: Likewise.
		* testsuite/gas/riscv/zknh-32.s: Likewise.
		* testsuite/gas/riscv/zknh-64.d: Likewise.
		* testsuite/gas/riscv/zknh-64.s: Likewise.
		* testsuite/gas/riscv/zksed-32.d: Likewise.
		* testsuite/gas/riscv/zksed-64.d: Likewise.
		* testsuite/gas/riscv/zksed.s: Likewise.
		* testsuite/gas/riscv/zksh-32.d: Likewise.
		* testsuite/gas/riscv/zksh-64.d: Likewise.
		* testsuite/gas/riscv/zksh.s: Likewise.
		* testsuite/gas/riscv/priv-reg-fail-zkr.d: New testcase for zkr
		csr check.
		* testsuite/gas/riscv/priv-reg-fail-zkr.l: Likewise.
		* testsuite/gas/riscv/priv-reg-fail-version-1p10.d: Updated march to
		rv32if_zkr.
		* testsuite/gas/riscv/priv-reg-fail-version-1p11.d: Likewise.
		* testsuite/gas/riscv/priv-reg-fail-version-1p9p1.d: Likewise.
		* testsuite/gas/riscv/priv-reg-version-1p10.d: Added Crypto seed csr.
		* testsuite/gas/riscv/priv-reg-version-1p11.d: Likewise.
		* testsuite/gas/riscv/priv-reg-version-1p9p1.d: Likewise.
		* testsuite/gas/riscv/priv-reg.s: Likewise.

2021-11-16  jiawei  <jiawei@iscas.ac.cn>

	RISC-V: Scalar crypto instructions and operand set.
	Add instructions in k-ext, some instruction in zbkb, zbkc is reuse from
	zbb,zbc, we just change the class attribute to make them both support.
	The 'aes64ks1i' and 'aes64ks2' instructions are present in both the Zknd
	and Zkne extensions on rv64.  Add new operand letter 'y' to present 'bs'
	symbol and 'Y' to present 'rnum' symbolc  for zkn instructions.  Also add
	a new Entropy Source CSR define 'seed' located at address 0x015.

	bfd/
		* elfxx-riscv.c (riscv_multi_subset_supports): Added support for
		crypto extension.
	gas/
		*config/tc-riscv.c (enum riscv_csr_class): Added CSR_CLASS_ZKR.
		(riscv_csr_address): Checked for CSR_CLASS_ZKR.
		(validate_riscv_insn): Added y and Y for bs and rnum operands.
		(riscv_ip): Handle y and Y operands.
	include/
		* opcode/riscv-opc.h: Added encodings of crypto instructions.
		Also defined new csr seed, which address is 0x15.
		* opcode/riscv.h: Defined OP_* and INSN_CLASS_* for crypto.
	opcodes/
		* riscv-dis.c (print_insn_args): Recognized new y and Y operands.
		* riscv-opc.c (riscv_opcodes): Added crypto instructions.

2021-11-16  jiawei  <jiawei@iscas.ac.cn>

	RISC-V: Minimal support of scalar crypto extension.
	Minimal support of scalar crypto extension, add "k" in the
	riscv_supported_std_ext, to make the order check right with
	"zk" behind "zb".

	bfd/
		* elfxx-riscv.c (riscv_implicit_subsets): Added implicit
		rules for zk* extensions.
		(riscv_supported_std_ext): Added entry for k.
		(riscv_supported_std_z_ext): Added entries for zk*.

2021-11-16  Simon Marchi  <simon.marchi@efficios.com>

	gdb: rework "set debuginfod" commands
	As discussed here [1], do some re-work in the "set debuginfod commands".

	First, use "set debuginfod enabled on/off/ask" instead of "set
	debuginfod on/off/ask".  This is more MI-friendly, and it gives an
	output that makes more sense in "info set", for example.

	Then, make the show commands not call "error" when debuginfod support is
	not compiled in.  This makes the commands "show" and "show debuginfod"
	stop early, breaking gdb.base/default.exp:

	    Running /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/default.exp ...
	    FAIL: gdb.base/default.exp: info set
	    FAIL: gdb.base/default.exp: show

	 - Make the "debuginfod enabled" setting default to "off" when debuginfod
	   support is not compiled in, and "ask" otherwise.
	 - Make the setter of "debuginfod enabled" error out when debuginfod
	   support is not compiled in, so that "debuginfod enabled" will always
	   remain "off" in that case.
	 - Make the setter of "debuginfod verbose" work in any case.  I don't
	   see the harm in letting the user change that setting, since the user will
	   hit an error if they try to enable the use of debuginfod.
	 - I would do the same for the "debuginfod urls" setter, but because
	   this one needs to see the DEBUGINFOD_URLS_ENV_VAR macro, provided by
	   libdebuginfod, I made that one error out as well if debuginfod
	   support is not compiled it (otherwise, I would have left it like
	   "debuginfod verbose".  Alternatively, we could hard-code
	   "DEBUGINFOD_URLS" in the code (in fact, it was prior to this patch,
	   but I think it was an oversight, as other spots use
	   DEBUGINFOD_URLS_ENV_VAR), or use a dummy string to store the setting,
	   but I don't really see the value in that.

	Rename debuginfod_enable to debuginfod_enabled, just so it matches the
	setting name.

	[1] https://sourceware.org/pipermail/gdb-patches/2021-October/182937.html

	Change-Id: I45fdb2993f668226a5639228951362b7800f09d5
	Co-Authored-By: Aaron Merey <amerey@redhat.com>

2021-11-16  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: adjust gdbarch_tdep calls in nat files
	Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") forgot to
	update the gdbarch_tdep calls in the native files other than x86-64
	Linux.  This patch updates them all (to the best of my knowledge).
	These are the files I was able to build-test:

	  aarch64-linux-nat.c
	  amd64-bsd-nat.c
	  arm-linux-nat.c
	  ppc-linux-nat.c
	  windows-nat.c
	  xtensa-linux-nat.c

	And these are the ones I could not build-test:

	  aix-thread.c
	  arm-netbsd-nat.c
	  ppc-fbsd-nat.c
	  ppc-netbsd-nat.c
	  ia64-tdep.c (the part that needs libunwind)
	  ppc-obsd-nat.c
	  rs6000-nat.c

	If there are still some build problems related to gdbarch_tdep in them,
	they should be pretty obvious to fix.

	Change-Id: Iaa3d791a850e4432973757598e634e3da6061428

2021-11-16  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove unused variables in xtensa-linux-nat.c
	While build-testing this file, the compiler complained about these two
	unused variables, remove them.

	Change-Id: I3c54f779f12c16ef6184af58aca75eaad042ce4e

2021-11-16  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add arc-newlib-tdep.c to ALL_TARGET_OBS
	This file is currently not compiled in an --enable-targets=all build,
	but it should be.  Add it to ALL_TARGET_OBS.

	Update the gdbarch_tdep call that commit 345bd07cce33 ("gdb: fix
	gdbarch_tdep ODR violation") forgot to update.

	Change-Id: I86248a01493eea5e70186e9c46a298ad3994b034

2021-11-16  Jim Wilson  <wilson@tuliptree.org>

	Update my email address.
	I've left SiFive and have a new gmail account because it is convenient
	to use with git send-email.  I'm planning to use this for my RISC-V
	work.  My tuliptree address still works, it just isn't as convenient.

		binutils:
		* MAINTAINERS (RISC-V): Update my address.

2021-11-16  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-15  Tom de Vries  <tdevries@suse.de>

	[gdb] Don't use gdb_stdlog for inferior-events
	The test-case gdb.base/foll-vfork.exp contains:
	...
	if [gdb_debug_enabled] {
	    untested "debug is enabled"
	    return 0
	}
	...

	To understand what it does, I disabled this bit and ran with GDB_DEBUG=infrun,
	like so:
	...
	$ cd $build/gdb/testsuite
	$ make check GDB_DEBUG=infrun RUNTESTFLAGS=gdb.base/foll-vfork.exp
	...
	and ran into:
	...
	(gdb) PASS: gdb.base/foll-vfork.exp: exec: \
	  vfork parent follow, through step: set follow-fork parent
	next^M
	33        if (pid == 0) {^M
	(gdb) FAIL: gdb.base/foll-vfork.exp: exec: \
	  vfork parent follow, through step: step
	...

	The problem is that the test-case expects:
	...
	(gdb) PASS: gdb.base/foll-vfork.exp: exec: \
	  vfork parent follow, through step: set follow-fork parent
	next^M
	[Detaching after vfork from child process 28169]^M
	33        if (pid == 0) {^M
	(gdb) PASS: gdb.base/foll-vfork.exp: exec: \
	  vfork parent follow, through step: step
	...
	but the "Detaching" line has been redirected to
	$outputs/gdb.base/foll-vfork/gdb.debug.

	I looked at the documentation of "set logging debugredirect [on|off]":
	...
	  By default, GDB debug output will go to both the terminal and the logfile.
	  Set debugredirect if you want debug output to go only to the log file.
	...
	and my interpretation of it was that "debug output" did not match the
	"messages" description of inferior-events:
	...
	The set print inferior-events command allows you to enable or disable printing
	of messages when GDB notices that new inferiors have started or that inferiors
	have exited or have been detached.
	...

	Fix the discrepancy by not using gdb_stdlog for inferior-events.

	Update the gdb.base/foll-vfork.exp test-case to not require
	gdb_debug_enabled == 0.

	Tested on x86_64-linux.

	Tested test-case gdb.base/foll-vfork.exp with and without GDB_DEBUG=infrun.

2021-11-15  Roland McGrath  <mcgrathr@google.com>

	ld: Fix testsuite failures under --enable-textrel-check=error
	ld/
		* testsuite/ld-aarch64/dt_textrel.d: Pass explicit -z notext in
		case ld was configured with --enable-textrel-check=error.
		* testsuite/ld-aarch64/pr22764.d: Likewise.
		* testsuite/ld-aarch64/pr20402.d: Likewise.

2021-11-15  Luis Machado  <luis.machado@linaro.org>

	Extend the prologue analyzer to handle the bti instruction
	Handle the BTI instruction in the prologue analyzer. The patch handles all
	the variations of the BTI instruction.

2021-11-15  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix gdbarch_tdep ODR violation
	I would like to be able to use non-trivial types in gdbarch_tdep types.
	This is not possible at the moment (in theory), because of the one
	definition rule.

	To allow it, rename all gdbarch_tdep types to <arch>_gdbarch_tdep, and
	make them inherit from a gdbarch_tdep base class.  The inheritance is
	necessary to be able to pass pointers to all these <arch>_gdbarch_tdep
	objects to gdbarch_alloc, which takes a pointer to gdbarch_tdep.

	These objects are never deleted through a base class pointer, so I
	didn't include a virtual destructor.  In the future, if gdbarch objects
	deletable, I could imagine that the gdbarch_tdep objects could become
	owned by the gdbarch objects, and then it would become useful to have a
	virtual destructor (so that the gdbarch object can delete the owned
	gdbarch_tdep object).  But that's not necessary right now.

	It turns out that RISC-V already has a gdbarch_tdep that is
	non-default-constructible, so that provides a good motivation for this
	change.

	Most changes are fairly straightforward, mostly needing to add some
	casts all over the place.  There is however the xtensa architecture,
	doing its own little weird thing to define its gdbarch_tdep.  I did my
	best to adapt it, but I can't test those changes.

	Change-Id: Ic001903f91ddd106bd6ca09a79dabe8df2d69f3b

2021-11-15  Clément Chigot  <clement.chigot@atos.net>

	COFF: avoid modifications over C_FILE filename aux entries.
	Commit e86fc4a5bc37 ("PR 28447: implement multiple parameters for .file
	on XCOFF") introduces C_FILE entries which can store additional
	information.
	However, some modifications are needed by them but not by the original
	C_FILE entries, usually representing the filename.
	This patch ensures that filename entries are kept as is, in order to
	protect targets not supporting the additional entries.

		* coffgen.c (coff_write_symbol): Protect filename entries
		(coff_write_symbols): Likewise.
		(coff_print_symbol): Likewise.

2021-11-15  Eric Botcazou  <ebotcazou@gcc.gnu.org>

	Deal with full path in .file 0 directive
	Gas uses the directory part, if present, of the .file 0 directive to set
	entry 0 of the directory table in DWARF 5, which represents the "current
	directory".

	Now Gas also uses the file part of the same directive to set entry 0 of the
	file table, which represents the "current compilation file".  But the latter
	need not be located in the former so GCC will use a full path in the file
	part when it is passed a full path:

	gcc -c /full/path/test.c -save-temps

	yields:

	 .file 0 "/current/directory" "/full/path/test.c"

	in the assembly file and:

	 The Directory Table (offset 0x22, lines 2, columns 1):
	  Entry Name
	  0     (indirect line string, offset: 0x25): /current/directory
	  1     (indirect line string, offset: 0x38): /full/path

	 The File Name Table (offset 0x30, lines 2, columns 2):
	  Entry Dir     Name
	  0     0       (indirect line string, offset: 0x43): /full/path/test.c

	in the object file.  Note the full path and the questionable Dir value in
	the 0 entry of the file table.

2021-11-15  Mike Frysinger  <vapier@gentoo.org>

	sim: cris: make error message test a little more flexible
	The point of this test is to just make sure the usage text is shown,
	not the exact details of the usage text.  So shorten the output test
	to match the beginning.  This fixes breakage when the output changed
	slightly to include [--].

	sim: run: fix crash in argc==0 error situation
	The new argv processing code assumed that we were always passed a
	command line.  If we weren't, make sure we don't crash before we
	get a chance to output an error message about incorrect usage.

	sim: cris: touch up rvdummy handling
	Add quiet build support and make sure it's removed with `make clean`.

	sim: cris: replace custom "dest" test field with new --argv0
	The #dest field used in the cris testsuite is a bit of hack to set the
	argv[0] for the tests to read out later on.  Now that the sim has an
	option to set argv[0] explicitly, we don't need this custom field, so
	let's drop it to harmonize the testsuites a little.

	sim: run: add --argv0 option to control argv[0]
	We default argv[0] to the program we run which is a standard *NIX
	convention, but sometimes we want to be able to control the argv[0]
	setting independently (especially for programs that inspect argv[0]
	to change their behavior or output).  Add an option to control it.

2021-11-15  Mike Frysinger  <vapier@gentoo.org>

	sim: split program path out of argv vector
	We use the program argv to both find the program to run (argv[0]) and
	to hold the arguments to the program.  Most of the time this is fine,
	but if we want to let programs specify argv[0] independently (which is
	possible in standard *NIX programs), this double duty doesn't work.

	So let's split the path to the program to run out into a separate
	field by itself.  This simplifies the various sim_open funcs too.

	By itself, this code is more of a logical cleanup than something that
	is super useful.  But it will open up customization of argv[0] in a
	follow up commit.  Split the changes to make it easier to review.

2021-11-15  Mike Frysinger  <vapier@gentoo.org>

	sim: bfin: fix mach/xfail usage in tests
	Set the mach to the right value all the time, and update xfail to
	say the test fails on all targets.  WIth multitarget testing, the
	idea of target here doesn't make much sense.

2021-11-15  Alan Modra  <amodra@gmail.com>

	-Waddress fixes for gold testsuite
	Current mainline gcc.
	common_test_1.c: In function 'main':
	common_test_1.c:56:14: error: comparison between two arrays [-Werror=array-compare]
	   56 |   assert (c5 > c4);
	      |              ^
	common_test_1.c:56:14: note: use '&c5[0] > &c4[0]' to compare the addresses

		* testsuite/common_test_1.c: Avoid -Waddress warnings.
		* testsuite/common_test_1_v1.c: Likewise.
		* testsuite/common_test_1_v2.c: Likewise.
		* testsuite/script_test_2.cc: Likewise.

2021-11-15  Alan Modra  <amodra@gmail.com>

	PowerPC64 @notoc in non-power10 code
	R_PPC64_REL24_P9NOTOC is a variant of R_PPC64_REL24_NOTOC for use on
	@notoc cals from non-power10 code in the rare case that using such a
	construct is useful.  R_PPC64_REL24_P9NOTOC will be emitted by gas
	rather than R_PPC64_REL24_NOTOC when @notoc is used in a branch
	instruction if power10 instructions are not enabled at that point.
	The new relocation tells the linker to not use power10 instructions on
	any stub emitted for that branch, unless overridden by
	--power10-stubs=yes.

	The current linker heuristic of only generating power10 instructions
	for stubs if power10-only relocations are detected, continues to be
	used.

	include/
		* elf/ppc64.h (R_PPC64_REL24_P9NOTOC): Define.
	bfd/
		* reloc.c (BFD_RELOC_PPC64_REL24_P9NOTOC): Define.
		* elf64-ppc.c (ppc64_elf_howto_raw): Add entry for new reloc.
		(ppc64_elf_reloc_type_lookup): Handle it.
		(enum ppc_stub_type): Delete.
		(enum ppc_stub_main_type, ppc_stub_sub_type): New.
		(struct ppc_stub_type): New.
		(struct ppc_stub_hash_entry): Use the above new type.
		(struct ppc_link_hash_table): Update stub_count.
		(is_branch_reloc, ppc64_elf_check_relocs),
		(toc_adjusting_stub_needed): Handle new reloc.
		(stub_hash_newfunc, select_alt_stub, ppc_merge_stub),
		(ppc_type_of_stub, plt_stub_size, build_plt_stub),
		(build_tls_get_addr_head, build_tls_get_addr_tail),
		(ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_size_stubs),
		(ppc64_elf_build_stubs, ppc64_elf_relocate_section): Handle new
		reloc.  Modify stub handling to suit new scheme.
		* bfd-in2.h: Regenerate.
		* libbfd.h: Regenerate.
	gas/
		* config/tc-ppc.c (ppc_elf_suffix): When power10 is not enabled
		return BFD_RELOC_PPC64_REL24_P9NOTOC for @notoc.
		(fixup_size, ppc_force_relocation, ppc_fix_adjustable): Handle
		BFD_RELOC_PPC64_REL24_P9NOTOC.
	ld/
		* testsuite/ld-powerpc/callstub-2.s: Add .machine power10.

2021-11-15  Alan Modra  <amodra@gmail.com>

	Regenerate a couple of files
	A couple of files changed on my latest --enable-maintainer-mode
	build.  ld/Makefile.in had a missing dependency but better sorting of
	the loongson entries.

	intl/
		* configure: Regenerate.
	ld/
		* Makefile.am: Sort loongson entries.
		* Makefile.in: Regenerate.

2021-11-15  Pedro Alves  <pedro@palves.net>

	Fix build with current GCC: EL_EXPLICIT(location) always non-NULL
	Compiling GDB with current GCC (1b4a63593b) runs into this:

	  src/gdb/location.c: In function 'int event_location_empty_p(const event_location*)':
	  src/gdb/location.c:963:38: error: the address of 'event_location::<unnamed union>::explicit_loc' will never be NULL [-Werror=address]
	    963 |       return (EL_EXPLICIT (location) == NULL
		|                                      ^
	  src/gdb/location.c:57:30: note: 'event_location::<unnamed union>::explicit_loc' declared here
	     57 |     struct explicit_location explicit_loc;
		|                              ^~~~~~~~~~~~

	GCC is right, EL_EXPLICIT is defined as returning the address of an
	union field:

	      /* An explicit location.  */
	      struct explicit_location explicit_loc;
	  #define EL_EXPLICIT(P) (&((P)->u.explicit_loc))

	and thus must always be non-NULL.

	Change-Id: Ie74fee7834495a93affcefce03c06e4d83ad8191

2021-11-15  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-14  Lancelot SIX  <lsix@lancelotsix.com>

	[PR gdb/16238] Add completer for the show user command
	The 'show user' command (which shows the definition of non-python/scheme
	user defined commands) is currently missing a completer. This is
	mentioned in PR 16238.  Having one can improve the user experience.

	In this commit I propose an implementation for such completer as well as
	the associated tests.

	Tested on x86_64 GNU/Linux.

	All feedbacks are welcome.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16238

2021-11-14  Alan Modra  <amodra@gmail.com>

	sync libbacktrace from gcc

2021-11-14  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-13  H.J. Lu  <hjl.tools@gmail.com>

	Sync Makefile.tpl with GCC
		* Makefile.tpl: Sync with GCC.
		* Makefile.in: Regenerate.

2021-11-13  Mike Frysinger  <vapier@gentoo.org>

	sim: sh: fix switch-bool warnings
	This code triggers -Werror=switch-bool warnings with <=gcc-5 versions.
	Rework it to use if statements instead as it also simplifies a bit.

	sim: sh: rework carry checks to not rely on integer overflows
	In <=gcc-7 versions, -fstrict-overflow is enabled by default, and that
	triggers warnings in this code that relies on integer overflows to test
	for carries.  Change the logic to test against the limit directly.

2021-11-13  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-12  Carl Love  <cel@us.ibm.com>

	Fix gdb.base/sigstep.exp test for ppc
	The test stops at <signal_handler called> which is the call to the handler
	rather than in the handler as intended.  This patch replaces the
	gdb_test "$enter_cmd to handler" with a gdb_test_multiple test.  The multiple
	test looks for the stop at <signal_handler called>.  If found, the command
	is issued again.  The test passes if gdb stops in the handler as expected.

	(gdb) PASS: gdb.base/sigstep.exp: stepi to handler, nothing in handler, step
	from handler: continue to signal
	stepi
	<signal handler called>
	1: x/i $pc
	=> 0x7ffff7f80440 <__kernel_start_sigtramp_rt64>:       bctrl
	(gdb) stepi
	handler (sig=551) at sigstep.c:32
	32      {
	1: x/i $pc
	=> 0x10000097c <handler>:       addis   r2,r12,2
	(gdb) PASS: gdb.base/sigstep.exp: stepi to handler, nothing in handler,
	step from handler: stepi to handler

	Patch has been tested on x86_64-linux and ppc64le-linux with no test failures.

2021-11-12  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix regexp in gdb.base/foll-vfork.exp
	On OBS I ran into:
	...
	(gdb) PASS: gdb.base/foll-vfork.exp: exit: \
	  vfork relations in info inferiors: continue to child exit
	info inferiors^M
	  Num  Description       Connection           Executable        ^M
	  1    <null>                                 foll-vfork-exit ^M
	* 2    <null>                                 foll-vfork-exit ^M
	(gdb) I'm the proud parent of child #5044!^M
	FAIL: gdb.base/foll-vfork.exp: exit: vfork relations in info inferiors: \
	  vfork relation no longer appears in info inferiors (timeout)
	...

	Fix this by removing the '$' anchor in the corresponding '$gdb_prompt $'
	regexps.

	Tested on x86_64-linux.

2021-11-12  Alan Modra  <amodra@gmail.com>

	Don't compile some opcodes files when bfd is 32-bit only
		* Makefile.am (TARGET_LIBOPCODES_CFILES): Split into..
		(TARGET64_LIBOPCODES_CFILES): ..this and..
		(TARGET32_LIBOPCODES_CFILES): ..this.
		(ALL_MACHINES): Likewise split to
		(ALL64_MACHINES, ALL32_MACHINES): ..this.
		* disassemble.c: Define some ARCH_* when ARCH_all only if BFD64.
		* configure.ac (BFD_MACHINES): Defined depending on BFD_ARCH_SIZE.
		* Makefile.in: Regenerate.
		* configure: Regenerate.

	Import Makefile.def from gcc
		* Makefile.def: Import from gcc.
		* Makefile.in: Regenerate.

2021-11-12  Alan Modra  <amodra@gmail.com>

	Fix demangle style usage info
	Extract allowed styles from libiberty, so we don't have to worry about
	our help messages getting out of date.  The function probably belongs
	in libiberty/cplus-dem.c but it can be here for a while to iron out
	bugs.

		PR 28581
		* demanguse.c: New file.
		* demanguse.h: New file.
		* nm.c (usage): Break up output.  Use display_demangler_styles.
		* objdump.c (usage): Use display_demangler_styles.
		* readelf.c (usage): Likewise.
		* Makefile.am: Add demanguse.c and demanguse.h.
		* Makefile.in: Regenerate.
		* po/POTFILESin: Regenerate.

2021-11-12  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-11  Simon Marchi  <simon.marchi@efficios.com>

	gdb: fix "set scheduler-locking" thread exit hang
	GDB hangs when doing this:

	 - launch inferior with multiple threads
	 - multiple threads hit some breakpoint(s)
	 - one breakpoint hit is presented as a stop, the rest are saved as
	   pending wait statuses
	 - "set scheduler-locking on"
	 - resume the currently selected thread (because of scheduler-locking,
	   it's the only one resumed), let it execute until exit
	 - GDB hangs, not showing the prompt, impossible to interrupt with ^C

	When the resumed thread exits, we expect the target to return a
	TARGET_WAITKIND_NO_RESUMED event, and that's what we see:

	    [infrun] fetch_inferior_event: enter
	      [infrun] scoped_disable_commit_resumed: reason=handling event
	      [infrun] random_pending_event_thread: None found.
	    [Thread 0x7ffff7d9c700 (LWP 309357) exited]
	      [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
	      [infrun] print_target_wait_results:   -1.0.0 [process -1],
	      [infrun] print_target_wait_results:   status->kind = no-resumed
	      [infrun] handle_inferior_event: status->kind = no-resumed
	      [infrun] handle_no_resumed: TARGET_WAITKIND_NO_RESUMED (ignoring: found resumed)
	      [infrun] prepare_to_wait: prepare_to_wait
	      [infrun] reset: reason=handling event
	      [infrun] maybe_set_commit_resumed_all_targets: not requesting commit-resumed for target native, no resumed threads
	    [infrun] fetch_inferior_event: exit

	The problem is in handle_no_resumed: we check if some other thread is
	actually resumed, to see if we should ignore that event (see comments in
	that function for more info).  If this condition is true:

	    (thread->executing () || thread->has_pending_waitstatus ())

	... then we ignore the event.  The problem is that there are some non-resumed
	threads with a pending event, which makes us ignore the event.  But these
	threads are not resumed, so we end up waiting while nothing executes, hence
	waiting for ever.

	My first fix was to change the condition to:

	    (thread->executing ()
	     || (thread->resumed () && thread->has_pending_waitstatus ()))

	... but then it occured to me that we could simply check for:

	    (thread->resumed ())

	Since "executing" implies "resumed", checking simply for "resumed"
	covers threads that are resumed and executing, as well as threads that
	are resumed with a pending status, which is what we want.

	Change-Id: Ie796290f8ae7f34c026ca3a8fcef7397414f4780

2021-11-11  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Fix Wimplicit-exception-spec-mismatch in clang build
	When building with clang 13 (and -std=gnu++17 to work around an issue in
	string_view-selftests.c), we run into a few Wimplicit-exception-spec-mismatch
	warnings:
	...
	src/gdbsupport/new-op.cc:102:1: error: function previously declared with an \
	  explicit exception specification redeclared with an implicit exception \
	  specification [-Werror,-Wimplicit-exception-spec-mismatch]
	operator delete (void *p)
	^
	/usr/include/c++/11/new:130:6: note: previous declaration is here
	void operator delete(void*) _GLIBCXX_USE_NOEXCEPT
	     ^
	...

	These are due to recent commit 5fff6115fea "Fix
	LD_PRELOAD=/usr/lib64/libasan.so.6 gdb".

	Fix this by adding the missing noexcept.

	Build on x86_64-linux, using gcc 7.5.0 and clang 13.0.0.

2021-11-11  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Fix build with -std=c++11
	When building with -std=c++11, we run into two Werror=missing-declarations:
	...
	new-op.cc: In function 'void operator delete(void*, std::size_t)':
	new-op.cc:114:1: error: no previous declaration for \
	  'void operator delete(void*, std::size_t)' [-Werror=missing-declarations]
	 operator delete (void *p, std::size_t) noexcept
	 ^~~~~~~~
	new-op.cc: In function 'void operator delete [](void*, std::size_t)':
	new-op.cc:132:1: error: no previous declaration for \
	  'void operator delete [](void*, std::size_t)' [-Werror=missing-declarations]
	 operator delete[] (void *p, std::size_t) noexcept
	 ^~~~~~~~
	...

	These are due to recent commit 5fff6115fea "Fix
	LD_PRELOAD=/usr/lib64/libasan.so.6 gdb".

	The declarations are provided by <new> (which is included) for c++14 onwards,
	but they are missing for c++11.

	Fix this by adding the missing declarations.

	Tested on x86_64-linux, with gcc 7.5.0, both without (implying -std=gnu++14) and
	with -std=c++11.

2021-11-11  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add gdb.arch/ppc64-break-on-_exit.exp
	Add a regression test-case for commit a50bdb99afe "[gdb/tdep, rs6000] Don't
	skip system call in skip_prologue":
	- set a breakpoint on a local copy of glibc's _exit, and
	- verify that it triggers.

	The test-case uses an assembly file by default, but also has the possibility
	to use a C source file instead.

	Tested on ppc64le-linux.  Verified that the test-case fails without
	aforementioned commit, and passes with the commit.  Both with assembly
	and C source.

2021-11-11  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Dump objects according to the elf architecture attribute.
	For now we should always generate the elf architecture attribute both for
	elf and linux toolchains, so that we could dump the objects correctly
	according to the generated architecture string.  This patch resolves the
	problem that we probably dump an object with c.nop instructions, but
	in fact the c extension isn't allowed.  Consider the following case,

	nelson@LAPTOP-QFSGI1F2:~/test$ cat temp.s
	.option norvc
	.option norelax
	.text
	add     a0, a0, a0
	.byte   0x1
	.balign 16
	nelson@LAPTOP-QFSGI1F2:~/test$ ~/binutils-dev/build-elf32-upstream/build-install/bin/riscv32-unknown-elf-as temp.s -o temp.o
	nelson@LAPTOP-QFSGI1F2:~/test$ ~/binutils-dev/build-elf32-upstream/build-install/bin/riscv32-unknown-elf-objdump -d temp.o

	temp.o:     file format elf32-littleriscv

	Disassembly of section .text:

	00000000 <.text>:
	   0:   00a50533                add     a0,a0,a0
	   4:   01                      .byte   0x01
	   5:   00                      .byte   0x00
	   6:   0001                    nop
	   8:   00000013                nop
	   c:   00000013                nop
	nelson@LAPTOP-QFSGI1F2:~/test$ ~/binutils-dev/build-elf32-upstream/build-install/bin/riscv32-unknown-elf-readelf -A temp.o
	Attribute Section: riscv
	File Attributes
	  Tag_RISCV_arch: "rv32i2p0_m2p0_a2p0_f2p0_d2p0"

	The c.nop at address 0x6 is generated for alignment, but since the rvc isn't
	allowed for this object, dump it as a c.nop instruction looks wrong.  After
	applying this patch, I get the following result,

	nelson@LAPTOP-QFSGI1F2:~/test$ ~/binutils-dev/build-elf32-upstream/build-install/bin/riscv32-unknown-elf-objdump -d temp.o

	temp.o:     file format elf32-littleriscv

	Disassembly of section .text:

	00000000 <.text>:
	   0:   00a50533                add     a0,a0,a0
	   4:   01                      .byte   0x01
	   5:   00                      .byte   0x00
	   6:   0001                    .2byte  0x1
	   8:   00000013                nop
	   c:   00000013                nop

	For the current objdump, we dump data to .byte/.short/.word/.dword, and
	dump the unknown or unsupported instructions to .2byte/.4byte/.8byte, which
	respectively are 2, 4 and 8 bytes instructions.  Therefore, we shouldn't
	dump the 0x0001 as a c.nop instruction in the above case, we should dump
	it to .2byte 0x1 as a unknown instruction, since the rvc is disabled.

	However, consider that some people may use the new objdump to dump the old
	objects, which don't have any elf attributes.  We usually set the default
	architecture string to rv64g by bfd/elfxx-riscv.c:riscv_set_default_arch.
	But this will cause rvc instructions to be unrecognized.  Therefore, we
	set the default architecture string to rv64gc for disassembler, to keep
	the previous behavior.

	This patch pass the riscv-gnu-toolchain gcc/binutils regressions for
	rv32emc-elf, rv32gc-linux, rv32i-elf, rv64gc-elf and rv64gc-linux
	toolchains.  Also, tested by --enable-targets=all and can build
	riscv-gdb successfully.

	bfd/
		* elfnn-riscv.c (riscv_merge_arch_attr_info): Tidy the
		codes for riscv_parse_subset_t setting.
		* elfxx-riscv.c (riscv_get_default_ext_version): Updated.
		(riscv_subset_supports): Moved from gas/config/tc-riscv.c.
		(riscv_multi_subset_supports): Likewise.
		* elfxx-riscv.h: Added extern for riscv_subset_supports and
		riscv_multi_subset_supports.
	gas/
		* config/tc-riscv.c (riscv_subset_supports): Moved to
		bfd/elfxx-riscv.c.
		(riscv_multi_subset_supports): Likewise.
		(riscv_rps_as): Defined for architectrue parser.
		(riscv_set_arch): Updated.
		(riscv_set_abi_by_arch): Likewise.
		(riscv_csr_address): Likewise.
		(reg_lookup_internal): Likewise.
		(riscv_ip): Likewise.
		(s_riscv_option): Updated.
		* testsuite/gas/riscv/mapping-04b.d: Updated.
		* testsuite/gas/riscv/mapping-norelax-03b.d: Likewise.
		* testsuite/gas/riscv/mapping-norelax-04b.d: Likewise.
	opcodes/
		* riscv-dis.c: Include elfxx-riscv.h since we need the
		architecture parser.  Also removed the cpu-riscv.h, it
		is already included in elfxx-riscv.h.
		(default_isa_spec): Defined since the parser need this
		to set the default architecture string.
		(xlen): Moved out from riscv_disassemble_insn as a global
		variable, it is more convenient to initialize riscv_rps_dis.
		(riscv_subsets): Defined to recoed the supported
		extensions.
		(riscv_rps_dis): Defined for architectrue parser.
		(riscv_disassemble_insn): Call riscv_multi_subset_supports
		to make sure if the instructions are valid or not.
		(print_insn_riscv): Initialize the riscv_subsets by parsing
		the elf architectrue attribute.  Otherwise, set the default
		architectrue string to rv64gc.

2021-11-11  Mike Frysinger  <vapier@gentoo.org>

	sim: testsuite: drop sim_compile cover function
	Most code isn't using this, and the only call site (in one cris file)
	can use target_compile directly.  So switch it over to simplify.

	sim: cris: stop testing a.out explicitly [ld/13900]
	Since gcc dropped support for a.out starting with 4.4.0 in 2009, it's
	been impossible to verify this code actually still works.  Since it
	crashes in ld, and it uses a config option that no other tests uses
	and we want to remove, drop the test to avoid all the trouble.

	sim: io: tweak compiler workaround with error output
	Outputting an extra space broke a cris test.  Change the workaround
	to use %s with an empty string to avoid the compiler warning but not
	output an extra space.

	sim: testsuite: delete unused arm remote host logic
	There's no need to sync testutils.inc with remote hosts.  The one
	we have in the source tree is all we need and only thing we test.
	Delete it to simplify.

	sim: synacor: simplify test generation
	Objcopy was used to create a binary file of just the executable code
	since the environment requires code to based at address 0.  We can
	accomplish the same thing with the -Ttext=0 flag, so switch to that
	to get rid of custom logic.

2021-11-11  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-10  Tom Tromey  <tromey@adacore.com>

	Handle PIE in .debug_loclists
	Simon pointed out that my recent patches to .debug_loclists caused
	some regressions.  After a brief discussion we realized it was because
	his system compiler defaults to PIE.

	This patch changes this code to unconditionally apply the text offset
	here.  It also changes loclist_describe_location to work more like
	dwarf2_find_location_expression.

	I tested this by running the gdb.dwarf2 tests both with and without
	-pie.

2021-11-10  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	arm: enable Cortex-A710 CPU
	This patch is adding support for Cortex-A710 CPU in Arm.

	bfd/

		* cpu-arm.c (processors): Add cortex-a710.

	gas/

		* NEWS: Update docs.
		* config/tc-arm.c (arm_cpus): Add cortex-a710 to -mcpu.
		* doc/c-arm.texi: Update docs.
		* testsuite/gas/arm/cpu-cortex-a710.d: New test.

2021-11-10  Clément Chigot  <clement.chigot@atos.net>

	gdb: adjust x_file fields on COFF readers
	Commit e86fc4a5bc37 ("PR 28447: implement multiple parameters for .file
	on XCOFF") changes the structure associated to the internal
	representation of files in COFF formats.  However, gdb directory update
	has been forgotten, leading to compilation errors of this kind:

	      CXX    coffread.o
	    /home/simark/src/binutils-gdb/gdb/coffread.c: In function 'const char* coff_getfilename(internal_auxent*)':
	    /home/simark/src/binutils-gdb/gdb/coffread.c:1343:29: error: 'union internal_auxent::<unnamed struct>::<unnamed>' has no member named 'x_zeroes'
	     1343 |   if (aux_entry->x_file.x_n.x_zeroes == 0)
	          |                             ^~~~~~~~

	Fix it by adjusting the COFF code in GDB.

	Change-Id: I703fa134bc722d47515efbd72b88fa5650af6c3c

2021-11-10  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add gdb.opt/break-on-_exit.exp
	Add a test-case to excercise the problem scenario reported in PR28527 and
	fixed in commit a50bdb99afe "[gdb/tdep, rs6000] Don't skip system call in
	skip_prologue":
	- set a breakpoint on _exit, and
	- verify that it triggers.

	Note that this is not a regression test for that commit.  Since the actual
	code in _exit may vary across os instances, we cannot guarantee that the
	problem will always trigger with this test-case.

	Rather, this test-case is a version of the original test-case
	(gdb.threads/process-dies-while-detaching.exp) that is minimal while still
	reproducing the problem reported in PR28527, in that same setting.

	The benefit of this test-case is that it exercise real-life code and may
	expose similar problems in other settings.  Also, it provides a much easier
	test-case to investigate in case a similar problem occurs.

	Tested on x86_64-linux and ppc64le-linux.

2021-11-10  Mike Frysinger  <vapier@gentoo.org>

	sim: frv: flip trapdump default back to off
	When I refactored this by scoping it to sim-frv-xxx in commit
	e7954ef5e5ed90fb7d28c013518f4c2e6bcd20a1 ("sim: frv: scope the
	unique configure flag"), I changed the default from off to on.
	While the feature is nice for developers, it breaks a bunch of
	tests which aren't expecting this extra output.  So flip it back
	to off by default.

2021-11-10  Pekka Seppänen  <pexu@sourceware.mail.kapsi.fi>

	PR28575, readelf.c and strings.c use undefined type uint
	Since --unicode support (commit b3aa80b45c4) both binutils/readelf.c
	and binutils/strings.c use 'uint' in a few locations.  It likely
	should be 'unsigned int' since there isn't anything defining 'uint'
	within binutils (besides zlib) and AFAIK it isn't a standard type.

		* readelf.c (print_symbol): Replace uint with unsigned int.
		* strings.c (string_min, display_utf8_char): Likewise.
		(print_unicode_stream_body, print_unicode_stream): Likewise.
		(print_strings): Likewise.
		(get_unicode_byte): Wrap long line.

2021-11-10  Clément Chigot  <clement.chigot@atos.net>

	ld: set correct flags for AIX shared tests
	Previous flags were aimed to be run with XLC.
	Nowadays, only GCC is being tested with GNU toolchain. Moreover,
	recent XLC versions might also accept "-shared".

		* testsuite/ld-shared/shared.exp: Adjust shared flags.

2021-11-10  Clément Chigot  <clement.chigot@atos.net>

	PR 28447: implement multiple parameters for .file on XCOFF
	On XCOFF, ".file" pseudo-op allows 3 extras parameters to provide
	additional information to AIX linker, or its debugger. These are
	stored in auxiliary entries of the C_FILE symbol.

	bfd/
		PR 28447
		* coffcode.h (combined_entry_type): Add extrap field.
		(coff_bigobj_swap_aux_in): Adjust names of x_file fields.
		(coff_bigobj_swap_aux_out): Likewise.
		* coffgen.c (coff_write_auxent_fname): New function.
		(coff_fix_symbol_name): Write x_file using
		 coff_write_auxent_fname.
		(coff_write_symbol): Likewise.
		(coff_write_symbols): Add C_FILE auxiliary entries to
		string table if needed.
		(coff_get_normalized_symtab): Adjust names of x_file fields.
		Normalize C_FILE auxiliary entries.
		(coff_print_symbol): Print C_FILE auxiliary entries.
		* coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust names of
		x_file fields.
		(_bfd_xcoff_swap_aux_out): Likewise.
		* coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Likewise.
		(_bfd_xcoff64_swap_aux_out): Likewise.
		* cofflink.c (_bfd_coff_final_link): Likewise.
		(_bfd_coff_link_input_bfd): Likewise.
		* coffswap.h (coff_swap_aux_in): Likewise.
		* peXXigen.c (_bfd_XXi_swap_aux_in): Likewise.
		(_bfd_XXi_swap_aux_out): Likewise.
		* xcofflink.c (xcoff_link_input_bfd): Likewise.
		* libcoff.h: Regenerate.
	gas/
		* config/tc-ppc.c (ppc_file): New function.
		* config/tc-ppc.h (OBJ_COFF_MAX_AUXENTRIES): Change to 4.
		* testsuite/gas/ppc/aix.exp: Add tests.
		* testsuite/gas/ppc/xcoff-file-32.d: New test.
		* testsuite/gas/ppc/xcoff-file-64.d: New test.
		* testsuite/gas/ppc/xcoff-file.s: New test.
	include/
		* coff/internal.h (union internal_auxent): Change x_file to be a
		  struct instead of a union. Add x_ftype field.
		* coff/rs6000.h (union external_auxent): Add x_resv field.
		* coff/xcoff.h (XFT_FN): New define.
		(XFT_CT): Likewise.
		(XFT_CV): Likewise.
		(XFT_CD): Likewise.

2021-11-10  Kevin Buettner  <kevinb@redhat.com>

	Test case for Bug 28308
	The purpose of this test is described in the comments in
	dprintf-execution-x-script.exp.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28308

	The name of this new test was based on that of an existing test,
	bp-cmds-execution-x-script.exp.  I started off by copying that test,
	adding to it, and then rewriting almost all of it.  It's different
	enough that I decided that listing the copyright year as 2021
	was sufficient.

2021-11-10  Kevin Buettner  <kevinb@redhat.com>

	Fix PR 28308 - dprintf breakpoints not working when run from script
	This commit fixes Bug 28308, titled "Strange interactions with
	dprintf and break/commands":

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28308

	Since creating that bug report, I've found a somewhat simpler way of
	reproducing the problem.  I've encapsulated it into the GDB test case
	which I've created along with this bug fix.  The name of the new test
	is gdb.base/dprintf-execution-x-script.exp, I'll demonstrate the
	problem using this test case, though for brevity, I've placed all
	relevant files in the same directory and have renamed the files to all
	start with 'dp-bug' instead of 'dprintf-execution-x-script'.

	The script file, named dp-bug.gdb, consists of the following commands:

	dprintf increment, "dprintf in increment(), vi=%d\n", vi
	break inc_vi
	commands
	  continue
	end
	run

	Note that the final command in this script is 'run'.  When 'run' is
	instead issued interactively, the  bug does not occur.  So, let's look
	at the interactive case first in order to see the correct/expected
	output:

	$ gdb -q -x dp-bug.gdb dp-bug
	... eliding buggy output which I'll discuss later ...
	(gdb) run
	Starting program: /mesquite2/sourceware-git/f34-master/bld/gdb/tmp/dp-bug
	vi=0
	dprintf in increment(), vi=0

	Breakpoint 2, inc_vi () at dprintf-execution-x-script.c:26
	26	in dprintf-execution-x-script.c
	vi=1
	dprintf in increment(), vi=1

	Breakpoint 2, inc_vi () at dprintf-execution-x-script.c:26
	26	in dprintf-execution-x-script.c
	vi=2
	dprintf in increment(), vi=2

	Breakpoint 2, inc_vi () at dprintf-execution-x-script.c:26
	26	in dprintf-execution-x-script.c
	vi=3
	[Inferior 1 (process 1539210) exited normally]

	In this run, in which 'run' was issued from the gdb prompt (instead
	of at the end of the script), there are three dprintf messages along
	with three 'Breakpoint 2' messages.  This is the correct output.

	Now let's look at the output that I snipped above; this is the output
	when 'run' is issued from the script loaded via GDB's -x switch:

	$ gdb -q -x dp-bug.gdb dp-bug
	Reading symbols from dp-bug...
	Dprintf 1 at 0x40116e: file dprintf-execution-x-script.c, line 38.
	Breakpoint 2 at 0x40113a: file dprintf-execution-x-script.c, line 26.
	vi=0
	dprintf in increment(), vi=0

	Breakpoint 2, inc_vi () at dprintf-execution-x-script.c:26
	26	dprintf-execution-x-script.c: No such file or directory.
	vi=1

	Breakpoint 2, inc_vi () at dprintf-execution-x-script.c:26
	26	in dprintf-execution-x-script.c
	vi=2

	Breakpoint 2, inc_vi () at dprintf-execution-x-script.c:26
	26	in dprintf-execution-x-script.c
	vi=3
	[Inferior 1 (process 1539175) exited normally]

	In the output shown above, only the first dprintf message is printed.
	The 2nd and 3rd dprintf messages are missing!  However, all three
	'Breakpoint 2...' messages are still printed.

	Why does this happen?

	bpstat_do_actions_1() in gdb/breakpoint.c contains the following
	comment and code near the start of the function:

	  /* Avoid endless recursion if a `source' command is contained
	     in bs->commands.  */
	  if (executing_breakpoint_commands)
	    return 0;

	  scoped_restore save_executing
	    = make_scoped_restore (&executing_breakpoint_commands, 1);

	Also, as described by this comment prior to the 'async' field
	in 'struct ui' in top.h, the main UI starts off in sync mode
	when processing command line arguments:

	  /* True if the UI is in async mode, false if in sync mode.  If in
	     sync mode, a synchronous execution command (e.g, "next") does not
	     return until the command is finished.  If in async mode, then
	     running a synchronous command returns right after resuming the
	     target.  Waiting for the command's completion is later done on
	     the top event loop.  For the main UI, this starts out disabled,
	     until all the explicit command line arguments (e.g., `gdb -ex
	     "start" -ex "next"') are processed.  */

	This combination of things, the state of the static global
	'executing_breakpoint_commands' plus the state of the async
	field in the main UI causes this behavior.

	This is a backtrace after hitting the dprintf breakpoint for
	the second time when doing 'run' from the script file, i.e.
	non-interactively:

	Thread 1 "gdb" hit Breakpoint 3, bpstat_do_actions_1 (bsp=0x7fffffffc2b8)
	    at /ironwood1/sourceware-git/f34-master/bld/../../worktree-master/gdb/breakpoint.c:4431
	4431	  if (executing_breakpoint_commands)

	 #0  bpstat_do_actions_1 (bsp=0x7fffffffc2b8)
	     at gdb/breakpoint.c:4431
	 #1  0x00000000004d8bc6 in dprintf_after_condition_true (bs=0x1538090)
	     at gdb/breakpoint.c:13048
	 #2  0x00000000004c5caa in bpstat_stop_status (aspace=0x116dbc0, bp_addr=0x40116e, thread=0x137f450, ws=0x7fffffffc718,
	     stop_chain=0x1538090) at gdb/breakpoint.c:5498
	 #3  0x0000000000768d98 in handle_signal_stop (ecs=0x7fffffffc6f0)
	     at gdb/infrun.c:6172
	 #4  0x00000000007678d3 in handle_inferior_event (ecs=0x7fffffffc6f0)
	     at gdb/infrun.c:5662
	 #5  0x0000000000763cd5 in fetch_inferior_event ()
	     at gdb/infrun.c:4060
	 #6  0x0000000000746d7d in inferior_event_handler (event_type=INF_REG_EVENT)
	     at gdb/inf-loop.c:41
	 #7  0x00000000007a702f in handle_target_event (error=0, client_data=0x0)
	     at gdb/linux-nat.c:4207
	 #8  0x0000000000b8cd6e in gdb_wait_for_event (block=block@entry=0)
	     at gdbsupport/event-loop.cc:701
	 #9  0x0000000000b8d032 in gdb_wait_for_event (block=0)
	     at gdbsupport/event-loop.cc:597
	 #10 gdb_do_one_event () at gdbsupport/event-loop.cc:212
	 #11 0x00000000009d19b6 in wait_sync_command_done ()
	     at gdb/top.c:528
	 #12 0x00000000009d1a3f in maybe_wait_sync_command_done (was_sync=0)
	     at gdb/top.c:545
	 #13 0x00000000009d2033 in execute_command (p=0x7fffffffcb18 "", from_tty=0)
	     at gdb/top.c:676
	 #14 0x0000000000560d5b in execute_control_command_1 (cmd=0x13b9bb0, from_tty=0)
	     at gdb/cli/cli-script.c:547
	 #15 0x000000000056134a in execute_control_command (cmd=0x13b9bb0, from_tty=0)
	     at gdb/cli/cli-script.c:717
	 #16 0x00000000004c3bbe in bpstat_do_actions_1 (bsp=0x137f530)
	     at gdb/breakpoint.c:4469
	 #17 0x00000000004c3d40 in bpstat_do_actions ()
	     at gdb/breakpoint.c:4533
	 #18 0x00000000006a473a in command_handler (command=0x1399ad0 "run")
	     at gdb/event-top.c:624
	 #19 0x00000000009d182e in read_command_file (stream=0x113e540)
	     at gdb/top.c:443
	 #20 0x0000000000563697 in script_from_file (stream=0x113e540, file=0x13bb0b0 "dp-bug.gdb")
	     at gdb/cli/cli-script.c:1642
	 #21 0x00000000006abd63 in source_gdb_script (extlang=0xc44e80 <extension_language_gdb>, stream=0x113e540,
	     file=0x13bb0b0 "dp-bug.gdb") at gdb/extension.c:188
	 #22 0x0000000000544400 in source_script_from_stream (stream=0x113e540, file=0x7fffffffd91a "dp-bug.gdb",
	     file_to_open=0x13bb0b0 "dp-bug.gdb")
	     at gdb/cli/cli-cmds.c:692
	 #23 0x0000000000544557 in source_script_with_search (file=0x7fffffffd91a "dp-bug.gdb", from_tty=1, search_path=0)
	     at gdb/cli/cli-cmds.c:750
	 #24 0x00000000005445cf in source_script (file=0x7fffffffd91a "dp-bug.gdb", from_tty=1)
	     at gdb/cli/cli-cmds.c:759
	 #25 0x00000000007cf6d9 in catch_command_errors (command=0x5445aa <source_script(char const*, int)>,
	     arg=0x7fffffffd91a "dp-bug.gdb", from_tty=1, do_bp_actions=false)
	     at gdb/main.c:523
	 #26 0x00000000007cf85d in execute_cmdargs (cmdarg_vec=0x7fffffffd1b0, file_type=CMDARG_FILE, cmd_type=CMDARG_COMMAND,
	     ret=0x7fffffffd18c) at gdb/main.c:615
	 #27 0x00000000007d0c8e in captured_main_1 (context=0x7fffffffd3f0)
	     at gdb/main.c:1322
	 #28 0x00000000007d0eba in captured_main (data=0x7fffffffd3f0)
	     at gdb/main.c:1343
	 #29 0x00000000007d0f25 in gdb_main (args=0x7fffffffd3f0)
	     at gdb/main.c:1368
	 #30 0x00000000004186dd in main (argc=5, argv=0x7fffffffd508)
	     at gdb/gdb.c:32

	There are two frames for bpstat_do_actions_1(), one at frame #16 and
	the other at frame #0.  The one at frame #16 is processing the actions
	for Breakpoint 2, which is a 'continue'.  The one at frame #0 is attempting
	to process the dprintf breakpoint action.  However, at this point,
	the value of 'executing_breakpoint_commands' is 1, forcing an early
	return, i.e. prior to executing the command(s) associated with the dprintf
	breakpoint.

	For the sake of comparison, this is what the stack looks like when hitting
	the dprintf breakpoint for the second time when issuing the 'run'
	command from the GDB prompt.

	Thread 1 "gdb" hit Breakpoint 3, bpstat_do_actions_1 (bsp=0x7fffffffccd8)
	    at /ironwood1/sourceware-git/f34-master/bld/../../worktree-master/gdb/breakpoint.c:4431
	4431	  if (executing_breakpoint_commands)

	 #0  bpstat_do_actions_1 (bsp=0x7fffffffccd8)
	     at gdb/breakpoint.c:4431
	 #1  0x00000000004d8bc6 in dprintf_after_condition_true (bs=0x16b0290)
	     at gdb/breakpoint.c:13048
	 #2  0x00000000004c5caa in bpstat_stop_status (aspace=0x116dbc0, bp_addr=0x40116e, thread=0x13f0e60, ws=0x7fffffffd138,
	     stop_chain=0x16b0290) at gdb/breakpoint.c:5498
	 #3  0x0000000000768d98 in handle_signal_stop (ecs=0x7fffffffd110)
	     at gdb/infrun.c:6172
	 #4  0x00000000007678d3 in handle_inferior_event (ecs=0x7fffffffd110)
	     at gdb/infrun.c:5662
	 #5  0x0000000000763cd5 in fetch_inferior_event ()
	     at gdb/infrun.c:4060
	 #6  0x0000000000746d7d in inferior_event_handler (event_type=INF_REG_EVENT)
	     at gdb/inf-loop.c:41
	 #7  0x00000000007a702f in handle_target_event (error=0, client_data=0x0)
	     at gdb/linux-nat.c:4207
	 #8  0x0000000000b8cd6e in gdb_wait_for_event (block=block@entry=0)
	     at gdbsupport/event-loop.cc:701
	 #9  0x0000000000b8d032 in gdb_wait_for_event (block=0)
	     at gdbsupport/event-loop.cc:597
	 #10 gdb_do_one_event () at gdbsupport/event-loop.cc:212
	 #11 0x00000000007cf512 in start_event_loop ()
	     at gdb/main.c:421
	 #12 0x00000000007cf631 in captured_command_loop ()
	     at gdb/main.c:481
	 #13 0x00000000007d0ebf in captured_main (data=0x7fffffffd3f0)
	     at gdb/main.c:1353
	 #14 0x00000000007d0f25 in gdb_main (args=0x7fffffffd3f0)
	     at gdb/main.c:1368
	 #15 0x00000000004186dd in main (argc=5, argv=0x7fffffffd508)
	     at gdb/gdb.c:32

	This relatively short backtrace is due to the current UI's async field
	being set to 1.

	Yet another thing to be aware of regarding this problem is the
	difference in the way that commands associated to dprintf breakpoints
	versus regular breakpoints are handled.  While they both use a command
	list associated with the breakpoint, regular breakpoints will place
	the commands to be run on the bpstat chain constructed in
	bp_stop_status().  These commands are run later on.  For dprintf
	breakpoints, commands are run via the 'after_condition_true' function
	pointer directly from bpstat_stop_status().  (The 'commands' field in
	the bpstat is cleared in dprintf_after_condition_true().  This
	prevents the dprintf commands from being run again later on when other
	commands on the bpstat chain are processed.)

	Another thing that I noticed is that dprintf breakpoints are the only
	type of breakpoint which use 'after_condition_true'.  This suggests
	that one possible way of fixing this problem, that of making dprintf
	breakpoints work more like regular breakpoints, probably won't work.
	(I must admit, however, that my understanding of this code isn't
	complete enough to say why.  I'll trust that whoever implemented it
	had a good reason for doing it this way.)

	The comment referenced earlier regarding 'executing_breakpoint_commands'
	states that the reason for checking this variable is to avoid
	potential endless recursion when a 'source' command appears in
	bs->commands.  We know that a dprintf command is constrained to either
	1) execution of a GDB printf command, 2) an inferior function call of
	a printf-like function, or 3) execution of an agent-printf command.
	Therefore, infinite recursion due to a 'source' command cannot happen
	when executing commands upon hitting a dprintf breakpoint.

	I chose to fix this problem by having dprintf_after_condition_true()
	directly call execute_control_commands().  This means that it no
	longer attempts to go through bpstat_do_actions_1() avoiding the
	infinite recursion check for potential 'source' commands on the
	command chain.  I think it simplifies this code a little bit too, a
	definite bonus.

	Summary:

		* breakpoint.c (dprintf_after_condition_true): Don't call
		bpstat_do_actions_1().  Call execute_control_commands()
		instead.

2021-11-10  Alan Modra  <amodra@gmail.com>

	Re: Add --unicode option
		* objdump: Whitespace fixes.
		(long_options): Correct "ctf" entry.

2021-11-10  Alan Modra  <amodra@gmail.com>

	Re: Add --unicode option
	At low optimisation levels gcc may warn.

		* strings.c (print_unicode_stream_body): Avoid bogus "may be
		used unitialised" warning.

2021-11-10  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-09  Alan Modra  <amodra@gmail.com>

	PR28543, readelf entered an infinite loop
	This little tweak terminates fuzzed binary readelf output a little
	quicker.

		PR 28543
		* dwarf.c (read_and_display_attr_value): Consume a byte when
		form is unrecognized.

2021-11-09  Alan Modra  <amodra@gmail.com>

	PR28542, Undefined behaviours in readelf.c
		PR 28542
		* readelf.c (dump_relocations): Check that section headers have
		been read before attempting to access section name.
		(print_dynamic_symbol): Likewise.
		(process_mips_specific): Delete dead code.

2021-11-09  Pedro Alves  <pedro@palves.net>

	gdb::array_view slicing/container selftest - test std::array too
	Change-Id: I2141b0b8a09f6521a59908599eb5ba1a19b18dc6

2021-11-09  Simon Marchi  <simon.marchi@efficios.com>

	gdb.debuginfod/fetch_src_and_symbols.exp: fix when GDB is built with AddressSanitizer
	This test fails for me, showing:

	    ERROR: tcl error sourcing /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp.
	    ERROR: This GDB was configured as follows:
	       configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
	                 --with-auto-load-dir=$debugdir:$datadir/auto-load
	                 --with-auto-load-safe-path=$debugdir:$datadir/auto-load
	    ... and much more ...

	The problem is that TCL's exec throws an error as soon as the exec'ed
	process outputs on stderr.  When GDB is built with ASan, it prints some
	warnings about pre-existing signal handlers:

	    warning: Found custom handler for signal 7 (Bus error) preinstalled.
	    warning: Found custom handler for signal 8 (Floating point exception) preinstalled.
	    warning: Found custom handler for signal 11 (Segmentation fault) preinstalled.

	Pass --quiet to GDB to avoid these warnings.

	Change-Id: I3751d89b9b1df646da19149d7cb86775e2d3e80f

2021-11-09  Tom Tromey  <tromey@adacore.com>

	Correctly handle DW_LLE_start_end
	When the code to handle DW_LLE_start_end was added (as part of some
	DWARF 5 work), it was written to add the base address.  However, this
	seems incorrect -- the DWARF standard describes this as an address,
	not an offset from the base address.

	This patch changes a couple of spots in dwarf2/loc.c to fix this
	problem.  It then changes decode_debug_loc_addresses to return
	DEBUG_LOC_OFFSET_PAIR instead, which preserves the previous semantics.

	This only showed up on the RISC-V target internally, due to the
	combination of DWARF 5 and a newer version of GCC.  I've updated a
	couple of existing loclists test cases to demonstrate the bug.

2021-11-09  Tom Tromey  <tromey@adacore.com>

	Fix build on rhES5
	The rhES5 build failed due to an upstream import a while back.  The
	bug here is that, while the 'personality' function exists,
	ADDR_NO_RANDOMIZE is only defined in <linux/personality.h>, not
	<sys/personality.h>.

	However, <linux/personality.h> does not declare the 'personality'
	function, and <sys/personality.h> and <linux/personality.h> cannot
	both be included.

	This patch restores one of the removed configure checks and updates
	the code to check it.

	We had this as a local patch at AdaCore, because it seemed like there
	was no interest upstream.  However, now it turns out that this fixes
	PR build/28555, so I'm sending it now.

2021-11-09  H.J. Lu  <hjl.tools@gmail.com>

	doc/ctf-spec.texi: Remove "@validatemenus off"
	Remove @validatemenus from ctf-spec.texi, which has been removed from
	texinfo by

	commit a16dd1a9ece08568a1980b9a65a3a9090717997f
	Author: Gavin Smith <gavinsmith0123@gmail.com>
	Date:   Mon Oct 12 16:32:37 2020 +0100

	    * doc/texinfo.texi
	    (Writing a Menu, Customization Variables for @-Commands)
	    (Command List),
	    * doc/refcard/txirefcard.tex
	    Remove @validatemenus.
	    * tp/Texinfo/XS/Makefile.am (command_ids.h): Use gawk instead
	    of awk.  Avoid discouraged "$p" usage, using "$(p)" instead.
	    * tp/Texinfo/XS/configure.ac: Check for gawk.

	commit 128acab3889b51809dc3bd3c6c74b61d13f7f5f4
	Author: Gavin Smith <gavinsmith0123@gmail.com>
	Date:   Thu Jan 3 14:51:53 2019 +0000

	    Update refcard.

	    * doc/refcard/txirefcard.tex: @setfilename is no longer
	    mandatory.  Do not mention @validatemenus or explicitly giving
	    @node pointers, as these are not very important features.

		PR libctf/28567
		* doc/ctf-spec.texi: Remove "@validatemenus off".

2021-11-09  Nick Clifton  <nickc@redhat.com>

	Add --unicode option to control how unicode characters are handled by display tools.
		* nm.c: Add --unicode option to control how unicode characters are
		handled.
		* objdump.c: Likewise.
		* readelf.c: Likewise.
		* strings.c: Likewise.
		* binutils.texi: Document the new feature.
		* NEWS: Document the new feature.
		* testsuite/binutils-all/unicode.exp: New file.
		* testsuite/binutils-all/nm.hex.unicode
		* testsuite/binutils-all/strings.escape.unicode
		* testsuite/binutils-all/objdump.highlight.unicode
		* testsuite/binutils-all/readelf.invalid.unicode

2021-11-09  Mike Frysinger  <vapier@gentoo.org>

	sim: sh: simplify testsuite a bit
	Switch from the centralized list in the exp file to each test declaring
	its own requirements which they're already (mostly) doing.  This will
	increase coverage slightly by running more tests in more configurations
	since the hardcoded exp list was a little out of date.

	We have to mark the psh* tests as shdsp only (to match what the exp
	file was doing), mark the fsca & fsrra tests as failing (since they
	weren't even being run by the exp file), and to fix the expected
	output & status of the fail test.

2021-11-09  Mike Frysinger  <vapier@gentoo.org>

	sim: cris: clean up missing func prototype warnings
	Move some unused funcs under existing #if 0 protection, mark a few
	local funcs as static, and add missing prototypes for the rest which
	are used from other files.  This fixes all the fatal warnings in the
	mloop files so we can turn -Werror on here fully.

2021-11-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-08  Lancelot SIX  <lsix@lancelotsix.com>

	Improve gdb::array_view ctor from contiguous containers
	While reading the interface of gdb::array_view, I realized that the
	constructor that builds an array_view on top of a contiguous container
	(such as std::vector, std::array or even gdb::array_view) can be
	missused.

	Lets consider the following code sample:

		struct Parent
		{
		  Parent (int a): a { a } {}
		  int a;
		};

		std::ostream &operator<< (std::ostream& os, const Parent & p)
		{ os << "Parent {a=" << p.a << "}"; return os; }

		struct Child : public Parent
		{
		  Child (int a, int b): Parent { a }, b { b } {}
		  int b;
		};

		std::ostream &operator<< (std::ostream& os, const Child & p)
		{ os << "Child {a=" << p.a << ", b=" << p.b << "}"; return os; }

		template <typename T>
		void print (const gdb::array_view<const T> &p)
		{
		  std::for_each (p.begin (), p.end (), [](const T &p) { std::cout << p << '\n'; });
		}

	Then with the current interface nothinng prevents this usage of
	array_view to be done:

		const std::array<Child, 3> elts = {
		  Child {1, 2},
		  Child {3, 4},
		  Child {5, 6}
		};
		print_all<Parent> (elts);

	This compiles fine and produces the following output:

		Parent {a=1}
		Parent {a=2}
		Parent {a=3}

	which is obviously wrong.  There is nowhere in memory a Parent-like
	object for which the A member is 2 and this call to print_all<Parent>
	shold not compile at all (calling print_all<Child> is however fine).

	This comes down to the fact that a Child* is convertible into a Parent*,
	and that an array view is constructed to a pointer to the first element
	and a size.  The valid type pointed to that can be used with this
	constructor are restricted using SFINAE, which requires that a
	pointer to a member into the underlying container can be converted into a
	pointer the array_view's data type.

	This patch proposes to change the constraints on the gdb::array_view
	ctor which accepts a container now requires that the (decayed) type of
	the elements in the container match the (decayed) type of the array_view
	being constructed.

	Applying this change required minimum adjustment in GDB codebase, which
	are also included in this patch.

	Tested by rebuilding.

2021-11-08  Lancelot SIX  <lsix@lancelotsix.com>

	Add a const version of gdb_argv:as_array_view
	This commits adds const versions for the GET and AS_ARRAX_VIEW methods
	of gdb_argv.  Those methods will be required in the following patch of
	the series.

2021-11-08  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix nulltr -> nullptr typo
	Change-Id: I04403bd85ec3fa75ea14130d68daba675a2a8aeb

2021-11-08  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: tweak scoped_disable_commit_resumed uses when resuming all threads in non-stop
	When doing "continue -a" in non-stop mode, each thread is individually
	resumed while the commit resumed state is enabled.  This forces the
	target to commit each resumption immediately, instead of being able to
	batch things.

	The reason is that there is no scoped_disable_commit_resumed around the
	loop over threads in continue_1, when "non_stop && all_threads" is true.
	Since the proceed function is called once for each thread, the
	scoped_disable_commit_resumed in proceed therefore forces commit-resumed
	between each thread resumption.  Add the necessary
	scoped_disable_commit_resumed in continue_1 to avoid that.

	I looked at the MI side of things, the function exec_continue, and found
	that it was correct.  There is a similar iteration over threads, and
	there is a scoped_disable_commit_resumed at the function scope.  This is
	not wrong, but a bit more than we need.  The branches that just call
	continue_1 do not need it, as continue_1 takes care of disabling commit
	resumed.  So, move the scoped_disable_commit_resumed to the inner scope
	where we iterate on threads and proceed them individually.

	Here's an example debugging a multi-threaded program attached by
	gdbserver (debug output trimmed for brevity):

	    $ ./gdb -nx -q --data-directory=data-directory -ex "set non-stop" -ex "tar rem :1234"
	    (gdb) set debug remote
	    (gdb) set debug infrun
	    (gdb) c -a
	    Continuing.
	    [infrun] proceed: enter
	      [infrun] scoped_disable_commit_resumed: reason=proceeding
	      [remote] Sending packet: $vCont;c:p14388.14388#90
	      [infrun] reset: reason=proceeding
	      [infrun] maybe_set_commit_resumed_all_targets: enabling commit-resumed for target remote
	      [infrun] maybe_call_commit_resumed_all_targets: calling commit_resumed for target remote
	    [infrun] proceed: exit
	    [infrun] proceed: enter
	      [infrun] scoped_disable_commit_resumed: reason=proceeding
	      [remote] Sending packet: $vCont;c:p14388.1438a#b9
	      [infrun] reset: reason=proceeding
	      [infrun] maybe_set_commit_resumed_all_targets: enabling commit-resumed for target remote
	      [infrun] maybe_call_commit_resumed_all_targets: calling commit_resumed for target remote
	    [infrun] proceed: exit
	    ... and so on for each thread ...

	Notice how we send one vCont;c for each thread.  With the patch applied, we
	send a single vCont;c at the end:

	    [infrun] scoped_disable_commit_resumed: reason=continue all threads in non-stop
	    [infrun] proceed: enter
	      [infrun] scoped_disable_commit_resumed: reason=proceeding
	      [infrun] reset: reason=proceeding
	    [infrun] proceed: exit
	    [infrun] clear_proceed_status_thread: Thread 85790.85792
	    [infrun] proceed: enter
	      [infrun] scoped_disable_commit_resumed: reason=proceeding
	      [infrun] reset: reason=proceeding
	    [infrun] proceed: exit
	    ... proceeding threads individually ...
	    [infrun] reset: reason=continue all threads in non-stop
	    [infrun] maybe_set_commit_resumed_all_targets: enabling commit-resumed for target remote
	    [infrun] maybe_call_commit_resumed_all_targets: calling commit_resumed for target remote
	    [remote] Sending packet: $vCont;c#a8

	Change-Id: I331dd2473c5aa5114f89854196fed2a8fdd122bb

2021-11-08  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make dwarf2_find_containing_comp_unit take a dwarf2_per_bfd
	While reading another patch, I saw that this function didn't need to
	take a dwarf2_per_objfile, but could take a dwarf2_per_bfd instead.
	It doesn't change the behavior, but doing this shows that this function
	is objfile-independent (can work with only the shared per-bfd data).

	Change-Id: I58f9c9cef6688902e95226480285da2d0005d77f

2021-11-08  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove bpstat typedef, rename bpstats to bpstat
	I don't find that the bpstat typedef, which hides a pointer, is
	particularly useful.  In fact, it confused me many times, and I just see
	it as something to remember that adds cognitive load.  Also, with C++,
	we might want to be able to pass bpstats objects by const-reference, not
	necessarily by pointer.

	So, remove the bpstat typedef and rename struct bpstats to bpstat (since
	it represents one bpstat, it makes sense that it is singular).

	Change-Id: I52e763b6e54ee666a9e045785f686d37b4f5f849

2021-11-08  Nick Alcock  <nick.alcock@oracle.com>

	libctf: add CTF format specification
	It's been a long time since most of this was written: it's long past
	time to put it in the binutils source tree.  It's believed correct and
	complete insofar as it goes: it documents format v3 (the current
	version) but not the libctf API or any earlier versions.  (The
	earlier versions can be read by libctf but not generated by it, and you
	are highly unlikely ever to see an example of any of them.)

	libctf/ChangeLog
	2021-11-08  Nick Alcock  <nick.alcock@oracle.com>

		* doc/ctf-spec.texi: New file.
		* configure.ac (MAKEINFO): Add.
		(BUILD_INFO): Likewise.
		(AC_CONFIG_FILES) [doc/Makefile]: Add.
		* Makefile.am [BUILD_INFO] (SUBDIRS): Add doc/.
		* doc/Makefile.am: New file.
		* doc/Makefile.in: Likewise.
		* configure: Regenerated.
		* Makefile.in: Likewise.

2021-11-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-07  Alan Modra  <amodra@gmail.com>

	Correct ld script wildcard matching description
	Goes with commit 68bbb9f788d0

		* ld.texi (Input Section Wildcards): Delete paragraph incorrectly
		saying '*' does not match '/'.

2021-11-07  Mike Frysinger  <vapier@gentoo.org>

	sim: sh: fix conversion of PC to an integer
	On LLP64 targets where sizeof(long) != sizeof(void*), this code fails:
	sim/sh/interp.c:704:24: error: cast from pointer to integer of different size  -Werror=pointer-to-int-cast]
	  704 |   do { memstalls += ((((long) PC & 3) != 0) ? (n) : ((n) - 1)); } while (0)
	      |                        ^

	Since this code simply needs to check alignment, cast it using uintptr_t
	which is the right type for this.

2021-11-07  Mike Frysinger  <vapier@gentoo.org>

	sim: sh: clean up time(NULL) call
	Casting 0 to a pointer via (long *) doesn't work on LLP64 targets:
	error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

	It's also unnecessary here.  We can simply pass NULL like every other
	bit of code does.

2021-11-07  Mike Frysinger  <vapier@gentoo.org>

	sim: sh: break utime logic out of _WIN32 check
	Some _WIN32 targets provide utime (like mingw), so move the header
	include out from _WIN32 and under the specific HAVE_UTIME_H check.

	sim: sh: drop errno extern
	This isn't needed on any reasonable target nowadays, and no other
	source does this, and breaks with some mingw targets, so punt the
	extern entirely.

	sim: sh: fix isnan redefinition with mingw targets
	The code assumes that all _WIN32 targets are the same and can
	define isnan to _isnan.  For mingw targets, they provide an isnan
	define already, so no need for the fallback here.

	sim: arm/bfin/rx: undefine page size from system headers
	Some targets (like cygwin) will export page size defines that clash
	with our local usage here.  Undefine the system one to fix building
	for these targets.

	sim: ppc: switch to libiberty environ.h
	Drop our compat code and assume environ exists to simplify.
	We did this for all other targets already, but ppc was missed.

	sim: sh: enable -Werror everywhere
	With most of the warnings fixed in interp.c, we can enable -Werror
	here too now.  There are some -Wmaybe-uninitialized warnings still
	lurking that look legitimate, but we don't flag those are fatal,
	and I don't have the expertise to dive into each opcode to figure
	out the right way to clean them up.

	sim: sh: fix uninitialized variable usage with pdmsb
	This block of code relies on i to control which bits to test and how
	many times to run through the loop, but it never actually initialized
	it.  There is another chunk of code that handles the pdmsb instruction
	that sets i to 16, so use that here too assuming it's correct.  The
	programming manual suggests this is the right value too, but I am by
	no means a SuperH DSP expert.  The tests are still passing though ...

	sim: sh: constify a few read-only lookup tables

	sim: sh: fix various parentheses warnings
	Add parentheses to a bunch of places where the compiler suggests we
	do to avoid confusion to most readers.

	sim: sh: fix unused-value warnings
	These macro expansions are deliberate in not using the computed value
	so that they trigger side-effects (possible invalid memory accesses)
	but while otherwise being noops.  Add a (void) cast so the compiler
	knows these are intentional.

	sim: sh: rework register layout with anonymous unions & structs
	Now that we require C11, we can leverage anonymous unions & structs
	to fix a long standing issue with the SH register layout.  The use
	of sregs.i for sh-dsp has generated a lot of compiler warnings about
	the access being out of bounds -- it only has 7 elements declared,
	but code goes beyond that to reach into the fregs that follow.  But
	now that we have anonymous unions, we can reduce the nested names
	and have sregs cover all of these registers.

2021-11-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-06  Tiezhu Yang  <yangtiezhu@loongson.cn>

	sim: mips: use sim_fpu_to{32,64}u to fix build warnings
	Since the first argument type is unsigned32 or unsigned64, just use
	sim_fpu_to{32,64}u instead of sim_fpu_to{32,64}i to fix the following
	build warnings:

	  CC     cp1.o
	.../sim/mips/cp1.c: In function 'convert':
	.../sim/mips/cp1.c:1425:32: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign]
	       status |= sim_fpu_to32i (&result32, &wop, round);
	                                ^~~~~~~~~
	In file included from .../sim/mips/sim-main.h:67,
	                 from .../sim/mips/cp1.c:46:
	.../sim/mips/../common/sim-fpu.h:270:22: note: expected 'signed32 *' {aka 'int *'} but argument is of type 'unsigned32 *' {aka 'unsigned int *'}
	 INLINE_SIM_FPU (int) sim_fpu_to32i (signed32 *i, const sim_fpu *f,
	                      ^~~~~~~~~~~~~
	.../sim/mips/cp1.c:1429:32: warning: pointer targets in passing argument 1 of 'sim_fpu_to64i' differ in signedness [-Wpointer-sign]
	       status |= sim_fpu_to64i (&result64, &wop, round);
	                                ^~~~~~~~~
	In file included from .../sim/mips/sim-main.h:67,
	                 from .../sim/mips/cp1.c:46:
	.../sim/mips/../common/sim-fpu.h:274:22: note: expected 'signed64 *' {aka 'long int *'} but argument is of type 'unsigned64 *' {aka 'long unsigned int *'}
	 INLINE_SIM_FPU (int) sim_fpu_to64i (signed64 *i, const sim_fpu *f,
	                      ^~~~~~~~~~~~~
	.../sim/mips/cp1.c: In function 'convert_ps':
	.../sim/mips/cp1.c:1528:34: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign]
	       status_u |= sim_fpu_to32i (&res_u, &wop_u, round);
	                                  ^~~~~~
	In file included from .../sim/mips/sim-main.h:67,
	                 from .../sim/mips/cp1.c:46:
	.../sim/mips/../common/sim-fpu.h:270:22: note: expected 'signed32 *' {aka 'int *'} but argument is of type 'unsigned32 *' {aka 'unsigned int *'}
	 INLINE_SIM_FPU (int) sim_fpu_to32i (signed32 *i, const sim_fpu *f,
	                      ^~~~~~~~~~~~~
	.../sim/mips/cp1.c:1529:34: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign]
	       status_l |= sim_fpu_to32i (&res_l, &wop_l, round);
	                                  ^~~~~~
	In file included from .../sim/mips/sim-main.h:67,
	                 from .../sim/mips/cp1.c:46:
	.../sim/mips/../common/sim-fpu.h:270:22: note: expected 'signed32 *' {aka 'int *'} but argument is of type 'unsigned32 *' {aka 'unsigned int *'}
	 INLINE_SIM_FPU (int) sim_fpu_to32i (signed32 *i, const sim_fpu *f,
	                      ^~~~~~~~~~~~~

2021-11-06  Alan Modra  <amodra@gmail.com>

	Modernise yyerror
	Newer versions of bison emit a prototype for yyerror
		void yyerror (const char *);
	This clashes with some of our old code that declares yyerror to return
	an int.  Fix that in most cases by modernizing yyerror.  bfin-parse.y
	uses the return value all over the place, so for there disable
	generation of the prototype as specified by posix.

	binutils/
		* arparse.y (yyerror): Return void.
		* dlltool.c (yyerror): Likewise.
		* dlltool.h (yyerror): Likewise.
		* sysinfo.y (yyerror): Likewise.
		* windmc.h (yyerror): Likewise.
		* mclex.c (mc_error): Extract from ..
		(yyerror): ..here, both now returning void.
	gas/
		* config/bfin-parse.y (yyerror): Define.
		(yyerror): Make static.
		* itbl-parse.y (yyerror): Return void.
	ld/
		* deffilep.y (def_error): Return void.

2021-11-06  Alan Modra  <amodra@gmail.com>

	ubsan: undefined shift in mach-o.c
	This one was logically wrong too.  If file_ptr was 64 bits, then -1U
	is extended to 0x00000000ffffffff, probably not what was intended
	here.

		* mach-o.c (FILE_ALIGN): Correct expression.

2021-11-06  Fangrui Song  <maskray@google.com>

	readelf: Support RELR in -S and -d and output
	readelf -r dumping support is not added in this patch.

	include/
		* elf/common.h: Add SHT_RELR, DT_RELR{,SZ,ENT}
	bfd/
		* elf.c (_bfd_elf_print_private_bfd_data): Add DT_RELR{,SZ,ENT}.
	binutils/
		* readelf.c (get_dynamic_type): Add DT_RELR{,SZ,ENT}.
		(get_section_type_name): Add SHT_RELR.

2021-11-06  Fangrui Song  <maskray@google.com>

	readelf: Make DT_PREINIT_ARRAYSZ's output style match DT_INIT_ARRAYSZ
	The output now looks like:

	- 0x0000000000000021 (PREINIT_ARRAYSZ)    0x10
	+ 0x0000000000000021 (PREINIT_ARRAYSZ)    16 (bytes)
	  0x0000000000000019 (INIT_ARRAY)         0xbefc90
	  0x000000000000001b (INIT_ARRAYSZ)       536 (bytes)

		* readelf.c (process_dynamic_section): Handle DT_PREINIT_ARRAYSZ.

2021-11-06  Mike Frysinger  <vapier@gentoo.org>

	sim: clarify license text via COPYING file
	The project has been using GPL v3 for a while now in the source files,
	and the arm & ppc ports have carried a copy of the COPYING file.  Lets
	move those up to the top sim dir like other projects to make it clear.

	Also drop the ppc/COPYING.LIB as it's not really referenced by any
	source as everything is GPL v3.

2021-11-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-05  Tom Tromey  <tom@tromey.com>

	Introduce make_unique_xstrndup
	This adds a new make_unique_xstrndup function, which is the "n"
	analogue of make_unique_xstrdup.  It also updates a couple existing
	places to use this function.

2021-11-05  Pedro Alves  <pedro@palves.net>

	Avoid /proc/pid/mem races (PR 28065)
	PR 28065 (gdb.threads/access-mem-running-thread-exit.exp intermittent
	failure) shows that GDB can hit an unexpected scenario -- it can
	happen that the kernel manages to open a /proc/PID/task/LWP/mem file,
	but then reading from the file returns 0/EOF, even though the process
	hasn't exited or execed.

	"0" out of read/write is normally what you get when the address space
	of the process the file was open for is gone, because the process
	execed or exited.  So when GDB gets the 0, it returns memory access
	failure.  In the bad case in question, the process hasn't execed or
	exited, so GDB fails a memory access when the access should have
	worked.

	GDB has code in place to gracefully handle the case of opening the
	/proc/PID/task/LWP/mem just while the LWP is exiting -- most often the
	open fails with EACCES or ENOENT.  When it happens, GDB just tries
	opening the file for a different thread of the process.  The testcase
	is written such that it stresses GDB's logic of closing/reopening the
	/proc/PID/task/LWP/mem file, by constantly spawning short lived
	threads.

	However, there's a window where the kernel manages to find the thread,
	but the thread exits just after and clears its address space pointer.
	In this case, the kernel creates a file successfully, but the file
	ends up with no address space associated, so a subsequent read/write
	returns 0/EOF too, just like if the whole process had execed or
	exited.  This is the case in question that GDB does not handle.

	Oleg Nesterov gave this suggestion as workaround for that race:

	    gdb can open(/proc/pid/mem) and then read (say) /proc/pid/statm.
	    If statm reports something non-zero, then open() was "successfull".

	I think that might work.  However, I didn't try it, because I realized
	we have another nasty race that that wouldn't fix.

	The other race I realized is that because we close/reopen the
	/proc/PID/task/LWP/mem file when GDB switches to a different inferior,
	then it can happen that GDB reopens /proc/PID/task/LWP/mem just after
	a thread execs, and before GDB has seen the corresponding exec event.
	I.e., we can open a /proc/PID/task/LWP/mem file accessing the
	post-exec address space thinking we're accessing the pre-exec address
	space.

	A few months back, Simon, Oleg and I discussed a similar race:

	  [Bug gdb/26754] Race condition when resuming threads and one does an exec
	  https://sourceware.org/bugzilla/show_bug.cgi?id=26754

	The solution back then was to make the kernel fail any ptrace
	operation until the exec event is consumed, with this kernel commit:

	 commit dbb5afad100a828c97e012c6106566d99f041db6
	 Author:     Oleg Nesterov <oleg@redhat.com>
	 AuthorDate: Wed May 12 15:33:08 2021 +0200
	 Commit:     Linus Torvalds <torvalds@linux-foundation.org>
	 CommitDate: Wed May 12 10:45:22 2021 -0700

	     ptrace: make ptrace() fail if the tracee changed its pid unexpectedly

	This however, only applies to ptrace, not to the /proc/pid/mem file
	opening case.  Also, even if it did apply to the file open case, we
	would want to support current kernels until such a fix is more wide
	spread anyhow.

	So all in all, this commit gives up on the idea of only ever keeping
	one /proc/pid/mem file descriptor open.  Instead, make GDB open a
	/proc/pid/mem per inferior, and keep it open until the inferior exits,
	is detached or execs.  Make GDB open the file right after the inferior
	is created or is attached to or forks, at which point we know the
	inferior is stable and stopped and isn't thus going to exec, or have a
	thread exit, and so the file open won't fail (unless the whole process
	is SIGKILLed from outside GDB, at which point it doesn't matter
	whether we open the file).

	This way, we avoid both races described above, at the expense of using
	more file descriptors (one per inferior).

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28065
	Change-Id: Iff943b95126d0f98a7973a07e989e4f020c29419

2021-11-05  Andrew Burgess  <aburgess@redhat.com>

	gdb/testsuite: use gdb_get_line_number
	Replaces a hard coded line number with a use of gdb_get_line_number.

	I suspect that the line number has, over time, come adrift from where
	it was supposed to be stopping.  When the test was first added, line
	770 pointed at the final 'return 0' in function main.  Over time, as
	things have been added, line 770 now points at some random location in
	the middle of main.

	So, I've marked the 'return 0' with a comment, and now the test will
	always stop there.

	I also removed an old comment from 1997 talking about how these tests
	will only pass with the HP compiler, followed by an additional comment
	from 2000 saying that the tests now pass with GCC.

	I get the same results before and after this change.

2021-11-05  Alan Modra  <amodra@gmail.com>

	PR28541, unstable cie offset in the output of readelf
	Calculating "0 - pointer" can indeed result in seeming randomness as
	the pointer address varies.

		PR 28541
		* dwarf.c (display_debug_frames): Don't print cie offset when
		invalid, print "invalid" instead.  Remove now redundant warning.

2021-11-05  Alan Modra  <amodra@gmail.com>

	Missing va_end in aarch64-dis.c
		* aarch64-dis.c (extract_fields): Invoke va_end.

2021-11-05  Alan Modra  <amodra@gmail.com>

	PR28530, Hang in objdump on machine with 196GB RAM
	Investigating the PR28530 testcase, which has a fuzzed compression
	header with an enormous size, I noticed that decompress_contents is
	broken when the size doesn't fit in strm.avail_out.  It wouldn't be
	too hard to support larger sizes (patches welcome!) but for now just
	stop decompress_contents from returning rubbish.

		PR 28530
		* compress.c (decompress_contents): Fail when uncompressed_size
		is too big.
		(bfd_init_section_decompress_status): Likewise.

2021-11-05  Alan Modra  <amodra@gmail.com>

	asan: alpha-vms: objdump buffer overflows
		* vms-alpha.c (evax_bfd_print_desc): Sanity check buffer access.
		(evax_bfd_print_valspec, evax_bfd_print_typspec): Likewise.
		(evax_bfd_print_dst): Likewise.

2021-11-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: introduce "set index-cache enabled", deprecate "set index-cache on/off"
	The "set index-cache" command is used at the same time as a prefix
	command (prefix for "set index-cache directory", for example), and a
	boolean setting for turning the index-cache on and off.  Even though I
	did introduce that, I now don't think it's a good idea to do something
	non-standard like this.

	First, there's no dedicated CLI command to show whether the index-cache
	is enabled, so it has to be custom output in the "show index-cache
	handler".  Also, it means there's no good way a MI frontend can find out
	if the index-cache is enabled.  "-gdb-show index-cache" doesn't show it
	in the MI output record:

	    (gdb) interpreter-exec mi "-gdb-show index-cache"
	    ~"\n"
	    ~"The index cache is currently disabled.\n"
	    ^done,showlist={option={name="directory",value="/home/simark/.cache/gdb"}}

	Fix this by introducing "set/show index-cache enabled on/off", regular
	boolean setting commands.  Keep commands "set index-cache on" and "set
	index-cache off" as deprecated aliases of "set index-cache enabled",
	with respectively the default arguments "on" and "off".

	Update tests using "set index-cache on/off" to use the new command.
	Update the regexps in gdb.base/maint.exp to figure out whether the
	index-cache is enabled or not.  Update the doc to mention the new
	commands.

	Change-Id: I7d5aaaf7fd22bf47bd03e0023ef4fbb4023b37b3

2021-11-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: pass/return setting setter/getter scalar values by value
	The getter and setter in struct setting always receive and return values
	by const reference.  This is not necessary for scalar values (like bool
	and int), but more importantly it makes it a bit annoying to write a
	getter, you have to use a scratch static variable or something similar
	that you can refer to:

	  const bool &
	  my_getter ()
	  {
	    static bool value;
	    value = function_returning_bool ();
	    return value;
	  }

	Change the getter and setter function signatures to receive and return
	value by value instead of by reference, when the underlying data type is
	scalar.  This means that string-based settings will still use
	references, but all others will be by value.  The getter above would
	then be re-written as:

	  bool
	  my_getter ()
	  {
	    return function_returning_bool ();
	  }

	This is useful for a patch later in this series that defines a boolean
	setting with a getter and a setter.

	Change-Id: Ieca3a2419fcdb75a6f75948b2c920b548a0af0fd

2021-11-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove command_class enum class_deprecated
	The class_deprecated enumerator isn't assigned anywhere, so remove it.
	Commands that are deprecated have cmd_list_element::cmd_deprecated set
	instead.

	Change-Id: Ib35e540915c52aa65f13bfe9b8e4e22e6007903c

2021-11-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove unnecessary cmd_list_element::aliases nullptr checks
	Remove two unnecessary nullptr checks.  If aliases is nullptr, then the
	for loops will simply be skipped.

	Change-Id: I9132063bb17798391f8d019af305383fa8e0229f

2021-11-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbserver: re-generate configure
	I get some diffs when running autoconf in gdbserver, probably leftovers
	from commit 5dfe4bfcb969 ("Fix format_pieces selftest on Windows").
	Re-generate configure in that directory.

	Change-Id: Icdc9906af95fbaf1047a579914b2983f8ec5db08

2021-11-04  H.J. Lu  <hjl.tools@gmail.com>

	Revert "bfd: Always check sections with the corrupt size"
	This reverts commit e0f7ea91436dd308a094c4c101fd4169e8245a91.

2021-11-04  H.J. Lu  <hjl.tools@gmail.com>

	bfd: Always check sections with the corrupt size
	Always check sections with the corrupt size for non-MMO files.  Skip MMO
	files for compress_status == COMPRESS_SECTION_NONE since MMO has special
	handling for COMPRESS_SECTION_NONE.

		PR binutils/28530
		* compress.c (bfd_get_full_section_contents): Always check
		sections with the corrupt size.

2021-11-04  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Clarify the behavior of .option rvc or norvc.
	Add/Remove the rvc extension to/from the riscv_subsets once the
	.option rvc/norvc is set.  So that we don't need to always check
	the riscv_opts.rvc in the riscv_subset_supports, just call the
	riscv_lookup_subset to search the subset list is enough.

	Besides, we will need to dump the instructions according to the
	elf architecture attributes.  That means the dis-assembler needs
	to parse the architecture string from the elf attribute before
	dumping any instructions, and also needs to recognized the
	INSN_CLASS* classes from riscv_opcodes.  Therefore, I suppose
	some functions will need to be moved from gas/config/tc-riscv.c
	to bfd/elfxx-riscv.c, including riscv_multi_subset_supports and
	riscv_subset_supports.  This is one of the reasons why we need
	this patch.

	This patch passes the gcc/binutils regressions of rv32emc-elf,
	rv32i-elf, rv64gc-elf and rv64gc-linux toolchains.

	bfd/
		* elfxx-riscv.c (riscv_remove_subset): Remove the extension
		from the subset list.
		(riscv_update_subset): Add/Remove an extension to/from the
		subset list.  This is used for the .option rvc or norvc.
		* elfxx-riscv.h: Added the extern bool riscv_update_subset.
	gas/
		* config/tc-riscv.c (riscv_set_options): Removed the unused
		rve flag.
		(riscv_opts): Likewise.
		(riscv_set_rve): Removed.
		(riscv_subset_supports): Removed the riscv_opts.rvc check.
		(riscv_set_arch): Don't need to call riscv_set_rve.
		(reg_lookup_internal): Call riscv_subset_supports to check
		whether the rve is supported.
		(s_riscv_option): Add/Remove the rvc extension to/from the
		subset list once the .option rvc/norvc is set.

2021-11-04  Mike Frysinger  <vapier@gentoo.org>

	sim: mips: fix missing prototype in multi-run generation
	The multi-run logic for mips involves a bit of codegen and rewriting
	of files to include per-architecture prefixes.  That can result in
	files with missing prototypes which cause compiler errors.  In the
	case of mips-sde-elf targets, we have:
	$srcdir/m16run.c -> $builddir/m16mips64r2_run.c
	  sim_engine_run -> m16mips64r2_engine_run
	$srcdir/micromipsrun.c -> micromipsmicromips_run.c
	  sim_engine_run -> micromips64micromips_engine_run

	micromipsmicromips_run.c:80:1: error: no previous prototype for 'micromips64micromips_engine_run' [-Werror=missing-prototypes]
	   80 | micromips64micromips_engine_run (SIM_DESC sd, int next_cpu_nr, int nr_cpus,

	We generate headers for those prototypes in the configure script,
	but only include them in the generated multi-run.c file.  Update the
	rewrite logic to turn the sim-engine.h include into the relevant
	generated engine include so these files also have their prototypes.
	$srcdir/m16run.c -> $builddir/m16mips64r2_run.c
	  sim-engine.h -> m16mips64r2_engine.h
	$srcdir/micromipsrun.c -> micromipsmicromips_run.c
	  sim-engine.h -> micromips64micromips_engine.h

2021-11-04  Alan Modra  <amodra@gmail.com>

	PR28540, segmentation fault on NULL byte_get
		PR 28540
		* objdump.c (dump_bfd): Don't attempt load_separate_debug_files
		when byte_get is NULL.

2021-11-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-03  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: inline common sim-fpu.c logic
	We will never bother building w/out a ../common/ sim directory,
	so drop ancient logic supporting that method.

2021-11-03  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: switch to common builds for callback objects
	We don't need to build this anymore ourselves since the common build
	includes it and produces the same object code.  We also need to pull
	in the split constant modules after the refactoring and pulling them
	out of nltvals.def & targ-map.o.  This doesn't matter for the sim
	directly, but does for gdb and other users of libsim.

	We also delete some conditional source tree logic since we already
	require this be the "new" combined tree with a ../common/ dir.  This
	has been the case for decades at this point.

2021-11-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix gnu-nat build
	When building gnu-nat.c, we get:

	      CXX    gnu-nat.o
	    gnu-nat.c: In member function 'virtual void gnu_nat_target::create_inferior(const char*, const string&, char**, int)':
	    gnu-nat.c:2117:13: error: 'struct inf' has no member named 'target_is_pushed'
	     2117 |   if (!inf->target_is_pushed (this))
	          |             ^~~~~~~~~~~~~~~~
	    gnu-nat.c:2118:10: error: 'struct inf' has no member named 'push_target'
	     2118 |     inf->push_target (this);
	          |          ^~~~~~~~~~~

	This is because of a confusion between the generic `struct inferior`
	variable and the gnu-nat-specific `struct inf` variable.  Fix by
	referring to `inferior`, not `inf`.

	Adjust the comment on top of `struct inf` to clarify the purpose of that
	type.

	Co-Authored-By: Andrea Monaco <andrea.monaco@autistici.org>
	Change-Id: I2fe2f7f6ef61a38d79860fd262b08835c963fc77

2021-11-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: set ASAN_OPTIONS=detect_leaks=0 while running tests
	We see some additional failures when running the testsuite against a GDB
	compiled with ASan, compared to a GDB compiled without ASan.  Some of
	them are caused by the memory leak report shown by the GDB process when
	it exits, and the fact that it makes it exit with a non-zero exit code.

	I generally try to remember to set ASAN_OPTIONS=detect_leaks=0 in my
	environment when running the tests, but I don't always do it.  I think
	it would be nice if the testsuite did it.  I don't see any use to have
	leak detection when running the tests.  That is, unless we ever have a
	test that ensures GDB doesn't leak memory, which isn't going to happen
	any time soon.

	Here are some tests I found that were affected by this:

	    gdb.base/batch-exit-status.exp
	    gdb.base/many-headers.exp
	    gdb.base/quit.exp
	    gdb.base/with-mf.exp
	    gdb.dwarf2/gdb-add-index.exp
	    gdb.dwarf2/gdb-add-index-symlink.exp
	    gdb.dwarf2/imported-unit-runto-main.exp

	Change-Id: I784c7df8a13979eb96587f735c1d33ba2cc6e0ca

2021-11-03  Tom Tromey  <tromey@adacore.com>

	Use section name in warnings in display_debug_loc
	While looking at an apparently malformed executable with
	"readelf --debug-dump=loc", I got this warning:

	    readelf: ./main: Warning: There is a hole [0x89 - 0x95] in .debug_loc section.

	However, the executable only has a .debug_loclists section.

	This patch fixes the warning messages in display_debug_loc to use the
	name of the section that is being processed.

	binutils/ChangeLog
	2021-11-03  Tom Tromey  <tromey@adacore.com>

		* dwarf.c (display_debug_loc): Use section name in warnings.

2021-11-03  Luis Machado  <luis.machado@linaro.org>

	[AArch64] Make gdbserver register set selection dynamic
	The current register set selection mechanism for AArch64 is static, based
	on a pre-populated array of register sets.

	This means that we might potentially probe register sets that are not
	available. This is OK if the kernel errors out during ptrace, but probing the
	tag_ctl register, for example, does not result in a ptrace error if the kernel
	supports the tagged address ABI but not MTE (PR 28355).

	Making the register set selection dynamic, based on feature checks, solves
	this and simplifies the code a bit. It allows us to list all of the register
	sets only once, and pick and choose based on HWCAP/HWCAP2 or other properties.

	I plan to backport this fix to GDB 11 as well.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28355

2021-11-03  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix LD_PRELOAD=/usr/lib64/libasan.so.6 gdb
	Currently for a binary compiled normally (without -fsanitize=address) but with
	LD_PRELOAD of ASAN one gets:

	$ ASAN_OPTIONS=detect_leaks=0:alloc_dealloc_mismatch=1:abort_on_error=1:fast_unwind_on_malloc=0 LD_PRELOAD=/usr/lib64/libasan.so.6 gdb
	=================================================================
	==1909567==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete []) on 0x602000001570
	    #0 0x7f1c98e5efa7 in operator delete[](void*) (/usr/lib64/libasan.so.6+0xb0fa7)
	...
	0x602000001570 is located 0 bytes inside of 2-byte region [0x602000001570,0x602000001572)
	allocated by thread T0 here:
	    #0 0x7f1c98e5cd1f in __interceptor_malloc (/usr/lib64/libasan.so.6+0xaed1f)
	    #1 0x557ee4a42e81 in operator new(unsigned long) (/usr/libexec/gdb+0x74ce81)
	SUMMARY: AddressSanitizer: alloc-dealloc-mismatch (/usr/lib64/libasan.so.6+0xb0fa7) in operator delete[](void*)
	==1909567==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
	==1909567==ABORTING

	Despite the code called properly operator new[] and operator delete[].
	But GDB's new-op.cc provides its own operator new[] which gets translated into
	malloc() (which gets recogized as operatore new(size_t)) but as it does not
	translate also operators delete[] Address Sanitizer gets confused.

	The question is how many variants of the delete operator need to be provided.
	There could be 14 operators new but there are only 4, GDB uses 3 of them.
	There could be 16 operators delete but there are only 6, GDB uses 2 of them.
	It depends on libraries and compiler which of the operators will get used.
	Currently being used:
	                 U operator new[](unsigned long)
	                 U operator new(unsigned long)
	                 U operator new(unsigned long, std::nothrow_t const&)
	                 U operator delete[](void*)
	                 U operator delete(void*, unsigned long)

	Tested on x86_64-linux.

2021-11-03  Alan Modra  <amodra@gmail.com>

	asan: dlltool buffer overflow: embedded NUL in string
	yyleng gives the pattern length, xstrdup just copies up to the NUL.
	So it is quite possible writing at an index of yyleng-2 overflows
	the xstrdup allocated string buffer.  xmemdup quite handily avoids
	this problem, even writing the terminating NUL over the trailing
	quote.  Use it in ldlex.l too where we'd already had a report of this
	problem and fixed it by hand, and to implement xmemdup0 in gas.

	binutils/
		* deflex.l (single and double quote strings): Use xmemdup.
	gas/
		* as.h (xmemdup0): Use xmemdup.
	ld/
		PR 20906
		* ldlex.l (double quote string): Use xmemdup.

2021-11-03  Mike Frysinger  <vapier@gentoo.org>

	sim: mloop: mark a few conditionally used funcs as unused
	These are marked inline, so building w/gcc at higher optimization
	levels will automatically discard them.  But building with -O0 will
	trigger unused function warnings, so fix that.

	The common before/after cover functions in the common mloop generator
	are not used by all architecture ports.  Doesn't seem to be a hard
	requirement, so marking them optional (i.e. unused) is fine.

	The cris execute function is conditionally used depending on the
	fast-build mode settings, so mark it unused too.

2021-11-03  Alan Modra  <amodra@gmail.com>

	asan: assert (addr_ranges) <= (start)
	That assert would be more obvious if it were reported as
	"addr_ranges <= end_ranges".  Fix that by using the obvious variable
	in the final loop.  Stop the assertion by using a signed comparison:
	It's possible for the rounding up of the arange pointer to exceed the
	end of the block when the block size is fuzzed.

		* dwarf.c (display_debug_aranges): Use "end_ranges" in loop
		displaying ranges rather that "start".  Simplify rounding up
		to 2*address_size boundary.  Use signed comparison in loop.

2021-11-03  Mike Frysinger  <vapier@gentoo.org>

	sim: hoist cgen mloop rules up to common builds
	These rules don't depend on the target compiler settings, so hoist
	the build logic up to the common builds for better parallelization.

	We have to extend the genmloop.sh logic a bit to allow outputting
	to a subdir since it always assumed cwd was the right place.

	We leave the cgen maintainer rules in the subdirs for now as they
	aren't normally run, and they rely on cgen logic that has not yet
	been generalized.

2021-11-03  Mike Frysinger  <vapier@gentoo.org>

	sim: hoist mn10300 & v850 igen rules up to common builds
	These rules don't depend on the target compiler settings, so hoist
	the build logic up to the common builds for better parallelization.

	We leave the mips rules in place as they depend on complicated
	arch-specific configure logic that needs to be untangled first.

2021-11-03  Mike Frysinger  <vapier@gentoo.org>

	sim: hoist gencode & opc2c build rules up to common builds
	These rules don't depend on the target compiler settings, so hoist
	the build logic up to the common builds for better parallelization.

2021-11-03  Mike Frysinger  <vapier@gentoo.org>

	opcodes: d10v: simplify header includes
	This file doesn't use anything from bfd (sysdep.h), so drop that
	include.  This avoids an implicit dependency on the generated
	config.h which can be problematic for build-time tools.

	Also swap stdio.h for stddef.h.  This file isn't doing or using
	any I/O structures, but it does need NULL.

2021-11-03  Alan Modra  <amodra@gmail.com>

	PR28523, ld.bfd created undefined symbols on ppc64
	This patch removes any fake (linker created) function descriptor
	symbol if its code entry symbol isn't dynamic, to ensure bogus dynamic
	symbols are not created.  The change to func_desc_adjust requires that
	it be run only once, which means ppc64_elf_tls_setup can't call it for
	just a few selected symbols.

		PR 28523
		* elf64-ppc.c (func_desc_adjust): If a function entry sym is
		not dynamic and has no plt entry, hide any associated fake
		function descriptor symbol.
		(ppc64_elf_edit): Move func_desc_adjust iteration over syms to..
		(ppc64_elf_tls_setup): ..here.

2021-11-03  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-02  Tom de Vries  <tdevries@suse.de>

	[gdb/tdep, rs6000] Don't skip system call in skip_prologue
	I ran into a case where a breakpoint on _exit never triggered, because it was
	set past the end of the _exit prologue, past the end of the exit_group system
	call (which does not return).

	More concretely, the breakpoint was set at the last insn show here:
	...
	Dump of assembler code for function _exit:
	   0x00007ffff7e42ea0 <+0>:     12 00 4c 3c     addis   r2,r12,18
	   0x00007ffff7e42ea4 <+4>:     60 43 42 38     addi    r2,r2,17248
	   0x00007ffff7e42ea8 <+8>:     00 00 00 60     nop
	   0x00007ffff7e42eac <+12>:    f8 ff e1 fb     std     r31,-8(r1)
	   0x00007ffff7e42eb0 <+16>:    78 1b 7f 7c     mr      r31,r3
	   0x00007ffff7e42eb4 <+20>:    f0 ff c1 fb     std     r30,-16(r1)
	   0x00007ffff7e42eb8 <+24>:    ea 00 00 38     li      r0,234
	   0x00007ffff7e42ebc <+28>:    a0 8b 22 e9     ld      r9,-29792(r2)
	   0x00007ffff7e42ec0 <+32>:    78 fb e3 7f     mr      r3,r31
	   0x00007ffff7e42ec4 <+36>:    14 6a c9 7f     add     r30,r9,r13
	   0x00007ffff7e42ec8 <+40>:    02 00 00 44     sc
	   0x00007ffff7e42ecc <+44>:    26 00 00 7c     mfcr    r0
	   0x00007ffff7e42ed0 <+48>:    00 10 09 74     andis.  r9,r0,4096
	...

	Fix this by treating system calls the same as branches in skip_prologue:
	by default, don't skip, such that the breakpoint is set at 0x00007ffff7e42eb8
	instead.

	Tested on ppc64le-linux, on a power 8 machine.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28527

2021-11-02  Tom de Vries  <tdevries@zinfandel-3.arch.suse.de>

	[gdb/testsuite] Handle SIGILL in two gdb.arch powerpc test-cases
	On powerpc64le-linux, with test-case gdb.arch/powerpc-addpcis.exp I run into
	SIGILL:
	...
	(gdb) PASS: gdb.arch/powerpc-addpcis.exp: get hexadecimal valueof "$r3"
	stepi^M
	^M
	Program terminated with signal SIGILL, Illegal instruction.^M
	The program no longer exists.^M
	(gdb) PASS: gdb.arch/powerpc-addpcis.exp: set r4
	...
	because it's a power9 insn, and I'm running on a power8 machine.

	Fix this by handling the SIGILL.  Likewise in gdb.arch/powerpc-lnia.exp.

	Tested on powerpc64le-linux.

2021-11-02  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/sim: update my email address
	gdb:

		* MAINTAINERS (Global Maintainers): Update my address.
		(Responsible Maintainers): Likewise.
		(Write After Approval): Likewise.

	sim:

		* MAINTAINERS (Global Maintainers): Update my address.

2021-11-02  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix stepi test-cases with unix/-m32/-fPIE/-pie
	When running test-case gdb.base/step-indirect-call-thunk.exp with target board
	unix/-m32/-fPIE/-pie, I run into:
	...
	(gdb) stepi^M
	0x5655552e      22      {                /* inc.1 */^M
	(gdb) stepi^M
	0x56555530      22      {                /* inc.1 */^M
	(gdb) stepi^M
	0x565555f7 in __x86.get_pc_thunk.ax ()^M
	(gdb) FAIL: gdb.base/step-indirect-call-thunk.exp: stepi into return thunk
	...

	In contrast, with unix/-m32 we have instead:
	...
	(gdb) stepi^M
	0x08048407      22      {                /* inc.1 */^M
	(gdb) stepi^M
	23        return x + 1;  /* inc.2 */^M
	(gdb) stepi^M
	0x0804840c      23        return x + 1;  /* inc.2 */^M
	(gdb) stepi^M
	24      }                /* inc.3 */^M
	(gdb) stepi^M
	0x08048410      24      }                /* inc.3 */^M
	(gdb) stepi^M
	0x0804848f in __x86_return_thunk ()^M
	(gdb) PASS: gdb.base/step-indirect-call-thunk.exp: stepi into return thunk
	...

	The test-case doesn't expect to run into __x86.get_pc_thunk.ax, which is a
	PIC helper function for x86_64-linux.

	Fix this by insn-stepping through it.

	Likewise in a few other test-cases.

	Tested on x86_64-linux.

2021-11-02  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-11-01  Alan Modra  <amodra@gmail.com>

	ARM: match armeb output for unwind-pacbti-m test
		* testsuite/gas/arm/unwind-pacbti-m.d: Match armeb output.

2021-11-01  Bruno Larsen  <blarsen@redhat.com>

	[gdb/doc]: Updated manpages to be consistent with help
	Updated manpages to be consistent with help information provided by the
	binary. The main changes are:

	* Making all long-form options have '--', instead of a single '-';
	* added most of the missing options to the manpage;
	* removed the information about using '+' instead of '-', since it
	  doesn't seem to be supported anymore.

	This also fixes 2 upstream bugs:
	* https://sourceware.org/bugzilla/show_bug.cgi?id=23965; by adding
	--args to the manpage
	* https://sourceware.org/bugzilla/show_bug.cgi?id=10619; by adding the
	double dashes

2021-11-01  Alan Modra  <amodra@gmail.com>

	macho-o archive sanity checks
	Anti-fuzzing checks.

		* mach-o.c (bfd_mach_o_fat_archive_p): Sanity check entry offset
		and size against file size.

2021-11-01  Alan Modra  <amodra@gmail.com>

	objcopy buffer overflow
	"tocopy" in this code was an int, which when the size to be copied was
	larger than MAXINT could result in tocopy being negative.  A negative
	value of course is less than BUFSIZE, but when converted to
	bfd_size_type is extremely large.

		PR 995
		* objcopy.c (copy_unknown_object): Correct calculation of "tocopy".
		Use better variable types.

2021-11-01  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	arm: add armv9-a architecture to -march
	Update also include:
		+ New value of Tag_CPU_arch EABI attribute (22) is added.
		+ Updated missing Tag_CPU_arch EABI attributes.
		+ Updated how we combine archs 'v4t_plus_v6_m' as this mechanism
		  have to handle new Armv9 as well.

	Regression tested on `arm-none-eabi` cross Binutils and no issues.

	bfd/

		* archures.c: Define bfd_mach_arm_9.
		* bfd-in2.h (bfd_mach_arm_9): Define bfd_mach_arm_9.
		* cpu-arm.c: Add 'armv9-a' option to -march.
		* elf32-arm.c (using_thumb2_bl): Update assert check.
		(arch_has_arm_nop): Add TAG_CPU_ARCH_V9.
		(bfd_arm_get_mach_from_attributes): Add case for TAG_CPU_ARCH_V9.
		Update assert.
		(tag_cpu_arch_combine): Updated table.
		(v9): New table..

	binutils/

		* readelf.c (arm_attr_tag_CPU_arch): Update with

	elfcpp/

		* arm.h: Update TAG_CPU_ARCH_ enums with correct values.

	gas/

		* NEWS: Update docs.
		* config/tc-arm.c (get_aeabi_cpu_arch_from_fset): Return Armv9-a
		for -amarch=all.
		(aeabi_set_public_attributes): Update assert.
		* doc/c-arm.texi: Update docs.
		* testsuite/gas/arm/armv9-a_arch.d: New test.
		* testsuite/gas/arm/attr-march-all.d: Update test with v9.

	include/

		* elf/arm.h Update TAG_CPU_ARCH_ defines with correct values.
		* opcode/arm.h (ARM_EXT3_V9A): New macro.
		(ARM_ARCH_NONE): Updated with arm_feature_set.core size.
		(FPU_NONE): Updated.
		(ARM_ANY): Updated.
		(ARM_ARCH_UNKNOWN): New macro.
		(ARM_FEATURE_LOW): Updated.
		(ARM_FEATURE_CORE): Updated.
		(ARM_FEATURE_CORE_LOW): Updated.
		(ARM_FEATURE_CORE_HIGH): Updated.
		(ARM_FEATURE_COPROC): Updated.
		(ARM_FEATURE): Updated.
		(ARM_FEATURE_ALL): New macro.

	opcodes/

		* arm-dis.c (select_arm_features): Support bfd_mach_arm_9.
		Also Update bfd_mach_arm_unknown to use new macro ARM_ARCH_UNKNOWN.

2021-11-01  Mike Frysinger  <vapier@gentoo.org>

	sim: iq2000: reduce -Wno-error scope
	Clean up the warnings in sim-if, then reduce the -Werror disable to
	the files that still aren't clean that now that we require GNU make
	and can set variables on a per-object basis.

	sim: lm32: reduce -Wno-error scope
	Clean up some warnings in dv-lm32cpu, and all in sim-if, then reduce
	the -Werror disable to the files that still aren't clean that now that
	we require GNU make and can set variables on a per-object basis.

	sim: frv: reduce -Wno-error scope
	Only two files in here still generates warnings, so reduce the -Werror
	disable to that now that we require GNU make and can set variables on
	a per-object basis.

	sim: m32r: reduce -Wno-error scope
	Only two files in here still generates warnings, so reduce the -Werror
	disable to that now that we require GNU make and can set variables on
	a per-object basis.

	sim: mips: reduce -Wno-error scope
	Fix a few printf warnings in sim-main.c, and then we're left with only
	one file in here still generating warnings, so reduce the -Werror
	disable to that alone now that we require GNU make and can set variables
	on a per-object basis.

	sim: erc32: reduce -Wno-error scope
	Only one file in here still generates warnings, so reduce the -Werror
	disable to that alone now that we require GNU make and can set variables
	on a per-object basis.

	sim: cris: reduce -Wno-error scope
	Only two files in here still generates warnings, so reduce the -Werror
	disable to that now that we require GNU make and can set variables on
	a per-object basis.

	sim: sh: reduce -Wno-error scope
	Only one file in here still generates warnings, so reduce the -Werror
	disable to that alone now that we require GNU make and can set variables
	on a per-object basis.

	sim: or1k: build with -Werror
	The only warnings left in this port are a few maybe-uninitialized,
	but we don't abort the build for them, so turn on -Werror everywhere.

	sim: igen: minor build output alignment fix
	The custom echo was off by one space relative to all the others.

	sim: ppc: fix the printf fix for 32-bit systems
	The time delta is a 64-bit value too.

	sim: m68hc11: clean up pointer casts
	The void *data field is used to past arbitrary data between event
	handlers, and these are using it to pass an integer.  Fix up the
	casts to avoid using (long) to cast to/from pointers since there
	is no guarantee that's the right size.

	sim: d10v: clean up pointer casts
	Use %p to print pointers instead of trying to cast them to longs.

	sim: bfin: cast pointers using uintptr_t
	We can't assume that sizeof(long) == sizeof(void*), so change all
	these casts over to uintptr_t.

	sim: ppc: clean up printf format handling
	Don't blindly cast every possible type to (long).  Change to the right
	printf format specifier whether it be a 64-bit type or a pointer.

	sim: ppc: switch core types to stdint.h types
	There's no need to define these ourselves anymore, so switch to the
	stdint.h types.  This will be important when we start using PRI*
	defines with printf formats.

	sim: mn10300: clean up pointer casts
	The void *data field is used to past arbitrary data between event
	handlers, and these are using it to pass an enum.  Fix up the casts
	to avoid using (long) to cast to/from pointers since there is no
	guarantee that's the right size.

	sim: events: clean up trace casts
	Don't blindly cast every possible type to (long).  Change to the right
	printf format specifier whether it be a 64-bit type or a pointer.

	sim: ppc: handle \r in igen inputs [PR sim/28476]
	Make sure we consume & ignore \r bytes in inputs in case the file
	encodings are from a non-LF systems (e.g. Windows).

	sim: ppc: constify strings in igen tooling

2021-11-01  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-31  Tom Tromey  <tom@tromey.com>

	Fix latent bug in DWARF test case
	On my branch that replaces the DWARF psymtab reader,
	dw2-stack-boundary.exp started failing.  However, when I look at the
	output in gdb.log, it is correct:

	    file /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary
	    Reading symbols from /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary...
	    During symbol reading: location description stack overflow
	    During symbol reading: location description stack underflow

	What happens to cause the failure is that the two branches in
	gdb_test_multiple appear in this order:

	    -re "\r\nDuring symbol reading: location description stack underflow" {
	    [...]
	    -re "\r\nDuring symbol reading: location description stack overflow" {

	The first one will match the above, without causing the second one to
	ever match -- leading to a spurious failure.

	Anchoring the regexps seems to fix the problem, and works for the
	current gdb as well.

2021-10-31  Tom Tromey  <tom@tromey.com>

	Fix unittest.exp failure due to 'set debuginfod' addition
	The 'set debuginfod' change caused a regression in unittest.exp:

	    Running selftest help_doc_invariants.
	    help doc broken invariant: command 'info set debuginfod' help doc first line is not terminated with a '.' character
	    help doc broken invariant: command 'set debuginfod' help doc first line is not terminated with a '.' character
	    help doc broken invariant: command 'show debuginfod' help doc first line is not terminated with a '.' character
	    Self test failed: self-test failed at ../../binutils-gdb/gdb/unittests/command-def-selftests.c:100

	This patch fixes the problem.  I'm checking it in.

2021-10-31  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: use silent build rules here too
	The ppc codebase is unique and doesn't leverage common/, so have to
	add silent rules to it specifically.

	sim: rl78: drop obsolete manual dependency rules
	We have GNU make generate these for us automatically now, so there's
	no need to manually specify any deps.

	sim: drop unused targ-vals.h includes
	This is used in a few places where it's not needed.  Drop the include
	to avoid the build-time generated header file as we move to drop it.

	sim: unify callback.o building
	Now that the use of TARGET_xxx defines have been removed, we can move
	this to the common logic so we only build it once for multi-targets.

	sim: nltvals: pull target open flags out into a dedicated source file
	Like we just did for pulling out the errno & signal maps, pull out the
	open flag map into a dedicated common file.  All newlib ports are using
	the same map which makes it easy.

	sim: nltvals: localize TARGET_<open> defines
	Code should not be using these directly, instead they should be
	resolving these dynamically via the open_map.  Rework the common
	callback code that was using the defines to use symbolic names
	instead, and localize some of the defines in the ARM code (since
	it's a bit unclear how many different APIs it supports currently),
	then remove the defines out of the header so no new code can rely on
	them.

	sim: nltvals: pull target signal out into a dedicated source file
	Like we just did for pulling out the errno map, pull out the signal
	map into a dedicated common file.  All newlib ports are using the
	same signal map which makes it easy.

2021-10-31  Mike Frysinger  <vapier@gentoo.org>

	sim: nltvals: pull target errno out into a dedicated source file
	The current system maintains a list of target errno constants in the
	nltvals.def file, then runs a build-time tool to turn that into a C
	file.  This list of errno values is the same for all arches, so we
	don't need the arch-specific flexibility.  Further, these are only
	for newlib/libgloss environments, which makes it confusing to support
	other userland runtimes (like Linux).  Let's simplify to make this
	easier to understand & build.  We don't namespace the variables yet,
	but sets up the framework for it.

	Create a new target-newlib-errno.c template file.  The template file
	is hand written, but the inline map is still automatically generated.

	This allows us to move it to the common set of objects so it's only
	built once in a multi-target build.

	Now we can remove the output from the gentmap build-time tool since
	it's checked into the tree.

	Then we stop including the errno lists in nltvals.def since nothing
	uses it.

2021-10-31  Mike Frysinger  <vapier@gentoo.org>

	sim: erc32: use silent build rules with sis linkage

2021-10-31  Mike Frysinger  <vapier@gentoo.org>

	sim: erc32: fix a few more build warnings
	Tweak the if indentation & brace style to avoid ambiguous warnings.

	Add ATTRIBUTE_UNUSED to UART functions that aren't used when FAST_UART
	is defined (which is the default).

2021-10-31  Orgad Shaneh  <orgads@gmail.com>

	sim: erc32: fix signedness compatibility and redefinition warnings

2021-10-31  Mike Frysinger  <vapier@gentoo.org>

	sim: add arch-specific conditional logic
	This will make it easy to include arch-specific logic (build files)
	as we migrate ports to the common top level build.

	sim: v850: delete old gencode logic
	The v850 port used to have a gencode helper, but it was deleted long
	ago.  Clean up the settings that no longer make sense w/out it.

	sim: common: merge multiple clean commands
	This provides a minor speedup when cleaning in a multi-target build.

	sim: m32c: tighten up opc2c build output
	Drop the single debugging line that repeats the command line option,
	and use the silent build helpers to tighten up output.

	sim: tighten up build regen rules
	Update the makefile & configure related rules to use the silent
	build helpers.

	sim: tighten up gencode output
	Update the gencode rules to use the silent build helpers.

	sim: igen: tighten up build output
	Add a new stamp helper for quiet builds, and don't dump the command
	line options when it runs.  That isn't standard tool behavior, and
	doesn't really seem necessary in any way.

	sim: tighten up stamp rules
	Add a new ECHO_STAMP helper and convert existing stamp code over
	to it.  This is mostly common rules and cgen mloop rules.

	sim: silence stamp touch rules
	We pretty much never care about these stamp touches, so silence them.
	Also switch to using $@ when it makes sense.

	sim: standardize move-if-change rules
	Use the srcroot path and make them all silent.

	sim: mips/v850: remove redundant variable setup
	The common/Make-common.in fragment already provides these variables.

2021-10-31  Orgad Shaneh  <orgads@gmail.com>

	sim: fix compilation on mingw64 [PR sim/28476]
	...by reordering includes.

	1. sim-utils.c

	sim/mips/sim-main.h defines UserMode, while there is a struct in winnt.h
	which has UserMode as a member. So if sim-main.h is included before winnt.h,
	compilation fails.

	2. ppc

	registers.h defines CR, which is used as a member in winnt.h.

	winsock2.h is included by sys/time.h, so sys/time.h has to be included
	before registers.h.

	Bug: https://sourceware.org/PR28476

2021-10-31  Alan Modra  <amodra@gmail.com>

	Don't include coff/pe.h in coff-x86_64.c
	This (and other) code from coffcode.h is broken for x86_64_coff_vec,
	and has been ever since support was added in 2006 commit 99ad839030c1
	Here, bfd_coff_aoutsz must match coff_swap_aouthdr_out otherwise we
	end up writing garbage.

	      /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR.
		 include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)).  */
	      char * buff;
	      bfd_size_type amount = bfd_coff_aoutsz (abfd);

	      buff = (char *) bfd_malloc (amount);
	      if (buff == NULL)
		return false;

	      coff_swap_aouthdr_out (abfd, & internal_a, buff);
	      amount = bfd_bwrite (buff, amount, abfd);

	We have removed support for --target=x86_64-coff, likely because it
	never worked properly, but still produce coff-x86_64.o with
	--enable-targets=all.  This means objcopy can recognize x86_64 COFF
	files but will write garbage to the output file, a fact found by
	fuzzers.  I suspect x86_64 COFF is still broken after this fix, and
	mention of coff-x86_64.* should be removed from bfd/Makefile.am.

		* coff-x86_64.c: Don't include coff/pe.h.
		(COFF_WITH_pex64): Don't define here.
		* pe-x86_64.c: Include coff/pe.h and other headers.
		(PEI_HEADERS): Define.

2021-10-31  Alan Modra  <amodra@gmail.com>

	Re: PR28420, ecoff fuzzing failures
	sym_ptr_ptr NULL results in segfaults.

		PR 28420
		* ecoff.c (ecoff_slurp_reloc_table): Don't leave sym_ptr_ptr NULL.

2021-10-31  Alan Modra  <amodra@gmail.com>

	ubsan: alpha-vms: undefined shift
		* vms-alpha.c (evax_bfd_print_image): Shift left 1u.

	PR28518: signed integer overflow & free on unmalloced address
		PR 28518
		* vms-alpha.c (build_module_list): Don't lose malloc buffer address.
		Use unsigned variables.

2021-10-31  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-30  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix gdb.gdb/unittest.exp with C++17 compiler
	On a machine with gcc 11, I get:

	    FAIL: gdb.gdb/unittest.exp: test_completion: tab complete "maintenance selftest string_v" (second tab) (timeout)
	    FAIL: gdb.gdb/unittest.exp: test_completion: tab complete "maintenance selftest string_vie" (timeout)

	That's because when compiling with C++ >= 17, we use the standard
	version of string_view, and don't have a selftest for it.  So the list
	of selftests shown by the tab completion when completing "string_v"
	differs.

	Change the test to use the copy_* tests instead.

	Change-Id: I85f6aa44ee5fc9652b9bd4451e0506b89773526b

2021-10-30  Aaron Merey  <amerey@redhat.com>

	gdb.texinfo: Expand documentation for debuginfod
	Add section describing GDB's usage of debuginfod.

	Refer to this new section in the description of the '--with-debuginfod'
	configure option.

	Mention debuginfod in the 'Separate Debug Files' section.

2021-10-30  Aaron Merey  <amerey@redhat.com>

	gdb: add set/show commands for managing debuginfod
	Add 'set debuginfod' command.  Accepts 'on', 'off' or 'ask' as an
	argument.  'on' enables debuginfod for the current session.  'off'
	disables debuginfod for the current session.  'ask' will prompt
	the user to either enable or disable debuginfod when the next query
	is about to be performed:

	    This GDB supports auto-downloading debuginfo from the following URLs:
	    <URL1> <URL2> ...
	    Enable debuginfod for this session? (y or [n]) y
	    Debuginfod has been enabled.
	    To make this setting permanent, add 'set debuginfod on' to .gdbinit.

	For interactive sessions, 'ask' is the default.  For non-interactive
	sessions, 'off' is the default.

	Add 'show debuginfod status' command.  Displays whether debuginfod
	is set to 'on', 'off' or 'ask'.

	Add 'set/show debuginfod urls' commands. Accepts a string of
	space-separated debuginfod server URLs to be queried.  The default
	value is copied from the DEBUGINFOD_URLS environment variable.

	Finally add 'set/show debuginfod verbose' commands to control whether
	debuginfod-related output is displayed.  Verbose output is enabled
	by default.

	    (gdb) run
	    Starting program: /bin/sleep 5
	    Download failed: No route to host.  Continuing without debug info for /lib64/libc.so.6.

	If GDB is not built with debuginfod then these commands will just display

	    Support for debuginfod is not compiled into GDB.

2021-10-30  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove TYPE_FIELD_DWARF_BLOCK
	Remove TYPE_FIELD_DWARF_BLOCK, replace with type::field +
	field::loc_dwarf_block.

	Change-Id: I10af9410bb5f46d342b8358a7956998c7e804b64

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove TYPE_FIELD_STATIC_PHYSADDR
	Remove TYPE_FIELD_STATIC_PHYSADDR replace with type::field +
	field::loc_physaddr.

	Change-Id: Ica9bc4a48f34750ec82ec86c298d3ecece81bcbd

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove TYPE_FIELD_STATIC_PHYSNAME
	Remove TYPE_FIELD_STATIC_PHYSNAME, replace with type::field +
	field::loc_physname.

	Change-Id: Ie35d446b67dd1d02f39998b406001bdb7e6d5abb

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove TYPE_FIELD_ENUMVAL
	Remove TYPE_FIELD_ENUMVAL, replace with type::field +
	field::loc_enumval.

	Change-Id: I2ada73e4635aad3363ce2eb22c1dc52698ee2072

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove TYPE_FIELD_BITPOS
	Remove TYPE_FIELD_BITPOS, replace its uses with type::field +
	field::loc_bitpos.

	Change-Id: Iccd8d5a77e5352843a837babaa6bd284162e0320

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove TYPE_FIELD_LOC_KIND
	Remove TYPE_FIELD_LOC_KIND, replace its uses with type::field +
	field::loc_kind.

	Change-Id: Ib124a26365df82ac1d23df7962d954192913bd90

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove FIELD_DWARF_BLOCK macro
	Remove FIELD_DWARF_BLOCK, replace its uses with field::loc_dwarf_block.

	Change-Id: I66b7d6a960cb5e341e61e21bd3cc9a6ac26de6a8

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove FIELD_STATIC_PHYSADDR macro
	Remove FIELD_LOC_KIND_PHYSADDR, replace its uses with
	field::loc_physaddr.

	Change-Id: Ifd8b2bdaad75f42bfb1404ef8c396ffe7e10ac55

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove FIELD_STATIC_PHYSNAME macro
	Remove FIELD_STATIC_PHYSNAME, replace its uses with field::loc_physname.

	Change-Id: Iaa8952410403b4eb5bbd68411feea27e2405d657

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove FIELD_ENUMVAL macro
	Remove FIELD_ENUMVAL, replace its uses with field::loc_enumval.

	Change-Id: Id4861cee91a8bb583a9836f1aa5da0a320fbf4d9

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove FIELD_BITPOS macro
	Remove FIELD_BITPOD, replace its uses with field::loc_bitpos.

	Change-Id: Idb99297e0170661254276c206383a7e9bf1a935a

2021-10-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove FIELD_LOC_KIND macro
	Remove FIELD_LOC_KIND, replace its uses with field::loc_kind or
	call_site_target::loc_kind.

	Change-Id: I0368d8c3ea269d491bb215aa70e32edbdf55f389

2021-10-29  Tom Tromey  <tromey@adacore.com>

	Add gdb.Architecture.integer_type Python function
	This adds a new Python function, gdb.Architecture.integer_type, which
	can be used to look up an integer type of a given size and
	signed-ness.  This is useful to avoid dependency on debuginfo when a
	particular integer type would be useful.

	v2 moves this to be a method on gdb.Architecture and addresses other
	review comments.

2021-10-29  Tom Tromey  <tromey@adacore.com>

	Remove ada_value_print_inner
	I noticed that the only caller of ada_value_print_inner is
	valprint.c:do_val_print (via ada_language::value_print_inner), meaning
	that the try/catch logic in this function is redundant.  This patch
	removes the wrapper function.

	Regression tested on x86-64 Fedora 34.

2021-10-29  Tom Tromey  <tromey@adacore.com>

	Document resolve_dynamic_type oddity
	Today I re-learned that resolve_dynamic_type can return a type for
	which is_dynamic_type returns true.  This can happen for an array
	whose elements have dynamic type -- the array is reported as dynamic,
	but resolving the elements would be incorrect, because each element
	might have a different type after resolution.

	You can see the special case in resolve_dynamic_array_or_string:

	  if (ary_dim != NULL && ary_dim->code () == TYPE_CODE_ARRAY)
	...
	  else
	...

	I looked into having the TYPE_CODE_ARRAY case in
	is_dynamic_type_internal follow this same logic, but that breaks down
	on the gdb.fortran/dynamic-ptype-whatis.exp test case.  In particular
	this code in fortran_undetermined::evaluate:

	  value *callee = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
	  if (noside == EVAL_AVOID_SIDE_EFFECTS
	      && is_dynamic_type (value_type (callee)))
	    callee = std::get<0> (m_storage)->evaluate (nullptr, exp, EVAL_NORMAL);

	... relies on is_dynamic_type returning true for such an array.

	I wasn't really sure of the best way to fix this, so in the meantime I
	wrote this patch, which documents the oddity so that I might have a
	chance of remembering this in the future.

2021-10-29  Tom Tromey  <tromey@adacore.com>

	Avoid self-test failures on x86-linux
	The disassembly tests in "maint selftest" will fail on x86-linux.
	This happens because opcodes rejects an attempt to disassemble for an
	arch with a 64-bit address size when bfd_vma is 32-bit.

	This patch avoids this problem by avoiding the test in this case.  I
	chose to do it this way because this seems to be the only situation
	where opcodes checks the size of bfd_vma.

	For v2 of this patch, I've also updated memory_error_test to do the
	same thing.  This is needed due to the "improve error reporting from
	the disassembler" patch.

2021-10-29  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Fix build with --disable-unit-tests
	A build with --disable-unit-tests currently run into:
	...
	ld: maint.o: in function \
	  `maintenance_selftest_completer(cmd_list_element*, completion_tracker&,
	                                  char const*, char const*)':
	src/gdb/maint.c:1183: undefined reference to \
	  `selftests::for_each_selftest(
	    gdb::function_view<
	      void (std::__cxx11::basic_string<char,std::char_traits<char>,
	                                       std::allocator<char> > const&)>)'
	...

	Fix this by guarding the call to selftests::for_each_selftest in
	maintenance_selftest_completer with GDB_SELF_TEST, such that the "-verbose"
	completion still works.

	Rebuild on x86_64-linux and ran gdb.gdb/unittest.exp.

2021-10-29  Enze Li  <lienze2010@hotmail.com>

	Document "memory-tag-violations".
	* gdb/doc/gdb.texinfo: (Data): Document	'-memory-tag-violations'.
	 (Command Options): Update the example.

2021-10-29  Tejas Belagod  <tejas.belagod@arm.com>

	Support for a new pacbti unwind opcode.
	This patch adds readelf support for decoding the exception table
	opcode for restoring the RA_AUTH_CODE pseudo register defined by the
	EHABI
	(https://github.com/ARM-software/abi-aa/releases/download/2021Q1/ehabi32.pdf
	Section 10.3).

		* readelf.c (decode_arm_unwind_bytecode): Add support to decode
		restoring RA_AUTH_CODE pseudo register.

2021-10-29  Alan Modra  <amodra@gmail.com>

	Re: arm: add unwinder encoding support for PACBTI
	Move the gas testsuite files to where they belong.

2021-10-29  Alan Modra  <amodra@gmail.com>

	ELF core file size checks
	Catch fuzzed segments where p_offset + p_filesz wraps, and limit error
	output.

		* elfcore.h (elf_core_file_p): Rewrite segment checks using
		bfd_get_file_size.  Set read_only on file size errors.
		* elfcode.h (elf_swap_shdr_in): Don't repeat error message.

2021-10-29  Alan Modra  <amodra@gmail.com>

	obcopy vs. files with silly section alignment
	We already ignore stupid segment alignment when rewriting headers,
	ignore section alignment too.

		* elf.c (rewrite_elf_program_header): Ignore section alignment
		power greater than 62.

2021-10-29  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-28  Stafford Horne  <shorne@gmail.com>

	gdb: Add OpenRISC gdbserver and native config news
	The previous patches added gdbserver and native debugging support
	for OpenRISC targets.  This patch documents that in the news.

	gdb: or1k: add single step for linux native debugging
	Needed for single stepping in Linux, this adds the or1k implementation
	of or1k_software_single_step.  Most of the implementation is borrowed
	from the bare metal single step code from or1k_single_step_through_delay
	which has been extracted and shared in helper function
	or1k_delay_slot_p.

2021-10-28  Stafford Horne  <shorne@gmail.com>

	gdb: or1k: add native linux support
	This patch adds support for running gdb natively on OpenRISC linux.
	Debugging support is provided via the linux PTRACE interface which is
	mostly handled by GDB genric code.  This patch provides the logic of how
	to read and write the ptrace registers between linux and GDB.

	Single stepping is privided in a separate patch.

2021-10-28  Stafford Horne  <shorne@gmail.com>

	gdb: or1k: add generated linux descriptor file

	gdb: or1k: fixup linux regcache comment
	The old comment was not properly updated from the RISC-V example used.
	Update it to match OpenRISC.

2021-10-28  Stafford Horne  <shorne@gmail.com>

	gdb: or1k: implement gdb server
	This patch adds gdbserver support for OpenRISC.  This has been used for
	debugging the glibc port that in being worked on here:

	  https://github.com/openrisc/or1k-glibc/tree/or1k-port-2

	Hence the comment about registers definitions being inline with glibc.

2021-10-28  Christian Biesinger  <cbiesinger@google.com>

	[sim] Include defs.h in ppc/hw_memory.c
	To fix this error (seen on cygwin):
	/../../sim/ppc/../common ../../../sim/ppc/hw_memory.c
	In file included from ../../gnulib/import/stdlib.h:100,
	                 from ../../../sim/ppc/hw_memory.c:28:
	../../gnulib/import/unistd.h:663:3: error: #error "Please include config.h first."
	  663 |  #error "Please include config.h first."
	      |   ^~~~~
	../../gnulib/import/unistd.h:665:24: error: expected ';' before 'extern'
	  665 | _GL_INLINE_HEADER_BEGIN
	      |                        ^
	      |                        ;
	../../gnulib/import/unistd.h:2806:22: error: expected ';' before 'extern'
	 2806 | _GL_INLINE_HEADER_END
	      |                      ^
	      |                      ;

2021-10-28  Markus Klein  <markus.klein@sma.de>

	ARM assembler: Allow up to 32 single precision registers in the VPUSH and VPOP instructions.
		PR 28436
		* config/tc-arm.c (do_vfp_nsyn_push_pop_check): New function.
		(do_vfp_nsyn_pop): Use the new function.
		(do_vfp_nsyn_push): Use the new function.
		* testsuite/gas/arm/v8_1m-mve.s: Add new instructions.
		* testsuite/gas/arm/v8_1m-mve.d: Updated expected disassembly.

2021-10-28  Simon Marchi  <simon.marchi@efficios.com>

	gdb: use ptid_t::to_string in infrun debug messages
	In debug messages, I think it would be more helpful to print ptid using
	the simple "pid.lwp.tid" notation in infrun debug messages.  I am
	currently debugging some fork issues, and find the pid_to_str output not
	so useful, as it doesn't tell which process a thread belongs to.

	It currently shows up like this:

	    [infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=0, current thread [Thread 0x7ffff7d95740 (LWP 892942)] at 0x55555555521f

	With the patch, it shows up like this:

	    [infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread [894072.894077.0] at 0x5555555551d9

	Change-Id: I130796d7dfb0d8e763b8358d8a6002701d80c4ea

2021-10-28  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add selftest name completion
	After the previous commit, it is easy to add completion for selftest
	names.  Again, this is not particularly high value, but I rarely touched
	completion, so it served as a simple example to get some practice.

	Change the for_each_selftest_ftype parameter to gdb::function_view, so
	that we can pass a lambda that captures things.

	Change-Id: I87cac299ddca9ca7eb0ffab78342e850a98d954c

2021-10-28  Tejas Belagod  <Tejas.Belagod@arm.com>

	arm: add unwinder encoding support for PACBTI
	This patch adds support for encoding the Return Address Authentication pseudo
	register - '.save {ra_auth_code}' as defined by the DWARF ABI - in the
	exception tables where the opcode is defined by the EHABI

	gas/Changelog:

		* config/tc-arm.c (arm_reg_type): Add new type REG_TYPE_PSEUDO.
		(reg_expected_msgs): Add message for pseudo reg type.
		(reg_list_els): Add new reg list type REGLIST_PSEUDO.
		(parse_reg_list): Handle new REGLIST_PSEUDO type.
		(s_arm_unwind_save_pseudo): Encode pseudo reg list save in exception
		tables.
		(s_arm_unwind_save): Handle new REG_TYPE_PSEUDO.
		(reg_names): Add ra_auth_code pseudo register.
		* testsuite/gas/arm/unwind-pacbti-m.s: New test.
		* testsuite/gas/arm/unwind-pacbti-m.d: New test.
		* testsuite/gas/arm/unwind-pacbti-m-readelf.d: New test.

2021-10-28  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add "maint set/show selftest verbose" commands and use process_options
	I saw the new -verbose switch to "maint selftests" and thought it would
	be nice for it to use the option framework.  For example, that makes
	having completion easy.  It's not that high value, given this is a
	maintenance command, but I had never used the framework myself, so it
	was a good way to practice.

	This patch also adds the "maint set/show selftest verbose" setting.  It
	would be possible to use option framework without adding the setting,
	but using the framework makes adding the option almost trivial, so I
	thought why not.

	Change-Id: I6687faa0713ff3da60b398253211777100094144

2021-10-28  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Update some test-cases to GPLv3
	I noticed some files in the test-suite have GPLv2 notices.

	Update these to GPLv3.

2021-10-28  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add add_setshow_prefix_cmd
	There's a common pattern to call add_basic_prefix_cmd and
	add_show_prefix_cmd to add matching set and show commands.  Add the
	add_setshow_prefix_cmd function to factor that out and use it at a few
	places.

	Change-Id: I6e9e90a30e9efb7b255bf839cac27b85d7069cfd

2021-10-28  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Require python in gdb.server/server-kill-python.exp
	I came across this when running test-case gdb.server/server-kill-python.exp
	with a gdb configured without python:
	...
	builtin_spawn gdb -nw -nx -data-directory data-directory -iex set height 0 \
	  -iex set width 0 -quiet -iex set height 0 -iex set width 0 \
	  -ex source outputs/gdb.server/server-kill-python/file1.py^M
	FAIL: gdb.server/server-kill-python.exp: ensure inferior is running
	Executing on target: kill -9 28535    (timeout = 300)
	builtin_spawn -ignore SIGHUP kill -9 28535^M
	file1.py:1: Error in sourced command file:^M
	Undefined command: "import".  Try "help".^M
	...

	Fix this by testing for python support in the test-case.

	Tested on aarch64-linux (with python support disabled) and x86_64-linux (with
	python support enabled).

2021-10-28  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix assembly comments in gdb.dwarf2/clang-debug-names.exp.tcl
	On openSUSE Leap 15.2 aarch64 I ran into:
	...
	clang-debug-names-debug.S:72: \
	  Error: junk at end of line, first unrecognized character is `#'
	...
	due to:
	...
	    71  .Ldebug_names_start:
	    72    .short 5                      # Header: version
	...

	Fix this by using the /* ... */ comment style instead:
	...
	$ sed -i 's% #\([^"]*\)%/*\1 */%' clang-debug-names.exp.tcl
	...

	Tested on aarch64-linux and x86_64-linux.

2021-10-28  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Handle DW_AT_string_length with location list
	Consider a fortran routine where a string variable s is modified:
	...
	subroutine f(s)
	  character*(*) s
	  print *, s
	  s(1:3) = 'oof'
	  print *, s
	end subroutine f
	...

	When compiling with optimization level -O1 and printing the type of
	variable s we get:
	...
	$ gdb -q -batch outputs/gdb.opt/fortran-string/fortran-string \
	  -ex "b f" \
	  -ex run \
	  -ex "ptype s"
	Breakpoint 1 at 0x4006f7: file fortran-string.f90, line 21.

	Breakpoint 1, f (s=..., _s=_s@entry=3) at fortran-string.f90:21
	21      subroutine f(s)
	type = character*1
	...
	while with -O0 we have instead:
	...
	type = character (3)
	...

	The problem is that the type of s is:
	...
	 <1><2d6>: Abbrev Number: 21 (DW_TAG_string_type)
	    <2d7>   DW_AT_string_length: 0xbf (location list)
	    <2db>   DW_AT_byte_size   : 4
	...
	where the DW_AT_string_length is a location list, a case that is not handled
	by attr_to_dynamic_prop.

	Fix this by handling attr->form_is_section_offset () in attr_to_dynamic_prop.

	Tested on x86_64-linux.

	The test-case is based on gdb.opt/fortran-string.exp from
	https://src.fedoraproject.org/rpms/gdb/raw/f32/f/gdb-archer-vla-tests.patch .
	I've updated the copyrights to stretch to 2021.

	[ I've tried to create a dwarf assembly test-case for this, but didn't
	manage. ]

	Co-Authored-By: Jan Kratochvil <jan.kratochvil@redhat.com>

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26910

2021-10-28  Kavitha Natarajan  <kavitha.natarajan@amd.com>

	[gdb/testsuite] Initialize anonymous union in gdb.cp/koenig.cc
	GDB test fails while running the test case gdb.cp/koenig.exp using
	clang compiler:
	[...]
	p foo (p_union)
	No symbol "p_union" in current context.
	(gdb) FAIL: gdb.cp/koenig.exp: p foo (p_union)
	[...]

	In the testcase, "p_union" is an unused/uninitialized variable of
	anonymous union type. Clang does not emit symbol for unused anonymous
	union/struct variables at any optimization level. Since the compiler
	itself is not emitting the symbol for "p_union", debug info is also
	not emitted when built with debug option. If the anonymous union is
	initialized (or used), then clang emits the symbol "p_union" which
	enables emitting debug info for "p_union".
	[...]
	p foo (p_union)
	Cannot resolve function foo to any overloaded instance
	(gdb) PASS: gdb.cp/koenig.exp: p foo (p_union)
	[...]

2021-10-28  Alan Modra  <amodra@gmail.com>

	asan: mmo: NULL dereferenc in mmo_xore_32
	mmo_get_loc can return NULL.  It's commented even, and that the caller
	then must handle a split field.  mmo_xore_* don't handle split fields,
	instead just segfault.  Stop that happening, and refuse to recognise
	fuzzed mmo files that trigger this problem.

		* mmo.c (mmo_get_loc): Don't declare inline.
		(mmo_xore_64, mmo_xore_32, mmo_xore_16): Remove forward decls.
		Return pointer, don't dereference NULL.
		(mmo_scan): Return error on mmo_get_loc returning NULL.

2021-10-28  Alan Modra  <amodra@gmail.com>

	bfd: remove use of INLINE
	No need to use anything fancy, plain inline works just as well.

		* bfd-in.h (INLINE): Don't define.
		* bfd-in2.h: Regenerate.
		* aoutx.h: Replace use of INLINE with inline.
		* elf-eh-frame.c: Likewise.
		* elf32-score7.c: Likewise.
		* elfxx-mips.c: Likewise.
		* ihex.c: Likewise.
		* mach-o.c: Likewise.
		* mmo.c: Likewise.

2021-10-28  Alan Modra  <amodra@gmail.com>

	ASSERT in empty output section with address
		* ldlang.c (lang_do_assignments_1): Correct "dot" inside ignored
		sections.
		* testsuite/ld-scripts/empty-address-4.d,
		* testsuite/ld-scripts/empty-address-4.s,
		* testsuite/ld-scripts/empty-address-4.t: New test.
		* testsuite/ld-scripts/empty-address.exp: Run it.

2021-10-28  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-27  Alan Modra  <amodra@gmail.com>

	asan: alpha-vms: buffer overflows
	Yet more anti-fuzzer sanity checking

		* vms-alpha.c (evax_bfd_print_egsd): Sanity check record and
		name lengths before access.
		(evax_bfd_print_etir_stc_ir, evax_bfd_print_etir): Likewise.

2021-10-27  Alan Modra  <amodra@gmail.com>

	ubsan: arm: undefined shift
	left shift of 2 by 31 places cannot be represented in type 'int'

		* arm-dis.c (print_insn_thumb16): Avoid undefined behaviour.

2021-10-27  Tom Tromey  <tromey@adacore.com>

	Fix watchpoints with multiple threads on Windows
	A recent internal change pointed out that watchpoints were not working
	on Windows when the inferior was multi-threaded.  This happened
	because the debug registers were only updated for certain threads --
	in particular, those that were being resumed and that were not marked
	as suspended.  In the case of single-stepping, the need to update the
	debug registers in other threads could also be "forgotten".

	This patch changes windows-nat.c to mark all threads needing a debug
	register update.  This brings the code closer to what gdbserver does
	(though, unfortunately, it still seems more complicated than needed).

2021-10-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix port detection in gdb.debuginfod/fetch_src_and_symbols.exp
	On OBS I ran into this failure with test-case
	gdb.debuginfod/fetch_src_and_symbols.exp:
	...
	Failed to listen for connections: Address already in use^M
	[Thu Oct 21 11:48:49 2021] (559/559): started http server on IPv6 port=8000^M
	  ...
	FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: local_url: find port timeout
	...

	The test-case is trying to start debuginfod on a port to see if it's
	available, and it handles either this message:
	  "started http server on IPv4 IPv6 port=$port"
	meaning success, or:
	  "failed to bind to port"
	meaning failure, in which case the debuginfod instance is killed, and we try
	the next port.

	The test-case only uses the v4 address 127.0.0.1, so fix this by:
	- accepting "started http server on IPv4 port=$port"
	- rejecting "started http server on IPv6 port=$port"

	Tested on x86_64-linux.

2021-10-27  Simon Marchi  <simon.marchi@efficios.com>

	gdb: fix value.c build on 32-bits
	When building on ARM (32-bits), we errors like this:

	    /home/smarchi/src/binutils-gdb/gdb/value.c: In function 'gdb::array_view<const unsigned char> value_contents_for_printing(value*)':
	    /home/smarchi/src/binutils-gdb/gdb/value.c:1252:35: error: narrowing conversion of 'length' from 'ULONGEST' {aka 'long long unsigned int'} to 'size_t' {aka 'unsigned int'} [-Werror=narrowing]
	     1252 |   return {value->contents.get (), length};
	          |                                   ^~~~~~

	Fix that by using gdb::make_array_view, which does the appropriate
	conversion.

	Change-Id: I7d6f2e75d7440d248b8fb18f8272ee92954b404d

2021-10-27  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Tidy riscv assembler and disassembler.
	Tidy the gas/config/tc-riscv.c and opcodes/riscv-dis.c, to prepare for
	moving the released extensions (including released vendor extensions)
	from integration branch back to mainline.

	* Added parts of missing comments.

	* Updated md_show_usage.

	* For validate_riscv_insn, riscv_ip and print_insn_args, unify the
	  following pointer names,
	  - oparg: pointed to the parsed operand defined in the riscv_opcodes.
	  - asarg: pointed to the parsed operand from assembly.
	  - opargStart: recorded the parsed operand name from riscv_opcodes.
	  - asargStart: recorded the parsed operand name from assembly.

	gas/
		* config/tc-riscv.c: Added parts of missind comments and updated
		the md_show_usage.
		(riscv_multi_subset_supports): Tidy codes.
		(validate_riscv_insn): Unify the pointer names, oparg, asarg,
		opargStart and asargStart, to prepare for moving the released
		extensions from integration branch back to mainline.
		(riscv_ip): Likewise.
		(macro_build): Added fmtStart, also used to prepare for moving
		released extensions.
		(md_show_usage): Added missing descriptions for new options.
	opcodes/
		* riscv-dis.c (print_insn_args): Unify the pointer names,
		oparg and opargStart, to prepare for moving the released
		extensions from integration branch back to mainline.

2021-10-27  Maciej W. Rozycki  <macro@embecosm.com>

	opcodes: Fix RPATH not being set for dynamic libbfd dependency
	If built as a shared library, libopcodes has a load-time dependency on
	libbfd, which is recorded in the dynamic section, however without a
	corresponding RPATH entry for the directory to find libbfd in.  This
	causes loading to fail whenever libbfd is only pulled by libopcodes
	indirectly and libbfd has been installed in a directory that is not in
	the dynamic loader's search path.

	It does not happen with the programs included with binutils or GDB,
	because they all also pull libbfd when using libopcodes, but it can
	happen with external software, e.g.:

	$ gdbserver --help
	gdbserver: error while loading shared libraries: libbfd-[...].so: cannot open shared object file: No such file or directory
	$

	(not our `gdbserver').

	Indirect dynamic dependencies are handled by libtool automatically by
	adding RPATH entries as required, however our setup for libopcodes
	prevents this from happening by linking in libbfd with an explicit file
	reference sneaked through to the linker directly behind libtool's back
	via the `-Wl' linker command-line option rather than via `-l' combined
	with a suitable library search path specified via `-L', as it would be
	usually the case, or just referring to the relevant .la file in a fully
	libtool-enabled configuration such as ours.

	According to an observation in the discussion back in 2007[1][2][3] that
	has led to the current arrangement it is to prevent libtool from picking
	up the wrong version of libbfd.  It does not appear to be needed though,
	not at least with our current libtool incarnation, as directly referring
	`libbfd.la' does exactly what it should, as previously suggested[4], and
	with no link-time reference to the installation directory other than to
	set RPATH.  Uninstalled version of libopcodes has libbfd's build-time
	location prepended to RPATH too, as also expected.

	Use a direct reference to `libbfd.la' then, making the load error quoted
	above go away.  Alternatively `-L' and `-l' could be used to the same
	effect, but it seems an unnecessary complication and just another way to
	circumvent rather than making use of libtool.

	References:

	[1] "compile failure due to undefined symbol",
	    <https://sourceware.org/ml/binutils/2007-08/msg00476.html>

	[2] same, <https://sourceware.org/ml/binutils/2007-09/msg00000.html>

	[3] same, <https://sourceware.org/ml/binutils/2007-10/msg00019.html>

	[4] same, <https://sourceware.org/ml/binutils/2007-10/msg00034.html>

		opcodes/
		* Makefile.am: Remove obsolete comment.
		* configure.ac: Refer `libbfd.la' to link shared BFD library
		except for Cygwin.
		* Makefile.in: Regenerate.
		* configure: Regenerate.

2021-10-27  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-27  H.J. Lu  <hjl.tools@gmail.com>

	gold: Place .note.gnu.property section before other note sections
	Place the .note.gnu.property section before all other note sections to
	avoid being placed between other note sections with different alignments.

		PR gold/28494
		* layout.cc (Layout::create_note): Set order to ORDER_PROPERTY_NOTE
		for the .note.gnu.property section.
		* layout.h (Output_section_order): Add ORDER_PROPERTY_NOTE.

2021-10-26  Tom de Vries  <tdevries@suse.de>

	[gdb/doc] Fix print inferior-events default
	In the docs about print inferior-events we read:
	...
	By default, these messages will not be printed.
	...

	That used to be the case, but is no longer so since commit f67c0c91715 "Enable
	'set print inferior-events' and improve detach/fork/kill/exit messages".

	Fix this by updating the docs.

2021-10-26  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-25  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: change functions returning value contents to use gdb::array_view
	The bug fixed by this [1] patch was caused by an out-of-bounds access to
	a value's content.  The code gets the value's content (just a pointer)
	and then indexes it with a non-sensical index.

	This made me think of changing functions that return value contents to
	return array_views instead of a plain pointer.  This has the advantage
	that when GDB is built with _GLIBCXX_DEBUG, accesses to the array_view
	are checked, making bugs more apparent / easier to find.

	This patch changes the return types of these functions, and updates
	callers to call .data() on the result, meaning it's not changing
	anything in practice.  Additional work will be needed (which can be done
	little by little) to make callers propagate the use of array_view and
	reap the benefits.

	[1] https://sourceware.org/pipermail/gdb-patches/2021-September/182306.html

	Change-Id: I5151f888f169e1c36abe2cbc57620110673816f3

2021-10-25  Simon Marchi  <simon.marchi@efficios.com>

	gdbsupport: add assertions in array_view
	Add assertions to ensure we don't access an array_view out of bounds.
	Enable these assertions only when _GLIBCXX_DEBUG is set, as we did for
	gdb::optional.

	Change-Id: Iffaee38252405073735ed123c8e57fde6b2c6be3

2021-10-25  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbserver: make target_pid_to_str return std::string
	I wanted to write a warning that included two target_pid_to_str calls,
	like this:

	    warning (_("Blabla %s, blabla %s"),
		     target_pid_to_str (ptid1),
		     target_pid_to_str (ptid2));

	This doesn't work, because target_pid_to_str stores its result in a
	static buffer, so my message would show twice the same ptid.  Change
	target_pid_to_str to return an std::string to avoid this.  I don't think
	we save much by using a static buffer, but it is more error-prone.

	Change-Id: Ie3f649627686b84930529cc5c7c691ccf5d36dc2

2021-10-25  H.J. Lu  <hjl.tools@gmail.com>

	x86: Also handle stores for -muse-unaligned-vector-move
		* config/tc-i386.c (encode_with_unaligned_vector_move): Also
		handle stores.
		* testsuite/gas/i386/unaligned-vector-move.s: Add stores.
		* testsuite/gas/i386/unaligned-vector-move.d: Updated.
		* testsuite/gas/i386/x86-64-unaligned-vector-move.d: Likewise.

2021-10-25  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix duplicate in gdb.mi/mi-var-cp.exp
	With test-case gdb.mi/mi-var-cp.exp I run into this duplicate:
	...
	PASS: gdb.mi/mi-var-cp.exp: run to mi-var-cp.cc:104 (set breakpoint)
	PASS: gdb.mi/mi-var-cp.exp: create varobj for s
	PASS: gdb.mi/mi-var-cp.exp: create varobj for s
	DUPLICATE: gdb.mi/mi-var-cp.exp: create varobj for s
	...

	This is due to a duplicate test name here:
	...
	$ cat -n gdb/testsuite/gdb.mi/mi-var-cp.cc
	  ...
	   100  int reference_to_struct ()
	   101  {
	   102    /*: BEGIN: reference_to_struct :*/
	   103    S s = {7, 8};
	   104    S& r = s;
	   105    /*:
	   106      mi_create_varobj S s "create varobj for s"
	   107      mi_create_varobj R r "create varobj for s"
	...

	Fix this by using "create varobj for r" instead.

	Tested on x86_64-linux.

2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

	libctf, ld: handle nonrepresentable types better
	ctf_type_visit (used, among other things, by the type dumping code) was
	aborting when it saw a nonrepresentable type anywhere: even a single
	structure member with a nonrepresentable type caused an abort with
	ECTF_NONREPRESENTABLE.  This is not useful behaviour, given that the
	abort comes from a type-resolution we are only doing in order to
	determine whether the type is a structure or union.  We know
	nonrepresentable types can't be either, so handle that case and
	pass the nonrepresentable type down.

	(The added test verifies that the dumper now handles this case and
	prints nonrepresentable structure members as it already does
	nonrepresentable top-level types, rather than skipping the whole
	structure -- or, without the previous commit, skipping the whole types
	section.)

	ld/ChangeLog
	2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

		* testsuite/ld-ctf/nonrepresentable-member.*: New test.

	libctf/ChangeLog
	2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

		* ctf-types.c (ctf_type_rvisit): Handle nonrepresentable types.

2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

	libctf: dump: do not stop dumping types on error
	If dumping of a single type fails, we obviously can't dump it; but just
	as obviously this doesn't make the other types in the types section
	invalid or undumpable.  So we should not propagate errors seen when
	type-dumping, but rather ignore them and carry on, so we dump as many
	types as we can (leaving out the ones we can't grok).

	libctf/ChangeLog
	2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

		* ctf-dump.c (ctf_dump_type): Do not abort on error.

2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

	binutils, ld: make objdump --ctf's parameter optional
	ld by default (and always, unless adjusted with a hand-rolled linker
	script) emits deduplicated CTF into the .ctf section.  But viewing
	it needs you to explicitly tell objdump this: it doesn't default
	its argument, even though what you always end up typing is
	--ctf=.ctf.

	This is annoying, so make the argument optional.

	binutils/ChangeLog
	2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

		* objdump.c (usage): --ctf now has an optional argument.
		(main): Adjust accordingly.
		(dump_ctf): Default it.
		* doc/ctf.options.texi: Adjust.

	ld/ChangeLog
	2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

		* testsuite/ld-ctf/array.d: Change --ctf=.ctf to --ctf.
		* testsuite/ld-ctf/conflicting-cycle-1.B-1.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-1.B-2.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-1.parent.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-2.A-1.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-2.A-2.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-2.parent.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-3.C-1.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-3.C-2.d: Likewise.
		* testsuite/ld-ctf/conflicting-cycle-3.parent.d: Likewise.
		* testsuite/ld-ctf/conflicting-enums.d: Likewise.
		* testsuite/ld-ctf/conflicting-typedefs.d: Likewise.
		* testsuite/ld-ctf/cross-tu-cyclic-conflicting.d: Likewise.
		* testsuite/ld-ctf/cross-tu-cyclic-nonconflicting.d: Likewise.
		* testsuite/ld-ctf/cross-tu-into-cycle.d: Likewise.
		* testsuite/ld-ctf/cross-tu-noncyclic.d: Likewise.
		* testsuite/ld-ctf/cycle-1.d: Likewise.
		* testsuite/ld-ctf/cycle-2.A.d: Likewise.
		* testsuite/ld-ctf/cycle-2.B.d: Likewise.
		* testsuite/ld-ctf/cycle-2.C.d: Likewise.
		* testsuite/ld-ctf/data-func-conflicted.d: Likewise.
		* testsuite/ld-ctf/diag-cttname-null.d: Likewise.
		* testsuite/ld-ctf/diag-cuname.d: Likewise.
		* testsuite/ld-ctf/diag-parlabel.d: Likewise.
		* testsuite/ld-ctf/enum-forward.d: Likewise.
		* testsuite/ld-ctf/enums.d: Likewise.
		* testsuite/ld-ctf/forward.d: Likewise.
		* testsuite/ld-ctf/function.d: Likewise.
		* testsuite/ld-ctf/nonrepresentable.d: Likewise.
		* testsuite/ld-ctf/slice.d: Likewise.
		* testsuite/ld-ctf/super-sub-cycles.d: Likewise.

2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

	binutils: make objdump/readelf --ctf-parent actually useful
	This option has been present since the very early days of the
	development of libctf as part of binutils, and it shows.  Back in the
	earliest days, I thought we might handle ambiguous types by introducing
	new ELF sections on the fly named things like .ctf.foo.c for ambiguous
	types found only in foo.c, etc.  This turned out to be a terrible idea,
	so we moved to using a CTF archive in the .ctf section which contained
	all the CTF dictionaries -- but the --ctf-parent option in objdump and
	readelf was never adjusted, and lingered as a mechanism to specify CTF
	parent dictionaries in sections other than .ctf, even though the linker
	has no way to produce parent dictionaries in different sections from
	their children, libctf's ctf_open can't handle such split-up
	parent/child dicts, and they are never found in the wild, emitted by GNU
	ld or by any known third-party linking tool.

	Meanwhile, the actually-useful ctf_link feature (albeit not used by ld)
	which lets you remap the names of CTF archive members (so you can end up
	with a parent archive member named something other than ".ctf", still
	contained with all its children in a single .ctf section) had no support
	in objdump or readelf: there was no way to tell them that these members
	were parents, so all the types in the associated child dicts always
	appeared corrupted, referencing nonexistent types from a parent objdump
	couldn't find.

	So adjust --ctf-parent so that rather than taking a section name it
	takes a member name instead (if not specified, the name is ".ctf", which
	is what GNU ld emits).  Because the option was always useless before
	now, this is expected to have no backward-compatibility implications.

	As part of this, we have to slightly adjust the code which skips the
	archive member name if redundant: right now it skips it if it's ".ctf",
	on the assumption that this name will almost always be at the start
	of the objdump output and thus we'll end up with a shared dump
	and then smaller, headed dumps for the per-TU child dicts; but if
	the parent name has been changed, that won't be true any more.

	So change the rules to "members named .ctf which appear first in the
	first have their member name skipped".  Since we now need to count
	members, move from ctf_archive_iter (for which passing in extra
	parameters requires defining a new struct and is clumsy) to
	ctf_archive_next, allowing us to just *call* dump_ctf_archive_member and
	maintain a member count in the obvious way.  In the process we fix a
	tiny difference between readelf and objdump: if a ctf_dump ever failed,
	readelf skipped every later member, while objdump tried to keep going as
	much as it could.  For a dumping tool the former is clearly preferable.

	binutils/ChangeLog
	2021-10-25  Nick Alcock  <nick.alcock@oracle.com>

		* objdump.c (usage): --ctf-parent now takes a name, not a section.
		(dump_ctf): Don't open a separate section; use the parent_name in
		ctf_dict_open instead.  Use ctf_archive_next, not ctf_archive_iter,
		so we can pass down a member count.
		(dump_ctf_archive_member): Add the member count; don't return
		anything.  Import parents into children no matter what the
		parent's name, while still avoiding displaying the header for the
		common parent name of ".ctf".
		* readelf.c (usage): Adjust similarly.
		(dump_section_as_ctf): Likewise.
		(dump_ctf_archive_member): Likewise.  Never stop iterating over
		archive members, even if ctf_dump of one member fails.
		* doc/ctf.options.texi: Adjust.

2021-10-25  Alan Modra  <amodra@gmail.com>

	objdump doesn't accept -L option
	A followup to commit ca0e11aa4b.

		* objdump.c (main): Add 'L' to short options and sort them.

2021-10-25  Alan Modra  <amodra@gmail.com>

	bfd_nonfatal_message, localise va_start
	Nothing to see here, just a little tidier.

		* bucomm.c (bfd_nonfatal_message): Localise va_list args.

2021-10-25  Alan Modra  <amodra@gmail.com>

	ubsan: _bfd_xcoff64_swap_aux_in left shift of negative value
		* coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Use bfd_vma for h.

	asan: evax_bfd_print_image buffer overflow
		* vms-alpha.c (evax_bfd_print_image): Sanity check printing of
		"image activator fixup" section.
		(evax_bfd_print_relocation_records): Sanity check buffer offsets.
		(evax_bfd_print_address_fixups): Likewise.
		(evax_bfd_print_reference_fixups): Likewise.

2021-10-25  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-24  Alan Modra  <amodra@gmail.com>

	asan: c4x, c54x coff_canonicalize_reloc buffer overflow
	Sometimes the investigation of a fuzzing bug report leads into areas
	you'd rather not go.  In this instance by the time I'd figured out the
	real cause was a target variant that had never been properly supported
	in binutils, the time needed to fix it was less than the time needed
	to rip it out.

		* coffcode.h (coff_set_alignment_hook): Call bfd_coff_swap_reloc_in
		not coff_swap_reloc_in.
		(coff_slurp_reloc_table): Likewise.  Don't use RELOC type.
		(ticoff0_swap_table): Use coff_swap_reloc_v0_out and
		coff_swap_reloc_v0_in.
		* coffswap.h (coff_swap_reloc_v0_in, coff_swap_reloc_v0_out): New.
		* coff-tic54x.c (tic54x_lookup_howto): Don't abort.
		* coffgen.c (coff_get_normalized_symtab): Use PTR_ADD.
		* bfd-in.h (PTR_ADD, NPTR_ADD): Avoid warnings when passing an
		expression.
		* bfd-in2.h: Regenerate.

2021-10-24  Alan Modra  <amodra@gmail.com>

	asan: arm-darwin: buffer overflow
		PR 21813
		* mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Sanity
		check PAIR reloc in other branch of condition as was done for
		PR21813.  Formatting.  Delete debug printf.

	asan: aout: heap buffer overflow
		* aoutx.h (aout_get_external_symbols): Sanity check before writing
		zero index entry.  Remove outdated comment.
		* pdp11.c (aout_get_external_symbols): Likewise.

2021-10-24  liuzhensong  <liuzhensong@loongson.cn>

	LoongArch ld support
	2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
		    Zhensong Liu  <liuzhensong@loongson.cn>
		    Weinan Liu  <liuweinan@loongson.cn>
		    Xiaolin Tang  <tangxiaolin@loongson.cn>

	ld/
		* Makefile.am: Add LoongArch.
		* NEWS: Mention LoongArch support.
		* configure.tgt: Add LoongArch.
		* emulparams/elf32loongarch-defs.sh: New.
		* emulparams/elf32loongarch.sh: Likewise.
		* emulparams/elf64loongarch-defs.sh: Likewise.
		* emulparams/elf64loongarch.sh: Likewise.
		* emultempl/loongarchelf.em: Likewise.
		* Makefile.in: Regenerate.
		* po/BLD-POTFILES.in: Regenerate.
	ld/testsuite/
		* ld-loongarch-elf/disas-jirl.d: New.
		* ld-loongarch-elf/disas-jirl.s: Likewise.
		* ld-loongarch-elf/jmp_op.d: Likewise.
		* ld-loongarch-elf/jmp_op.s: Likewise.
		* ld-loongarch-elf/ld-loongarch-elf.exp: Likewise.
		* ld-loongarch-elf/macro_op.d: Likewise.
		* ld-loongarch-elf/macro_op.s: Likewise.
		* ld-loongarch-elf/syscall-0.s: Likewise.
		* ld-loongarch-elf/syscall-1.s: Likewise.
		* ld-loongarch-elf/syscall.d: Likewise.
		* ld-srec/srec.exp: Add LoongArch.
		* ld-unique/pr21529.d: Likewise.

2021-10-24  liuzhensong  <liuzhensong@loongson.cn>

	LoongArch gas support
	2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
	            Zhensong Liu  <liuzhensong@loongson.cn>
	            Weinan Liu  <liuweinan@loongson.cn>
		    Xiaolin Tang  <tangxiaolin@loongson.cn>

	gas/
		* Makefile.am: Add LoongArch.
		* NEWS: Mention LoongArch support.
		* config/loongarch-lex-wrapper.c: New.
		* config/loongarch-lex.h: New.
		* config/loongarch-lex.l: New.
		* config/loongarch-parse.y: New.
		* config/tc-loongarch.c: New.
		* config/tc-loongarch.h: New.
		* configure.ac: Add LoongArch.
		* configure.tgt: Likewise.
		* doc/as.texi: Likewise.
		* doc/c-loongarch.texi: Likewise.
		* Makefile.in: Regenerate.
		* configure: Regenerate.
		* po/POTFILES.in: Regenerate.
	gas/testsuite/
		* gas/all/gas.exp: Add LoongArch.
		* gas/elf/elf.exp: Likewise.
		* gas/loongarch/4opt_op.d: New.
		* gas/loongarch/4opt_op.s: Likewise.
		* gas/loongarch/fix_op.d: Likewise.
		* gas/loongarch/fix_op.s: Likewise.
		* gas/loongarch/float_op.d: Likewise.
		* gas/loongarch/float_op.s: Likewise.
		* gas/loongarch/imm_op.d: Likewise.
		* gas/loongarch/imm_op.s: Likewise.
		* gas/loongarch/jmp_op.d: Likewise.
		* gas/loongarch/jmp_op.s: Likewise.
		* gas/loongarch/load_store_op.d: Likewise.
		* gas/loongarch/load_store_op.s: Likewise.
		* gas/loongarch/loongarch.exp: Likewise.
		* gas/loongarch/macro_op.d: Likewise.
		* gas/loongarch/macro_op.s: Likewise.
		* gas/loongarch/nop.d: Likewise.
		* gas/loongarch/nop.s: Likewise.
		* gas/loongarch/privilege_op.d: Likewise.
		* gas/loongarch/privilege_op.s: Likewise.
		* gas/loongarch/syscall.d: Likewise.
		* gas/loongarch/syscall.s: Likewise.
		* lib/gas-defs.exp: Add LoongArch.

2021-10-24  liuzhensong  <liuzhensong@loongson.cn>

	LoongArch binutils support
	2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
		    Zhensong Liu  <liuzhensong@loongson.cn>
		    Weinan Liu  <liuweinan@loongson.cn>
	binutils/
		* NEWS: Mention LoongArch support.
		* readelf.c: Add LoongArch.
		* testsuite/binutils-all/objdump.exp: Add LoongArch.

2021-10-24  liuzhensong  <liuzhensong@loongson.cn>

	LoongArch opcodes support
	2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
		    Zhensong Liu  <liuzhensong@loongson.cn>
		    Weinan Liu  <liuweinan@loongson.cn>

	include/
		* opcode/loongarch.h: New.
		* dis-asm.h: Declare print_loongarch_disassembler_options.
	opcodes/
		* Makefile.am: Add LoongArch.
		* configure.ac: Likewise.
		* disassemble.c: Likewise.
		* disassemble.h: Declare print_insn_loongarch.
		* loongarch-coder.c: New.
		* loongarch-dis.c: New.
		* loongarch-opc.c: New.
		* Makefile.in: Regenerate.
		* configure: Regenerate.
		* po/POTFILES.in: Regenerate.

2021-10-24  liuzhensong  <liuzhensong@loongson.cn>

	LoongArch bfd support
	2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
		    Zhensong Liu  <liuzhensong@loongson.cn>
		    Weinan Liu  <liuweinan@loongson.cn>
	bfd/
		* Makefile.am: Add LoongArch.
		* archures.c: Likewise.
		* config.bfd: Likewise.
		* configure.ac: Likewise.
		* cpu-loongarch.c: New.
		* elf-bfd.h: Add LoongArch.
		* elf.c: Add LoongArch elfcore_grok_xxx.
		* elfnn-loongarch.c: New.
		* elfxx-loongarch.c: New.
		* elfxx-loongarch.h: New.
		* reloc.c: Add LoongArch BFD RELOC ENUM.
		* targets.c: Add LoongArch target.
		* Makefile.in: Regenerate.
		* bfd-in2.h: Regenerate.
		* configure: Regenerate.
		* libbfd.h: Regenerate.
		* po/BLD-POTFILES.in: Regenerate.
		* po/SRC-POTFILES.in: Regenerate.

	include/
		* elf/common.h: Add NT_LARCH_{CPUCFG,CSR,LSX,LASX}.
		* elf/loongarch.h: New.

2021-10-24  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-23  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-22  H.J. Lu  <hjl.tools@gmail.com>

	x86: Add -muse-unaligned-vector-move to assembler
	Unaligned load/store instructions on aligned memory or register are as
	fast as aligned load/store instructions on modern Intel processors.  Add
	a command-line option, -muse-unaligned-vector-move, to x86 assembler to
	encode encode aligned vector load/store instructions as unaligned
	vector load/store instructions.

		* NEWS: Mention -muse-unaligned-vector-move.
		* config/tc-i386.c (use_unaligned_vector_move): New.
		(encode_with_unaligned_vector_move): Likewise.
		(md_assemble): Call encode_with_unaligned_vector_move for
		-muse-unaligned-vector-move.
		(OPTION_MUSE_UNALIGNED_VECTOR_MOVE): New.
		(md_longopts): Add -muse-unaligned-vector-move.
		(md_parse_option): Handle -muse-unaligned-vector-move.
		(md_show_usage): Add -muse-unaligned-vector-move.
		* doc/c-i386.texi: Document -muse-unaligned-vector-move.
		* testsuite/gas/i386/i386.exp: Run unaligned-vector-move and
		x86-64-unaligned-vector-move.
		* testsuite/gas/i386/unaligned-vector-move.d: New file.
		* testsuite/gas/i386/unaligned-vector-move.s: Likewise.
		* testsuite/gas/i386/x86-64-unaligned-vector-move.d: Likewise.

2021-10-22  Tom Tromey  <tromey@adacore.com>

	Fix 'uninstall' target
	This adds some missing code to the 'uninstall' targets in gdb and
	gdbserver.  It also changes gdb's uninstall target so that it no
	longer tries to remove any man page -- this is already done (and more
	correctly) by doc/Makefile.in.

	I tested this with 'make install' followed by 'make uninstall', then
	examining the install tree for regular files.  Only the 'dir' file
	remains, but this appears to just be how 'install-info' is intended to
	work.

2021-10-22  Tom Tromey  <tromey@adacore.com>

	Remove unused variables from gdbserver's Makefile
	This removes a number of unused variables from gdbserver's Makefile.
	I found these while working on the subsequent patches, and figured it
	would be cleaner to have a separate patch for the deletions.

2021-10-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.threads/linux-dp.exp
	On openSUSE Tumbleweed with glibc-debuginfo installed I get:
	...
	 (gdb) PASS: gdb.threads/linux-dp.exp: continue to breakpoint: thread 5's print
	 where^M
	 #0  print_philosopher (n=3, left=33 '!', right=33 '!') at linux-dp.c:105^M
	 #1  0x0000000000401628 in philosopher (data=0x40537c) at linux-dp.c:148^M
	 #2  0x00007ffff7d56b37 in start_thread (arg=<optimized out>) \
	                          at pthread_create.c:435^M
	 #3  0x00007ffff7ddb640 in clone3 () \
	                          at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81^M
	 (gdb) PASS: gdb.threads/linux-dp.exp: first thread-specific breakpoint hit
	...
	while without debuginfo installed I get instead:
	...
	 (gdb) PASS: gdb.threads/linux-dp.exp: continue to breakpoint: thread 5's print
	 where^M
	 #0  print_philosopher (n=3, left=33 '!', right=33 '!') at linux-dp.c:105^M
	 #1  0x0000000000401628 in philosopher (data=0x40537c) at linux-dp.c:148^M
	 #2  0x00007ffff7d56b37 in start_thread () from /lib64/libc.so.6^M
	 #3  0x00007ffff7ddb640 in clone3 () from /lib64/libc.so.6^M
	 (gdb) FAIL: gdb.threads/linux-dp.exp: first thread-specific breakpoint hit
	...

	The problem is that the regexp used:
	...
	  "\(from .*libpthread\|at pthread_create\|in pthread_create\)"
	...
	expects the 'from' part to match libpthread, but in glibc 2.34 libpthread has
	been merged into libc.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

2021-10-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp
	Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
	mi_gdb_test" we run into:
	...
	PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: mi runto main
	Expecting: ^(-break-insert -f pendfunc1[^M
	]+)?((&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,\
	  bkpt=\{number="2",type="breakpoint".*\}.*\n\^done[^M
	]+[(]gdb[)] ^M
	[ ]*)
	-break-insert -f pendfunc1^M
	^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",\
	  addr="0x00007ffff7bd559e",func="pendfunc1",\
	  file="gdb/testsuite/gdb.mi/pendshr1.c",\
	  fullname="gdb/testsuite/gdb.mi/pendshr1.c",line="21",thread-groups=["i1"],\
	  times="0",original-location="pendfunc1"}^M
	(gdb) ^M
	FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
	  -break-insert -f pendfunc1 (unexpected output)
	...

	The regexp expects a breakpoint-created event, but that's actually suppressed
	by the command:
	...
	DEF_MI_CMD_MI_1 ("break-insert", mi_cmd_break_insert,
	                   &mi_suppress_notification.breakpoint),
	...

	Fix this by updating the regexp.

	Likewise for the following:
	...
	PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
	  -break-insert -f pendfunc1
	Expecting: ^(-break-enable count 1 2[^M
	]+)?(=breakpoint-modified,\
	  bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done[^M
	]+[(]gdb[)] ^M
	[ ]*)
	-break-enable count 1 2^M
	^done^M
	(gdb) ^M
	FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
	  -break-enable count 1 2 (unexpected out\
	put)
	...

	Tested on x86_64-linux.

2021-10-22  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: move gdb.Membuf support into a new file
	In a future commit I'm going to be creating gdb.Membuf objects from a
	new file within gdb/python/py*.c.  Currently all gdb.Membuf objects
	are created directly within infpy_read_memory (as a result of calling
	gdb.Inferior.read_memory()).

	Initially I split out the Membuf creation code into a new function,
	and left the new function in gdb/python/py-inferior.c, however, it
	felt a little random that the Membuf creation code should live with
	the inferior handling code.

	So, then I moved all of the Membuf related code out into a new file,
	gdb/python/py-membuf.c, the interface is gdbpy_buffer_to_membuf, which
	wraps an array of bytes into a gdb.Membuf object.

	Most of the code is moved directly from py-inferior.c with only minor
	tweaks to layout and replacing NULL with nullptr, hence, I've left the
	copyright date on py-membuf.c as 2009-2021 to match py-inferior.c.

	Currently, the only user of this code is still py-inferior.c, but in
	later commits this will change.

	There should be no user visible changes after this commit.

2021-10-22  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: new gdb.architecture_names function
	Add a new function to the Python API, gdb.architecture_names().  This
	function returns a list containing all of the supported architecture
	names within the current build of GDB.

	The values returned in this list are all of the possible values that
	can be returned from gdb.Architecture.name().

2021-10-22  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: make disassembler fprintf callback a static member function
	The disassemble_info structure has four callbacks, we have three of
	them as static member functions within gdb_disassembler, the fourth is
	just a global static function.

	However, this fourth callback, is still only used from the
	disassemble_info struct, so there's no real reason for its special
	handling.

	This commit makes fprintf_disasm a static method within
	gdb_disassembler.

	There should be no user visible changes after this commit.

2021-10-22  Lewis Revill  <lewis.revill@embecosm.com>

	RISC-V: Added ld testcase for pcgp relaxation.
	Consider the the pcgp-relax-02 testcase,

	        .text
	        .globl _start
	_start:
	.L1:    auipc   a0, %pcrel_hi(data_a)
	.L2:    auipc   a1, %pcrel_hi(data_b)
	        addi    a0, a0, %pcrel_lo(.L1)
	        addi    a1, a1, %pcrel_lo(.L2)

	        .data
	        .word 0x0
	        .globl data_a
	data_a:
	        .word 0x1

	        .section .rodata
	        .globl data_b
	data_b:
	        .word 0x2

	If the first auipc is deleted, but we are still building the pcgp
	table (connect the high and low pcrel relocations), then there is
	an aliasing issue that we need some way to disambiguate which of
	the two symbols we are targeting.  Therefore, Palmer thought of a
	way to use R_RISCV_DELETE to split this into two phases, so we
	could resolve the addresses before creating the ambiguities.

	This patch just add the ld testcase for the above case, in case we
	have changed something but break this.

	ld/
		* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Renamed pcgp-relax
		to pcgp-relax-01, and added pcgp-relax-02.
		* testsuite/ld-riscv-elf/pcgp-relax-01.d: Renmaed from pcgp-relax.
		* testsuite/ld-riscv-elf/pcgp-relax-01.s: Likewise.
		* testsuite/ld-riscv-elf/pcgp-relax-02.d: New testcase.
		* testsuite/ld-riscv-elf/pcgp-relax-02.s: Likewise.

2021-10-22  Lewis Revill  <lewis.revill@embecosm.com>

	RISC-V: Don't separate pcgp relaxation to another relax pass.
	Commit abd20cb637008da9d32018b4b03973e119388a0a and
	ebdcad3fddf6ec21f6d4dcc702379a12718cf0c4 introduced additional
	complexity into the paths run by the RISC-V relaxation pass in order to
	resolve the issue of accurately keeping track of pcrel_hi and pcrel_lo
	pairs. The first commit split up relaxation of these relocs into a pass
	which occurred after other relaxations in order to prevent the situation
	where bytes were deleted in between a pcrel_lo/pcrel_hi pair, inhibiting
	our ability to find the corresponding pcrel_hi relocation from the
	address attached to the pcrel_lo.

	Since the relaxation was split into two passes the 'again' parameter
	could not be used to perform the entire relaxation process again and so
	the second commit added a way to restart ldelf_map_segments, thus
	starting the whole process again.

	Unfortunately this process could not account for the fact that we were
	not finished with the relaxation process so in some cases - such as the
	case where code would not fit in a memory region before the
	R_RISCV_ALIGN relocation was relaxed - sanity checks in generic code
	would fail.

	This patch fixes all three of these concerns by reverting back to a
	system of having only one target relax pass but updating entries in the
	table of pcrel_hi/pcrel_lo relocs every time any bytes are deleted. Thus
	we can keep track of the pairs accurately, and we can use the 'again'
	parameter to restart the entire target relax pass, behaving in the way
	that generic code expects. Unfortunately we must still have an
	additional pass to delay deleting AUIPC bytes to avoid ambiguity between
	pcrel_hi relocs stored in the table after deletion. This pass can only
	be run once so we may potentially miss out on relaxation opportunities
	but this is likely to be rare.

	https://sourceware.org/bugzilla/show_bug.cgi?id=28410

	bfd/
		* elfnn-riscv.c (riscv_elf_link_hash_table): Removed restart_relax.
		(riscv_elf_link_hash_table_create): Updated.
		(riscv_relax_delete_bytes): Moved after the riscv_update_pcgp_relocs.
		Update the pcgp_relocs table whenever bytes are deleted.
		(riscv_update_pcgp_relocs): Add function to update the section
		offset of pcrel_hi and pcrel_lo, and also update the symbol value
		of pcrel_hi.
		(_bfd_riscv_relax_call): Need to update the pcgp_relocs table
		when deleting codes.
		(_bfd_riscv_relax_lui): Likewise.
		(_bfd_riscv_relax_tls_le): Likewise.
		(_bfd_riscv_relax_align): Once we've handled an R_RISCV_ALIGN,
		we can't relax anything else, so set the sec->sec_flg0 to true.
		Besides, we don't need to update the pcgp_relocs table at this
		stage, so just pass NULL pointer as the pcgp_relocs table for
		riscv_relax_delete_bytes.
		(_bfd_riscv_relax_section): Use only one pass for all target
		relaxations.
		(_bfd_riscv_relax_delete): Likewise, we don't need to update
		the pcgp_relocs table at this stage, and don't need to set
		the `again' since restart_relax mechanism is abandoned.
		(bfd_elfNN_riscv_restart_relax_sections): Removed.
		(_bfd_riscv_relax_section): Updated.
		* elfxx-riscv.h (bfd_elf32_riscv_restart_relax_sections): Removed.
		(bfd_elf64_riscv_restart_relax_sections): Likewise.
	ld/
		* emultempl/riscvelf.em: Revert restart_relax changes and set
		relax_pass to 3.
		* testsuite/ld-riscv-elf/align-small-region.d: New testcase.
		* testsuite/ld-riscv-elf/align-small-region.ld: Likewise.
		* testsuite/ld-riscv-elf/align-small-region.s: Likewise.
		* testsuite/ld-riscv-elf/restart-relax.d: Removed sine the
		restart_relax mechanism is abandoned.
		* testsuite/ld-riscv-elf/restart-relax.s: Likewise.
		* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.

2021-10-22  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix remote-sim.c build
	Commit 183be222907a ("gdb, gdbserver: make target_waitstatus safe")
	broke the remote-sim.c build.  In fact, it does some wrong changes,
	result of a bad sed invocation.

	Fix it by adjusting the code to the new target_waitstatus API.

	Change-Id: I3236ff7ef7681fc29215f68be210ff4263760e91

2021-10-22  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-21  Simon Marchi  <simon.marchi@efficios.com>

	gdb, gdbserver: make target_waitstatus safe
	I stumbled on a bug caused by the fact that a code path read
	target_waitstatus::value::sig (expecting it to contain a gdb_signal
	value) while target_waitstatus::kind was TARGET_WAITKIND_FORKED.  This
	meant that the active union field was in fact
	target_waitstatus::value::related_pid, and contained a ptid.  The read
	signal value was therefore garbage, and that caused GDB to crash soon
	after.  Or, since that GDB was built with ubsan, this nice error
	message:

	    /home/simark/src/binutils-gdb/gdb/linux-nat.c:1271:12: runtime error: load of value 2686365, which is not a valid value for type 'gdb_signal'

	Despite being a large-ish change, I think it would be nice to make
	target_waitstatus safe against that kind of bug.  As already done
	elsewhere (e.g. dynamic_prop), validate that the type of value read from
	the union matches what is supposed to be the active field.

	 - Make the kind and value of target_waitstatus private.
	 - Make the kind initialized to TARGET_WAITKIND_IGNORE on
	   target_waitstatus construction.  This is what most users appear to do
	   explicitly.
	 - Add setters, one for each kind.  Each setter takes as a parameter the
	   data associated to that kind, if any.  This makes it impossible to
	   forget to attach the associated data.
	 - Add getters, one for each associated data type.  Each getter
	   validates that the data type fetched by the user matches the wait
	   status kind.
	 - Change "integer" to "exit_status", "related_pid" to "child_ptid",
	   just because that's more precise terminology.
	 - Fix all users.

	That last point is semi-mechanical.  There are a lot of obvious changes,
	but some less obvious ones.  For example, it's not possible to set the
	kind at some point and the associated data later, as some users did.
	But in any case, the intent of the code should not change in this patch.

	This was tested on x86-64 Linux (unix, native-gdbserver and
	native-extended-gdbserver boards).  It was built-tested on x86-64
	FreeBSD, NetBSD, MinGW and macOS.  The rest of the changes to native
	files was done as a best effort.  If I forgot any place to update in
	these files, it should be easy to fix (unless the change happens to
	reveal an actual bug).

	Change-Id: I0ae967df1ff6e28de78abbe3ac9b4b2ff4ad03b7

2021-10-21  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbserver: initialize the members of lwp_info in-class
	Add a constructor to initialize the waitstatus members.  Initialize the
	others in the class directly.

	Change-Id: I10f885eb33adfae86e3c97b1e135335b540d7442

2021-10-21  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbserver: make thread_info non-POD
	Add a constructor and a destructor.  The constructor takes care of the
	initialization that happened in add_thread, while the destructor takes
	care of the freeing that happened in free_one_thread.  This is needed to
	make target_waitstatus non-POD, as thread_info contains a member of that
	type.

	Change-Id: I1db321b4de9dd233ede0d5c101950f1d6f1d13b7

2021-10-21  Andrew Pinski  <apinski@marvell.com>

	Fix ARMv8.4 for hw watchpoint and breakpoint
	Just like my previoius patch for ARMv8.1 and v8.2 (49ecef2a7da2ee9df4),
	this adds ARMv8.4 debug arch as being compatible for hw watchpoint
	and breakpoints.

	Refactor code slightly in nat/aarch64-linux-hw-point.c (aarch64_linux_get_debug_reg_capacity)
	Since the two locations which check the debug arch are the same code currently, it is
	a good idea to factor it out to a new function and just use that function from
	aarch64_linux_get_debug_reg_capacity. This is also the first step to support
	ARMv8.4 debug arch.

2021-10-21  Carl Love  <cel@us.ibm.com>

	Fixes for gdb.mi/mi-break.exp
	Update the expected pattern for two of the tests.

	Matching pattern \" doesn't work.  Use .*  to match the \* pattern.

2021-10-21  Tom de Vries  <tdevries@suse.de>

	[gdb/tui] Fix breakpoint display functionality
	In commit 81e6b8eb208 "Make tui-winsource not use breakpoint_chain", a loop
	body was transformed into a lambda function body:
	...
	-      for (bp = breakpoint_chain;
	-           bp != NULL;
	-           bp = bp->next)
	+      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
	...
	and consequently:
	- a continue was replaced by a return, and
	- a final return was added.

	Then in commit 240edef62f0 "gdb: remove iterate_over_breakpoints function", we
	transformed back to a loop body:
	...
	-      iterate_over_breakpoints ([&] (breakpoint *bp) -> bool
	+      for (breakpoint *bp : all_breakpoints ())
	...
	but without reverting the changes that introduced the two returns.

	Consequently, breakpoints no longer show up in the tui source window.

	Fix this by reverting the changes that introduced the two returns.

	Build on x86_64-linux, tested with all .exp test-cases that contain
	tuiterm_env.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28483

2021-10-21  Carl Love  <cel@us.ibm.com>

	Fix test step-and-next-inline.cc
	The test expect the runto_main to stop at the first line of the function.
	Depending on the optimization level, gdb may stop in the prolog or after
	the prolog at the first line.  To ensure the test stops at the first line
	of main, have it explicitly stop at a break point on the first line of the
	function.

	On PowerPC, the test passes when compiled with no optimization but fails
	with all levels of optimization due to gdb stopping in the prolog.

2021-10-21  Tom Tromey  <tromey@adacore.com>

	Fix latent Ada bug when accessing field offsets
	The "add accessors for field (and call site) location" patch caused a
	gdb crash when running the internal AdaCore testsuite.  This turned
	out to be a latent bug in ada-lang.c.

	The immediate cause of the bug is that find_struct_field
	unconditionally uses TYPE_FIELD_BITPOS.  This causes an assert for a
	dynamic type.

	This patch fixes the problem by doing two things.  First, it changes
	find_struct_field to use a dummy value for the field offset in the
	situation where the offset is not actually needed by the caller.  This
	works because the offset isn't used in any other way -- only as a
	result.

	Second, this patch assures that calls to find_struct_field use a
	resolved type when the offset is needed.  For
	value_tag_from_contents_and_address, this is done by resolving the
	type explicitly.  In ada_value_struct_elt, this is done by passing
	nullptr for the out parameters when they are not needed (the second
	call in this function already uses a resolved type).

	Note that, while we believe the parent field probably can't occur at a
	variable offset, the patch still updates this code path, just in case.

	I've updated an existing test case to reproduce the crash.
	I'm checking this in.

2021-10-21  Alan Modra  <amodra@gmail.com>

	-Waddress warning in ldelf.c
	ldelf.c: In function 'ldelf_after_open':
	ldelf.c:1049:43: warning: the comparison will always evaluate as 'true' for the address of 'elf_header' will never be NULL [-Waddress]
	 1049 |           && elf_tdata (abfd)->elf_header != NULL
	      |                                           ^~
	In file included from ldelf.c:37:
	../bfd/elf-bfd.h:1957:21: note: 'elf_header' declared here
	 1957 |   Elf_Internal_Ehdr elf_header[1];      /* Actual data, but ref like ptr */

		* ldelf.c (ldelf_after_open): Remove useless elf_header test.

2021-10-21  Alan Modra  <amodra@gmail.com>

	Avoid -Waddress warnings in readelf
	Mainline gcc:
	readelf.c: In function 'find_section':
	readelf.c:349:8: error: the comparison will always evaluate as 'true' for the pointer operand in 'filedata->section_headers + (sizetype)((long unsigned int)i * 80)' must not be NULL [-Werror=address]
	  349 |   ((X) != NULL                                                          \
	      |        ^~
	readelf.c:761:9: note: in expansion of macro 'SECTION_NAME_VALID'
	  761 |     if (SECTION_NAME_VALID (filedata->section_headers + i)
	      |         ^~~~~~~~~~~~~~~~~~

	This will likely be fixed in gcc, but inline functions are nicer than
	macros.

		* readelf.c (SECTION_NAME, SECTION_NAME_VALID),
		(SECTION_NAME_PRINT, VALID_SYMBOL_NAME, VALID_DYNAMIC_NAME),
		(GET_DYNAMIC_NAME): Delete.  Replace with..
		(section_name, section_name_valid, section_name_print),
		(valid_symbol_name, valid_dynamic_name, get_dynamic_name): ..these
		new inline functions.  Update use throughout file.

2021-10-21  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-20  Alan Modra  <amodra@gmail.com>

	PR28417, std::string no longer allows accepting nullptr_t
		PR 28417
		* incremental.cc (Sized_relobj_incr::do_section_name): Avoid
		std:string undefined behaviour.
		* options.h (Search_directory::Search_directory): Likewise.

2021-10-20  Alan Modra  <amodra@gmail.com>

	Re: PR27625, powerpc64 gold __tls_get_addr calls
	My previous PR27625 patch had a problem or two.  For one, the error
	"__tls_get_addr call lacks marker reloc" on processing some calls
	before hitting a call without markers typically isn't seen.  Instead a
	gold assertion fails.  Either way it would be a hard error, which
	triggers on a file contained in libphobos.a when running the gcc
	testsuite.  A warning isn't even appropriate since the call involved
	is one built by hand without any of the arg setup relocations that
	might result in linker optimisation.

	So this patch reverts most of commit 0af4fcc25dd5, instead entirely
	ignoring the problem of mis-optimising old-style __tls_get_addr calls
	without marker relocs.  We can't handle them gracefully without
	another pass over relocations before decisions are made about GOT
	entries in Scan::global or Scan::local.  That seems too costly, just
	to link object files from 2009.  What's more, there doesn't seem to be
	any way to allow the libphobos explicit __tls_get_addr call, but not
	old TLS sequences without marker relocs.  Examining instructions
	before the __tls_get_addr call is out of the question: program flow
	might reach the call via a branch.  Putting an R_PPC64_TLSGD marker
	with zero sym on the call might be a solution, but current linkers
	will then merrily optimise away the call!

		PR gold/27625
		* powerpc.cc (Powerpc_relobj): Delete no_tls_marker_, tls_marker_,
		and tls_opt_error_ variables and accessors.  Remove all uses.

2021-10-20  Tom Tromey  <tom@tromey.com>

	Use std::string in print_one_catch_syscall
	This changes print_one_catch_syscall to use std::string, removing a
	bit of manual memory management.

	Use unique_xmalloc_ptr in breakpoint
	This changes struct breakpoint to use unique_xmalloc_ptr in a couple
	of spots, removing a bit of manual memory management.

	Use unique_xmalloc_ptr in bp_location
	This changes struct bp_location to use a unique_xmalloc_ptr, removing
	a bit of manual memory management.

	Use unique_xmalloc_ptr in watchpoint
	This changes struct watchpoint to use unique_xmalloc_ptr in a couple
	of places, removing a bit of manual memory management.

	Use unique_xmalloc_ptr in exec_catchpoint
	This changes struct exec_catchpoint to use a unique_xmalloc_ptr,
	removing a bit of manual memory management.

	Use unique_xmalloc_ptr in solib_catchpoint
	This changes struct solib_catchpoint to use a unique_xmalloc_ptr,
	removing a bit of manual memory management.

2021-10-20  Christian Biesinger  <cbiesinger@google.com>

	Make c-exp.y work with Bison 3.8+
	When using Bison 3.8, we get this error:

	    ../../gdb/c-exp.y:3455:1: error: 'void c_print_token(FILE*, int, YYSTYPE)' defined but not used [-Werror=unused-function]

	That's because bison 3.8 removed YYPRINT support:
	https://savannah.gnu.org/forum/forum.php?forum_id=10047

	Accordingly, this patch only defines that function for Bison < 3.8.

	Change-Id: I3cbf2f317630bb72810b00f2d9b2c4b99fa812ad

2021-10-20  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-19  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Reimplement gdb.gdb/python-interrupts.exp as unittest
	The test-case gdb.gdb/python-interrupts.exp:
	- runs to captured_command_loop
	- sets a breakpoint at set_active_ext_lang
	- calls a python command
	- verifies the command triggers the breakpoint
	- sends a signal and verifies the result

	The test-case is fragile, because (f.i. with -flto) it cannot be guaranteed
	that captured_command_loop and set_active_ext_lang are available for setting
	breakpoints.

	Reimplement the test-case as unittest, using:
	- execute_command_to_string to capture the output
	- try/catch to catch the "Error while executing Python code" exception
	- a new hook selftests::hook_set_active_ext_lang to raise the signal

	Tested on x86_64-linux.

2021-10-19  Tom Tromey  <tromey@adacore.com>

	Check index in type::field
	This changes gdb to check the index that is passed to type::field.
	This caught one bug in the Ada code when running the test suite
	(actually I found the bug first, then realized that the check would
	have helped), so this patch fixes that as well.

	Regression tested on x86-64 Fedora 34.

2021-10-19  Tom Tromey  <tromey@adacore.com>

	Fix Rust lex selftest when using libiconv
	The Rust lex selftest fails on our Windows build.  I tracked this down
	to a use of UTF-32 as a parameter to convert_between_encodings.  Here,
	iconv_open succeeds, but the actual conversion of a tab character
	fails with EILSEQ.  I suspect that "UTF-32" is being interpreted as
	big-endian, as changing the call to use "UTF-32LE" makes it work.
	This patch implements this fix.

2021-10-19  Tom Tromey  <tromey@adacore.com>

	Fix format_pieces selftest on Windows
	The format_pieces selftest currently fails on Windows hosts.

	The selftest doesn't handle the "%ll" -> "%I64" rewrite that the
	formatter may perform, but also gdbsupport was missing a configure
	check for PRINTF_HAS_LONG_LONG.  This patch fixes both issues.

2021-10-19  Tom Tromey  <tromey@adacore.com>

	Fix bug in dynamic type resolution
	A customer-reported problem led us to a bug in dynamic type
	resolution.  resolve_dynamic_struct will recursively call
	resolve_dynamic_type_internal, passing it the sub-object for the
	particular field being resolved.  While it offsets the address here,
	it does not also offset the "valaddr" -- the array of bytes describing
	the memory.

	This patch fixes the bug, by offsetting both.  A test case is included
	that can be used to reproduce the bug.

2021-10-19  Tom Tromey  <tromey@adacore.com>

	Always use std::function for self-tests
	Now that there is a register_test variant that accepts std::function,
	it seems to me that the 'selftest' struct and accompanying code is
	obsolete -- simply always using std::function is simpler.  This patch
	implements this idea.

2021-10-19  Daniel Black  <daniel@mariadb.org>

	Fix PR gdb/17917 Lookup build-id in remote binaries
	GDB doesn't support loading debug files using build-id from remote
	target filesystems.

	This is the case when gdbserver attached to a process and a gdb target
	remote occurs over tcp.

	With this change we make build-id lookups possible:

	    (gdb) show debug-file-directory
	    The directory where separate debug symbols are searched for is "/usr/local/lib/debug".
	    (gdb) set debug-file-directory /usr/lib/debug
	    (gdb) show sysroot
	    The current system root is "target:".
	    (gdb) target extended-remote :46615
	    Remote debugging using :46615
	    warning: Can not parse XML target description; XML support was disabled at compile time
	    Reading /usr/sbin/mariadbd from remote target...
	    warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
	    Reading /usr/sbin/mariadbd from remote target...
	    Reading symbols from target:/usr/sbin/mariadbd...
	    Reading /usr/lib/debug/.build-id/6e/0a874dca5a7ff831396ddc0785d939a192efe3.debug from remote target...
	    Reading /usr/lib/debug/.build-id/6e/0a874dca5a7ff831396ddc0785d939a192efe3.debug from remote target...
	    Reading symbols from target:/usr/lib/debug/.build-id/6e/0a874dca5a7ff831396ddc0785d939a192efe3.debug...
	    Reading /lib/x86_64-linux-gnu/libpcre2-8.so.0 from remote target...
	    ...

	Before this change, the lookups would have been (GNU gdb (GDB) Fedora 10.2-3.fc34):

	    (gdb) target extended-remote :46615
	    Remote debugging using :46615
	    Reading /usr/sbin/mariadbd from remote target...
	    warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
	    Reading /usr/sbin/mariadbd from remote target...
	    Reading symbols from target:/usr/sbin/mariadbd...
	    Reading /usr/sbin/0a874dca5a7ff831396ddc0785d939a192efe3.debug from remote target...
	    Reading /usr/sbin/.debug/0a874dca5a7ff831396ddc0785d939a192efe3.debug from remote target...
	    Reading /usr/lib/debug//usr/sbin/0a874dca5a7ff831396ddc0785d939a192efe3.debug from remote target...
	    Reading /usr/lib/debug/usr/sbin//0a874dca5a7ff831396ddc0785d939a192efe3.debug from remote target...
	    Reading target:/usr/lib/debug/usr/sbin//0a874dca5a7ff831396ddc0785d939a192efe3.debug from remote target...
	    Missing separate debuginfo for target:/usr/sbin/mariadbd
	    Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/6e/0a874dca5a7ff831396ddc0785d939a192efe3.debug
	    (No debugging symbols found in target:/usr/sbin/mariadbd)

	Observe it didn't look for
	/usr/lib/debug/.build-id/6e/0a874dca5a7ff831396ddc0785d939a192efe3.debug
	on the remote target (where it is) and expected them to be installed
	locally.

	As a minor optimization, this also changes the build-id lookup such that
	if sysroot is empty, no second lookup of the same location is performed.

	Change-Id: I5181696d271c325a25a0805a8defb8ab7f9b3f55
	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17917

2021-10-19  Nick Clifton  <nickc@redhat.com>

	Fix a potential illegal memory access when testing for a special LTO symbol name.
	bfd	* linker.c (_bfd_generic_link_add_one_symbol): Test for a NULL
		name before checking to see if the symbol is __gnu_lto_slim.
		* archive.c (_bfd_compute_and_write_armap): Likewise.
	binutils
		* nm.c (filter_symbols): Test for a NULL name before checking to
		see if the symbol is __gnu_lto_slim.
		* objcopy.c (filter_symbols): Likewise.

2021-10-19  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-18  Weimin Pan  <weimin.pan@oracle.com>

	CTF: incorrect underlying type setting for enumeration types
	A bug was filed against the incorrect underlying type setting for
	an enumeration type, which was caused by a copy and paste error.
	This patch fixes the problem by setting it by calling objfile_int_type,
	which was originally dwarf2_per_objfile::int_type, with ctf_type_size bits.
	Also add error checking on ctf_func_type_info call.

2021-10-18  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-17  Alan Modra  <amodra@gmail.com>

	PR28459, readelf issues bogus warning
	I'd missed the fact that the .debug_rnglists dump doesn't exactly
	display the contents of the section.  Instead readelf rummages through
	.debug_info looking for DW_AT_ranges entries, then displays the
	entries in .debug_rnglists pointed at, sorted.  A simpler dump of the
	actual section contents might be more useful and robust, but it was
	likely done that way to detect overlap and holes.

	Anyway, the headers in .debug_rnglists besides the first are ignored,
	and limiting to the unit length of the first header fails if there is
	more than one unit.

		PR 28459
		* dwarf.c (display_debug_ranges): Don't constrain data to length
		in header.

2021-10-17  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-16  H.J. Lu  <hjl.tools@gmail.com>

	ld: Adjust pr28158.rd for glibc 2.34
	Adjust pr28158.rd for glibc 2.34:

	$ readelf -W --dyn-syms tmpdir/pr28158

	Symbol table '.dynsym' contains 4 entries:
	   Num:    Value          Size Type    Bind   Vis      Ndx Name
	     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
	     1: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __libc_start_main@GLIBC_2.34 (2)
	     2: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
	     3: 000000000040401c     4 OBJECT  GLOBAL DEFAULT   23 foo@VERS_2.0 (3)
	$

	vs older glibc:

	$ readelf -W --dyn-syms tmpdir/pr28158

	Symbol table '.dynsym' contains 4 entries:
	   Num:    Value          Size Type    Bind   Vis      Ndx Name
	     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
	     1: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __libc_start_main@GLIBC_2.2.5 (3)
	     2: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND __gmon_start__
	     3: 000000000040401c     4 OBJECT  GLOBAL DEFAULT   23 foo@VERS_2.0 (2)

	$

		* testsuite/ld-elf/pr28158.rd: Adjusted for glibc 2.34.

2021-10-16  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-15  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-14  Carl Love  <cel@us.ibm.com>

	Powerpc: Add support for openat and fstatat syscalls
	[gdb] update ppc-linux-tdep.c

	Add argument to ppc_canonicalize_syscall for the wordsize.
	Add syscall entries for the openat and fstatat system calls.

2021-10-14  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add .debug_loc support in dwarf assembler
	Add .debug_loc support in the dwarf assembler, and use it in new test-case
	gdb.dwarf2/loc-sec-offset.exp (which is based on
	gdb.dwarf2/loclists-sec-offset.exp).

	Tested on x86_64-linux.

2021-10-14  Alan Modra  <amodra@gmail.com>

	[GOLD] Re: PowerPC64: Don't pretend to support multi-toc
	We can't get at section->address() until everything is laid out, so
	trying to generalise the offset calculation rather than using a value
	of 0x8000 (the old object->toc_base_offset()) was bound to fail.
	got->g_o_t() is a little better than a hard-coded 0x8000.

		* powerpc.cc (Target_powerpc::Scan::local, global): Don't use
		toc_pointer() here.

2021-10-14  Alan Modra  <amodra@gmail.com>

	[GOLD] Two GOT sections for PowerPC64
	Split .got into two piece, one with the header and entries for small
	model got entries, the other with entries for medium/large model got
	entries.  The idea is to better support mixed pcrel/non-pcrel code
	where non-pcrel small-model .toc entries need to be within 32k of the
	toc pointer.

		* target.h (Target::tls_offset_for_local): Add got param.
		(Target::tls_offset_for_global): Likewise.
		(Target::do_tls_offset_for_local, do_tls_offset_for_global): Likewise.
		* output.h (Output_data_got::Got_entry::write): Add got param.
		* output.cc (Output_data_got::Got_entry::write): Likewise, pass to
		tls_offset_for_local/global calls.
		(Output_data_got::do_write): Adjust to suit.
		* s390.cc (Target_s390::do_tls_offset_for_local): Likewise.
		(Target_s390::do_tls_offset_for_global): Likewise.
		* powerpc.cc (enum Got_type): Extend with small types, move from
		class Target_powerpc.
		(Target_powerpc::biggot_): New.
		(Traget_powerpc::do_tls_offset_for_local, do_tls_offset_for_global,
		got_size, got_section, got_base_offset): Handle biggot_.
		(Target_powerpc::do_define_standard_symbols): Adjust.
		(Target_powerpc::make_plt_section, do_finalize_sections): Likewise.
		(Output_data_got_powerpc::Output_data_got_powerpc): Only make
		64-bit header for small got section.
		(Output_data_got_powerpc::g_o_t): Only return a result for small
		got section.
		(Output_data_got_powerpc::write): Only write small got section
		header.
		(Target_powerpc::Scan::local, global): Select small/big Got_type
		and section to suit reloc.
		(Target_powerpc::Relocate::relocate): Similarly.
		(Sort_toc_sections): Rewrite.

2021-10-14  Alan Modra  <amodra@gmail.com>

	[GOLD] PowerPC64: Don't pretend to support multi-toc
	Code in powerpc.cc is pretending to support a per-object toc pointer
	value, but powerpc gold has no real support for multi-toc.  This patch
	removes the pretense, tidying quite a lot in preparation for a
	followup patch.  If multi-toc is ever to be supported, don't revert
	this patch but start by adding object parameter to toc_pointer() and
	an object to Branch_stub_key.

		* powerpc.cc (Powerpc_relobj::toc_base_offset): Delete.
		(Target_powerpc::toc_pointer): New function.  Use throughout.
		(Target_powerpc::got_base_offset): New function.  Use throughout..
		(Output_data_got_powerpc::got_base_offset): ..in place of
		this.  Delete.
		(Output_data_got_powerpc::Output_data_got_powerpc): Init
		header_index_ to -1u for 64-bit, and make header here.
		(Output_data_got_powerpc::set_final_data_size, reserve_ent): Don't
		make 64-bit header here.
		(Output_data_got_powerpc::g_o_t): Return toc pointer offset in
		section for 64-bit.  Use throughout.
		(Stub_table): Remove toc_base_off_ from Branch_stub_key, and
		object param on add_long_branch_entry and find_long_branch_entry.
		Adjust all uses.

2021-10-14  Alan Modra  <amodra@gmail.com>

	Re: s12z/disassembler: call memory_error_func when appropriate
	Adjust for commit ba7c18a48457.

		* testsuite/gas/s12z/truncated.d: Update expected output.

2021-10-14  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-13  Tom de Vries  <tdevries@suse.de>

	[gdb/exp] Improve <error reading variable> message
	When printing a variable x in a subroutine foo:
	...
	subroutine foo (x)
	  integer(4) :: x (*)
	  x(3) = 1
	end subroutine foo
	...
	where x is an array with unknown bounds, we get:
	...
	$ gdb -q -batch outputs/gdb.fortran/array-no-bounds/array-no-bounds \
	  -ex "break foo" \
	  -ex run \
	  -ex "print x"
	Breakpoint 1 at 0x4005cf: file array-no-bounds.f90, line 18.

	Breakpoint 1, foo (x=...) at array-no-bounds.f90:18
	18        x(3) = 1
	$1 = <error reading variable>
	...

	Improve the error message by printing the details of the error, such that we
	have instead:
	...
	$1 = <error reading variable: failed to get range bounds>
	...

	This is a change in gdb/valprint.c, and grepping through the sources reveals
	that this is a common pattern.

	Tested on x86_64-linux.

2021-10-13  Carl Love  <cel@us.ibm.com>

	PPC fix for stfiwx instruction (and additional stores with primary opcode of 31)
	[gdb] Fix address being recorded in rs6000-tdep.c, ppc_process_record_op31.

	The GDB record function was recording the variable addr that was passed in
	rather than the calculated effective address (ea) by the
	ppc_process_record_op31 function.

2021-10-13  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: improve error reporting from the disassembler
	If the libopcodes disassembler returns a negative value then this
	indicates that the disassembly failed for some reason.  In disas.c, in
	the function gdb_disassembler::print_insn we can see how this is
	handled; when we get a negative value back, we call the memory_error
	function, which throws an exception.

	The problem here is that the address used in the memory_error call is
	gdb_disassembler::m_err_memaddr, which is set in
	gdb_disassembler::dis_asm_memory_error, which is called from within
	the libopcodes disassembler through the
	disassembler_info::memory_error_func callback.

	However, for this to work correctly, every time the libopcodes
	disassembler returns a negative value, the libopcodes disassembler
	must have first called the memory_error_func callback.

	My first plan was to make m_err_memaddr a gdb::optional, and assert
	that it always had a value prior to calling memory_error, however, a
	quick look in opcodes/*-dis.c shows that there _are_ cases where a
	negative value is returned without first calling the memory_error_func
	callback, for example in arc-dis.c and cris-dis.c.

	Now, I think that a good argument can be made that these disassemblers
	must therefore be broken, except for the case where we can't read
	memory, we should always be able to disassemble the memory contents to
	_something_, even if it's just '.word 0x....'.  However, I certainly
	don't plan to go and fix all of the disassemblers.

	What I do propose to do then, is make m_err_memaddr a gdb::optional,
	but now, instead of always calling memory_error, I add a new path
	which just calls error complaining about an unknown error.  This new
	path is only used if m_err_memaddr doesn't have a value (indicating
	that the memory_error_func callback was not called).

	To test this I just augmented one of the disassemblers to always
	return -1, before this patch I see this:

	  Dump of assembler code for function main:
	     0x000101aa <+0>:	Cannot access memory at address 0x0

	And after this commit I now see:

	  Dump of assembler code for function main:
	     0x000101aa <+0>:	unknown disassembler error (error = -1)

	This doesn't really help much, but that's because there's no way to
	report non memory errors out of the disasembler, because, it was not
	expected that the disassembler would ever report non memory errors.

2021-10-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.fortran/call-no-debug.exp with native-gdbserver
	When running test-case gdb.fortran/call-no-debug.exp with target board
	native-gdbserver, I run into:
	...
	(gdb) PASS: gdb.fortran/call-no-debug.exp: print string_func_ (&'abcdefg', 3)
	call (integer) string_func_ (&'abcdefg', 3)^M
	$2 = 0^M
	(gdb) FAIL: gdb.fortran/call-no-debug.exp: call (integer) string_func_ (&'abcdefg', 3)
	...

	The problem is that gdb_test is used to match inferior output.

	Fix this by using gdb_test_stdio.

	Tested on x86_64-linux.

2021-10-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Require use_gdb_stub == 0 where appropriate
	When running with target board native-gdbserver, we run into a number of FAILs
	due to use of the start command (and similar), which is not supported when
	use_gdb_stub == 1.

	Fix this by:
	- requiring use_gdb_stub == 0 for the entire test-case, or
	- guarding some tests in the test-case with use_gdb_stub == 0.

	Tested on x86_64-linux.

2021-10-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix test name in gdb.python/python.exp
	When running test-case gdb.python/python.exp, we have:
	...
	PASS: gdb.python/python.exp: starti via gdb.execute, not from tty
	PASS: gdb.python/python.exp: starti via interactive input
	...

	The two tests are instances of the same test, with different values for
	starti command argument from_tty, so it's strange that the test names are so
	different.

	This is due to using a gdb_test nested in a gdb_test_multiple, with the inner
	one using a different test name than the outer one.  [ That could still make
	sense if both produced passes, but that's not the case here. ]

	Fix this by using $gdb_test_name, such that we have:
	...
	PASS: gdb.python/python.exp: starti via gdb.execute, not from tty
	PASS: gdb.python/python.exp: starti via gdb.execute, from tty
	...

	Also make this more readable by using variables.

	Tested on x86_64-linux.

2021-10-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/batch-exit-status.exp with native-gdbserver
	When running test-case gdb.base/batch-exit-status.exp with target board
	native-gdbserver, I run into (added missing double quotes for clarity):
	...
	builtin_spawn $build/gdb/testsuite/../../gdb/gdb -nw -nx \
	  -data-directory $build/gdb/testsuite/../data-directory \
	  -iex "set height 0" -iex "set width 0" \
	  -ex "set auto-connect-native-target off" \
	  -iex "set sysroot" -batch ""^M
	: No such file or directory.^M
	PASS: gdb.base/batch-exit-status.exp: 1x: \
	  No such file or directory: [lindex $result 2] == 0
	FAIL: gdb.base/batch-exit-status.exp: 1x: \
	  No such file or directory: [lindex $result 3] == $expect_status
	...

	As in commit a02a90c114c "[gdb/testsuite] Set sysroot earlier in
	local-board.exp", the problem is the use of -ex for
	"set auto-connect-native-target off", which makes that the last command to
	be executed, and consequently determines the return status.

	Fix this by using -iex instead.

	Tested on x86_64-linux.

2021-10-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Remove quit in gdb.arch/i386-mpx.exp
	When running test-case gdb.arch/i386-mpx.exp with target board
	native-gdbserver, I run into:
	...
	(gdb) PASS: gdb.arch/i386-mpx.exp: verify size for bnd0
	Remote debugging from host ::1, port 42328^M
	quit^M
	A debugging session is active.^M
	^M
	        Inferior 1 [process 19679] will be killed.^M
	^M
	Quit anyway? (y or n) monitor exit^M
	Please answer y or n.^M
	A debugging session is active.^M
	^M
	        Inferior 1 [process 19679] will be killed.^M
	^M
	Quit anyway? (y or n) WARNING: Timed out waiting for EOF in server after monitor exit
	...

	The problem is that the test-case sends a quit at the end (without verifying
	the result of this in any way):
	...
	send_gdb "quit\n"
	...

	Fix this by removing the quit.

	Tested on x86_64-linux.

2021-10-13  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-12  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-11  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	[ARM] Add support for M-profile MVE extension
	This patch adds support for the M-profile MVE extension, which includes the
	following:

	- New M-profile XML feature m-profile-mve
	- MVE vector predication status and control register (VPR)
	- p0 pseudo register (contained in the VPR)
	- q0 ~ q7 pseudo vector registers
	- New feature bits
	- Documentation update

	Pseudo register p0 is the least significant bits of vpr and can be accessed
	as $p0 or displayed through $vpr.  For more information about the register
	layout, please refer to [1].

	The q0 ~ q7 registers map back to the d0 ~ d15 registers, two d registers
	per q register.

	The register dump looks like this:

	(gdb) info reg all
	r0             0x0                 0
	r1             0x0                 0
	r2             0x0                 0
	r3             0x0                 0
	r4             0x0                 0
	r5             0x0                 0
	r6             0x0                 0
	r7             0x0                 0
	r8             0x0                 0
	r9             0x0                 0
	r10            0x0                 0
	r11            0x0                 0
	r12            0x0                 0
	sp             0x0                 0x0 <__Vectors>
	lr             0xffffffff          -1
	pc             0xd0c               0xd0c <Reset_Handler>
	xpsr           0x1000000           16777216
	d0             0                   (raw 0x0000000000000000)
	d1             0                   (raw 0x0000000000000000)
	d2             0                   (raw 0x0000000000000000)
	d3             0                   (raw 0x0000000000000000)
	d4             0                   (raw 0x0000000000000000)
	d5             0                   (raw 0x0000000000000000)
	d6             0                   (raw 0x0000000000000000)
	d7             0                   (raw 0x0000000000000000)
	d8             0                   (raw 0x0000000000000000)
	d9             0                   (raw 0x0000000000000000)
	d10            0                   (raw 0x0000000000000000)
	d11            0                   (raw 0x0000000000000000)
	d12            0                   (raw 0x0000000000000000)
	d13            0                   (raw 0x0000000000000000)
	d14            0                   (raw 0x0000000000000000)
	d15            0                   (raw 0x0000000000000000)
	fpscr          0x0                 0
	vpr            0x0                 [ P0=0 MASK01=0 MASK23=0 ]
	s0             0                   (raw 0x00000000)
	s1             0                   (raw 0x00000000)
	s2             0                   (raw 0x00000000)
	s3             0                   (raw 0x00000000)
	s4             0                   (raw 0x00000000)
	s5             0                   (raw 0x00000000)
	s6             0                   (raw 0x00000000)
	s7             0                   (raw 0x00000000)
	s8             0                   (raw 0x00000000)
	s9             0                   (raw 0x00000000)
	s10            0                   (raw 0x00000000)
	s11            0                   (raw 0x00000000)
	s12            0                   (raw 0x00000000)
	s13            0                   (raw 0x00000000)
	s14            0                   (raw 0x00000000)
	s15            0                   (raw 0x00000000)
	s16            0                   (raw 0x00000000)
	s17            0                   (raw 0x00000000)
	s18            0                   (raw 0x00000000)
	s19            0                   (raw 0x00000000)
	s20            0                   (raw 0x00000000)
	s21            0                   (raw 0x00000000)
	s22            0                   (raw 0x00000000)
	s23            0                   (raw 0x00000000)
	s24            0                   (raw 0x00000000)
	s25            0                   (raw 0x00000000)
	s26            0                   (raw 0x00000000)
	s27            0                   (raw 0x00000000)
	s28            0                   (raw 0x00000000)
	s29            0                   (raw 0x00000000)
	s30            0                   (raw 0x00000000)
	s31            0                   (raw 0x00000000)
	q0             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	q1             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	q2             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	q3             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	q4             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	q5             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	q6             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	q7             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
	p0             0x0                 0

	Built and regtested with a simulator.

	[1] https://developer.arm.com/documentation/ddi0553/bn

	Co-Authored-By: Luis Machado <luis.machado@linaro.org>

2021-10-11  Luis Machado  <luis.machado@linaro.org>

	[ARM] Refactor pseudo register numbering
	The pseudo register handling for ARM uses some hardcoded constants to
	determine types and names.  In preparation to the upcoming MVE support
	patch (that will add another pseudo register), this patch refactors and
	reorganizes things in order to simplify handling of future pseudo registers.

	We keep track of the first pseudo register number in a group and the number of
	pseudo registers in that group.

	Right now we only have the S and Q pseudo registers.

2021-10-11  Luis Machado  <luis.machado@linaro.org>

	[ARM] Small refactoring of arm gdbarch initialization
	This is in preparation to MVE support, where we will define another
	pseudo register. We need to define the pseudo register numbers *after*
	accounting for all the registers in the XML description, so move
	the call to tdesc_use_registers up.

	If we don't do it, GDB's register count won't consider registers contained
	in the XML but ignored by GDB, throwing the register numbering off.

2021-10-11  Luis Machado  <luis.machado@linaro.org>

	[ARM] Refactor some constants
	In preparation for the MVE extension patch, this one refactors some of
	the register-related constants we have for ARM.

	Basically I'm separating counting constants from numbering constants.

	For example, ARM_A1_REGNUM is a numbering constant, whereas ARM_NUM_ARG_REGS
	is a counting constant.

2021-10-11  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAIL in gdb.mi/mi-var-child-f.exp
	When running test-case gdb.mi/mi-var-child-f.exp on openSUSE Tumbleweed
	(with glibc 2.34) I run into:
	...
	(gdb) ^M
	PASS: gdb.mi/mi-var-child-f.exp: mi runto prog_array
	Expecting: ^(-var-create array \* array[^M
	]+)?(\^done,name="array",numchild="[0-9]+",value=".*",type=.*,has_more="0"[^M
	]+[(]gdb[)] ^M
	[ ]*)
	-var-create array * array^M
	&"Attempt to use a type name as an expression.\n"^M
	^error,msg="-var-create: unable to create variable object"^M
	(gdb) ^M
	FAIL: gdb.mi/mi-var-child-f.exp: create local variable array (unexpected output)
	...

	The problem is that the name array is used both:
	- as the name for a local variable
	- as the name of a type in glibc, in file malloc/dynarray-skeleton.c, as included
	  by nss/nss_files/files-hosts.c.

	Fix this by ignoring the shared lib symbols.

	Likewise in a couple of other fortran tests.

	Tested on x86_64-linux.

2021-10-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	z80/disassembler: call memory_error_func when appropriate
	If a call to the read_memory_func fails then we should call the
	memory_error_func to notify the user of the disassembler of the
	address that was a problem.

	Without this GDB will report all memory errors as being at address
	0x0.

	opcodes/ChangeLog:

		* z80-dis.c (fetch_data): Call memory_error_func if the
		read_memory_func call fails.

2021-10-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	s12z/disassembler: call memory_error_func when appropriate
	If a call to the read_memory_func fails then we should call the
	memory_error_func to notify the user of the disassembler of the
	address that was a problem.

	Without this GDB will report all memory errors as being at address
	0x0.

	opcodes/ChangeLog:

		* s12z-disc.c (abstract_read_memory): Call memory_error_func if
		the read_memory_func call fails.

2021-10-11  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix double debug info in gdb.dwarf2/dw2-ref-missing-frame.exp
	A mistake slipped in in commit a5ea23036d8 "[gdb/testsuite] Use function_range
	in gdb.dwarf2/dw2-ref-missing-frame.exp".

	Before the commit the main file was compiled with debug info, and the two
	others not:
	...
	if {[prepare_for_testing_full "failed to prepare" \
	        [list $testfile {} $srcfile {} $srcfuncfile {} \
	             $srcmainfile debug]]} {
	...

	After the commit, all were compiled with debug info, and consequently, there
	are two versions of debug info for $srcfuncfile.  This shows up as a FAIL when
	running the test-case with target boards readnow and cc-with-debug-names.

	Fix this by using prepare_for_testing_full, as before.

	Tested on x86_64-linux.

	Fixes: a5ea23036d8 ("[gdb/testsuite] Use function_range in
	       gdb.dwarf2/dw2-ref-missing-frame.exp")

2021-10-11  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use require for ensure_gdb_index
	Replace:
	...
	if { [ensure_gdb_index $binfile] == -1 } {
	    return -1
	}
	...
	with:
	...
	require {ensure_gdb_index $binfile} != -1
	...
	and consequently, add a missing UNTESTED message.

	Tested on x86_64-linux, both with native and target board readnow.

2021-10-11  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle readnow in ensure_gdb_index
	When running test-case gdb.base/with-mf.exp with target board readnow, I run
	into:
	...
	FAIL: gdb.base/with-mf.exp: check if index present
	...
	This is since commit 6010fb0c49e "[gdb/testsuite] Fix full buffer in
	gdb.rust/dwindex.exp".

	Before that commit, the proc ensure_gdb_index would treat the line:
	...
	.gdb_index: faked for "readnow"^M
	...
	as proof that an index is already present (which is incorrect).

	Now, instead it generates aforementioned FAIL and continues to generate an
	index.

	Fix this by explicitly handling the readnow case in proc ensure_gdb_index,
	such that we bail out instead.

	Tested on x86_64-linux.

2021-10-11  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.dwarf2/gdb-add-index-symlink.exp
	The test-case gdb.dwarf2/gdb-add-index-symlink.exp interpretes a failure to
	add an index as a failure to add an index for a symlink:
	...
	if { [ensure_gdb_index $symlink] == -1 } {
	    fail "Unable to call gdb-add-index with a symlink to a symfile"
	    return -1
	}
	...

	However, it's possible that the gdb-add-index also fails with a regular
	file.  Add a check for that situation.

	Tested on x86_64-linux.

2021-10-11  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add proc require in lib/gdb.exp
	Add a new proc require in lib/gdb.exp, and use it to shorten:
	...
	if { [gdb_skip_xml_test] } {
	    # Valgrind gdbserver requires gdb with xml support.
	    untested "missing xml support"
	    return 0
	}
	...
	into:
	...
	require gdb_skip_xml_test 0
	...

	Tested on x86_64-linux, both with and without a trigger patch that forces
	gdb_skip_xml_test to return 1.

2021-10-11  Michael Forney  <mforney@mforney.org>

	bfd: Remove use of void pointer arithmetic
	This is not valid in ISO C. Instead, use a pointer to bfd_byte.

		* peicode.h (pe_bfd_object_p): Remove use of void pointer
		arithmetic.

2021-10-11  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-10  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-09  Tom de Vries  <tdevries@suse.de>

	[gdb] Make execute_command_to_string return string on throw
	The pattern for using execute_command_to_string is:
	...
	  std::string output;
	  output = execute_fn_to_string (fn, term_out);
	...

	This results in a problem when using it in a try/catch:
	...
	  try
	    {
	      output = execute_fn_to_string (fn, term_out)
	    }
	  catch (const gdb_exception &e)
	    {
	      /* Use output.  */
	    }
	...

	If an expection was thrown during execute_fn_to_string, then the output
	remains unassigned, while it could be worthwhile to known what output was
	generated by gdb before the expection was thrown.

	Fix this by returning the string using a parameter instead:
	...
	  execute_fn_to_string (output, fn, term_out)
	...

	Also add a variant without string parameter, to support places where the
	function is used while ignoring the result:
	...
	  execute_fn_to_string (fn, term_out)
	...

	Tested on x86_64-linux.

2021-10-09  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add check-readmore
	Consider the gdb output:
	...
	27        return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M
	(gdb) ^M
	Thread 2 "run-attach-whil" stopped.^M
	...

	When trying to match the gdb prompt using gdb_test which uses '$gdb_prompt $',
	it may pass or fail.

	This sort of thing needs to be fixed (see commit b0e2f96b56b), but there's
	currently no way to reliably find this type of FAILs.

	We have check-read1, but that one actually make the test pass reliably.

	We need something like the opposite of check-read1: something that makes
	expect read a bit slower, or more exhaustively.

	Add a new test target check-readmore that implements this.

	There are two methods of implementing this in read1.c:
	- the first method waits a bit before doing a read
	- the second method does a read and then decides whether to
	  return or to wait a bit and do another read, and so on.

	The second method is potentially faster, has less risc of timeout and could
	potentially detect more problems.  The first method has a simpler
	implementation.

	The second method is enabled by default.  The default waiting period is 10
	miliseconds.

	The first method can be enabled using:
	...
	$ export READMORE_METHOD=1
	...
	and the waiting period can be specified in miliseconds using:
	...
	$ export READMORE_SLEEP=9
	...

	Also a log file can be specified using:
	...
	$ export READMORE_LOG=$(pwd -P)/LOG
	...

	Tested on x86_64-linux.

	Testing with check-readmore showed these regressions:
	...
	FAIL: gdb.base/bp-cmds-continue-ctrl-c.exp: run: stop with control-c (continue)
	FAIL: gdb.base/bp-cmds-continue-ctrl-c.exp: attach: stop with control-c (continue)
	...

	I have not been able to find a problem in the test-case, and I think it's the
	nature of both the test-case and readmore that makes it run longer.  Make
	these pass by increasing the alarm timeout from 60 to 120 seconds.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27957

2021-10-09  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix fortran module tests with stressed cpu
	When running these test-cases:
	- gdb.fortran/info-modules.exp
	- gdb.fortran/module.exp
	- gdb.mi/mi-fortran-modules.exp
	in conjunction with:
	...
	$ stress -c $(($(cat /proc/cpuinfo | grep -c "^processor") + 1))
	...
	I run into timeouts.

	Fix this by using:
	- "set auto-solib-add off" to avoid symbols of shared libs
	  (which doesn't work for libc, now that libpthread_name_p has been
	  updated to  match libc)
	- "nosharedlibrary" to avoid symbols of libc

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28133

2021-10-09  Guillermo E. Martinez  <guillermo.e.martinez@oracle.com>

	PR28415, invalid read in xtensa_read_table_entries
		PR 28415
		PR 28416
		* elf32-xtensa.c (xtensa_read_table_entries): Handle error
		return from retrieve_contents.

2021-10-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-08  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/info-types-c++.exp with stressed cpu
	When running test-case gdb.base/info-types-c++.exp in conjunction with:
	...
	$ stress -c $(($(cat /proc/cpuinfo | grep -c "^processor") + 1))
	...
	we get:
	...
	FAIL: gdb.base/info-types-c++.exp: info types (timeout)
	...

	Fix this by setting auto-solib-add to off.

	Tested on x86_64-linux.

2021-10-08  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/info_sources_2.exp with check-read1
	When running test-case gdb.base/info_sources_2.exp with check-read1, I run
	into:
	...
	FAIL: gdb.base/info_sources_2.exp: args: : info sources  (timeout)
	...

	Fix this by consuming a "$src1, $src2, ..., $srcn: line bit by bit rather than
	as one whole line.

	Also add the missing handling of "Objfile has no debug information".

	Tested on x86_64-linux.

2021-10-08  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1
	When running test-case gdb.mi/gdb2549.exp with check-read1, I run into:
	...
	FAIL: gdb.mi/gdb2549.exp: register values x (timeout)
	...

	Fix this by applying the same fix as for "register values t" in commit
	478e490a4df "[gdb/testsuite] Fix gdb.mi/gdb2549.exp with check-read1".

	Tested on x86_64-linux.

2021-10-08  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/bt-on-error-and-warning.exp with check-read1
	When running test-case gdb.base/bt-on-error-and-warning.exp with check-read1,
	I run into:
	...
	(gdb) maint internal-error foobar^M
	src/gdb/maint.c:82: internal-error: foobar^M
	A problem internal to GDB has been detectedFAIL: \
	  gdb.base/bt-on-error-and-warning.exp: problem=internal-error, mode=on: \
	  scan for backtrace (GDB internal error)
	Resyncing due to internal error.
	,^M
	...

	The corresponding gdb_test_multiple in the test-case contains:
	...
	           -early -re "^A problem internal to GDB has been detected,\r\n" {
	               incr header_lines
	               exp_continue
	           }
	...
	but instead this one triggers in gdb_test_multiple:
	...
	        -re ".*A problem internal to GDB has been detected" {
	            fail "$message (GDB internal error)"
	            gdb_internal_error_resync
	            set result -1
	        }
	...

	Fix this by likewise shortening the regexp to before the comma.

	Tested on x86_64-linux.

2021-10-08  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add nopie in two test-cases
	When running test-case gdb.dwarf2/dw2-restrict.exp on openSUSE Leap 15.2 with
	gcc-PIE installed (switching compiler default to -fPIE/-pie), I get:
	...
	gdb compile failed, ld: outputs/gdb.dwarf2/dw2-restrict/dw2-restrict0.o: \
	  warning: relocation in read-only section `.text'
	ld: warning: creating DT_TEXTREL in a PIE
	UNTESTED: gdb.dwarf2/dw2-restrict.exp: failed to prepare
	...

	This is due to using a hardcoded .S file that was generated with -fno-PIE.

	Fix this by adding the missing nopie.

	Likewise in gdb.arch/amd64-tailcall-noret.exp.

	Tested on x86_64-linux.

2021-10-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.threads/check-libthread-db.exp with glibc 2.34
	When running test-case gdb.threads/check-libthread-db.exp on openSUSE
	Tumbleweed (with glibc 2.34) I get:
	...
	(gdb) continue^M
	Continuing.^M
	[Thread debugging using libthread_db enabled]^M
	Using host libthread_db library "/lib64/libthread_db.so.1".^M
	Stopped due to shared library event:^M
	  Inferior loaded /lib64/libm.so.6^M
	    /lib64/libc.so.6^M
	(gdb) FAIL: gdb.threads/check-libthread-db.exp: user-initiated check: continue
	...

	The check expect the inferior to load libpthread, but since glibc 2.34
	libpthread has been integrated into glibc, and consequently it's no longer
	a dependency:
	...
	$ ldd outputs/gdb.threads/check-libthread-db/check-libthread-db
	        linux-vdso.so.1 (0x00007ffe4cae4000)
	        libm.so.6 => /lib64/libm.so.6 (0x00007f167c77c000)
	        libc.so.6 => /lib64/libc.so.6 (0x00007f167c572000)
	        /lib64/ld-linux-x86-64.so.2 (0x00007f167c86e000)
	...

	Fix this by updating the regexp to expect libpthread or libc.

	Tested on x86_64-linux.

2021-10-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.guile/scm-type.exp with gcc 4.8
	With gcc 7.5.0, I get:
	...
	(gdb) guile (print (type-range (field-type (type-field (value-type \
	  (value-dereference f)) "items"))))^M
	= (0 0)^M
	(gdb) PASS: gdb.guile/scm-type.exp: lang_cpp: test_range: \
	  on flexible array member: $cmd
	...
	but with gcc 4.8.5, I get instead:
	...
	(gdb) guile (print (type-range (field-type (type-field (value-type \
	  (value-dereference f)) "items"))))^M
	= (0 -1)^M
	(gdb) FAIL: gdb.guile/scm-type.exp: lang_cpp: test_range: \
	  on flexible array member: $cmd
	...

	There's a difference in debug info.  With gcc 4.8.5, we have:
	...
	 <2><224>: Abbrev Number: 15 (DW_TAG_member)
	    <225>   DW_AT_name        : items
	    <22b>   DW_AT_type        : <0x231>
	 <1><231>: Abbrev Number: 4 (DW_TAG_array_type)
	    <232>   DW_AT_type        : <0x105>
	 <2><23a>: Abbrev Number: 16 (DW_TAG_subrange_type)
	    <23b>   DW_AT_type        : <0x11a>
	    <23f>   DW_AT_upper_bound : 0xffffffffffffffff
	...
	and with gcc 7.5.0, we have instead:
	...
	 <2><89f>: Abbrev Number: 12 (DW_TAG_member)
	    <8a0>   DW_AT_name        : items
	    <8a6>   DW_AT_type        : <0x8ac>
	 <1><8ac>: Abbrev Number: 17 (DW_TAG_array_type)
	    <8ad>   DW_AT_type        : <0x29d>
	 <2><8b5>: Abbrev Number: 41 (DW_TAG_subrange_type)
	 <2><8b6>: Abbrev Number: 0
	...

	As mentioned in commit 858c8f2c1b9 "gdb/testsuite: adjust
	gdb.python/flexible-array-member.exp expected pattern":
	...
	Ideally, GDB would present a consistent and documented value for an
	array member declared with size 0, regardless of how the debug info
	looks like.
	...

	As in gdb.python/flexible-array-member.exp, change the test to accept the two
	values.

	Tested on x86_64-linux.

2021-10-07  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add accessors for field (and call site) location
	Add accessors for the various location values in struct field.  This
	lets us assert that when we get a location value of a certain kind (say,
	bitpos), the field's location indeed contains a value of that kind.

	Remove the SET_FIELD_* macros, instead use the new setters directly.
	Update the FIELD_* macros used to access field locations to go through
	the getters.  They will be removed in a subsequent patch.

	There are places where the FIELD_* macros are used on call_site_target
	structures, because it contains members of the same name (loc_kind and
	loc).  For now, I have replicated the getters/setters in
	call_site_target.  But we could perhaps eventually factor them in a
	"location" structure that can be used at both places.

	Note that the field structure, being zero-initialized, defaults to a
	bitpos location with value 0.  While writing this patch, I tried to make
	it default to an "unset" location, to catch places where we would miss
	setting a field's location.  However, I found that some places relied on
	the default being "bitpos 0", so I left it as-is.  This change could
	always be done as follow-up work, making these places explicitly set the
	"bitpos 0" location.

	I found two issues to fix:

	 - I got some failures in the gdb.base/infcall-nested-structs-c++.exp
	   test.  They were caused by two functions in amd64-tdep.c using
	   TYPE_FIELD_BITPOS before checking if the location is of the bitpos
	   kind, which they do indirectly through `field_is_static`.  Simply
	   move getting the bitpos below the field_is_static call.

	 - I got a failure in gdb.xml/tdesc-regs.exp.  It turns out that in
	   make_gdb_type_enum, we set enum field values using SET_FIELD_BITPOS,
	   and later access them through FIELD_ENUMVAL.  Fix that by using
	   set_loc_enumval to set the value.

	Change-Id: I53d3734916c46457576ba11dd77df4049d2fc1e8

2021-10-07  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	RISC-V: Support aliases for Zbs instructions
	Add aliases for the non-immediate mnemonics of b{set,clr,inv,ext} to
	yencode the respective immediate insn b{set,clr,inv,ext}i when the
	second source operand is an immediate.

	2021-01-11  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	    gas/
		* testsuite/gas/riscv/b-ext.d: Add tests.
		* testsuite/gas/riscv/b-ext.s: Likewise.
		* testsuite/gas/riscv/b-ext-64.d: Likewise.
		* testsuite/gas/riscv/b-ext-64.s: Likewise.
	    opcodes/
	        * riscv-opc.c (riscv_opcodes): Add aliases for Zbs.

	Suggested-by: Jan Beulich <jbeulich@suse.com>

2021-10-07  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	RISC-V: Add support for Zbs instructions
	This change adds the Zbs instructions from the Zbs 1.0.0 specification.
	See
	  https://github.com/riscv/riscv-bitmanip/releases/tag/1.0.0
	for the frozen specification.

	2021-01-09  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	    bfd/
		* elfxx-riscv.c (riscv_supported_std_z_ext): Added zbs.
	    gas/
		* config/tc-riscv.c (riscv_multi_subset_supports): Handle INSN_CLASS_ZBS.
		* testsuite/gas/riscv/b-ext.d: Test Zbs instructions.
		* testsuite/gas/riscv/b-ext.s: Likewise.
		* testsuite/gas/riscv/b-ext-64.d: Likewise.
		* testsuite/gas/riscv/b-ext-64.s: Likewise.
	    include/
		* opcode/riscv-opc.h: Added MASK/MATCH/DECLARE_INSN for Zbs.
		* opcode/riscv.h (riscv_insn_class): Added INSN_CLASS_ZBS.
	    opcodes/
		* riscv-opc.c (riscv_supported_std_z_ext): Add zbs.

2021-10-07  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	RISC-V: Update extension version for Zb[abc] to 1.0.0
	2021-10-06  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	    bfd/
		* elfxx-riscv.c (riscv_supported_std_z_ext): Update the version
		number for zba, zbb and zbc to 1.0.0


	Version-changes: 3
	- Updated version numbers for zba, zbb and zbc to 1.0.0

2021-10-07  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	RISC-V: Split Zb[abc] into commented sections
	The Zb[abc] opcodes are bundled just below the Privileged opcodes in
	riscv_opcodes, possibly giving the appearance that they are part of
	the Privileged spec for an uninitiated reader.  This separates them
	out and adds comments above each section to clearly identify them as
	Zba, Zbb or Zbc opcodes.

	2021-10-04  Philipp Tomsich  <philipp.tomsich@vrull.eu>

	    opcodes/
		* riscv-opc.c: Split of Zb[abc] instructions and add comments.

2021-10-07  Alan Modra  <amodra@gmail.com>

	PR28423, use-after-free in objdump
	XCOFF archives use a bi-directional linked list for file members.  So
	one member points to both the previous member and the next member.
	Members may not be sequentially ordered in the file.  This of course
	is over-engineered nonsense and an attractive target for fuzzers.
	(There is even a free list of members!)  The testcase in PR28423 is an
	XCOFF archive with one member pointing to itself, which results in
	lots of bad behaviour.  For example, "ar t" never terminates.

	The use-after-free with "objdump -r" happens like this:  The first
	archive element is opened, its symbols are read and "canonicalized"
	for objdump, then relocations are read and printed.  Those relocations
	use the canonicalized symbols, and also happen to be cached by the
	coff bfd backend support.  objdump frees the symbols.  The next
	archive element is then opened.  This must be done before the first
	element is closed, because finding the next element uses data held in
	the currect element.  Unfortunately the next element happens to be the
	original, so we aren't opening, we're reopening a bfd which has cached
	data.  When the relocations are printed they use the cached copy
	containing references to the freed canonical symbols.

	This patch adds a little sanity checking to the XCOFF "open next
	archive file" support, so that it rejects archive members pointing at
	themselves.  That is sufficient to cure this problem.  Anything more
	is overkill.  If someone deliberately fuzzes an XCOFF archive with an
	element loop then reports an "ar" bug when it runs forever, they will
	find their bug report closed WONTFIX.

		PR 28423
		* coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Save size occupied
		by member name in areltdata.extra_size.
		(_bfd_xcoff_openr_next_archived_file): Sanity check nextoff.
		* coff64-rs6000.c (xcoff64_openr_next_archived_file): Call
		_bfd_xcoff_openr_next_archived_file.

2021-10-07  Alan Modra  <amodra@gmail.com>

	PR28422, build_id use-after-free
	This fixes a bug in commit 5d9bbb73c1df.  All fields preserved from a
	bfd in struct bfd_preserve need to be cleared in bfd_reinit.

		PR 28422
		* format.c (bfd_reinit): Clear build_id.

2021-10-07  Alan Modra  <amodra@gmail.com>

	Change ridiculous section size error
	Rather than reporting "memory exhausted", report "file truncated".
	You can hit this error on small fuzzed object files, or on files that
	are actually truncated.  In either case sizes can be such that an out
	of memory error is a little confusing.

		* compress.c (bfd_get_full_section_contents): Set
		bfd_error_file_truncated rather than bfd_error_no_memory when
		section size exceeds file size.

2021-10-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAIL in gdb.base/annota1.exp
	On openSUSE tumbleweed I run into:
	...
	FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout)
	...
	due to a message related to libthread_db:
	...
	^Z^Zstarting^M
	[Thread debugging using libthread_db enabled]^M
	Using host libthread_db library "/lib64/libthread_db.so.1".^M
	^M
	^Z^Zframes-invalid^M
	...
	which is not matched by the regexp.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

2021-10-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Refactor regexp in gdb.base/annota1.exp
	Refactor regexp in gdb.base/annota1.exp to reduce indentation and repetition.

	Tested on x86_64-linux.

2021-10-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-06  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/doc: improve 'show print elements' description
	The documentation for 'show print elements' contains the line:

	  If the number is 0, then the printing is unlimited.

	However, this line is now out of date as can be seen by this GDB
	session:

	  (gdb) set print elements 0
	  (gdb) show print elements
	  Limit on string chars or array elements to print is unlimited.

	The value 0 does indeed mean unlimited, and this is described in the
	'set print elements' section, however, for 'show print elements' the
	user will never see the value 0, so lets just remove that bit from the
	docs.

2021-10-06  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAIL in gdb.tui/corefile-run.exp
	When running test-case gdb.tui/corefile-run.exp on openSUSE Tumbleweed,
	I run into:
	...
	PASS: gdb.tui/corefile-run.exp: load corefile
	FAIL: gdb.tui/corefile-run.exp: run until the end
	...

	What's going on is easier to see when also doing dump_screen if
	check_contents passes, and inspecting state at the preceding PASS:
	...
	 +-------------------------------------------------------------------------+
	 exec No process In:                                           L??   PC: ??
	 [New LWP 16629]
	 [Thread debugging using libthread_db enabled]
	 Using host libthread_db library "/lib64/libthread_db.so.1".
	 Core was generated by `/data/gdb_versions/devel/build/gdb/testsuite/output
	 s/gdb.tui/corefile-run/corefi'.
	 Program terminated with signal SIGTRAP, Trace/breakpoint trap.
	 #0  main ()
	 --Type <RET> for more, q to quit, c to continue without paging--
	...

	The problem is that we're getting a pagination prompt, and the subsequent run
	command is interpreted as an answer to that prompt.

	Fix this by:
	- detecting the gdb prompt in response to "load corefile", such that
	  we detect the failure earlier, and
	- doing a "set pagination off" in Term::clean_restart.

	Tested on x86_64-linux.

2021-10-06  Alan Modra  <amodra@gmail.com>

	PR28420, ecoff fuzzing failures
		PR 28420
		* coff-mips.c (mips_adjust_reloc_in): Replace abort with error
		message and return.
		* ecoff.c (ecoff_slurp_reloc_table): Remove assertion and aborts,
		instead handle errors gracefully.

2021-10-06  Alan Modra  <amodra@gmail.com>

	PR28402, fail to allocate line number array
	This fixes a situation where the COFF code allocated memory for
	internal representaion arrays before reading the external file data.
	That meant the allocation didn't have any sanity check against file
	size.

		PR 28402
		* coffcode.h (buy_and_read): Malloc rather than alloc memory.
		(coff_slurp_line_table): Read native line number info before
		allocating memory for internal line number array.  Adjust error
		paths to suit.  Remove now unnecessary line number count check.
		(coff_slurp_reloc_table): Adjust to suit buy_and_read change.

2021-10-06  Alan Modra  <amodra@gmail.com>

	PR28403, null pointer dereference in disassemble_bytes
	Indexing of symbol and howto arrays wasn't checked in aout targets.

		PR 28403
		* aout-ns32k.c (MY (reloc_howto)): Sanity check howto_table index.
		Make r_index unsigned.
		(MY_swap_std_reloc_in): Make r_index unsigned.
		* aoutx.h (MOVE_ADDRESS): Sanity check symbol r_index.
		(aout_link_input_section_std): Make r_index unsigned.
		(aout_link_input_section_ext): Likewise.
		* i386lynx.c (MOVE_ADDRESS): Sanity check symbol r_index.
		(swap_ext_reloc_in, swap_std_reloc_in): Make r_index unsigned.
		* pdp11.c (MOVE_ADDRESS): Sanity check symbol r_index.

2021-10-06  Alan Modra  <amodra@gmail.com>

	PR28401, invalid section name lookup
	The PR28401 testcase has a section named "", ie. an empty string.
	This results in some silly behaviour in load_debug_section, and
	dump_dwarf_section.  Fix that.  Note that this patch doesn't correct
	the main complaint in PR28401, "failed to allocate", since malloc
	failures on sections having huge bogus sizes are to be expected.  We
	can't safely catch all such cases by comparing with file size, for
	example, where sections contain compressed data.

		PR 28401
		* objdump.c (load_debug_section): Don't attempt to retrieve
		empty name sections.
		(dump_dwarf_section): Likewise.

2021-10-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-06  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Make tui testing less verbose
	Currently, tui testing is rather verbose.  When using these RUNTESTFLAGS to
	pick up all tui tests (17 in total):
	...
	rtf=$(echo $(cd src/gdb/testsuite/; find gdb.* -type f -name *.exp* \
	  | xargs grep -l tuiterm_env) )
	...
	we have:
	...
	$ wc -l gdb.log
	120592 gdb.log
	...

	Most of the output is related to controlling the tui screen, but that does
	not give a top-level sense of how the test-case progresses.

	Put differently: a lot of bandwith is used to describe how we arrive at a
	certain tui screen state.  But we don't actually always show the state we
	arrive at, unless there's a FAIL.

	And if there's say, a PASS that should actually be FAILing, it's hard to
	detect.

	Fix this by:
	- dropping the -log on the call to verbose in _log.  We still can get the
	  same info back using runtest -v.
	- dumping the screen or box that we're checking, also when the test passes.

	Brings down verbosity to something more reasonable:
	...
	$ wc -l gdb.log
	3221 gdb.log
	...

	Tested on x86_64-linux.

2021-10-06  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add Term::dump_box in lib/tuiterm.exp
	Factor out new proc Term::get_region and use it to implement a
	new proc Term::dump_box, similar to Term::dump_screen.

	Tested on x86_64-linux.

2021-10-05  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: Remove deprecated assertion in setting::get
	The commit 702991711a91bd47b209289562843a11e7009396 (gdb: Have setter
	and getter callbacks for settings) makes it possible for a setting not
	to be backed by a memory buffer but use callback functions instead to
	retrieve or set the setting's value.

	An assertion was not properly updated to take into account that the
	m_var member (which points to a memory buffer, if used) might be nullptr
	if the setting uses callback functions.  If the setting is backed by a
	memory buffer, the m_var has to be non nullptr, which is already checked
	before the pointer is dereferenced.

	This commit removes this assertion as it is not valid anymore.

2021-10-05  Tom Tromey  <tromey@adacore.com>

	Remove 'varsize-limit'
	This makes the Ada-specific "varsize-limit" a synonym for
	"max-value-size", and removes the Ada-specific checks of the limit.

	I am not certain of the history here, but it seems to me that this
	code is fully obsolete now.  And, removing this makes it possible to
	index large Ada arrays without triggering an error.  A new test case
	is included to demonstrate this.

2021-10-05  Tom Tromey  <tromey@adacore.com>

	Allow lazy 'zero' value
	This changes value_zero to create a lazy value.  In many cases,
	value_zero is called in expression evaluation to wrap a type in a
	non-eval context.  It seems senseless to allocate a buffer in these
	cases.

	A new 'is_zero' flag is added so we can preserve the existing
	assertions in value_fetch_lazy.

	A subsequent patch will add a test where creating a zero value would
	fail, due to the variable size check.  However, the contents of this
	value are never needed, and so creating a lazy value avoids the error
	case.

2021-10-05  Tom Tromey  <tromey@adacore.com>

	Add lval_funcs::is_optimized_out
	This adds an is_optimized_out function pointer to lval_funcs, and
	changes value_optimized_out to call it.  This new function lets gdb
	determine if a value is optimized out without necessarily fetching the
	value.  This is needed for a subsequent patch, where an attempt to
	access a lazy value would fail due to the value size limit -- however,
	the access was only needed to determine the optimized-out state.

2021-10-05  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAIL in gdb.mi/mi-nsmoribund.exp
	Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
	mi_gdb_test" we run into:
	...
	PASS: gdb.mi/mi-nsmoribund.exp: print done = 1
	Expecting: ^(.*[^M
	]+)?([^
	]*^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"^M
	\*running,thread-id="[0-9]+"[^M
	]+[(]gdb[)] ^M
	[ ]*)
	103-exec-continue --all^M
	=library-loaded,id="/lib64/libgcc_s.so.1",target-name="/lib64/libgcc_s.so.1",\
	  host-name="/lib64/libgcc_s.so.1",symbols-loaded="0",thread-group="i1",\
	  ranges=[{from="0x00007ffff22a5010",to="0x00007ffff22b6365"}]^M
	103^running^M
	*running,thread-id="5"^M
	(gdb) ^M
	FAIL: gdb.mi/mi-nsmoribund.exp: 103-exec-continue --all (unexpected output)
	...

	The regexp expect running messages for all threads, but we only get one for
	thread 5.

	The test-case uses non-stop mode, and when the exec-continue --all command is
	issued, thread 5 is stopped and all other threads are running.  Consequently,
	only thread 5 is resumed, and reported as running.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

2021-10-05  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: fix memory leak in python inferior code
	When a user creates a gdb.Inferior object for the first time a new
	Python object is created.  This object is then cached within GDB's
	inferior object using the registry mechanism (see
	inferior_to_inferior_object in py-inferior.c, specifically the calls
	to inferior_data and set_inferior_data).

	The Python Reference to the gdb.Inferior object held within the real
	inferior object ensures that the reference count on the Python
	gdb.Inferior object never reaches zero while the GDB inferior object
	continues to exist.

	At the same time, the gdb.Inferior object maintains a C++ pointer back
	to GDB's real inferior object.  We therefore end up with a system that
	looks like this:

	                   Python Reference
	                         |
	                         |
	    .----------.         |          .--------------.
	    |          |------------------->|              |
	    | inferior |                    | gdb.Inferior |
	    |          |<-------------------|              |
	    '----------'         |          '--------------'
	                         |
	                         |
	                    C++ Pointer

	When GDB's inferior object is deleted (say the inferior exits) then
	py_free_inferior is called (thanks to the registry system), this
	function looks up the Python gdb.Inferior object and sets the C++
	pointer to nullptr and finally reduces the reference count on the
	Python gdb.Inferior object.

	If at this point the user still holds a reference to the Python
	gdb.Inferior object then nothing happens.  However, the gdb.Inferior
	object is now in the non-valid state (see infpy_is_valid in
	py-inferior.c), but otherwise, everything is fine.

	However, if there are no further references to the Python gdb.Inferior
	object, or, once the user has given up all their references to the
	gdb.Inferior object, then infpy_dealloc is called.

	This function currently checks to see if the inferior pointer within
	the gdb.Inferior object is nullptr or not.  If the pointer is nullptr
	then infpy_dealloc immediately returns.

	Only when the inferior point in the gdb.Inferior is not nullptr do
	we (a) set the gdb.Inferior reference inside GDB's inferior to
	nullptr, and (b) call the underlying Python tp_free function.

	There are a number things wrong here:

	  1.  The Python gdb.Inferior reference within GDB's inferior object
	  holds a reference count, thus, setting this reference to nullptr
	  without first decrementing the reference count would leak a
	  reference, however...

	  2. As GDB's inferior holds a reference then infpy_dealloc will never
	  be called until GDB's inferior object is deleted.  Deleting a GDB
	  inferior ohject calls py_free_inferior, and so gives up the
	  reference.  At this point there is no longer a need to call
	  set_inferior_data to set the field back to NULL, that field must
	  have been cleared in order to get the reference count to zero, which
	  means...

	  3. If we know that py_free_inferior must be called before
	  infpy_dealloc, then we know that the inferior pointer in
	  gdb.Inferior will always be nullptr when infpy_dealloc is called,
	  this means that the call to the underlying tp_free function will
	  always be skipped.  Skipping this call will cause Python to leak the
	  memory associated with the gdb.Inferior object, which is what we
	  currently always do.

	Given all of the above, I assert that the C++ pointer within
	gdb.Inferior will always be nullptr when infpy_dealloc is called.
	That's what this patch does.

	I wrote a test for this issue making use of Pythons tracemalloc
	module, which allows us to spot this memory leak.

2021-10-05  Bhuvanendra Kumar N  <Bhuvanendra.KumarN@amd.com>

	[gdb/testsuite] Use function_range in gdb.dwarf2/dw2-ref-missing-frame.exp
	Following 2 test points are failing with clang compiler

	(gdb) FAIL: gdb.dwarf2/dw2-ref-missing-frame.exp: func_nofb print
	(gdb) FAIL: gdb.dwarf2/dw2-ref-missing-frame.exp: func_loopfb print

	As in commit f677852bbda "[gdb/testsuite] Use function_range in
	gdb.dwarf2/dw2-abs-hi-pc.exp", the problem is that the CU and functions
	have an empty address range, due to using asm labels in global scope,
	which is a known source of problems, as explained in the comment of proc
	function_range in gdb/testsuite/lib/dwarf.exp.  Hence fix this also by
	using function_range.

	Tested on x86_64-linux with gcc and clang.

2021-10-05  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: add a new gdb_exiting event
	Add a new event, gdb.events.gdb_exiting, which is called once GDB
	decides it is going to exit.

	This event is not triggered in the case that GDB performs a hard
	abort, for example, when handling an internal error and the user
	decides to quit the debug session, or if GDB hits an unexpected,
	fatal, signal.

	This event is triggered if the user just types 'quit' at the command
	prompt, or if GDB is run with '-batch' and has processed all of the
	required commands.

	The new event type is gdb.GdbExitingEvent, and it has a single
	attribute exit_code, which is the value that GDB is about to exit
	with.

	The event is triggered before GDB starts dismantling any of its own
	internal state, so, my expectation is that most Python calls should
	work just fine at this point.

	When considering this functionality I wondered about using the
	'atexit' Python module.  However, this is triggered when the Python
	environment is shut down, which is done from a final cleanup.  At
	this point we don't know for sure what other GDB state has already
	been cleaned up.

2021-10-05  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: update events test to handle missing exit_code
	The test gdb.python/py-events.exp sets up a handler for the gdb.exited
	event.  Unfortunately the handler is slightly broken, it assumes that
	the exit_code attribute will always be present.  This is not always
	the case.

	In a later commit I am going to add more tests to py-events.exp test
	script, and in so doing I expose the bug in our handling of gdb.exited
	events.

	Just to be clear, GDB itself is fine, it is the test that is not
	written correctly according to the Python Events API.

	So, in this commit I fix the Python code in the test, and extend the
	test case to exercise more paths through the Python code.

	Additionally, I noticed that the gdb.exited event is used as an
	example in the documentation for how to write an event handler.
	Unfortunately the same bug that we had in our test was also present in
	the example code in the manual.

	So I've fixed that too.

	After this commit there is no functional change to GDB.

2021-10-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-04  Tom Tromey  <tromey@adacore.com>

	Use unique_xmalloc_ptr<char> when demangling
	I noticed that some methods in language_defn could use
	unique_xmalloc_ptr<char> rather than a plain 'char *'.  This patch
	implements this change, fixing up the fallout and changing
	gdb_demangle to also return this type.  In one spot, std::string is
	used to simplify some related code, and in another, an auto_obstack is
	used to avoid manual management.

	Regression tested on x86-64 Fedora 34.

2021-10-04  Tom Tromey  <tromey@adacore.com>

	Minor boolean fix in windows-nat.c
	I noticed a spot in windows-nat.c that used '1' rather than the more
	appropriate 'true'.  This patch fixes it.

2021-10-04  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Add CXX_DIALECT to CXX
	Say we use a gcc version that (while supporting c++11) does not support c++11
	by default, and needs an -std setting to enable it.

	If gdb would use the default AX_CXX_COMPILE_STDCXX from autoconf-archive, then
	we'd have:
	...
	CXX="g++ -std=gnu++11"
	...

	That mechanism however has the following problem (quoting from commit
	0bcda685399):
	...
	the top level Makefile passes CXX down to subdirs, and that overrides whatever
	gdb/Makefile may set CXX to.  The result would be that a make invocation from
	the build/gdb/ directory would use "g++ -std=gnu++11" as expected, while a
	make invocation at the top level would not.
	...

	Commit 0bcda685399 fixes this by using a custom AX_CXX_COMPILE_STDCXX which
	does:
	...
	CXX=g++
	CXX_DIALECT=-std=gnu++11
	...

	The problem reported in PR28318 is that using the custom instead of the
	default AX_CXX_COMPILE_STDCXX makes the configure test for std::thread
	support fail.

	We could simply add $CXX_DIALECT to the test for std::thread support, but
	that would have to be repeated for each added c++ support test.

	Instead, fix this by doing:
	...
	CXX="g++ -std=gnu++11"
	CXX_DIALECT=-std=gnu++11
	...

	This is somewhat awkward, since it results in -std=gnu++11 occuring twice in
	some situations:
	...
	$ touch src/gdb/dwarf2/read.c
	$ ( cd build/gdb; make V=1 dwarf2/read.o )
	g++-4.8 -std=gnu++11 -x c++ -std=gnu++11 ...
	...

	However, both settings are needed:
	 - the switch in CXX for the std::thread tests (and other tests)
	 - the switch in CXX_DIALECT so it can be appended in Makefiles, to
	   counteract the fact that the top-level Makefile overrides CXX

	The code added in gdb/ax_cxx_compile_stdcxx.m4 is copied from the default
	AX_CXX_COMPILE_STDCXX from autoconf-archive.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28318

2021-10-04  Simon Marchi  <simon.marchi@polymtl.ca>

	[gdb/symtab] Use unrelocated addresses in call_site
	Consider test-case gdb.trace/entry-values.exp with target board
	unix/-fPIE/-pie.

	Using this command we have an abbreviated version, and can see the correct
	@entry values for foo:
	...
	$ gdb -q -batch outputs/gdb.trace/entry-values/entry-values \
	  -ex start \
	  -ex "break foo" \
	  -ex "set print entry-values both" \
	  -ex continue
	Temporary breakpoint 1 at 0x679

	Temporary breakpoint 1, 0x0000555555554679 in main ()
	Breakpoint 2 at 0x55555555463e

	Breakpoint 2, 0x000055555555463e in foo (i=0, i@entry=2, j=2, j@entry=3)
	...

	Now, let's try the same again, but run directly to foo rather than stopping at
	main:
	...
	$ gdb -q -batch outputs/gdb.trace/entry-values/entry-values \
	  -ex "break foo" \
	  -ex "set print entry-values both" \
	  -ex run
	Breakpoint 1 at 0x63e

	Breakpoint 1, 0x000055555555463e in foo (i=0, i@entry=<optimized out>, \
	  j=2, j@entry=<optimized out>)
	...

	So, what explains the difference?  Noteworthy, this is a dwarf assembly
	test-case, with debug info for foo and bar, but not for main.

	In the first case:
	- we run to main
	- this does not trigger expanding debug info, because there's none for main
	- we set a breakpoint at foo
	- this triggers expanding debug info.  Relocated addresses are used in
	  call_site info (because the exec is started)
	- we continue to foo, and manage to find the call_site info

	In the second case:
	- we set a breakpoint at foo
	- this triggers expanding debug info.  Unrelocated addresses are used in
	  call_site info (because the exec is not started)
	- we run to foo
	- this triggers objfile_relocate1, but it doesn't update the call_site
	  info addresses
	- we don't manage to find the call_site info

	We could fix this by adding the missing call_site relocation in
	objfile_relocate1.

	This solution however is counter-trend in the sense that we're trying to
	work towards the situation where when starting two instances of an executable,
	we need only one instance of debug information, implying the use of
	unrelocated addresses.

	So, fix this instead by using unrelocated addresses in call_site info.

	Tested on x86_64-linux.

	This fixes all remaining unix/-fno-PIE/-no-pie vs unix/-fPIE/-pie
	regressions, like f.i. PR24892.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24892

	Co-Authored-By: Tom de Vries <tdevries@suse.de>

2021-10-04  Simon Marchi  <simon.marchi@polymtl.ca>

	[gdb/symtab] C++-ify call_site
	- add constructor
	- add member function call_site::pc ()

	Tested on x86_64-linux.

	Co-Authored-By: Tom de Vries <tdevries@suse.de>

2021-10-04  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Add call_site_eq and call_site_hash
	In commit b4c919f7525 "[gdb/symtab] Fix htab_find_slot call in
	read_call_site_scope" , I removed the comment:
	...
	It must be the first field as we overload core_addr_hash and core_addr_eq for
	it.
	...
	for field pc of struct call_site.

	However, this was not tested, and when indeed moving field pc to the second
	location, we run into a testsuite failure in gdb.trace/entry-values.exp.

	This is caused by core_addr_eq (the eq_f function for the htab) being
	called with a pointer to the pc field (as passed into htab_find_slot) and a
	pointer to a hash table element.  Now that pc is no longer the first field,
	the pointer to hash table element no longer points to the pc field.

	This could be fixed by simply reinstating the comment, but we're trying to
	get rid of this kind of tricks that make refactoring more difficult.

	Instead, fix this by:
	- reverting commit b4c919f7525, apart from the comment removal, such that
	  we're passing a pointer to element to htab_find_slot
	- updating the htab_find_slot call in compunit_symtab::find_call_site
	  in a similar manner
	- adding a call_site_eq and call_site_hash, and using these in the hash table
	  instead of core_addr_eq and core_addr_hash.

	Tested on x86_64-linux, both with and without a trigger patch that moves pc to
	the second location in struct call_site.

2021-10-04  Tom Tromey  <tromey@adacore.com>

	Fix remote-sim.c compilation
	The change "make string-like set show commands use std::string
	variable" caused remote-sim.c to fail to build.  The issue is that the
	code does:

	  const std::string &sysroot = gdb_sysroot;
	  if (is_target_filename (sysroot))
	    sysroot += strlen (TARGET_SYSROOT_PREFIX);

	... which isn't valid.

	This patch changes this code to use a 'const char *' again, fixing the
	build.

2021-10-04  Bruno Larsen  <blarsen@redhat.com>

	[gdb/testsuite] update analyze-racy-logs.py to python3
	Since python 2 is no longer supported on most distributions, update the
	script to run under python while while still being runnable under
	python2.

2021-10-04  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdbsupport: remove attempt to define TARGET_WORD_SIZE
	In the gdbsupport configure.ac file, there is an attempt to define
	TARGET_WORD_SIZE.  This is done by running grep on the file
	../bfd/bfd-in3.h.

	The problem with this is, the file bfd-in3.h is generated into the bfd
	build directory when bfd is configured, and there is no dependency
	between the gdbsupport module and the bfd module, so, for example, if
	I do:

	  $ ../src/configure
	  $ make all-gdbsupport

	Then bfd will neither be configured, or built.  In this case
	TARGET_WORD_SIZE ends up being defined, but with no value because the
	grep on bfd-in3.h fails.

	However, it turns out that this doesn't matter; we don't actually use
	TARGET_WORD_SIZE anywhere.

	My proposal in this commit is to just remove the definition of
	TARGET_WORD_SIZE, the alternative would be to add a dependency between
	configure-gdbsupport and configure-bfd into Makefile.def, but adding a
	dependency for something we don't need seems pretty pointless.

2021-10-04  Mike Frysinger  <vapier@gentoo.org>

	sim: add --info-target for listing supported BFD targets
	It can be difficult to guess the exact bfd name, so add an option to
	list all the targets that the current build supports.  This aligns with
	other simulator options like --info-architecture.

2021-10-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-03  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: Setting setter return a bool to tell if the value changed
	GDB can notify observers when a parameter is changed.

	To do that, do_set_command (in gdb/cli/cli-setshow.c) compares the new
	value against the old one before updating it, and based on that notifies
	observers.  This looks like something like:

	    int valuechanged = 0;
	    switch (cmd->var.type ())
	    {
	    case var_integer:
	      {
	        LONGEST new_val = parse_and_eval_long (arg)
	        if (new_val != cmd->var.get<int> ())
	        {
	          cmd->var.get<int> (new_val);
	          value_changes = 1;
	        }
	      }
	    case var_uinteger:
	    case var_zuinteger:
	      {
	        unsigned int val
	          = parse_cli_var_uinteger (c->var->type (), &arg, true);
	        if (c->var->get<unsigned int> () != val)
	          {
	            c->var->set<unsigned int> (val);
	            option_changed = true;
	          }
	      }
	    case...
	      /* And so on for all possible var_types.  */
	    }

	This comparison is done for each possible var_type, which leads to
	unnecessary logic duplication.

	In this patch I propose to move all those checks in one place within the
	setting setter method.  This limits the code duplication and simplifies
	the do_set_command implementation.

	This patch also changes slightly the way a value change is detected.
	Instead of comparing the user provided value against the current value
	of the setting, we compare the value of the setting before and after the
	set operation.  This is meant to handle edge cases where trying to set
	an unrecognized value would be equivalent to a noop (the actual value
	remains unchanged).  Doing this requires that the original value needs
	to be copied before the update, which can be non trivial for
	std::string.

	There should be no user visible change introduced by this commit.

	Tested on x86_64 GNU/Linux.

	[1] https://review.lttng.org/c/binutils-gdb/+/5831/41

	Change-Id: If064b9cede3eb56275aacd2b286f74eceb1aed11

2021-10-03  Lancelot SIX  <lsix@lancelotsix.com>
	    Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: Have setter and getter callbacks for settings
	The main motivation behind this improvement is to help the
	implementation of a patch Simon Marchi is preparing to fix a bug when
	MI or Python try to access parameters that are inferior dependent (see
	PR/28085).

	This commit extends the previous ones, which introduces the setting
	object to represent a static variable whose value can be set or shown
	with the appropriate commands.  This patch proposes that a setting can
	either contain a pointer to a static variable holding a setting, or
	pointers to a pair of setter and getter callback functions.

	The callbacks functions can be used to retrieve or change the value with
	custom logic.  This is useful when the source of truth for a given
	setting is not contained in the variable pointed to by the setting
	instance.

	Given that the callback function call is hidden within the setting
	abstraction introduced earlier, none of the sites accessing the setting
	needs to be updated.  The registered getter or setter is used whatever
	the way to access it is (through MI, Python, Guile, the "with" command
	and the $_gdb_setting / $_gdb_setting_str convenience functions).

	All the add_setshow_*_cmd are given a new overload that will accept the
	pair of function pointers (set / get functions) instead of the pointer
	to a global variable.

	Tested on GNU/Linux x86_64 with no regression observed.

	Change-Id: Ieb81fef57550632ff66e6aa85f637372a226be8c

2021-10-03  Simon Marchi  <simon.marchi@efficios.com>
	    Lancelot SIX  <lsix@lancelotsix.com>

	gdb: make string-like set show commands use std::string variable
	String-like settings (var_string, var_filename, var_optional_filename,
	var_string_noescape) currently take a pointer to a `char *` storage
	variable (typically global) that holds the setting's value.  I'd like to
	"mordernize" this by changing them to use an std::string for storage.

	An obvious reason is that string operations on std::string are often
	easier to write than with C strings.  And they avoid having to do any
	manual memory management.

	Another interesting reason is that, with `char *`, nullptr and an empty
	string often both have the same meaning of "no value".  String settings
	are initially nullptr (unless initialized otherwise).  But when doing
	"set foo" (where `foo` is a string setting), the setting now points to
	an empty string.  For example, solib_search_path is nullptr at startup,
	but points to an empty string after doing "set solib-search-path".  This
	leads to some code that needs to check for both to check for "no value".
	Or some code that converts back and forth between NULL and "" when
	getting or setting the value.  I find this very error-prone, because it
	is very easy to forget one or the other.  With std::string, we at least
	know that the variable is not "NULL".  There is only one way of
	representing an empty string setting, that is with an empty string.

	I was wondering whether the distinction between NULL and "" would be
	important for some setting, but it doesn't seem so.  If that ever
	happens, it would be more C++-y and self-descriptive to use
	optional<string> anyway.

	Actually, there's one spot where this distinction mattered, it's in
	init_history, for the test gdb.base/gdbinit-history.exp.  init_history
	sets the history filename to the default ".gdb_history" if it sees that
	the setting was never set - if history_filename is nullptr.  If
	history_filename is an empty string, it means the setting was explicitly
	cleared, so it leaves it as-is.  With the change to std::string, this
	distinction doesn't exist anymore.  This can be fixed by moving the code
	that chooses a good default value for history_filename to
	_initialize_top.  This is ran before -ex commands are processed, so an
	-ex command can then clear that value if needed (what
	gdb.base/gdbinit-history.exp tests).

	Another small improvement, in my opinion is that we can now easily
	give string parameters initial values, by simply initializing the global
	variables, instead of xstrdup-ing it in the _initialize function.

	In Python and Guile, when registering a string-like parameter, we
	allocate (with new) an std::string that is owned by the param_smob (in
	Guile) and the parmpy_object (in Python) objects.

	This patch started by changing all relevant add_setshow_* commands to
	take an `std::string *` instead of a `char **` and fixing everything
	that failed to build.  That includes of course all string setting
	variable and their uses.

	string_option_def now uses an std::string also, because there's a
	connection between options and settings (see
	add_setshow_cmds_for_options).

	The add_path function in source.c is really complex and twisted, I'd
	rather not try to change it to work on an std::string right now.
	Instead, I added an overload that copies the std:string to a `char *`
	and back.  This means more copying, but this is not used in a hot path
	at all, so I think it is acceptable.

	Change-Id: I92c50a1bdd8307141cdbacb388248e4e4fc08c93

2021-10-03  Lancelot SIX  <lsix@lancelotsix.com>
	    Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: Introduce setting construct within cmd_list_element
	cmd_list_element can contain a pointer to data that can be set and / or
	shown.  This is achieved with the void* VAR member which points to the
	data that can be accessed, while the VAR_TYPE member (of type enum
	var_types) indicates how to interpret the data pointed to.

	With this pattern, the user of the cmd_list_element needs to know what
	is the storage type associated with a given VAR_TYPES in order to do
	the proper casting.  No automatic safeguard is available to prevent
	miss-use of the pointer.  Client code typically looks something like:

		switch (c->var_type)
		{
		  case var_zuinteger:
		    unsigned int v = *(unsigned int*) c->var;
		    ...
		    break;
		  case var_boolean:
		    bool v = *(bool *) c->var;
		    ...
		    break;
		  ...
		}

	This patch proposes to add an abstraction around the var_types and void*
	pointer pair.  The abstraction is meant to prevent the user from having
	to handle the cast and verify that the data is read or written as a type
	that is coherent with the setting's var_type.  This is achieved by
	introducing the struct setting which exposes a set of templated get /
	set member functions.  The template parameter is the type of the
	variable that holds the referred variable.

	Using those accessors allows runtime checks to be inserted in order to
	ensure that the data pointed to has the expected type.  For example,
	instantiating the member functions with bool will yield something
	similar to:

		const bool &get<bool> () const
		{
		  gdb_assert (m_var_type == var_boolean);
		  gdb_assert (m_var != nullptr);
		  return *static_cast<bool *> (m_var);
		}
		void set<bool> (const bool &var)
		{
		  gdb_assert (m_var_type == var_boolean);
		  gdb_assert (m_var != nullptr);
		  *static_cast<bool *> (m_var) = var;
		}

	Using the new abstraction, our initial example becomes:

		switch (c->var_type)
		{
		  case var_zuinteger:
		    unsigned int v = c->var->get<unsigned int> ();
		    ...
		    break;
		  case var_boolean:
		    bool v = c->var->get<bool> ();
		    ...
		    break;
		  ...
		}

	While the call site is still similar, the introduction of runtime checks
	help ensure correct usage of the data.

	In order to avoid turning the bulk of add_setshow_cmd_full into a
	templated function, and following a suggestion from Pedro Alves, a
	setting can be constructed from a pre validated type erased reference to
	a variable.  This is what setting::erased_args is used for.

	Introducing an opaque abstraction to describe a setting will also make
	it possible to use callbacks to retrieve or set the value of the setting
	on the fly instead of pointing to a static chunk of memory.  This will
	be done added in a later commit.

	Given that a cmd_list_element may or may not reference a setting, the
	VAR and VAR_TYPES members of the struct are replaced with a
	gdb::optional<setting> named VAR.

	Few internal function signatures have been modified to take into account
	this new abstraction:

	-The functions value_from_setting, str_value_from_setting and
	 get_setshow_command_value_string used to have a 'cmd_list_element *'
	 parameter but only used it for the VAR and VAR_TYPE member. They now
	 take a 'const setting &' parameter instead.
	- Similarly, the 'void *' and a 'enum var_types' parameters of
	  pascm_param_value and gdbpy_parameter_value have been replaced with a
	  'const setting &' parameter.

	No user visible change is expected after this patch.

	Tested on GNU/Linux x86_64, with no regression noticed.

	Change-Id: Ie1d08c3ceb8b30b3d7bf1efe036eb8acffcd2f34

2021-10-03  Mike Frysinger  <vapier@gentoo.org>

	sim: filter out SIGSTKSZ [PR sim/28302]
	We map target signals to host signals so we can propagate signals
	between the host & simulated worlds.  That means we need to know
	the symbolic names & values of all signals that might be sent.

	The tools that generate that list use signal.h and include all
	symbols that start with "SIG" so as to automatically include any
	new symbols that the C library might add.  Unfortunately, this
	also picks up "SIGSTKSZ" which is not actually a signal itself,
	but a signal related setting -- it's the size of the stack when
	a signal is handled.

	By itself this doesn't super matter as we will never see a signal
	with that same value (since the range of valid signals tend to be
	way less than 1024, and the size of the default signal stack will
	never be that small).  But with recent glibc changes that make this
	into a dynamic value instead of a compile-time constant, some users
	see build failures when building the sim.

	As suggested by Adam Sampson, update our scripts to ignore this
	symbol to simplify everything and avoid the build failure.

	Bug: https://sourceware.org/PR28302

2021-10-03  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: fallback when ln is not available [PR sim/18864]
	Not all systems have easy access to hard links or symlinks, so add
	fallback logic to the run->psim build code to handle those.

	Bug: https://sourceware.org/PR18864

2021-10-03  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: Fix comment in riscv_scan_prologue
	I found an inaccurate comment in riscv_scan_prologue.  This commit fixes
	it.

2021-10-03  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: Support the c.mv insn in the riscv prologue scanner.
	While working on other problems, I encountered situations where GDB
	fails to properly unwind the stack because some functions use the C.MV
	instruction in the prologue.  The prologue scanner stops when it hits
	this instruction assuming its job is done at this point.  Unfortunately
	the prologue is not necessarily finished yet, preventing GDB to properly
	unwind.

	This commit adds support for handling such instruction in
	riscv_scan_prologue.

	Note that C.MV is part of the compressed instruction set.  The MV
	counterpart from the base ISA is a pseudo instruction that expands to
	'ADDI RD,RS1,0' which is already supported.

	Tested on riscv64-linux-gnu.

	All feedback are welcome.

2021-10-03  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-02  Simon Marchi  <simon.marchi@polymtl.ca>

	[gdb/symtab] Remove COMPUNIT_CALL_SITE_HTAB
	Remove macro COMPUNIT_CALL_SITE_HTAB, and provide access to the htab using
	member functions:
	- compunit_symtab::find_call_site
	- compunit_symtab::set_call_site_htab

	Tested on x86_64-linux.

	Co-Authored-By: Tom de Vries <tdevries@suse.de>

2021-10-02  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/python: fix a few flake8 warnings
	Fix these rather obvious warnings reported by flake8:

	    ./lib/gdb/FrameIterator.py:16:1: F401 'gdb' imported but unused
	    ./lib/gdb/FrameIterator.py:17:1: F401 'itertools' imported but unused
	    ./lib/gdb/command/prompt.py:55:26: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
	    ./lib/gdb/command/explore.py:526:9: F841 local variable 'has_explorable_fields' is assigned to but never used
	    ./lib/gdb/command/explore.py:697:56: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
	    ./lib/gdb/command/explore.py:736:62: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
	    ./lib/gdb/command/explore.py:767:61: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
	    ./lib/gdb/command/frame_filters.py:21:1: F401 'copy' imported but unused
	    ./lib/gdb/command/frame_filters.py:22:1: F401 'gdb.FrameIterator.FrameIterator' imported but unused
	    ./lib/gdb/command/frame_filters.py:23:1: F401 'gdb.FrameDecorator.FrameDecorator' imported but unused
	    ./lib/gdb/command/frame_filters.py:25:1: F401 'itertools' imported but unused
	    ./lib/gdb/command/frame_filters.py:179:17: E712 comparison to True should be 'if cond is True:' or 'if cond:'

	Change-Id: I4f49c0cb430359ee872222600c61d9c5283b09ab

2021-10-02  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-10-01  Luis Machado  <luis.machado@linaro.org>

	Fix build failure for 32-bit targets
	When building master GDB, I ran into the following:

	binutils-gdb/gdb/bt-utils.c: In function 'int libbacktrace_print(void*, uintptr_t, const char*, int, const char*)':
	binutils-gdb/gdb/bt-utils.c:93:44: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'uintptr_t {aka unsigned int}' [-Werror=format=]
	   snprintf (buf, sizeof (buf), "0x%lx ", pc);

	Fix this by using %PRIxPTR as opposed to %lx.

2021-10-01  Nick Clifton  <nickc@redhat.com>

	Fix mistake in RX assembler documentation (special section names)

2021-10-01  Simon Marchi  <simon.marchi@polymtl.ca>

	[gdb/symtab] Fix htab_find_slot call in read_call_site_scope
	In read_call_site_scope we have:
	...
	  call_site_local.pc = pc;
	  slot = htab_find_slot (cu->call_site_htab, &call_site_local, INSERT);
	...

	The call passes a call_site pointer as element.  OTOH, the hashtab is created
	using hash_f == core_addr_hash and eq_f == core_addr_eq, so the element
	will be accessed through a CORE_ADDR pointer.

	This is not wrong (at least in C), given that pc is the first field in
	call_site.

	Nevertheless, as in call_site_for_pc, make the htab_find_slot call match the
	used hash_f and eq_f by using &pc instead:
	...
	  slot = htab_find_slot (cu->call_site_htab, &pc, INSERT);
	...

	Tested on x86_64-linux.

	Co-Authored-By: Tom de Vries <tdevries@suse.de>

2021-10-01  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH bfd: Fix linker warning for recently introduced arm attributes
	2021-09-27  Andrea Corallo  <andrea.corallo@arm.com>

		* elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Update value to cover
		'Tag_BTI_use' and 'Tag_PACRET_use'.

2021-10-01  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite/dwarf: use options for rnglists/loclists procs
	Change how rnglists and loclists procs to align them with how procs for
	aranges (and other things in the DWARF assembler) work.  Instead of
	using "args" (variable number of parameters in TCL) and command-line
	style option arguments, use one leading "option" parameters, used as a
	kind of key/value dictionary of options parsed using `parse_options`.

	Change-Id: I63e60d17ae16a020ce4d6de44baf3d152ea42a1a

2021-10-01  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite/dwarf: don't define nested procs for rnglists/loclists
	When I wrote support for rnglists and loclists in the testsuite's DWARF
	assembler, I made it with nested procs, for example proc "table" inside
	proc "rnglists".  The intention was that this proc "table" could only be
	used by the user while inside proc "rnglists"'s body.  I had chosen very
	simple names, thinking there was no chance of name clashes.  I recently
	learned that this is not how TCL works.  This ends up defining a proc
	"table" in the current namespace ("Dwarf" in this case).

	Things still work if you generate rnglists and loclists in the same
	file, as each redefines its own procedures when executing.  But if a
	user of the assembler happened to define a convenience "table" or
	"start_end" procedure, for example, it would get overriden.

	I'd like to change how this works to reduce the chances of a name clash.

	 - Move the procs out of each other, so they are not defined in a nested
	   fashion.
	 - Prefix them with "_rnglists_" or "_loclists_".
	 - While calling $body in the various procs, temporarily make the procs
	   available under their "short" name.  For example, while in rngllists'
	   body, make _rnglists_table available as just "table".  This allows
	   existing code to keep working and keeps it not too verbose.
	 - Modify with_override to allow the overriden proc to not exist.  In
	   that case, the temporary proc is deleted on exit.

	Note the non-conforming indentation when calling with_override in
	_loclists_list.  This is on purpose: as we implement more loclists (and
	rnglists) entry types, the indentation would otherwise get larger and
	larger without much value for readability.  So I think it's reasonable
	here to put them on the same level.

	Change-Id: I7bb48d26fcb0dba1ae4dada05c0c837212424328

2021-10-01  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove TYPE_FIELD_NAME and FIELD_NAME macros
	Remove the `TYPE_FIELD_NAME` and `FIELD_NAME` macros, changing all the
	call sites to use field::name directly.

	Change-Id: I6900ae4e1ffab1396e24fb3298e94bf123826ca6

2021-10-01  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add field::name / field::set_name
	Add the `name` and `set_name` methods on `struct field`, in order to
	remove `FIELD_NAME` and `TYPE_FIELD_NAME` macros.  In this patch, the
	macros are changed to use `field::name`, so all the call sites that are
	used to set the field's name are changed to use `field::set_name`.
	The next patch will remove the macros completely.

	Note that because of the name clash between the existing field named
	`name` and the new method, I renamed the field `m_name`.  It is not
	private per-se, because we can't make `struct field` a non-POD yet, but
	it should be considered private anyway (not accessed outside `struct
	field`).

	Change-Id: If16ddbca4e0c39d0ff9da420bb5cdebe5b9b0896

2021-10-01  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-30  Sergio Durigan Junior  <sergiodj@sergiodj.net>

	[PR gdb/28369] Use get_shell on gdb/ser-pipe.c
	PR gdb/28369 reports that gdb/ser-pipe.c has an 'execl' function call
	with a hard-coded "/bin/sh" as its argument.  We've had 'get_shell'
	for a while now, which is conscious about the SHELL environment and a
	better alternative to always calling "/bin/sh".

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28369

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add untested for missing xml support in gdb.base/valgrind*.exp
	Add untested in case missing xml support is detected in test-cases
	gdb.base/valgrind*.exp.

	Tested on x86_64-linux.

2021-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	arm: enable Cortex-R52+ CPU
	Patch is adding Cortex-R52+ as 'cortex-r52plus' command line
	flag for -mcpu option.

	bfd/

		* cpu-arm.c: New Cortex-R52+ CPU.

	gas/

		* NEWS: Update docs.
		* config/tc-arm.c: New Cortex-R52+ CPU.
		* doc/c-arm.texi: Update docs.
		* testsuite/gas/arm/cpu-cortex-r52plus.d: New test.

2021-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: Enable Cortex-X2 CPU
	This patch is adding support for Cortex-X2 CPU.

	gas:

		* NEWS: Update docs.
		* config/tc-aarch64.c: Add Cortex-X2.
		* doc/c-aarch64.texi: Update docs.

2021-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: Enable Cortex-A710 CPU
	This patch is adding support for Cortex-A710 CPU.

	gas/

	        * NEWS: Update docs.
	        * config/tc-aarch64.c: Add Cortex-A710.
	        * doc/c-aarch64.texi: Update docs.

2021-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: Enable Cortex-A510 CPU
	This patch is adding support for Cortex-A510 CPU.

	gas/

		* NEWS: Update docs.
		* config/tc-aarch64.c: Add Cortex-A510.
		* doc/c-aarch64.texi: Update docs.

2021-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: Update AArch64 features command line options docs 2/2
	Patch is only sorting by 'Extension` column 'Architecture Extension'
	table.

	gas/

		* doc/c-aarch64.texi: Update docs.

2021-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: Update AArch64 features command line options docs 1/2
	Patch is improving entries in "Architecture extensions" table in GAS
	documentation.

	gas/

		* doc/c-aarch64.texi: Update docs.

2021-09-30  Przemyslaw Wirkus  <przemyslaw.wirkus@arm.com>

	aarch64: add armv9-a architecture to -march
	Patch is adding new 'armv9-a` command line flag to -march for AArch64.

	gas/

		* config/tc-aarch64.c: Add 'armv9-a' command line flag.
		* docs/c-aarch64.text: Update docs.
		* NEWS: Update docs.

	include/

		* opcode/aarch64.h (AARCH64_FEATURE_V9): New define.
		(AARCH64_ARCH_V9): New define.

2021-09-30  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: make runto_main not pass no-message to runto
	As follow-up to this discussion:

	  https://sourceware.org/pipermail/gdb-patches/2020-August/171385.html

	... make runto_main not pass no-message to runto.  This means that if we
	fail to run to main, for some reason, we'll emit a FAIL.  This is the
	behavior we want the majority of (if not all) the time.

	Without this, we rely on tests logging a failure if runto_main fails,
	otherwise.  They do so in a very inconsisteny mannet, sometimes using
	"fail", "unsupported" or "untested".  The messages also vary widly.
	This patch removes all these messages as well.

	Also, remove a few "fail" where we call runto (and not runto_main).  by
	default (without an explicit no-message argument), runto prints a
	failure already.  In two places, gdb.multi/multi-re-run.exp and
	gdb.python/py-pp-registration.exp, remove "message" passed to runto.
	This removes a few PASSes that we don't care about (but FAILs will still
	be printed if we fail to run to where we want to).  This aligns their
	behavior with the rest of the testsuite.

	Change-Id: Ib763c98c5f4fb6898886b635210d7c34bd4b9023

2021-09-30  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: make gdb_mkostemp_cloexec return a scoped_fd
	This encourages the callers to use automatic file descriptor management.

	Change-Id: I137a81df6f3607b457e28c35aafde8ed6f3a3344

2021-09-30  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: make gdb_open_cloexec return scoped_fd
	Make gdb_open_cloexec return a scoped_fd, to encourage using automatic
	management of the file descriptor closing.  Except in the most trivial
	cases, I changed the callers to just release the fd, which retains their
	existing behavior.  That will allow the transition to using scoped_fd
	more to go gradually, one caller at a time.

	Change-Id: Ife022b403f96e71d5ebb4f1056ef6251b30fe554

2021-09-30  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: move gdb_file_up to its own file
	The following patches wants to change gdb_fopen_cloexec and
	gdb_mkostemp_cloexec to return a scoped_fd.  Doing this causes a cyclic
	include between scoped_fd.h and filestuff.h, that both want to include
	each other.  scoped_fd.h includes filestuff.h because of the
	scoped_fd::to_file method's return value.  filestuff.h would then
	include scoped_fd.h for gdb_fopen_cloexec's and gdb_mkostemp_cloexec's
	return values.

	To fix that, move gdb_file_up to its own file, gdb_file.h.

	Change-Id: Ic82a48914b2aacee8f14af535b7469245f88b93d

2021-09-30  Dimitar Dimitrov  <dimitar@dinux.eu>

	ld: pru: Fix resource_table output section alignment
	My commit 261980de18b added alignment for the resource table symbol.
	But it is wrong.  The Linux remoteproc driver loads and interprets the
	contents of the .resource_table ELF section, not of a table symbol.

	Without this patch, if the linker happens to output padding for symbol
	alignment, then the resource table contents as viewed by the kernel
	loader would "shift" and look corrupted.

	ld/ChangeLog:

		* scripttempl/pru.sc  (.resource_table): Align the output
		section, not the first symbol.

2021-09-30  Tom Tromey  <tromey@adacore.com>

	Fix Windows crash from stop_pc change
	The "make thread_suspend_state::stop_pc optional" patch caused a
	regression on Windows when using shared libraries.  I tracked this
	down to an unguarded use of stop_pc() in the TARGET_WAITKIND_LOADED
	case of handle_inferior_event.  This patch fixes the bug by ensuring
	that the stop PC is set at this point.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use untested in gdb.debuginfod/fetch_src_and_symbols.exp
	With running test-case gdb.debuginfod/fetch_src_and_symbols.exp with target
	board unix/-bad, I get:
	...
	gcc: error: unrecognized command line option '-bad'^M
	compiler exited with status 1
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: compile
	...

	Replace the FAIL with the usual:
	...
	UNTESTED: gdb.debuginfod/fetch_src_and_symbols.exp: failed to compile
	...

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Remove redundant FAIL in gdb.base/info-os.exp
	When running test-case gdb.base/info-os.exp with target board unix/-bad, I run
	into:
	...
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	UNTESTED: gdb.base/info-os.exp: failed to prepare
	FAIL: gdb.base/info-os.exp: cannot compile test program
	...

	Remove the redundant FAIL.

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix DUPLICATE in gdb.base/info-os.exp
	When running test-case gdb.base/info-os.exp, I run into:
	...
	PASS: gdb.base/info-os.exp: get threads
	PASS: gdb.base/info-os.exp: get threads
	DUPLICATE: gdb.base/info-os.exp: get threads
	...

	Fix this not doing pass followed by exp_continue in gdb_test_multiple.

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Check compilation result in gdb.dwarf2/dw2-opt-structptr.exp
	When running test-case gdb.dwarf2/dw2-opt-structptr.exp with target board
	unix/-bad, I get:
	...
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	UNTESTED: gdb.dwarf2/dw2-opt-structptr.exp: dw2-opt-structptr.exp
	UNTESTED: gdb.dwarf2/dw2-opt-structptr.exp: failed to compile
	ERROR: (dw2-opt-structptr) No such file or directory
	UNRESOLVED: gdb.dwarf2/dw2-opt-structptr.exp: console: set print object on
	...

	Merge the two UNTESTEDs.

	Fix the UNRESOLVED by checking result of compilation.

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Check compilation result in gdb.base/structs.exp
	When running test-case gdb.base/structs.exp with target board unix/-bad, I
	get:
	...
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	UNTESTED: gdb.base/structs.exp: failed to prepare
	ERROR: tcl error sourcing src/gdb/testsuite/gdb.base/structs.exp.
	ERROR: can't read "use_gdb_stub": no such variable
	...

	Fix this by checking the compilation result.

	Fix the resulting DUPLICATEs using with_test_prefix.

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Prepare nodebug exec in gdb.base/cvexpr.exp
	When running test-case gdb.base/cvexpr.exp with target board unix/-bad, I get:
	...
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	ERROR: tcl error sourcing src/gdb/testsuite/gdb.base/cvexpr.exp.
	ERROR: can't read "use_gdb_stub": no such variable
	...

	This is triggered in a part of the test that claims to require no debug
	information, but uses the exec containing either dwarf or ctf.

	Fix this by preparing another executable compiled with nodebug, and using
	that one instead.

	Also use with_test_prefix to mark the nodebug part, such that we have:
	...
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	UNTESTED: gdb.base/cvexpr.exp: dwarf: failed to prepare
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	UNTESTED: gdb.base/cvexpr.exp: nodebug: failed to prepare
	...

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix DUPLICATE in gdb.base/cvexpr.exp
	Fix:
	...
	DUPLICATE: gdb.base/cvexpr.exp: ptype int * restrict
	...
	using with_test_prefix.

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Check compilation result in gdb.base/call-sc.exp
	When running test-case gdb.base/call-sc.exp with target board unix/-bad, I
	get:
	...
	gdb compile failed, gcc: error: unrecognized command line option '-bad'
	UNTESTED: gdb.base/call-sc.exp: failed to prepare
	ERROR: tcl error sourcing src/gdb/testsuite/gdb.base/call-sc.exp.
	ERROR: can't read "use_gdb_stub": no such variable
	...

	Fix this by checking the compilation result.

	Fix the resulting DUPLICATE:
	...
	DUPLICATE: gdb.base/call-sc.exp: failed to prepare
	...
	using with_test_prefix.

	Tested on x86_64-linux.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix untested messages in gdb.mi/*.exp
	The effect of:
	...
	untested "y.exp"
	...
	in a gdb.x/y.exp is:
	...
	UNTESTED: gdb.x/y.exp: y.exp
	...
	which is a bit pointless.

	Replace these untested messages in gdb.mi/*.exp with the usual "failed to
	compile".

	Likewise for an:
	...
	untested $testname
	...
	where the variable is undefined.

	Tested on x86_64-linux.

2021-09-30  Nick Clifton  <nickc@redhat.com>

	make objcopy fail if it is asked to redefine symbols in an object file containing LTO information.
		* objcopy.c (filter_symbols): Fail if attempting to dredefine
		symbols in an LTO object file.

2021-09-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix full buffer in gdb.rust/dwindex.exp
	On ubuntu 18.04.5, I run into:
	...
	(gdb) mt print objfiles dwindex^M
	^M
	Object file build/gdb/testsuite/outputs/gdb.rust/dwindex/dwindex:  \
	  Objfile at 0x55dab0b87a50, bfd at 0x55dab0b0cfa0, 1095 minsyms^M
	^M
	Psymtabs:^M
	vendor/compiler_builtins/src/int/specialized_div_rem/mod.rs at 0x55dab0db0720^M
	  ...
	library/std/src/sys/unix/stdio.rs at 0x55dab0d96320^M
	ERROR: internal buffer is full.
	UNRESOLVED: gdb.rust/dwindex.exp: check if index present
	...

	Fix this by using -lbl in proc ensure_gdb_index.

	Tested on x86_64-linux.

2021-09-30  Libor Bukata  <libor.bukata@oracle.com>

	Add Solaris specific ELF note processing
	Add elfcore_grok_solaris_note function that enables to
	obtain process status, register values, and program info
	from Solaris's core files.

	bfd/
		* elf.c (elfcore_grok_solaris_note): Solaris specific ELF
		note parser. Better GDB's coredump analysis on Solaris...
		(elfcore_grok_solaris_note_impl): New function.
		(elfcore_grok_solaris_prstatus): New function.
		(elfcore_grok_solaris_info): New function.
		(elfcore_grok_solaris_lwpstatus): New function.
		(elf_parse_notes): Added "CORE" groker element.
	include/
		* elf/common.h: Add note segment constants for core files on
		Solaris systems.

2021-09-30  Frederic Cambus  <fred@statdns.com>

	Add support to readelf for reading OpenBSD ELF core notes.
		* readelf.c (get_openbsd_elfcore_note_type): New function.
		(process_note): Add support for OpenBSD core notes.

2021-09-30  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-29  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/break-interp.exp for ld.so without debug
	When running test-case gdb.base/break-interp.exp on openSUSE Leap 42.3, I get:
	...
	(gdb) info addr dl_main^M
	Symbol "dl_main" is at 0x1750 in a file compiled without debugging.^M
	(gdb) FAIL: gdb.base/break-interp.exp: info addr dl_main
	...
	while the regexp expects "Symbol \"dl_main\" is a function at address $hex\\."

	Fix this by also accepting this variant.

	Tested on x86_64-linux.

2021-09-29  H.J. Lu  <hjl.tools@gmail.com>

	Add a testcase for PR binutils/27202
		PR binutils/27202
		* testsuite/gas/elf/dwarf-5-loc0.d: New file.
		* testsuite/gas/elf/dwarf-5-loc0.s: Likewise.
		* testsuite/gas/elf/elf.exp: Run dwarf-5-loc0.

2021-09-29  Pedro Alves  <pedro@palves.net>

	Fix gdb.multi/multi-term-settings.exp race
	The gdb.multi/multi-term-settings.exp testcase sometimes fails like so:

	 Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.multi/multi-term-settings.exp ...
	 FAIL: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: stop with control-c (SIGINT)

	It's easier to reproduce if you stress the machine at the same time, like e.g.:

	  $ stress -c 24

	Looking at gdb.log, we see:

	 (gdb) attach 60422
	 Attaching to program: build/gdb/testsuite/outputs/gdb.multi/multi-term-settings/multi-term-settings, process 60422
	 [New Thread 60422.60422]
	 Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...
	 Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.31.so...
	 Reading symbols from /lib64/ld-linux-x86-64.so.2...
	 (No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
	 0x00007f2fc2485334 in __GI___clock_nanosleep (clock_id=<optimized out>, clock_id@entry <mailto:clock_id@entry>=0, flags=flags@entry <mailto:flags@entry>=0, req=req@entry <mailto:req@entry>=0x7ffe23126940, rem=rem@entry <mailto:rem@entry>=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
	 78	../sysdeps/unix/sysv/linux/clock_nanosleep.c: No such file or directory.
	 (gdb) PASS: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: inf2: attach
	 set schedule-multiple on
	 (gdb) PASS: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: set schedule-multiple on
	 info inferiors
	   Num  Description       Connection                         Executable
	   1    process 60404     1 (extended-remote localhost:2349) build/gdb/testsuite/outputs/gdb.multi/multi-term-settings/multi-term-settings
	 * 2    process 60422     1 (extended-remote localhost:2349) build/gdb/testsuite/outputs/gdb.multi/multi-term-settings/multi-term-settings
	 (gdb) PASS: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: info inferiors
	 pid=60422, count=46
	 pid=60422, count=47
	 pid=60422, count=48
	 pid=60422, count=49
	 pid=60422, count=50
	 pid=60422, count=51
	 pid=60422, count=52
	 pid=60422, count=53
	 pid=60422, count=54
	 pid=60422, count=55
	 pid=60422, count=56
	 pid=60422, count=57
	 pid=60422, count=58
	 pid=60422, count=59
	 pid=60422, count=60
	 pid=60422, count=61
	 pid=60422, count=62
	 pid=60422, count=63
	 pid=60422, count=64
	 pid=60422, count=65
	 pid=60422, count=66
	 pid=60422, count=67
	 pid=60422, count=68
	 pid=60422, count=69
	 pid=60404, count=54
	 pid=60404, count=55
	 pid=60404, count=56
	 pid=60404, count=57
	 pid=60404, count=58
	 PASS: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: continue
	 Quit
	 (gdb) FAIL: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: stop with control-c (SIGINT)

	If you look at the testcase's sources, you'll see that the intention
	is to resumes the program with "continue", wait to see a few of those
	"pid=..., count=..." lines, and then interrupt the program with
	Ctrl-C.  But somehow, that resulted in GDB printing "Quit", instead of
	the Ctrl-C stopping the program with SIGINT.

	Here's what is happening:

	 #1 - those "pid=..., count=..." lines we see above weren't actually
	      output by the inferior after it has been continued (see #1).
	      Note that "inf1_how" and "inf2_how" are "attach".  What happened
	      is that those "pid=..., count=..." lines were output by the
	      inferiors _before_ they were attached to.  We see them at that
	      point instead of earlier, because that's where the testcase
	      reads from the inferiors' spawn_ids.

	 #2 - The testcase mistakenly thinks those "pid=..., count=..." lines
	      happened after the continue was processed by GDB, meaning it has
	      waited enough, and so sends the Ctrl-C.  GDB hasn't yet passed
	      the terminal to the inferior, so the Ctrl-C results in that
	      Quit.

	The fix here is twofold:

	 #1 - flush inferior output right after attaching

	 #2 - consume the "Continuing" printed by "continue", indicating the
	      inferior has the terminal.  This is the same as done throughout
	      the testsuite to handle this exact problem of sending Ctrl-C too
	      soon.

	gdb/testsuite/ChangeLog:
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net <mailto:pedro@palves.net>>

		* gdb.multi/multi-term-settings.exp (create_inferior): Flush
		inferior output.
		(coretest): Use $gdb_test_name.  After issuing "continue", wait
		for "Continuing".

	Change-Id: Iba7671dfe1eee6b98d29cfdb05a1b9aa2f9defb9

2021-09-29  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Disable vgdb tests if xml not supported
	I build gdb without xml support using --without-expat, and ran into:
	...
	(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=22032^M
	Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=22032^M
	relaying data between gdb and process 22032^M
	warning: Can not parse XML target description; XML support was disabled at \
	  compile time^M
	  ...
	(gdb) PASS: gdb.base/valgrind-infcall.exp: continue #1
	p gdb_test_infcall ()^M
	Remote 'g' packet reply is too long (expected 560 bytes, got 800 bytes): ...^M
	(gdb) FAIL: gdb.base/valgrind-infcall.exp: p gdb_test_infcall ()
	...

	After googling the error message with context valgrind gdbserver, I found
	indications that the Remote 'g' packet reply error is due to missing xml
	support.

	And here ( https://www.valgrind.org/docs/manual/manual-core-adv.html ) I
	found:
	...
	GDB version needed for ARM and PPC32/64.

	You must use a GDB version which is able to read XML target description sent
	by a gdbserver.  This is the standard setup if GDB was configured and built
	with the "expat" library.  If your GDB was not configured with XML support, it
	will report an error message when using the "target" command.  Debugging will
	not work because GDB will then not be able to fetch the registers from the
	Valgrind gdbserver.
	...

	So I guess I'm running into the same problem for x86_64.

	Fix this by skipping all gdb.base/valgrind-*.exp tests if xml support is not
	available.  Although only the gdb.base/valgrind-infcall*.exp produce fails,
	the Remote 'g' packet reply error occurs in all tests, so it seems prudent to
	disable them all.

	Tested on x86_64-linux.

2021-09-29  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.python/py-breakpoint.exp with python 2
	With a gdb build using python 2.7, I run into:
	...
	(gdb) python \
	  gdb.events.breakpoint_modified.connect(lambda bp: print(bp.enabled))^M
	  File "<string>", line 1^M
	    gdb.events.breakpoint_modified.connect(lambda bp: print(bp.enabled))^M
	                                                          ^^M
	SyntaxError: invalid syntax^M
	Error while executing Python code.^M
	(gdb) FAIL: gdb.python/py-breakpoint.exp: test_bkpt_auto_disable: \
	  trap breakpoint_modified event
	...

	This is caused by the following:
	- a lambda function body needs to be an expression
	- in python 2, print is a statement, while in python 3 it's a function
	- a function call is an expression, and a statement is not.

	Fix this by defining a function print_bp_enabled:
	...
	def print_bp_enabled (bp):
	    print (bp.enabled)
	end
	...
	and using that instead.

	Tested on x86_64-linux.

2021-09-29  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix breakpoint detection in gdb.gdb/python-helper.exp
	With a gdb configured to be somewhat minimal, while still supporting python:
	...
	$ gdb --configuration
	This GDB was configured as follows:
	   configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
	             --with-auto-load-dir=$debugdir:$datadir/auto-load
	             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
	             --without-expat
	             --with-gdb-datadir=$install/share/gdb (relocatable)
	             --with-jit-reader-dir=$install/lib64/gdb (relocatable)
	             --without-libunwind-ia64
	             --without-lzma
	             --without-babeltrace
	             --without-intel-pt
	             --with-mpfr
	             --without-xxhash
	             --with-python=/usr
	             --with-python-libdir=/usr/lib
	             --with-debuginfod
	             --without-guile
	             --disable-source-highlight
	             --with-separate-debug-dir=/usr/lib/debug
	             --with-system-gdbinit=$devel/system-gdbinit
	...
	and using gcc 4.8 to build gdb (causing std::thread not to be used due to
	PR28318) I ran into:
	...
	(gdb) PASS: gdb.gdb/python-helper.exp: start inner gdb
	print 1^M
	^M
	Breakpoint 2, value_print () at src/gdb/valprint.c:1174^M
	1174      scoped_value_mark free_values;^M
	(xgdb) FAIL: gdb.gdb/python-helper.exp: hit breakpoint in inner gdb (timeout)
	...

	The problem is that the regexp expects "hit Breakpoint $decimal".  The "hit"
	part is missing.

	The "hit" is printed by maybe_print_thread_hit_breakpoint, when
	show_thread_that_caused_stop returns true:
	...
	int
	show_thread_that_caused_stop (void)
	{
	  return highest_thread_num > 1;
	}
	...
	Apparently, that's not the case.

	Fix this by removing "hit" from the regexp, making the regexp more similar to
	what is used in say, continue_to_breakpoint.

	Tested on x86_64-linux.

2021-09-29  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: fix build when libbacktrace and execinfo backtrace are not available
	In this commit:

	  commit abbbd4a3e0ca51132e7fb31a43f896d29894dae0
	  Date:   Wed Aug 11 13:24:33 2021 +0100

	      gdb: use libbacktrace to create a better backtrace for fatal signals

	The build of GDB was broken iff, the execinfo backtrace API is not
	available, and, libbacktrace is either disabled, or not usable.  In
	this case you'll see build errors like this:

	      CXX    bt-utils.o
	    /home/username/src/binutils-gdb/gdb/bt-utils.c: In function 'void gdb_internal_backtrace()':
	    /home/username/src/binutils-gdb/gdb/bt-utils.c:165:5: error: 'gdb_internal_backtrace_1' was not declared in this scope
	         gdb_internal_backtrace_1 ();
	         ^~~~~~~~~~~~~~~~~~~~~~~~

	This commit fixes the issue by guarding the call to
	gdb_internal_backtrace_1 with '#ifdef GDB_PRINT_INTERNAL_BACKTRACE',
	which is only defined when one of the backtrace libraries are
	available.

2021-09-29  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/doc: use 'standard error stream' instead of 'stderr' in some places
	With this commit:

	  commit 91f2597bd24d171c1337a4629f8237aa47c59082
	  Date:   Thu Aug 12 18:24:59 2021 +0100

	      gdb: print backtrace for internal error/warning

	I included some references to 'stderr', which, it was pointed out,
	would be better written as 'standard error stream'.  See:

	  https://sourceware.org/pipermail/gdb-patches/2021-September/182225.html

	This commit replaces the two instances of 'stderr' that I introduced.

2021-09-29  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: fix manor -> manner typo in some comments
	In a recent commit I used 'manor' in some comments rather than
	'manner'.  This commit fixes those two mistakes.

	I also looked through the gdb/ tree and found one additional instance
	of this mistake that this commit also fixes.

2021-09-29  Alan Modra  <amodra@gmail.com>

	PR27202, readelf -wL doesn't work on ".loc 0"
	For DWARF revision 4 and earlier, display_debug_lines_decoded
	populates the file_table array with entries read from .debug_line
	after the directory table.  file_table[0] contains the first entry.
	DWARF rev 4 line number programs index this entry as file number one.
	DWARF revision 5 changes .debug_line format quite extensively, and in
	particular gives file number zero a meaning.

		PR 27202
		* dwarf.c (display_debug_lines_decoded): Correct indexing used
		for DWARF5 files.

2021-09-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: enable target_async around stop_all_threads call in process_initial_stop_replies
	The following scenario hangs:

	 - maint set target-non-stop on
	 - `gdbserver --attach`
	 - a multi-threaded program

	For example:

	Terminal 1:

	    $ gnome-calculator&
	    [1] 495731
	    $ ../gdbserver/gdbserver --once --attach :1234 495731
	    Attached; pid = 495731
	    Listening on port 1234

	Terminal 2:

	    $ ./gdb -nx -q --data-directory=data-directory /usr/bin/gnome-calculator -ex "maint set target-non-stop on" -ex "tar rem :1234"
	    Reading symbols from /usr/bin/gnome-calculator...
	    (No debugging symbols found in /usr/bin/gnome-calculator)
	    Remote debugging using :1234
	    * hangs *

	What happens is:

	 - The protocol between gdb and gdbserver is in non-stop mode, but the
	   user-visible behavior is all-stop
	 - On connect, gdbserver sends one stop reply for one thread that is
	   stops, the others stay running
	 - In process_initial_stop_replies, gdb calls stop_all_threads to stop
	   these other threads, because we are using the all-stop user-visible
	   mode
	 - stop_all_threads sends a stop request for all the running threads and
	   then waits for resulting events
	 - At this point, the remote target is in target_async(0) mode, which
	   makes stop_all_threads not consider it for events
	 - stop_all_threads loops indefinitely (it does not even block
	   indefinitely, it is in an infinite busy loop) because there are no
	   event sources.  wait_one_event returns a TARGET_WAITKIND_NO_RESUMED
	   wait status.

	Fix that by making the remote target async around the stop_all_threads
	call.

	I haven't implemented it because I'm not sure how to do it, but I think
	it would be a good idea to have, in stop_all_threads / wait_one /
	handle_one, an assert to check that if we are expecting one or more
	event, then there are some targets that are in a state where they can
	supply some events.  Otherwise, we'll necessarily be stuck in this
	infinite loop, and it's probably due to a bug in GDB.  I'm not too sure
	where to put this or how to express it though.  Perhaps in
	stop_all_threads, here:

		  for (int i = 0; i < waits_needed; i++)
		    {
		      wait_one_event event = wait_one ();
		      *here*
		      if (handle_one (event))
			break;
		    }

	If at that point, the returned event is TARGET_WAITKIND_NO_RESUMED,
	there's a problem.  We expect some event, because we've asked some
	threads to stop, but all targets are answering that they won't have any
	events for us.  That's a contradiction, and a sign that something has
	gone wrong.  It could perhaps event be:

	    gdb_assert (event.ws.kind != TARGET_WAITKIND_NO_RESUMED);

	in handle_one, as the idea is the same in prepare_for_detach.

	A bit more sophisticated would be: we know which targets we are
	expecting waits from, since we know which threads we have asked to
	stop.  So if any of these targets returns TARGET_WAITKIND_NO_RESUMED,
	something is fishy.

	Add a test that tests attaching with gdbserver's --attach flag to a
	multi-threaded program, and then connecting to it.  Without the fix, the
	test reproduces the hang.

	Change-Id: If6f6690a4887ca66693ef1af64791dda4c65f24f

2021-09-29  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix darwin-nat build (again)
	I made a mistake in the previous patch.  Adjust the format string to
	match the arguments.

	Change-Id: I4d45e0e0adb78eb3b5a06ba1a5287155940056ba

2021-09-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix darwin-nat build
	There are two errors of this kind:

	      CXX    darwin-nat.o
	    /Users/smarchi/src/binutils-gdb/gdb/darwin-nat.c:1175:19: error: format specifies type 'unsigned long' but the argument has type 'ULONGEST' (aka 'unsigned long long') [-Werror,-Wformat]
		 ptid.pid (), ptid.tid ());
			      ^~~~~~~~~~~

	Fix them by using ptid_t's to_string method.

	Change-Id: I52087d5f7ee0fc01ac8b3f87d4db0217cb0d7cc7

2021-09-29  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb.base/foll-fork.exp: accept "info breakpoints" output in any order
	The test currently requires the "inf 1" breakpoint to be before the "inf
	2" breakpoint.  This is not always the case:

	    info breakpoints 2
	    Num     Type           Disp Enb Address            What
	    2       breakpoint     keep y   <MULTIPLE>
	    2.1                         y   0x0000555555554730 in callee at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/foll-fork.c:9 inf 2
	    2.2                         y   0x0000555555554730 in callee at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/foll-fork.c:9 inf 1
	    (gdb) FAIL: gdb.base/foll-fork.exp: follow-fork-mode=parent: detach-on-fork=off: cmd=next 2: test_follow_fork: info breakpoints

	Since add_location_to_breakpoint uses only the address as a criterion to
	sort locations, the order of locations at the same address is not
	stable: it will depend on the insertion order.  Here, the insertion
	order comes from the order of SALs when creating the breakpoint, which
	can vary from machine to machine.  While it would be more user-friendly
	to have a more stable order for printed breakpoint locations, it doesn't
	really matter for this test, and it would be hard to define an order
	that will be the same everywhere, all the time.

	So, loosen the regexp to accept "inf 1" and "inf 2" in any order.

	Co-Authored-By: Pedro Alves <pedro@palves.net>
	Change-Id: I5ada2e0c6ad0669e0d161bfb6b767229c0970d16

2021-09-28  Cooper Qu  <cooper.qu@linux.alibaba.com>

	RISC-V: Fix wrong version number when arch contains 'p'.
	When specify a default version for p extension in
	riscv_supported_std_ext[](elfxx-riscv.c) and assembling with
	-march=rv32imacp, the c extension's version in attribute will become
	0p0, the expectation is 2p0.

	TODO: Remember to add testcase when we have supported standrad p in
	the future.

	bfd/
		PR gas/28372
		* elfxx-riscv.c (riscv_parsing_subset_version): Break if p
		represent the 'p' extension.

	Change-Id: Ia4e0cf26f3d7d07acaee8cefd86707ecac663a59

2021-09-28  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Allow to add numbers in the prefixed extension names.
	We need to allow adding numbers in the prefixed extension names, since
	the zve<32,64><d,f,x> extensions are included in the forzen rvv v1.0 spec
	recently.  But there are two restrictions as follows,

	* The extension name ends with <number>p is invalid, since this may
	be confused with extension with <number>.0 version.  We report errors
	for this case.

	Invalid format: [z|h|s|zvm|x][0-9a-z]+[0-9]+p

	* The extension name ends with numbers is valid, but the numbers will
	be parsed as major version, so try to avoid naming extensions like this.

	bfd/
		* elfxx-riscv.c (riscv_recognized_prefixed_ext): Renamed from
		riscv_valid_prefixed_ext/
		(riscv_parsing_subset_version): The extensions end with <number>p
		is forbidden, we already report the detailed errors in the
		riscv_parse_prefixed_ext, so clean the code and unused parameters.
		(riscv_parse_std_ext): Updated.
		(riscv_parse_prefixed_ext): Rewrite the parser to allow numbers
		in the prefixed extension names.
	gas/
		* testsuite/gas/riscv/march-fail-invalid-x-01.d: New testcases.
		* testsuite/gas/riscv/march-fail-invalid-x-02.d: Likewise.
		* testsuite/gas/riscv/march-fail-invalid-z-01.d: Likewise.
		* testsuite/gas/riscv/march-fail-invalid-z-02.d: Likewise.
		* testsuite/gas/riscv/march-fail-invalid.l: Likewise.
		* testsuite/gas/riscv/march-fail-version-x.d: Removed.
		* testsuite/gas/riscv/march-fail-version-z.d: Likewise.
		* testsuite/gas/riscv/march-fail-version.l: Likewise.

2021-09-28  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: print backtrace for internal error/warning
	This commit builds on previous work to allow GDB to print a backtrace
	of itself when GDB encounters an internal-error or internal-warning.
	This fixes PR gdb/26377.

	There's not many places where we call internal_warning, and I guess in
	most cases the user would probably continue their debug session.  And
	so, in order to avoid cluttering up the output, by default, printing
	of a backtrace is off for internal-warnings.

	In contrast, printing of a backtrace is on by default for
	internal-errors, as I figure that in most cases hitting an
	internal-error is going to be the end of the debug session.

	Whether a backtrace is printed or not can be controlled with the new
	settings:

	  maintenance set internal-error backtrace on|off
	  maintenance show internal-error backtrace

	  maintenance set internal-warning backtrace on|off
	  maintenance show internal-warning backtrace

	Here is an example of what an internal-error now looks like with the
	backtrace included:

	  (gdb) maintenance internal-error blah
	  ../../src.dev-3/gdb/maint.c:82: internal-error: blah
	  A problem internal to GDB has been detected,
	  further debugging may prove unreliable.
	  ----- Backtrace -----
	  0x5c61ca gdb_internal_backtrace_1
	  	../../src.dev-3/gdb/bt-utils.c:123
	  0x5c626d _Z22gdb_internal_backtracev
	  	../../src.dev-3/gdb/bt-utils.c:165
	  0xe33237 internal_vproblem
	  	../../src.dev-3/gdb/utils.c:393
	  0xe33539 _Z15internal_verrorPKciS0_P13__va_list_tag
	  	../../src.dev-3/gdb/utils.c:470
	  0x1549652 _Z14internal_errorPKciS0_z
	  	../../src.dev-3/gdbsupport/errors.cc:55
	  0x9c7982 maintenance_internal_error
	  	../../src.dev-3/gdb/maint.c:82
	  0x636f57 do_simple_func
	  	../../src.dev-3/gdb/cli/cli-decode.c:97
	   .... snip, lots more backtrace lines ....
	  ---------------------
	  ../../src.dev-3/gdb/maint.c:82: internal-error: blah
	  A problem internal to GDB has been detected,
	  further debugging may prove unreliable.
	  Quit this debugging session? (y or n) y

	  This is a bug, please report it.  For instructions, see:
	  <https://www.gnu.org/software/gdb/bugs/>.

	  ../../src.dev-3/gdb/maint.c:82: internal-error: blah
	  A problem internal to GDB has been detected,
	  further debugging may prove unreliable.
	  Create a core file of GDB? (y or n) n

	My hope is that this backtrace might make it slightly easier to
	diagnose GDB issues if all that is provided is the console output, I
	find that we frequently get reports of an assert being hit that is
	located in pretty generic code (frame.c, value.c, etc) and it is not
	always obvious how we might have arrived at the assert.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26377

2021-09-28  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: use libbacktrace to create a better backtrace for fatal signals
	GDB recently gained the ability to print a backtrace when a fatal
	signal is encountered.  This backtrace is produced using the backtrace
	and backtrace_symbols_fd API available in glibc.

	However, in order for this API to actually map addresses to symbol
	names it is required that the application (GDB) be compiled with
	-rdynamic, which GDB is not by default.

	As a result, the backtrace produced often looks like this:

	  Fatal signal: Bus error
	  ----- Backtrace -----
	  ./gdb/gdb[0x80ec00]
	  ./gdb/gdb[0x80ed56]
	  /lib64/libc.so.6(+0x3c6b0)[0x7fc2ce1936b0]
	  /lib64/libc.so.6(__poll+0x4f)[0x7fc2ce24da5f]
	  ./gdb/gdb[0x15495ba]
	  ./gdb/gdb[0x15489b8]
	  ./gdb/gdb[0x9b794d]
	  ./gdb/gdb[0x9b7a6d]
	  ./gdb/gdb[0x9b943b]
	  ./gdb/gdb[0x9b94a1]
	  ./gdb/gdb[0x4175dd]
	  /lib64/libc.so.6(__libc_start_main+0xf3)[0x7fc2ce17e1a3]
	  ./gdb/gdb[0x4174de]
	  ---------------------

	This is OK if you have access to the exact same build of GDB, you can
	manually map the addresses back to symbols, however, it is next to
	useless if all you have is a backtrace copied into a bug report.

	GCC uses libbacktrace for printing a backtrace when it encounters an
	error.  In recent commits I added this library into the binutils-gdb
	repository, and in this commit I allow this library to be used by
	GDB.  Now (when GDB is compiled with debug information) the backtrace
	looks like this:

	  ----- Backtrace -----
	  0x80ee08 gdb_internal_backtrace
	  	../../src/gdb/event-top.c:989
	  0x80ef0b handle_fatal_signal
	  	../../src/gdb/event-top.c:1036
	  0x7f24539dd6af ???
	  0x7f2453a97a5f ???
	  0x154976f gdb_wait_for_event
	  	../../src/gdbsupport/event-loop.cc:613
	  0x1548b6d _Z16gdb_do_one_eventv
	  	../../src/gdbsupport/event-loop.cc:237
	  0x9b7b02 start_event_loop
	  	../../src/gdb/main.c:421
	  0x9b7c22 captured_command_loop
	  	../../src/gdb/main.c:481
	  0x9b95f0 captured_main
	  	../../src/gdb/main.c:1353
	  0x9b9656 _Z8gdb_mainP18captured_main_args
	  	../../src/gdb/main.c:1368
	  0x4175ec main
	  	../../src/gdb/gdb.c:32
	  ---------------------

	Which seems much more useful.

	Use of libbacktrace is optional.  If GDB is configured with
	--disable-libbacktrace then the libbacktrace directory will not be
	built, and GDB will not try to use this library.  In this case GDB
	would try to use the old backtrace and backtrace_symbols_fd API.

	All of the functions related to writing the backtrace of GDB itself
	have been moved into the new files gdb/by-utils.{c,h}.

2021-09-28  Andrew Burgess  <andrew.burgess@embecosm.com>

	src-release.sh: add libbacktrace to GDB_SUPPORT_DIRS
	After the previous commit that imported libbacktrace from gcc, this
	commit updates src-release.sh so that the libbacktrace directory is
	included in the gdb release tar file.

	ChangeLog:

		* src-release.sh (GDB_SUPPPORT_DIRS): Add libbacktrace.

2021-09-28  Andrew Burgess  <andrew.burgess@embecosm.com>

	Copy in libbacktrace from gcc
	This copies in libbacktrace from the gcc repository as it was in the
	commit 62e420293a293608f383d9b9c7f2debd666e9fc9.  GDB is going to
	start using this library soon.

	A dependency between GDB and libbacktrace has already been added to
	the top level Makefile, so, after this commit, when building GDB,
	libbacktrace will be built first.  However, libbacktrace is not yet
	linked into GDB, or used by GDB in any way.

	It is possible to stop libbacktrace being built by configuring the
	tree with --disable-libbacktrace.

	This commit does NOT update src-release.sh, that will be done in the
	next commit, this commit ONLY imports libbacktrace from gcc.  This
	means that if you try to make a release of GDB from exactly this
	commit then the release tar file will not include libbacktrace.
	However, as libbacktrace is an optional dependency this is fine.

2021-09-28  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: Add a dependency between gdb and libbacktrace
	GDB is going to start using libbacktrace, so add a build dependency.

	ChangeLog:

		* Makefile.def: Add all-gdb dependency on all-libbacktrace.
		* Makefile.in: Regenerate.

2021-09-28  Andrew Burgess  <andrew.burgess@embecosm.com>

	top-level configure: setup target_configdirs based on repository
	The top-level configure script is shared between the gcc repository
	and the binutils-gdb repository.

	The target_configdirs variable in the configure.ac script, defines
	sub-directories that contain components that should be built for the
	target using the target tools.

	Some components, e.g. zlib, are built as both host and target
	libraries.

	This causes problems for binutils-gdb.  If we run 'make all' in the
	binutils-gdb repository we end up trying to build a target version of
	the zlib library, which requires the target compiler be available.
	Often the target compiler isn't immediately available, and so the
	build fails.

	The problem with zlib impacted a previous attempt to synchronise the
	top-level configure scripts from gcc to binutils-gdb, see this thread:

	  https://sourceware.org/pipermail/binutils/2019-May/107094.html

	And I'm in the process of importing libbacktrace in to binutils-gdb,
	which is also a host and target library, and triggers the same issues.

	I believe that for binutils-gdb, at least at the moment, there are no
	target libraries that we need to build.

	In the configure script we build three lists of things we want to
	build, $configdirs, $build_configdirs, and $target_configdirs, we also
	build two lists of things we don't want to build, $skipdirs and
	$noconfigdirs.  We then remove anything that is in the lists of things
	not to build, from the list of things that should be built.

	My proposal is to add everything in target_configdirs into skipdirs,
	if the source tree doesn't contain a gcc/ sub-directory.  The result
	is that for binutils-gdb no target tools or libraries will be built,
	while for the gcc repository, nothing should change.

	If a user builds a unified source tree, then the target tools and
	libraries should still be built as the gcc/ directory will be present.

	I've tested a build of gcc on x86-64, and the same set of target
	libraries still seem to get built.  On binutils-gdb this change
	resolves the issues with 'make all'.

	ChangeLog:

		* configure: Regenerate.
		* configure.ac (skipdirs): Add the contents of target_configdirs if
		we are not building gcc.

2021-09-28  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>

	PR28391, strip/objcopy --preserve-dates *.a: cannot set time
	After commit 985e0264516 copy_archive function began to pass invalid
	values to the utimensat(2) function when it tries to preserve
	timestamps in ar archives.  This happens because the bfd_stat_arch_elt
	implementation for ar archives fills only the st_mtim.tv_sec part of
	the st_mtim timespec structure, but leaves the st_mtim.tv_nsec part
	and the whole st_atim timespec untouched leaving them uninitialized

		PR 28391
		* ar.c (extract_file): Clear buf for preserve_dates.
		* objcopy.c (copy_archive): Likewise.

2021-09-28  Mike Frysinger  <vapier@gentoo.org>

	sim: drop weak func attrs on module inits
	When I first wrote this, I was thinking we'd scan all source files
	that existed and generate a complete init list.  That means for any
	particular build, we'd probably have a few functions that didn't
	exist, so weak attributes was necessary.  What I ended up scanning
	though was only the source files that went into a particular build.

	There was another concern too: a source file might be included, but
	the build settings would cause all of its contents to be skipped
	(via CPP defines).  So scanning via naive grep would pick up names
	not actually available.  A check of the source tree shows that we
	never do this, and it's pretty easy to institute a policy that we
	don't start (by at the very least including a stub init func).

	The use of weak symbols ends up causing a problem in practice: for
	a few modules (like profiling), nothing else pulls it in, so the
	linker omits it entirely, which leads to the profiling module never
	being available.  So drop the weak markings since we know all these
	funcs will be available.

2021-09-28  Cui,Lili  <lili.cui@intel.com>

	x86: Print {bad} on invalid broadcast in OP_E_memory
	Don't print broadcast for scalar_mode, and print {bad} for invalid broadcast.

	gas/

		PR binutils/28381
		* testsuite/gas/i386/bad-bcast.s: Add a new testcase.
		* testsuite/gas/i386/bad-bcast.d: Likewise.
		* testsuite/gas/i386/bad-bcast-intel.d: New.

	opcodes/

		PR binutils/28381
		* i386-dis.c (static struct): Add no_broadcast.
		(OP_E_memory): Mark invalid broadcast with no_broadcast=1 and Print "{bad}"for it.
		(intel_operand_size): mark invalid broadcast with no_broadcast=1.
		(OP_XMM): Mark scalar_mode with no_broadcast=1.

2021-09-28  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: use intrusive_list for linux-nat lwp_list
	Replace the manually maintained linked list of lwp_info objects with
	intrusive_list.  Replace the ALL_LWPS macro with all_lwps, which returns
	a range.  Add all_lwps_safe as well, for use in iterate_over_lwps, which
	currently iterates in a safe manner.

	Change-Id: I355313502510acc0103f5eaf2fbde80897d6376c

2021-09-28  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add destructor to lwp_info
	Replace the lwp_free function with a destructor.  Make lwp_info
	non-copyable, since there is now a destructor (we wouldn't want an
	lwp_info object getting copied and this->arch_private getting deleted
	twice).

	Change-Id: I09fcbe967e362566d3a06fed2abca2a9955570fa

2021-09-28  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make lwp_info non-POD
	Initialize all fields in the class declaration directly.  This opens the
	door to using intrusive_list, done in the following patch.

	Change-Id: I38bb27410cd9ebf511d310bb86fe2ea1872c3b05

2021-09-28  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-27  Simon Marchi  <simon.marchi@efficios.com>

	gdb: don't share aspace/pspace on fork with "detach-on-fork on" and "follow-fork-mode child"
	We found that when handling forks, two inferiors can unexpectedly share
	their program space and address space.  To reproduce:

	 1. Using a test program that forks...
	 2. "set follow-fork-mode child"
	 3. "set detach-on-fork on" (the default)
	 4. run to a breakpoint somewhere after the fork

	Step 4 should have created a new inferior:

	    (gdb) info inferiors
	      Num  Description       Connection           Executable
	      1    <null>                                 /home/smarchi/build/wt/amd/gdb/fork
	    * 2    process 251425    1 (native)           /home/smarchi/build/wt/amd/gdb/fork

	By inspecting the state of GDB, we can see that the two inferiors now
	share one program space and one address space:

	Inferior 1:

	    (top-gdb) p inferior_list.m_front.num
	    $2 = 1
	    (top-gdb) p inferior_list.m_front.aspace
	    $3 = (struct address_space *) 0x5595e2520400
	    (top-gdb) p inferior_list.m_front.pspace
	    $4 = (struct program_space *) 0x5595e2520440

	Inferior 2:

	    (top-gdb) p inferior_list.m_front.next.num
	    $5 = 2
	    (top-gdb) p inferior_list.m_front.next.aspace
	    $6 = (struct address_space *) 0x5595e2520400
	    (top-gdb) p inferior_list.m_front.next.pspace
	    $7 = (struct program_space *) 0x5595e2520440

	You can then run inferior 1 again and the two inferiors will still
	erroneously share their spaces, but already at this point this is wrong.

	The cause of the bad {a,p}space sharing is in follow_fork_inferior.
	When following the child and detaching from the parent, we just re-use
	the parent's spaces, rather than cloning them.  When we switch back to
	inferior 1 and run again, we find ourselves with two unrelated inferiors
	sharing spaces.

	Fix that by creating new spaces for the parent after having moved them
	to the child.  My initial implementation created new spaces for the
	child instead.  Doing this breaks doing "next" over fork().  When "next"
	start, we record the symtab of the starting location.  When the program
	stops, we compare that symtab with the symtab the program has stopped
	at.  If the symtab or the line number has changed, we conclude the
	"next" is done.  If we create a new program space for the child and copy
	the parent's program space to it with clone_program_space, it creates
	new symtabs for the child as well.  When the child stop, but still on
	the fork() line, GDB thinks the "next" is done because the symtab
	pointers no longer match.  In reality they are two symtab instances that
	represent the same file.  But moving the spaces to the child and
	creating new spaces for the parent, we avoid this problem.

	Note that the problem described above happens today with "detach-on-fork
	off" and "follow-fork-mode child", because we create new spaces for the
	child.  This will have to be addressed later.

	Test-wise, improve gdb.base/foll-fork.exp to set a breakpoint that is
	expected to have a location in each inferiors.  Without the fix, when
	the two inferiors erroneously share a program space, GDB reports a
	single location.

	Change-Id: Ifea76e14f87b9f7321fc3a766217061190e71c6e

2021-09-27  Simon Marchi  <simon.marchi@efficios.com>

	gdb.base/foll-fork.exp: use foreach_with_prefix to handle prefixes
	No behavior change in the test expected, other than in the test names.

	Change-Id: I111137483858ab0f23138439f2930009779a2b3d

2021-09-27  Simon Marchi  <simon.marchi@efficios.com>

	gdb.base/foll-fork.exp: rename variables
	Rename the variables / parameters used to match the corresponding GDB
	setting name, I find that easier to follow.

	Change-Id: Idcbddbbb369279fcf1e808b11a8c478f21b2a946

2021-09-27  Simon Marchi  <simon.marchi@efficios.com>

	gdb.base/foll-fork.exp: refactor to restart GDB between each portion of the test
	This test is difficult to follow and modify because the state of GDB is
	preserved some tests.  Add a setup proc, which starts a new GDB and runs
	to main, and use it in all test procs.  Use proc_with_prefix to avoid
	duplicates.

	The check_fork_catchpoints proc also seems used to check for follow-fork
	support by checking if catchpoints are supported.  If they are not, it
	uses "return -code return", which makes its caller return.  I find this
	unnecessary complex, versus just returning a boolean.  Modify it to do
	so.

	Change-Id: I23e62b204286c5e9c5c86d2727f7d33fb126ed08

2021-09-27  Simon Marchi  <simon.marchi@efficios.com>

	gdb.base/foll-fork.exp: remove gating based on target triplet
	It looks like this test has some code to check at runtime the support of
	fork handling of the target (see check_fork_catchpoints).  So, it seems
	to me that the check based on target triplet at the beginning of the
	test is not needed.  This kind of gating is generally not desirable,
	because we wouldn't think of updating it when adding fork support to a
	target.  For example, FreeBSD supports fork, but it wasn't listed here.

	Change-Id: I6b55f2298edae6b37c3681fb8633d8ea1b5aabee

2021-09-27  Simon Marchi  <simon.marchi@efficios.com>

	gdb.base/foll-fork.exp: remove DUPLICATEs
	Remove DUPLICATEs, and and at the same time replace two uses of
	gdb_test_multiple with gdb_test.  I don't think using gdb_test_multiple
	is necessary here.

	Change-Id: I8dcf097c3364e92d4f0e11f0c0f05dbb88e86742

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	libctf, lookup: fix bounds of pptrtab lookup
	An off-by-one bug in the check for pptrtab lookup meant that we could
	access the pptrtab past its bounds (*well* past its bounds),
	particularly if we called ctf_lookup_by_name in a child dict with "*foo"
	where "foo" is a type that exists in the parent but not the child and no
	previous lookups by name have been carried out.  (Note that "*foo" is
	not even a valid thing to call ctf_lookup_by_name with: foo * is.
	Nonetheless, users sometimes do call ctf_lookup_by_name with invalid
	content, and it should return ECTF_NOTYPE, not crash.)

	ctf_pptrtab_len, as its name suggests (and as other tests of it in
	ctf-lookup.c confirm), is one higher than the maximum valid permissible
	index, so the comparison is wrong.

	(Test added, which should fail pretty reliably in the presence of this
	bug on any machine with 4KiB pages.)

	libctf/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* ctf-lookup.c (ctf_lookup_by_name_internal): Fix pptrtab bounds.
		* testsuite/libctf-writable/pptrtab-writable-page-deep-lookup.*:
		New test.

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	libctf, testsuite: fix various warnings in tests
	These warnings are all off by default, but if they do fire you get
	spurious ERRORs when running make check-libctf.

	libctf/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* testsuite/libctf-lookup/enum-symbol.c: Remove unused label.
		* testsuite/libctf-lookup/conflicting-type-syms.c: Remove unused
		variables.
		* testsuite/libctf-regression/pptrtab.c: Likewise.
		* testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
		* testsuite/libctf-writable/pptrtab.c: Likewise.
		* testsuite/libctf-writable/reserialize-strtab-corruption.c:
		Likewise.
		* testsuite/libctf-regression/nonstatic-var-section-ld-r.c: Fix
		format string.
		* testsuite/libctf-regression/nonstatic-var-section-ld.c:
		Likewise.
		* testsuite/libctf-regression/nonstatic-var-section-ld.lk: Adjust.
		* testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Fix
		initializer.

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	libctf: fix handling of CTF symtypetab sections emitted by older GCC
	Older (pre-upstreaming) GCC emits a function symtypetab section of a
	format never read by any extant libctf.  We can detect such CTF dicts by
	the lack of the CTF_F_NEWFUNCINFO flag in their header, and we do so
	when reading in the symtypetab section -- but if the set of symbols with
	types is sufficiently sparse, even an older GCC will emit a function
	index section.

	In NEWFUNCINFO-capable compilers, this section will always be the exact
	same length as the corresponding function section (each is an array of
	uint32_t, associated 1:1 with each other). But this is not true for the
	older compiler, for which the sections are different lengths.  We check
	to see if the function symtypetab section and its index are the same
	length, but we fail to skip this check when this is not a NEWFUNCINFO
	dict, and emit a spurious corruption error for a CTF dict we could
	have perfectly well opened and used.

	Fix trivial: check the flag (and fix the terrible grammar of the error
	message at the same time).

	libctf/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* ctf-open.c (ctf_bufopen_internal): Don't complain about corrupt
		function index symtypetab sections if this is an old-format
		function symtypetab section (which should be ignored in any case).
		Fix bad grammar.

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	configure: regenerate in all projects that use libtool.m4
	(including sim/, which has no changelog.)

	bfd/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.

	binutils/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.

	gas/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.

	gprof/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.

	ld/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.

	libctf/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.
		* Makefile.in: Regenerate.

	opcodes/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.

	zlib/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		* configure: Regenerate.

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	libctf: try several possibilities for linker versioning flags
	Checking for linker versioning by just grepping ld --help output for
	mentions of --version-script is inadequate now that Solaris 11.4
	implements a --version-script with different semantics.  Try linking a
	test program with a small wildcard-using version script with each
	supported set of flags in turn, to make sure that linker versioning is
	not only advertised but actually works.

	The Solaris "GNU-compatible" linker versioning is not quite
	GNU-compatible enough, but we can work around the differences by
	generating a new version script that removes the comments from the
	original (Solaris ld requires #-style comments), and making another
	version script for libctf-nonbfd in particular which doesn't mention any
	of the symbols that appear in libctf.la, to avoid Solaris ld introducing
	corresponding new NOTYPE symbols to match the version script.

	libctf/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		PR libctf/27967
		* configure.ac (VERSION_FLAGS): Replace with...
		(ac_cv_libctf_version_script): ... this multiple test.
		(VERSION_FLAGS_NOBFD): Substitute this too.
		* Makefile.am (libctf_nobfd_la_LDFLAGS): Use it.  Split out...
		(libctf_ldflags_nover): ... non-versioning flags here.
		(libctf_la_LDFLAGS): Use it.
		* libctf.ver: Give every symbol not in libctf-nobfd a comment on
		the same line noting as much.

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	libtool.m4: fix nm BSD flag detection
	Libtool needs to get BSD-format (or MS-format) output out of the system
	nm, so that it can scan generated object files for symbol names for
	-export-symbols-regex support.  Some nms need specific flags to turn on
	BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
	Unfortunately the code to do this has a pair of interlocking flaws:

	 - it runs the test by doing an nm of /dev/null.  Some platforms
	   reasonably refuse to do an nm on a device file, but before now this
	   has only been worked around by assuming that the error message has a
	   specific textual form emitted by Tru64 nm, and that getting this
	   error means this is Tru64 nm and that nm -B would work to produce
	   BSD-format output, even though the test never actually got anything
	   but an error message out of nm -B.  This is fixable by nm'ing *nm
	   itself* (since we necessarily have a path to it).

	 - the test is entirely skipped if NM is set in the environment, on the
	   grounds that the user has overridden the test: but the user cannot
	   reasonably be expected to know that libtool wants not only nm but
	   also flags forcing BSD-format output.  Worse yet, one such "user" is
	   the top-level Cygnus configure script, which neither tests for
	   nor specifies any BSD-format flags.  So platforms needing BSD-format
	   flags always fail to set them when run in a Cygnus tree, breaking
	   -export-symbols-regex on such platforms.  Libtool also needs to
	   augment $LD on some platforms, but this is done unconditionally,
	   augmenting whatever the user specified: the nm check should do the
	   same.

	   One wrinkle: if the user has overridden $NM, a path might have been
	   provided: so we use the user-specified path if there was one, and
	   otherwise do the path search as usual.  (If the nm specified doesn't
	   work, this might lead to a few extra pointless path searches -- but
	   the test is going to fail anyway, so that's not a problem.)

	(Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
	symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
	*that* is a symlink to /usr/bin/nm.)

	ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		PR libctf/27967
		* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
		NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
		errors from nms that refuse to work on non-regular files.  Remove
		other workarounds for this problem.  Strip out blank lines from the
		nm output.

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	libtool.m4: augment symcode for Solaris 11
	This reports common symbols like GNU nm, via a type code of 'C'.

	ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		PR libctf/27967
		* libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for
		Solaris 11.

2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

	libctf: link against libiberty before linking in libbfd or libctf-nobfd
	This ensures that the CTF_LIBADD, which always contains at least this
	when doing a shared link:

	-L`pwd`/../libiberty/pic -liberty

	appears in the link line before any requirements pulled in by libbfd.la,
	which include -liberty but because it is install-time do not include the
	-L`pwd`/../libiberty/pic portion (in an indirect dep like this, the path
	comes from the libbfd.la file, and is an install path).  libiberty also
	appears after libbfd in the link line by virtue of libctf-nobfd.la,
	because libctf-nobfd has to follow libbfd in the link line, and that
	needs symbols from libiberty too.

	Without this, an installed liberty might well be pulled in by libbfd,
	and if --enable-install-libiberty is not specified this libiberty might
	be completely incompatible with what is being installed and break either
	or boht of libbfd and libctf. (The specific problem observed here is
	that bsearch_r was not present, but other problems might easily be
	observed in future too.)

	Because ld links against libctf, this has a tendency to break the system
	linker at install time too, if installing with --prefix=/usr.  That's
	quite unpleasant to recover from.

	libctf/ChangeLog
	2021-09-27  Nick Alcock  <nick.alcock@oracle.com>

		PR libctf/27360
		* Makefile.am (libctf_la_LIBADD): Link against libiberty
		before pulling in libbfd.la or pulling in libctf-nobfd.la.
		* Makefile.in: Regenerate.

2021-09-27  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Fix build with g++-4.8
	When building g++-4.8, we run into:
	...
	src/gdb/dwarf2/read.c:919:5: error: multiple fields in union \
	  'partial_die_info::<anonymous union>' initialized
	...

	This is due to:
	...
	    union
	    {
	      struct
	      {
	       CORE_ADDR lowpc = 0;
	       CORE_ADDR highpc = 0;
	      };
	      ULONGEST ranges_offset;
	    };
	...

	The error looks incorrect, given that only one union member is initialized,
	and does not reproduce with newer g++.

	Nevertheless, work around this by moving the initialization to a constructor.

	[ I considered just removing the initialization, with the idea that access
	should be guarded by has_pc_info, but I ran into one failure in the testsuite,
	for gdb.base/check-psymtab.exp due to add_partial_symbol using lowpc without
	checking has_pc_info. ]

	Tested on x86_64-linux.

2021-09-27  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: add setting to disable reading source code files
	In some situations it is possible that a user might not want GDB to
	try and access source code files, for example, the source code might
	be stored on a slow to access network file system.

	It is almost certainly possible that using some combination of 'set
	directories' and/or 'set substitute-path' a user can trick GDB into
	being unable to find the source files, but this feels like a rather
	crude way to solve the problem.

	In this commit a new option is add that stops GDB from opening and
	reading the source files.  A user can run with source code reading
	disabled if this is required, then re-enable later if they decide
	that they now want to view the source code.

2021-09-27  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: remove duplicate cmd_list_element declarations
	For some reason we have two locations where cmd_list_elements are
	declared, cli/cli-cmds.h and gdbcmd.h.  Worse still there is
	duplication between these two locations.

	In this commit I have moved all of the cmd_list_element declarations
	from gdbcmd.h into cli/cli-cmds.h and removed the duplicates.

	There should be no user visible changes after this commit.

2021-09-27  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: prevent an assertion when computing the frame_id for an inline frame
	I ran into this assertion while GDB was trying to unwind the stack:

	  gdb/inline-frame.c:173: internal-error: void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion `frame_id_p (*this_id)' failed.

	That is, when building the frame_id for an inline frame, GDB asks for
	the frame_id of the previous frame.  Unfortunately, no valid frame_id
	was returned for the previous frame, and so the assertion triggers.

	What is happening is this, I had a stack that looked something like
	this (the arrows '->' point from caller to callee):

	  normal_frame -> inline_frame

	However, for whatever reason (e.g. broken debug information, or
	corrupted stack contents in the inferior), when GDB tries to unwind
	"normal_frame", it ends up getting back effectively the same frame,
	thus the call stack looks like this to GDB:

	  .-> normal_frame -> inline_frame
	  |     |
	  '-----'

	Given such a situation we would expect GDB to terminate the stack with
	an error like this:

	  Backtrace stopped: previous frame identical to this frame (corrupt stack?)

	However, the inline_frame causes a problem, and here's why:

	When unwinding we start from the sentinel frame and call
	get_prev_frame.  We eventually end up in get_prev_frame_if_no_cycle,
	in here we create a raw frame, and as this is frame #0 we immediately
	return.

	However, eventually we will try to unwind the stack further.  When we
	do this we inevitably needing to know the frame_id for frame #0, and
	so, eventually, we end up in compute_frame_id.

	In compute_frame_id we first find the right unwinder for this frame,
	in our case (i.e. for inline_frame) the $pc is within the function
	normal_frame, but also within a block associated with the inlined
	function inline_frame, as such the inline frame unwinder claims this
	frame.

	Back in compute_frame_id we next compute the frame_id, for our
	inline_frame this means a call to inline_frame_this_id.

	The ID of an inline frame is based on the id of the previous frame, so
	from inline_frame_this_id we call get_prev_frame_always, this
	eventually calls get_prev_frame_if_no_cycle again, which creates
	another raw frame and calls compute_frame_id (for frames other than
	frame 0 we immediately compute the frame_id).

	In compute_frame_id we again identify the correct unwinder for this
	frame.  Our $pc is unchanged, however, the fact that the next frame is
	of type INLINE_FRAME prevents the inline frame unwinder from claiming
	this frame again, and so, the standard DWARF frame unwinder claims
	normal_frame.

	We return to compute_frame_id and call the standard DWARF function to
	build the frame_id for normal_frame.

	With the frame_id of normal_frame figured out we return to
	compute_frame_id, and then to get_prev_frame_if_no_cycle, where we add
	the ID for normal_frame into the frame_id cache, and return the frame
	back to inline_frame_this_id.

	From inline_frame_this_id we build a frame_id for inline_frame and
	return to compute_frame_id, and then to get_prev_frame_if_no_cycle,
	which adds the frame_id for inline_frame into the frame_id cache.

	So far, so good.

	However, as we are trying to unwind the complete stack, we eventually
	ask for the previous frame of normal_frame, remember, at this point
	GDB doesn't know the stack is corrupted (with a cycle), GDB still
	needs to figure that out.

	So, we eventually end up in get_prev_frame_if_no_cycle where we create
	a raw frame and call compute_frame_id, remember, this is for the frame
	before normal_frame.

	The first task for compute_frame_id is to find the unwinder for this
	frame, so all of the frame sniffers are tried in order, this includes
	the inline frame sniffer.

	The inline frame sniffer asks for the $pc, this request is sent up the
	stack to normal_frame, which, due to its cyclic behaviour, tells GDB
	that the $pc in the previous frame was the same as the $pc in
	normal_frame.

	GDB spots that this $pc corresponds to both the function normal_frame
	and also the inline function inline_frame.  As the next frame is not
	an INLINE_FRAME then GDB figures that we have not yet built a frame to
	cover inline_frame, and so the inline sniffer claims this new frame.
	Our stack is now looking like this:

	  inline_frame -> normal_frame -> inline_frame

	But, we have not yet computed the frame id for the outer most (on the
	left) inline_frame.  After the frame sniffer has claimed the inline
	frame GDB returns to compute_frame_id and calls inline_frame_this_id.

	In here GDB calls get_prev_frame_always, which eventually ends up
	in get_prev_frame_if_no_cycle again, where we create a raw frame and
	call compute_frame_id.

	Just like before, compute_frame_id tries to find an unwinder for this
	new frame, it sees that the $pc is within both normal_frame and
	inline_frame, but the next frame is, again, an INLINE_FRAME, so, just
	like before the standard DWARF unwinder claims this frame.  Back in
	compute_frame_id we again call the standard DWARF function to build
	the frame_id for this new copy of normal_frame.

	At this point the stack looks like this:

	  normal_frame -> inline_frame -> normal_frame -> inline_frame

	After compute_frame_id we return to get_prev_frame_if_no_cycle, where
	we try to add the frame_id for the new normal_frame into the frame_id
	cache, however, unlike before, we fail to add this frame_id as it is
	a duplicate of the previous normal_frame frame_id.  Having found a
	duplicate get_prev_frame_if_no_cycle unlinks the new frame from the
	stack, and returns nullptr, the stack now looks like this:

	  inline_frame -> normal_frame -> inline_frame

	The nullptr result from get_prev_frame_if_no_cycle is fed back to
	inline_frame_this_id, which forwards this to get_frame_id, which
	immediately returns null_frame_id.  As null_frame_id is not considered
	a valid frame_id, this is what triggers the assertion.

	In summary then:

	 - inline_frame_this_id currently assumes that as the inline frame
	   exists, we will always get a valid frame back from
	   get_prev_frame_always,

	 - get_prev_frame_if_no_cycle currently assumes that it is safe to
	   return nullptr when it sees a cycle.

	Notice that in frame.c:compute_frame_id, this code:

	  fi->this_id.value = outer_frame_id;
	  fi->unwind->this_id (fi, &fi->prologue_cache, &fi->this_id.value);
	  gdb_assert (frame_id_p (fi->this_id.value));

	The assertion makes it clear that the this_id function must always
	return a valid frame_id (e.g. null_frame_id is not a valid return
	value), and similarly in inline_frame.c:inline_frame_this_id this
	code:

	  *this_id = get_frame_id (get_prev_frame_always (this_frame));
	  /* snip comment */
	  gdb_assert (frame_id_p (*this_id));

	Makes it clear that every inline frame expects to be able to get a
	previous frame, which will have a valid frame_id.

	As I have discussed above, these assumptions don't currently hold in
	all cases.

	One possibility would be to move the call to get_prev_frame_always
	forward from inline_frame_this_id to inline_frame_sniffer, however,
	this falls foul of (in frame.c:frame_cleanup_after_sniffer) this
	assertion:

	  /* No sniffer should extend the frame chain; sniff based on what is
	     already certain.  */
	  gdb_assert (!frame->prev_p);

	This assert prohibits any sniffer from trying to get the previous
	frame, as getting the previous frame is likely to depend on the next
	frame, I can understand why this assertion is a good thing, and I'm in
	no rush to alter this rule.

	The solution proposed here takes onboard feedback from both Pedro, and
	Simon (see the links below).  The get_prev_frame_if_no_cycle function
	is renamed to get_prev_frame_maybe_check_cycle, and will now not do
	cycle detection for inline frames, even when we spot a duplicate frame
	it is still returned.  This is fine, as, if the normal frame has a
	duplicate frame-id then the inline frame will also have a duplicate
	frame-id.  And so, when we reject the inline frame, the duplicate
	normal frame, which is previous to the inline frame, will also be
	rejected.

	In inline-frame.c the call to get_prev_frame_always is no longer
	nested inside the call to get_frame_id.  There are reasons why
	get_prev_frame_always can return nullptr, for example, if there is a
	memory error while trying to get the previous frame, if this should
	happen then we now give a more informative error message.

	Historical Links:

	 Patch v2: https://sourceware.org/pipermail/gdb-patches/2021-June/180208.html
	 Feedback: https://sourceware.org/pipermail/gdb-patches/2021-July/180651.html
	           https://sourceware.org/pipermail/gdb-patches/2021-July/180663.html

	 Patch v3: https://sourceware.org/pipermail/gdb-patches/2021-July/181029.html
	 Feedback: https://sourceware.org/pipermail/gdb-patches/2021-July/181035.html

	 Additional input: https://sourceware.org/pipermail/gdb-patches/2021-September/182040.html

2021-09-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/dcache-flush.exp
	When running test-case gdb.base/dcache-flush.exp on ubuntu 18.04.5, I run into:
	...
	(gdb) PASS: gdb.base/dcache-flush.exp: p var2
	info dcache^M
	Dcache 4096 lines of 64 bytes each.^M
	Contains data for Thread 0x7ffff7fc6b80 (LWP 3551)^M
	Line 0: address 0x7fffffffd4c0 [47 hits]^M
	Line 1: address 0x7fffffffd500 [31 hits]^M
	Line 2: address 0x7fffffffd5c0 [7 hits]^M
	Cache state: 3 active lines, 85 hits^M
	(gdb) FAIL: gdb.base/dcache-flush.exp: check dcache before flushing
	...
	The regexp expects "Contains data for process $decimal".

	This is another case of thread_db_target::pid_to_str being used.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

2021-09-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Test sw watchpoint in gdb.threads/process-dies-while-detaching.exp
	The test-case gdb.threads/process-dies-while-detaching.exp takes about 20s
	when using hw watchpoints, but when forcing sw watchpoints (using the patch
	mentioned in PR28375#c0), the test-case takes instead 3m14s.

	Also, it show a FAIL:
	...
	(gdb) continue^M
	Continuing.^M
	Cannot find user-level thread for LWP 10324: generic error^M
	(gdb) FAIL: gdb.threads/process-dies-while-detaching.exp: single-process:
	continue: watchpoint: continue
	...
	for which PR28375 was filed.

	Modify the test-case to:
	- add the hw/sw axis to the watchpoint testing, to ensure that we
	  observe the sw watchpoint behaviour also on can-use-hw-watchpoints
	  architectures.
	- skip the hw breakpoint testing if not supported
	- set the sw watchpoint later to avoid making the test
	  too slow.  This still triggers the same PR, but now takes just 24s.

	This patch adds a KFAIL for PR28375.

	Tested on x86_64-linux.

2021-09-27  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix indentation in gdbtypes.c
	Change-Id: I7bfbb9d349a1f474256800c45e28fe3b1de08771

2021-09-27  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-26  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-26  Peter Bergner  <bergner@linux.ibm.com>

	PowerPC: Enable mfppr mfppr32, mtppr and mtppr32 extended mnemonics on POWER5
	SPR 896 and the mfppr mfppr32, mtppr and mtppr32 extended mnemonics were added
	in ISA 2.03, so enable them on POWER5 and later.

	opcodes/
		* ppc-opc.c (powerpc_opcodes) <mfppr, mfppr32, mtppr, mtppr32>: Enable
		on POWER5 and later.

	gas/
		* testsuite/gas/ppc/power5.s: New test.
		* testsuite/gas/ppc/power5.d: Likewise.
		* testsuite/gas/ppc/ppc.exp: Run it.
		* testsuite/gas/ppc/power7.s: Remove tests for mfppr, mfppr32, mtppr
		and mtppr32.
		* testsuite/gas/ppc/power7.d: Likewise.

2021-09-25  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Minimize gdb restarts
	Minimize gdb restarts, applying the following rules:
	- don't use prepare_for_testing unless necessary
	- don't use clean_restart unless necessary

	Also, if possible, replace build_for_executable + clean_restart
	with prepare_for_testing for brevity.

	Touches 68 test-cases.

	Tested on x86_64-linux.

2021-09-25  Alan Modra  <amodra@gmail.com>

	PR28346, segfault attempting to disassemble raw binary
	Don't attempt to access elf_section_data for non-ELF sections.

		PR 28346
		* elf32-xtensa.c (xtensa_read_table_entries): Return zero entries
		for non-ELF.

2021-09-25  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-24  Hans-Peter Nilsson  <hp@axis.com>

	gas/testsuite/ld-elf/dwarf2-21.d: Pass -W
	Required for the expected "CU:" to be emitted for long
	source-paths.  See binutils/dwarf.c:

	 if (do_wide || strlen (directory) < 76)
	   printf (_("CU: %s/%s:\n"), directory, file_table[0].name);
	 else
	   printf ("%s:\n", file_table[0].name);

	See also commit 5f410aa50ce2c, "testsuite/ld-elf/pr26936.d:
	Pass -W."

	gas/ChangeLog:
		* testsuite/ld-elf/dwarf2-21.d: Pass -W.

2021-09-24  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: change thread_info::name to unique_xmalloc_ptr, add helper function
	This started out as changing thread_info::name to a unique_xmalloc_ptr.
	That showed that almost all users of that field had the same logic to
	get a thread's name: use thread_info::name if non-nullptr, else ask the
	target.  Factor out this logic in a new thread_name free function.  Make
	the field private (rename to m_name) and add some accessors.

	Change-Id: Iebdd95f4cd21fbefc505249bd1d05befc466a2fc

2021-09-24  Tom Tromey  <tom@tromey.com>

	Move value_true to value.h
	I noticed that value_true is declared in language.h and defined in
	language.c.  However, as part of the value API, I think it would be
	better in one of those files.  And, because it is very short, I
	changed it to be an inline function in value.h.  I've also removed a
	comment from the implementation, on the basis that it seems obsolete
	-- if the change it suggests was needed, it probably would have been
	done by now; and if it is needed in the future, odds are it would be
	done differently anyway.

	Finally, this patch also changes value_true and value_logical_not to
	return a bool, and updates some uses.

2021-09-24  Pedro Alves  <pedro@palves.net>

	Make dcache multi-target-safe
	By inspection, I noticed that this code in dcache.c is not
	multi-target-aware:

	  /* If this is a different inferior from what we've recorded,
	     flush the cache.  */

	  if (inferior_ptid != dcache->ptid)

	This doesn't take into account that threads of different targets may
	have the same ptid.

	Fixed by also storing/comparing the process_stratum_target.

	Tested on x86-64-linux-gnu, native and gdbserver.

	Change-Id: I4d9d74052c696b72d28cb1c77b697b911725c8d3

2021-09-24  Pedro Alves  <pedro@palves.net>

	Fix 'FAIL: gdb.perf/disassemble.exp: python Disassemble().run()'
	We currently have one FAIL while running "make check-perf":

	  PerfTest::assemble, run ...
	  python Disassemble().run()
	  Traceback (most recent call last):
	    File "<string>", line 1, in <module>
	    File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/perftest.py", line 64, in run
	      self.warm_up()
	    File "<string>", line 25, in warm_up
	  gdb.error: No symbol "ada_evaluate_subexp" in current context.
	  Error while executing Python code.
	  (gdb) FAIL: gdb.perf/disassemble.exp: python Disassemble().run()
	  ...

	The gdb.perf/disassemble.exp testcase debugs GDB with itself, runs to
	main, and then disassembles a few GDB functions.  The problem is that
	most(!) functions it is trying to disassemble are now gone...

	This commit fixes the issue by simply picking some other functions to
	disassemble.

	It would perhaps be better to come up with some test program to
	disassemble, one that would stay the same throughout the years,
	instead of disassembling GDB itself.  I don't know why that wasn't
	done to begin with.  I'll have to leave that for another rainy day,
	though.

	gdb/testsuite/
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

		* gdb.perf/disassemble.py (Disassemble::warm_up): Disassemble
		evaluate_subexp_do_call instead of ada_evaluate_subexp.
		(Disassemble::warm_up): Disassemble "captured_main",
		"run_inferior_call" and "update_global_location_list" instead of
		"evaluate_subexp_standard" and "c_parse_internal".

	Change-Id: I89d1cca89ce2e495dea5096e439685739cc0d3df

2021-09-24  Pedro Alves  <pedro@palves.net>

	Fix all PATH problems in testsuite/gdb.perf/
	Currently "make check-perf" triggers ~40 PATH messages in gdb.sum:

	  ...
	  PATH: gdb.perf/backtrace.exp: python sys.path.insert(0, os.path.abspath("/home/pedro/rocm/gdb/build/gdb/../../src/gdb/testsuite/gdb.perf/lib"))
	  PATH: gdb.perf/backtrace.exp: python exec (open ('/home/pedro/rocm/gdb/build/gdb/testsuite/outputs/gdb.perf/backtrace/backtrace.py').read ())
	  ...

	This commit fixes them.  E.g. before/after gdb.sum diff:

	 -PASS: gdb.perf/backtrace.exp: python import os, sys
	 -PASS: gdb.perf/backtrace.exp: python sys.path.insert(0, os.path.abspath("/home/pedro/rocm/gdb/build-master/gdb/../../src/gdb/testsuite/gdb.perf/lib"))
	 -PATH: gdb.perf/backtrace.exp: python sys.path.insert(0, os.path.abspath("/home/pedro/rocm/gdb/build-master/gdb/../../src/gdb/testsuite/gdb.perf/lib"))
	 -PASS: gdb.perf/backtrace.exp: python exec (open ('/home/pedro/rocm/gdb/build-master/gdb/testsuite/outputs/gdb.perf/backtrace/backtrace.py').read ())
	 -PATH: gdb.perf/backtrace.exp: python exec (open ('/home/pedro/rocm/gdb/build-master/gdb/testsuite/outputs/gdb.perf/backtrace/backtrace.py').read ())
	 +PASS: gdb.perf/backtrace.exp: setup perftest: python import os, sys
	 +PASS: gdb.perf/backtrace.exp: setup perftest: python sys.path.insert(0, os.path.abspath("${srcdir}/gdb.perf/lib"))
	 +PASS: gdb.perf/backtrace.exp: setup perftest: python exec (open ('${srcdir}/gdb.perf/backtrace.py').read ())

	gdb/testsuite/
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

		* lib/perftest.exp (PerfTest::_setup_perftest): Use
		with_test_prefix.  Add explicit test names to python invocations,
		with "$srcdir" not expanded.

	Change-Id: I50a31b04b7abdea754139509e4a34ae9263118a4

2021-09-24  Pedro Alves  <pedro@palves.net>

	Fix all DUPLICATE problems in testsuite/gdb.perf/
	Currently running "make check-perf" shows:

	 ...
	 # of duplicate test names       6008
	 ...

	All those duplicate test names come from gdb.perf/skip-command.exp.
	This commit fixes them, using with_test_prefix.

	gdb/testsuite/
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

		* gdb.perf/skip-command.exp (run_skip_bench): Wrap each for
		iteration in with_test_prefix.

	Change-Id: I38501cf70bc6b60306ee7228996ee7bcd858dc1b

2021-09-24  Tom Tromey  <tromey@adacore.com>

	Fix handling of DW_AT_data_bit_offset
	A newer version of GCC will now emit member locations using just
	DW_AT_data_bit_offset, like:

	 <3><14fe>: Abbrev Number: 1 (DW_TAG_member)
	    <14ff>   DW_AT_name        : (indirect string, offset: 0x215e): nb_bytes
	    <1503>   DW_AT_decl_file   : 1
	    <1503>   DW_AT_decl_line   : 10
	    <1504>   DW_AT_decl_column : 7
	    <1505>   DW_AT_type        : <0x150b>
	    <1509>   DW_AT_bit_size    : 31
	    <150a>   DW_AT_data_bit_offset: 64

	whereas earlier versions would emit something like:

	 <3><164f>: Abbrev Number: 7 (DW_TAG_member)
	    <1650>   DW_AT_name        : (indirect string, offset: 0x218d): nb_bytes
	    <1654>   DW_AT_decl_file   : 1
	    <1655>   DW_AT_decl_line   : 10
	    <1656>   DW_AT_decl_column : 7
	    <1657>   DW_AT_type        : <0x165f>
	    <165b>   DW_AT_byte_size   : 4
	    <165c>   DW_AT_bit_size    : 31
	    <165d>   DW_AT_bit_offset  : 1
	    <165e>   DW_AT_data_member_location: 8

	That is, DW_AT_data_member_location is not emitted any more.  This is
	a change due to the switch to DWARF 5 by default.

	This change pointed out an existing bug in gdb, namely that the
	attr_to_dynamic_prop depends on the presence of
	DW_AT_data_member_location.  This patch moves the handling of
	DW_AT_data_bit_offset into handle_data_member_location, and updates
	attr_to_dynamic_prop to handle this new case.

	A new test case is included.  This test fails with GCC 11, but passes
	with an earlier version of GCC.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Don't leave gdb instance running after function_range
	A typical dwarf assembly test-case start like this:
	...
	standard_testfile .c -debug.S

	set asm_file [standard_output_file $srcfile2]
	Dwarf::assemble $asm_file {
	  ...
	}

	if { [prepare_for_testing "failed to prepare" ${testfile} \
		  [list $srcfile $asm_file] {nodebug}] } {
	    return -1
	}
	...

	When accidentally using build_for_executable instead of
	prepare_for_testing (or intentionally using it but forgetting to add
	clean_restart $binfile or some such) the mistake may not be caught, because
	another gdb instance is still running, and we may silently end up testing
	compiler-generated DWARF.

	This can be caused by something relatively obvious, like an earlier
	prepare_for_testing or clean_restart, but also by something more obscure like
	function_range, which may even be triggered by dwarf assembly like this:
	...
	  {MACRO_AT_func {main}}
	...

	Fix this by calling gdb_exit at the end of function_range.

	Also fix the fallout of that in test-case gdb.dwarf2/dw2-bad-elf.exp, where a
	get_sizeof call used the gdb instance left lingering by function_range.

	[ A better and more complete fix would add a new proc get_exec_info, that would
	be called at the start of the dwarf assembly body:
	...
	Dwarf::assemble $asm_file {
	  get_exec_info {main foo} {int void*}
	...
	that would:
	- do a prepare_for_testing with $srcfile (roughtly equivalent to what
	  MACRO_AT_func does,
	- call function_range for all functions main and foo, without starting a
	  new gdb instance
	- set corresponding variables at the call-site: main_start, main_len,
	  main_end, foo_start, foo_len, foo_end.
	- get size for types int and void*
	- set corresponding variables at the call-site: int_size, void_ptr_size.
	- do a gdb_exit. ]

	Tested on x86_64-linux.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use pie instead of -fpie/-pie
	I noticed two test-cases where -fpie is used.  Using the canonical pie option
	will usually get one -fPIE instead.

	That choice is justified here in gdb_compile:
	...
	  # For safety, use fPIE rather than fpie. On AArch64, m68k, PowerPC
	  # and SPARC, fpie can cause compile errors due to the GOT exceeding
	  # a maximum size.  On other architectures the two flags are
	  # identical (see the GCC manual). Note Debian9 and Ubuntu16.10
	  # onwards default GCC to using fPIE.  If you do require fpie, then
	  # it can be set using the pie_flag.
	  set flag "additional_flags=-fPIE"
	...

	There is no indication that using -fpie rather than -fPIE is on purpose, so
	use pie instead.

	Tested on x86_64-linux.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Factor out dump_info in gdb.testsuite/dump-system-info.exp
	Factor out new proc dump_info in test-case gdb.testsuite/dump-system-info.exp,
	and in the process:
	- fix a few typos
	- remove unnecessary "test -r /proc/cpuinfo"

	Tested on x86_64-linux.

	Co-Authored-By: Pedro Alves <pedro@palves.net>

2021-09-24  Pedro Alves  <pedro@palves.net>

	gdb/testsuite: Make it possible to use TCL variables in DWARF assembler loclists
	It is currently not possible to use variables in locations lists.  For
	example, with:

	  diff --git a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
	  index 6b4f5c8cbb8..cdbf948619f 100644
	  --- a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
	  +++ b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp
	  @@ -30,6 +30,8 @@ if {![dwarf2_support]} {
	       return 0
	   }

	  +set myconst 0x123456
	  +
	   # Test with 32-bit and 64-bit DWARF.
	   foreach_with_prefix is_64 {false true} {
	       if { $is_64 } {
	  @@ -49,6 +51,7 @@ foreach_with_prefix is_64 {false true} {
		  global func1_addr func1_len
		  global func2_addr func2_len
		  global is_64
	  +       global myconst

		  # The CU uses the DW_FORM_loclistx form to refer to the .debug_loclists
		  # section.
	  @@ -107,7 +110,7 @@ foreach_with_prefix is_64 {false true} {
			  list_ {
			      # When in func1.
			      start_length $func1_addr $func1_len {
	  -                       DW_OP_constu 0x123456
	  +                       DW_OP_constu $myconst
				  DW_OP_stack_value
			      }

	we get:

	  $ make check TESTS="*/loclists-multiple-cus.exp"
	  ...
	  gdb compile failed, build/gdb/testsuite/outputs/gdb.dwarf2/loclists-multiple-cus/loclists-multiple-cus-dw32.S: Assembler messages:
	  build/gdb/testsuite/outputs/gdb.dwarf2/loclists-multiple-cus/loclists-multiple-cus-dw32.S:78: Error: leb128 operand is an undefined symbol: $myconst
	  ...

	That means $myconst was copied literally to the generated assembly
	file.

	This patch fixes it, by running subst on the location list body, in
	the context of the caller.  The fix is applied to both
	Dwarf::loclists::table::list_::start_length and
	Dwarf::loclists::table::list_::start_end.

	Reported-by: Zoran Zaric <Zoran.Zaric@amd.com>

	Change-Id: I615a64431857242d9f477d5699e3732df1b31322

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix DUPLICATEs in gdb.dwarf2/implptr-64bit.exp
	When running test-case gdb.dwarf2/implptr-64bit.exp with target board
	unix/-m32, I noticed:
	...
	DUPLICATE: gdb.dwarf2/implptr-64bit.exp: failed to prepare
	...

	Fix this by using with_test_prefix.

	Tested on x86_64-linux.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix DUPLICATEs gdb.dwarf2/dw2-is-stmt.exp
	Fix these DUPLICATEs by using with_test_prefix:
	...
	DUPLICATE: gdb.dwarf2/dw2-is-stmt.exp: ensure we saw a valid line pattern, 1
	DUPLICATE: gdb.dwarf2/dw2-is-stmt.exp: ensure we saw a valid line pattern, 2
	...

	Tested on x86_64-linux.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix set $var val in gdb.dwarf2/dw2-is-stmt.exp
	When doing a testrun with:
	...
	$ make check RUNTESTFLAGS=$(cd $src/gdb/testsuite/; echo gdb.dwarf2/*.exp)
	...
	I ran into:
	...
	ERROR: tcl error sourcing gdb.dwarf2/dw2-is-stmt.exp.
	ERROR: expected integer but got "dw2-abs-hi-pc-world.c"
	    while executing
	"incr i"
	...

	The variable i is set in gdb.dwarf2/dw2-abs-hi-pc.exp, and leaks to
	gdb.dwarf2/dw2-is-stmt.exp.  It's not removed by gdb_cleanup_globals because i
	is set as global variable by runtest.exp, which does:
	...
	for { set i 0 } { $i < $argc } { incr i } {
	...
	at toplevel but forgets to unset the variable.

	Fix this by removing '$' in front of the variable name when doing set:
	...
	-set $i 0
	+set i 0
	...

	Tested on x86_64-linux.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix DUPLICATE in gdb.base/load-command.exp
	Fix this duplicate:
	...
	DUPLICATE: gdb.base/load-command.exp: check initial value of the_variable
	...
	by using with_test_prefix.

	Tested on x86_64-linux.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use pie/nopie instead of ldflags=-pie/-no-pie
	I noticed two test-case that use ldflags=-pie and ldflags-no-pie, instead of
	the canonical pie and nopie options, which would typically also add
	additional_flags=-fPIE respectively additional_flags=-fno-pie.

	There is no indication that this is on purpose, so replace these with pie and
	nopie.

	Tested on x86_64-linux.

2021-09-24  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add gdb.testsuite/dump-system-info.exp
	When interpreting the testsuite results, it's often relevant what kind of
	machine the testsuite ran on.  On a local machine one can just do
	/proc/cpuinfo, but in case of running tests using a remote system
	that distributes test runs to other remote systems that are not directly
	accessible, that's not possible.

	Fix this by dumping /proc/cpuinfo into the gdb.log, as well as lsb_release -a
	and uname -a.

	We could do this at the start of each test run, by putting it into unix.exp
	or some such.  However, this might be too verbose, so we choose to put it into
	its own test-case, such that it get triggered in a full testrun, but not when
	running one or a subset of tests.

	We put the test-case into the gdb.testsuite directory, which is currently the
	only place in the testsuite where we do not test gdb.   [ Though perhaps this
	could be put into a new gdb.info directory, since the test-case doesn't
	actually test the testsuite. ]

	Tested on x86_64-linux.

2021-09-24  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-23  Tom Tromey  <tom@tromey.com>

	Change pointer_type to a method of struct type
	I noticed that pointer_type is declared in language.h and defined in
	language.c.  However, it really has to do with types, so it should
	have been in gdbtypes.h all along.

	This patch changes it to be a method on struct type.  And, I went
	through uses of TYPE_IS_REFERENCE and updated many spots to use the
	new method as well.  (I didn't update ones that were in arch-specific
	code, as I couldn't readily test that.)

2021-09-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Support -fPIE/-fno-PIE/-pie/-no-pie in gdb_compile_rust
	When running gdb.rust/*.exp test-cases with target board unix/-fPIE/-pie, I
	run into:
	...
	builtin_spawn -ignore SIGHUP rustc --color never gdb.rust/watch.rs \
	  -g -lm -fPIE -pie -o outputs/gdb.rust/watch/watch^M
	error: Unrecognized option: 'f'^M
	^M
	compiler exited with status 1
	...

	The problem is that -fPIE and -fpie are gcc options, but for rust we use
	rustc, which has different compilation options.

	Fix this by translating the gcc options to rustc options in gdb_compile_rust,
	similar to how that is done for ada in target_compile_ada_from_dir.

	Likewise for unix/-fno-PIE/-no-pie.

	Tested on x86_64-linux, with:
	- native
	- unix/-fPIE/-pie
	- unix/-fno-PIE/-no-pie
	specifically, on openSUSE Leap 15.2 both with package gcc-PIE:
	- installed (making gcc default to PIE)
	- uninstalled (making gcc default to non-PIE).
	and rustc 1.52.1.

2021-09-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use pie instead of -fPIE -pie
	Replace {additional_flags=-fPIE ldflags=-pie} with {pie}.

	This makes sure that the test-cases properly error out when using target board
	unix/-fno-PIE/-no-pie.

	Tested on x86_64-linux.

2021-09-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix probe test in gdb.base/break-interp.exp
	When running test-case gdb.base/break-interp.exp on ubuntu 18.04.5, we have:
	...
	 (gdb) bt^M
	 #0  0x00007eff7ad5ae12 in ?? () from break-interp-LDprelinkNOdebugNO^M
	 #1  0x00007eff7ad71f50 in ?? () from break-interp-LDprelinkNOdebugNO^M
	 #2  0x00007eff7ad59128 in ?? () from break-interp-LDprelinkNOdebugNO^M
	 #3  0x00007eff7ad58098 in ?? () from break-interp-LDprelinkNOdebugNO^M
	 #4  0x0000000000000002 in ?? ()^M
	 #5  0x00007fff505d7a32 in ?? ()^M
	 #6  0x00007fff505d7a94 in ?? ()^M
	 #7  0x0000000000000000 in ?? ()^M
	 (gdb) FAIL: gdb.base/break-interp.exp: ldprelink=NO: ldsepdebug=NO: \
	         first backtrace: dl bt
	...

	Using the backtrace, the test-case tries to establish that we're stopped in
	dl_main.

	However, the backtrace only shows an address, because:
	- the dynamic linker contains no minimal symbols and no debug info, and
	- gdb is build without --with-separate-debug-dir so it can't find the
	  corresponding .debug file, which does contain the mimimal symbols and
	  debug info.

	As in "[gdb/testsuite] Improve probe detection in gdb.base/break-probes.exp",
	fix this by doing info probes and grepping for the address.

	Tested on x86_64-linux.

2021-09-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Improve probe detection in gdb.base/break-probes.exp
	When running test-case gdb.base/break-probes.exp on ubuntu 18.04.5, we have:
	...
	 (gdb) run^M
	 Starting program: break-probes^M
	 Stopped due to shared library event (no libraries added or removed)^M
	 (gdb) bt^M
	 #0  0x00007ffff7dd6e12 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #1  0x00007ffff7dedf50 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #2  0x00007ffff7dd5128 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #3  0x00007ffff7dd4098 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #4  0x0000000000000001 in ?? ()^M
	 #5  0x00007fffffffdaac in ?? ()^M
	 #6  0x0000000000000000 in ?? ()^M
	 (gdb) UNSUPPORTED: gdb.base/break-probes.exp: probes not present on this system
	...

	Using the backtrace, the test-case tries to establish that we're stopped in
	dl_main, which is used as proof that we're using probes.

	However, the backtrace only shows an address, because:
	- the dynamic linker contains no minimal symbols and no debug info, and
	- gdb is build without --with-separate-debug-dir so it can't find the
	  corresponding .debug file, which does contain the mimimal symbols and
	  debug info.

	Fix this by instead printing the pc and grepping for the value in the
	info probes output:
	...
	(gdb) p /x $pc^M
	$1 = 0x7ffff7dd6e12^M
	(gdb) info probes^M
	Type Provider Name           Where              Object                      ^M
	  ...
	stap rtld     init_start     0x00007ffff7dd6e12 /lib64/ld-linux-x86-64.so.2 ^M
	  ...
	(gdb)
	...

	Tested on x86_64-linux.

2021-09-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle failing probe detection in gdb.base/break-probes.exp
	When running test-case gdb.base/break-probes.exp on ubuntu 18.04.5, we have:
	...
	 (gdb) bt^M
	 #0  0x00007ffff7dd6e12 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #1  0x00007ffff7dedf50 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #2  0x00007ffff7dd5128 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #3  0x00007ffff7dd4098 in ?? () from /lib64/ld-linux-x86-64.so.2^M
	 #4  0x0000000000000001 in ?? ()^M
	 #5  0x00007fffffffdaac in ?? ()^M
	 #6  0x0000000000000000 in ?? ()^M
	 (gdb) FAIL: gdb.base/break-probes.exp: ensure using probes
	...

	The test-case intends to emit an UNTESTED in this case, but fails to do so
	because it tries to do it in a regexp clause in a gdb_test_multiple, which
	doesn't trigger.  Instead, a default clause triggers which produces the FAIL.

	Also the use of UNTESTED is not appropriate, and we should use UNSUPPORTED
	instead.

	Fix this by silencing the FAIL, and emitting an UNSUPPORTED after the
	gdb_test_multiple:
	...
	 if { ! $using_probes } {
	+    unsupported "probes not present on this system"
	     return -1
	 }
	...

	Tested on x86_64-linux.

2021-09-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use early-out style in gdb.base/break-probes.exp
	Reduce indentation and improve readability in test-case
	gdb.base/break-probes.exp by replacing:
	...
	if { <cond> } {
	  <lots-of-code>
	}
	...
	with:
	...
	if { ! <cond> } {
	  return -1
	}
	<lots-of-code>
	...

	Tested on x86_64-linux.

2021-09-23  Pedro Alves  <pedro@palves.net>

	Test that frame info/IDs are stable/consistent
	This adds a testcase that tests that the unwinder produces consistent
	frame info and frame IDs by making sure that "info frame" shows the
	same result when stopped at a function (level == 0), compared to when
	we find the same frame in the stack at a level > 0.

	E.g., on x86-64, right after running to main, we see:

	  (gdb) info frame
	  Stack level 0, frame at 0x7fffffffd340:
	   rip = 0x555555555168 in main (gdb.base/backtrace.c:41); saved rip = 0x7ffff7dd90b3
	   source language c.
	   Arglist at 0x7fffffffd330, args:
	   Locals at 0x7fffffffd330, Previous frame's sp is 0x7fffffffd340
	   Saved registers:
	    rbp at 0x7fffffffd330, rip at 0x7fffffffd338
	  (gdb)

	and then after continuing to a function called by main, and selecting
	the "main" frame again, we see:

	  (gdb) info frame
	  Stack level 3, frame at 0x7fffffffd340:
	   rip = 0x555555555172 in main (gdb.base/backtrace.c:41); saved rip = 0x7ffff7dd90b3
	   caller of frame at 0x7fffffffd330
	   source language c.
	   Arglist at 0x7fffffffd330, args:
	   Locals at 0x7fffffffd330, Previous frame's sp is 0x7fffffffd340
	   Saved registers:
	    rbp at 0x7fffffffd330, rip at 0x7fffffffd338
	  (gdb)

	The only differences should be in the stack level, the 'rip = '
	address, and the presence of the "caller of frame at" info.  All the
	rest should be the same.  If it isn't, it probably means that the
	frame base, the frame ID, etc. aren't stable & consistent.

	The testcase exercises both the DWARF and the heuristic unwinders,
	using "maint set dwarf unwinder on/off".

	Tested on {x86-64 -m64, x86-64 -m32, Aarch64, Power8} GNU/Linux.

	Change-Id: I795001c82cc70d543d197415e3f80ce5dc7f3452

2021-09-23  Tom Tromey  <tromey@adacore.com>

	Change get_ada_task_ptid parameter type
	get_ada_task_ptid currently takes a 'long' as its 'thread' parameter
	type.  However, on some platforms this is actually a pointer, and
	using 'long' can sometimes end up with the value being sign-extended.
	This sign extension can cause problems later, if the tid is then later
	used as an address again.

	This patch changes the parameter type to ULONGEST and updates all the
	uses.  This approach preserves sign extension on the targets where it
	is apparently intended, while avoiding it on others.

	Co-Authored-By: John Baldwin <jhb@FreeBSD.org>

2021-09-23  Tom Tromey  <tromey@adacore.com>

	Change ptid_t::tid to ULONGEST
	The ptid_t 'tid' member is normally used as an address in gdb -- both
	bsd-uthread and ravenscar-thread use it this way.  However, because
	the type is 'long', this can cause problems with sign extension.

	This patch changes the type to ULONGEST to ensure that sign extension
	does not occur.

2021-09-23  Tom Tromey  <tromey@adacore.com>

	Remove defaulted 'tid' parameter to ptid_t constructor
	I wanted to find, and potentially modify, all the spots where the
	'tid' parameter to the ptid_t constructor was used.  So, I temporarily
	removed this parameter and then rebuilt.

	In order to make it simpler to search through the "real" (nonzero)
	uses of this parameter, something I knew I'd have to do multiple
	times, I removed any ", 0" from constructor calls.

	Co-Authored-By: John Baldwin <jhb@FreeBSD.org>

2021-09-23  Tom Tromey  <tom@tromey.com>

	Style the "XXX" text in ptype/o
	This patch changes gdb to use the 'highlight' style on the "XXX" text
	in the output of ptype/o.

2021-09-23  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.python/py-events.exp
	With test-case gdb.python/py-events.exp on ubuntu 18.04.5 we run into:
	...
	(gdb) info threads^M
	  Id   Target Id                                     Frame ^M
	* 1    Thread 0x7ffff7fc3740 (LWP 31467) "py-events" do_nothing () at \
	         src/gdb/testsuite/gdb.python/py-events-shlib.c:19^M
	(gdb) FAIL: gdb.python/py-events.exp: get current thread
	...

	The info thread commands uses "Thread" instead of "process" because
	libpthread is already loaded:
	...
	new objfile name: /lib/x86_64-linux-gnu/libdl.so.2^M
	[Thread debugging using libthread_db enabled]^M
	Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".^M
	event type: new_objfile^M
	new objfile name: /lib/x86_64-linux-gnu/libpthread.so.0^M
	...
	and consequently thread_db_target::pid_to_str is used.

	Fix this by parsing the "Thread" expression.

	Tested on x86_64-linux.

2021-09-22  Tom de Vries  <tdevries@suse.de>

	[gdb] Add maint selftest -verbose option
	The print_one_insn selftest in gdb/disasm-selftests.c contains:
	...
	  /* If you want to see the disassembled instruction printed to gdb_stdout,
	     set verbose to true.  */
	  static const bool verbose = false;
	...

	Make this parameter available in the maint selftest command using a new option
	-verbose, such that we can do:
	...
	(gdb) maint selftest -verbose print_one_insn
	...

	Tested on x86_64-linux.

2021-09-22  Alan Modra  <amodra@gmail.com>

	dwarf2 sub-section test
	This is a testcase for the bug fixed by commit 5b4846283c3d.  When
	running the testcase on ia64 targets I found timeouts along with lots
	of memory being consumed, due to ia64 gas not tracking text
	sub-sections.  Trying to add nops for ".nop 16" in ".text 1" resulting
	in them being added to subsegment 0, with no increase to subsegment 1
	size.  This patch also fixes that problem.

	Note that the testcase fails on ft32-elf, mn10200-elf, score-elf,
	tic5x-elf, and xtensa-elf.  The first two are relocation errors, the
	last three appear to be the .nop directive failing to emit the right
	number of nops.  I didn't XFAIL any of them.

		* config/tc-ia64.c (md): Add last_text_subseg.
		(ia64_flush_insns, dot_endp): Use last_text_subseg.
		(ia64_frob_label, md_assemble): Set last_text_subseg.
		* testsuite/gas/elf/dwarf2-21.d,
		* testsuite/gas/elf/dwarf2-21.s: New test.
		* testsuite/gas/elf/elf.exp: Run it.

2021-09-22  Alan Modra  <amodra@gmail.com>

	Fix x86 "FAIL: TLS -fno-pic -shared"
	Fix a typo in commit 5d0869d9872a

		* testsuite/ld-i386/tlsnopic.rd: Typo fix.

2021-09-22  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-21  Nick Clifton  <nickc@redhat.com>

	Change the linker's heuristic for computing the entry point for binaries so that shared libraries default to an entry point of 0.
		* ldlang.c (lang_end): When computing the entry point, only
		try the start address of the entry section when creating an
		executable.
		* ld.texi (Entry point): Update description of heuristic used to
		choose the entry point.
		testsuite/ld-alpha/tlspic.rd: Update expected entry point address.
		testsuite/ld-arm/tls-gdesc-got.d: Likewise.
		testsuite/ld-i386/tlsnopic.rd: Likewise.
		testsuite/ld-ia64/tlspic.rd: Likewise.
		testsuite/ld-sparc/gotop32.rd: Likewise.
		testsuite/ld-sparc/gotop64.rd: Likewise.
		testsuite/ld-sparc/tlssunnopic32.rd: Likewise.
		testsuite/ld-sparc/tlssunnopic64.rd: Likewise.
		testsuite/ld-sparc/tlssunpic32.rd: Likewise.
		testsuite/ld-sparc/tlssunpic64.rd: Likewise.
		testsuite/ld-tic6x/shlib-1.rd: Likewise.
		testsuite/ld-tic6x/shlib-1b.rd: Likewise.
		testsuite/ld-tic6x/shlib-1r.rd: Likewise.
		testsuite/ld-tic6x/shlib-1rb.rd: Likewise.
		testsuite/ld-tic6x/shlib-noindex.rd: Likewise.
		testsuite/ld-x86-64/pr14207.d: Likewise.
		testsuite/ld-x86-64/tlsdesc.rd: Likewise.
		testsuite/ld-x86-64/tlspic.rd: Likewise.
		testsuite/ld-x86-64/tlspic2.rd: Likewise.

2021-09-21  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle supports_memtag in gdb.base/gdb-caching-proc.exp
	In test-case gdb.base/gdb-caching-proc.exp, we run all procs declared with
	gdb_caching_proc.  Some of these require a gdb instance, some not.

	We could just do a clean_restart every time, but that would amount to 44 gdb
	restarts.  We try to minimize this by doing this only for the few procs that
	need it, and hardcoding those in the test-case.

	For those procs, we do a clean_restart, execute the proc, and then do a
	gdb_exit, to make sure the gdb instance doesn't linger such that we detect
	procs that need a gdb instance but are not listed in the test-case.

	However, that doesn't work in the case of gnat_runtime_has_debug_info.  This
	proc doesn't require a gdb instance because it starts its own.  But it doesn't
	clean up the gdb instance, and since it's not listed, the test-case
	doesn't clean up the gdb instance eiter.  Consequently, the proc
	supports_memtag (which should be listed, but isn't) uses the gdb instance
	started by gnat_runtime_has_debug_info rather than throwing an error.  Well,
	unless gnat_runtime_has_debug_info fails before starting a gdb instance, in
	which case we do run into the error.

	Fix this by:
	- doing gdb_exit unconditionally
	- fixing the resulting error by adding supports_memtag in the test-case to
	  the "needing gdb instance" list

	Tested on x86_64-linux.

2021-09-21  Felix Willgerodt  <felix.willgerodt@intel.com>

	gdb, doc: Add ieee_half and bfloat16 to list of predefined target types.
	For some reason these two weren't added to the list when they were orginally
	added to GDB.

	gdb/doc/ChangeLog:
	2021-09-21  Felix Willgerodt  <felix.willgerodt@intel.com>

		* gdb.texinfo (Predefined Target Types): Mention ieee_half and bfloat16.

2021-09-21  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-20  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.ada/interface.exp with gcc-9
	When running test-case gdb.ada/interface.exp with gcc-9, we run into:
	...
	(gdb) info locals^M
	s = (x => 1, y => 2, w => 3, h => 4)^M
	r = (x => 1, y => 2, w => 3, h => 4)^M
	(gdb) FAIL: gdb.ada/interface.exp: info locals
	...

	The failure is caused by the regexp expecting variable r followed by
	variable s.

	Fix this by allowing variable s followed by variable r as well.

	Tested on x86_64-linux.

2021-09-20  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.ada/mi_prot.exp
	When running test-case gdb.ada/mi_prot.exp with gcc 8.5.0, we run into:
	...
	(gdb) ^M
	Expecting: ^(-stack-list-arguments --no-frame-filters 1[^M
	]+)?(\^done,stack=.*[^M
	]+[(]gdb[)] ^M
	[ ]*)
	-stack-list-arguments --no-frame-filters 1^M
	^done,stack-args=[frame={level="0",args=[{name="<_object>",value="(ceiling_priority =\
	> 97, local => 0)"},{name="v",value="5"},{name="<_objectO>",value="true"}]},frame={le\
	vel="1",args=[{name="v",value="5"},{name="<_objectO>",value="true"}]},frame={level="2\
	",args=[]}]^M
	(gdb) ^M
	FAIL: gdb.ada/mi_prot.exp: -stack-list-arguments --no-frame-filters 1 (unexpected out\
	put)
	...

	Fix this by updating the regexp to expect "^done,stack-args=" instead of
	"^done,stack=".

	Tested on x86_64-linux.

2021-09-20  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Register test for each arch separately in register_test_foreach_arch
	In gdb/disasm-selftests.c we have:
	...
	  selftests::register_test_foreach_arch ("print_one_insn",
	                                         selftests::print_one_insn_test);
	...
	and we get:
	...
	$ gdb -q -batch -ex "maint selftest print_one_insn" 2>&1 \
	  | grep ^Running
	Running selftest print_one_insn.
	$
	...

	Change the semantics register_test_foreach_arch such that a version of
	print_one_insn is registered for each architecture, such that we have:
	...
	$ gdb -q -batch -ex "maint selftest print_one_insn" 2>&1 \
	  | grep ^Running
	Running selftest print_one_insn::A6.
	Running selftest print_one_insn::A7.
	Running selftest print_one_insn::ARC600.
	  ...
	$
	...

	This makes it f.i. possible to do:
	...
	$ gdb -q -batch a.out -ex "maint selftest print_one_insn::armv8.1-m.main"
	Running selftest print_one_insn::armv8.1-m.main.
	Self test failed: self-test failed at src/gdb/disasm-selftests.c:165
	Ran 1 unit tests, 1 failed
	...

	Tested on x86_64-linux with an --enable-targets=all build.

2021-09-20  Tom de Vries  <tdevries@suse.de>

	[gdb] Change register_test to use std::function arg
	Change register_test to use std::function arg, such that we can do:
	...
	  register_test (test_name, [=] () { SELF_CHECK (...); });
	...

	Tested on x86_64-linux.

2021-09-20  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.ada/big_packed_array.exp xfail for -m32
	With test-case gdb.ada/big_packed_array.exp and target board unix/-m32 I run
	into:
	...
	(gdb) print bad^M
	$2 = (0 => 0 <repeats 24 times>, 160)^M
	(gdb) FAIL: gdb.ada/big_packed_array.exp: scenario=minimal: print bad
	...

	The problem is that while the variable is an array of 196 bits (== 24.5 bytes),
	the debug information describes it as 25 unsigned char.  This is PR
	gcc/101643, and the test-case contains an xfail for this, which catches only:
	...
	(gdb) print bad^M
	$2 = (0 => 0 <repeats 25 times>)^M
	...

	Fix this by updating the xfail pattern.

	Tested on x86_64-linux.

2021-09-20  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport/gdb_proc_service.h: use decltype instead of typeof
	Bug 28341 shows that GDB fails to compile when built with -std=c++11.
	I don't know much about the use case, but according to the author of the
	bug:

	    I encountered the scenario where CXX is set to "g++ -std=c++11" when
	    I try to compile binutils under GCC as part of the GCC 3-stage
	    compilation, which is common for building a cross-compiler.

	The author of the bug suggests using __typeof__ instead of typeof.  But
	since we're using C++, we might as well use decltype, which is standard.
	This is what this patch does.

	The failure (and fix) can be observed by configuring GDB with CXX="g++
	-std=c++11":

	      CXX    linux-low.o
	    In file included from /home/simark/src/binutils-gdb/gdbserver/gdb_proc_service.h:22,
			     from /home/simark/src/binutils-gdb/gdbserver/linux-low.h:27,
			     from /home/simark/src/binutils-gdb/gdbserver/linux-low.cc:20:
	    /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/gdb_proc_service.h:177:50: error: expected constructor, destructor, or type conversion before (token
	      177 |   __attribute__((visibility ("default"))) typeof (SYM) SYM
		  |                                                  ^
	    /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/gdb_proc_service.h:179:1: note: in expansion of macro PS_EXPORT
	      179 | PS_EXPORT (ps_get_thread_area);
		  | ^~~~~~~~~

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28341
	Change-Id: I84fbaae938209d8d935ca08dec9b7e6a0dd1bda0

2021-09-20  Andrew Burgess  <andrew.burgess@embecosm.com>

	riscv: print .2byte or .4byte before an unknown instruction encoding
	When the RISC-V disassembler encounters an unknown instruction, it
	currently just prints the value of the bytes, like this:

	  Dump of assembler code for function custom_insn:
	     0x00010132 <+0>:	addi	sp,sp,-16
	     0x00010134 <+2>:	sw	s0,12(sp)
	     0x00010136 <+4>:	addi	s0,sp,16
	     0x00010138 <+6>:	0x52018b
	     0x0001013c <+10>:	0x9c45

	My proposal, in this patch, is to change the behaviour to this:

	  Dump of assembler code for function custom_insn:
	     0x00010132 <+0>:	addi	sp,sp,-16
	     0x00010134 <+2>:	sw	s0,12(sp)
	     0x00010136 <+4>:	addi	s0,sp,16
	     0x00010138 <+6>:	.4byte	0x52018b
	     0x0001013c <+10>:	.2byte	0x9c45

	Adding the .4byte and .2byte opcodes.  The benefit that I see here is
	that in the patched version of the tools, the disassembler output can
	be fed back into the assembler and it should assemble to the same
	binary format.  Before the patch, the disassembler output is invalid
	assembly.

	I've started a RISC-V specific test file under binutils so that I can
	add a test for this change.

	binutils/ChangeLog:

		* testsuite/binutils-all/riscv/riscv.exp: New file.
		* testsuite/binutils-all/riscv/unknown.d: New file.
		* testsuite/binutils-all/riscv/unknown.s: New file.

	opcodes/ChangeLog:

		* riscv-dis.c (riscv_disassemble_insn): Print a .%dbyte opcode
		before an unknown instruction, '%d' is replaced with the
		instruction length.

2021-09-20  Alan Modra  <amodra@gmail.com>

	Fix allocate_filenum last dir/file checks
		* dwarf2dbg.c (allocate_filenum) Correct use of last_used_dir_len.

2021-09-20  Alan Modra  <amodra@gmail.com>

	Re: PR28149, debug info with wrong file association
	Fixes segfaults when building aarch64-linux kernel, due to only doing
	part of the work necessary when allocating file numbers late.  I'd
	missed looping over subsegments, which resulted in some u.filename
	entries left around and later interpreted as u.view.

		PR 28149
		* dwarf2dbg.c (purge_generated_debug): Iterate over subsegs too.
		(dwarf2_finish): Call do_allocate_filenum for all subsegs too,
		in a separate loop before subsegs are chained.

2021-09-20  Alan Modra  <amodra@gmail.com>

	Move eelf_mipsel_haiki.c to ALL_64_EMULATION_SOURCES
	--enable-targets=all on a 32-bit host results in a link failure with
	undefined references due to elfxx-mips.c not being compiled.  This
	patch fixes that by putting eelf_mipsel_haiki.c in the correct
	EMULATION_SOURCES Makefile variable.  I've also added a bunch of
	missing file dependencies and sorted a few things so that it's easier
	to verify dependencies are present.

		* Makfile.am: Add missing haiku dependencies, sort.
		(ALL_EMULATION_SOURCES): Sort.  Move eelf_mipsel_haiku.c to..
		(ALL_64_EMULATION_SOURCES): ..here.  Sort.
		* Makfile.in: Regenerate.

2021-09-20  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-19  H.J. Lu  <hjl.tools@gmail.com>

	elf: Don't set version info on unversioned symbols
	Don't set version info on unversioned symbols when seeing a hidden
	versioned symbol after an unversioned definition and the default
	versioned symbol.

	bfd/

		PR ld/28348
		* elflink.c (elf_link_add_object_symbols): Don't set version info
		on unversioned symbols.

	ld/

		PR ld/28348
		* testsuite/ld-elf/pr28348.rd: New file.
		* testsuite/ld-elf/pr28348.t: Likewise.
		* testsuite/ld-elf/pr28348a.c: Likewise.
		* testsuite/ld-elf/pr28348b.c: Likewise.
		* testsuite/ld-elf/pr28348c.c: Likewise.
		* testsuite/ld-elf/shared.exp: Run PR ld/28348 tests.

2021-09-19  Mike Frysinger  <vapier@gentoo.org>

	gdb: manual: update @inforef to @xref
	The @inforef command is deprecated, and @xref does the samething.
	Also had to update the text capitalization to match current manual.
	Verified that info & HTML links work.

2021-09-19  Weimin Pan  <weimin.pan@oracle.com>

	CTF: multi-CU and archive support
	Now gdb is capable of debugging executable, which consists of multiple
	compilation units (CUs) with the CTF debug info. An executable could
	potentially have one or more archives, which, in CTF context, contain
	conflicting types.

	all changes were made in ctfread.c in which elfctf_build_psymtabs was
	modified to handle archives, via the ctf archive iterator and its callback
	build_ctf_archive_member and scan_partial_symbols was modified to scan
	archives, which are treated as subfiles, to build the psymtabs.

	Also changes were made to handle CTF's data object section and function
	info section which now share the same format of their contents - an array
	of type IDs. New functions ctf_psymtab_add_stt_entries, which is called by
	ctf_psymtab_add_stt_obj and ctf_psymtab_add_stt_func, and add_stt_entries,
	which is called by add_stt_obj and add_stt_func when setting up psymtabs
	and full symtab, respectively.

2021-09-19  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-18  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.server/server-kill.exp with -m32
	When running test-case gdb.server/server-kill.exp with target board unix/-m32,
	I run into:
	...
	0xf7fd6b20 in _start () from /lib/ld-linux.so.2^M
	(gdb) Executing on target: kill -9 13082    (timeout = 300)
	builtin_spawn -ignore SIGHUP kill -9 13082^M
	bt^M
	(gdb) FAIL: gdb.server/server-kill.exp: kill_pid_of=server: test_unwind_syms: bt
	...

	The test-case expects the backtrace command to trigger remote communication,
	which then should result in a "Remote connection closed" or similar.

	However, no remote communication is triggered, because we hit the "Check that
	this frame is unwindable" case in get_prev_frame_always_1.

	We don't hit this problem in the kill_pid_of=inferior case, because there we
	run to main before doing the backtrace.

	Fix this by doing the same in the kill_pid_of=server case.

	Tested on x86_64-linux.

2021-09-18  Tom de Vries  <tdevries@suse.de>

	[gdb/ada] Handle artificial local symbols
	With current master and gcc 7.5.0/8.5.0, we have this timeout:
	...
	(gdb) print s^M
	Multiple matches for s^M
	[0] cancel^M
	[1] s at src/gdb/testsuite/gdb.ada/interface/foo.adb:20^M
	[2] s at src/gdb/testsuite/gdb.ada/interface/foo.adb:?^M
	> FAIL: gdb.ada/interface.exp: print s (timeout)
	...

	[ The FAIL doesn't reproduce with gcc 9.3.1.  This difference in
	behaviour bisects to gcc commit d70ba0c10de.

	The FAIL with earlier gcc bisects to gdb commit ba8694b650b. ]

	The FAIL is caused by gcc generating this debug info describing a named
	artificial variable:
	...
	 <2><1204>: Abbrev Number: 31 (DW_TAG_variable)
	    <1205>   DW_AT_name        : s.14
	    <1209>   DW_AT_type        : <0x1213>
	    <120d>   DW_AT_artificial  : 1
	    <120d>   DW_AT_location    : 5 byte block: 91 e0 7d 23 18   \
	      (DW_OP_fbreg: -288; DW_OP_plus_uconst: 24)
	...

	An easy way to fix this would be to simply not put named artificial variables
	into the symbol table.  However, that causes regressions for Ada.  It relies
	on being able to get the value from such variables, using a named reference.

	Fix this instead by marking the symbol as artificial, and:
	- ignoring such symbols in ada_resolve_variable, which fixes the FAIL
	- ignoring such ada symbols in do_print_variable_and_value, which prevents
	  them from showing up in "info locals"

	Note that a fix for the latter was submitted here (
	https://sourceware.org/pipermail/gdb-patches/2008-January/054994.html ), and
	this patch borrows from it.

	Tested on x86_64-linux.

	Co-Authored-By: Joel Brobecker  <brobecker@adacore.com>

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28180

2021-09-18  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-17  Alan Modra  <amodra@gmail.com>

	PR28149 part 2, purge generated line info
	Mixing compiler generated line info with gas generated line info is
	generally just confusing.  Also .loc directives with non-zero view
	fields might reference a previous .loc.  It becomes a little more
	tricky to locate that previous .loc if there might be gas generated
	line info present too.  Mind you, we turn off gas generation of line
	info on seeing compiler generated line info, so any reference back
	won't hit gas generated line info.  At least, if the view info is
	sane.  Unfortunately, gas needs to handle mangled source.

		PR 28149
		* dwarf2dbg.c (purge_generated_debug): New function.
		(dwarf2_directive_filename): Call the above.
		(out_debug_line): Don't segfault after purging.
		* testsuite/gas/i386/dwarf2-line-4.d: Update expected output.
		* testsuite/gas/i386/dwarf4-line-1.d: Likewise.
		* testsuite/gas/i386/dwarf5-line-1.d: Likewise.
		* testsuite/gas/i386/dwarf5-line-2.d: Likewise.

2021-09-17  Alan Modra  <amodra@gmail.com>

	PR28149, debug info with wrong file association
	gcc-11 and gcc-12 pass -gdwarf-5 to gas, in order to prime gas for
	DWARF 5 level debug info.  Unfortunately it seems there are cases
	where the compiler does not emit a .file or .loc dwarf debug directive
	before any machine instructions.  (Note that the .file directive
	typically emitted as the first line of assembly output doesn't count as
	a dwarf debug directive.  The dwarf .file has a file number before the
	file name string.)

	This patch delays allocation of file numbers for gas generated line
	debug info until the end of assembly, thus avoiding any clashes with
	compiler generated file numbers.  Two fixes for test case source are
	necessary;  A .loc can't use a file number that hasn't already been
	specified with .file.

	A followup patch will remove all the gas generated line info on
	seeing a .file directive.

		PR 28149
		* dwarf2dbg.c (num_of_auto_assigned): Delete.
		(current): Update initialisation.
		(set_or_check_view): Replace all accesses to view with u.view.
		(dwarf2_consume_line_info): Likewise.
		(dwarf2_directive_loc): Likewise.  Assert that we aren't generating
		line info.
		(dwarf2_gen_line_info_1): Don't call set_or_check_view on
		gas generated line entries.
		(dwarf2_gen_line_info): Set and track filenames for gas generated
		line entries.  Simplify generation of labels.
		(get_directory_table_entry): Use filename_cmp when comparing dirs.
		(do_allocate_filenum): New function.
		(dwarf2_where): Set u.filename and filenum to -1 for gas generated
		line entries.
		(dwarf2_directive_filename): Remove num_of_auto_assigned handling.
		(process_entries): Update view field access.  Call
		do_allocate_filenum.
		* dwarf2dbg.h (struct dwarf2_line_info): Add filename field in
		union aliasing view.
		* testsuite/gas/i386/dwarf2-line-3.s: Add .file directive.
		* testsuite/gas/i386/dwarf2-line-4.s: Likewise.
		* testsuite/gas/i386/dwarf2-line-4.d: Update expected output.
		* testsuite/gas/i386/dwarf4-line-1.d: Likewise.
		* testsuite/gas/i386/dwarf5-line-1.d: Likewise.
		* testsuite/gas/i386/dwarf5-line-2.d: Likewise.

2021-09-17  Alan Modra  <amodra@gmail.com>

	[GOLD] PowerPC64 support for sym+addend GOT entries
	Pass addends to all the GOT handling functions, plus remove some
	extraneous asserts.

		PR 28192
		* powerpc.cc (Output_data_got_powerpc): Add addend parameter to
		all methods creating got entries.
		(Target_powerpc::Scan::local): Pass reloc addend to got handling
		functions, and when creating dynamic got relocations.
		(Target_powerpc::Scan::global): Likewise.
		(Target_powerpc::Relocate::relocate): Likewise.  Remove extraneous
		assertions.

2021-09-17  Alan Modra  <amodra@gmail.com>

	[GOLD] Got_entry::write addends
	This takes care of writing out GOT entries with addends.  The local
	symbol case was already largely handled, except for passing the addend
	to tls_offset_for_local which might need the addend in a
	local_got_offset call.  That's needed also in tls_offset_for_global.

	I'm assuming here that GOT entries for function symbols won't ever
	have addends, and in particular that a GOT entry referencing PLT call
	stub code won't want an offset into the code.

		PR 28192
		* output.cc (Output_data_got::Got_entry::write): Include addend
		in global symbol value.  Pass addend to tls_offset_for_*.
		* powerpc.cc (Target_powerpc::do_tls_offset_for_local): Handle addend.
		(Target_powerpc::do_tls_offset_for_global): Likewise.
		* s390.cc (Target_s390::do_tls_offset_for_local): Likewise.
		(Target_s390::do_tls_offset_for_global): Likewise.
		* target.h (Target::tls_offset_for_local): Add addend param.
		(Target::tls_offset_for_global): Likewise.
		(Target::do_tls_offset_for_local): Likewise.
		(Target::do_tls_offset_for_global): Likewise.

2021-09-17  Alan Modra  <amodra@gmail.com>

	[GOLD] Output_data_got create entry method addends
	This patch makes all the Output_data_got methods that create new
	entries accept an optional addend.

		PR 28192
		* output.h (Output_data_got::add_global): Add optional addend
		parameter.  Update comment.  Delete overload without addend.
		(Output_data_got::add_global_plt): Likewise.
		(Output_data_got::add_global_tls): Likewise.
		(Output_data_got::add_global_with_rel): Likewise.
		(Output_data_got::add_global_pair_with_rel): Likewise.
		(Output_data_got::add_local_plt): Likewise.
		(Output_data_got::add_local_tls): Likewise.
		(Output_data_got::add_local_tls_pair): Likewise.
		(Output_data_got::reserve_local): Likewise.
		(Output_data_got::reserve_global): Likewise.
		(Output_data_got::Got_entry): Include addend in global sym
		constructor.  Delete local sym constructor without addend.
		* output.cc (Output_data_got::add_global): Add addend param,
		pass to got handling methods.
		(Output_data_got::add_global_plt): Likewise.
		(Output_data_got::add_global_with_rel): Likewise.
		(Output_data_got::add_global_pair_with_rel): Likewise.
		(Output_data_got::add_local_plt): Likewise.
		(Output_data_got::add_local_tls_pair): Likewise.
		(Output_data_got::reserve_local): Likewise.
		(Output_data_got::reserve_global): Likewise.

2021-09-17  Alan Modra  <amodra@gmail.com>

	[GOLD] Output_data_got tidy
	Some Output_data_got methods already have support for addends, but
	were implemented as separate methods.  This removes unnecessary code
	duplication.

	Relobj::local_has_got_offset and others there get a similar treatment.
	Comments are removed since it should be obvious without a comment, and
	the existing comments are not precisely what the code does.  For
	example, a local_has_got_offset call without an addend does not return
	whether the local symbol has *a* GOT offset of type GOT_TYPE, it
	returns whether there is a GOT entry of type GOT_TYPE for the symbol
	with addend of zero.

		PR 28192
		* output.h (Output_data_got::add_local): Make addend optional.
		(Output_data_got::add_local_with_rel): Likewise.
		(Output_data_got::add_local_pair_with_rel): Likewise.
		* output.cc (Output_data_got::add_local): Delete overload
		without addend.
		(Output_data_got::add_local_with_rel): Likewise.
		(Output_data_got::add_local_pair_with_rel): Likewise.
		* object.h (Relobj::local_has_got_offset): Make addend optional.
		Delete overload without addend later.  Update comment.
		(Relobj::local_got_offset): Likewise.
		(Relobj::set_local_got_offset): Likewise.

2021-09-17  Alan Modra  <amodra@gmail.com>

	[GOLD] Remove addend from Local_got_entry_key
	This patch removes the addend from Local_got_entry_key, which is
	unnecessary now that Got_offset_list has an addend.  Note that it
	might be advantageous to keep the addend in Local_got_entry_key when
	linking objects containing a large number of section_sym+addend@got
	relocations.  I opted to save some memory by removing the field but
	left the class there in case we might need to restore {sym,addend}
	lookup.  That's also why this change is split out from the
	Got_offset_list change.

		PR 28192
		* object.h (Local_got_entry_key): Delete addend_ field.
		Adjust constructor and methods to suit.
		* object.cc (Sized_relobj::do_for_all_local_got_entries):
		Update key.

2021-09-17  Alan Modra  <amodra@gmail.com>

	[GOLD] Got_offset_list: addend field
	This is the first in a series of patches aimed at supporting GOT
	entries against symbol plus addend generally for PowerPC64 rather than
	just section symbol plus addend as gold has currently.

	This patch adds an addend field to Got_offset_list, so that both local
	and global symbols can have GOT entries with addend.

		PR 28192
		* object.h (Got_offset_list): Add addend_ field, init in both
		constructors.  Adjust all accessors to suit.
		(Sized_relobj::do_local_has_got_offset): Adjust to suit.
		(Sized_relobj::do_local_got_offset): Likewise.
		(Sized_relobj::do_set_local_got_offset): Likewise.
		* symtab.h (Symbol::has_got_offset): Add optional addend param.
		(Symbol::got_offset, Symbol::set_got_offset): Likewise.
		* incremental.cc (Local_got_offset_visitor::visit): Add unused
		uint64_t parameter with FIXME.
		(Global_got_offset_visitor::visit): Add unused uint64_t parameter.

2021-09-17  Henry Castro  <hcvcastro@gmail.com>

	Fix segfault when running ia16-elf-gdb
	"A problem internal to GDB has been detected,
	further debugging may prove unreliable."

	Segmentation fault

2021-09-17  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Merged extension string tables and their version tables into one.
	There are two main reasons for this patch,

	* In the past we had two extension tables, one is used to record all
	supported extensions in bfd/elfxx-riscv.c, another is used to get the
	default extension versions in gas/config/tc-riscv.c.  It is hard to
	maintain lots of tables in different files, but in fact we can merge
	them into just one table.  Therefore, we now define many riscv_supported_std*
	tables, which record names and versions for all supported extensions.
	We not only use these tables to initialize the riscv_ext_order, but
	also use them to get the default versions of extensions, and decide if
	the extensions should be enbaled by default.

	* We add a new filed `default_enable' for the riscv_supported_std* tables,
	to decide if the extension should be enabled by default.  For now if the
	`default_enable' field of the extension is set to EXT_DEFAULT, then we
	should enable the extension when the -march and elf architecture attributes
	are not set.  In the future, I suppose the `default_enable' can be set
	to lots of EXT_<VENDOR>, each vendor can decide to open which extensions,
	when the target triple of vendor is chosen.

	The elf/linux regression tests of riscv-gnu-toolchain are passed.

	bfd/
		* elfnn-riscv.c (cpu-riscv.h): Removed sine it is included in
		bfd/elfxx-riscv.h.
		(riscv_merge_std_ext): Updated since the field of rpe is changed.
		* elfxx-riscv.c (cpu-riscv.h): Removed.
		(riscv_implicit_subsets): Added implicit extensions for g.
		(struct riscv_supported_ext): Used to be riscv_ext_version.  Moved
		from gas/config/tc-riscv.c, and added new field `default_enable' to
		decide if the extension should be enabled by default.
		(EXT_DEFAULT): Defined for `default_enable' field.
		(riscv_supported_std_ext): It used to return the supported standard
		architecture string, but now we move ext_version_table from
		gas/config/tc-riscv.c to here, and rename it to riscv_supported_std_ext.
		Currently we not only use the table to initialize riscv_ext_order, but
		also get the default versions of extensions, and decide if the extensions
		should be enbaled by default.
		(riscv_supported_std_z_ext): Likewise, but is used for z* extensions.
		(riscv_supported_std_s_ext): Likewise, but is used for s* extensions.
		(riscv_supported_std_h_ext): Likewise, but is used for h* extensions.
		(riscv_supported_std_zxm_ext): Likewise, but is used for zxm* extensions.
		(riscv_all_supported_ext): Includes all supported extension tables.
		(riscv_known_prefixed_ext): Updated.
		(riscv_valid_prefixed_ext): Updated.
		(riscv_init_ext_order): Init the riscv_ext_order table according to
		riscv_supported_std_ext.
		(riscv_get_default_ext_version): Moved from gas/config/tc-riscv.c.
		Get the versions of extensions from riscv_supported_std* tables.
		(riscv_parse_add_subset): Updated.
		(riscv_parse_std_ext): Updated.
		(riscv_set_default_arch): Set the default subset list according to
		the default_enable field of riscv_supported_*ext tables.
		(riscv_parse_subset): If the input ARCH is NULL, then we call
		riscv_set_default_arch to set the default subset list.
		* elfxx-riscv.h (cpu-riscv.h): Included.
		(riscv_parse_subset_t): Removed get_default_version field, and added
		isa_spec field to replace it.
		(extern riscv_supported_std_ext): Removed.
	gas/
		* (bfd/cpu-riscv.h): Removed.
		(struct riscv_ext_version): Renamed and moved to bfd/elfxx-riscv.c.
		(ext_version_table): Likewise.
		(riscv_get_default_ext_version): Likewise.
		(ext_version_hash): Removed.
		(init_ext_version_hash): Removed.
		(riscv_set_arch): Updated since the field of rps is changed.  Besides,
		report error when the architecture string is empty.
		(riscv_after_parse_args): Updated.

2021-09-17  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-16  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix interrupted sleep in multi-threaded test-cases
	When running test-case gdb.threads/continue-pending-status.exp with native, I
	have:
	...
	(gdb) continue^M
	Continuing.^M
	PASS: gdb.threads/continue-pending-status.exp: attempt 0: continue for ctrl-c
	^C^M
	Thread 1 "continue-pendin" received signal SIGINT, Interrupt.^M
	[Switching to Thread 0x7ffff7fc4740 (LWP 1276)]^M
	0x00007ffff758e4c0 in __GI___nanosleep () at nanosleep.c:27^M
	27        return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M
	(gdb) PASS: gdb.threads/continue-pending-status.exp: attempt 0: caught interrupt
	...
	but with target board unix/-m32, I run into:
	...
	(gdb) continue^M
	Continuing.^M
	PASS: gdb.threads/continue-pending-status.exp: attempt 0: continue for ctrl-c
	[Thread 0xf74aeb40 (LWP 31957) exited]^M
	[Thread 0xf7cafb40 (LWP 31956) exited]^M
	[Inferior 1 (process 31952) exited normally]^M
	(gdb) Quit^M
	...

	The problem is that the sleep (300) call at the end of main is interrupted,
	which causes the inferior to exit before the ctrl-c can be send.

	This problem is described at "Interrupted System Calls" in the docs, and the
	suggested solution (using a sleep loop) indeed fixes the problem.

	Fix this instead using the more prevalent:
	...
	  alarm (300);
	  ...
	  while (1) sleep (1);
	...
	which is roughly equivalent because the sleep is called at the end of main,
	but slightly better because it guards against hangs from the start rather than
	from the end of main.

	Likewise in gdb.base/watch_thread_num.exp.

	Likewise in gdb.btrace/enable-running.exp, but use the sleep loop there,
	because the sleep is not called at the end of main.

	Tested on x86_64-linux.

2021-09-16  Mike Frysinger  <vapier@gentoo.org>

	gdb: manual: fix werrors typo

2021-09-16  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-15  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use function_range in gdb.dwarf2/dw2-abs-hi-pc.exp
	When I run test-case gdb.dwarf2/dw2-abs-hi-pc.exp with gcc, we have:
	...
	(gdb) break hello^M
	Breakpoint 1 at 0x4004c0: file dw2-abs-hi-pc-hello.c, line 24.^M
	(gdb) PASS: gdb.dwarf2/dw2-abs-hi-pc.exp: break hello
	...
	but with clang, I run into:
	...
	(gdb) break hello^M
	Breakpoint 1 at 0x4004e4^M
	(gdb) FAIL: gdb.dwarf2/dw2-abs-hi-pc.exp: break hello
	...

	The problem is that the CU and function both have an empty address range:
	...
	 <0><d2>: Abbrev Number: 1 (DW_TAG_compile_unit)
	    <108>   DW_AT_name        : dw2-abs-hi-pc-hello.c
	    <123>   DW_AT_low_pc      : 0x4004e0
	    <127>   DW_AT_high_pc     : 0x4004e0
	 <1><12f>: Abbrev Number: 2 (DW_TAG_subprogram)
	    <131>   DW_AT_name        : hello
	    <13a>   DW_AT_low_pc      : 0x4004e0
	    <13e>   DW_AT_high_pc     : 0x4004e0
	...

	The address ranges are set like this in dw2-abs-hi-pc-hello-dbg.S:
	...
	        .4byte  .hello_start    /* DW_AT_low_pc */
	        .4byte  .hello_end      /* DW_AT_high_pc */
	...
	where the labels refer to dw2-abs-hi-pc-hello.c:
	...
	extern int v;

	asm (".hello_start: .globl .hello_start\n");
	void
	hello (void)
	{
	asm (".hello0: .globl .hello0\n");
	  v++;
	asm (".hello1: .globl .hello1\n");
	}
	asm (".hello_end: .globl .hello_end\n");
	...

	Using asm labels in global scope is a known source of problems, as explained
	in the comment of proc function_range in gdb/testsuite/lib/dwarf.exp.

	Fix this by using function_range instead.

	Tested on x86_64-linux with gcc and clang-7 and clang-12.

2021-09-15  Claudiu Zissulescu  <claziss@synopsys.com>

	arc: Fix got-weak linker test
	Use regular expressions to fix the got-weak linker test.

	ld/
		* testsuite/got-weak.d: Update test.

2021-09-15  Andrew Burgess  <andrew.burgess@embecosm.com>

	bfd: fix incorrect type used in sizeof
	Noticed in passing that we used 'sizeof (char **)' when calculating
	the size of a list of 'char *' pointers.  Of course, this isn't really
	going to make a difference anywhere, but we may as well be correct.

	There should be no user visible changes after this commit.

	bfd/ChangeLog:

		* archures.c (bfd_arch_list): Use 'char *' instead of 'char **'
		when calculating space for a string list.

2021-09-15  Tom de Vries  <tdevries@suse.de>

	[gdb/doc] Fix typo in maint selftest entry
	Fix typo "will by" -> "will be".

2021-09-15  Tom de Vries  <tdevries@suse.de>

	[bfd] Ensure unique printable names for bfd archs
	Remove duplicate entry in bfd_ft32_arch and bfd_rx_arch.

	Fix printable name for bfd_mach_n1: "nh1" -> "n1".

		PR 28336
		* cpu-ft32.c (arch_info_struct): Remove "ft32" entry.
		* cpu-rx.c (arch_info_struct): Remove "rx" entry.
		* cpu-nds32.c (bfd_nds32_arch): Fix printable name for bfd_mach_n1
		entry.

2021-09-15  Alan Modra  <amodra@gmail.com>

	PR28328, dlltool ice
		PR 28328
		* archive.c (bfd_ar_hdr_from_filesystem): Don't use bfd_set_input_error
		here, our caller will do that.

2021-09-15  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-14  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb_load_no_complaints with gnu-debuglink
	When running test-case gdb.dwarf2/dw2-ranges-psym-warning.exp with target
	board gnu-debuglink I run into:
	...
	(gdb) file dw2-ranges-psym-warning^M
	Reading symbols from dw2-ranges-psym-warning...^M
	Reading symbols from .debug/dw2-ranges-psym-warning.debug...^M
	(gdb) FAIL: gdb.dwarf2/dw2-ranges-psym-warning.exp: No complaints
	...

	Fix this by updating the regexp in gdb_load_no_complaints.

	Tested on x86_64-linux.

2021-09-14  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Fix function range handling in psymtabs
	Consider the test-case from this patch.

	We run into:
	...
	(gdb) PASS: gdb.dwarf2/dw2-ranges-psym-warning.exp: continue
	bt^M
	warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M
	^M
	warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M
	^M
	warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M
	^M
	warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M
	^M
	warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M
	^M
	warning: (Internal error: pc 0x4004b6 in read in psymtab, but not in symtab.)^M
	^M
	  read in psymtab, but not in symtab.)^M
	^M
	)^M
	(gdb) FAIL: gdb.dwarf2/dw2-ranges-psym-warning.exp: bt
	...

	This happens as follows.

	The function foo:
	...
	 <1><31>: Abbrev Number: 4 (DW_TAG_subprogram)
	    <33>   DW_AT_name        : foo
	    <37>   DW_AT_ranges      : 0x0
	...
	has these ranges:
	...
	    00000000 00000000004004c1 00000000004004d2
	    00000000 00000000004004ae 00000000004004af
	    00000000 <End of list>
	...
	which have a hole at at [0x4004af,0x4004c1).

	However, the address map of the partial symtabs incorrectly maps addresses
	in the hole (such as 0x4004b6 in the backtrace) to the foo CU.

	The address map of the full symbol table of the foo CU however does not
	contain the addresses in the hole, which is what the warning / internal error
	complains about.

	Fix this by making sure that ranges of functions are read correctly.

	The patch adds a bit to struct partial_die_info, in this hole (shown for
	x86_64-linux):
	...
	/*   11: 7   |     4 */    unsigned int canonical_name : 1;
	/* XXX  4-byte hole  */
	/*   16      |     8 */    const char *raw_name;
	...
	So there's no increase in size for 64-bit, but AFAIU there will be an increase
	for 32-bit.

	Tested on x86_64-linux.

	gdb/ChangeLog:

	2021-08-10  Tom de Vries  <tdevries@suse.de>

		PR symtab/28200
		* dwarf2/read.c (struct partial_die_info): Add has_range_info and
		range_offset field.
		(add_partial_subprogram): Handle pdi->has_range_info.
		(partial_die_info::read): Set pdi->has_range_info.

	gdb/testsuite/ChangeLog:

	2021-08-10  Tom de Vries  <tdevries@suse.de>

		PR symtab/28200
		* gdb.dwarf2/dw2-ranges-psym-warning-main.c: New test.
		* gdb.dwarf2/dw2-ranges-psym-warning.c: New test.
		* gdb.dwarf2/dw2-ranges-psym-warning.exp: New file.

2021-09-14  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Fix CU list in .debug_names for dummy CUs
	With current trunk and target board cc-with-debug-names we have:
	...
	(gdb) file dw2-ranges-psym^M
	Reading symbols from dw2-ranges-psym...^M
	warning: Section .debug_names in dw2-ranges-psym has abbreviation_table of \
	  size 1 vs. written as 28, ignoring .debug_names.^M
	(gdb) set complaints 0^M
	(gdb) FAIL: gdb.dwarf2/dw2-ranges-psym.exp: No complaints
	...

	The executable has 8 compilation units:
	...
	$ readelf -wi dw2-ranges-psym | grep @
	  Compilation Unit @ offset 0x0:
	  Compilation Unit @ offset 0x2e:
	  Compilation Unit @ offset 0xa5:
	  Compilation Unit @ offset 0xc7:
	  Compilation Unit @ offset 0xd2:
	  Compilation Unit @ offset 0x145:
	  Compilation Unit @ offset 0x150:
	  Compilation Unit @ offset 0x308:
	...
	of which the ones at 0xc7 and 0x145 are dummy CUs (that is, they do not
	contain a single DIE), which were added by recent commit 5ef670d81fd
	"[gdb/testsuite] Add dummy start and end CUs in dwarf assembly".

	The .debug_names section contains this CU table:
	...
	[  0] 0x0
	[  1] 0x2e
	[  2] 0xa5
	[  3] 0xd2
	[  4] 0x150
	[  5] 0x308
	[  6] 0x1
	[  7] 0x0
	...
	The last two entries are incorrect, and the entries for the dummy CUs are
	missing.

	The last two entries are incorrect because here in write_debug_names we write
	the dimension of the CU list as 8:
	...
	  /* comp_unit_count - The number of CUs in the CU list.  */
	  header.append_uint (4, dwarf5_byte_order,
	                     per_objfile->per_bfd->all_comp_units.size ()
	                     - per_objfile->per_bfd->tu_stats.nr_tus);
	...
	while the actual dimension of the CU list is 6.

	The discrepancy is caused by this code which skips the dummy CUs:
	...
	  for (int i = 0; i < per_objfile->per_bfd->all_comp_units.size (); ++i)
	    {
	      ...
	      /* CU of a shared file from 'dwz -m' may be unused by this main
	        file.  It may be referenced from a local scope but in such
	        case it does not need to be present in .debug_names.  */
	      if (psymtab == NULL)
	       continue;
	...
	because they have a null partial symtab.

	We can fix this by writing the actual dimension of the CU list, but that still
	leaves the dummy CUs out of the CU list.  The purpose of having these is to
	delimit the end of preceding CUs.

	So, fix this by:
	- removing the code that skips the dummy CUs (note that the same change
	  was done for .gdb_index in commit efba5c2319d '[gdb/symtab] Handle PU
	  without import in "save gdb-index"'.
	- verifying that all units are represented in the CU/TU lists
	- using the actual CU list size when writing the dimension of the CU list
	  (and likewise for the TU list).

	Tested on x86_64-linux with native and target board cc-with-debug-names.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28261

2021-09-14  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Generate .debug_aranges in gdb.dwarf2/locexpr-data-member-location.exp
	When running test-case gdb.dwarf2/locexpr-data-member-location.exp with target
	board cc-with-debug-names, all tests pass but we run into PR28261:
	...
	(gdb) run ^M
	Starting program: locexpr-data-member-location ^M
	warning: Section .debug_names in locexpr-data-member-location-lib.so has \
	  abbreviation_table of size 1 vs. written as 37, ignoring .debug_names.^M
	...

	Using a patch that fixes PR28261, the warning is gone, but we run into:
	...
	FAIL: gdb.dwarf2/locexpr-data-member-location.exp: step into foo
	...

	This is due a missing .debug_aranges contribution for the CU declared in
	gdb.dwarf2/locexpr-data-member-location.exp.

	Fix this by adding the missing .debug_aranges contribution.

	Tested on x86_64-linux.

2021-09-14  Claudiu Zissulescu  <claziss@synopsys.com>

	arc: Fix potential invalid pointer access when fixing got symbols.
	When statically linking, it can arrive to an undefined weak symbol of
	which its value cannot be determined. However, we are having pieces of
	code which doesn't take this situation into account, leading to access
	a structure which may not be initialized. Fix this situation and add a
	test.

	bfd/
	xxxx-xx-xx  Cupertino Miranda  <cmiranda@synopsys.com>
	            Claudiu Zissulescu  <claziss@synopsys.com>

		* arc-got.h (arc_static_sym_data): New structure.
		(get_static_sym_data): New function.
		(relocate_fix_got_relocs_for_got_info): Move the computation fo
		symbol value and section to above introduced function, and use
		this new function.

	ld/testsuite/
	xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

		* ld-arc/got-weak.d: New file.
		* ld-arc/got-weak.s: Likewise.


	fix

2021-09-14  Mike Frysinger  <vapier@gentoo.org>

	sim: bfin: add support for SDL2
	This probably should have been ported long ago, but better late than
	never.  We keep support for both versions for now since both projects
	tend to have long lifetimes.  Maybe consider dropping SDL1 in another
	ten years.

2021-09-14  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-14  Tom Tromey  <tom@tromey.com>

	Remove use of __CYGNUSCLIB__
	I found a check of __CYGNUSCLIB__ in dbxread.c.  I think this is dead
	code.  This patch removes it.

2021-09-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Check for valid test name
	When running gdb.base/batch-exit-status.exp I noticed that the test name
	contains a newline:
	...
	PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M
	: No such file or directory\.: [lindex $result 2] == 0
	...

	Check for this in ::CheckTestNames::check, such that we have a warning:
	...
	PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M
	: No such file or directory\.: [lindex $result 2] == 0
	WARNING: Newline in test name
	...

	Tested on x86_64-linux.

2021-09-13  Tom de Vries  <tdevries@suse.de>

	[gdb/tdep] Fix exec check in gdb_print_insn_arm
	With a gdb build with --enable-targets=all we run into a KFAIL:
	...
	KFAIL: gdb.gdb/unittest.exp: executable loaded: maintenance selftest, \
	  failed none (PRMS: gdb/27891)
	...
	due to:
	...
	Running selftest print_one_insn.^M
	Self test failed: arch armv8.1-m.main: self-test failed at \
	  disasm-selftests.c:165^M
	...

	The test fails because we expect disassembling of one arm insn to consume 4
	bytes and produce (using verbose = true in disasm-selftests.c):
	...
	arm mov r0, #0
	...
	but instead the disassembler uses thumb mode and only consumes 2
	bytes and produces:
	...
	arm movs        r0, r0
	...

	The failure does not show up in the "no executable loaded" variant because
	this code in gdb_print_insn_arm isn't triggered:
	...
	  if (current_program_space->exec_bfd () != NULL)
	    info->flags |= USER_SPECIFIED_MACHINE_TYPE;
	...
	and consequently we do this in print_insn:
	...
	      if ((info->flags & USER_SPECIFIED_MACHINE_TYPE) == 0)
	        info->mach = bfd_mach_arm_unknown;
	...
	and don't set force_thumb to true in select_arm_features.

	The code in gdb_print_insn_arm makes the assumption that the disassembly
	architecture matches the exec architecture, which in this case is incorrect,
	because the exec architecture is x86_64, and the disassembly architecture is
	armv8.1-m.main.  Fix that by explicitly checking it:
	...
	  if (current_program_space->exec_bfd () != NULL
	      && (current_program_space->exec_bfd ()->arch_info
		  == gdbarch_bfd_arch_info (gdbarch)))
	...

	This fixes the print_one_insn failure, so remove the KFAIL.

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27891

2021-09-13  Tom de Vries  <tdevries@suse.de>

	[gdb/tdep] Reset force_thumb in parse_arm_disassembler_options
	With a gdb build with --enable-targets=all, we have 2 arch-specific failures
	in selftest print_one_insn:
	...
	$ gdb -q -batch a.out -ex "maint selftest print_one_insn" 2>&1 \
	  | grep "Self test failed: arch "
	Self test failed: arch armv8.1-m.main: self-test failed at \
	  disasm-selftests.c:165
	Self test failed: arch arm_any: self-test failed at disasm-selftests.c:165
	$
	...

	During the first failed test, force_thumb is set to true, and remains so until
	and during the second test, which causes the second failure.

	Fix this by resetting force_thumb to false in parse_arm_disassembler_options,
	such that we get just one failure:
	...
	$ gdb -q -batch a.out -ex "maint selftest print_one_insn" 2>&1 \
	  | grep "Self test failed: arch "
	Self test failed: arch armv8.1-m.main: self-test failed at \
	  disasm-selftests.c:165
	$
	...

	Tested on x86_64-linux.

2021-09-13  Tom Tromey  <tromey@adacore.com>

	Fix no-Python build
	A build without Python will currently fail, because
	selftests::test_python uses gdb_python_initialized, which is only
	conditionally defined.

	This patch fixes the build by making test_python also be conditionally
	defined.  I chose this approach because the selftest will fail if
	Python is not enabled, so it didn't seem useful to leave it defined.

2021-09-13  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Update the assembler insn testcase.
	Since the 0x57 is preserved for the vadd.vv instruction in the integration
	branch, remove it to make sure the testcase can work.

	gas/
		* testsuite/gas/riscv/insn.d: Remove 0x57 since it is preserved
		for vadd.vv instruction.
		* testsuite/gas/riscv/insn.s: Likewise.

2021-09-13  Jan Beulich  <jbeulich@suse.com>

	MIPS: don't use get_symbol_name() for section parsing.  With s_change_section() later calling obj_elf_section(), it seems better to pre-parse the section name by the same function that will be used there. This way no differences in what is accepted will result.
	gas	* config/tc-mips.c (s_change_section): Use obj_elf_section_name to
		parse the section name.

	ia64: don't use get_symbol_name() for section parsing.  With cross_section() later calling obj_elf_section(), it seems better to pre-parse the section name by the same function that will be used there. This way no differences in what is accepted will result.
	gas	* config/tc-ia64.c (cross_section): Use obj_elf_section_name to
		parse the section name.

2021-09-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.gdb/selftest.exp
	With a gdb build with CFLAGS "-O2 -g -flto=auto", I run into:
	...
	 #7  gdb_main (args=0x7fffffffd220) at src/gdb/main.c:1368^M
	 #8  main (argc=<optimized out>, argv=<optimized out>) at src/gdb/gdb.c:32^M
	 (gdb) FAIL: gdb.gdb/selftest.exp: backtrace through signal handler
	...
	which means that this regexp in proc test_with_self fails:
	...
	  -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
	...

	The problem is that gdb_main has been inlined into main, and consequently the
	backtrace uses:
	...
	 #x  <fn> ...
	...
	instead of
	...
	 #x  <address> in <fn> ...
	...

	Fix this by updating the regexp to not require "in" before " main".

	Tested on x86_64-linux.

2021-09-13  Alan Modra  <amodra@gmail.com>

	Re: Deprecate a.out support for NetBSD targets
		* config.bfd: Correct m68-*-*bsd* obsolete target match.

2021-09-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix test name in gdb.base/batch-exit-status.exp
	When running gdb.base/batch-exit-status.exp I noticed that the test name
	contains a newline:
	...
	PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M
	: No such file or directory\.: [lindex $result 2] == 0
	...

	The mistake is that I passed an output regexp argument to a parameter
	interpreted as testname prefix.  Fix this by passing a testname prefix
	instead.

	Add support for checking output, to be able to handle the output regexp
	argument.

	Tested on x86_64-linux.

2021-09-13  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-12  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Set sysroot earlier in local-board.exp
	When running test-case gdb.base/batch-exit-status.exp for native, it passes.
	But with target board cc-with-debug-names, we run into (added missing double
	quotes for clarity):
	...
	builtin_spawn $build/gdb/testsuite/../../gdb/gdb -nw -nx \
	  -data-directory $build/gdb/testsuite/../data-directory \
	  -iex "set height 0" -iex "set width 0" -ex "set sysroot" -batch ""^M
	: No such file or directory.^M
	PASS: gdb.base/batch-exit-status.exp: \
	  : No such file or directory\.: [lindex $result 2] == 0
	FAIL: gdb.base/batch-exit-status.exp: \
	  : No such file or directory\.: [lindex $result 3] == $expect_status
	...

	The difference between the passing and failing case is that with native we
	have (leaving out set height/width for brevity):
	...
	$ gdb -batch ""; echo $?
	: No such file or directory.
	1
	...
	and with target board cc-with-debug-names:
	...
	$ gdb -ex "set sysroot" -batch ""; echo $?
	: No such file or directory.
	0
	...

	The difference is expected.  GDB returns the exit status of the last executed
	command.  In the former case that's 'file ""', which fails.  In the latter case,
	that's 'set sysroot', which succeeds.

	Fix this by setting sysroot using -iex instead of -ex in local-board.exp, such
	that we have the expected:
	...
	$ gdb -iex "set sysroot" -batch ""; echo $?
	: No such file or directory.
	1
	...

	Tested on x86_64-linux.

2021-09-12  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-11  Mike Frysinger  <vapier@gentoo.org>

	sim: run: change help short option to -h
	It's unclear why -H was picked over the more standard -h, but since
	-h is still not used, just change -H to -h to match pretty much every
	other tool in the sourceware tree.

2021-09-11  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-10  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Reimplement gdb.gdb/python-selftest.exp as unittest
	The test-case gdb.gdb/python-selftest.exp:
	- patches the gdb_python_initialized variable in gdb to 0
	- checks that the output of a python command is "Python not initialized"

	Reimplement gdb.gdb/python-selftest.exp as unittest, using:
	- execute_command_to_string to capture the output
	- try/catch to catch the "Python not initialized" exception.

	Tested on x86_64-linux.

2021-09-10  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix DUPLICATE in gdb.base/global-var-nested-by-dso.exp
	Fix DUPLICATE in gdb.base/global-var-nested-by-dso.exp by naming commands more
	uniquely.

2021-09-10  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix DUPLICATE in gdb.base/skip-solib.exp
	Fix DUPLICATE in gdb.base/skip-solib.exp by using with_test_prefix.

	Also fix indentation style and long lines, remove outdated question/answer
	bits, and use multi_line.

2021-09-10  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix handling of nr_args < 3 in mi_gdb_test
	The documentation of mi_gdb_test states that the command, pattern and message
	arguments are mandatory:
	...
	 # mi_gdb_test COMMAND PATTERN MESSAGE [IPATTERN] -- send a command to gdb;
	 #   test the result.
	...

	However, this is not checked, and when mi_gdb_test is called with less than 3
	arguments, it passes or fails silently.

	Fix this by using the following semantics:
	- if there are 1 or 2 arguments, use the command as the message.
	- if there is 1 argument, use ".*" as the pattern.
	- if there are no or too much arguments, error out.

	Fix a PATH issue in gdb.mi/mi-logging.exp, introduced by using the command as
	message.  Fix a few other trivial-looking FAILs.

	There are 11 less trivial-looking FAILs left in gdb.mi in test-cases:
	- mi-nsmoribund.exp
	- mi-breakpoint-changed.exp
	- mi-break.exp.

	Tested on x86_64-linux.

2021-09-10  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add string_list_to_regexp
	A regexp pattern with escapes like this is hard to read:
	...
	set re "~\"\[$\]$decimal = 1\\\\n\"\r\n\\^done"
	...

	We can make it more readable by spacing out parts (which allows us to also use
	the curly braces where that's convenient):
	...
	set re [list "~" {"} {[$]} $decimal " = 1" "\\\\" "n" {"} "\r\n" "\\^" "done"]
	set re [join $re ""]
	...
	or by using string_to_regexp:
	...
	set re [list \
	            [string_to_regexp {~"$}] \
	            $decimal \
	            [string_to_regexp " = 1\\n\"\r\n^done"]]
	set re [join $re ""]
	...
	Note: we have to avoid applying string_to_list to decimal, which is already a
	regexp.

	Add a proc string_list_to_regexp to make it easy to do both:
	...
	set re [list \
	            [string_list_to_regexp ~ {"} $] \
	            $decimal \
	            [string_list_to_regexp " = 1" \\ n {"} \r\n ^ done]]
	...

	Also add a test-case gdb.testsuite/string_to_regexp.exp.

2021-09-10  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle unrecognized command line option in gdb_compile_test
	When running the gdb testsuite with gnatmake-4.8, I get many fails of the
	following form:
	...
	gcc: error: unrecognized command line option '-fgnat-encodings=all'^M
	gnatmake: "gdb.ada/O2_float_param/foo.adb" compilation error^M
	compiler exited with status 1
	compilation failed: gcc ... gdb.ada/O2_float_param/foo.adb
	gcc: error: unrecognized command line option '-fgnat-encodings=all'
	gnatmake: "gdb.ada/O2_float_param/foo.adb" compilation error
	FAIL: gdb.ada/O2_float_param.exp: scenario=all: compilation foo.adb
	...

	Fix this by marking the test unsupported instead, such that we have:
	...
	UNSUPPORTED: gdb.ada/O2_float_param.exp: scenario=all: compilation foo.adb \
	  (unsupported option '-fgnat-encodings=all')
	...

	Tested on x86_64-linux.

2021-09-10  Alan Modra  <amodra@gmail.com>

	PowerPC, sanity check r_offset in relocate_section
	        * elf32-ppc.c (offset_in_range): New function.
		(ppc_elf_vle_split16): Sanity check r_offset before accessing
		section contents.  Return status.
	        (ppc_elf_relocate_section): Sanity check r_offset before
	        accessing section contents.  Don't segfault on NULL howto.

	Re: gas: Use the directory name in .file 0
		PR gas/28266
		* testsuite/gas/elf/dwarf-5-file0-2.s: Use %object rather than
		@object, .4byte instead of .long, and .asciz instead of .string.

2021-09-10  Mike Frysinger  <vapier@gentoo.org>

	etc: switch to automake
	There's no content in here currently, so switching to automake is
	pretty easy with a stub file.

	etc: rename configure.in to configure.ac
	The .in name has been deprecated for a long time in favor of .ac.

2021-09-10  H.J. Lu  <hjl.tools@gmail.com>

	gas: Use the directory name in .file 0
	DWARF5 allows .file 0 to take an optional directory name.  Set the entry
	0 of the directory table to the directory name in .file 0.

		PR gas/28266
		* dwarf2dbg.c (get_directory_table_entry): Add an argument for
		the directory name in .file 0 and use it, instead of PWD.
		(allocate_filenum): Pass NULL to get_directory_table_entry.
		(allocate_filename_to_slot): Pass the incoming dirname to
		get_directory_table_entry.
		* testsuite/gas/elf/dwarf-5-file0-2.d: New file.
		* testsuite/gas/elf/dwarf-5-file0-2.s: Likewise.
		* testsuite/gas/elf/elf.exp: Run dwarf-5-file0-2.

2021-09-10  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-09  Yoshinori Sato  <ysato@users.sourceforge.jp>

	gdb: Enable target rx-*-*linux.
	I added rx-*-linux in binutils few yaers ago.
	But missing this changes,

2021-09-09  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/coredump-filter-build-id.exp with older eu-unstrip
	On openSUSE Leap 42.3 with eu-unstrip 0.158, we run into:
	...
	(gdb) PASS: gdb.base/coredump-filter-build-id.exp: save corefile
	First line of eu-unstrip: \
	  0x400000+0x202000 f4ae8502bd6a14770182382316bc595e9dc6f08b@0x400284 - - [exe]
	FAIL: gdb.base/coredump-filter-build-id.exp: gcore dumped mapping with build-id
	...

	The test expects an actual file name instead of '[exe]', but that only got
	introduced with eu-unstrip 0.161.  Before it printed '[exe]' or '[pie]'.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

2021-09-09  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix various issues in gdb.mi/mi-sym-info.exp
	I noticed this failure in gdb.mi/mi-sym-info.exp with gcc-4.8:
	...
	FAIL: gdb.mi/mi-sym-info.exp: -symbol-info-functions --max-results 1 \
	  (unexpected output)
	...
	due to function f2 instead of f3 being listed.

	AFAICT, this is caused by a difference in debug info:
	...
	$ readelf -wi outputs/gdb.mi/mi-sym-info/mi-sym-info1.o \
	  | egrep "DW_AT_name.*: f[1-3]"
	    <72>   DW_AT_name        : f1
	    <a1>   DW_AT_name        : f2
	    <d0>   DW_AT_name        : f3
	...
	vs:
	...
	$ readelf -wi outputs/gdb.mi/mi-sym-info/mi-sym-info1.o \
	  | egrep "DW_AT_name.*: f[1-3]"
	    <f4>   DW_AT_name        : f3
	    <123>   DW_AT_name        : f2
	    <152>   DW_AT_name        : f1
	...
	and the command documentation does not mention an imposed order, so fix this
	by allowing f2 as well.

	Doing this fix, it made sense to do a refactoring of adding f2_re and f3_re
	variables, in order to write (?:$f2_re|$f3_re), and I applied the same pattern
	overall.

	Furthermore, I found a silent FAIL due to calling mi_gdb_proc with 2 args, fix
	by updating the regexp.

	Then I ran with clang and found another FAIL, fix by updating the regexp.

	Tested on x86_64-linux with gcc-4.8.5, gcc-7.5.0, gcc-11.2.1, clang-7.0.1 and
	clang-12.0.1.

2021-09-09  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Reimplement gdb.gdb/complaints.exp as unittest
	When building gdb with "-Wall -O2 -g -flto=auto", I run into:
	...
	(gdb) call clear_complaints()^M
	No symbol "clear_complaints" in current context.^M
	(gdb) FAIL: gdb.gdb/complaints.exp: clear complaints
	...

	The problem is that lto has optimized away the clear_complaints function
	and consequently the selftest doesn't work.

	Fix this by reimplementing the selftest as a unit test.

	Factor out two new functions:
	- void
	  execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn);
	- std::string
	  execute_fn_to_string (std::function<void(void)> fn, bool term_out);
	and use the latter to capture the complaints output.

	Tested on x86_64-linux.

2021-09-09  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: remove all uses of Py_TPFLAGS_HAVE_ITER
	Python 2 has a bit flag Py_TPFLAGS_HAVE_ITER which can be passed as
	part of the tp_flags field when defining a new object type.  This flag
	is not defined in Python 3 and so we define it to 0 in
	python-internal.h (when IS_PY3K is defined).

	The meaning of this flag is that the object has the fields tp_iter and
	tp_iternext.  Note the use of "has" here, the flag says nothing about
	the values in those fields, just that the type object has the fields.

	In early versions of Python 2 these fields were no part of the
	PyTypeObject struct, they were added in version 2.2 (see
	https://docs.python.org/release/2.3/api/type-structs.html).  And so,
	there could be a some code compiled out there which has a PyTypeObject
	structure within it that doesn't even have the tp_iter and tp_iternext
	fields, attempting to access these fields would be undefined
	behaviour.

	And so Python added the Py_TPFLAGS_HAVE_ITER flag.  If the flag is
	present then Python is free to access the tp_iter and tp_iternext
	fields.

	If we consider GDB then we always assume that the tp_iter and
	tp_iternext fields are part of PyTypeObject.  If someone was crazy
	enough to try and compile GDB against Python 2.1 then we'd get lots of
	build errors saying that we were passing too many fields when
	initializing PyTypeObject structures.  And so, I claim, we can be sure
	that GDB will always be compiled with a version of Python that has the
	tp_iter and tp_iternext fields in PyTypeObject.

	Next we can look at the Py_TPFLAGS_DEFAULT flag.  In Python 2, each
	time additional fields are added to PyTypeObject a new Py_TPFLAGS_*
	flag would be defined to indicate whether those flags are present or
	not.  And, those new flags would be added to Py_TPFLAGS_DEFAULT.  And
	so, in the latest version of Python 2 the Py_TPFLAGS_DEFAULT flag
	includes Py_TPFLAGS_HAVE_ITER (see
	https://docs.python.org/2.7/c-api/typeobj.html).

	In GDB we pass Py_TPFLAGS_DEFAULT as part of the tp_flags for all
	objects we define.

	And so, in this commit, I propose to remove all uses of
	Py_TPFLAGS_HAVE_ITER from GDB, it's simply not needed.

	There should be no user visible changes after this commit.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: accept -EB/-EL short options
	Many GNU tools accept -EB/-EL as short options for selecting big &
	little endian modes.  While the sim has an -E option, it requires
	spelling out "big" and "little".  Adding support for -EB & -EL is
	thus quite trivial, so lets round it out to be less annoying.

	sim: ppc: drop support for std-config.h overrides
	Only the ppc arch supports this kind of source file override logic.
	All the others expose knobs via configure flags, and for some of
	these, the ppc code does as well.  For others, it doesn't make sense
	to ever change them.  Since it's unlikely anyone is using this, drop
	it all to simplify the code (and to get us a little closer to the
	common sim code).

	sim: ppc: enable use of gnulib
	All other sim arches are using this now, so finish up the logic in
	the ppc arch to enable gnulib usage here too.

	sim: drop old O_NDELAY & FNBLOCK support
	We use these older names inconsistently in the sim codebase, and time
	has moved on long ago, so drop support for these non-standard names.
	POSIX provides O_NONBLOCK for us, so use it everywhere.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: dv-sockser: enable for mingw targets too
	We have enough functionality from gnulib now to build sockser on
	all platforms.

	Non-blocking I/O is supported when F_GETFL/F_SETFL are unavailable,
	but we can address that in a follow up commit.  This mirrors what
	is done in other places in the sim already.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: cgen: workaround Windows VOID define
	The cgen framework provides a "VOID" type for code to use, but this
	defines ends up conflicting with the standard Windows VOID define.
	Since they actually define to the same thing ("void"), undef it here
	to fix the Windows build.

	We might want to reconsider the need for "VOID" in cgen, but that
	will take larger discussion & coordination with the cgen project.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: dv-sockser: move sim-main.h include after system includes
	The sim-main.h header is a bit of a dumping ground.  Every arch can
	(and many do) define all sorts of weird & common names that end up
	conflicting with system headers.  So including it before the system
	headers sets us up for pain.  v850 is a good example of this -- when
	building for mingw, we see weird failures:

	$ i686-w64-mingw32-gcc ... -c -o dv-sockser.o ../../../../sim/v850/../common/dv-sockser.c
	In file included from ../../../../sim/v850/sim-main.h:11,
	                 from ../../../../sim/v850/../common/dv-sockser.c:24:
	../../../../sim/v850/../common/sim-base.h:97:32: error: expected ')' before '->' token
	  97 | # define STATE_CPU(sd, n) ((sd)->cpu[0])
	     |                                ^~

	While gcc is unhelpful at first, running it through the preprocessor
	by hand shows more details:

	$ i686-w64-mingw32-gcc ... -E -dD -o dv-sockser.i ../../../../sim/v850/../common/dv-sockser.c
	$ i686-w64-mingw32-gcc -c dv-sockser.i
	In file included from /usr/i686-w64-mingw32/usr/include/minwindef.h:163,
	                 from /usr/i686-w64-mingw32/usr/include/windef.h:9,
	                 from /usr/i686-w64-mingw32/usr/include/windows.h:69,
	                 from /usr/i686-w64-mingw32/usr/include/winsock2.h:23,
	                 from ../../gnulib/import/sys/socket.h:684,
	                 from ../../gnulib/import/netinet/in.h:43,
	                 from ../../../../sim/v850/../common/dv-sockser.c:39:
	/usr/i686-w64-mingw32/usr/include/winnt.h:4803:25: error: expected ')' before '->' token
	 4803 |       DWORD State;
	      |                         ^
	      |                         )

	This is because v850 sets up this common name:

	All of this needs cleaning up someday, but since the dv-sockser code
	definitely should be fixed in this way, lets do that now and unblock
	the v850 code.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: mips: delete unused PSIZE define
	It's unclear what this define is for as it appears to be unused, and
	has never been used in the history of the mips sim.  Delete it to tidy
	up, and to fix build errors for Windows targets that have a standard
	"PSIZE" struct in their system headers.  This doesn't show up yet as
	most sim files don't include many system headers, but enabling sockser
	code for mingw uncovers the conflict.

	Unfortunately the error produced by gcc is inscrutable, but running
	it through the preprocessor manually manages to provide a pointer to
	the underlying issue.

	$ i686-w64-mingw32-gcc ... -c -o dv-sockser.o ../../../../sim/mips/../common/dv-sockser.c
	<command-line>: error: expected identifier or '(' before numeric constant
	In file included from /usr/i686-w64-mingw32/usr/include/windows.h:71,
	                 from /usr/i686-w64-mingw32/usr/include/winsock2.h:23,
	                 from ../../gnulib/import/sys/socket.h:684,
	                 from ../../gnulib/import/netinet/in.h:43,
	                 from ../../../../sim/mips/../common/dv-sockser.c:39:
	/usr/i686-w64-mingw32/usr/include/wingdi.h:2934:59: error: unknown type name 'LPSIZE'; did you mean 'LPSIZEL'?
	 2934 |   WINGDIAPI WINBOOL WINAPI GetAspectRatioFilterEx(HDC hdc,LPSIZE lpsize);
	      |                                                           ^~~~~~
	      |                                                           LPSIZEL
	...

	$ i686-w64-mingw32-gcc ... -E -dD -o dv-sockser.i ../../../../sim/mips/../common/dv-sockser.c
	$ i686-w64-mingw32-gcc -c dv-sockser.i
	In file included from /usr/i686-w64-mingw32/usr/include/windows.h:69,
	                 from /usr/i686-w64-mingw32/usr/include/winsock2.h:23,
	                 from ../../gnulib/import/sys/socket.h:684,
	                 from ../../gnulib/import/netinet/in.h:43,
	                 from ../../../../sim/mips/../common/dv-sockser.c:39:
	/usr/i686-w64-mingw32/usr/include/windef.h:104:9: error: expected identifier or '(' before numeric constant
	  104 | } SIZE,*PSIZE,*LPSIZE;
	      |         ^~

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: switch to common warning flags
	Now that the ppc code has been cleaned up enough to use the same set
	of warning flags as the common code, delete the ppc-specific configure
	logic so we can leverage what the common code already defined for us.

2021-09-09  Tom de Vries  <tdevries@suse.de>

	sim: ppc: enable -Wpointer-sign warnings
	When compiling with --enable-werror and CFLAGS="-O0 -g -Wall", we run into:
	...
	src/sim/ppc/hw_memory.c: In function 'hw_memory_init_address':
	src/sim/ppc/hw_memory.c:204:7: error: pointer targets in passing argument 4 \
	  of 'device_find_integer_array_property' differ in signedness \
	  [-Werror=pointer-sign]
	       &new_chunk->size);
	       ^
	...

	Fix these by adding an explicit pointer cast.  It's a bit ugly to use APIs
	based on signed integers to read out unsigned values, but in practice, this
	is par for the course in the ppc code.

	We already use signed APIs and assign the result to unsigned values a lot:
	see how device_find_integer_property returns a signed integer (cell), but
	then assign it to unsigned types.  The array APIs are not used that often
	which is why we don't see many warnings, and we disable warnings when we
	assign signed integers to unsigned integers in general.

	The dtc/libfdt project (which is the standard in other projects) processes
	the fdt blob as a series of bytes without any type information.  Typing is
	left to the caller.  They have core APIs that read/write bytes, and a few
	helper functions to cast/convert those bytes to the right value (e.g. u32).
	In this ppc sim code, the core APIs use signed integers, and the callers
	convert to unsigned, usually implicitly.

	We could add some core APIs to the ppc sim that deal with raw bytes and then
	add some helpers to convert to the right type, but that seems like a lot of
	lifting for what boils down to a cast, and is effectively equivalent to all
	the implicit assignments we use elsewhere.  Long term, a lot of the ppc code
	should either get converted to existing sim common code, or we should stand
	up proper APIs in the common code first, or use standard libraries to do all
	the processing (e.g. libfdt).  Either way, this device.c code would all get
	deleted, and callers (like these hw_*.c files) would get converted.  Which
	is also why we go with a cast rather new (but largely unused) APIs.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: enable -Wmissing-declarations & -Wmissing-prototypes
	This aligns with common code which already uses this flag.  We have
	to add another local prototype to fix the failure, and add another
	local decl for the SIM_DESC type.  Unwinding these will require a
	lot more work & conversions in the process, so going with the decl
	for now unblocks the warning unification.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: microblaze: replace custom basic types with common ones
	The basic "byte" type conflicts with Windows headers, and we already
	have common types that provide the right sizes.  So replace these with
	the common ones to avoid issues.

	  CC     dv-sockser.o
	In file included from /usr/i686-w64-mingw32/usr/include/wtypes.h:8,
	                 from /usr/i686-w64-mingw32/usr/include/winscard.h:10,
	                 from /usr/i686-w64-mingw32/usr/include/windows.h:97,
	                 from /usr/i686-w64-mingw32/usr/include/winsock2.h:23,
	                 from ../../gnulib/import/sys/socket.h:684,
	                 from ../../gnulib/import/netinet/in.h:43,
	                 from .../build/sim/../../../sim/microblaze/../common/dv-sockser.c:39:
	/usr/i686-w64-mingw32/usr/include/rpcndr.h:63:25: error: conflicting types for 'byte'; have 'unsigned char'
	   63 |   typedef unsigned char byte;
	      |                         ^~~~
	In file included from .../buildsim/../../../sim/microblaze/sim-main.h:21,
	                 from .../buildsim/../../../sim/microblaze/../common/dv-sockser.c:24:
	.../buildsim/../../../sim/microblaze/microblaze.h:94:25: note: previous declaration of 'byte' with type 'byte' {aka 'char'}
	   94 | typedef char            byte;
	      |                         ^~~~
	make: *** [Makefile:513: dv-sockser.o] Error 1

2021-09-09  Jim Wilson  <jimw@sifive.com>

	RISC-V: Pretty print values formed with lui and addiw.
	The disassembler has support to pretty print values created by an lui/addi
	pair, but there is no support for addiw.  There is also no support for
	c.addi and c.addiw.  This patch extends the pretty printing support to
	handle these 3 instructions in addition to addi.  Existing testcases serve
	as tests for the new feature.

		opcodes/
		* riscv-dis.c (maybe_print_address): New arg wide.  Sign extend when
		wide is true.
		(print_insn_args): Fix calls to maybe_print_address.  Add checks for
		c.addi, c.addiw, and addiw, and call maybe_print_address for them.

		gas/
		* testsuite/gas/riscv/insn.d: Update for disassembler change.
		* testsuite/gas/li32.d, testsuite/gas/li64.d: Likwise.
		* testsuite/gas/lla64.d: Likewise.

2021-09-09  Mike Frysinger  <vapier@gentoo.org>

	sim: ppc: align format string settings with common code
	This copies logic used in the common sim warning configure code to fix
	build errors for mingw targets.  Turning format warnings on triggers
	a failure in the debug.c file, so apply a minor fix at the same time.

	sim: ppc: drop unnecessary config includes
	This file is compiled for the --host & --build system which leads to
	including the configure generated config.h in both environments.
	This obviously doesn't work when the two targets don't look alike at
	all and can cause build failures here (e.g. a mingw host & a linux
	build).  Since we don't actually need any config settings in this
	very simple file, drop the includes entirely.

2021-09-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-08  Mike Frysinger  <vapier@gentoo.org>

	gnulib: import various network functions
	Some sim ports use these to provide networking functionality via the
	dv-sockser module or via direct emulation for a few ports.

	Gdb seems to build just fine still too.

2021-09-08  Tom Tromey  <tromey@adacore.com>

	Fix unit test build on Windows
	Like Tom de Vries' earlier patch to fix the no-CXX_STD_THREAD case in
	maint.c, this patch fixes a similar problem in
	parallel-for-selftests.c.  This fixes a build failure on Windows.

2021-09-08  Alan Modra  <amodra@gmail.com>

	PowerPC64, sanity check r_offset in relocate_section
	This hardens the powerpc64 linker code transformations.

		* elf64-ppc.c (is_8byte_reloc, offset_in_range): New functions.
		(ppc64_elf_relocate_section): Sanity check r_offset before
		accessing section contents for various code transformations.

2021-09-08  Alan Modra  <amodra@gmail.com>

	PowerPC64: Avoid useless work on R_PPC64_TPREL34
	_bfd_elf_ppc_at_tprel_transform doesn't handle prefix instructions,
	and I'm not inclined to implement code editing for them.

		* elf64-ppc.c (ppc64_elf_relocate_section): Don't attempt tprel
		transform for R_PPC64_TPREL34.

2021-09-08  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: make thread_suspend_state::stop_pc optional
	Currently the stop_pc field of thread_suspect_state is a CORE_ADDR and
	when we want to indicate that there is no stop_pc available we set
	this field back to a special value.

	There are actually two special values used, in post_create_inferior
	the stop_pc is set to 0.  This is a little unfortunate, there are
	plenty of embedded targets where 0 is a valid pc value.  The more
	common special value for stop_pc though, is set in
	thread_info::set_executing, where the value (~(CORE_ADDR) 0) is used.

	This commit changes things so that the stop_pc is instead a
	gdb::optional.  We can now explicitly reset the field to an
	uninitialised state, we also have asserts that we don't read the
	stop_pc when its in an uninitialised state (both in
	gdbsupport/gdb_optional.h, when compiling with _GLIBCXX_DEBUG
	defined, and in thread_info::stop_pc).

	One situation where a thread will not have a stop_pc value is when the
	thread is stopped as a consequence of GDB being in all stop mode, and
	some other thread stopped at an interesting event.  When GDB brings
	all the other threads to a stop those other threads will not have a
	stop_pc set (thus avoiding an unnecessary read of the pc register).

	Previously, when GDB passed through handle_one (in infrun.c) the
	threads executing flag was set to false and the stop_pc field was left
	unchanged, i.e. it would (previous) have been left as ~0.

	Now, handle_one leaves the stop_pc with no value.

	This caused a problem when we later try to set these threads running
	again, in proceed() we compare the current pc with the cached stop_pc.
	If the thread was stopped via handle_one then the stop_pc would have
	been left as ~0, and the compare (in proceed) would (likely) fail.
	Now however, this compare tries to read the stop_pc when it has no
	value and this would trigger an assert.

	To resolve this I've added thread_info::stop_pc_p() which returns true
	if the thread has a cached stop_pc.  We should only ever call
	thread_info::stop_pc() if we know that there is a cached stop_pc,
	however, this doesn't mean that every call to thread_info::stop_pc()
	needs to be guarded with a call to thread_info::stop_pc_p(), in most
	cases we know that the thread we are looking at stopped due to some
	interesting event in that thread, and so, we know that the stop_pc is
	valid.

	After running the testsuite I've seen no other situations where
	stop_pc is read uninitialised.

	There should be no user visible changes after this commit.

2021-09-08  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Fix build with undefined CXX_STD_THREAD
	When building gdb on openSUSE Leap 42.3, we trigger the case that
	CXX_STD_THREAD is undefined, and run into:
	...
	gdb/maint.c: In function 'void maintenance_show_worker_threads \
	  (ui_file*, int, cmd_list_element*, const char*)':
	gdb/maint.c:877:14: error: 'gdb::thread_pool' has not been declared
	         gdb::thread_pool::g_thread_pool->thread_count ());
	              ^
	Makefile:1647: recipe for target 'maint.o' failed
	make[1]: *** [maint.o] Error 1
	...

	Fix this by handling the undefined CXX_STD_THREAD case in
	maintenance_show_worker_threads, such that we get:
	...
	$ gdb -q -batch -ex "maint show worker-thread"
	The number of worker threads GDB can use is 0.
	...

	Tested on x86_64-linux.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28312

2021-09-08  Mike Frysinger  <vapier@gentoo.org>

	sim: update configure target list
	Fix sorting of the list, and update the globs to match the list used
	in gdb's configure script.

	gdb: cris: enable sim integration
	The sim side is already ready to go for cris, so wire it up.

	gdb: aarch64: enable sim integration
	The sim side is already ready to go for aarch64, so wire it up.

	gdb: sim: consolidate configure settings
	Moving all the sim settings to one section makes it easier to track,
	and makes it easier to keep it aligned with the sim target tests.
	The gdb logic was duplicating this when handling different OS targets
	instead of having a single cpu check.  Now it's more obvious that the
	sim is tied to a cpu and not related to the OS.

2021-09-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-07  Tom Tromey  <tromey@adacore.com>

	Remove unused declaration from gdbserver/win32-low.h
	I noticed that gdbserver/win32-low.h has an unused declaration.  This
	code was changed a while ago, but this declaration slipped through.
	This patch removes it.  Tested by rebuilding.

2021-09-07  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: make use of std::string in utils.c
	Replace some of the manual string management (malloc/free) with
	std::string when creating commands in utils.c.

	Things are a little bit messy as, creating the prefix commands (using
	add_basic_prefix_cmd and add_show_prefix_cmd), doesn't copy the doc
	string, while creating the actual set/show commands (using
	add_setshow_enum_cmd) does copy the doc string.

	As a result, I have retained the use of xstrprintf when creating the
	prefix command doc strings, but switched to using std::string when
	creating the actual set/show commands.

	There should be no user visible changes after this commit.

2021-09-07  Luis Machado  <luis.machado@linaro.org>

	Revert: [AArch64] MTE corefile support
	        bfd     * elf.c (elfcore_make_memtag_note_section): New function.
	                (elfcore_grok_note): Handle NT_MEMTAG note types.

	        binutils* readelf.c (get_note_type): Handle NT_MEMTAG note types.

	        include * elf/common.h (NT_MEMTAG): New constant.
	                (NT_MEMTAG_TYPE_AARCH_MTE): New constant.

2021-09-07  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: use bool instead of int in struct internal_problem
	Change struct internal_problem (gdb/utils.c) to use bool instead of
	int, update the 3 static instances of this structure that we create to
	use true/false instead of 1/0.

	I've also updated the comments on struct internal_problem as the
	existing comment doesn't seem to be referring to the structure, it
	talks about returning something, which doesn't make sense in this
	context.

	There should be no user visible changes after this commit.

2021-09-07  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: make thread_info::executing private
	Rename thread_info::executing to thread_info::m_executing, and make it
	private.  Add a new get/set member functions, and convert GDB to make
	use of these.

	The only real change of interest in this patch is in thread.c where I
	have deleted the helper function set_executing_thread, and now just
	use the new set function thread_info::set_executing.  However, the old
	helper function set_executing_thread included some code to reset the
	thread's stop_pc, so I moved this code into the new function
	thread_info::set_executing.  However, I don't believe there is
	anywhere that this results in a change of behaviour, previously the
	executing flag was always set true through a call to
	set_executing_thread anyway.

2021-09-07  Nick Clifton  <nickc@redhat.com>

	Fix an illegal memory access triggered by an atempt to disassemble a corrupt xtensa binary.
		PR 28305
		* elf32-xtensa.c (elf_xtensa_do_reloc): Add check for put of range
		reloc.

2021-09-07  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/python: new function to add values into GDB's history
	The guile API has (history-append! <value>) to add values into GDB's
	history list.  There is currently no equivalent in the Python API.

	This commit adds gdb.add_history(<value>) to the Python API, this
	function takes <value> a gdb.Value (or anything that can be passed to
	the constructor of gdb.Value), and adds the value it represents to
	GDB's history list.  The index of the newly added value is returned.

2021-09-07  Nick Clifton  <nickc@redhat.com>

	Fix illegal memory access triggered by an attempt to disassemble a corrupt RISC-V binary.
		PR 28303
		* elfxx-riscv.c (riscv_elf_add_sub_reloc): Add check for out of
		range relocs.

2021-09-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle internal-error in gdb_unload
	When reverting commit 5a20fadc841 and using gdb_unload instead of runto "bar"
	to trigger the internal-error in test-case
	gdb.dwarf2/locexpr-data-member-location.exp, we run into:
	...
	ERROR: couldn't unload file in $gdb (timeout).
	...
	and the test-case takes about 1 minute.

	Fix this by handling internal-error in gdb_unload, such that we have:
	...
	ERROR: Couldn't unload file in $gdb (GDB internal error).
	ERROR: Could not resync from internal error (eof)
	...
	within 2 seconds.

	Tested on x86_64-linux.

2021-09-07  Alan Modra  <amodra@gmail.com>

	PR28307, segfault in ppc64_elf_toc64_reloc
	Adds missing bfd_reloc_offset_in_range checks to various relocation
	special_functions.

		PR 28307
		* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Range check reloc offset.
		* elf64-ppc.c (ppc64_elf_ha_reloc, ppc64_elf_brtaken_reloc): Likewise.
		(ppc64_elf_toc64_reloc, ppc64_elf_prefix_reloc): Likewise.

2021-09-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-07  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle internal-error in gdb_run_cmd
	When reverting commit 5a20fadc841 the test-case
	gdb.dwarf2/locexpr-data-member-location.exp fails like this:
	...
	FAIL: gdb.dwarf2/locexpr-data-member-location.exp: running to bar in runto \
	  (GDB internal error)
	ERROR: Could not resync from internal error (eof)
	...
	and takes 1 minute to run.

	The long running time is caused by running into a timeout in gdb_run_cmd, at
	this point:
	...
	(gdb) run ^M
	The program being debugged has been started already.^M
	Start it from the beginning? (y or n) y^M
	/home/vries/gdb_versions/devel/src/gdb/gdbtypes.c:5583: internal-error: \
	  Unexpected type field location kind: 4^M
	A problem internal to GDB has been detected,^M
	further debugging may prove unreliable.^M
	Quit this debugging session? (y or n)
	...

	Fix this by detecting the internal-error in gdb_run_cmd.  We don't handle it
	in gdb_run_cmd, but stash the gdb output back into the buffer using
	-notransfer, and let the caller proc runto deal with it.

	After the fix, the test-case just takes 2 seconds.

	Tested on x86_64-linux.

2021-09-06  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: rename gdb/testsuite/gdb.arch/riscv64-unwind-prologue-with-ld-lw.c
	A previous commit added the
	gdb.arch/riscv64-unwind-prologue-with-ld-lw.exp testcase, but one of its
	associated file was named after a previous version of the test.

	This commit fixes this and makes sure that all the files linked to this
	testcase share the same prefix in the name.

	Tested on riscv64 GNU/Linux.

2021-09-06  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Handle eof in gdb_internal_error_resync
	Before commit 5a20fadc841 the test-case
	gdb.dwarf2/locexpr-data-member-location.exp fails like this:
	...
	FAIL: gdb.dwarf2/locexpr-data-member-location.exp: running to bar in runto \
	  (GDB internal error)
	ERROR: : spawn id exp9 not open
	    while executing
	"expect {
	-i exp9 -timeout 10
	            -re "Quit this debugging session\\? \\(y or n\\) $" {
	                send_gdb "n\n" answer
	                incr count
	            }
	            -re "Create ..."
	    ("uplevel" body line 1)
	    invoked from within
	"uplevel $body" NONE : spawn id exp9 not open
	ERROR: Could not resync from internal error (timeout)
	...

	Fix the:
	...
	ERROR: : spawn id exp9 not open
	...
	by handling eof in gdb_internal_error_resync, such that we have instead:
	...
	FAIL: gdb.dwarf2/locexpr-data-member-location.exp: running to bar in runto \
	  (GDB internal error)
	ERROR: Could not resync from internal error (eof)
	...

	Tested on x86_64-linux.

2021-09-06  Tom Tromey  <tom@tromey.com>

	Remove some complaints.h includes
	There are a few includes of complaints.h that aren't necessary.  This
	patch removes them.  Tested by rebuilding.

2021-09-06  Nick Clifton  <nickc@redhat.com>

	Fix an illegal memory access triggered by disassembling corrupt s390x binaries.
		PR 28304
		* elfxx-score7.c (score_elf_gprel15_reloc): If there is no output bfd
		treat the reloc as undefined.

	Fix potential use on an uninitialised vairable in the MCore assembler.

	Fix potential uninitialised variable in microblaze assembler code.

2021-09-06  Yinjun Zhang  <yinjun.zhang@corigine.com>

	Add a sanity check to the init_nfp6000_mecsr_sec() function in the NFP disassembler.

2021-09-06  Alexandra Hájková  <ahajkova@redhat.com>

	gdbtypes.c: Add the case for FIELD_LOC_KIND_DWARF_BLOCK
	The case for FIELD_LOC_KIND_DWARF_BLOCK was missing for
	switch TYPE_FIELD_LOC_KIND. Thas caused an internal-error
	under some circumstances.

	Fixes bug 28030.

2021-09-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-04  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Check avx support in gdb.arch/amd64-disp-step-avx.exp
	On a machine on Open Build Service I'm running into a SIGILL for test-case
	gdb.arch/amd64-disp-step-avx.exp:
	...
	Program received signal SIGILL, Illegal instruction.^M
	test_rip_vex2 () at gdb.arch/amd64-disp-step-avx.S:40^M
	40              vmovsd ro_var(%rip),%xmm0^M
	(gdb) FAIL: gdb.arch/amd64-disp-step-avx.exp: vex2: \
	  continue to test_rip_vex2_end
	...
	The SIGILL happens when trying to execute the first avx instruction in the
	executable.

	I can't directly access the machine, but looking at the log for test-case
	gdb.arch/i386-avx.exp, it seems that there's no avx support:
	...
	Breakpoint 1, main (argc=1, argv=0x7fffffffd6b8) at gdb.arch/i386-avx.c:68^M
	68        if (have_avx ())^M
	(gdb) print have_avx ()^M
	$1 = 0^M
	...

	Fix this by:
	- adding a gdb_caching_proc have_avx, similar to have_mpx, using the have_avx
	  function from gdb.arch/i386-avx.c
	- using proc have_avx in both gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp
	  and gdb/testsuite/gdb.arch/i386-avx.exp.

	Tested on my x86_64-linux laptop with avx support, where both test-cases pass.

	gdb/testsuite/ChangeLog:

	2021-09-04  Tom de Vries  <tdevries@suse.de>

		PR testsuite/26950
		* gdb/testsuite/gdb.arch/i386-avx.c (main): Remove call to have_avx.
		(have_avx): Move ...
		* gdb/testsuite/lib/gdb.exp (have_avx): ... here.  New proc.
		* gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp: Use have_avx.
		* gdb/testsuite/gdb.arch/i386-avx.exp: Same.

2021-09-04  Mike Frysinger  <vapier@gentoo.org>

	gnulib: import sys_wait
	A few sims use this to emulate process syscalls.
	Gdb builds seem to still be fine.

2021-09-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-03  Tom Tromey  <tromey@adacore.com>

	Use CORE_ADDR as return type from x86_dr_low_get_addr
	On a Windows build locally, watchpoints started failing.  I tracked
	this down to x86_dr_low_get_addr returning an 'unsigned long'... in
	this particular build, this is a 32-bit type, but the inferior is a
	64-bit program.

	This patch fixes the problem by changing the return type.  No other
	change is required, because this matches the function pointer in
	struct x86_dr_low_type.

2021-09-03  Kevin Buettner  <kevinb@redhat.com>

	Test case reproducing PR28030 bug
	The original reproducer for PR28030 required use of a specific
	compiler version - gcc-c++-11.1.1-3.fc34 is mentioned in the PR,
	though it seems probable that other gcc versions might also be able to
	reproduce the bug as well.  This commit introduces a test case which,
	using the DWARF assembler, provides a reproducer which is independent
	of the compiler version.  (Well, it'll work with whatever compilers
	the DWARF assembler works with.)

	To the best of my knowledge, it's also the first test case which uses
	the DWARF assembler to provide debug info for a shared object.  That
	being the case, I provided more than the usual commentary which should
	allow this case to be used as a template when a combo shared
	library / DWARF assembler test case is required in the future.

	I provide some details regarding the bug in a comment near the
	beginning of locexpr-dml.exp.

	This problem was difficult to reproduce; I found myself constantly
	referring to the backtrace while trying to figure out what (else) I
	might be missing while trying to create a reproducer.  Below is a
	partial backtrace which I include for posterity.

	 #0  internal_error (
	    file=0xc50110 "/ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/gdbtypes.c", line=5575,
	    fmt=0xc520c0 "Unexpected type field location kind: %d")
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdbsupport/errors.cc:51
	 #1  0x00000000006ef0c5 in copy_type_recursive (objfile=0x1635930,
	    type=0x274c260, copied_types=0x30bb290)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/gdbtypes.c:5575
	 #2  0x00000000006ef382 in copy_type_recursive (objfile=0x1635930,
	    type=0x274ca10, copied_types=0x30bb290)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/gdbtypes.c:5602
	 #3  0x0000000000a7409a in preserve_one_value (value=0x24269f0,
	    objfile=0x1635930, copied_types=0x30bb290)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/value.c:2529
	 #4  0x000000000072012a in gdbscm_preserve_values (
	    extlang=0xc55720 <extension_language_guile>, objfile=0x1635930,
	    copied_types=0x30bb290)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/guile/scm-value.c:94
	 #5  0x00000000006a3f82 in preserve_ext_lang_values (objfile=0x1635930,
	    copied_types=0x30bb290)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/extension.c:568
	 #6  0x0000000000a7428d in preserve_values (objfile=0x1635930)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/value.c:2579
	 #7  0x000000000082d514 in objfile::~objfile (this=0x1635930,
	    __in_chrg=<optimized out>)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/objfiles.c:549
	 #8  0x0000000000831cc8 in std::_Sp_counted_ptr<objfile*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x1654580)
	    at /usr/include/c++/11/bits/shared_ptr_base.h:348
	 #9  0x00000000004e6617 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x1654580) at /usr/include/c++/11/bits/shared_ptr_base.h:168
	 #10 0x00000000004e1d2f in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x190bb88, __in_chrg=<optimized out>)
	    at /usr/include/c++/11/bits/shared_ptr_base.h:705
	 #11 0x000000000082feee in std::__shared_ptr<objfile, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x190bb80, __in_chrg=<optimized out>)
	    at /usr/include/c++/11/bits/shared_ptr_base.h:1154
	 #12 0x000000000082ff0a in std::shared_ptr<objfile>::~shared_ptr (
	    this=0x190bb80, __in_chrg=<optimized out>)
	    at /usr/include/c++/11/bits/shared_ptr.h:122
	 #13 0x000000000085ed7e in __gnu_cxx::new_allocator<std::_List_node<std::shared_ptr<objfile> > >::destroy<std::shared_ptr<objfile> > (this=0x114bc00,
	    __p=0x190bb80) at /usr/include/c++/11/ext/new_allocator.h:168
	 #14 0x000000000085e88d in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<objfile> > > >::destroy<std::shared_ptr<objfile> > (__a=...,
	    __p=0x190bb80) at /usr/include/c++/11/bits/alloc_traits.h:531
	 #15 0x000000000085e50c in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::_M_erase (this=0x114bc00, __position=
	  std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x1635930})
	    at /usr/include/c++/11/bits/stl_list.h:1925
	 #16 0x000000000085df0e in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::erase (this=0x114bc00, __position=
	  std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x1635930})
	    at /usr/include/c++/11/bits/list.tcc:158
	 #17 0x000000000085c748 in program_space::remove_objfile (this=0x114bbc0,
	    objfile=0x1635930)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/progspace.c:210
	 #18 0x000000000082d3ae in objfile::unlink (this=0x1635930)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/objfiles.c:487
	 #19 0x000000000082e68c in objfile_purge_solibs ()
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/objfiles.c:875
	 #20 0x000000000092dd37 in no_shared_libraries (ignored=0x0, from_tty=1)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/solib.c:1236
	 #21 0x00000000009a37fe in target_pre_inferior (from_tty=1)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/target.c:2496
	 #22 0x00000000007454d6 in run_command_1 (args=0x0, from_tty=1,
	    run_how=RUN_NORMAL)
	    at /ironwood1/sourceware-git/f34-pr28030/bld/../../worktree-pr28030/gdb/infcmd.c:437

	I'll note a few points regarding this backtrace:

	Frame #1 is where the internal error occurs.  It's caused by an
	unhandled case for FIELD_LOC_KIND_DWARF_BLOCK.  The fix for this bug
	adds support for this case.

	Frame #22 - it's a partial backtrace - shows that GDB is attempting to
	(re)run the program.  You can see the exact command sequence that was
	used for reproducing this problem in the PR (at
	https://sourceware.org/bugzilla/show_bug.cgi?id=28030), but in a
	nutshell, after starting the program and advancing to the appropriate
	source line, GDB was asked to step into libstdc++; a "finish" command
	was issued, returning a value.  The fact that a value was returned is
	very important.  GDB was then used to step back into libstdc++.  A
	breakpoint was set on a source line in the library after which a "run"
	command was issued.

	Frame #19 shows a call to objfile_purge_solibs.  It's aptly named.

	Frame #7 is a call to the destructor for one of the objfile solibs; it
	turned out to be the one for libstdc++.

	Frames #6 thru #3 show various value preservation frames.  If you look
	at preserve_values() in gdb/value.c, the value history is preserved
	first, followed by internal variables, followed by values for the
	extension languages (python and guile).

2021-09-03  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add untested case in gdb.gdb/complaints.exp
	When building gdb with "-Wall -O2 -g -flto=auto", I run into:
	...
	(gdb) call clear_complaints()^M
	No symbol "clear_complaints" in current context.^M
	(gdb) FAIL: gdb.gdb/complaints.exp: clear complaints
	...

	The problem is that lto has optimized away clear_complaints, and consequently
	the selftests cannot run.

	Fix this by:
	- using info function to detect presence of clear_complaints
	- handling the absence of clear_complaints by calling untested
	...
	(gdb) UNTESTED: gdb.gdb/complaints.exp: \
	  Cannot find clear_complaints, skipping test
	...

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-09-03  Tom de Vries  <tdevries@suse.de>

		* gdb.gdb/complaints.exp: Use untested if clear_complaints cannot
		be found.

2021-09-03  Felix Willgerodt  <felix.willgerodt@intel.com>

	gdb: Enable finish command and inferior calls for _Float16 on amd64 and i386.
	Values of type _Float16 and _Float16 _Complex can now be used on CPUs with
	AVX512-FP16 support. Return values of those types are located in XMM0.
	Compiler support for gcc and clang is in progress, see e.g.:
	https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574117.html

	gdb/ChangeLog:
	2021-07-21  Felix Willgerodt  <Felix.Willgerodt@intel.com>

		* amd64-tdep.c (amd64_classify): Classify _Float16 and
		_Float16 _Complex as AMD64_SSE.
		* i386-tdep.c (i386_extract_return_value): Read _Float16 and
		_Float16 _Complex from xmm0.

	gdb/testsuite/ChangeLog:
	2021-07-21  Felix Willgerodt  <Felix.Willgerodt@intel.com>

		* gdb.arch/x86-avx512fp16-abi.c: New file.
		* gdb.arch/x86-avx512fp16-abi.exp: New file.

2021-09-03  Felix Willgerodt  <felix.willgerodt@intel.com>

	Add half support for AVX512 register view.
	This adds support for the half datatype, FP16, to the AVX512 register printing.

	gdb/ChangeLog:
	2020-07-21  Felix Willgerodt  <Felix.Willgerodt@intel.com>

		* i386-tdep.c (i386_zmm_type) <v32_half>: New field.
		(i386_ymm_type) <v16_half>: New field.
		(i386_gdbarch_init): Add set_gdbarch_half_format.
		* features/i386/64bit-avx512.xml: Add half type.
		* features/i386/64bit-avx512.c: Regenerated.
		* features/i386/64bit-sse.xml: Add half type.
		* features/i386/64bit-sse.c: Regenerated.

	gdb/testsuite/ChangeLog:
	2021-07-21  Felix Willgerodt  <Felix.Willgerodt@intel.com>

		* gdb.arch/x86-avx512fp16.c: New file.
		* gdb.arch/x86-avx512fp16.exp: New file.
		* lib/gdb.exp (skip_avx512fp16_tests): New function.

2021-09-03  Felix Willgerodt  <felix.willgerodt@intel.com>

	gdb, i386: Enable AVX512-bfloat16 for i386 targets.
	Values of type bfloat16 can also be used on 32-bit targets, which was missed
	in the original enablement.  This also adjusts the testcase to pass with
	"unix/-m32", where only the lower 8 AVX registers are available.

	gdb/ChangeLog:
	2021-07-21  Felix Willgerodt  <Felix.Willgerodt@intel.com>

		* features/i386/32bit-sse.xml: Add bfloat16 type.
		* features/i386/32bit-sse.c: Regenerated.

	gdb/testsuite/ChangeLog:
	2021-07-21  Felix Willgerodt  <Felix.Willgerodt@intel.com>

		* gdb.arch/x86-avx512bf16.exp: Only use x/z/ymm 0-7.

2021-09-03  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add untested case in selftest_setup
	When building gdb with "-Wall -O2 -g -flto=auto", I run into:
	...
	FAIL: gdb.gdb/python-helper.exp: breakpoint in captured_main \
	  (got interactive prompt)
	FAIL: gdb.gdb/python-helper.exp: run until breakpoint at captured_main
	WARNING: Couldn't test self
	...
	and similar in gdb.gdb/selftest.exp.

	The first FAIL in more detail:
	...
	(gdb) break captured_main^M
	Function "captured_main" not defined.^M
	Make breakpoint pending on future shared library load? (y or [n]) n^M
	(gdb) FAIL: gdb.gdb/python-helper.exp: breakpoint in captured_main \
	  (got interactive prompt)
	...

	The problem is that lto has optimized away the captured_main function
	and consequently the selftests dependent on that cannot run.

	Fix this by:
	- using gdb_breakpoint to detect failure to set the breakpoint
	- handling the failure to set a breakpoint by calling untested
	- not emitting the warning if we've already got untested
	such that we have:
	...
	(gdb) UNTESTED: gdb.gdb/python-helper.exp: Cannot set breakpoint at \
	  captured_main, skipping testcase.
	...

	gdb/testsuite/ChangeLog:

	2021-09-02  Tom de Vries  <tdevries@suse.de>

		* lib/selftest-support.exp: Emit untested when not being able to set
		breakpoint.

2021-09-03  Alan Modra  <amodra@gmail.com>

	ld testsuite tidy
	Fixes a few issues:
	1) If you use "-fsanitize=address,undefined" in CFLAGS, the Makefile
	attempt to trim off -fsanitize options left us with ",undefined".
	2) ld_compile adds CFLAGS_FOR_TARGET itself, no need to pass it.
	3) CFLAGS might be needed linking bootstrap test.

		* Makefile.am (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Trim off
		all -fsanitize=*.
		* Makefile.in: Regenerate.
		* testsuite/ld-bootstrap/bootstrap.exp: Use CFLAGS when linking.
		* testsuite/ld-cdtest/cdtest.exp: Use CFLAGS_FOR_TARGET when
		linking.
		* testsuite/ld-auto-import/auto-import.exp: Don't pass
		CFLAGS_FOR_TARGET to ld_compile.
		* testsuite/ld-cygwin/exe-export.exp: Likewise.
		* testsuite/ld-elfvers/vers.exp: Likewise.
		* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
		* testsuite/ld-elfweak/elfweak.exp: Likewise.
		* testsuite/ld-gc/gc.exp: Likewise.
		* testsuite/ld-pe/pe-compile.exp: Likewise.
		* testsuite/ld-pe/pe-run.exp: Likewise.
		* testsuite/ld-pe/pe-run2.exp: Likewise.
		* testsuite/ld-plugin/plugin.exp: Likewise.
		* testsuite/ld-shared/shared.exp: Likewise.
		* testsuite/ld-elfcomm/elfcomm.exp: Likewise, and don't allow
		nios2 testing to trash CFLAGS_FOR_TARGET.
		* testsuite/ld-scripts/crossref.exp: Don't pass options in
		CC_FOR_TARGET, do so in CFLAGS_FOR_TARGET instead.
		* testsuite/ld-srec/srec.exp: Likewise, and for CXX.

2021-09-03  Alan Modra  <amodra@gmail.com>

	CC_FOR_TARGET et al
	The top level Makefile, the ld Makefile and others, define
	CC_FOR_TARGET to be a compiler for the binutils target machine.  This
	is the compiler that should be used for almost all tests with C
	source.  There are _FOR_TARGET versions of CFLAGS, CXX, and CXXFLAGS
	too.  This was all supposed to work with the testsuite .exp files
	using CC for the target compiler, and CC_FOR_HOST for the host
	compiler, with the makefiles passing CC=$CC_FOR_TARGET and
	CC_FOR_HOST=$CC to the runtest invocation.

	One exception to the rule of using CC_FOR_TARGET is the native-only ld
	bootstrap test, which uses the newly built ld to link a copy of
	itself.  Since the files being linked were created with the host
	compiler, the boostrap test should use CC and CFLAGS, in case some
	host compiler option provides needed libraries automatically.
	However, bootstrap.exp used CC where it should have used CC_FOR_HOST.
	I set about fixing that problem, then decided that playing games in
	the makefiles with CC was a bad idea.  Not only is it confusing, but
	other dejagnu code knows about CC_FOR_TARGET.  See dejagnu/target.exp.

	So this patch gets rid of the makefile variable renaming and changes
	all the .exp files to use the correct _FOR_TARGET variables.
	CC_FOR_HOST and CFLAGS_FOR_HOST disappear.  A followup patch will
	correct bootstrap.exp to use CFLAGS, and a number of other things I
	noticed.

	binutils/
		* testsuite/lib/binutils-common.exp (run_dump_test): Use
		CC_FOR_TARGET and CFLAGS_FOR_TARGET rather than CC and CFLAGS.
	ld/
		* Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET
		and similar.  Pass variables with unchanged names.  Don't set
		CC_FOR_HOST or CFLAGS_FOR_HOST.
		* Makefile.in: Regenerate.
		* testsuite/config/default.exp: Update default CC and similar.
		(compiler_supports, plug_opt): Use CC_FOR_TARGET.
		* testsuite/ld-cdtest/cdtest.exp: Replace all uses of CC with
		CC_FOR_TARGET, and similarly for CFLAGS, CXX and CXXFLAGS.
		* testsuite/ld-auto-import/auto-import.exp: Likewise.
		* testsuite/ld-cygwin/exe-export.exp: Likewise.
		* testsuite/ld-elf/dwarf.exp: Likewise.
		* testsuite/ld-elf/indirect.exp: Likewise.
		* testsuite/ld-elf/shared.exp: Likewise.
		* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
		* testsuite/ld-elfvers/vers.exp: Likewise.
		* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
		* testsuite/ld-elfweak/elfweak.exp: Likewise.
		* testsuite/ld-gc/gc.exp: Likewise.
		* testsuite/ld-ifunc/ifunc.exp: Likewise.
		* testsuite/ld-mn10300/mn10300.exp: Likewise.
		* testsuite/ld-pe/pe-compile.exp: Likewise.
		* testsuite/ld-pe/pe-run.exp: Likewise.
		* testsuite/ld-pe/pe-run2.exp: Likewise.
		* testsuite/ld-pie/pie.exp: Likewise.
		* testsuite/ld-plugin/lto.exp: Likewise.
		* testsuite/ld-plugin/plugin.exp: Likewise.
		* testsuite/ld-scripts/crossref.exp: Likewise.
		* testsuite/ld-selective/selective.exp: Likewise.
		* testsuite/ld-sh/sh.exp: Likewise.
		* testsuite/ld-shared/shared.exp: Likewise.
		* testsuite/ld-srec/srec.exp: Likewise.
		* testsuite/ld-undefined/undefined.exp: Likewise.
		* testsuite/ld-unique/unique.exp: Likewise.
		* testsuite/ld-x86-64/tls.exp: Likewise.
		* testsuite/lib/ld-lib.exp: Likewise.
	libctf/
		* Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET.
		Pass CC and CC_FOR_TARGET.  Don't set CC_FOR_HOST.
		* Makefile.in: Regenerate.
		* testsuite/config/default.exp: Update default CC and similar.
		* testsuite/lib/ctf-lib.exp (run_native_host_cmd): Use CC rather
		than CC_FOR_HOST.
		(run_lookup_test): Use CC_FOR_TARGET and CFLAGS_FOR_TARGET.

2021-09-03  Alan Modra  <amodra@gmail.com>

	pj: asan: out of bounds, ubsan: left shift of negative
		* pj-dis.c: Include libiberty.h.
		(print_insn_pj): Don't index op->arg past array bound.  Don't
		left shift negative int.

	ubsan: alpha: member access within null pointer
		* elf64-alpha.c (elf64_alpha_relax_with_lituse): Avoid UB.

	ubsan: libctf: applying zero offset to null pointer
		* ctf-open.c (init_symtab): Avoid ubsan error.

2021-09-03  Alan Modra  <amodra@gmail.com>

	haiku tidy
	--enable-maintainer-mode showed a number of files needing to be
	regenerated, and in the case of ld/Makefile.in that the file was
	regenerated by hand.  Nothing to see here really.

	ld/
		* Makefile.am (ALL_64_EMULATION_SOURCES): Sort haiku entry.
		* Makefile.in: Regenerate.
		* po/BLD-POTFILES.in: Regenerate.
	libctf/
		* configure: Regenerate.
	zlib/
		* configure: Regenerate.

2021-09-03  Fangrui Song  <maskray@google.com>

	gold: --export-dynamic-symbol: don't imply -u
	to match GNU ld.

	gold/
		* archive.cc (Library_base::should_include_member): Don't handle
		--export-dynamic-symbol.
		* symtab.cc (Symbol_table::do_add_undefined_symbols_from_command_line):
		Likewise.

2021-09-03  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-02  Alexander von Gluck IV  <kallisti5@unixzen.com>

	Add support for the haiku operating system.  These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org.  All of these architectures are working and most have been stable for quite some time.

2021-09-02  Nick Clifton  <nickc@redhat.com>

	Fix the V850 assembler's generation of relocations for the st.b instruction.
		PR 28292
	gas	* config/tc-v850.c (handle_lo16): Also accept
		BFD_RELOC_V850_LO16_SPLIT_OFFSET.
		* testsuite/gas/v850/split-lo16.s: Add extra line.
		* testsuite/gas/v850/split-lo16.d: Update expected disassembly.

	opcodes	* v850-opc.c (D16): Use BFD_RELOC_V850_LO16_SPLIT_OFFSET in place
		of BFD_RELOC_16.

2021-09-02  Alan Modra  <amodra@gmail.com>

	SHT_SYMTAB_SHNDX handling
	.symtab_shndx section contents is an array, one entry for each symbol
	in .symtab, present when the number of symbols exceeds a little less
	than 64k.  Since the mapping is 1-1 with symbols there is no need to
	keep both dest_index and destshndx_index in elf_sym_strtab.  Instead,
	just make sure that the shndx pointers to the swap functions are kept
	NULL when .symtab_shndx does not exist.  Also, strtabcount in the
	linker's elf hash table is incremented in lock-step with the output
	symcount, so that can disappear too.

2021-09-02  Alan Modra  <amodra@gmail.com>

	PTR_ADD and NPTR_ADD for bfd.h
	This defines a couple of macros used to avoid ubsan complaints about
	calculations involving NULL pointers.  PTR_ADD should be used in the
	case where it is known that the offset is always zero with a NULL
	pointer, and you'd like to know if a non-zero offset is ever used.
	NPTR_ADD should be rarely used, but is defined for cases where a
	non-zero offset is expected and should be ignored if the pointer is
	NULL.

	bfd/
		* bfd-in.h (PTR_ADD, NPTR_ADD): Define.
		* bfd-in2.h: Regenerate.
		* elf-eh-frame.c (adjust_eh_frame_local_symbols): Avoid NULL
		pointer calculations.
		* elflink.c (_bfd_elf_strip_zero_sized_dynamic_sections): Likewise.
		(bfd_elf_add_dt_needed_tag, elf_finalize_dynstr): Likewise.
		(elf_link_add_object_symbols, elf_link_input_bfd): Likewise.
		(bfd_elf_final_link, bfd_elf_gc_record_vtinherit): Likewise.
	binutils/
		* objdump.c (disassemble_section): Use PTR_ADD for rel_ppend.

2021-09-02  Alan Modra  <amodra@gmail.com>

	obstack.h __PTR_ALIGN vs. ubsan
	Current ubsan complains on every use of __PTR_ALIGN (when ptrdiff_t is
	as large as a pointer), due to making calculations relative to a NULL
	pointer.  This patch avoids the problem by extracting out and
	simplifying __BPTR_ALIGN for the usual case.  I've continued to use
	ptrdiff_t here, where it might be better to throw away __BPTR_ALIGN
	entirely and just assume uintptr_t exists.

		* obstack.h (__PTR_ALIGN): Expand and simplify __BPTR_ALIGN
		rather than calculating relative to a NULL pointer.

2021-09-02  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-09-01  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix dwo path in fission-*.S
	[ Using $build for /home/vries/gdb_versions/devel/build to make things a bit
	more readable. ]

	When using make check// to run test-case gdb.dwarf2/fission-base.exp:
	...
	( cd $build/gdb; make check//unix RUNTESTFLAGS="fission-base.exp" )
	...
	we run into:
	...
	(gdb) file \
	  $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base^M
	Reading symbols from \
	  $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base...^M
	warning: Could not find DWO CU \
	  $build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo \
	  (0x807060504030201) referenced by CU at offset 0xc7 [in module \
	  $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base]^M
	...

	The problem is that the executable refers to the dwo file using path name
	$build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo,
	while the actual dwo file is at
	$build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base.dwo.

	This is caused by this trick in fission-base.S:
	...
	 #define XSTR(s) STR(s)
	 #define STR(s) #s
	   ...
	   .asciz XSTR(DWO)        # DW_AT_GNU_dwo_name
	...
	and:
	...
	$ echo | gcc -E -dD - | grep "define unix"
	...

	I used this trick to avoid doing additional_flags=-DDWO=\"$dwo\", since I was
	concerned that there could be quoting issues.

	However, I've found other uses of this pattern, f.i. in
	gdb/testsuite/gdb.base/corefile-buildid.exp:
	...
	  additional_flags=-DSHLIB_NAME=\"$dlopen_lib\"]
	...

	So, fix this by:
	- using additional_flags=-DDWO=\"$dwo\" and
	- using plain DWO instead of XSTR(DWO)

	Likewise in other gdb.dwarf2/fission*.exp test-cases.

	Tested on x86_64-linux, using make check//unix.

	gdb/testsuite/ChangeLog:

	2021-09-01  Tom de Vries  <tdevries@suse.de>

		PR testsuite/28298
		* gdb.dwarf2/fission-base.S: Use DWO instead of XSTR(DWO).
		* gdb.dwarf2/fission-loclists-pie.S: Same.
		* gdb.dwarf2/fission-loclists.S: Same.
		* gdb.dwarf2/fission-reread.S: Same.
		* gdb.dwarf2/fission-base.exp: Use additional_flags=-DDWO=\"$dwo\".
		* gdb.dwarf2/fission-loclists-pie.exp: Same.
		* gdb.dwarf2/fission-loclists.exp: Same.
		* gdb.dwarf2/fission-reread.exp: Same.

2021-09-01  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.fortran/call-no-debug.exp symbol search
	On openSUSE Tumbleweed I ran into:
	...
	(gdb) ptype outstring_func.part^M
	No symbol "outstring_func" in current context.^M
	(gdb) FAIL: gdb.fortran/call-no-debug.exp: ptype outstring_func.part
	...
	while on openSUSE Leap 15.2 I have instead:
	...
	(gdb) ptype string_func_^M
	type = <unknown return type> ()^M
	(gdb) PASS: gdb.fortran/call-no-debug.exp: ptype string_func_
	...

	The difference is caused by the result for "info function string_func", which
	is this for the latter:
	...
	(gdb) info function string_func^M
	All functions matching regular expression "string_func":^M
	^M
	Non-debugging symbols:^M
	0x000000000040089c  string_func_^M
	...
	but this for the former:
	...
	(gdb) info function string_func^M
	All functions matching regular expression "string_func":^M
	^M
	Non-debugging symbols:^M
	0x00000000004012bb  string_func_^M
	0x00007ffff7bac5b0  outstring_func.part^M
	0x00007ffff7bb1a00  outstring_func.part^M
	...

	The extra symbols are part of glibc:
	...
	$ nm /lib64/libc.so.6 | grep string_func
	00000000000695b0 t outstring_func.part.0
	000000000006ea00 t outstring_func.part.0
	...

	If glibc debug info is installed, we get instead:
	...
	(gdb) info function string_func^M
	All functions matching regular expression "string_func":^M
	^M
	File /usr/src/debug/glibc-2.33-9.1.x86_64/stdio-common/vfprintf-internal.c:^M
	236:    static int outstring_func(int, size_t, const unsigned int *, FILE *);^M
	^M
	File vfprintf-internal.c:^M
	236:    static int outstring_func(int, size_t, const unsigned char *, FILE *);^M
	^M
	Non-debugging symbols:^M
	0x00000000004012bb  string_func_^M
	...
	and the FAIL doesn't trigger.

	Fix this by calling "info function string_func" before starting the exec, such
	that only symbols of the exec are taken into account.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-09-01  Tom de Vries  <tdevries@suse.de>

		* gdb.fortran/call-no-debug.exp: Avoid shared lib symbols for
		find_mangled_name calls.

2021-09-01  Yinjun Zhang  <yinjun.zhang@corigine.com>

	nfp: add validity check of island and me
	AddressSanitizer detects heap-buffer-overflow when running
	"objdump -D" for nfp .nffw files.

		PR 27854
		* nfp-dis.c (_NFP_ISLAND_MAX, _NFP_ME_MAX): Define.
		(nfp_priv_data): ..and use here.
		(_print_instrs): Sanity check island and menum.

2021-09-01  Alan Modra  <amodra@gmail.com>

	PR28250, Null pointer dereference in debug_class_type_samep
	Typo fix, obviously should be m1->variants != NULL, not
	m1->variants == NULL.

		PR 28250
		* debug.c (debug_class_type_samep): Correct m1->variants test.

2021-09-01  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-31  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove breakpoint_find_if
	Remove breakpoint_find_if, replace its sole usage with using
	all_breakpoints directly instead.  At the same time, change return
	types to use bool.

	Change-Id: I9ec392236b4804b362d16ab563330b9c07311106

2021-08-31  Nick Clifton  <nickc@redhat.com>

	Update the how-to-make-a-release document so that a check for empty manual pages is included.  cf PR 28144

2021-08-31  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Extend .insn directive to support hardcode encoding.
	The .insn directive can let users use their own instructions, or
	some new instruction, which haven't supported in the old binutils.
	For example, if users want to use sifive cache instruction, they
	cannot just write "cflush.d1.l1" in the assembly code, they should
	use ".insn i SYSTEM, 0, x0, x10, -0x40".  But the .insn directive
	may not easy to use for some cases, and not so friendly to users.
	Therefore, I believe most of the users will use ".word 0xfc050073",
	to encode the instructions directly, rather than use .insn.  But
	once we have supported the mapping symbols, the .word directives
	are marked as data, so disassembler won't dump them as instructions
	as usual.  I have discussed this with Kito many times, we all think
	extend the .insn direcitve to support the hardcode encoding, is the
	easiest way to resolve the problem.  Therefore, there are two more
	.insn formats are proposed as follows,

	(original) .insn <type>, <operand1>, <operand2>, ...
	           .insn <insn-length>, <value>
	           .insn <value>

	The <type> is string, and the <insn-length> and <value> are constants.

	gas/
		* config/tc-riscv.c (riscv_ip_hardcode): Similar to riscv_ip,
		but assembles an instruction according to the hardcode values
		of .insn directive.
		* doc/c-riscv.texi: Document two new .insn formats.
		* testsuite/gas/riscv/insn-fail.d: New testcases.
		* testsuite/gas/riscv/insn-fail.l: Likewise.
		* testsuite/gas/riscv/insn-fail.s: Likewise.
		* testsuite/gas/riscv/insn.d: Updated.
		* testsuite/gas/riscv/insn.s: Likewise.

2021-08-31  John Baldwin  <jhb@FreeBSD.org>

	Use gdbfmt for vprintf_filtered.
	gdbfmt was already used for printf_filtered, so using it for
	vprintf_filtered is more consistent.

	As a result, all callers of vfprintf_maybe_filtered now use gdbfmt, so
	the function can be simplified to assume the gdbfmt case and remove
	the associated bool argument.  Similary, vprintf_filtered is now a
	simple wrapper around vfprintf_filtered.

2021-08-31  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-30  John Baldwin  <jhb@FreeBSD.org>

	fbsd-nat: Don't use '%jd' and '%ju' with printf_filtered.
	The handler for 'info proc status' for native processes on FreeBSD
	uses the 'j' size modifier along with uintmax_t / intmax_t casts to
	output integer values for types such as off_t that are not aliases of
	a basic C type such as 'int' or 'long'.  printf_filtered does not
	support the 'j' modifer, so this resulted in runtime errors in
	practice:

	(gdb) info proc stat
	process 8674
	Name: ls
	State: T (stopped)
	Parent process: 8673
	Process group: 8674
	Session id: 2779
	Unrecognized format specifier 'j' in printf

	Instead, use plongest and pulongest to generate the output strings of
	these integer values.

2021-08-30  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix build error in unittests/parallel-for-selftests.c
	We get this error when building GDB on some platforms.  I get it using
	g++-10 on Ubuntu 20.04 (installed using the distro package).  It was
	also reported by John Baldwin, using a clang that uses libc++.

	      CXX    unittests/parallel-for-selftests.o
	    cc1plus: warning: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++
	    /home/smarchi/src/binutils-gdb/gdb/unittests/parallel-for-selftests.c: In function 'void selftests::parallel_for::test(int)':
	    /home/smarchi/src/binutils-gdb/gdb/unittests/parallel-for-selftests.c:53:30: error: use of deleted function 'std::atomic<int>::atomic(const std::atomic<int>&)'
	       53 |   std::atomic<int> counter = 0;
	          |                              ^
	    In file included from /usr/include/c++/9/future:42,
	                     from /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/thread-pool.h:29,
	                     from /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/parallel-for.h:26,
	                     from /home/smarchi/src/binutils-gdb/gdb/unittests/parallel-for-selftests.c:22:
	    /usr/include/c++/9/atomic:755:7: note: declared here
	      755 |       atomic(const atomic&) = delete;
	          |       ^~~~~~
	    /usr/include/c++/9/atomic:759:17: note:   after user-defined conversion: 'constexpr std::atomic<int>::atomic(std::atomic<int>::__integral_type)'
	      759 |       constexpr atomic(__integral_type __i) noexcept : __base_type(__i) { }
	          |                 ^~~~~~

	I haven't dug to know why it does not happen everywhere, but this patch
	fixes it by using the constructor to initialize the variable, rather
	than the assignment operator.

	Change-Id: I6b27958171bf6187f6a875657395fd10441db7e6

2021-08-30  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: PR28291, Fix the gdb fails that PR27916 caused.
	* According to PR28291, we get the following unexpected gdb behavior,

	(gdb) disassemble 0x0,+4
	Dump of assembler code from 0x0 to 0x4:
	   0x0000000000000000:
	   0x0000000000000001:
	   0x0000000000000002:
	   0x0000000000000003:
	End of assembler dump.

	* This patch should fix it to the right behavior,

	(gdb) disassemble 0x0,+4
	Dump of assembler code from 0x0 to 0x4:
	   0x0000000000000000:  Cannot access memory at address 0x0

	opcodes/
	    pr 28291
	    * riscv-dis.c (print_insn_riscv): Return STATUS if it is not zero.

2021-08-30  Tom Tromey  <tom@tromey.com>

	Add some parallel_for_each tests
	Tom de Vries noticed that a patch in the DWARF scanner rewrite series
	caused a regression in parallel_for_each -- it started crashing in the
	case where the number of threads is 0 (there was an unchecked use of
	"n-1" that was used to size an array).

	He also pointed out that there were no tests of parallel_for_each.
	This adds a few tests of parallel_for_each, primarily testing that
	different settings for the number of threads will work.  This test
	catches the bug that he found in that series.

2021-08-30  Tom Tromey  <tom@tromey.com>

	Add a show function for "maint show worker-threads"
	I wanted to see how many threads gdb thought it was using, but
	"maint show worker-threads" only reported "unlimited".  This patch
	adds a show function so that it will now report the number of threads
	gdb has started.

	Regression tested on x86-64 Fedora 34.

2021-08-30  Tom de Vries  <tdevries@suse.de>

	[gdb/cli] Don't assert on empty string for core-file
	With current gdb we run into:
	...
	$ gdb -batch '' ''
	: No such file or directory.
	pathstuff.cc:132: internal-error: \
	  gdb::unique_xmalloc_ptr<char> gdb_abspath(const char*): \
	  Assertion `path != NULL && path[0] != '\0'' failed.
	...

	Fix this by skipping the call to gdb_abspath in core_target_open in the
	empty-string case, such that we have instead:
	...
	$ gdb -batch '' ''
	: No such file or directory.
	: No such file or directory.
	$
	...

	Tested on x86_64-linux.

	gdb/ChangeLog:

	2021-08-30  Tom de Vries  <tdevries@suse.de>

		PR cli/28290
		* gdb/corelow.c (core_target_open): Skip call to gdb_abspath in the
		empty-string case.

	gdb/testsuite/ChangeLog:

	2021-08-30  Tom de Vries  <tdevries@suse.de>

		PR cli/28290
		* gdb.base/batch-exit-status.exp: Add gdb '' and gdb '' '' tests.

2021-08-30  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: PR27916, Support mapping symbols.
	Similar to ARM/AARCH64, we add mapping symbols in the symbol table,
	to mark the start addresses of data and instructions.  The $d means
	data, and the $x means instruction.  Then the disassembler uses these
	symbols to decide whether we should dump data or instruction.

	Consider the mapping-04 test case,
	$ cat tmp.s
	  .text
	  .option norelax
	  .option norvc
	  .fill 2, 4, 0x1001
	  .byte 1
	  .word 0
	  .balign 8
	  add a0, a0, a0
	  .fill 5, 2, 0x2002
	  add a1, a1, a1
	  .data
	  .word 0x1             # No need to add mapping symbols.
	  .word 0x2

	$ riscv64-unknown-elf-as tmp.s -o tmp.o
	$ riscv64-unknown-elf-objdump -d tmp.o

	Disassembly of section .text:

	0000000000000000 <.text>:
	   0:   00001001         .word   0x00001001  # Marked $d, .fill directive.
	   4:   00001001         .word   0x00001001
	   8:   00000001         .word   0x00000001  # .byte + part of .word.
	   c:   00               .byte   0x00        # remaining .word.
	   d:   00               .byte   0x00        # Marked $d, odd byte of alignment.
	   e:   0001             nop                 # Marked $x, nops for alignment.
	  10:   00a50533         add     a0,a0,a0
	  14:   20022002         .word   0x20022002  # Marked $d, .fill directive.
	  18:   20022002         .word   0x20022002
	  1c:   2002             .short  0x2002
	  1e:   00b585b3         add     a1,a1,a1    # Marked $x.
	  22:   0001             nop                 # Section tail alignment.
	  24:   00000013         nop

	* Use $d and $x to mark the distribution of data and instructions.
	  Alignments of code are recognized as instructions, since we usually
	  fill nops for them.

	* If the alignment have odd bytes, then we cannot just fill the nops
	  into the spaces.  We always fill an odd byte 0x00 at the start of
	  the spaces.  Therefore, add a $d mapping symbol for the odd byte,
	  to tell disassembler that it isn't an instruction.  The behavior
	  is same as Arm and Aarch64.

	The elf/linux toolchain regressions all passed.  Besides, I also
	disable the mapping symbols internally, but use the new objudmp, the
	regressions passed, too.  Therefore, the new objudmp should dump
	the objects corretly, even if they don't have any mapping symbols.

	bfd/
		pr 27916
		* cpu-riscv.c (riscv_elf_is_mapping_symbols): Define mapping symbols.
		* cpu-riscv.h: extern riscv_elf_is_mapping_symbols.
		* elfnn-riscv.c (riscv_maybe_function_sym): Do not choose mapping
		symbols as a function name.
		(riscv_elf_is_target_special_symbol): Add mapping symbols.
	binutils/
		pr 27916
		* testsuite/binutils-all/readelf.s: Updated.
		* testsuite/binutils-all/readelf.s-64: Likewise.
		* testsuite/binutils-all/readelf.s-64-unused: Likewise.
		* testsuite/binutils-all/readelf.ss: Likewise.
		* testsuite/binutils-all/readelf.ss-64: Likewise.
		* testsuite/binutils-all/readelf.ss-64-unused: Likewise.
	gas/
		pr 27916
		* config/tc-riscv.c (make_mapping_symbol): Create a new mapping symbol.
		(riscv_mapping_state): Decide whether to create mapping symbol for
		frag_now.  Only add the mapping symbols to text sections.
		(riscv_add_odd_padding_symbol): Add the mapping symbols for the
		riscv_handle_align, which have odd bytes spaces.
		(riscv_check_mapping_symbols): Remove any excess mapping symbols.
		(md_assemble): Marked as MAP_INSN.
		(riscv_frag_align_code): Marked as MAP_INSN.
		(riscv_init_frag): Add mapping symbols for frag, it usually called
		by frag_var.  Marked as MAP_DATA for rs_align and rs_fill, and
		marked as MAP_INSN for rs_align_code.
		(s_riscv_insn): Marked as MAP_INSN.
		(riscv_adjust_symtab): Call riscv_check_mapping_symbols.
		* config/tc-riscv.h (md_cons_align): Defined to riscv_mapping_state
		with MAP_DATA.
		(TC_SEGMENT_INFO_TYPE): Record mapping state for each segment.
		(TC_FRAG_TYPE): Record the first and last mapping symbols for the
		fragments.  The first mapping symbol must be placed at the start
		of the fragment.
		(TC_FRAG_INIT): Defined to riscv_init_frag.
		* testsuite/gas/riscv/mapping-01.s: New testcase.
		* testsuite/gas/riscv/mapping-01a.d: Likewise.
		* testsuite/gas/riscv/mapping-01b.d: Likewise.
		* testsuite/gas/riscv/mapping-02.s: Likewise.
		* testsuite/gas/riscv/mapping-02a.d: Likewise.
		* testsuite/gas/riscv/mapping-02b.d: Likewise.
		* testsuite/gas/riscv/mapping-03.s: Likewise.
		* testsuite/gas/riscv/mapping-03a.d: Likewise.
		* testsuite/gas/riscv/mapping-03b.d: Likewise.
		* testsuite/gas/riscv/mapping-04.s: Likewise.
		* testsuite/gas/riscv/mapping-04a.d: Likewise.
		* testsuite/gas/riscv/mapping-04b.d: Likewise.
		* testsuite/gas/riscv/mapping-norelax-04a.d: Likewise.
		* testsuite/gas/riscv/mapping-norelax-04b.d: Likewise.
		* testsuite/gas/riscv/no-relax-align.d: Updated.
		* testsuite/gas/riscv/no-relax-align-2.d: Likewise.
	include/
		pr 27916
		* opcode/riscv.h (enum riscv_seg_mstate): Added.

	opcodes/
		pr 27916
		* riscv-dis.c (last_map_symbol, last_stop_offset, last_map_state):
		Added to dump sections with mapping symbols.
		(riscv_get_map_state): Get the mapping state from the symbol.
		(riscv_search_mapping_symbol): Check the sorted symbol table, and
		then find the suitable mapping symbol.
		(riscv_data_length): Decide which data size we should print.
		(riscv_disassemble_data): Dump the data contents.
		(print_insn_riscv): Handle the mapping symbols.
		(riscv_symbol_is_valid): Marked mapping symbols as invalid.

2021-08-30  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Improve argument syntax of proc arange
	The current syntax of proc arange is:
	...
	  proc arange { arange_start arange_length {comment ""} {seg_sel ""} } {
	...
	and a typical call looks like:
	...
	  arange $start $len
	...

	This style is somewhat annoying because if you want to specify the last
	parameter, you need to give the default values of all the other optional ones
	before as well:
	...
	  arange $start $len "" $seg_sel
	...

	Update the syntax to:
	...
	    proc arange { options arange_start arange_length } {
	       parse_options {
	           { comment "" }
	           { seg_sel "" }
	       }
	...
	such that a typical call looks like:
	...
	  arange {} $start $len
	...
	and a call using seg_sel looks like:
	...
	  arange {
	    seg_sel $seg_sel
	  } $start $len
	...

	Also update proc aranges, which already has an options argument, to use the
	new proc parse_options.

	Tested on x86_64-linux.

	Co-Authored-By: Simon Marchi <simon.marchi@polymtl.ca>

2021-08-30  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-29  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-28  H.J. Lu  <hjl.tools@gmail.com>

	ld: Change indirect symbol from IR to undefined
	bfd/

		PR ld/28264
		* elflink.c (_bfd_elf_merge_symbol): Change indirect symbol from
		IR to undefined.

	ld/

		PR ld/28264
		* testsuite/ld-plugin/lto.exp: Run PR ld/28264 test.
		* testsuite/ld-plugin/pr28264-1.d: New file.
		* testsuite/ld-plugin/pr28264-2.d: Likewise.
		* testsuite/ld-plugin/pr28264-3.d: Likewise.
		* testsuite/ld-plugin/pr28264-4.d: Likewise.
		* testsuite/ld-plugin/pr28264.c: Likewise.
		* testsuite/ld-plugin/pr28264.ver: Likewise.

2021-08-28  Alan Modra  <amodra@gmail.com>

	PR28264, ld.bfd crash on linking efivar with LTO
		PR 28264
		PR 26978
		* linker.c (_bfd_generic_link_add_one_symbol <MIND>): Check
		that string is non-NULL.

2021-08-28  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-27  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Don't write .gdb_index symbol table with empty entries
	When comparing the sizes of the index files generated for shlib
	outputs/gdb.dwarf2/dw2-zero-range/shr1.sl, I noticed a large difference
	between .debug_names:
	...
	$ gdb -q -batch $shlib -ex "save gdb-index -dwarf-5 ."
	$ du -b -h shr1.sl.debug_names shr1.sl.debug_str
	61      shr1.sl.debug_names
	0       shr1.sl.debug_str
	...
	and .gdb_index:
	...
	$ gdb -q -batch $shlib -ex "save gdb-index ."
	$ du -b -h shr1.sl.gdb-index
	8.2K    shr1.sl.gdb-index
	...

	The problem is that the .gdb_index contains a non-empty symbol table with only
	empty entries.

	Fix this by making the symbol table empty, such that we have instead:
	...
	$ du -b -h shr1.sl.gdb-index
	184     shr1.sl.gdb-index
	...

	Tested on x86_64-linux.

2021-08-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Generate .debug_aranges in gdb.dlang/watch-loc.exp
	Before commit 5ef670d81fd "[gdb/testsuite] Add dummy start and end CUs in
	dwarf assembly" we had in exec outputs/gdb.dlang/watch-loc/watch-loc a D
	compilation unit at offset 0xc7:
	...
	  Compilation Unit @ offset 0xc7:
	   Length:        0x4c (32-bit)
	   Version:       4
	   Abbrev Offset: 0x64
	   Pointer Size:  8
	 <0><d2>: Abbrev Number: 2 (DW_TAG_compile_unit)
	    <d3>   DW_AT_language    : 19       (D)
	...
	with a corresponding .debug_aranges entry:
	...
	Offset into .debug_info:  0xc7
	  Pointer Size:             4
	  Segment Size:             0

	    Address    Length
	    004004a7 0000000b
	    00000000 00000000
	...

	After that commit we have a dummy CU at offset 0xc7 and the D compilation unit
	at offset 0xd2:
	...
	  Compilation Unit @ offset 0xc7:
	   Length:        0x7 (32-bit)
	   Version:       4
	   Abbrev Offset: 0x64
	   Pointer Size:  8
	  Compilation Unit @ offset 0xd2:
	   Length:        0x4c (32-bit)
	   Version:       4
	   Abbrev Offset: 0x65
	   Pointer Size:  8
	 <0><dd>: Abbrev Number: 2 (DW_TAG_compile_unit)
	    <de>   DW_AT_language    : 19       (D)
	...
	while the .debug_aranges entry still points to 0xc7.

	The problem is that the test-case uses a hack (quoting from
	commit 75f06e9dc59):
	...
	[ Note: this is a non-trivial test-case.  The file watch-loc-dw.S contains a
	.debug_info section, but not an .debug_aranges section or any actual code.
	The file watch-loc.c contains code and a .debug_aranges section, but no other
	debug section.  So, the intent for the .debug_aranges section in watch-loc.c
	is to refer to a compilation unit in the .debug_info section in
	watch-loc-dw.S. ]
	...
	and adding the dummy CU caused that hack to stop working.

	Fix this by moving the generation of .debug_aranges from watch-loc.c to
	watch-loc.exp, such that we have:
	...
	  Offset into .debug_info:  0xd2
	  Pointer Size:             4
	  Segment Size:             0

	    Address    Length
	    004004a7 0000000b
	    00000000 00000000
	...

	Tested on x86_64-linux.

2021-08-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Generate .debug_aranges entry for dummy CU
	A best practise for DWARF [1] is to generate .debug_aranges entries for CUs
	even if they have no address range.

	Generate .debug_arange entries for the dummy CUs added by the DWARF assembler.

	Tested on x86_64-linux.

	[1] http://wiki.dwarfstd.org/index.php?title=Best_Practices

2021-08-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add .debug_aranges in more test-cases
	A couple of test-cases fail when run with target board cc-with-debug-names due
	to missing .debug_aranges entries for the CUs added by the dwarf assembler.

	Add a .debug_aranges entry for those CUs.

	Tested on x86_64-linux.

2021-08-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Support .debug_aranges in dwarf assembly
	Add a proc aranges such that we can generate .debug_aranges sections in dwarf
	assembly using:
	...
	  cu { label cu_label } {
	  ...
	  }

	  aranges {} cu_label {
	    arange $addr $len [<comment>] [$segment_selector]
	  }
	...

	Tested on x86_64-linux.

2021-08-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add label option to proc cu
	We can use current dwarf assembly infrastructure to declare a label that marks
	the start of the CU header:
	...
	  declare_labels header_start_cu_a
	  _section ".debug_info"
	  header_start_cu_a : cu {} {
	  }
	  _section ".debug_info"
	  header_start_cu_b : cu {} {
	  }
	...
	on the condition that we switch to the .debug_info section before, which makes
	this style of use fragile.

	Another way to achieve the same is to use the label as generated by the cu
	proc itself:
	...
	  variable _cu_label
	  cu {} {
	  }
	  set header_start_cu_a $_cu_label
	  cu {} {
	  }
	  set header_start_cu_b $_cu_label
	...
	but again that seems fragile given that adding a new CU inbetween will
	silently result in the wrong value for the label.

	Add a label option to proc cu such that we can simply do:
	...
	  cu { label header_start_cu_a } {
	  }
	  cu { label header_start_cu_b } {
	  }
	...

	Tested on x86_64-linux.

2021-08-27  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-26  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: remove some stray newlines in debug output
	I spotted a couple of stray newlines that were left at the end of
	debug message during conversion to the new debug output scheme.  These
	messages are part of the 'set debug lin-lwp 1' output.

2021-08-26  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-25  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-24  Tom Tromey  <tom@tromey.com>

	Fix two regressions caused by CU / TU merging
	PR symtab/28160 and PR symtab/27893 concern GDB crashes in the test
	suite when using the "fission" target board.  They are both caused by
	the patches that merge the list of CUs with the list of TUs (and to a
	lesser degree by the patches to share DWARF data across objfiles), and
	the underlying issue is the same: it turns out that reading a DWO can
	cause new type units to be created.  This means that the list of
	dwarf2_per_cu_data objects depends on precisely which CUs have been
	expanded.  However, because the type units can be created while
	expanding a CU means that the vector of CUs can expand while it is
	being iterated over -- a classic mistake.  Also, because a TU can be
	added later, it means the resize_symtabs approach is incorrect.

	This patch fixes resize_symtabs by removing it, and having set_symtab
	resize the vector on demand.  It fixes the iteration problem by
	introducing a safe (index-based) iterator and changing the relevant
	spots to use it.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28160
	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27893

2021-08-24  Alan Modra  <amodra@gmail.com>

	Real programmers don't configure gcc using --with-ld
		* testsuite/lib/ld-lib.exp (run_host_cmd): Give a clue as to why
		gcc -B doesn't pick up the ld under test.

2021-08-24  Alan Modra  <amodra@gmail.com>

	objdump -S test fail on mingw
	FAIL: objdump -S
	FAIL: objdump --source-comment
	is seen on mingw for the simple reason that gcc adds a .exe suffix on
	the output file if not already present.  Fix that, and tidy some objcopy
	tests.

		* testsuite/lib/binutils-common.exp (exeext): New proc.
		* testsuite/binutils-all/objcopy.exp (exe, test_prog): Use it here.
		(objcopy_remove_relocations_from_executable): Catch objcopy errors.
		Only run on ELF targets.
		* testsuite/binutils-all/objdump.exp (exe): Set variable.
		(test_build_id_debuglink, test_objdump_S): Use exe file suffix.

2021-08-24  James Bowman (FTDI-UK)  <james.bowman@ftdichip.com>

	FT32: Remove recursion in ft32_opcode
	The function ft32_opcode used recursion.  This could cause a stack
	overflow.  Replaced with a pair of non-recursive functions.

		PR 28169
	        * ft32-dis.c: Formatting.
		(ft32_opcode1): Split out from..
		(ft32_opcode): ..here.

2021-08-24  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-23  Tom Tromey  <tom@tromey.com>

	Fix a latent bug in dw2-ranges-overlap.exp
	dw2-ranges-overlap.exp creates a program where a psymtab has two
	address ranges, and a function without debug info whose address is
	between these two ranges.  Then it sets a breakpoint on this function
	and runs to it, expecting that the language should remain "auto; c"
	when stopped.

	However, this test case also has a "main" function described (briefly)
	in the DWARF, and this function is given language C++.  Also, a
	breakpoint stop sets the current language to the language that was
	used when setting the breakpoint.

	My new DWARF scanner decides that this "main" is the main program and
	sets the current language to C++ at startup, causing this test to
	fail.

	This patch fixes the test in a simple way, by introducing a new
	function that takes the place of "main" in the DWARF.  I think this
	still exercises the original problem, but also avoids problems with my
	branch.

	It seemed safe to me to submit this separately.

2021-08-23  Tom de Vries  <tdevries@suse.de>

	[gdb] Fix 'not in executable format' error message
	With trying to load a non-executable file into gdb, we run into PR26880:
	...
	$ gdb -q -batch test.c
	"0x7ffc87bfc8d0s": not in executable format: \
	  file format not recognized
	...

	The problem is caused by using %ps in combination with the error function
	(note that confusingly, it does work in combination with the warning
	function).

	Fix this by using plain "%s" instead.

	Tested on x86_64-linux.

	gdb/ChangeLog:

	2021-08-22  Tom de Vries  <tdevries@suse.de>

		PR gdb/26880
		* gdb/exec.c (exec_file_attach): Use %s instead of %ps in call to
		error function.

	gdb/testsuite/ChangeLog:

	2021-08-22  Tom de Vries  <tdevries@suse.de>

		PR gdb/26880
		* gdb.base/non-executable.exp: New file.

2021-08-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Use compiler-generated instead of gas-generated stabs
	The test-case gdb.dwarf2/dw2-ranges.exp is the only one in the gdb testsuite
	that uses gas-generated stabs.

	While the use seems natural alongside the use of gas-generated dwarf in the
	same test-case, there are a few known issues, filed on the gdb side as:
	- PR symtab/12497 - "stabs: PIE relocation does not work"
	- PR symtab/28221 - "[readnow, stabs] FAIL: gdb.dwarf2/dw2-ranges.exp: \
	  info line func"
	and on the gas side as:
	- PR gas/28233 - "[gas, --gstabs] Generate stabs more similar to gcc"

	The test-case contains a KFAIL for PR12497, but it's outdated and fails to
	trigger.

	The intention of the test-case is to test gas-generated dwarf, and using
	gcc-generated stabs instead of gas-generated stabs works fine.

	Supporting compiler-generated stabs is already a corner-case for gdb, and
	there's no current commitment/incentive to support/workaround gas-generated
	stabs, which can be considered a corner-case of a corner-case.

	Work around these problem by using compiler-generated stabs in the test-case.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-22  Tom de Vries  <tdevries@suse.de>

		* gdb.dwarf2/dw2-ranges.exp: Use compiler-generated stabs.

2021-08-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add dummy start and end CUs in dwarf assembly
	Say one compiles a hello.c:
	...
	$ gcc -g hello.c
	...

	On openSUSE Leap 15.2 and Tumbleweed, the CU for hello.c is typically not the
	first in .debug_info, nor the last, due to presence of debug information in
	objects for sources like:
	- ../sysdeps/x86_64/start.S
	- init.c
	- ../sysdeps/x86_64/crti.S
	- elf-init.c
	- ../sysdeps/x86_64/crtn.S.

	On other systems, say ubuntu 18.04.5, the CU for hello.c is typically the
	first and the last in .debug_info.

	This difference has caused me to find some errors in the dwarf assembly
	using openSUSE, that didn't show up on other platforms.

	Force the same situation on other platforms by adding a dummy start
	and end CU.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-22  Tom de Vries  <tdevries@suse.de>

		PR testsuite/28235
		* lib/dwarf.exp (Dwarf::dummy_cu): New proc.
		(Dwarf::assemble): Add dummy start and end CU.

2021-08-23  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix dw2-ranges-psym.exp with -readnow
	When running test-case gdb.dwarf2/dw2-ranges-psym.exp with target board
	-readnow, I run into:
	...
	(gdb) file dw2-ranges-psym^M
	Reading symbols from dw2-ranges-psym...^M
	Expanding full symbols from dw2-ranges-psym...^M
	(gdb) set complaints 0^M
	(gdb) FAIL: gdb.dwarf2/dw2-ranges-psym.exp: No complaints
	...

	The problem is that the regexp expects a gdb prompt immediately after the
	"Reading symbols" line.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-22  Tom de Vries  <tdevries@suse.de>

		* lib/gdb.exp (gdb_load_no_complaints): Update regexp to allow
		"Expanding full symbols" Line.

2021-08-23  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-22  Mike Frysinger  <vapier@gentoo.org>

	sim: m32r: add __linux__ hack for non-Linux hosts
	The m32r Linux syscall emulation logic assumes the host environment
	directly matches -- it's being run on 32-bit little endian Linux.
	This breaks building for non-Linux systems, so put all the code in
	__linux__ ifdef checks.  This code needs a lot of love to make it
	work everywhere, but let's at least unbreak it for non-Linux hosts.

2021-08-22  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-21  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-20  Mike Frysinger  <vapier@gentoo.org>

	sim: nltvals: switch output mode to a directory
	In preparation for this script generating more files, change the output
	argument to specify a directory.  This drops the stdout behavior, but
	since no one really runs this tool directly, it's not a big deal.

2021-08-20  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-19  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: use bool in notify_command_param_changed_p and do_set_command
	Trivial patch to use bool instead of int.

	Change-Id: I9e5f8ee4305272a6671cbaaaf2f0484eff0d1ea5

2021-08-19  H.J. Lu  <hjl.tools@gmail.com>

	x86: Put back 3 aborts in OP_E_memory
	Put back 3 aborts where invalid lengths should have been filtered out.

	gas/

		PR binutils/28247
		* testsuite/gas/i386/bad-bcast.s: Add a comment.

	opcodes/

		PR binutils/28247
		* * i386-dis.c (OP_E_memory): Put back 3 aborts.

2021-08-19  H.J. Lu  <hjl.tools@gmail.com>

	x86: Avoid abort on invalid broadcast
	Print "{bad}" on invalid broadcast instead of abort.

	gas/

		PR binutils/28247
		* testsuite/gas/i386/bad-bcast.d: New file.
		* testsuite/gas/i386/bad-bcast.s: Likewise.
		* testsuite/gas/i386/i386.exp: Run bad-bcast.

	opcodes/

		PR binutils/28247
		* i386-dis.c (OP_E_memory): Print "{bad}" on invalid broadcast
		instead of abort.

2021-08-19  Aaron Merey  <amerey@redhat.com>

	gdb/solib: Refactor scan_dyntag
	scan_dyntag is unnecessarily duplicated in solib-svr4.c and solib-dsbt.c.

	Move this function to solib.c and rename it to gdb_bfd_scan_elf_dyntag.
	Also add it to solib.h so it is included in both solib-svr4 and solib-dsbt.

2021-08-19  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-18  Will Schmidt  <will_schmidt@vnet.ibm.com>

	[gdb] [rs6000] Add ppc64_linux_gcc_target_options method.
	Add a method to set the gcc target options for the ppc64 targets.
	This change sets an empty value, which allows the gcc
	default values (-mcmodel=medium) be used, instead of -mcmodel=large
	which is set by the default_gcc_target_options hook.

	[gdb] [rs6000] Add ppc64*_gnu_triplet_regexp methods.
	Add methods to set the target triplet so we can
	find the proper gcc when our gcc is named of
	the form powerpc64{le}-<foo>-gcc or ppc64{le}-<foo>-gcc.

2021-08-18  Alan Modra  <amodra@gmail.com>

	Re: as: Replace the removed symbol with the versioned symbol
	Some targets, typically embedded without shared libraries, replace the
	relocation symbol with a section symbol (see tc_fix_adjustable).
	Allow the test to pass for such targets.  Fixes the following.

	avr-elf  +FAIL: symver symver16
	d10v-elf  +FAIL: symver symver16
	dlx-elf  +FAIL: symver symver16
	ip2k-elf  +FAIL: symver symver16
	m68k-elf  +FAIL: symver symver16
	mcore-elf  +FAIL: symver symver16
	pj-elf  +FAIL: symver symver16
	s12z-elf  +FAIL: symver symver16
	visium-elf  +FAIL: symver symver16
	z80-elf  +FAIL: symver symver16

		PR gas/28157
		* testsuite/gas/symver/symver16.d: Relax reloc match.

2021-08-18  Alan Modra  <amodra@gmail.com>

	[GOLD] PowerPC64 relocation overflow for -Os register save/restore funcs
	Fixes a silly mistake in calculating the address of -Os out-of-line
	register save/restore function copies.  Copies of these linker defined
	functions are added to stub sections when the original (in
	target->savres_section) can't be reached.

		* powerpc.cc (Target_powerpc::Relocate::relocate): Correct address
		calculation of out-of-line save/restore function copies.

2021-08-18  Alan Modra  <amodra@gmail.com>

	Another ld script backtrack
		* ldgram.y (length_spec): Throw away look-ahead NAME.

2021-08-18  Mike Frysinger  <vapier@gentoo.org>

	gdb: fix spacing on CCLD silent rules

	sim: nltvals: localize TARGET_<ERRNO> defines
	Code should not be using these directly, instead they should be
	resolving these dynamically via cb_host_to_target_errno maps.
	Fix the Blackfin code and remove the defines out of the header
	so no new code can rely on them.

2021-08-18  Mike Frysinger  <vapier@gentoo.org>

	sim: rename ChangeLog files to ChangeLog-2021
	Now that ChangeLog entries are no longer used for sim patches,
	this commit renames all relevant sim ChangeLog to ChangeLog-2021,
	similar to what we would do in the context of the "Start of New
	Year" procedure.

	The purpose of this change is to avoid people merging ChangeLog
	entries by mistake when applying existing commits that they are
	currently working on.

	Also throw in a .gitignore entry to keep people from adding new
	ChangeLog files anywhere in the sim tree.

2021-08-18  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-17  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix thread_step_over_chain_length
	If I debug a single-thread program and look at the infrun debug logs, I
	see:

	    [infrun] start_step_over: stealing global queue of threads to step, length = 2

	That makes no sense... turns out there's a buglet in
	thread_step_over_chain_length, "num" should be initialized to 0.  I
	think this bug is a leftover from an earlier version of the code (not
	merged upstream) that manually walked the list, where the first item was
	implicitly counted (hence the 1).

	Change-Id: I0af03aa93509aed36528be5076894dc156a0b5ce

2021-08-17  Shahab Vahedi  <shahab@synopsys.com>

	opcodes: Fix the auxiliary register numbers for ARC HS
	The numbers for the auxiliary registers "tlbindex" and
	"tlbcommand" of ARCv2HS are incorrect.  This patch makes
	the following changes to correct that error.

	 ,------------.-----------------.---------------.
	 | aux. reg.  | old (incorrect) | new (correct) |
	 |------------+-----------------+---------------|
	 | tlbindex   |      0x463      |     0x464     |
	 | tlbcommand |      0x464      |     0x465     |
	 `------------^-----------------^---------------'

	opcodes/
	2021-08-17  Shahab Vahedi <shahab@synopsys.com>

		* arc-regs.h (DEF): Fix the register numbers.

2021-08-17  H.J. Lu  <hjl.tools@gmail.com>

	gdb: Don't assume r_ldsomap when r_version > 1 on Linux
	The r_ldsomap field is specific to Solaris (part of librtld_db), and
	should never be accessed for Linux.  glibc is planning to add a field
	to support multiple namespaces.  But there will be no r_ldsomap when
	r_version is bumped to 2.  Add linux_[ilp32|lp64]_fetch_link_map_offsets
	to set r_ldsomap_offset to -1 and use them for Linux targets.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28236

2021-08-17  H.J. Lu  <hjl.tools@gmail.com>

	gdbserver: Check r_version < 1 for Linux debugger interface
	Update gdbserver to check r_version < 1 instead of r_version != 1 so
	that r_version can be bumped for a new field in the glibc debugger
	interface to support multiple namespaces.  Since so far, the gdbserver
	only reads fields defined for r_version == 1, it is compatible with
	r_version >= 1.

	All future glibc debugger interface changes will be backward compatible.
	If there is ever the need for backward incompatible change to the glibc
	debugger interface, a new DT_XXX element will be provided to access the
	new incompatible interface.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=11839

2021-08-17  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [4/4] arm: Add Tag_PACRET_use build attribute
	bfd/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf32-arm.c (elf32_arm_merge_eabi_attributes): Add
		'Tag_PACRET_use' case.

	binutils/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* readelf.c (arm_attr_tag_PAC_extension): Declare.
		(arm_attr_public_tags): Add 'PAC_extension' lookup.

	elfcpp/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* arm.h: Define 'Tag_PACRET_use' enum.

	gas/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (arm_convert_symbolic_attribute): Add
		'Tag_PACRET_use' to the attribute_table.

	include/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf/arm.h (elf_arm_reloc_type): Add 'Tag_PACRET_use'.

2021-08-17  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [3/4] arm: Add Tag_BTI_use build attribute
	bfd/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf32-arm.c (elf32_arm_merge_eabi_attributes): Add
		'Tag_BTI_use' case.

	binutils/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* readelf.c (arm_attr_tag_PAC_extension): Declare.
		(arm_attr_public_tags): Add 'PAC_extension' lookup.

	elfcpp/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* arm.h: Define 'Tag_BTI_use' enum.

	gas/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (arm_convert_symbolic_attribute): Add
		'Tag_BTI_use' to the attribute_table.

	include/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf/arm.h (elf_arm_reloc_type): Add 'Tag_BTI_use'.

2021-08-17  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [2/4] arm: Add Tag_BTI_extension build attribute
	bfd/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf32-arm.c (elf32_arm_merge_eabi_attributes): Add
		'Tag_BTI_extension' case.

	binutils/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* readelf.c (arm_attr_tag_PAC_extension): Declare.
		(arm_attr_public_tags): Add 'PAC_extension' lookup.

	elfcpp/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* arm.h: Define 'Tag_BTI_extension' enum.

	gas/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (arm_convert_symbolic_attribute): Add
		'Tag_BTI_extension' to the attribute_table.

	include/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf/arm.h (elf_arm_reloc_type): Add 'Tag_BTI_extension'.

2021-08-17  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [1/4] arm: Add Tag_PAC_extension build attribute
	bfd/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf32-arm.c (elf32_arm_merge_eabi_attributes): Add
		'Tag_PAC_extension' case.

	binutils/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* readelf.c (arm_attr_tag_PAC_extension): Declare.
		(arm_attr_public_tags): Add 'PAC_extension' lookup.

	elfcpp/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* arm.h: Define 'Tag_PAC_extension' enum.

	gas/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (arm_convert_symbolic_attribute): Add
		'Tag_PAC_extension' to the attribute_table.

	include/
	2021-07-06  Andrea Corallo  <andrea.corallo@arm.com>

		* elf/arm.h (elf_arm_reloc_type): Add 'Tag_PAC_extension'.

2021-08-17  H.J. Lu  <hjl.tools@gmail.com>

	x86: Always run fp tests
	Always run fp tests since the size of .tfloat, .ds.x, .dc.x and .dcb.x
	directive outputs is always 10 bytes.  There is no need for fp-elf32 nor
	fp-elf64.

		PR gas/28230
		* testsuite/gas/i386/fp-elf32.d: Removed.
		* testsuite/gas/i386/fp-elf64.d: Likewise.
		* testsuite/gas/i386/fp.s: Remove NO_TFLOAT_PADDING codes.
		* testsuite/gas/i386/i386.exp: Don't run fp-elf32 nor fp-elf64.
		Always run fp.

2021-08-17  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-16  H.J. Lu  <hjl.tools@gmail.com>

	x86: Don't pad .tfloat directive output
	.tfloat output should always be 10 bytes without padding, independent
	of psABIs.  In glibc, x86 assembly codes expect 10-byte .tfloat output.
	This also reduces .ds.x output and .tfloat output with hex input from
	12 bytes to 10 bytes to match .tfloat output.

		PR gas/28230
		* NEWS: Mention changes of .ds.x output and .tfloat output with
		hex input.
		* config/tc-i386.c (x86_tfloat_pad): Removed.
		* config/tc-i386.h (X_PRECISION_PAD): Changed to 0.
		(x86_tfloat_pad): Removed.
		* testsuite/gas/i386/fp.s: If NO_TFLOAT_PADDING isn't defined,
		add explicit paddings after .tfloat, .ds.x, .dc.x and .dcb.x
		directives.
		* testsuite/gas/i386/i386.exp (ASFLAGS): Append
		"--defsym NO_TFLOAT_PADDING=1" when running the fp test.

2021-08-16  Tom Tromey  <tromey@adacore.com>

	Fix register regression in DWARF evaluator
	On an internal test case, using an arm-elf target, commit ba5bc3e5a92
	("Make DWARF evaluator return a single struct value") causes a
	regression.  (It doesn't happen for any of the other cross targets
	that I test when importing upstream gdb.)

	I don't know if there's an upstream gdb test case showing the same
	problem... I can only really run native tests with dejagnu AFAIK.

	The failure manifests like this:

	    Breakpoint 1, file_1.export_1 (param_1=<error reading variable: Unable to access DWARF register number 64>, str=...) at [...]/file_1.adb:5

	Whereas when it works it looks like:

	    Breakpoint 1, file_1.export_1 (param_1=99.0, str=...) at [...]/file_1.adb:5

	The difference is that the new code uses the passed-in gdbarch,
	whereas the old code used the frame's gdbarch, when handling
	DWARF_VALUE_REGISTER.

	This patch restores the use of the frame's arch.

2021-08-16  Tom Tromey  <tromey@adacore.com>

	Fix Ada regression due to DWARF expression series
	Commit 0579205aec4 ("Simplify dwarf_expr_context class interface")
	caused a regression in the internal AdaCore test suite.  I didn't try
	to reproduce this with the GDB test suite, but the test is identical
	to gdb.dwarf2/dynarr-ptr.exp.

	The problem is that this change:

	 	case DW_OP_push_object_address:
	 	  /* Return the address of the object we are currently observing.  */
	-	  if (this->data_view.data () == nullptr
	-	      && this->obj_address == 0)
	+	  if (this->m_addr_info == nullptr)

	... slightly changes the logic here.  In particular, it's possible for
	the caller to pass in a non-NULL m_addr_info, but one that looks like:

	    (top) p *this.m_addr_info
	    $15 = {
	      type = 0x29b7a70,
	      valaddr = {
		m_array = 0x0,
		m_size = 0
	      },
	      addr = 0,
	      next = 0x0
	    }

	In this case, an additional check is needed.  With the current code,
	what happens instead is that the computation computes an incorrect
	address -- but one that does not fail in read_memory, due to the
	precise memory map of the embedded target in question.

	This patch restores the old logic.

2021-08-16  Patrick Monnerat  <patrick@monnerat.net>

	Notify observer of breakpoint auto-disabling
	As breakpoint_modified observer is currently notified upon breakpoint stop
	before handling auto-disabling when enable count is reached, the observer
	is never notified of the disabling.

	The problem affects:
	- The MI interpreter enabled= value when reporting =breakpoint-modified
	- A Python event handler for breakpoint_modified using the "enabled"
	  member of its parameter
	- insight: breakpoint GUI window is not properly updated upon auto-disable

	This patch moves the observer notification after the auto-disabling
	code and implements corresponding tests for the MI and Python cases.

	Fixes https://sourceware.org/bugzilla/show_bug.cgi?id=23336

	Change-Id: I0c50df4789334071e5390cb46b3ca0d4a7f83c61

2021-08-16  H.J. Lu  <hjl.tools@gmail.com>

	as: Replace the removed symbol with the versioned symbol
	When a symbol removed by .symver is used in relocation and there is one
	and only one versioned symbol, don't remove the symbol.  Instead, mark
	it to be removed and replace the removed symbol used in relocation with
	the versioned symbol before generating relocation.

		PR gas/28157
		* symbols.c (symbol_flags): Add removed.
		(symbol_entry_find): Updated.
		(symbol_mark_removed): New function.
		(symbol_removed_p): Likewise.
		* symbols.h (symbol_mark_removed): New prototype.
		(symbol_removed_p): Likewise.
		* write.c (write_relocs): Call obj_fixup_removed_symbol on
		removed fixp->fx_addsy and fixp->fx_subsy if defined.
		(set_symtab): Don't add a symbol if symbol_removed_p returns true.
		* config/obj-elf.c (elf_frob_symbol):  Don't remove the symbol
		if it is used on relocation.  Instead, mark it as to be removed
		and issue an error if the symbol has more than one versioned name.
		(elf_fixup_removed_symbol): New function.
		* config/obj-elf.h (elf_fixup_removed_symbol): New prototype.
		(obj_fixup_removed_symbol): New.
		* testsuite/gas/symver/symver11.d: Updated expected error
		message.
		* testsuite/gas/symver/symver16.d: New file.
		* testsuite/gas/symver/symver16.s: Likewise.

2021-08-16  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-15  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-14  Alan Modra  <amodra@gmail.com>

	ld script fill pattern expression
	It turns out we do need to backtrack when parsing after all.  The
	fill_opt component in the section rule swiches to EXPRESSION and back
	to SCRIPT, and to find the end of an expression it is necessary to
	look ahead one token.

		* ldgram.y (section): Throw away lookahead NAME token.
		(overlay_section): Likewise.
		* testsuite/ld-elf/overlay.t: Add fill pattern on overlays.
		Test fill pattern before stupidly named normal sections too,
		and before /DISCARD/.

2021-08-14  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-13  Alan Modra  <amodra@gmail.com>

	ld lexer tidy, possibly break the world
	This tidies the states in which ld lexer rules are enabled.
	This change will quite likely trip over issues similar to those
	mentioned in the new ldlex.l comments, so please test it out.

		* ldgram.y (wildcard_name): Remove now unnecessary components.
		* ldlex.l: Restrict many rules' states.  Remove -l expression
		state rule.  Comment on lookahead state madness and need for
		/DISCARD/ in expression state.

2021-08-13  Alan Modra  <amodra@gmail.com>

	ld script lower-case absolute and sizeof_headers
	I think these happened by accident, so let's see what breaks if they
	are removed.

		* ldlex.l: Remove lower case "absolute" and "sizeof_headers"
		in non-mri mode.
		* ld.texi: Remove sizeof_headers index.
		* testsuite/ld-mmix/mmohdr1.ld: Use SIZEOF_HEADERS.

2021-08-13  Alan Modra  <amodra@gmail.com>

	tidy mri script extern
	MRI mode generally doesn't flip lexer states, so let's make MRI mode
	"extern" not do so either.

		* ldgram.y (extern_name_list): Don't change lex state here.
		(ifile_p1): Change state here on EXTERN instead.

2021-08-13  Alan Modra  <amodra@gmail.com>

	Re: PR28217, Syntax error when memory region contains a hyphen
	I discovered some more errors when tightening up the lexer rules.
	Just because we INCLUDE a file doesn't mean we've switched states.

		PR 28217
		* ldgram.y (statement): Don't switch lexer state on INCLUDE.
		(mri_script_command, ifile_p1, memory_spec, section): Likewise.

2021-08-13  Lifang Xia  <lifang_xia@c-sky.com>

	PR28168: [CSKY] Fix stack overflow in disassembler
	PR 28168:
	Stack overflow with a large float. %f is not a goot choice for this.
	%f should be replaced with %.7g.

	gas/
		* testsuite/gas/csky/pr28168.d: New testcase for PR 28168.
		* testsuite/gas/csky/pr28168.s: Likewise.
		* testsuite/gas/csky/v2_float_part2.d: Following the new format.
		* opcodes/csky-dis.c (csky_output_operand): %.7g replaces %f.

2021-08-13  Alan Modra  <amodra@gmail.com>

	PR28217, Syntax error when memory region contains a hyphen
	The saga of commit 40726f16a8d7 continues.  This attacks the problem
	of switching between SCRIPT and EXPRESSION state lexing by removing
	the need to do so for phdrs like ":text".  Instead {WILDCHAR}*
	matching, the reason why ":text" lexed as one token, is restricted to
	within the braces of a section or overlay statement.  The new WILD
	lexer state is switched at the non-optional brace tokens, so
	ldlex_backup is no longer needed.  I've also removed the BOTH state,
	which doesn't seem to be needed any more.  Besides rules involving
	error reporting, there was just one place where SCRIPT appeared
	without BOTH, the {WILDCHAR}* rule, three where BOTH appears without
	SCRIPT for tokens that only need EXPRESSION state, and two where BOTH
	appears alongside INPUT_LIST.  (Since I'm editing the wild and
	filename rules, removing BOTH and adding WILD can also be seen as
	renaming the old BOTH state to SCRIPT and renaming the old SCRIPT
	state to WILD with a reduced scope.)

	As a followup, I'll look at removing EXPRESSION state from some lexer
	rules that no longer need it due to this cleanup.

		PR 28217
		* ldgram.y (exp <ORIGIN, LENGTH>): Use paren_script_name.
		(section): Parse within braces of section in wild mode, and
		after brace back in script mode.  Remove ldlex_backup call.
		Similarly for OVERLAY.
		(overlay_section): Similarly.
		(script_file): Replace ldlex_both with ldlex_script.
		* ldlex.h (ldlex_wild): Declare.
		(ldlex_both): Delete.
		* ldlex.l (BOTH): Delete.  Remove state from all rules.
		(WILD): New state.  Enable many tokens in this state.
		Enable filename match in SCRIPT mode.  Enable WILDCHAR match
		in WILD state, disable in SCRIPT mode.
		(ldlex_wild): New function.
		* ldfile.c (ldfile_try_open_bfd): Replace ldlex_both call with
		ldlex_script.

2021-08-13  Alan Modra  <amodra@gmail.com>

	ns32k configury
	Since ns32k-netbsd is as yet not removed, just marked obsolete,
	the target should still be accepted with --enable-obsolete.

	I also enabled ns32k-openbsd in ld since there doesn't seem to be a
	good reason why that target is not supported there but is elsewhere.

	bfd/
		* config.bfd: Allow ns32k-netbsd.
	ld/
		* configure.tgt: Allow ns32k-openbsd.

2021-08-13  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-13  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: riscv_scan_prologue: handle LD and LW instructions
	While working on the testsuite, I ended up noticing that GDB fails to
	produce a full backtrace from a thread waiting in pthread_join.  When
	selecting the waiting thread and using the 'bt' command, the following
	result can be observed:

		(gdb) bt
		#0  0x0000003ff7fccd20 in __futex_abstimed_wait_common64 () from /lib/riscv64-linux-gnu/libpthread.so.0
		#1  0x0000003ff7fc43da in __pthread_clockjoin_ex () from /lib/riscv64-linux-gnu/libpthread.so.0
		Backtrace stopped: frame did not save the PC

	On my platform, I do not have debug symbols for glibc, so I need to rely
	on prologue analysis in order to unwind stack.

	Here is what the function prologue looks like:

		(gdb) disassemble __pthread_clockjoin_ex
		Dump of assembler code for function __pthread_clockjoin_ex:
		   0x0000003ff7fc42de <+0>:     addi    sp,sp,-144
		   0x0000003ff7fc42e0 <+2>:     sd      s5,88(sp)
		   0x0000003ff7fc42e2 <+4>:     auipc   s5,0xd
		   0x0000003ff7fc42e6 <+8>:     ld      s5,-2(s5) # 0x3ff7fd12e0
		   0x0000003ff7fc42ea <+12>:    ld      a5,0(s5)
		   0x0000003ff7fc42ee <+16>:    sd      ra,136(sp)
		   0x0000003ff7fc42f0 <+18>:    sd      s0,128(sp)
		   0x0000003ff7fc42f2 <+20>:    sd      s1,120(sp)
		   0x0000003ff7fc42f4 <+22>:    sd      s2,112(sp)
		   0x0000003ff7fc42f6 <+24>:    sd      s3,104(sp)
		   0x0000003ff7fc42f8 <+26>:    sd      s4,96(sp)
		   0x0000003ff7fc42fa <+28>:    sd      s6,80(sp)
		   0x0000003ff7fc42fc <+30>:    sd      s7,72(sp)
		   0x0000003ff7fc42fe <+32>:    sd      s8,64(sp)
		   0x0000003ff7fc4300 <+34>:    sd      s9,56(sp)
		   0x0000003ff7fc4302 <+36>:    sd      a5,40(sp)

	As far as prologue analysis is concerned, the most interesting part is
	done at address 0x0000003ff7fc42ee (<+16>): 'sd ra,136(sp)'. This stores
	the RA (return address) register on the stack, which is the information
	we are looking for in order to identify the caller.

	In the current implementation of the prologue scanner, GDB stops when
	hitting 0x0000003ff7fc42e6 (<+8>) because it does not know what to do
	with the 'ld' instruction.  GDB thinks it reached the end of the
	prologue but have not yet reached the important part, which explain
	GDB's inability to unwind past this point.

	The section of the prologue starting at <+4> until <+12> is used to load
	the stack canary[1], which will then be placed on the stack at <+36> at
	the end of the prologue.

	In order to have the prologue properly handled, this commit proposes to
	add support for the ld instruction in the RISC-V prologue scanner.
	I guess riscv32 would use lw in such situation so this patch also adds
	support for this instruction.

	With this patch applied, gdb is now able to unwind past pthread_join:

		(gdb) bt
		#0  0x0000003ff7fccd20 in __futex_abstimed_wait_common64 () from /lib/riscv64-linux-gnu/libpthread.so.0
		#1  0x0000003ff7fc43da in __pthread_clockjoin_ex () from /lib/riscv64-linux-gnu/libpthread.so.0
		#2  0x0000002aaaaaa88e in bar() ()
		#3  0x0000002aaaaaa8c4 in foo() ()
		#4  0x0000002aaaaaa8da in main ()

	I have had a look to see if I could reproduce this easily, but in my
	simple testcases using '-fstack-protector-all', the canary is loaded
	after the RA register is saved.  I do not have a reliable way of
	generating a prologue similar to the problematic one so I forged one
	instead.

	The testsuite have been run on riscv64 ubuntu 21.01 with no regression
	observed.

	[1] https://en.wikipedia.org/wiki/Buffer_overflow_protection#Canaries

2021-08-12  Tom Tromey  <tromey@adacore.com>

	Update documentation to mention Pygments
	Philippe Blain pointed out that the gdb documentation does not mention
	that Pygments may be used for source highlighting.  This patch updates
	the docs to reflect how highlighting is actually done.

2021-08-12  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make gdbarch_printable_names return a vector
	I noticed that gdbarch_selftest::operator() leaked the value returned by
	gdbarch_printable_names.  Make gdbarch_printable_names return an
	std::vector and update callers.  That makes it easier for everyone
	involved, less manual memory management.

	Change-Id: Ia8fc028bdb91f787410cca34f10bf3c5a6da1498

2021-08-12  Carl Love  <cel@us.ibm.com>

	Improve forward progress test in python.exp
	The test steps into func2 and than does an up to get back to the previous
	frame. The test checks that the line number you are at after the up command
	is greater than the line where the function was called from. The
	assembly/codegen for the powerpc target includes a NOP after the
	branch-link.

	func2 (); /* Break at func2 call site. /
	10000694: 59 00 00 48 bl 100006ec
	10000698: 00 00 00 60 nop
	return 0; / Break to end. */
	1000069c: 00 00 20 39 li r9,0

	The PC at the instruction following the branch-link is 0x10000698 which
	GDB.find_pc_line() maps to the same line number as the bl instruction.
	GDB did move past the branch-link location thus making forward progress.

	The following proposed fix adds an additional PC check to see if forward
	progress was made.  The line test is changed from greater than to greater
	than or equal.

2021-08-12  Jiangshuai Li  <jiangshuai_li@c-sky.com>

	gdb:csky rm tdesc_has_registers in csky_register_name
	As CSKY arch has not parsed target-description.xml in csky_gdbarch_init,
	when a remote server, like csky-qemu or gdbserver, send a target-description.xml
	to gdb, tdesc_has_registers will return ture, but tdesc_register_name (gdbarch, 0)
	will return NULL, so a cmd "info registers r0" will not work.

	Function of parsing target-description.xml will be add later for CSKY arch,
	now it is temporarily removed to allow me to do other supported tests.

	2021-07-15 Jiangshuai Li  <jiangshuai_li@c-sky.com>

	            * csky-tdep.c : not using tdesc funtions in csky_register_name

2021-08-12  Alan Modra  <amodra@gmail.com>

	Re: gas: support NaN flavors
	Fixes tic4x-coff FAIL: simple FP constants

		* testsuite/gas/all/float.s: Make NaN tests conditional on hasnan.
		* testsuite/gas/all/gas.exp: Define hasnan.

2021-08-12  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-11  H.J. Lu  <hjl.tools@gmail.com>

	ld: Update the pass and fail strings of PR ld/28138 test
		PR ld/28138
		* testsuite/ld-plugin/lto.exp: Update the pass and fail strings
		of PR ld/28138 test to indicate which part of the test passed
		and failed.

2021-08-11  Darius Galis  <darius.galis@cyberthorstudios.com>

	Fix a typo in the RX asse,bler.  The Double-precision floating-point exception handling control register name is DECNT not DCENT.
		* config/rx-parse.y (DECNT): Fixed typo.
		* testsuite/gas/rx/dpopm.sm (DECNT): Fixed typo.
		* testsuite/gas/rx/dpushm.sm (DECNT): Fixed typo.
		* testsuite/gas/rx/macros.inc (DECNT): Fixed typo.

2021-08-11  Nick Clifton  <nickc@redhat.com>

	Fix an internal error in the CSKY assembler when asked to resolve an overlarge constant.
		PR 28215
		* config/tc-csky.c (md_apply_fix): Correctly handle a fixup that
		involves an overlarge constant.

2021-08-11  Luis Machado  <luis.machado@linaro.org>

	Add 3 new PAC-related ARM note types
	The following patch synchronizes includes/objdump/readelf with the Linux
	Kernel in terms of ARM regset notes.

	We're currently missing 3 of them:

	NT_ARM_PACA_KEYS
	NT_ARM_PACG_KEYS
	NT_ARM_PAC_ENABLED_KEYS

	We don't need GDB to bother with this at the moment, so this doesn't update
	bfd/elf.c. If needed, we can do it in the future.

	binutils/

		* readelf.c (get_note_type): Handle new ARM PAC notes.

	include/elf/

		* common.h (NT_ARM_PACA_KEYS, NT_ARM_PACG_KEYS)
		(NT_ARM_PAC_ENABLED_KEYS): New constants.

2021-08-11  Nick Clifton  <nickc@redhat.com>

	Updated Portuguese translation for the binutils sub-directory.

2021-08-11  John Ericson  <git@JohnEricson.me>

	Deprecate a.out support for NetBSD targets.
	As discussed previously, a.out support is now quite deprecated, and in
	some cases removed, in both Binutils itself and NetBSD, so this legacy
	default makes little sense. `netbsdelf*` and `netbsdaout*` still work
	allowing the user to be explicit about there choice. Additionally, the
	configure script warns about the change as Nick Clifton requested.

	One possible concern was the status of NetBSD on NS32K, where only a.out
	was supported. But per [1] NetBSD has removed support, and if it were to
	come back, it would be with ELF. The binutils implementation is
	therefore marked obsolete, per the instructions in the last message.

	With that patch and this one applied, I have confirmed the following:

	--target=i686-unknown-netbsd
	--target=i686-unknown-netbsdelf
	  builds completely

	--target=i686-unknown-netbsdaout
	  properly fails because target is deprecated.

	--target=vax-unknown-netbsdaout builds completely except for gas, where
	the target is deprecated.

	[1]: https://mail-index.netbsd.org/tech-toolchain/2021/07/19/msg004025.html
	---
	 bfd/config.bfd                             | 43 +++++++++++++--------
	 bfd/configure.ac                           |  5 +--
	 binutils/testsuite/binutils-all/nm.exp     |  2 +-
	 binutils/testsuite/lib/binutils-common.exp |  7 +---
	 config/picflag.m4                          |  4 +-
	 gas/configure.tgt                          |  9 +++--
	 gas/testsuite/gas/arm/blx-bl-convert.d     |  2 +-
	 gas/testsuite/gas/arm/blx-local-thumb.d    |  2 +-
	 gas/testsuite/gas/sh/basic.exp             |  2 +-
	 gdb/configure.host                         | 34 +++++++----------
	 gdb/configure.tgt                          |  2 +-
	 gdb/testsuite/gdb.asm/asm-source.exp       |  6 +--
	 intl/configure                             |  2 +-
	 ld/configure.tgt                           | 44 +++++++++++-----------
	 ld/testsuite/ld-arm/arm-elf.exp            |  4 +-
	 ld/testsuite/ld-elf/elf.exp                |  2 +-
	 ld/testsuite/ld-elf/shared.exp             |  4 +-
	 libiberty/configure                        |  4 +-

2021-08-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: don't print backtrace when dumping core after an internal error
	Currently, when GDB hits an internal error, and the user selects to
	dump core, the recently added feature to write a backtrace to the
	console will kick in, and print a backtrace as well as dumping the
	core.

	This was certainly not my intention when adding the backtrace on fatal
	signal functionality, this feature was intended to produce a backtrace
	when GDB crashes due to some fatal signal, internal errors should have
	continued to behave as they did before, unchanged.

	In this commit I set the signal disposition of SIGABRT back to SIG_DFL
	just prior to the call to abort() that GDB uses to trigger the core
	dump, this prevents GDB reaching the code that writes the backtrace to
	the console.

	I've also added a test that checks we don't see a backtrace on the
	console after an internal error.

2021-08-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: register SIGBUS, SIGFPE, and SIGABRT handlers
	Register handlers for SIGBUS, SIGFPE, and SIGABRT.  All of these
	signals are setup as fatal signals that will cause GDB to terminate.
	However, by passing these signals through the handle_fatal_signal
	function, a user can arrange to see a backtrace when GDB
	terminates (see maint set backtrace-on-fatal-signal).

	In normal use of GDB there should be no user visible changes after
	this commit.  Only if GDB terminates with one of the above signals
	will GDB change slightly, potentially printing a backtrace before
	aborting.

	I've added new tests for SIGFPE, SIGBUS, and SIGABRT.

2021-08-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: print backtrace on fatal SIGSEGV
	This commit adds a new maintenance feature, the ability to print
	a (limited) backtrace if GDB dies due to a fatal signal.

	The backtrace is produced using the backtrace and backtrace_symbols_fd
	functions which are declared in the execinfo.h header, and both of
	which are async signal safe.  A configure check has been added to
	check for these features, if they are not available then the new code
	is not compiled into GDB and the backtrace will not be printed.

	The motivation for this new feature is to aid in debugging GDB in
	situations where GDB has crashed at a users site, but the user is
	reluctant to share core files, possibly due to concerns about what
	might be in the memory image within the core file.  Such a user might
	be happy to share a simple backtrace that was written to stderr.

	The production of the backtrace is on by default, but can switched off
	using the new commands:

	  maintenance set backtrace-on-fatal-signal on|off
	  maintenance show backtrace-on-fatal-signal

	Right now, I have hooked this feature in to GDB's existing handling of
	SIGSEGV only, but this will be extended to more signals in a later
	commit.

	One additional change I have made in this commit is that, when we
	decide GDB should terminate due to the fatal signal, we now
	raise the same fatal signal rather than raising SIGABRT.

	Currently, this is only effecting our handling of SIGSEGV.  So,
	previously, if GDB hit a SEGV then we would terminate GDB with a
	SIGABRT.  After this commit we will terminate GDB with a SIGSEGV.

	This feels like an improvement to me, we should still get a core dump,
	but in many shells, the user will see a more specific message once GDB
	exits, in bash for example "Segmentation fault" rather than "Aborted".

	Finally then, here is an example of the output a user would see if GDB
	should hit an internal SIGSEGV:

	  Fatal signal: Segmentation fault
	  ----- Backtrace -----
	  ./gdb/gdb[0x8078e6]
	  ./gdb/gdb[0x807b20]
	  /lib64/libpthread.so.0(+0x14b20)[0x7f6648c92b20]
	  /lib64/libc.so.6(__poll+0x4f)[0x7f66484d3a5f]
	  ./gdb/gdb[0x1540f4c]
	  ./gdb/gdb[0x154034a]
	  ./gdb/gdb[0x9b002d]
	  ./gdb/gdb[0x9b014d]
	  ./gdb/gdb[0x9b1aa6]
	  ./gdb/gdb[0x9b1b0c]
	  ./gdb/gdb[0x41756d]
	  /lib64/libc.so.6(__libc_start_main+0xf3)[0x7f66484041a3]
	  ./gdb/gdb[0x41746e]
	  ---------------------
	  A fatal error internal to GDB has been detected, further
	  debugging is not possible.  GDB will now terminate.

	  This is a bug, please report it.  For instructions, see:
	  <https://www.gnu.org/software/gdb/bugs/>.

	  Segmentation fault (core dumped)

	It is disappointing that backtrace_symbols_fd does not actually map
	the addresses back to symbols, this appears, in part, to be due to GDB
	not being built with -rdynamic as the manual page for
	backtrace_symbols_fd suggests, however, even when I do add -rdynamic
	to the build of GDB I only see symbols for some addresses.

	We could potentially look at alternative libraries to provide the
	backtrace (e.g. libunwind) however, the solution presented here, which
	is available as part of glibc is probably a good baseline from which
	we might improve things in future.

2021-08-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: rename async_init_signals to gdb_init_signals
	The async_init_signals has, for some time, dealt with async and sync
	signals, so removing the async prefix makes sense I think.

	Additionally, as pointed out by Pedro:

	  .....

	The comments relating to SIGTRAP and SIGQUIT within this function are
	out of date.

	The comments for SIGTRAP talk about the signal disposition (SIG_IGN)
	being passed to the inferior, meaning the signal disposition being
	inherited by GDB's fork children.  However, we now call
	restore_original_signals_state prior to forking, so the comment on
	SIGTRAP is redundant.

	The comments for SIGQUIT are similarly out of date, further, the
	comment on SIGQUIT talks about problems with BSD4.3 and vfork,
	however, we have not supported BSD4.3 for several years now.

	Given the above, it seems that changing the disposition of SIGTRAP is
	no longer needed, so I've deleted the signal() call for SIGTRAP.

	Finally, the header comment on the function now called
	gdb_init_signals was getting quite out of date, so I've updated it
	to (hopefully) better reflect reality.

	There should be no user visible change after this commit.

2021-08-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: register signal handler after setting up event token
	This commit fixes the smallest of small possible bug related to signal
	handling.  If we look in async_init_signals we see code like this:

	  signal (SIGQUIT, handle_sigquit);
	  sigquit_token =
	    create_async_signal_handler (async_do_nothing, NULL, "sigquit");

	Then if we look in handle_sigquit we see code like this:

	  mark_async_signal_handler (sigquit_token);
	  signal (sig, handle_sigquit);

	Finally, in mark_async_signal_handler we have:

	  async_handler_ptr->ready = 1;

	Where async_handler_ptr will be sigquit_token.

	What this means is that if a SIGQUIT arrive in async_init_signals
	after handle_sigquit has been registered, but before sigquit_token has
	been initialised, then GDB will most likely crash.

	The chance of this happening is tiny, but fixing this is trivial, just
	ensure we call create_async_signal_handler before calling signal, so
	lets do that.

	There are no tests for this.  Trying to land a signal in the right
	spot is pretty hit and miss.  I did try changing the current HEAD GDB
	like this:

	  signal (SIGQUIT, handle_sigquit);
	  raise (SIGQUIT);
	  sigquit_token =
	    create_async_signal_handler (async_do_nothing, NULL, "sigquit");

	And confirmed that this did result in a crash, after my change I tried
	this:

	  sigquit_token =
	    create_async_signal_handler (async_do_nothing, NULL, "sigquit");
	  signal (SIGQUIT, handle_sigquit);
	  raise (SIGQUIT);

	And GDB now starts up just fine.

	gdb/ChangeLog:

		* event-top.c (async_init_signals): For each signal, call signal
		only after calling create_async_signal_handler.

2021-08-11  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: terminate upon receipt of SIGFPE
	GDB's SIGFPE handling is broken, this is PR gdb/16505 and
	PR gdb/17891.

	We currently try to use an async event token to process SIGFPE.  So,
	when a SIGFPE arrives the signal handler calls
	mark_async_signal_handler then returns, effectively ignoring the
	signal (for now).

	The intention is that later the event loop will see that the async
	token associated with SIGFPE has been marked and will call the async
	handler, which just throws an error.

	The problem is that SIGFPE is not safe to ignore.  Ignoring a
	SIGFPE (unless it is generated artificially, e.g. by raise()) is
	undefined behaviour, after ignoring the signal on many targets we
	return to the instruction that caused the SIGFPE to be raised, which
	immediately causes another SIGFPE to be raised, we get stuck in an
	infinite loop.  The behaviour is certainly true on x86-64.

	To view this behaviour I simply added some dummy code to GDB that
	performed an integer divide by zero, compiled this on x86-64
	GNU/Linux, ran GDB and saw GDB hang.

	In this commit, I propose to remove all special handling of SIGFPE and
	instead just let GDB make use of the default SIGFPE action, that is,
	to terminate the process.

	The only user visible change here should be:

	  - If a user sends a SIGFPE to GDB using something like kill,
	    previously GDB would just print an error and remain alive, now GDB
	    will terminate.  This is inline with what happens if the user
	    sends GDB a SIGSEGV from kill though, so I don't see this as an
	    issue.

	  - If a bug in GDB causes a real SIGFPE, previously the users GDB
	    session would hang.  Now the GDB session will terminate.  Again,
	    this is inline with what happens if GDB receives a SIGSEGV due to
	    an internal bug.

	In bug gdb/16505 there is mention that it would be nice if GDB did
	more than just terminate when receiving a fatal signal.  I haven't
	done that in this commit, but later commits will move in that
	direction.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16505
	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17891

2021-08-11  Alan Modra  <amodra@gmail.com>

	PR28198, Support # as linker script comment marker
		PR 28198
		* ldlex.l: Combine rules for handling newline, whitespace and
		comments.  Extend # comment handling to all states.

2021-08-11  Alan Modra  <amodra@gmail.com>

	ldgram.y tidies
	I've been tripped up before thinking the "end" rule was the "END"
	token.  Let's use a better name.  The formatting changes are for
	consistency within rules, and making it a little easier to visually
	separate tokens from mid-rule actions.

		* ldgram.y (separator): Rename from "end".  Update uses.
		(statement): Formatting.  Move ';' match to beginning.
		(paren_script_name): Formatting.  Simplify.
		(must_be_exp, section): Formatting.

2021-08-11  Alan Modra  <amodra@gmail.com>

	Mention whitespace in script expressions
	Inside an output section statement, ld's parser can't tell whether a
	line
	    .+=4;
	is an assignment to dot or a file named ".+=4".

		* ld.texi (expressions): Mention need for whitespace.

2021-08-11  Matt Jacobson  <mhjacobson@me.com>

	Add a -mno-dollar-line-separator command line option to the AVR assembler.
	Some frontends, like the gcc Objective-C frontend, emit symbols with $
	characters in them.  The AVR target code in gas treats $ as a line separator,
	so the code doesn?t assemble correctly.

	Provide a machine-specific option to disable treating $ as a line separator.

		* config/tc-avr.c (enum options): Add option flag.
		(struct option): Add option -mno-dollar-line-separator.
		(md_parse_option): Adjust treatment of $ when option is present.
		* config/tc-avr.h: Use avr_line_separator_chars.

2021-08-11  Nick Clifton  <nickc@redhat.com>

	Fix typo in previous delta

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	gas: fold IEEE encoding of -Inf with that of +Inf
	The respective results differ only by the sign bits - there's no need to
	have basically identical (partially even arch-specific) logic twice.
	Simply set the sign bit at the end of encoding the various formats.

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	gas: support NaN flavors
	Like for infinity, there isn't just a single NaN. The sign bit may be
	of interest and, going beyond infinity, whether the value is quiet or
	signalling may be even more relevant to be able to encode.

	Note that an anomaly with x86'es double extended precision NaN values
	gets taken care of at the same time: For all other formats a positive
	value with all mantissa bits set was used, while here a negative value
	with all non-significant mantissa bits clear was chose for an unknown
	reason.

	For m68k, since I don't know their X_PRECISION floating point value
	layout, a warning gets issued if any of the new flavors was attempted
	to be encoded that way. However likely it may be that, given that the
	code lives in a source file supposedly implementing IEEE-compliant
	formats, the bit patterns of the individual words match x86'es, I didn't
	want to guess so. And my very, very old paper doc doesn't even mention
	floating point formats other than single and double.

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	Arm64: leave .bfloat16 processing to common code
	With x86 support having been implemented by extending atof-ieee.c, avoid
	unnecessary code duplication in md_atof(). This will then also allow to
	take advantage of adjustments made there without needing to mirror them
	here.

	Arm32: leave more .bfloat16 processing to common code
	With x86 support having been implemented by extending atof-ieee.c, avoid
	unnecessary code duplication in md_atof(). This will then also allow to
	take advantage of adjustments made there without needing to mirror them
	here.

	gas: make 2nd argument of .dcb.* consistently optional
	Unlike the forms consuming/producing integer data, the floating point
	ones so far required the 2nd argument to be present, contrary to
	documentation. To avoid code duplication, split float_length() out of
	hex_float() (taking the opportunity to adjust error message wording).

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	x86: introduce .bfloat16 directive
	This is to be able to generate data acted upon by AVX512-BF16 and
	AMX-BF16 insns. While not part of the IEEE standard, the format is
	sufficiently standardized to warrant handling in config/atof-ieee.c.
	Arm, where custom handling was implemented, may want to leverage this as
	well. To be able to also use the hex forms supported for other floating
	point formats, a small addition to the generic hex_float() is needed.

	Extend existing x86 testcases.

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	x86: introduce .hfloat directive
	This is to be able to generate data passed to {,V}CVTPH2PS and acted
	upon by AVX512-FP16 insns. To be able to also use the hex forms
	supported for other floating point formats, a small addition to the
	generic hex_float() is needed.

	Extend existing x86 testcases.

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	x86/ELF: fix .tfloat output with hex input
	The ELF psABI-s are quite clear here: On 32-bit the data type is 12
	bytes long (with 2 bytes of trailing padding), while on 64-bit it is 16
	bytes long (with 6 bytes of padding). Make hex_float() capable of
	handling such padding.

	Note that this brings the emitted data size of .dc.x / .dcb.x in line
	also for non-ELF targets; so far they were different depending on input
	format (dec vs hex).

	Extend the existing x86 testcases.

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	x86/ELF: fix .ds.x output
	The ELF psABI-s are quite clear here: On 32-bit the underlying data type
	is 12 bytes long (with 2 bytes of trailing padding), while on 64-bit it
	is 16 bytes long (with 6 bytes of padding). Make s_space() capable of
	handling 'x' (and 'p') type floating point being other than 12 bytes
	wide (also adjusting documentation). This requires duplicating the
	definition of X_PRECISION in the target speciifc header; the compiler
	would complain if this was out of sync with config/atof-ieee.c.

	Note that for now padding space doesn't get separated from actual
	storage, which means that things will work correctly only for little-
	endian cases, and which also means that by specifying large enough
	numbers padding space can be set to non-zero. Since the logic is needed
	for a single little-endian architecture only for now, I'm hoping that
	this might be acceptable for the time being; otherwise the change will
	become more intrusive.

	Note also that this brings the emitted data size of .ds.x vs .tfloat in
	line for non-ELF targets as well; the issue will be even more obvious
	when further taking into account a subsequent patch fixing .dc.x/.dcb.x
	(where output sizes currently differ depending on input format).

	Extend existing x86 testcases.

2021-08-11  Jan Beulich  <jbeulich@suse.com>

	x86/ELF: fix .tfloat output
	The ELF psABI-s are quite clear here: On 32-bit the data type is 12
	bytes long (with 2 bytes of trailing padding), while on 64-bit it is 16
	bytes long (with 6 bytes of padding). Make ieee_md_atof() capable of
	handling such padding, and specify the needed padding for x86 (leaving
	non-ELF targets alone for now). Split the existing x86 testcase.

	x86: have non-PE/COFF BEOS be recognized as ELF
	BEOS, unless explicitly requesting *-*-beospe* targets, uses standard
	ELF. None of the newly enabled tests in the testsuite fail for me.

2021-08-11  Alan Modra  <amodra@gmail.com>

	PR28163, Segment fault in function rl78_special_reloc
	Relocation offset checks were completely missing in the rl78 backend,
	allowing a relocation to write over memory anywhere.  This was true
	for rl78_special_reloc, a function primarily used when applying debug
	relocations, and in rl78_elf_relocate_section used by the linker.

	This patch fixes those problems by correcting inaccuracies in the
	relocation howtos, then uses those howtos to sanity check relocation
	offsets before applying relocations.  In addition, the patch
	implements overflow checking using the howto information rather than
	the ad-hoc scheme implemented in relocate_section.  I implemented the
	overflow checking in rl78_special_reloc too.

		* elf32-rl78.c (RL78REL, RL78_OP_REL): Add mask parameter.
		(rl78_elf_howto_table): Set destination masks.  Correct size and
		bitsize of DIR32_REV.  Correct complain_on_overflow for many relocs
		as per tests in relocate_section.  Add RH_SFR.  Correct bitsize
		for RH_SADDR.  Set size to 3 and bitsize to 0 for all OP relocs.
		(check_overflow): New function.
		(rl78_special_reloc): Check that reloc address is within section.
		Apply relocations using reloc howto.  Check for overflow.
		(RANGE): Delete.
		(rl78_elf_relocate_section): Sanity check r_offset.  Perform
		overflow checking using reloc howto.

2021-08-11  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-10  Tom Tromey  <tom@tromey.com>

	Ignore .debug_types when reading .debug_aranges
	I noticed that the fission-reread.exp test case can cause a complaint
	when run with --target_board=cc-with-debug-names:

	warning: Section .debug_aranges in [...]/fission-reread has duplicate debug_info_offset 0x0, ignoring .debug_aranges.

	The bug here is that this executable has both .debug_info and
	.debug_types, and both have a CU at offset 0x0.  This triggers the
	duplicate warning.

	Because .debug_types doesn't provide any address ranges, these CUs can
	be ignored.  That is, this bug turns out to be another regression from
	the info/types merger patch.

	This patch fixes the problem by having this loop igore type units.
	fission-reread.exp is updated to test for the bug.

2021-08-10  Tom Tromey  <tom@tromey.com>

	Generalize addrmap dumping
	While debugging another patch series, I wanted to dump an addrmap.  I
	came up with this patch, which generalizes the addrmap-dumping code
	from psymtab.c and moves it to addrmap.c.  psymtab.c is changed to use
	the new code.

2021-08-10  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: iterate only on vfork parent threads in handle_vfork_child_exec_or_exit
	I spotted what I think is a buglet in proceed_after_vfork_done.  After a
	vfork child exits or execs, we resume all the threads of the parent.  To
	do so, we iterate on all threads using iterate_over_threads with the
	proceed_after_vfork_done callback.  Each thread is resumed if the
	following condition is true:

	    if (thread->ptid.pid () == pid
		&& thread->state == THREAD_RUNNING
		&& !thread->executing
		&& !thread->stop_requested
		&& thread->stop_signal () == GDB_SIGNAL_0)

	where `pid` is the pid of the vfork parent.  This is not multi-target
	aware: since it only filters on pid, if there is an inferior with the
	same pid in another target, we could end up resuming a thread of that
	other inferior.  The chances of the stars aligning for this to happen
	are tiny, but still.

	Fix that by iterating only on the vfork parent's threads, instead of on
	all threads.  This is more efficient, as we iterate on just the required
	threads (inferiors have their own thread list), and we can drop the pid
	check.  The resulting code is also more straightforward in my opinion,
	so it's a win-win.

	Change-Id: I14647da72e2bf65592e82fbe6efb77a413a4be3a

2021-08-10  Nick Clifton  <nickc@redhat.com>

	Updated Serbian and Russian translations for various sub-directories

2021-08-10  George Barrett  <bob@bob131.so>

	guile: fix smob exports
	Before Guile v2.1 [1], calls to `scm_make_smob_type' implicitly added
	the created class to the exports list of (oop goops); v2.1+ does not
	implicitly create bindings in any modules. This means that the GDB
	manual subsection documenting exported types is not quite right when GDB
	is linked against Guile <v2.1 (types are exported from (oop goops))
	instead of (gdb)) and incorrect when linked against Guile v2.1+ (types
	are not bound to any variables at all!).

	There is a range of cases in which it's necessary or convenient to be
	able to refer to a GDB smob type, for instance:

	 - Pattern matching based on the type of a value.
	 - Defining GOOPS methods handling values from GDB (GOOPS methods
	   typically use dynamic dispatch based on the types of the arguments).
	 - Type-checking assertions when applying some defensive programming on
	   an interface.
	 - Generally any other situation one might encounter in a dynamically
	   typed language that might need some introspection.

	If you're more familiar with Python, it would be quite similar to being
	unable to refer to the classes exported from the GDB module (which is to
	say: not crippling for the most part, but makes certain tasks more
	difficult than necessary).

	This commit makes a small change to GDB's smob registration machinery
	to make sure registered smobs get exported from the current
	module. This will likely cause warnings to the user about conflicting
	exports if they load both (gdb) and (oop goops) from a GDB linked
	against Guile v2.0, but it shouldn't impact functionality (and seemed
	preferable to trying to un-export bindings from (oop goops) if v2.0
	was detected).

	[1]: This changed with Guile commit
	     28d0871b553a3959a6c59e2e4caec1c1509f8595

	gdb/ChangeLog:

	2021-06-07  George Barrett  <bob@bob131.so>

		* guile/scm-gsmob.c (gdbscm_make_smob_type): Export registered
		smob type from the current module.

	gdb/testsuite/ChangeLog:

	2021-06-07  George Barrett  <bob@bob131.so>

		* gdb.guile/scm-gsmob.exp (test exports): Add tests to make
		sure the smob types currently listed in the GDB manual get
		exported from the (gdb) module.

	Change-Id: I7dcd791276b48dfc9edb64fc71170bbb42a6f6e7

2021-08-10  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-09  Nick Clifton  <nickc@redhat.com>

	GAS: DWARF-5: Ensure that the 0'th entry in the directory table contains the current working directory.
		* dwarf2dbg.c (get_directory_table_entry): Ensure that dir[0]
		contains current working directory.
		(out_dir_and_file_list): Likewise.
		* testsuite/gas/elf/dwarf-5-dir0.s: New test source file.
		* testsuite/gas/elf/dwarf-5-dir0.d: New test driver.
		* testsuite/gas/elf/elf.exp: Run the new test.
		* testsuite/gas/elf/dwarf-5-file0.d: Adjust expected output.
		* testsuite/gas/i386/dwarf5-line-1.d: Likewise.
		* testsuite/gas/i386/dwarf5-line-2.d: Likewise.

2021-08-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-08  Tom Tromey  <tom@tromey.com>

	Include objfiles.h in a few .c files
	I found a few .c files that rely on objfiles.h, but that only include
	it indirectly, via dwarf2/read.h -> psympriv.h.  If that include is
	removed (something my new DWARF indexer series does), then the build
	will break.

	It seemed harmless and correct to add these includes now, making the
	eventual series a little smaller.

2021-08-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-07  Alan Modra  <amodra@gmail.com>

	PR28186, SEGV elf.c:7991:30 in _bfd_elf_fixup_group_sections
		PR 28186
		* elf.c (_bfd_elf_fixup_group_sections): Don't segfault on
		objcopy/strip with NULL output_section.

2021-08-07  Alan Modra  <amodra@gmail.com>

	PR28176, rl78 complex reloc divide by zero
	This is a bit more than just preventing the divide by zero.  Most of
	the patch is tidying up error reporting, so that for example, linking
	an object file with a reloc stack underflow produces a linker error
	rather than just displaying a message that might be ignored.

		PR 28176
		* elf32-rl78.c (RL78_STACK_PUSH, RL78_STACK_POP): Delete.
		(rl78_stack_push, rl78_stack_pop): New inline functions.
		(rl78_compute_complex_reloc): Add status and error message params.
		Use new inline stack handling functions.  Report stack overflow
		or underflow, and divide by zero.
		(rl78_special_reloc): Return status and error message from
		rl78_compute_complex_reloc.
		(rl78_elf_relocate_section): Similarly.  Modernise reloc error
		reporting.  Delete unused bfd_reloc_other case.  Don't assume
		DIR24S_PCREL overflow is due to undefined function.
		(rl78_offset_for_reloc): Adjust to suit rl78_compute_complex_reloc.

2021-08-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-06  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Recognize .gdb_index symbol table with empty entries as empty
	When reading a .gdb_index that contains a non-empty symbol table with only
	empty entries, gdb doesn't recognize it as empty.

	Fix this by recognizing that the constant pool is empty, and then setting the
	symbol table to empty.

	Tested on x86_64-linux.

	gdb/ChangeLog:

	2021-08-01  Tom de Vries  <tdevries@suse.de>

		PR symtab/28159
		* dwarf2/read.c (read_gdb_index_from_buffer): Handle symbol table
		filled with empty entries.

	gdb/testsuite/ChangeLog:

	2021-08-01  Tom de Vries  <tdevries@suse.de>

		PR symtab/28159
		* gdb.dwarf2/dw2-zero-range.exp: Remove kfail.

2021-08-06  Tom Tromey  <tromey@adacore.com>

	Unconditionally define _initialize_addrmap
	The way that init.c is generated does not allow for an initialization
	function to be conditionally defined -- doing so will result in a link
	error.

	This patch fixes a build problem that arises from such a conditional
	definition.  It can be reproduce with --disable-unit-tests.

2021-08-06  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Fix zero address complaint for shlib
	In PR28004 the following warning / Internal error is reported:
	...
	$ gdb -q -batch \
	    -iex "set sysroot $(pwd -P)/repro" \
	    ./repro/gdb \
	    ./repro/core \
	    -ex bt
	  ...
	 Program terminated with signal SIGABRT, Aborted.
	 #0  0x00007ff8fe8e5d22 in raise () from repro/usr/lib/libc.so.6
	 [Current thread is 1 (LWP 1762498)]
	 #1  0x00007ff8fe8cf862 in abort () from repro/usr/lib/libc.so.6
	 warning: (Internal error: pc 0x7ff8feb2c21d in read in psymtab, \
	           but not in symtab.)
	 warning: (Internal error: pc 0x7ff8feb2c218 in read in psymtab, \
	           but not in symtab.)
	  ...
	 #2  0x00007ff8feb2c21e in __gnu_debug::_Error_formatter::_M_error() const \
	   [clone .cold] (warning: (Internal error: pc 0x7ff8feb2c21d in read in \
	   psymtab, but not in symtab.)

	) from repro/usr/lib/libstdc++.so.6
	...

	The warning is about the following:
	- in find_pc_sect_compunit_symtab we try to find the address
	  (0x7ff8feb2c218 / 0x7ff8feb2c21d) in the symtabs.
	- that fails, so we try again in the partial symtabs.
	- we find a matching partial symtab
	- however, the partial symtab has a full symtab, so
	  we should have found a matching symtab in the first step.

	The addresses are:
	...
	(gdb) info sym 0x7ff8feb2c218
	__gnu_debug::_Error_formatter::_M_error() const [clone .cold] in \
	  section .text of repro/usr/lib/libstdc++.so.6
	(gdb) info sym 0x7ff8feb2c21d
	__gnu_debug::_Error_formatter::_M_error() const [clone .cold] + 5 in \
	  section .text of repro/usr/lib/libstdc++.so.6
	...
	which correspond to unrelocated addresses 0x9c218 and 0x9c21d:
	...
	$ nm -C  repro/usr/lib/libstdc++.so.6.0.29 | grep 000000000009c218
	000000000009c218 t __gnu_debug::_Error_formatter::_M_error() const \
	  [clone .cold]
	...
	which belong to function __gnu_debug::_Error_formatter::_M_error() in
	/build/gcc/src/gcc/libstdc++-v3/src/c++11/debug.cc.

	The partial symtab that is found for the addresses is instead the one for
	/build/gcc/src/gcc/libstdc++-v3/src/c++98/bitmap_allocator.cc, which is
	incorrect.

	This happens as follows.

	The bitmap_allocator.cc CU has DW_AT_ranges at .debug_rnglist offset 0x4b50:
	...
	    00004b50 0000000000000000 0000000000000056
	    00004b5a 00000000000a4790 00000000000a479c
	    00004b64 00000000000a47a0 00000000000a47ac
	...

	When reading the first range 0x0..0x56, it doesn't trigger the "start address
	of zero" complaint here:
	...
	      /* A not-uncommon case of bad debug info.
	         Don't pollute the addrmap with bad data.  */
	      if (range_beginning + baseaddr == 0
	          && !per_objfile->per_bfd->has_section_at_zero)
	        {
	          complaint (_(".debug_rnglists entry has start address of zero"
	                       " [in module %s]"), objfile_name (objfile));
	          continue;
	        }
	...
	because baseaddr != 0, which seems incorrect given that when loading the
	shared library individually in gdb (and consequently baseaddr == 0), we do see
	the complaint.

	Consequently, we run into this case in dwarf2_get_pc_bounds:
	...
	  if (low == 0 && !per_objfile->per_bfd->has_section_at_zero)
	    return PC_BOUNDS_INVALID;
	...
	which then results in this code in process_psymtab_comp_unit_reader being
	called with cu_bounds_kind == PC_BOUNDS_INVALID, which sets the set_addrmap
	argument to 1:
	...
	      scan_partial_symbols (first_die, &lowpc, &highpc,
	                            cu_bounds_kind <= PC_BOUNDS_INVALID, cu);
	...
	and consequently, the CU addrmap gets build using address info from the
	functions.

	During that process, addrmap_set_empty is called with a range that includes
	0x9c218 and 0x9c21d:
	...
	(gdb) p /x start
	$7 = 0x9989c
	(gdb) p /x end_inclusive
	$8 = 0xb200d
	...
	but it's called for a function at DIE 0x54153 with DW_AT_ranges at 0x40ae:
	...
	    000040ae 00000000000b1ee0 00000000000b200e
	    000040b9 000000000009989c 00000000000998c4
	    000040c3 <End of list>
	...
	and neither range includes 0x9c218 and 0x9c21d.

	This is caused by this code in partial_die_info::read:
	...
	            if (dwarf2_ranges_read (ranges_offset, &lowpc, &highpc, cu,
	                                    nullptr, tag))
	             has_pc_info = 1;
	...
	which pretends that the function is located at addresses 0x9989c..0xb200d,
	which is indeed not the case.

	This patch fixes the first problem encountered: fix the "start address of
	zero" complaint warning by removing the baseaddr part from the condition.
	Same for dwarf2_ranges_process.

	The effect is that:
	- the complaint is triggered, and
	- the warning / Internal error is no longer triggered.

	This does not fix the observed problem in partial_die_info::read, which is
	filed as PR28200.

	Tested on x86_64-linux.

	Co-Authored-By: Simon Marchi <simon.marchi@polymtl.ca>

	gdb/ChangeLog:

	2021-07-29  Simon Marchi  <simon.marchi@polymtl.ca>
		    Tom de Vries  <tdevries@suse.de>

		PR symtab/28004
		* gdb/dwarf2/read.c (dwarf2_rnglists_process, dwarf2_ranges_process):
		Fix zero address complaint.
		* gdb/testsuite/gdb.dwarf2/dw2-zero-range-shlib.c: New test.
		* gdb/testsuite/gdb.dwarf2/dw2-zero-range.c: New test.
		* gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp: New file.

2021-08-06  Alan Modra  <amodra@gmail.com>

	Re: Add tests for Intel AVX512_FP16 instructions
		* testsuite/gas/i386/x86-64-avx512_fp16_pseudo_ops.d: Pass with
		mingw section padding.

2021-08-06  Alan Modra  <amodra@gmail.com>

	chew ubsan warning
	It matters not at all if pc is incremented from its initial NULL
	value, but avoid this silly runtime ubsan error.

		* doc/chew.c (perform): Avoid incrementing NULL pc.

2021-08-06  Alan Modra  <amodra@gmail.com>

	bfd_reloc_offset_in_range overflow
	This patch is more about the style of bounds checking we ought to use,
	rather than a real problem.  An overflow of "octet + reloc_size" can
	only happen with huge sections which would certainly cause out of
	memory errors.

		* reloc.c (bfd_reloc_offset_in_range): Avoid possible overflow.

2021-08-06  Alan Modra  <amodra@gmail.com>

	PR28175, Segment fault in coff-tic30.c reloc_processing
	The obj_convert table shouldn't be accessed without first checking the
	index against the table size.

		PR 28175
		* coff-tic30.c (reloc_processing): Sanity check reloc symbol index.
		* coff-z80.c (reloc_processing): Likewise.
		* coff-z8k.c (reloc_processing): Likewise.

2021-08-06  Alan Modra  <amodra@gmail.com>

	PR28173, nds32_elf_howto_table index out of bounds
	Indexing the howto table was seriously broken by a missing entry, and
	use of assertions about user input rather than testing the input.

		PR 28173
		* elf32-nds32.c (nds32_elf_howto_table): Add missing empty howto.
		(bfd_elf32_bfd_reloc_type_table_lookup): Replace assertions with
		range checks.  Return NULL if unsupported reloc type.  Remove
		dead code.  Take an unsigned int param.
		(nds32_info_to_howto_rel): Test for NULL howto or howto name
		return from lookup.  Remove assertion.
		(nds32_info_to_howto): Remove unnecessary ATTRIBUTE_UNUSED.
		Test for NULL howto or howto name return from lookup.

2021-08-06  Alan Modra  <amodra@gmail.com>

	PR28172, bfin_pcrel24_reloc heap-buffer-overflow
	bfin pcrel24 relocs are weird, they apply to the reloc address minus
	two.  That means reloc addresses of 0 and 1 are invalid.  Check that,
	and fix other reloc range checking.

		PR 28172
		* elf32-bfin.c (bfin_pcrel24_reloc): Correct reloc range check.
		(bfin_imm16_reloc, bfin_byte4_reloc, bfin_bfd_reloc): Likewise.
		(bfin_final_link_relocate): Likewise.

2021-08-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-05  Will Schmidt  <will_schmidt@vnet.ibm.com>

	[PATCH] GDB Testsuite, update compile-cplus.exp
	[PATCH] GDB Testsuite, update compile-cplus.exp

	Update the gdb.compile/compile-cplus.exp test to
	handle errors generated when passing bad arguments
	into the gdb-compile command.
	This matches changes made to gdb.compile/compile.exp
	in the past as part of
	"Migrate rest of compile commands to new options framework"
	         e6ed716cd5514c08b9d7c469d185b1aa177dbc22

2021-08-05  Will Schmidt  <will_schmidt@vnet.ibm.com>

	[gdb] Handle .TOC. sections during gdb-compile for rs6000 target.
	[gdb] Handle .TOC. sections during gdb-compile for rs6000 target.

	  When we encounter a .TOC. symbol in the object we are loading,
	we need to associate this with the .toc section in order to
	properly resolve other symbols in the object.  IF a .toc section
	is not found, iterate the sections until we find one with the
	SEC_ALLOC flag.  If that also fails, fall back to using
	the *ABS* section, pointed to by bfd_abs_section_ptr.

2021-08-05  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: gdb.base/attach.exp: expose bug when testing with native-extended-gdbserver
	In gdb.base/attach.exp, proc do_attach_failure_tests, we attach to a
	process.  When then try to attach to the same process in another
	inferior, expecting it to fail.  We then come back to the first inferior
	and try to kill it, to clean up the test.  When using the
	native-extended-gdbserver board, this "kill" test passes, even though it
	didn't actually work:

	    add-inferior
	    [New inferior 2]
	    Added inferior 2 on connection 1 (extended-remote localhost:2347)
	    (gdb) PASS: gdb.base/attach.exp: do_attach_failure_tests: add empty inferior 2
	    inferior 2
	    [Switching to inferior 2 [<null>] (<noexec>)]
	    (gdb) PASS: gdb.base/attach.exp: do_attach_failure_tests: switch to inferior 2
	    attach 817032
	    Attaching to process 817032
	    Attaching to process 817032 failed
	    (gdb) PASS: gdb.base/attach.exp: do_attach_failure_tests: fail to attach again
	    inferior 1
	    [Switching to inferior 1 [process 817032] (/home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/attach/attach)]
	    [Switching to thread 1.1 (Thread 817032.817032)]
	    #0  main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/attach.c:19
	    19	  while (! should_exit)
	    (gdb) PASS: gdb.base/attach.exp: do_attach_failure_tests: switch to inferior 1
	    kill
	    Kill the program being debugged? (y or n) y
	    Remote connection closed  <==== That's unexpected
	    (gdb) PASS: gdb.base/attach.exp: do_attach_failure_tests: exit after attach failures

	When the second attach fails, gdbserver seems to break the connection
	(it hangs up on the existing remote target) and start listening again
	for incoming connections.  This is documented in PR 19558 [1].

	Make the expected output regexp for the kill command tighter (it
	currently accepts anything).  Use "set confirm off" so we don't have to
	deal with the confirmation.  And to be really sure the extended-remote
	target still works, try to run the inferior again after killing.  The
	now tests are kfail'ed when the target is gdbserver.

	[1] https://sourceware.org/bugzilla/show_bug.cgi?id=19558

	gdb/testsuite/ChangeLog:

		* gdb.base/attach.exp (do_attach_failure_tests): Make kill
		regexp tighter, run inferior after killing it.  Kfail when
		target is gdbserver.

	Change-Id: I99c5cd3968ce2ec962ace35b016f842a243b7a0d

2021-08-05  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: gdb.base/attach.exp: fix support check in test_command_line_attach_run
	When running this test with the native-extended-gdbserver, we get:

	    main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/attach.c:19
	    19	  while (! should_exit)
	    The program being debugged has been started already.
	    Start it from the beginning? (y or n) PASS: gdb.base/attach.exp: cmdline attach run: run to prompt
	    y
	    Don't know how to run.  Try "help target".
	    (gdb) FAIL: gdb.base/attach.exp: cmdline attach run: run to main

	This test tests using both "-p <pid>" and "-ex start" on the command line,
	making sure that we first attach and then run.

	Normally, after that "y", we should see the program running again.
	However, a particuliarity of the native-extended-gdbserver is that it
	uses "set auto-connect-native-target off" on the command line.  The full
	GDB command line is:

	    ./gdb -nw -nx -data-directory /home/simark/build/binutils-gdb/gdb/testsuite/../data-directory \
	          -iex set height 0 -iex set width 0 -ex set auto-connect-native-target off \
		  -ex set sysroot -quiet -iex set height 0 -iex set width 0 --pid=536609 -ex start

	The attach succeeds.  I guess it is done before "set
	auto-connect-native-target off", or it somehow bypasses it.  When the
	"start" is executed, the native target is unpushed, while killing the
	existing process, but not re-pushed, due to "set
	auto-connect-native-target off".  So we get that "Don't know how to run"
	message.

	Really, I think it's a case of the test doing things incompatible with
	the board, I think it should just be skipped.  And as we can see with
	the current code, there were some attempts at doing this, just using the
	wrong checks:

	 - isnative: this is a dejagnu proc which checks if the target board has
	   the same triplet as the build machine.  In the case of
	   native-extended-gdbserver, it does.
	 - is_remote target: this checks whether the target board is remote, as
	   in executing on a different machin.  native-extended-gdbserver is not
	   remote.

	Since the --pid option specifically attaches to a process using the
	native target, change the test to use gdb_is_target_native instead.

	gdb/testsuite/ChangeLog:

		* gdb.base/attach.exp (test_command_line_attach_run): Use
		gdb_is_target_native to check if test is supported.

	Change-Id: I762e127f39623889999dc9ed2185540a0951bfb0

2021-08-05  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: target_waitstatus_to_string: print extra info for FORKED, VFORKED, EXECD
	Print the extra information contained in target_waitstatus for these
	events.  For TARGET_WAITKIND_{FORKED,VFORKED}, the extra information is
	contained in related_pid, and is the ptid of the new process.  For
	TARGET_WAITKIND_EXECD, it,s the exec'd path name in execd_pathname.
	Print it using the same format used for TARGET_WAITKIND_STOPPED and
	others.

	Here are sample outputs for all three events:

	    [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
	    [infrun] print_target_wait_results:   726890.726890.0 [process 726890],
	    [infrun] print_target_wait_results:   status->kind = vforked, related_pid = 726894.726894.0

	    [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
	    [infrun] print_target_wait_results:   727045.727045.0 [process 727045],
	    [infrun] print_target_wait_results:   status->kind = forked, related_pid = 727049.727049.0

	    [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
	    [infrun] print_target_wait_results:   727119.727119.0 [process 727119],
	    [infrun] print_target_wait_results:   status->kind = execd, execd_pathname = /usr/bin/ls

	Change-Id: I4416a74e3bf792a625a68bf26c51689e170f2184

2021-08-05  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: use ptid_t::to_string in print_target_wait_results
	The ptid_t::to_string method was introduced recently, to format a ptid_t
	for debug purposes.  It formats the ptid exactly as is done in
	print_target_wait_results, so make print_target_wait_results use it.

	Change-Id: I0a81c8040d3e1858fb304cb28366b34d94eefe4d

2021-08-05  Zoran Zaric  <Zoran.Zaric@amd.com>

	Add as_lval argument to expression evaluator
	There are cases where the result of the expression evaluation is
	expected to be in a form of a value and not location description.

	One place that has this requirement is dwarf_entry_parameter_to_value
	function, but more are expected in the future. Until now, this
	requirement was fulfilled by extending the evaluated expression with
	a DW_OP_stack_value operation at the end.

	New implementation, introduces a new evaluation argument instead.

		* dwarf2/expr.c (dwarf_expr_context::fetch_result): Add as_lval
		argument.
		(dwarf_expr_context::eval_exp): Add as_lval argument.
		* dwarf2/expr.h (struct dwarf_expr_context): Add as_lval
		argument to fetch_result and eval_exp methods.
		* dwarf2/frame.c (execute_stack_op): Add as_lval argument.
		* dwarf2/loc.c (dwarf_entry_parameter_to_value): Remove
		DWARF expression extension.
		(dwarf2_evaluate_loc_desc_full): Add as_lval argument support.
		(dwarf2_evaluate_loc_desc): Add as_lval argument support.
		(dwarf2_locexpr_baton_eval): Add as_lval argument support.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Simplify dwarf_expr_context class interface
	Idea of this patch is to get a clean and simple public interface for
	the dwarf_expr_context class, looking like:

	- constructor,
	- destructor,
	- push_address method and
	- evaluate method.

	Where constructor should only ever require a target architecture
	information. This information is held in per object file
	(dwarf2_per_objfile) structure, so it makes sense to keep that
	structure as a constructor argument. It also makes sense to get the
	address size from that structure, but unfortunately that interface
	doesn't exist at the moment, so the dwarf_expr_context class user
	needs to provide that information.

	The push_address method is used to push a CORE_ADDR as a value on
	top of the DWARF stack before the evaluation. This method can be
	later changed to push any struct value object on the stack.

	The evaluate method is the method that evaluates a DWARF expression
	and provides the evaluation result, in a form of a single struct
	value object that describes a location. To do this, the method requires
	a context of the evaluation, as well as expected result type
	information. If the type information is not provided, the DWARF generic
	type will be used instead.

	To avoid storing the gdbarch information in the evaluator object, that
	information is now always acquired from the per_objfile object.

	All data members are now private and only visible to the evaluator
	class, so a m_ prefix was added to all of their names to reflect that.
	To make this distinction clear, they are also accessed through objects
	this pointer, wherever that was not the case before.

	gdb/ChangeLog:

		* dwarf2/expr.c (dwarf_expr_context::dwarf_expr_context): Add
		address size argument.
		(dwarf_expr_context::read_mem): Change to use property_addr_info
		structure.
		(dwarf_expr_context::evaluate): New function.
		(dwarf_expr_context::execute_stack_op): Change to use
		property_addr_info structure.
		* dwarf2/expr.h (struct dwarf_expr_context): New evaluate
		declaration. Change eval and fetch_result method to private.
	        (dwarf_expr_context::gdbarch): Remove member.
	        (dwarf_expr_context::stack): Make private and add m_ prefix.
	        (dwarf_expr_context::addr_size): Make private and add
	        m_ prefix.
	        (dwarf_expr_context::recursion_depth): Make private and add
	        m_ prefix.
	        (dwarf_expr_context::max_recursion_depth): Make private and
	        add m_ prefix.
	        (dwarf_expr_context::len): Make private and add m_ prefix.
	        (dwarf_expr_context::data): Make private and add m_ prefix.
	        (dwarf_expr_context::initialized): Make private and add
	        m_ prefix.
	        (dwarf_expr_context::pieces): Make private and add m_ prefix.
	        (dwarf_expr_context::per_objfile): Make private and add
	        m_ prefix.
	        (dwarf_expr_context::frame): Make private and add m_ prefix.
	        (dwarf_expr_context::per_cu): Make private and add m_ prefix.
	        (dwarf_expr_context::addr_info): Make private and add
	        m_ prefix.
		* dwarf2/frame.c (execute_stack_op): Change to call evaluate
		method.
		* dwarf2/loc.c (dwarf2_evaluate_loc_desc_full): Change to call
		evaluate method.
		(dwarf2_locexpr_baton_eval): Change to call evaluate method.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Make DWARF evaluator return a single struct value
	The patch is addressing the issue of class users writing and reading
	the internal data of the dwarf_expr_context class.

	At this point, all conditions are met for the DWARF evaluator to return
	an evaluation result in a form of a single struct value object.

	gdb/ChangeLog:

		* dwarf2/expr.c (pieced_value_funcs): Chenge to static
		function.
		(allocate_piece_closure): Change to static function.
		(dwarf_expr_context::fetch_result): New function.
		* dwarf2/expr.h (struct piece_closure): Remove declaration.
		(struct dwarf_expr_context): fetch_result new declaration.
		fetch, fetch_address and fetch_in_stack_memory members move
		to private.
		(allocate_piece_closure): Remove.
		* dwarf2/frame.c (execute_stack_op): Change to use
		fetch_result.
		* dwarf2/loc.c (dwarf2_evaluate_loc_desc_full): Change to use
		fetch_result.
		(dwarf2_locexpr_baton_eval): Change to use fetch_result.
	        * dwarf2/loc.h (invalid_synthetic_pointer): Expose function.

2021-08-05  Zoran Zaric  <Zoran.Zaric@amd.com>

	Make value_copy also copy the stack data member
	Fixing a bug where the value_copy function did not copy the stack data
	and initialized members of the struct value. This is needed for the
	next patch where the DWARF expression evaluator is changed to return a
	single struct value object.

	        * value.c (value_copy): Change to also copy the stack data
	          and initialized members.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Move piece_closure and its support to expr.c
	Following 5 patches series is trying to clean up the interface of the
	DWARF expression evaluator class (dwarf_expr_context).

	After merging all expression evaluators into one class, the next
	logical step is to make a clean user interface for that class. To do
	that, we first need to address the issue of class users writing and
	reading the internal data of the class directly.

	Fixing the case of writing is simple, it makes sense for an evaluator
	instance to be per architecture basis. Currently, the best separation
	seems to be per object file, so having that data (dwarf2_per_objfile)
	as a constructor argument makes sense. It also makes sense to get the
	address size from that object file, but unfortunately that interface
	does not exist at the moment.

	Luckily, address size information is already available to the users
	through other means. As a result, the address size also needs to be a
	class constructor argument, at least until a better interface for
	acquiring that information from an object file is implemented.

	The rest of the user written data comes down to a context of an
	evaluated expression (compilation unit context, frame context and
	passed in buffer context) and a source type information that a result
	of evaluating expression is representing. So, it makes sense for all of
	these to be arguments of an evaluation method.

	To address the problem of reading the dwarf_expr_context class
	internal data, we first need to understand why it is implemented that
	way?

	This is actualy a question of which existing class can be used to
	represent both values and a location descriptions and why it is not
	used currently?

	The answer is in a struct value class/structure, but the problem is
	that before the evaluators were merged, only one evaluator had an
	infrastructure to resolve composite and implicit pointer location
	descriptions.

	After the merge, we are now able to use the struct value to represent
	any result of the expression evaluation. It also makes sense to move
	all infrastructure for those location descriptions to the expr.c file
	considering that that is the only place using that infrastructure.

	What we are left with in the end is a clean public interface of the
	dwarf_expr_context class containing:

	- constructor,
	- destructor,
	- push_address method and
	- eval_exp method.

	The idea with this particular patch is to move piece_closure structure
	and the interface that handles it (lval_funcs) to expr.c file.

	While implicit pointer location descriptions are still not useful in
	the CFI context (of the AMD's DWARF standard extensions), the composite
	location descriptions are certainly necessary to describe a results of
	specific compiler optimizations.

	Considering that a piece_closure structure is used to represent both,
	there was no benefit in splitting them.

	gdb/ChangeLog:

		* dwarf2/expr.c (struct piece_closure): Add from loc.c.
		(allocate_piece_closure): Add from loc.c.
		(bits_to_bytes): Add from loc.c.
		(rw_pieced_value): Add from loc.c.
		(read_pieced_value): Add from loc.c.
		(write_pieced_value): Add from loc.c.
		(check_pieced_synthetic_pointer): Add from loc.c.
		(indirect_pieced_value): Add from loc.c.
		(coerce_pieced_ref): Add from loc.c.
		(copy_pieced_value_closure): Add from loc.c.
		(free_pieced_value_closure): Add from loc.c.
		(sect_variable_value): Add from loc.c.
		* dwarf2/loc.c (sect_variable_value): Move to expr.c.
		(struct piece_closure): Move to expr.c.
		(allocate_piece_closure): Move to expr.c.
		(bits_to_bytes): Move to expr.c.
		(rw_pieced_value): Move to expr.c.
		(read_pieced_value): Move to expr.c.
		(write_pieced_value): Move to expr.c.
		(check_pieced_synthetic_pointer): Move to expr.c.
		(indirect_pieced_value): Move to expr.c.
		(coerce_pieced_ref): Move to expr.c.
		(copy_pieced_value_closure): Move to expr.c.
		(free_pieced_value_closure): Move to expr.c.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Merge evaluate_for_locexpr_baton evaluator
	The evaluate_for_locexpr_baton is the last derived class from the
	dwarf_expr_context class. It's purpose is to support the passed in
	buffer functionality.

	Although, it is not really necessary to merge this class with it's
	base class, doing that simplifies new expression evaluator design.

	Considering that this functionality is going around the DWARF standard,
	it is also reasonable to expect that with a new evaluator design and
	extending the push object address functionality to accept any location
	description, there will be no need to support passed in buffers.

	Alternatively, it would also makes sense to abstract the interaction
	between the evaluator and a given resource in the near future. The
	passed in buffer would then be a specialization of that abstraction.

	gdb/ChangeLog:

		* dwarf2/expr.c (dwarf_expr_context::read_mem): Merge with
		evaluate_for_locexpr_baton implementation.
		* dwarf2/loc.c (class evaluate_for_locexpr_baton): Remove
		class.
		(evaluate_for_locexpr_baton::read_mem): Move to
		dwarf_expr_context.
		(dwarf2_locexpr_baton_eval): Instantiate dwarf_expr_context
		instead of evaluate_for_locexpr_baton class.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Remove empty frame and full evaluators
	There are no virtual methods that require different specialization in
	dwarf_expr_context class. This means that derived classes
	dwarf_expr_executor and dwarf_evaluate_loc_desc are not needed any
	more.

	As a result of this, the  evaluate_for_locexpr_baton class base class
	is now the dwarf_expr_context class.

	There might be a need for a better class hierarchy when we know more
	about the direction of the future DWARF versions and gdb extensions,
	but that is out of the scope of this patch series.

	gdb/ChangeLog:

		* dwarf2/frame.c (class dwarf_expr_executor): Remove class.
		(execute_stack_op): Instantiate dwarf_expr_context instead of
		dwarf_evaluate_loc_desc class.
		* dwarf2/loc.c (class dwarf_evaluate_loc_desc): Remove class.
		(dwarf2_evaluate_loc_desc_full): Instantiate dwarf_expr_context
		instead of dwarf_evaluate_loc_desc class.
		(struct evaluate_for_locexpr_baton): Derive from
		dwarf_expr_context.

2021-08-05  Zoran Zaric  <Zoran.Zaric@amd.com>

	Inline get_reg_value method of dwarf_expr_context
	The get_reg_value method is a small function that is only called once,
	so it can be inlined to simplify the dwarf_expr_context class.

	gdb/ChangeLog:

		* dwarf2/expr.c (dwarf_expr_context::get_reg_value): Remove
		method.
		(dwarf_expr_context::execute_stack_op): Inline get_reg_value
		method.
		* dwarf2/expr.h (dwarf_expr_context::get_reg_value): Remove
		method.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Move push_dwarf_reg_entry_value to expr.c
	Following the idea of merging the evaluators, the
	push_dwarf_reg_entry_value method can be moved from
	dwarf_expr_executor and dwarf_evaluate_loc_desc classes
	to their base class dwarf_expr_context.

	gdb/ChangeLog:

		* dwarf2/expr.c
	        (dwarf_expr_context::push_dwarf_reg_entry_value): Move from
		dwarf_evaluate_loc_desc.
		* dwarf2/frame.c
		(dwarf_expr_executor::push_dwarf_reg_entry_value): Remove
		method.
		* dwarf2/loc.c (dwarf_expr_reg_to_entry_parameter): Expose
		function.
		(dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value): Move to
		dwarf_expr_context.
		* dwarf2/loc.h (dwarf_expr_reg_to_entry_parameter): Expose
		function.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Move read_mem to dwarf_expr_context
	Following the idea of merging the evaluators, the read_mem method can
	be moved from dwarf_expr_executor and dwarf_evaluate_loc_desc classes
	to their base class dwarf_expr_context.

	gdb/ChangeLog:

		* dwarf2/expr.c (dwarf_expr_context::read_mem): Move from
		dwarf_evaluate_loc_desc.
		* dwarf2/frame.c (dwarf_expr_executor::read_mem): Remove
		method.
		* dwarf2/loc.c (dwarf_evaluate_loc_desc::read_mem): Move to
		dwarf_expr_context.

2021-08-05  Zoran Zaric  <Zoran.Zaric@amd.com>

	Move get_object_address to dwarf_expr_context
	Following the idea of merging the evaluators, the get_object_address
	and can be moved from dwarf_expr_executor and dwarf_evaluate_loc_desc
	classes to their base class dwarf_expr_context.

	gdb/ChangeLog:

		* dwarf2/expr.c (dwarf_expr_context::get_object_address): Move
		from dwarf_evaluate_loc_desc.
		(class dwarf_expr_context): Add object address member to
		dwarf_expr_context.
		* dwarf2/expr.h (dwarf_expr_context::get_frame_pc): Remove
		method.
		* dwarf2/frame.c (dwarf_expr_executor::get_object_address):
		Remove method.
		* dwarf2/loc.c (dwarf_evaluate_loc_desc::get_object_address):
		move to dwarf_expr_context.
		(class dwarf_evaluate_loc_desc): Move object address member to
		dwarf_expr_context.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Move dwarf_call to dwarf_expr_context
	Following the idea of merging the evaluators, the dwarf_call and
	get_frame_pc method can be moved from dwarf_expr_executor and
	dwarf_evaluate_loc_desc classes to their base class dwarf_expr_context.
	Once this is done, the get_frame_pc can be replace with lambda
	function.

	gdb/ChangeLog:

		* dwarf2/expr.c (dwarf_expr_context::dwarf_call): Move from
		dwarf_evaluate_loc_desc.
		(dwarf_expr_context::get_frame_pc): Replace with lambda.
		* dwarf2/expr.h (dwarf_expr_context::get_frame_pc): Remove
		method.
		* dwarf2/frame.c (dwarf_expr_executor::dwarf_call): Remove
		method.
		(dwarf_expr_executor::get_frame_pc): Remove method.
		* dwarf2/loc.c (dwarf_evaluate_loc_desc::get_frame_pc): Remove
		method.
		(dwarf_evaluate_loc_desc::dwarf_call): Move to
		dwarf_expr_context.
		(per_cu_dwarf_call): Inline function.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Move compilation unit info to dwarf_expr_context
	This patch moves the compilation unit context information and support
	from dwarf_expr_executor and dwarf_evaluate_loc_desc to
	dwarf_expr_context evaluator. The idea is to report an error when a
	given operation requires a compilation unit information to be resolved,
	which is not available.

	With this change, it also makes sense to always acquire ref_addr_size
	information from the compilation unit context, considering that all
	DWARF operations that refer to that information require a compilation
	unit context to be present during their evaluation.

	gdb/ChangeLog:

		* dwarf2/expr.c (ensure_have_per_cu): New function.
		(dwarf_expr_context::dwarf_expr_context): Add compilation unit
		context information.
		(dwarf_expr_context::get_base_type): Move from
		dwarf_evaluate_loc_desc.
		(dwarf_expr_context::get_addr_index): Remove method.
		(dwarf_expr_context::dwarf_variable_value): Remove method.
		(dwarf_expr_context::execute_stack_op): Call compilation unit
		context info check. Inline get_addr_index and
		dwarf_variable_value methods.
		* dwarf2/expr.h (struct dwarf_expr_context): Add compilation
		context info.
	        (dwarf_expr_context::get_addr_index): Remove method.
	        (dwarf_expr_context::dwarf_variable_value): Remove method.
	        (dwarf_expr_context::ref_addr_size): Remove member.
		* dwarf2/frame.c (dwarf_expr_executor::get_addr_index): Remove
		method.
		(dwarf_expr_executor::dwarf_variable_value): Remove method.
		* dwarf2/loc.c (sect_variable_value): Expose function.
		(dwarf_evaluate_loc_desc::get_addr_index): Remove method.
		(dwarf_evaluate_loc_desc::dwarf_variable_value): Remove method.
		(class dwarf_evaluate_loc_desc): Move compilation unit context
		information to dwarf_expr_context class.
		* dwarf2/loc.h (sect_variable_value): Expose function.

2021-08-05  Zoran Zaric  <Zoran.Zaric@amd.com>

	Remove get_frame_cfa from dwarf_expr_context
	Following the idea of merging the evaluators, the get_frame_cfa method
	can be moved from dwarf_expr_executor and dwarf_evaluate_loc_desc
	classes to their base class dwarf_expr_context. Once this is done,
	it becomes apparent that the method is only called once and it can be
	inlined.

	It is also necessary to check if the frame context information was
	provided before the DW_OP_call_frame_cfa operation is executed.

	gdb/ChangeLog:

		* dwarf2/expr.c (dwarf_expr_context::get_frame_cfa): Remove
		method.
		(dwarf_expr_context::execute_stack_op): Call frame context info
		check for DW_OP_call_frame_cfa. Remove use of get_frame_cfa.
		* dwarf2/expr.h (dwarf_expr_context::get_frame_cfa): Remove
		method.
		* dwarf2/frame.c (dwarf_expr_context::get_frame_cfa): Remove
		method.
		* dwarf2/loc.c (dwarf_expr_context::get_frame_cfa): Remove
		method.

2021-08-05  Zoran Zaric  <zoran.zaric@amd.com>

	Move frame context info to dwarf_expr_context
	Following 15 patches in this patch series is cleaning up the design of
	the DWARF expression evaluator (dwarf_expr_context) to make future
	extensions of that evaluator easier and cleaner to implement.

	There are three subclasses of the dwarf_expr_context class
	(dwarf_expr_executor, dwarf_evaluate_loc_desc and
	evaluate_for_locexpr_baton). Here is a short description of each class:

	- dwarf_expr_executor is evaluating a DWARF expression in a context
	  of a Call Frame Information. The overridden methods of this subclass
	  report an error if a specific DWARF operation, represented by that
	  method, is not allowed in a CFI context. The source code of this
	  subclass lacks the support for composite as well as implicit pointer
	  location description.

	- dwarf_evaluate_loc_desc can evaluate any expression with no
	  restrictions. All of the methods that this subclass overrides are
	  actually doing what they are intended to do. This subclass contains
	  a full support for all location description types.

	- evaluate_for_locexpr_baton subclass is a specialization of the
	  dwarf_evaluate_loc_desc subclass and it's function is to add
	  support for passed in buffers. This seems to be a way to go around
	  the fact that DWARF standard lacks a bit offset support for memory
	  location descriptions as well as using any location description for
	  the push object address functionality.

	It all comes down to this question: what is a function of a DWARF
	expression evaluator?

	Is it to evaluate the expression in a given context or to check the
	correctness of that expression in that context?

	Currently, the only reason why there is a dwarf_expr_executor subclass
	is to report an invalid DWARF expression in a context of a CFI, but is
	that what the evaluator is supposed to do considering that the evaluator
	is not tied to a given DWARF version?

	There are more and more vendor and GNU extensions that are not part of
	the DWARF standard, so is it that impossible to expect that some of the
	extensions could actually lift the previously imposed restrictions of
	the CFI context? Not to mention that every new DWARF version is lifting
	some restrictions anyway.

	The thing that makes more sense for an evaluator to do, is to take the
	context of an evaluation and checks the requirements of every operation
	evaluated against that context. With this approach, the evaluator would
	report an error only if parts of the context, necessary for the
	evaluation, are missing.

	If this approach is taken, then the unification of the
	dwarf_evaluate_loc_desc, dwarf_expr_executor and dwarf_expr_context
	is the next logical step. This makes a design of the DWARF expression
	evaluator cleaner and allows more flexibility when supporting future
	vendor and GNU extensions.

	Additional benefit here is that now all evaluators have access to all
	location description types, which means that a vendor extended CFI
	rules could support composite location description as well. This also
	means that a new evaluator interface can be changed to return a single
	struct value (that describes the result of the evaluation) instead of
	a caller poking around the dwarf_expr_context internal data for answers
	(like it is done currently).

	This patch starts the merging process by moving the frame context
	information and support from dwarf_expr_executor and
	dwarf_evaluate_loc_desc to dwarf_expr_context evaluator. The idea
	is to report an error when a given operation requires a frame
	information to be resolved, if that information is not present.

	gdb/ChangeLog:

		* dwarf2/expr.c (ensure_have_frame): New function.
		(read_addr_from_reg): Add from frame.c.
		(dwarf_expr_context::dwarf_expr_context): Add frame info to
		dwarf_expr_context.
		(dwarf_expr_context::read_addr_from_reg): Remove.
		(dwarf_expr_context::get_reg_value): Move from
		dwarf_evaluate_loc_desc.
		(dwarf_expr_context::get_frame_base): Move from
		dwarf_evaluate_loc_desc.
		(dwarf_expr_context::execute_stack_op): Call frame context info
		check. Remove use of read_addr_from_reg method.
		* dwarf2/expr.h (struct dwarf_expr_context): Add frame info
		member, read_addr_from_reg, get_reg_value and get_frame_base
		declaration.
		(read_addr_from_reg): Move to expr.c.
		* dwarf2/frame.c (read_addr_from_reg): Move to
		dwarf_expr_context.
		(dwarf_expr_executor::read_addr_from_reg): Remove.
		(dwarf_expr_executor::get_frame_base): Remove.
		(dwarf_expr_executor::get_reg_value): Remove.
		(execute_stack_op): Use read_addr_from_reg function instead of
		read_addr_from_reg method.
		* dwarf2/loc.c (dwarf_evaluate_loc_desc::get_frame_base): Move
		to dwarf_expr_context.
		(dwarf_evaluate_loc_desc::get_reg_value): Move to
		dwarf_expr_context.
		(dwarf_evaluate_loc_desc::read_addr_from_reg): Remove.
		(dwarf2_locexpr_baton_eval):Use read_addr_from_reg function
		instead of read_addr_from_reg method.

2021-08-05  Zoran Zaric  <Zoran.Zaric@amd.com>

	Cleanup of the dwarf_expr_context constructor
	Move the initial values for dwarf_expr_context class data members
	to the class declaration in expr.h.

	gdb/ChangeLog:

	        * dwarf2/expr.c (dwarf_expr_context::dwarf_expr_context):
	        Remove initial data members values.
	        * dwarf2/expr.h (dwarf_expr_context): Add initial values
	        to the class data members.

2021-08-05  Zoran Zaric  <Zoran.Zaric@amd.com>

	Replace the symbol needs evaluator with a parser
	This patch addresses a design problem with the symbol_needs_eval_context
	class. It exposes the problem by introducing two new testsuite test
	cases.

	To explain the issue, I first need to explain the dwarf_expr_context
	class that the symbol_needs_eval_context class derives from.

	The intention behind the dwarf_expr_context class is to commonize the
	DWARF expression evaluation mechanism for different evaluation
	contexts. Currently in gdb, the evaluation context can contain some or
	all of the following information: architecture, object file, frame and
	compilation unit.

	Depending on the information needed to evaluate a given expression,
	there are currently three distinct DWARF expression evaluators:

	 - Frame: designed to evaluate an expression in the context of a call
	   frame information (dwarf_expr_executor class). This evaluator doesn't
	   need a compilation unit information.

	 - Location description: designed to evaluate an expression in the
	   context of a source level information (dwarf_evaluate_loc_desc
	   class). This evaluator expects all information needed for the
	   evaluation of the given expression to be present.

	 - Symbol needs: designed to answer a question about the parts of the
	   context information required to evaluate a DWARF expression behind a
	   given symbol (symbol_needs_eval_context class). This evaluator
	   doesn't need a frame information.

	The functional difference between the symbol needs evaluator and the
	others is that this evaluator is not meant to interact with the actual
	target. Instead, it is supposed to check which parts of the context
	information are needed for the given DWARF expression to be evaluated by
	the location description evaluator.

	The idea is to take advantage of the existing dwarf_expr_context
	evaluation mechanism and to fake all required interactions with the
	actual target, by returning back dummy values. The evaluation result is
	returned as one of three possible values, based on operations found in a
	given expression:

	- SYMBOL_NEEDS_NONE,
	- SYMBOL_NEEDS_REGISTERS and
	- SYMBOL_NEEDS_FRAME.

	The problem here is that faking results of target interactions can yield
	an incorrect evaluation result.

	For example, if we have a conditional DWARF expression, where the
	condition depends on a value read from an actual target, and the true
	branch of the condition requires a frame information to be evaluated,
	while the false branch doesn't, fake target reads could conclude that a
	frame information is not needed, where in fact it is. This wrong
	information would then cause the expression to be actually evaluated (by
	the location description evaluator) with a missing frame information.
	This would then crash the debugger.

	The gdb.dwarf2/symbol_needs_eval_fail.exp test introduces this
	scenario, with the following DWARF expression:

	                   DW_OP_addr $some_variable
	                   DW_OP_deref

	                   # conditional jump to DW_OP_bregx
	                   DW_OP_bra 4
	                   DW_OP_lit0

	                   # jump to DW_OP_stack_value
	                   DW_OP_skip 3
	                   DW_OP_bregx $dwarf_regnum 0
	                   DW_OP_stack_value

	This expression describes a case where some variable dictates the
	location of another variable. Depending on a value of some_variable, the
	variable whose location is described by this expression is either read
	from a register or it is defined as a constant value 0. In both cases,
	the value will be returned as an implicit location description on the
	DWARF stack.

	Currently, when the symbol needs evaluator fakes a memory read from the
	address behind the some_variable variable, the constant value 0 is used
	as the value of the variable A, and the check returns the
	SYMBOL_NEEDS_NONE result.

	This is clearly a wrong result and it causes the debugger to crash.

	The scenario might sound strange to some people, but it comes from a
	SIMD/SIMT architecture where $some_variable is an execution mask.  In
	any case, it is a valid DWARF expression, and GDB shouldn't crash while
	evaluating it. Also, a similar example could be made based on a
	condition of the frame base value, where if that value is concluded to
	be 0, the variable location could be defaulted to a TLS based memory
	address.

	The gdb.dwarf2/symbol_needs_eval_timeout.exp test introduces a second
	scenario. This scenario is a bit more abstract due to the DWARF
	assembler lacking the CFI support, but it exposes a different
	manifestation of the same problem. Like in the previous scenario, the
	DWARF expression used in the test is valid:

	                       DW_OP_lit1
	                       DW_OP_addr $some_variable
	                       DW_OP_deref

	                       # jump to DW_OP_fbreg
	                       DW_OP_skip 4
	                       DW_OP_drop
	                       DW_OP_fbreg 0
	                       DW_OP_dup
	                       DW_OP_lit0
	                       DW_OP_eq

	                       # conditional jump to DW_OP_drop
	                       DW_OP_bra -9
	                       DW_OP_stack_value

	Similarly to the previous scenario, the location of a variable A is an
	implicit location description with a constant value that depends on a
	value held by a global variable. The difference from the previous case
	is that DWARF expression contains a loop instead of just one branch. The
	end condition of that loop depends on the expectation that a frame base
	value is never zero. Currently, the act of faking the target reads will
	cause the symbol needs evaluator to get stuck in an infinite loop.

	Somebody could argue that we could change the fake reads to return
	something else, but that would only hide the real problem.

	The general impression seems to be that the desired design is to have
	one class that deals with parsing of the DWARF expression, while there
	are virtual methods that deal with specifics of some operations.

	Using an evaluator mechanism here doesn't seem to be correct, because
	the act of evaluation relies on accessing the data from the actual
	target with the possibility of skipping the evaluation of some parts of
	the expression.

	To better explain the proposed solution for the issue, I first need to
	explain a couple more details behind the current design:

	There are multiple places in gdb that handle DWARF expression parsing
	for different purposes. Some are in charge of converting the expression
	to some other internal representation (decode_location_expression,
	disassemble_dwarf_expression and dwarf2_compile_expr_to_ax), some are
	analysing the expression for specific information
	(compute_stack_depth_worker) and some are in charge of evaluating the
	expression in a given context (dwarf_expr_context::execute_stack_op
	and decode_locdesc).

	The problem is that all those functions have a similar (large) switch
	statement that handles each DWARF expression operation. The result of
	this is a code duplication and harder maintenance.

	As a step into the right direction to solve this problem (at least for
	the purpose of a DWARF expression evaluation) the expression parsing was
	commonized inside of an evaluator base class (dwarf_expr_context). This
	makes sense for all derived classes, except for the symbol needs
	evaluator (symbol_needs_eval_context) class.

	As described previously the problem with this evaluator is that if the
	evaluator is not allowed to access the actual target, it is not really
	evaluating.

	Instead, the desired function of a symbol needs evaluator seems to fall
	more into expression analysis category. This means that a more natural
	fit for this evaluator is to be a symbol needs analysis, similar to the
	existing compute_stack_depth_worker analysis.

	Another problem is that using a heavyweight mechanism of an evaluator
	to do an expression analysis seems to be an unneeded overhead. It also
	requires a more complicated design of the parent class to support fake
	target reads.

	The reality is that the whole symbol_needs_eval_context class can be
	replaced with a lightweight recursive analysis function, that will give
	more correct result without compromising the design of the
	dwarf_expr_context class. The analysis treats the expression byte
	stream as a DWARF operation graph, where each graph node can be
	visited only once and each operation can decide if the frame context
	is needed for their evaluation.

	The downside of this approach is adding of one more similar switch
	statement, but at least this way the new symbol needs analysis will be
	a lightweight mechnism and it will provide a correct result for any
	given DWARF expression.

	A more desired long term design would be to have one class that deals
	with parsing of the DWARF expression, while there would be a virtual
	methods that deal with specifics of some DWARF operations. Then that
	class would be used as a base for all DWARF expression parsing mentioned
	at the beginning.

	This however, requires a far bigger changes that are out of the scope
	of this patch series.

	The new analysis requires the DWARF location description for the
	argc argument of the main function to change in the assembly file
	gdb.python/amd64-py-framefilter-invalidarg.S. Originally, expression
	ended with a 0 value byte, which was never reached by the symbol needs
	evaluator, because it was detecting a stack underflow when evaluating
	the operation before. The new approach does not simulate a DWARF
	stack anymore, so the 0 value byte needs to be removed because it
	makes the DWARF expression invalid.

	gdb/ChangeLog:

	        * dwarf2/loc.c (class symbol_needs_eval_context): Remove.
	        (dwarf2_get_symbol_read_needs): New function.
	        (dwarf2_loc_desc_get_symbol_read_needs): Remove.
	        (locexpr_get_symbol_read_needs): Use
	        dwarf2_get_symbol_read_needs.

	gdb/testsuite/ChangeLog:

	        * gdb.python/amd64-py-framefilter-invalidarg.S : Update argc
	          DWARF location expression.
	        * lib/dwarf.exp (_location): Handle DW_OP_fbreg.
	        * gdb.dwarf2/symbol_needs_eval.c: New file.
	        * gdb.dwarf2/symbol_needs_eval_fail.exp: New file.
	        * gdb.dwarf2/symbol_needs_eval_timeout.exp: New file.

2021-08-05  Cui,Lili  <lili.cui@intel.com>

	[PATCH 2/2] Add tests for Intel AVX512_FP16 instructions
	Intel AVX512 FP16 instructions use maps 3, 5 and 6. Maps 5 and 6 use 3 bits
	in the EVEX.mmm field (0b101, 0b110). Map 5 is for instructions that were FP32
	in map 1 (0Fxx). Map 6 is for instructions that were FP32 in map 2 (0F38xx).
	There are some exceptions to this rule. Some things in map 1 (0Fxx) with imm8
	operands predated our current conventions; those instructions moved to map 3.
	FP32 things in map 3 (0F3Axx) found new opcodes in map3 for FP16 because map3
	is very sparsely populated. Most of the FP16 instructions share opcodes and
	prefix (EVEX.pp) bits with the related FP32 operations.

	Intel AVX512 FP16 instructions has new displacements scaling rules, please refer
	to the public software developer manual for detail information.

	gas/

	2021-08-05  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
	            H.J. Lu  <hongjiu.lu@intel.com>
	            Wei Xiao <wei3.xiao@intel.com>
	            Lili Cui  <lili.cui@intel.com>

		* testsuite/gas/i386/i386.exp: Run FP16 tests.
		* testsuite/gas/i386/avx512_fp16-intel.d: New test.
		* testsuite/gas/i386/avx512_fp16-inval-bcast.l: Ditto.
		* testsuite/gas/i386/avx512_fp16-inval-bcast.s: Ditto.
		* testsuite/gas/i386/avx512_fp16.d: Ditto.
		* testsuite/gas/i386/avx512_fp16.s: Ditto.
		* testsuite/gas/i386/avx512_fp16_pseudo_ops.d: Ditto.
		* testsuite/gas/i386/avx512_fp16_pseudo_ops.s: Ditto.
		* testsuite/gas/i386/avx512_fp16_vl-intel.d: Ditto.
		* testsuite/gas/i386/avx512_fp16_vl.d: Ditto.
		* testsuite/gas/i386/avx512_fp16_vl.s: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16-intel.d: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16-inval-bcast.l: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16-inval-bcast.s: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16.d: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16.s: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16_pseudo_ops.d: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16_pseudo_ops.s: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16_vl-intel.d: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16_vl.d: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16_vl.s: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16-inval-register.l: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16-inval-register.s: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16-bad.d: Ditto.
		* testsuite/gas/i386/x86-64-avx512_fp16-bad.s: Ditto.
		* testsuite/gas/i386/x86-64-default-suffix-avx.d: Add new testcase.
		* testsuite/gas/i386/x86-64-default-suffix.d: Ditto.
		* testsuite/gas/i386/x86-64-default-suffix.s: Ditto.
		* testsuite/gas/i386/xmmword.l: Ditto.
		* testsuite/gas/i386/xmmword.s: Ditto.

2021-08-05  Cui,Lili  <lili.cui@intel.com>

	[PATCH 1/2] Enable Intel AVX512_FP16 instructions
	Intel AVX512 FP16 instructions use maps 3, 5 and 6. Maps 5 and 6 use 3 bits
	in the EVEX.mmm field (0b101, 0b110). Map 5 is for instructions that were FP32
	in map 1 (0Fxx). Map 6 is for instructions that were FP32 in map 2 (0F38xx).
	There are some exceptions to this rule. Some things in map 1 (0Fxx) with imm8
	operands predated our current conventions; those instructions moved to map 3.
	FP32 things in map 3 (0F3Axx) found new opcodes in map3 for FP16 because map3
	is very sparsely populated. Most of the FP16 instructions share opcodes and
	prefix (EVEX.pp) bits with the related FP32 operations.

	Intel AVX512 FP16 instructions has new displacements scaling rules, please refer
	to the public software developer manual for detail information.

	gas/

	2021-08-05  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
	            H.J. Lu  <hongjiu.lu@intel.com>
	            Wei Xiao <wei3.xiao@intel.com>
	            Lili Cui  <lili.cui@intel.com>

		* config/tc-i386.c (struct Broadcast_Operation): Adjust comment.
		(cpu_arch): Add .avx512_fp16.
		(cpu_noarch): Add noavx512_fp16.
		(pte): Add evexmap5 and evexmap6.
		(build_evex_prefix): Handle EVEXMAP5 and EVEXMAP6.
		(check_VecOperations): Handle {1to32}.
		(check_VecOperands): Handle CheckRegNumb.
		(check_word_reg): Handle Toqword.
		(i386_error): Add invalid_dest_and_src_register_set.
		(match_template): Handle invalid_dest_and_src_register_set.
		* doc/c-i386.texi: Document avx512_fp16, noavx512_fp16.

	opcodes/

	2021-08-05  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
	            H.J. Lu  <hongjiu.lu@intel.com>
	            Wei Xiao <wei3.xiao@intel.com>
	            Lili Cui  <lili.cui@intel.com>

		* i386-dis.c (EXwScalarS): New.
		(EXxh): Ditto.
		(EXxhc): Ditto.
		(EXxmmqh): Ditto.
		(EXxmmqdh): Ditto.
		(EXEvexXwb): Ditto.
		(DistinctDest_Fixup): Ditto.
		(enum): Add xh_mode, evex_half_bcst_xmmqh_mode, evex_half_bcst_xmmqdh_mode
		and w_swap_mode.
		(enum): Add PREFIX_EVEX_0F3A08_W_0, PREFIX_EVEX_0F3A0A_W_0,
		PREFIX_EVEX_0F3A26, PREFIX_EVEX_0F3A27, PREFIX_EVEX_0F3A56,
		PREFIX_EVEX_0F3A57, PREFIX_EVEX_0F3A66, PREFIX_EVEX_0F3A67,
		PREFIX_EVEX_0F3AC2, PREFIX_EVEX_MAP5_10, PREFIX_EVEX_MAP5_11,
		PREFIX_EVEX_MAP5_1D, PREFIX_EVEX_MAP5_2A, PREFIX_EVEX_MAP5_2C,
		PREFIX_EVEX_MAP5_2D, PREFIX_EVEX_MAP5_2E, PREFIX_EVEX_MAP5_2F,
		PREFIX_EVEX_MAP5_51, PREFIX_EVEX_MAP5_58, PREFIX_EVEX_MAP5_59,
		PREFIX_EVEX_MAP5_5A_W_0, PREFIX_EVEX_MAP5_5A_W_1,
		PREFIX_EVEX_MAP5_5B_W_0, PREFIX_EVEX_MAP5_5B_W_1,
		PREFIX_EVEX_MAP5_5C, PREFIX_EVEX_MAP5_5D, PREFIX_EVEX_MAP5_5E,
		PREFIX_EVEX_MAP5_5F, PREFIX_EVEX_MAP5_78, PREFIX_EVEX_MAP5_79,
		PREFIX_EVEX_MAP5_7A, PREFIX_EVEX_MAP5_7B, PREFIX_EVEX_MAP5_7C,
		PREFIX_EVEX_MAP5_7D_W_0, PREFIX_EVEX_MAP6_13, PREFIX_EVEX_MAP6_56,
		PREFIX_EVEX_MAP6_57, PREFIX_EVEX_MAP6_D6, PREFIX_EVEX_MAP6_D7
		(enum): Add EVEX_MAP5 and EVEX_MAP6.
		(enum): Add EVEX_W_MAP5_5A, EVEX_W_MAP5_5B,
		EVEX_W_MAP5_78_P_0, EVEX_W_MAP5_78_P_2, EVEX_W_MAP5_79_P_0,
		EVEX_W_MAP5_79_P_2, EVEX_W_MAP5_7A_P_2, EVEX_W_MAP5_7A_P_3,
		EVEX_W_MAP5_7B_P_2, EVEX_W_MAP5_7C_P_0, EVEX_W_MAP5_7C_P_2,
		EVEX_W_MAP5_7D, EVEX_W_MAP6_13_P_0, EVEX_W_MAP6_13_P_2,
		(get_valid_dis386): Properly handle new instructions.
		(intel_operand_size): Handle new modes.
		(OP_E_memory): Ditto.
		(OP_EX): Ditto.
		* i386-dis-evex.h: Updated for AVX512_FP16.
		* i386-dis-evex-mod.h: Updated for AVX512_FP16.
		* i386-dis-evex-prefix.h: Updated for AVX512_FP16.
		* i386-dis-evex-reg.h : Updated for AVX512_FP16.
		* i386-dis-evex-w.h : Updated for AVX512_FP16.
		* i386-gen.c (cpu_flag_init): Add CPU_AVX512_FP16_FLAGS,
		and CPU_ANY_AVX512_FP16_FLAGS. Update CPU_ANY_AVX512F_FLAGS
		and CPU_ANY_AVX512BW_FLAGS.
		(cpu_flags): Add CpuAVX512_FP16.
		(opcode_modifiers): Add DistinctDest.
		* i386-opc.h (enum): (AVX512_FP16): New.
		(i386_opcode_modifier): Add reqdistinctreg.
		(i386_cpu_flags): Add cpuavx512_fp16.
		(EVEXMAP5): Defined as a macro.
		(EVEXMAP6): Ditto.
		* i386-opc.tbl: Add Intel AVX512_FP16 instructions.
		* i386-init.h: Regenerated.
		* i386-tbl.h: Ditto.

2021-08-05  Alan Modra  <amodra@gmail.com>

	PR28167, vms-alpha build_module_list
		PR 28167
		* vms-alpha.c (build_module_list): Malloc and free section contents.
		Don't read past end of section.

2021-08-05  Alan Modra  <amodra@gmail.com>

	PR28166, _bfd_elf_mips_get_relocated_section_contents
	Some of the code paths unpacking mips relocs left arelent->sym_ptr_ptr
	uninitialised.

		PR 28166
		* elf64-mips.c (mips_elf64_slurp_one_reloc_table): Don't leave
		sym_ptr_ptr uninitialised.

2021-08-05  Alan Modra  <amodra@gmail.com>

	PR28165, buffer overflow in elf32-rx.c:rx_info_to_howto_rela
		PR 28165
		* elf32-rx.c (rx_elf_howto_table): Add missing empty entries.
		(rx_info_to_howto_rela): Assert rx_elf_howto_table is correct size.
		Use actual size when sanity checking r_type.

2021-08-05  Alan Modra  <amodra@gmail.com>

	Re: elf: Treat undefined version as hidden
	Fix fallout in cris testsuite

		PR binutils/28158
		* ld-cris/libdso-1c.d: Update for version display change.
		* ld-cris/libdso-15b.d: Likewise.

2021-08-05  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/testsuite: update test gdb.base/step-over-syscall.exp
	I was looking at PR gdb/19675 and the related test
	gdb.base/step-over-syscall.exp.  This test includes a call to kfail
	when we are testing a displaced step over a clone syscall.

	While looking at the test I removed the call to kfail and ran the
	test, and was surprised that the test passed.

	I ran the test a few times and it does sometimes fail, but mostly it
	passed fine.

	PR gdb/19675 describes how, when we displaced step over a clone, the
	new thread is created with a $pc in the displaced step buffer.  GDB
	then fails to "fix" this $pc (for the new thread), and the thread will
	be set running with its current $pc value.  This means that the new
	thread will just start executing from whatever happens to be after the
	displaced stepping buffer.

	In the original PR gdb/19675 bug report Yao Qi was seeing the new
	thread cause a segfault, the problem is, what actually happens is
	totally undefined.

	On my machine, I'm seeing the new thread reenter main, it then starts
	trying to run the test again (in the new thread).  This just happens
	to be safe enough (in this simple test) that most of the time the
	inferior doesn't crash.

	In this commit I try to make the test slightly more likely to fail by
	doing a couple of things.

	First, I added a static variable to main, this is set true when the
	first thread enters main, if a second thread ever enters main then I
	force an abort.

	Second, when the test is finishing I want to ensure that the new
	threads have had a chance to do "something bad" if they are going to.
	So I added a global counter, as each thread starts successfully it
	decrements the counter.  The main thread does not proceed to the final
	marker function (where GDB has placed a breakpoint) until all threads
	have started successfully.  This means that if the newly created
	thread doesn't successfully enter clone_fn then the counter will never
	reach zero and the test will timeout.

	With these two changes my hope is that the test should fail more
	reliably, and so, I have also changed the test to call setup_kfail
	before the specific steps that we expect to misbehave instead of just
	calling kfail and skipping parts of the test completely.  The benefit
	of this is that if/when we fix GDB this test will start to KPASS and
	we'll know to update this test to remove the setup_kfail call.

2021-08-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-05  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: Use unwinder name in frame_info::to_string
	While working on a stack unwinding issue using 'set debug frame on', I
	noticed the frame_info::to_string method could be slightly improved.

	Unwinders have been given a name in
	a154d838a70e96d888620c072e2d6ea8bdf044ca.  Before this patch, frame_info
	debug output prints the host address of the used unwinder, which is not
	easy to interpret.  This patch proposes to use the unwinder name
	instead since we now have it.

	Before the patch:

	    {level=1,type=NORMAL_FRAME,unwind=0x2ac1763ec0,pc=0x3ff7fc3460,id={stack=0x3ff7ea79b0,code=0x0000003ff7fc33ac,!special},func=0x3ff7fc33ac}

	With the patch:

	    {level=1,type=NORMAL_FRAME,unwinder="riscv prologue",pc=0x3ff7fc3460,id={stack=0x3ff7ea79b0,code=0x0000003ff7fc33ac,!special},func=0x3ff7fc33ac}

	Tested on riscv64-linux-gnu.

2021-08-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: fix gdb.base/info-macros.exp with clang
	The test gdb.base/info-macros.exp says that it doesn't pass the "debug"
	option to prepare_for_testing because that would cause -g to appear
	after -g3 on the command line, and that would cause some gcc versions to
	not include macro info.  I don't know what gcc versions this refers to.
	I tested with gcc 4.8, and that works fine with -g after -g3.

	The current state is problematic when testing with CC_FOR_TARGET=clang,
	because then only -fdebug-macro is included.  No -g switch if included,
	meaning we get a binary without any debug info, and the test fails.

	One way to fix it would be to add "debug" to the options when the
	compiler is clang.

	However, the solution I chose was to specify "debug" in any case, even
	for gcc.  Other macro tests such as gdb.base/macscp.exp do perfectly
	fine with it.  Also, this lets the test use the debug flag specified by
	the board file.  For example, we can test with GCC and DWARF 5, with:

	    $ make check RUNTESTFLAGS="--target_board unix/gdb:debug_flags=-gdwarf-5" TESTS="gdb.base/info-macros.exp"

	With the hard-coded -g3, this wouldn't actually test with DWARF 5.

	Change-Id: I33fa92ee545007d3ae9c52c4bb2d5be6b5b698f1

2021-08-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: avoid dereferencing empty str_offsets_base optional in dwarf_decode_macros
	Since 4d7188abfdf2 ("gdbsupport: add debug assertions in
	gdb::optional::get"), some macro-related tests fail on Ubuntu 20.04 with
	the system gcc 9.3.0 compiler when building with _GLIBCXX_DEBUG.  For
	example, gdb.base/info-macros.exp results in:

	   (gdb) break -qualified main
	   /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/gdb_optional.h:206: internal-error: T& gdb::optional<T>::get() [with T = long unsigned int]: Assertion `this->has_value ()' failed.

	The binary contains DWARF 4 debug info and includes a pre-standard
	(pre-DWARF 5) .debug_macro section.  The CU doesn't have a
	DW_AT_str_offsets_base attribute (which doesn't exist in DWARF 4).  The
	field dwarf2_cu::str_offsets_base is therefore empty.  At
	dwarf2/read.c:24138, we unconditionally read the value in the optional,
	which triggers the assertion shown above.

	The same thing happens when building the test program with DWARF 5 with
	the same gcc compiler, as that version of gcc doesn't use indirect
	string forms, even with DWARF 5.  So it still doesn't add a
	DW_AT_str_offsets_base attribute on the CU.

	Fix that by propagating down a gdb::optional<ULONGEST> for the str
	offsets base instead of ULONGEST.  That value is only used in
	dwarf_decode_macro_bytes, when encountering an "strx" macro operation
	(DW_MACRO_define_strx or DW_MACRO_undef_strx).  Add a check there that
	we indeed have a value in the optional before reading it.  This is
	unlikely to happen, but could happen in theory with an erroneous file
	that uses DW_MACRO_define_strx but does not provide a
	DW_AT_str_offsets_base (in practice, some things would probably have
	failed before and stopped processing of debug info).  I tested the
	complaint by inverting the condition and using a clang-compiled binary,
	which uses the strx operators.  This is the result:

	    During symbol reading: use of DW_MACRO_define_strx with unknown string offsets base [in module /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/info-macros/info-macros]

	The test now passes cleanly with the setup mentioned above, and the
	testsuite looks on par with how it was before 4d7188abfdf2.

	Change-Id: I7ebd2724beb7b9b4178872374c2a177aea696e77

2021-08-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix typo in complaint in dwarf2/macro.c
	I saw this complaint when my code had some bug, and spotted the typo.
	Fix it, and while at it mention DW_MACRO as well (it would be confusing
	to only see DW_MACINFO with a file that uses a DWARF 5 .debug_macro
	section).  I contemplated the idea of passing the knowledge of whether
	we are dealing with a .debug_macro section or .debug_macinfo section, to
	print only the right one.  But in the end, I don't think that trouble is
	necessary for a complaint nobody is going to see.

	Change-Id: I276ce8da65c3eac5304f64a1e246358ed29cdbbc

2021-08-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix warnings in bsd-kvm.c
	Building on OpenBSD, I get warnings like:

	      CXX    bsd-kvm.o
	    /home/simark/src/binutils-gdb/gdb/bsd-kvm.c:241:18: error: ISO C++11 does not allow conversion from string literal to 'char *' [-Werror,-Wwritable-strings]
	      nl[0].n_name = "_dumppcb";
	                     ^

	Silence those by adding casts.

	Change-Id: I2bef4eebcc306762a4e3e5b5c52f67ecf2820503

2021-08-04  Andreas Krebbel  <krebbel@linux.ibm.com>

	IBM Z: Remove lpswey parameter
	opcodes/
		* s390-opc.c (INSTR_SIY_RD): New instruction format.
		(MASK_SIY_RD): New instruction mask.
		* s390-opc.txt: Change instruction format of lpswey to SIY_RD.

	gas/
		* testsuite/gas/s390/zarch-arch14.d: Remove last operand of
		lpswey.
		* testsuite/gas/s390/zarch-arch14.s: Likewise.

2021-08-04  Alan Modra  <amodra@gmail.com>

	PR28162, segment fault in mips_elf_assign_gp
	For the testcase in the PR, _bfd_mips_elf32_gprel16_reloc is passed a
	NULL output_bfd.  As expected for reloc special functions if called by
	objdump or when final linking.  The function attempts to find the
	output by
	  output_bfd = symbol->section->output_section->owner;
	That makes some sense, since when handling a gp-relative reloc we need
	the relevant gp to which the symbol is relative.  Possibly the gp
	value can be one for a shared library?  But that doesn't seem useful
	or supported by the various abi docs and won't work as written.
	Symbols defined in shared libraries have section->output_section
	NULL, and what's more the code in mips_elf_assign_gp isn't set up to
	look at shared library symbols.

	Also, if the symbol is a SHN_ABS one the owner of *ABS* section is
	NULL, which will result in the testcase segfault.  The only gp to
	which an absolute symbol can be relative is the linker output bfd when
	linking, or the input bfd when not.  This patch arranges to do that
	for all gp-relative reloc symbols.

		* elf32-mips.c (_bfd_mips_elf32_gprel16_reloc): Don't use the
		section symbol to find the output bfd, use input_section.
		(mips_elf_gprel32_reloc, mips16_gprel_reloc): Likewise.
		* elf64-mips.c (mips_elf64_gprel16_reloc): Likewise.
		(mips_elf64_literal_reloc, mips_elf64_gprel32_reloc): Likewise.
		(mips16_gprel_reloc): Likewise.

2021-08-04  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Use lambda function instead of addrmap_foreach_check
	Use a lambda function instead of addrmap_foreach_check,
	which removes the need for static variables.

	Also remove unnecessary static on local var temp_obstack in test_addrmap.

	gdb/ChangeLog:

	2021-08-04  Tom de Vries  <tdevries@suse.de>

		* addrmap.c (addrmap_foreach_check): Remove.
		(array, val1, val2): Move ...
		(test_addrmap): ... here.  Remove static on temp_obstack.  Use lambda
		function instead of addrmap_foreach_check.

2021-08-04  H.J. Lu  <hjl.tools@gmail.com>

	elf: Treat undefined version as hidden
	Since undefined version can't be used to resolve any references without
	the original definition, treat it as hidden.

	bfd/

		PR binutils/28158
		* elf.c (_bfd_elf_get_symbol_version_string): Treat undefined
		version as hidden.

	ld/

		PR binutils/28158
		* testsuite/ld-elf/linux-x86.exp: Run PR binutils/28158 tests.
		* testsuite/ld-elf/pr28158-1.c: New file.
		* testsuite/ld-elf/pr28158-2.S: Likewise.
		* testsuite/ld-elf/pr28158.nd: Likewise.
		* testsuite/ld-elf/pr28158.rd: Likewise.
		* testsuite/ld-elf/pr28158.t: Likewise.
		* testsuite/ld-elfvers/vers2.dsym: Updated.
		* testsuite/ld-elfvers/vers3.dsym: Likewise.
		* testsuite/ld-elfvers/vers6.dsym: Likewise.
		* testsuite/ld-elfvers/vers19.dsym: Likewise.
		* testsuite/ld-elfvers/vers22.dsym: Likewise.
		* testsuite/ld-elfvers/vers23.dsym: Likewise.
		* testsuite/ld-elfvers/vers23d.dsym: Likewise.
		* testsuite/ld-elfvers/vers27d4.dsym: Likewise.
		* testsuite/ld-elfvers/vers28c.dsym: Likewise.

2021-08-04  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Implement addrmap_mutable_find
	Currently addrmap_mutable_find is not implemented:
	...
	static void *
	addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
	{
	  /* Not needed yet.  */
	  internal_error (__FILE__, __LINE__,
	                  _("addrmap_find is not implemented yet "
	                    "for mutable addrmaps"));
	}
	...

	I implemented this because I needed it during debugging, to be able to do:
	...
	(gdb) p ((dwarf2_psymtab *)addrmap_find (map, addr))->filename
	...
	before and after a call to addrmap_set_empty.

	Since this is not used otherwise, added addrmap unit test.

	Build on x86_64-linux, tested by doing:
	...
	$ gdb -q -batch -ex "maint selftest addrmap"
	Running selftest addrmap.
	Ran 1 unit tests, 0 failed
	...

	gdb/ChangeLog:

	2021-08-03  Tom de Vries  <tdevries@suse.de>

	        * gdb/addrmap.c (addrmap_mutable_find): Implement
	        [GDB_SELF_TESTS] (CHECK_ADDRMAP_FIND): New macro.
	        [GDB_SELF_TESTS] (core_addr, addrmap_foreach_check, test_addrmap)
		(_initialize_addrmap): New function.

2021-08-04  Clément Chigot  <clement.chigot@atos.net>

	gas: correctly output XCOFF tbss symbols with XTY_CM type.
	Global tbss symbols weren't correctly handled and were generating
	a symbol with XTY_SD instead of XTY_CM as expected.

	gas/
		* config/tc-ppc.c (ppc_frog_symbol): Generate a XTY_CM when
		a symbol has a storage class of XMC_UL.

2021-08-04  Clément Chigot  <clement.chigot@atos.net>

	gas: always add dummy symbols when creating XCOFF sections.
	Most of the algorithms for XCOFF in tc-ppc.c assume that
	the csects field of a ppc_xcoff_section isn't NULL.
	This was already made for most of the sections with the creation
	of a dummy symbol.
	This patch simply mades it default when creating a xcoff_section.

	gas/
		* config/tc-ppc.c (ppc_init_xcoff_section): Always create
		the dummy symbol.
		(md_begin): Adjust ppc_init_xcoff_section call.
		(ppc_comm): Likewise.
		(ppc_change_csect): Likewise.

2021-08-04  Alan Modra  <amodra@gmail.com>

	PR28156, rename.c doesn't compile with MinGW
	Guard against lack of struct timespec definition.

		PR 28156
		* rename.c (get_stat_atime, get_stat_mtime): Don't compile
		unless HAVE_UTIMENSAT is defined.

2021-08-04  Alan Modra  <amodra@gmail.com>

	PR28155, Superfluous "the" in the man page
		PR 28155
		* ld.texi (Options <runtime library name>): Correct grammar.

	revise PE IMAGE_SCN_LNK_NRELOC_OVFL test
		* coffcode.h (coff_set_alignment_hook): Test that the resulting
		reloc count is not less than 0xffff.

2021-08-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: follow-fork: push target and add thread in target_follow_fork
	In the context of ROCm-gdb [1], the ROCm target sits on top of the
	linux-nat target.  when a process forks, it needs to carry over some
	data from the forking inferior to the fork child inferior.  Ideally, the
	ROCm target would implement the follow_fork target_ops method, but there
	are some small problems.  This patch fixes these, which helps the ROCm
	target, but also makes things more consistent and a bit nicer in
	general, I believe.

	The main problem is: when follow-fork-mode is "parent",
	target_follow_fork is called with the parent as the current inferior.
	When it's "child", target_follow_fork is called with the child as the
	current inferior.  This means that target_follow_fork is sometimes
	called on the parent's target stack and sometimes on the child's target
	stack.

	The parent's target stack may contain targets above the process target,
	such as the ROCm target.  So if follow-fork-child is "parent", the ROCm
	target would get notified of the fork and do whatever is needed.  But
	the child's target stack, at that moment, only contains the exec and
	process target copied over from the parent.  The child's target stack is
	set up by follow_fork_inferior, before calling target_follow_fork.  In
	that case, the ROCm target wouldn't get notified of the fork.

	For consistency, I think it would be good to always call
	target_follow_fork on the parent inferior's target stack.  I think it
	makes sense as a way to indicate "this inferior has called fork, do
	whatever is needed".  The desired outcome of the fork (whether an
	inferior is created for the child, do we need to detach from the child)
	can be indicated by passed parameter.

	I therefore propose these changes:

	 - make follow_fork_inferior always call target_follow_fork with the
	   parent as the current inferior.  That lets all targets present on the
	   parent's target stack do some fork-related handling and push
	   themselves on the fork child's target stack if needed.

	   For this purpose, pass the child inferior down to target_follow_fork
	   and follow_fork implementations.  This is nullptr if no inferior is
	   created for the child, because we want to detach from it.

	 - as a result, in follow_fork_inferior, detach from the parent inferior
	   (if needed) only after the target_follow_fork call.  This is needed
	   because we want to call target_follow_fork before the parent's
	   target stack is torn down.

	 - hand over to the targets in the parent's target stack (including the
	   process target) the responsibility to push themselves, if needed, to
	   the child's target stack.  Also hand over the responsibility to the
	   process target, at the same time, to create the child's initial
	   thread (just like we do for follow_exec).

	 - pass the child inferior to exec_on_vfork, so we don't need to swap
	   the current inferior between parent and child.  Nothing in
	   exec_on_vfork depends on the current inferior, after this change.

	   Although this could perhaps be replaced with just having the exec
	   target implement follow_fork and push itself in the child's target
	   stack, like the process target does... We would just need to make
	   sure the process target calls beneath()->follow_fork(...).  I'm not
	   sure about this one.

	gdb/ChangeLog:

		* target.h (struct target_ops) <follow_fork>: Add inferior*
		parameter.
		(target_follow_fork): Likewise.
		* target.c (default_follow_fork): Likewise.
		(target_follow_fork): Likewise.
		* fbsd-nat.h (class fbsd_nat_target) <follow_fork>: Likewise.
		(fbsd_nat_target::follow_fork): Likewise, and call
		inf_ptrace_target::follow_fork.
		* linux-nat.h (class linux_nat_target) <follow_fork>: Likewise.
		* linux-nat.c (linux_nat_target::follow_fork): Likewise, and
		call inf_ptrace_target::follow_fork.
		* obsd-nat.h (obsd_nat_target) <follow_fork>: Likewise.
		* obsd-nat.c (obsd_nat_target::follow_fork): Likewise, and call
		inf_ptrace_target::follow_fork.
		* remote.c (class remote_target) <follow_fork>: Likewise.
		(remote_target::follow_fork): Likewise, and call
		process_stratum_target::follow_fork.
		* process-stratum-target.h (class process_stratum_target)
		<follow_fork>: New.
		* process-stratum-target.c
		(process_stratum_target::follow_fork): New.
		* target-delegates.c: Re-generate.

	[1] https://github.com/ROCm-Developer-Tools/ROCgdb

	Change-Id: I460bd0af850f0485e8aed4b24c6d8262a4c69929

2021-08-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-03  Carl Love  <cel@us.ibm.com>

	Fixes for mi-fortran-modules.exp fixes
	Output has additional information for a given filename.

	gdb/testsuite/ChangeLog
		* gdb.mi/mi-fortran-modules.exp (system_modules_pattern,
		system_module_symbols_pattern): Add check for additional symbols
		on the line

2021-08-03  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport: add debug assertions in gdb::optional::get
	The libstdc++ version of optional contains some runtime checks enabled
	when _GLIBCXX_DEBUG is defined.  I think it would be useful if our
	version contained similar checks.

	Add checks in the two `get` methods, also conditional on _GLIBCXX_DEBUG.
	I think it's simpler to use that macro rather than introducing a new
	GDB-specific one, as I think that if somebody is interested in enabling
	these runtime checks, they'll also be interested in enabling the
	libstdc++ runtime checks (and vice-versa).

	I implemented these checks using gdb_assert.  Note that gdb_assert
	throws (after querying the user), and we are in noexcept methods.  That
	means that std::terminate / abort will immediately be called.  I think
	this is ok, since if those were "real" _GLIBCXX_DEBUG checks, abort
	would be called straight away.

	If I add a dummy failure, it looks like so:

	    $ ./gdb -q -nx --data-directory=data-directory
	    /home/simark/src/binutils-gdb/gdb/../gdbsupport/gdb_optional.h:206: internal-error: T& gdb::optional<T>::get() [with T = int]: Assertion `this->has_value ()' failed.
	    A problem internal to GDB has been detected,
	    further debugging may prove unreliable.
	    Quit this debugging session? (y or n) n
	    [1]    658767 abort (core dumped)  ./gdb -q -nx --data-directory=data-directory

	Change-Id: Iadfdcd131425bd2ca6a2de30d7b22e9b3cc67793

2021-08-03  Alok Kumar Sharma  <AlokKumar.Sharma@amd.com>

	[gdb/testsuite] templates.exp to accept clang++ output
	Please consider below testcase with intended error.
	``````````
	    constexpr const char cstring[] = "Eta";
	    template <const char*, typename T> class Column {};
	    using quick = Column<cstring,double>; // cstring without '&'

	    void lookup() {
	      quick c1;
	      c1.ls();
	    }
	``````````
	It produces below error.
	``````````
	no member named 'ls' in 'Column<&cstring, double>'.
	``````````
	Please note that error message contains '&' for cstring, which is absent
	in actual program.
	Clang++ does not generate & in such cases and this should also be
	accepted as correct output.

	gdb/testsuite/ChangeLog:

		* gdb.cp/templates.exp: Accept different but correct output
		from the Clang++ compiled binary also.

2021-08-03  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-02  Tom Tromey  <tromey@adacore.com>

	Handle compiler-generated suffixes in Ada names
	The compiler may add a suffix to a mangled name.  A typical example
	would be splitting a function and creating a ".cold" variant.

	This patch changes Ada decoding (aka demangling) to handle these
	suffixes.  It also changes the encoding process to handle them as
	well.

	A symbol like "function.cold" will now be displayed to the user as
	"function[cold]".  The "." is not simply preserved because that is
	already used in Ada.

2021-08-02  Tom Tromey  <tromey@adacore.com>

	Remove uses of fprintf_symbol_filtered
	I believe that many calls to fprintf_symbol_filtered are incorrect.
	In particular, there are some that pass a symbol's print name, like:

	  fprintf_symbol_filtered (gdb_stdout, sym->print_name (),
				   current_language->la_language, DMGL_ANSI);

	fprintf_symbol_filtered uses the "demangle" global to decide whether
	or not to demangle -- but print_name does this as well.  This can lead
	to double-demangling.  Normally this could be innocuous, except I also
	plan to change Ada demangling in a way that causes this to fail.

2021-08-02  Tom Tromey  <tromey@adacore.com>

	Handle type qualifier for enumeration name
	Pierre-Marie noticed that the Ada expression "TYPE'(NAME)" resolved
	incorrectly when "TYPE" was an enumeration type.  Here, "NAME" should
	be unambiguous.

	This patch fixes this problem.  Note that the patch is not perfect --
	it does not give an error if TYPE is an enumeration type but NAME is
	not an enumerator but does have some other meaning in scope.  Fixing
	this proved difficult, and so I've left it out.

2021-08-02  Tom Tromey  <tromey@adacore.com>

	Remove the type_qualifier global
	The type_qualifier global is no longer needed in the Ada expression
	parser, so this removes it.

2021-08-02  Tom Tromey  <tromey@adacore.com>

	Defer Ada character literal resolution
	In Ada, an enumeration type can use a character literal as one of the
	enumerators.  The Ada expression parser handles the appropriate
	conversion.

	It turns out, though, that this conversion was handled incorrectly.
	For an expression like TYPE'(EXP), the conversion would be done for
	any such literal appearing in EXP -- but only the outermost such
	expression should really be affected.

	This patch defers the conversion until the resolution phase, fixing
	the bug.

2021-08-02  Tom Tromey  <tromey@adacore.com>

	Refactor Ada resolution
	In a subsequent patch, it will be convenient if an Ada expression
	operation can supply its own replacement object.  This patch refactors
	Ada expression resolution to make this possible.

	Remove add_symbols_from_enclosing_procs
	I noticed that add_symbols_from_enclosing_procs is empty, and can be
	removed.  The one caller, ada_add_local_symbols, can also be
	simplified, removing some code that, I think, was an incorrect attempt
	to handle nested functions.

2021-08-02  Tom Tromey  <tromey@adacore.com>

	Avoid crash in varobj deletion
	PR varobj/28131 points out a crash in the varobj deletion code.  It
	took a while to reproduce this, but essentially what happens is that a
	top-level varobj deletes its root object, then deletes the "dynamic"
	object.  However, deletion of the dynamic object may cause
	~py_varobj_iter to run, which in turn uses gdbpy_enter_varobj:

	gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
	: gdbpy_enter (var->root->exp->gdbarch, var->root->exp->language_defn)
	{
	}

	However, because var->root has already been destroyed, this is
	invalid.

	I've added a new test case.  This doesn't reliably crash, but the
	problem can easily be seen under valgrind (and, I presume, with ASAN,
	though I did not try this).

	Tested on x86-64 Fedora 32.  I also propose putting this on the GDB 11
	branch, with a suitable ChangeLog entry of course.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28131

2021-08-02  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.dwarf2/dw2-using-debug-str.exp with cc-with-dwz-m
	When running with target board cc-with-dwz-m, we run into:
	...
	(gdb) file dw2-using-debug-str-no-debug-str^M
	Reading symbols from dw2-using-debug-str-no-debug-str...^M
	(gdb) FAIL: gdb.dwarf2/dw2-using-debug-str.exp: file dw2-using-debug-str
	...

	With native, the .debug_str section is present in the
	dw2-using-debug-str executable, and removed from the
	dw2-using-debug-str-no-debug-str executable.  When loading the latter, a dwarf
	error is triggered.

	With cc-with-dwz-m, the .debug_str section is not present in the
	dw2-using-debug-str executable, because it's already moved to
	.tmp/dw2-using-debug-str.dwz.  Consequently, the removal has no effect, and no
	dwarf error is triggered, which causes the FAIL.

	The same problem arises with target board cc-with-gnu-debuglink.

	Fix this by detecting whether the .debug_str section is missing, and skipping
	the remainder of the test-case.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-02  Tom de Vries  <tdevries@suse.de>

		* gdb.dwarf2/dw2-using-debug-str.exp: Handle missing .debug_str
		section in dw2-using-debug-str.

2021-08-02  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.dwarf2/dw2-using-debug-str.exp with cc-with-gdb-index
	When running with target board cc-with-gdb-index, we run into:
	...
	(gdb) file dw2-using-debug-str-no-debug-str^M
	Reading symbols from dw2-using-debug-str-no-debug-str...^M
	Dwarf Error: DW_FORM_strp used without required section^M
	(gdb) FAIL: gdb.dwarf2/dw2-using-debug-str.exp: file dw2-using-debug-str
	...

	The test expects the dwarf error, but has no matching pattern for the entire
	output.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-02  Tom de Vries  <tdevries@suse.de>

		* gdb.dwarf2/dw2-using-debug-str.exp: Update regexp to match
		cc-with-gdb-index output.

2021-08-02  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp with cc-with-gdb-index
	When running with target board cc-with-gdb-index, we run into:
	...
	rm: cannot remove '/tmp/tmp.JmYTeiuFjj/*.gdb-index': \
	  No such file or directory^M
	FAIL: gdb.dwarf2/per-bfd-sharing.exp: \
	  couldn't remove files in temporary cache dir
	...

	Fix this, as in gdb.base/index-cache.exp, by only FAILing when
	$expecting_index_cache_use.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-02  Tom de Vries  <tdevries@suse.de>

		* gdb.dwarf2/per-bfd-sharing.exp: Only expect index-cache files
		when $expecting_index_cache_use.

2021-08-02  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.dwarf2/gdb-index-nodebug.exp with cc-with-gdb-index
	When running with target board cc-with-gdb-index, we run into:
	...
	(gdb) save gdb-index .^M
	Error while writing index for `gdb-index-nodebug': \
	  Cannot use an index to create the index^M
	(gdb) FAIL: gdb.dwarf2/gdb-index-nodebug.exp: try to save gdb index
	...

	Fix this by detecting an already present index, and marking the test
	unsupported.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-02  Tom de Vries  <tdevries@suse.de>

		* gdb.dwarf2/gdb-index-nodebug.exp: Mark unsupported when index
		already present.

2021-08-02  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.dwarf2/fission-relative-dwo.exp with cc-with-gdb-index
	When running with target board cc-with-gdb-index, we run into:
	...
	gdb compile failed, warning: Could not find DWO CU \
	  fission-relative-dwo.dwo(0x1234) referenced by CU at offset 0xc7 \
	  [in module outputs/gdb.dwarf2/fission-relative-dwo/.tmp/fission-relative-dwo]
	UNTESTED: gdb.dwarf2/fission-relative-dwo.exp: fission-relative-dwo.exp
	ERROR: failed to compile fission-relative-dwo
	...

	The problem is that:
	- the .dwo file is found relative to the executable, and
	- cc-with-tweaks.sh moves the executable to a temp dir, but not
	  the .dwo file.

	Fix this by copying the .dwo file alongside the executable in the temp dir.

	Verified changes using shellcheck.

	Tested on x86_64-linux.

	gdb/ChangeLog:

	2021-08-02  Tom de Vries  <tdevries@suse.de>

		* contrib/cc-with-tweaks.sh: Copy .dwo files alongside executable.

2021-08-02  Shahab Vahedi  <shahab@synopsys.com>

	gdb: Make the builtin "boolean" type an unsigned type
	When printing the fields of a register that is of a custom struct type,
	the "unpack_bits_as_long ()" function is used:

	    do_val_print (...)
	      cp_print_value_fields (...)
	        value_field_bitfield (...)
	          unpack_value_bitfield (...)
	            unpack_bits_as_long (...)

	This function may sign-extend the extracted field while returning it:

	    val >>= lsbcount;

	    if (...)
	      {
	        valmask = (((ULONGEST) 1) << bitsize) - 1;
	        val &= valmask;
	        if (!field_type->is_unsigned ())
	  	  if (val & (valmask ^ (valmask >> 1)))
	  	      val |= ~valmask;
	      }

	    return val;

	lsbcount:   Number of lower bits to get rid of.
	bitsize:    The bit length of the field to be extracted.
	val:        The register value.
	field_type: The type of field that is being handled.

	While the logic here is correct, there is a problem when it is
	handling "field_type"s of "boolean".  Those types are NOT marked
	as "unsigned" and therefore they end up being sign extended.
	Although this is not a problem for "false" (0), it definitely
	causes trouble for "true".

	This patch constructs the builtin boolean type as such that it is
	marked as an "unsigned" entity.

	The issue tackled here was first encountered for arc-elf32 target
	running on an x86_64 machine.  The unit-test introduced in this change
	has passed for all the targets (--enable-targets=all) running on the
	same x86_64 host.

	Fixes: https://sourceware.org/PR28104

2021-08-02  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-08-01  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/maint.exp with cc-with-gdb-index
	With target board cc-with-gdb-index we run into:
	...
	FAIL: gdb.base/maint.exp: maint print statistics
	...

	The output that is checked is:
	...
	Statistics for 'maint':^M
	  Number of "minimal" symbols read: 53^M
	  Number of "full" symbols read: 40^M
	  Number of "types" defined: 60^M
	  Number of symbol tables: 7^M
	  Number of symbol tables with line tables: 2^M
	  Number of symbol tables with blockvectors: 2^M
	  Number of read CUs: 2^M
	  Number of unread CUs: 5^M
	  Total memory used for objfile obstack: 20320^M
	  Total memory used for BFD obstack: 4064^M
	  Total memory used for string cache: 4064^M
	...
	and the regexp doesn't match because it expects the "Number of read/unread
	CUs" lines in a different place.

	Fix this by updating the regexp.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-01  Tom de Vries  <tdevries@suse.de>

		* gdb.base/maint.exp: Update "maint print statistics" to match
		output with target board cc-with-gdb-index.

2021-08-01  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/index-cache.exp with cc-with-gdb-index
	With target board cc-with-gdb-index we run into:
	...
	FAIL: gdb.base/index-cache.exp: couldn't remove files in temporary cache dir
	...

	The problem is that there are no files to remove, because the index cache
	isn't used, as indicated by $expecting_index_cache_use.

	Fix this by only FAILing when $expecting_index_cache_use.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-08-01  Tom de Vries  <tdevries@suse.de>

		* gdb.base/index-cache.exp:

2021-08-01  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-31  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-30  Tom Tromey  <tom@tromey.com>

	Use iterator_range in more places
	This changes a couple of spots to replace custom iterator range
	classes with a specialization of iterator_range.

	Regression tested on x86-64 Fedora 34.

2021-07-30  Tom Tromey  <tom@tromey.com>

	Replace exception_print_same with operator!=
	I noticed that exception_print_same is only used in a single spot, and
	it seemed to be better as an operator!= method attached to
	gdb_exception.

	Regression tested on x86-64 Fedora 34.

2021-07-30  Tom de Vries  <tdevries@suse.de>

	[gdb/build] Disable attribute nonnull
	With trunk gcc (12.0) we're running into a -Werror=nonnull-compare build
	breaker in gdb, which caused a broader review of the usage of the nonnull
	attribute.

	The current conclusion is that it's best to disable this.  This is explained
	at length in the gdbsupport/common-defs.h comment.

	Tested by building with trunk gcc.

	gdb/ChangeLog:

	2021-07-29  Tom de Vries  <tdevries@suse.de>

		* gdbsupport/common-defs.h (ATTRIBUTE_NONNULL): Disable.

2021-07-30  Clément Chigot  <clement.chigot@atos.net>

	gas: ensure XCOFF DWARF subsection are initialized to 0
	debug_abbrev doesn't use end_exp to compute its size. However, it must
	be NULL. Otherwise, ppc_xcoff_end might try to access uninitialized
	memory.

	gas/
		* config/tc-ppc.c (ppc_dwsect): Use XCNEW instead of XNEW when creating
		a new subsection.

2021-07-30  Clément Chigot  <clement.chigot@atos.net>

	bfd: ensure that symbols targeted by DWARF relocations are kept in XCOFF
	This patch improves XCOFF garbage collector pass, in order to keep
	symbols being referenced only by special sections like DWARF sections.

	bfd/
		* xcofflink.c (xcoff_mark): Replace SEC_MARK by gc_mark.
		Look through relocations even if xcoff_section_data is NULL.
		(xcoff_sweep): Check if any sections of a file is kept before
		adding its special sections.
		Call xcoff_mark for special sessions being kept instead of just
		marking them.
		(SEC_MARK): Remove
		(xcoff_mark_symbol): Replace SEC_MARK by gc_mark.
		(xcoff_keep_symbol_p): Likewise.
		(bfd_xcoff_size_dynamic_sections): Likewise.
		(xcoff_find_tc0): Likewise.

2021-07-30  Clément Chigot  <clement.chigot@atos.net>

	bfd: avoid a crash when debug_section isn't created in XCOFF
	bfd/
		* xcofflink.c (bfd_xcoff_size_dynamic_sections):
		Add check to know if debug_section is initialized.

2021-07-30  Alan Modra  <amodra@gmail.com>

	readelf: catch archive_file_size of -1
	Fuzzers might put -1 in arhdr.ar_size.  If the size is rounded up to
	and even number of bytes we get zero.

		* readelf.c (process_archive): Don't round up archive_file_size.
		Do round up next_arhdr_offset calculation.

2021-07-30  Alan Modra  <amodra@gmail.com>

	reloc_upper_bound size calculations
	Section reloc_count is an unsigned int.  Adding one for a NULL
	terminator to an array of arelent pointers can wrap the count to
	zero.  Avoid that by doing the addition as longs.

		* coffgen.c (coff_get_reloc_upper_bound): Don't overflow unsigned
		int expression.
		* elf.c (_bfd_elf_get_reloc_upper_bound): Likewise.
		* elf64-sparc.c (elf64_sparc_get_reloc_upper_bound): Likewise.
		* mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
		* vms-alpha.c (alpha_vms_get_reloc_upper_bound): Likewise.

2021-07-30  Alan Modra  <amodra@gmail.com>

	Sanity check _bfd_coff_read_string_table
		* coffgen.c (_bfd_coff_read_string_table): Catch overflows
		when calculating string table file location.

2021-07-30  Alan Modra  <amodra@gmail.com>

	IMAGE_SCN_LNK_NRELOC_OVFL
	From microsoft docs: It is an error if IMAGE_SCN_LNK_NRELOC_OVFL is
	set and there are fewer than 0xffff relocations in the section.

		* coffcode.h (coff_set_alignment_hook): Sanity check overflow
		reloc count.

2021-07-30  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fix nr_bits gdb_assert in append_flags_type_field
	The assertion

	    gdb_assert (nr_bits >= 1 && nr_bits <= type_bitsize);

	is not correct.  Well, it's correct in that we do want the number of
	bits to be in the range [1, type_bitsize].  But we don't check anywhere
	that the end of the specified flag is within the containing type.

	The following code should generate a failed assertion, as the flag goes
	past the 32 bits of the underlying type, but it's currently not caught:

	    static void
	    test_print_flag (gdbarch *arch)
	    {
	      type *flags_type = arch_flags_type (arch, "test_type", 32);
	      type *field_type = builtin_type (arch)->builtin_uint32;
	      append_flags_type_field (flags_type, 31, 2, field_type, "invalid");
	    }

	(You can test this by registering it as a selftest using
	selftests::register_test_foreach_arc and running.)

	Change the assertion to verify that the end bit is within the range of
	the underlying type.  This implicitly verifies that nr_bits is not
	too big as well, so we don't need a separate assertion for that.

	Change-Id: I9be79e5fd7a5917bf25b03b598727e6274c892e8
	Co-Authored-By: Tony Tye <Tony.Tye@amd.com>

2021-07-30  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-29  John Baldwin  <jhb@FreeBSD.org>

	obsd-nat: Report both thread and PID in ::pid_to_str.
	This improves the output of info threads when debugging multiple
	inferiors (e.g. after a fork with detach_on_fork disabled).

2021-07-29  John Baldwin  <jhb@FreeBSD.org>

	obsd-nat: Various fixes for fork following.
	- Don't use #ifdef's on ptrace ops.  obsd-nat.h didn't include
	  <sys/ptrace.h>, so the virtual methods weren't always overridden
	  causing the fork following to not work.  In addition, the thread and
	  fork code is intertwined in ::wait and and the lack of #ifdef's
	  there already assumed both were present.  Finally, both of these
	  ptrace ops have been present in OpenBSD for at least 10 years.

	- Move duplicated code to enable PTRACE_FORK event reporting to a
	  single function and invoke it on new child processes reported via
	  PTRACE_FORK.

	- Don't return early from PTRACE_FORK handling, but instead reset
	  wptid to the correct ptid if the child reports its event before the
	  parent.  This allows the ptid fixup code to add thread IDs if the
	  first event for a process is a PTRACE_FORK event.  This also
	  properly returns ptid's with thread IDs when reporting PTRACE_FORK
	  events.

	- Handle detach_fork by skipping the PT_DETACH.

2021-07-29  John Baldwin  <jhb@FreeBSD.org>

	obsd-nat: Various fixes to obsd_nat_target::wait.
	- Call inf_ptrace_target::wait instead of duplicating the code.
	  Replace a check for WIFSTOPPED on the returned status from waitpid
	  by checking for TARGET_WAITKIND_STOPPED in the parsed status as is
	  done in fbsd_nat_target::wait.

	- Don't use inferior_ptid when deciding if a new process is a child vs
	  parent of the fork.  Instead, use find_inferior_pid and assume that
	  if an inferior already exists, the pid in question is the parent;
	  otherwise, the pid is the child.

	- Don't use inferior_ptid when deciding if the ptid of the process
	  needs to be updated with an LWP ID, or if this is a new thread.
	  Instead, use the approach from fbsd-nat which is to check if a ptid
	  without an LWP exists and if so update the ptid of that thread
	  instead of adding a new thread.

2021-07-29  John Baldwin  <jhb@FreeBSD.org>

	x86-bsd-nat: Only define gdb_ptrace when using debug registers.
	This fixes an unused function warning on OpenBSD which does not
	support PT_GETDBREGS.

2021-07-29  John Baldwin  <jhb@FreeBSD.org>

	Don't compile x86 debug register support on OpenBSD.
	Simon Marchi tried gdb on OpenBSD, and it immediately segfaults when
	running a program.  Simon tracked down the problem to x86_dr_low.get_status
	being nullptr at this point:

	    (lldb) print x86_dr_low.get_status
	    (unsigned long (*)()) $0 = 0x0000000000000000
	    (lldb) bt
	    * thread #1, stop reason = step over
	      * frame #0: 0x0000033b64b764aa gdb`x86_dr_stopped_data_address(state=0x0000033d7162a310, addr_p=0x00007f7ffffc5688) at x86-dregs.c:645:12
	        frame #1: 0x0000033b64b766de gdb`x86_dr_stopped_by_watchpoint(state=0x0000033d7162a310) at x86-dregs.c:687:10
	        frame #2: 0x0000033b64ea5f72 gdb`x86_stopped_by_watchpoint() at x86-nat.c:206:10
	        frame #3: 0x0000033b64637fbb gdb`x86_nat_target<obsd_nat_target>::stopped_by_watchpoint(this=0x0000033b65252820) at x86-nat.h:100:12
	        frame #4: 0x0000033b64d3ff11 gdb`target_stopped_by_watchpoint() at target.c:468:46
	        frame #5: 0x0000033b6469b001 gdb`watchpoints_triggered(ws=0x00007f7ffffc61c8) at breakpoint.c:4790:32
	        frame #6: 0x0000033b64a8bb8b gdb`handle_signal_stop(ecs=0x00007f7ffffc61a0) at infrun.c:6072:29
	        frame #7: 0x0000033b64a7e3a7 gdb`handle_inferior_event(ecs=0x00007f7ffffc61a0) at infrun.c:5694:7
	        frame #8: 0x0000033b64a7c1a0 gdb`fetch_inferior_event() at infrun.c:4090:5
	        frame #9: 0x0000033b64a51921 gdb`inferior_event_handler(event_type=INF_REG_EVENT) at inf-loop.c:41:7
	        frame #10: 0x0000033b64a827c9 gdb`infrun_async_inferior_event_handler(data=0x0000000000000000) at infrun.c:9384:3
	        frame #11: 0x0000033b6465bd4f gdb`check_async_event_handlers() at async-event.c:335:4
	        frame #12: 0x0000033b65070917 gdb`gdb_do_one_event() at event-loop.cc:216:10
	        frame #13: 0x0000033b64af0db1 gdb`start_event_loop() at main.c:421:13
	        frame #14: 0x0000033b64aefe9a gdb`captured_command_loop() at main.c:481:3
	        frame #15: 0x0000033b64aed5c2 gdb`captured_main(data=0x00007f7ffffc6470) at main.c:1353:4
	        frame #16: 0x0000033b64aed4f2 gdb`gdb_main(args=0x00007f7ffffc6470) at main.c:1368:7
	        frame #17: 0x0000033b6459d787 gdb`main(argc=5, argv=0x00007f7ffffc6518) at gdb.c:32:10
	        frame #18: 0x0000033b6459d521 gdb`___start + 321

	On BSDs, get_status is set in _initialize_x86_bsd_nat, but only if
	HAVE_PT_GETDBREGS is defined.  PT_GETDBREGS doesn't exist on OpenBSD, so
	get_status (and the other fields of x86_dr_low) are left as nullptr.

	OpenBSD doesn't support getting or setting the x86 debug registers, so
	fix by omitting debug register support entirely on OpenBSD:

	- Change x86bsd_nat_target to only inherit from x86_nat_target if
	  PT_GETDBREGS is supported.

	- Don't include x86-nat.o and nat/x86-dregs.o for OpenBSD/amd64.  They
	  were already omitted for OpenBSD/i386.

2021-07-29  Carl Love  <cel@us.ibm.com>

	Fix for gdb.tui/tui-layout-asm.exp
	The width of the window is too narrow to display the entire assembly line.
	The width of the columns in the window changes as the test walks thru the
	terminal window output.  The column change results in the first and second
	reads of the same line to differ thus causing the test to fail.  Increasing
	the width of the window keeps the column width consistent thru the test.

	If the test fails, the added check prints an message to the log file if
	the failure may be due to the window being too narrow.

	gdb/testsuite/ChangeLog

		* gdb.tui/tui-layout-asm.exp: Replace window width of 80 with the
		tui_asm_window_width variable for the width. Add if
		count_whitespace check.
		(count_whitespace): New proc

2021-07-29  George Barrett  <bob@bob131.so>

	guile/scm-math: indentation fixes
	Changes the indenting of a few expressions in
	vlscm_convert_typed_number to be better in line with the prevailing
	code style.

	gdb/ChangeLog:

	2021-07-30  George Barrett  <bob@bob131.so>

		* guile/scm-math.c (vlscm_convert_typed_number): Fix the
		indentation of calls to gdbscm_make_out_of_range_error.

	Change-Id: I7463998b77c17a00e88058e89b52fa029ee40e03

2021-07-29  George Barrett  <bob@bob131.so>

	guile: fix make-value with pointer type
	Calling the `make-value' procedure with an integer value and a pointer
	type for the #:type argument triggers a failed assertion in
	`get_unsigned_type_max', as that function doesn't consider pointers to
	be an unsigned type. This commit fixes the issue by adding a separate
	code path for pointers.

	As previously suggested, range checking is done using a new helper
	function in gdbtypes.

	gdb/ChangeLog:

	2021-07-30  George Barrett  <bob@bob131.so>

		* gdbtypes.h (get_pointer_type_max): Add declaration.
		* gdbtypes.c (get_pointer_type_max): Add definition for new
		helper function.
		* guile/scm-math.c (vlscm_convert_typed_number): Add code path
		for handling conversions to pointer types without failing an
		assert.

	gdb/testsuite/ChangeLog:

	2021-07-30  George Barrett  <bob@bob131.so>

		* gdb.guile/scm-math.exp (test_value_numeric_ops): Add test
		for creating pointers with make-value.
		(test_make_pointer_value, test_pointer_numeric_range): Add
		test procedures containing checks for integer-to-pointer
		validation.

	Change-Id: I9994dd1c848840a3d995f745e6d72867732049f0

2021-07-29  George Barrett  <bob@bob131.so>

	gdbtypes: return value from get_unsigned_type_max
	Changes the signature of get_unsigned_type_max to return the computed
	value rather than returning void and writing the value into a pointer
	passed by the caller.

	gdb/ChangeLog:

	2021-07-30  George Barrett  <bob@bob131.so>

		* gdbtypes.h (get_unsigned_type_max): Change signature to
		return the result instead of accepting a pointer argument in
		which to store the result.
		* gdbtypes.c (get_unsigned_type_max): Likewise.
		* guile/scm-math.c (vlscm_convert_typed_number): Update caller
		of get_unsigned_type_max.
		(vlscm_integer_fits_p): Likewise.

	Change-Id: Ibb1bf0c0fa181fac7853147dfde082a7d1ae2323

2021-07-29  Clément Chigot  <clement.chigot@atos.net>

	gas: improve C_BSTAT and C_STSYM symbols handling on XCOFF
	A C_BSTAT debug symbol specifies the beginning of a static block.
	Its n_value is the index of the csect containing static symbols.
	A C_STSYM debug symbol represents the stabstring of a statically
	allocated symbol. Its n_value is the offset in the csect pointed
	by the containing C_BSTAT.

	These two special n_value were not correctly handled both when
	generating object files with gas or when reading them with objdump.
	This patch tries to improve that and, above all, to allow gas-generated
	object files with such symbols to be accepted by AIX ld.

	bfd/
		* coff-bfd.c (bfd_coff_get_syment): Adjust n_value of symbols
		having fix_value = 1 in order to be an index and not a memory
		offset.
		* coffgen.c (coff_get_symbol_info): Likewize.
		(coff_print_symbol): Likewize.

	gas/
		* config/tc-ppc.c (ppc_frob_label): Don't change within if
		already set.
		(ppc_stabx): Remove workaround changing exp.X_add_symbol's
		within.
		* config/tc-ppc.h (struct ppc_tc_sy): Update comments.
		* symbols.c (resolve_symbol_value): Remove symbol update
		when final_val is 0 and it's an AIX debug symbol.
		* testsuite/gas/ppc/aix.exp: Add new tests.
		* testsuite/gas/ppc/xcoff-stsym-32.d: New test.
		* testsuite/gas/ppc/xcoff-stsym-64.d: New test.
		* testsuite/gas/ppc/xcoff-stsym.s: New test.

2021-07-29  George Barrett  <bob@bob131.so>

	Guile: temporary breakpoints
	Adds API to the Guile bindings for creating temporary breakpoints and
	querying whether an existing breakpoint object is temporary. This is
	effectively a transliteration of the Python implementation.

	It's worth noting that the added `is_temporary' flag is ignored in the
	watchpoint registration path. This replicates the behaviour of the
	Python implementation, but might be a bit surprising for users.

	gdb/ChangeLog:

	2021-06-09  George Barrett  <bob@bob131.so>

		* guile/scm-breakpoint.c (gdbscm_breakpoint_object::spec): Add
		is_temporary field.
		(temporary_keyword): Add keyword object for make-breakpoint
		argument parsing.
		(gdbscm_make_breakpoint): Accept #:temporary keyword argument
		and store the value in the allocated object's
		spec.is_temporary.
		(gdbscm_register_breakpoint_x): Pass the breakpoint's
		spec.is_temporary value to create_breakpoint.
		(gdbscm_breakpoint_temporary): Add breakpoint-temporary?
		procedure implementation.
		(breakpoint_functions::make-breakpoint): Update documentation
		string and fix a typo.
		(breakpoint_functions::breakpoint-temporary?): Add
		breakpoint-temporary? procedure.
		(gdbscm_initialize_breakpoints): Initialise temporary_keyword
		variable.
		NEWS (Guile API): Mention new temporary breakpoints API.

	gdb/doc/ChangeLog:

	2021-06-09  George Barrett  <bob@bob131.so>

		* guile.texi (Breakpoints In Guile): Update make-breakpoint
		documentation to reflect new #:temporary argument.
		Add documentation for new breakpoint-temporary? procedure.

	gdb/testsuite/ChangeLog:

	2021-06-09  George Barrett  <bob@bob131.so>

		* gdb.guile/scm-breakpoint.exp: Add additional tests for
		temporary breakpoints.

	Change-Id: I2de332ee7c256f5591d7141ab3ad50d31b871d17

2021-07-29  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-28  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: clean up some things in features/Makefile
	Clean up some things I noticed:

	 - we generate a regformats/microblaze-with-stack-protect.dat file.  I
	   don't think this is used.  It could be used by a GDBserver built for
	   Microblaze, but GDBserver isn't ported to Microblaze.  So I don't
	   think that's used at all.  Remove the entry in features/Makefile and
	   the file itself.

	 - There are a bunch of *-expedite values in features/Makefile for
	   architectures for which we don't generate dat files.  AFAIK, these
	   *-expedite values are only used when generating dat files.  Remove
	   those that are not necessary.

	 - 32bit-segments.xml is not listed in the Makfile, but it's used.  This
	   means that it wouldn't get re-generated if we were to change how C
	   files are generated from the XML.  It looks like it was simply
	   forgotten, add it.

	Change-Id: I112d00db317102270e1df924473c37122ccb6c3a

2021-07-28  H.J. Lu  <hjl.tools@gmail.com>

	x86: Simplify check for distinct TMM register operands
	If any pair of operands in AMX instructions with 3 TMM register operands
	are the same, the instruction will UD.  Don't call register_number to
	check for distinct TMM register operands since all TMM register operands
	have the same size.

		* config/tc-i386.c (check_VecOperands): Remove register_number
		call when checking for distinct TMM register operands.

2021-07-28  H.J. Lu  <hjl.tools@gmail.com>

	ld: Run tmpdir/pr28138 only for native build
		* PR ld/28138
		* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
		native build.

2021-07-28  H.J. Lu  <hjl.tools@gmail.com>

	bfd: Close the file descriptor if there is no archive fd
	Close the file descriptor if there is no archive plugin file descriptor
	to avoid running out of file descriptors on thin archives with many
	archive members.

	bfd/

		PR ld/28138
		* plugin.c (bfd_plugin_close_file_descriptor): Close the file
		descriptor there is no archive plugin file descriptor.

	ld/

		PR ld/28138
		* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
		* testsuite/ld-plugin/pr28138.c: New file.
		* testsuite/ld-plugin/pr28138-1.c: Likewise.
		* testsuite/ld-plugin/pr28138-2.c: Likewise.
		* testsuite/ld-plugin/pr28138-3.c: Likewise.
		* testsuite/ld-plugin/pr28138-4.c: Likewise.
		* testsuite/ld-plugin/pr28138-5.c: Likewise.
		* testsuite/ld-plugin/pr28138-6.c: Likewise.
		* testsuite/ld-plugin/pr28138-7.c: Likewise.

2021-07-28  H.J. Lu  <hjl.tools@gmail.com>

	ld: Report error reason when a library cannot be found
	With "ulimit -n 20", report:

	ld: cannot find -lgcc: Too many open files

	instead of

	ld: cannot find -lgcc

		* ldfile.c (ldfile_open_file): Rport error reason when a library
		cannot be found.

2021-07-28  Sergei Trofimovich  <siarheit@google.com>

	texi2pod.pl: add no-op --no-split option support [PR28144]
	Change 2faf902da ("generate single html manual page by default")
	added use of --no-split option to makeinfo. binutils reuses
	makeinfo options for texi2pod.pl wrapper. Unsupported option
	led to silent manpage truncation.

	The change adds no-op option support.

	etc/

		* texi2pod.pl: Handle no-op --no-split option.

2021-07-28  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: fix missing space in some info variables output
	Fixes PR gdb/28121.  When a user declares an array like this:

	  int * const foo_1[3];

	And in GDB the user does this:

	  (gdb) info variables foo
	  All variables matching regular expression "foo":

	  File test.c:
	  1:	int * constfoo_1[3];

	Notice the missing space between 'const' and 'foo_1'.  This is fixed
	in c_type_print_varspec_prefix (c-typeprint.c) by passing through the
	flag that indicates if a trailing space is needed, rather than hard
	coding the flag to false as we currently do.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28121

2021-07-28  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Fix unhandled dwarf expression opcode with gcc-11 -gdwarf-5
	[ I've confused things by forgetting to add -gdwarf-4 in $subject of
	commit 0057a7ee0d9 "[gdb/testsuite] Add KFAILs for gdb.ada FAILs with
	gcc-11".  So I'm adding here -gdwarf-5 in $subject, even though -gdwarf-5 is
	the default for gcc-11.  I keep getting confused because of working with a
	system gcc-11 compiler that was patched to switch the default back to
	-gdwarf-4. ]

	When running test-case gdb.ada/arrayptr.exp with gcc-11 (and default
	-gdwarf-5), I run into:
	...
	(gdb) print pa_ptr.all^M
	Unhandled dwarf expression opcode 0xff^M
	(gdb) FAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all
	...

	What happens is that pa_ptr:
	...
	 <2><1523>: Abbrev Number: 3 (DW_TAG_variable)
	    <1524>   DW_AT_name        : pa_ptr
	    <1529>   DW_AT_type        : <0x14fa>
	...
	has type:
	...
	 <2><14fa>: Abbrev Number: 2 (DW_TAG_typedef)
	    <14fb>   DW_AT_name        : foo__packed_array_ptr
	    <1500>   DW_AT_type        : <0x1504>
	 <2><1504>: Abbrev Number: 4 (DW_TAG_pointer_type)
	    <1505>   DW_AT_byte_size   : 8
	    <1505>   DW_AT_type        : <0x1509>
	...
	which is a pointer to a subrange:
	...
	 <2><1509>: Abbrev Number: 12 (DW_TAG_subrange_type)
	    <150a>   DW_AT_lower_bound : 0
	    <150b>   DW_AT_upper_bound : 0x3fffffffffffffffff
	    <151b>   DW_AT_name        : foo__packed_array
	    <151f>   DW_AT_type        : <0x15cc>
	    <1523>   DW_AT_artificial  : 1
	 <1><15cc>: Abbrev Number: 5 (DW_TAG_base_type)
	    <15cd>   DW_AT_byte_size   : 16
	    <15ce>   DW_AT_encoding    : 7      (unsigned)
	    <15cf>   DW_AT_name        : long_long_long_unsigned
	    <15d3>   DW_AT_artificial  : 1
	...
	with upper bound of form DW_FORM_data16.

	In gdb/dwarf/attribute.h we have:
	...
	  /* Return non-zero if ATTR's value falls in the 'constant' class, or
	     zero otherwise.  When this function returns true, you can apply
	     the constant_value method to it.
	     ...
	     DW_FORM_data16 is not considered as constant_value cannot handle
	     that.  */
	  bool form_is_constant () const;
	...
	so instead we have attribute::form_is_block (DW_FORM_data16) == true.

	Then in attr_to_dynamic_prop for the upper bound, we get a PROC_LOCEXPR
	instead of a PROP_CONST and end up trying to evaluate the constant
	0x3fffffffffffffffff as if it were a locexpr, which causes the
	"Unhandled dwarf expression opcode 0xff".

	In contrast, with -gdwarf-4 we have:
	...
	    <164c>   DW_AT_upper_bound : 18 byte block: \
	      9e 10 ff ff ff ff ff ff ff ff 3f 0 0 0 0 0 0 0 \
	      (DW_OP_implicit_value 16 byte block: \
	        ff ff ff ff ff ff ff ff 3f 0 0 0 0 0 0 0 )
	...

	Fix the dwarf error by translating the DW_FORM_data16 constant into a
	PROC_LOCEXPR, effectively by prepending 0x9e 0x10, such that we have same
	result as with -gdwarf-4:
	...
	(gdb) print pa_ptr.all^M
	That operation is not available on integers of more than 8 bytes.^M
	(gdb) KFAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all \
	  (PRMS: gdb/20991)
	...

	Tested on x86_64-linux, with gcc-11 and target board
	unix/gdb:debug_flags=-gdwarf-5.

	gdb/ChangeLog:

	2021-07-25  Tom de Vries  <tdevries@suse.de>

		* dwarf2/read.c (attr_to_dynamic_prop): Handle DW_FORM_data16.

2021-07-28  will schmidt  <will_schmidt@vnet.ibm.com>

	Externalize the _bfd_set_gp_value function
	This change adds an external-visible wrapper for the _bfd_set_gp_value
	function.  This is a prerequisite for some gdb patches that better
	handle powerpc64le relocations against ".TOC.".

		* bfd.c (bfd_set_gp_value): New externally visible wrapper
		for _bfd_set_gp_value.
		* bfd-in2.h: Regenerate.

2021-07-28  Alan Modra  <amodra@gmail.com>

	PowerPC: ignore sticky options for .machine
	PowerPC gas and objdump for a long time have allowed certain -m/-M
	options that extend a base cpu with extra functional units to be
	specified before the base cpu.  For example, "-maltivec -mpower4" is
	the same as "-mpower4 -maltivec".  See
	https://sourceware.org/pipermail/binutils/2008-January/054935.html

	It doesn't make as much sense that .machine keep any of these
	"sticky" flags when handling a new base cpu.  See gcc PR101393.  I
	think that instead .machine ought to override the command line.
	That's what this patch does.  It is still possible to extend cpu
	functionality with .machine.  For example the following can be
	assembled when selecting a basic -mppc on the command line:
		.machine power5
		.machine altivec
		frin 1,2
		lvsr 3,4,5
	Here, ".machine altivec" extends the ".machine power5" so that both
	the power5 "frin" instruction and the altivec "lvsr" instruction are
	enabled.  Swapping the two ".machine" directives would result in
	failure to assemble "lvsr".

	This change will expose some assembly errors, such as the one in
	glibc/sysdeps/powerpc/powerpc64/tst-ucontext-ppc64-vscr.c, a file
	compiled with -maltivec but containing
	  asm volatile (".machine push;\n"
			".machine \"power5\";\n"
			"vspltisb %0,0;\n"
			"vspltisb %1,-1;\n"
			"vpkuwus %0,%0,%1;\n"
			"mfvscr %0;\n"
			"stvx %0,0,%2;\n"
			".machine pop;"
			: "=v" (v0), "=v" (v1)
			: "r" (vscr_ptr)
			: "memory");
	It's just wrong to choose power5 for a bunch of altivec instructions
	and in fact all of those .machine directives are unnecessary.

		* config/tc-ppc.c (ppc_machine): Don't use command line
		sticky options.

2021-07-28  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add xfail for PR gcc/101643
	With gcc 8.5.0 I run into:
	...
	(gdb) print bad^M
	$2 = (0 => 0 <repeats 25 times>)^M
	(gdb) FAIL: gdb.ada/big_packed_array.exp: scenario=minimal: print bad
	...
	while with gcc 9.3.1 we have instead:
	...
	(gdb) print bad^M
	$2 = (false <repeats 196 times>)^M
	(gdb) PASS: gdb.ada/big_packed_array.exp: scenario=minimal: print bad
	...

	This is caused by gcc PR, which I've filed at
	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101643 "[debug, ada] packed array
	not described as packed".

	Fix by marking this as XFAIL.

	Tested on x86_64-linux.

	gdb/ChangeLog:

	2021-07-27  Tom de Vries  <tdevries@suse.de>

		PR testsuite/26904
		* gdb/testsuite/gdb.ada/big_packed_array.exp: Add xfail.

2021-07-27  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add xfail for PR gcc/101633
	With gcc 7.5.0, I run into:
	...
	(gdb) print objects^M
	$1 = ((tag => object, values => ()), (tag => unused))^M
	(gdb) FAIL: gdb.ada/array_of_variant.exp: scenario=minimal: print entire array
	...
	while with gcc 8.5.0 we have:
	...
	(gdb) print objects^M
	$1 = ((tag => object, values => (2, 2, 2, 2, 2)), (tag => unused))^M
	(gdb) PASS: gdb.ada/array_of_variant.exp: scenario=minimal: print entire array
	...

	This is due to a gcc PR, which I've filed at
	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101633 "Bug 101633 - [debug]
	DW_TAG_subrange_type missing DW_AT_upper_bound".

	Fix by marking this and related FAILs as XFAIL.

	Tested on x86_64-linux.

	gdb/ChangeLog:

	2021-07-27  Tom de Vries  <tdevries@suse.de>

		PR testsuite/26903
		* gdb/testsuite/gdb.ada/array_of_variant.exp: Add xfails.

2021-07-27  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: remove VALUE_FRAME_ID and fix another frame debug issue
	This commit was originally part of this patch series:

	  (v1): https://sourceware.org/pipermail/gdb-patches/2021-May/179357.html
	  (v2): https://sourceware.org/pipermail/gdb-patches/2021-June/180208.html
	  (v3): https://sourceware.org/pipermail/gdb-patches/2021-July/181028.html

	However, that series is being held up in review, so I wanted to break
	out some of the non-related fixes in order to get these merged.

	This commit addresses two semi-related issues, both of which are
	problems exposed by using 'set debug frame on'.

	The first issue is in frame.c in get_prev_frame_always_1, and was
	introduced by this commit:

	  commit a05a883fbaba69d0f80806e46a9457727fcbe74c
	  Date:   Tue Jun 29 12:03:50 2021 -0400

	      gdb: introduce frame_debug_printf

	This commit replaced fprint_frame with frame_info::to_string.
	However, the former could handle taking a nullptr while the later, a
	member function, obviously requires a non-nullptr in order to make the
	function call.  In one place we are not-guaranteed to have a
	non-nullptr, and so, there is the possibility of triggering undefined
	behaviour.

	The second issue addressed in this commit has existed for a while in
	GDB, and would cause this assertion:

	  gdb/frame.c:622: internal-error: frame_id get_frame_id(frame_info*): Assertion `fi->this_id.p != frame_id_status::COMPUTING' failed.

	We attempt to get the frame_id for a frame while we are computing the
	frame_id for that same frame.

	What happens is that when GDB stops we create a frame_info object for
	the sentinel frame (frame #-1) and then we attempt to unwind this
	frame to create a frame_info object for frame #0.

	In the test case used here to expose the issue we have created a
	Python frame unwinder.  In the Python unwinder we attemt to read the
	program counter register.

	Reading this register will initially create a lazy register value.
	The frame-id stored in the lazy register value will be for the
	sentinel frame (lazy register values hold the frame-id for the frame
	from which the register will be unwound).

	However, the Python unwinder does actually want to examine the value
	of the program counter, and so the lazy register value is resolved
	into a non-lazy value.  This sends GDB into value_fetch_lazy_register
	in value.c.

	Now, inside this function, if 'set debug frame on' is in effect, then
	we want to print something like:

	  frame=%d, regnum=%d(%s), ....

	Where 'frame=%d' will be the relative frame level of the frame for
	which the register is being fetched, so, in this case we would expect
	to see 'frame=0', i.e. we are reading a register as it would be in
	frame #0.  But, remember, the lazy register value actually holds the
	frame-id for frame #-1 (the sentinel frame).

	So, to get the frame_info for frame #0 we used to call:

	  frame = frame_find_by_id (VALUE_FRAME_ID (val));

	Where VALUE_FRAME_ID is:

	  #define VALUE_FRAME_ID(val) (get_prev_frame_id_by_id (VALUE_NEXT_FRAME_ID (val)))

	That is, we start with the frame-id for the next frame as obtained by
	VALUE_NEXT_FRAME_ID, then call get_prev_frame_id_by_id to get the
	frame-id of the previous frame.

	The get_prev_frame_id_by_id function finds the frame_info for the
	given frame-id (in this case frame #-1), calls get_prev_frame to get
	the previous frame, and then calls get_frame_id.

	The problem here is that calling get_frame_id requires that we know
	the frame unwinder, so then have to try each frame unwinder in turn,
	which would include the Python unwinder.... which is where we started,
	and thus we have a loop!

	To prevent this loop GDB has an assertion in place, which is what
	actually triggers.

	Solving the assertion failure is pretty easy, if we consider the code
	in value_fetch_lazy_register and get_prev_frame_id_by_id then what we
	do is:

	  1. Start with a frame_id taken from a value,
	  2. Lookup the corresponding frame,
	  3. Find the previous frame,
	  4. Get the frame_id for that frame, and
	  5. Lookup the corresponding frame
	  6. Print the frame's level

	Notice that steps 3 and 5 give us the exact same result, step 4 is
	just wasted effort.  We could shorten this process such that we drop
	steps 4 and 5, thus:

	  1. Start with a frame_id taken from a value,
	  2. Lookup the corresponding frame,
	  3. Find the previous frame,
	  6. Print the frame's level

	This will give the exact same frame as a result, and this is what I
	have done in this patch by removing the use of VALUE_FRAME_ID from
	value_fetch_lazy_register.

	Out of curiosity I looked to see how widely VALUE_FRAME_ID was used,
	and saw it was only used in one other place in valops.c:value_assign,
	where, once again, we take the result of VALUE_FRAME_ID and pass it to
	frame_find_by_id, thus introducing a redundant frame_id lookup.

	I don't think the value_assign case risks triggering the assertion
	though, as we are unlikely to call value_assign while computing the
	frame_id for a frame, however, we could make value_assign slightly
	more efficient, with no real additional complexity, by removing the
	use of VALUE_FRAME_ID.

	So, in this commit, I completely remove VALUE_FRAME_ID, and replace it
	with a use of VALUE_NEXT_FRAME_ID, followed by a direct call to
	get_prev_frame_always, this should make no difference in either case,
	and resolves the assertion issue from value.c.

	As I said, this patch was originally part of another series, the
	original test relied on the fixes in that original series.  However, I
	was able to create an alternative test for this issue by enabling
	frame debug within an existing test script.

	This commit probably fixes bug PR gdb/27938, though the bug doesn't
	have a reproducer attached so it is not possible to know for sure.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27938

2021-07-27  Chenghua Xu  <xuchenghua@loongson.cn>

	Correct gs264e bfd_mach in mips_arch_choices.
	opcodes/
	    * mips-dis.c (mips_arch_choices): Correct gs264e bfd_mach.

2021-07-27  Roland McGrath  <mcgrathr@google.com>

	Fix ld test case that assumes --enable-textrel-check
	ld/
		* testsuite/ld-x86-64/x86-64.exp (Build textrel-1): Use --warn-textrel.

2021-07-27  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-27  H.J. Lu  <hjl.tools@gmail.com>

	bfd: Set error to bfd_error_malformed_archive only if unset
	When reading an archive member, set error to bfd_error_malformed_archive
	on open_nested_file failure only if the error is unset.

		PR ld/28138
		* archive.c (_bfd_get_elt_at_filepos): Don't set error to
		bfd_error_malformed_archive if it has been set.

2021-07-26  Carl Love  <cel@us.ibm.com>

	Fix for mi-reverse.exp
	This test fails on PPC64 because PPC64 prints the value of 3.5 with
	more significant digits than on Intel. The patch updates the regular
	expression to allow for more significant digits on the constant.

	gdb/testsuite/ChangeLog

		* gdb.mi/mi-reverse.exp: mi_execute_to exec-step reverse add check
		for additional digits.

2021-07-26  Tom Tromey  <tromey@adacore.com>

	Fix the Windows build
	The gdb build was broken on Windows after the patch to change
	get_inferior_cwd.  This patch fixes the build.

2021-07-26  Shahab Vahedi  <shahab@synopsys.com>

	gdb: Fix numerical field extraction for target description "flags"
	The "val_print_type_code_flags ()" function is responsible for
	extraction of fields for "flags" data type.  These data types are
	used when describing a custom register type in a target description
	XML.  The logic used for the extraction though is not sound:

	    unsigned field_len = TYPE_FIELD_BITSIZE (type, field);
	    ULONGEST field_val
	      = val >> (TYPE_FIELD_BITPOS (type, field) - field_len + 1);

	TYPE_FIELD_BITSIZE: The bit length of the field to be extracted.
	TYPE_FIELD_BITPOS:  The starting position of the field; 0 is LSB.
	val:                The register value.

	Imagine you have a field that starts at position 1 and its length
	is 4 bits.  According to the third line of the code snippet the
	shifting right would become "val >> -2", or "val >> 0xfff...fe"
	to be precise.  That will result in a "field_val" of 0.

	The correct extraction should be:

	    ULONGEST field_val = val >> TYPE_FIELD_BITPOS (type, field);

	The rest of the algorithm that masks out the higher bits is OK.

	Co-Authored-By: Simon Marchi <simon.marchi@efficios.com>

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [10/10] arm: Alias 'ra_auth_code' to r12 for pacbti.
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (reg_names): Alias 'ra_auth_code' to r12.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [9/10] arm: add 'pacg' instruction for Armv8.1-M pacbti extension
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (T16_32_TAB): Add '_pacg'.
		(do_t_pacbti_pacg): New function.
		(insns): Define 'pacg' insn.
		* testsuite/gas/arm/armv8_1-m-pacbti.d: Add 'pacg' test.
		* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

	opcodes/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* arm-dis.c (thumb32_opcodes): Add 'pacg'.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [8/10] arm: add 'autg' instruction for Armv8.1-M pacbti extension
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (T16_32_TAB): Add '_autg'.
		(insns): Define 'autg' insn.
		* testsuite/gas/arm/armv8_1-m-pacbti.d: Add autg test.
		* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

	opcodes/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* arm-dis.c (thumb32_opcodes): Add 'autg'.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [7/10] arm: add 'bxaut' instruction for Armv8.1-M pacbti extension
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (T16_32_TAB): Add '_bxaut'.
		(do_t_pacbti_nonop): New function.
		(insns): Define 'bxaut' insn.
		* testsuite/gas/arm/armv8_1-m-pacbti.d: Add 'bxaut' test.
		* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

	opcodes/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* arm-dis.c (thumb32_opcodes): Add 'bxaut'.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [6/10] arm: Add -march=armv8.1-m.main+pacbti flag
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (pacbti_ext): Define.
		(BAD_PACBTI): New macro.
		(armv8_1m_main_ext_table): Add 'pacbti' extension.

	include/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* opcode/arm.h (ARM_EXT3_PACBTI, ARM_AEXT3_V8_1M_MAIN_PACBTI): New
		macro.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [5/10] arm: Extend again arm_feature_set struct to provide more bits
	include/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* opcode/arm.h (arm_feature_set): Extend 'core' field.
		(ARM_CPU_HAS_FEATURE, ARM_FSET_CPU_SUBSET, ARM_CPU_IS_ANY)
		(ARM_MERGE_FEATURE_SETS, ARM_CLEAR_FEATURE, ARM_FEATURE_EQUAL)
		(ARM_FEATURE_ZERO, ARM_FEATURE_CORE_EQUAL): Account for
		'core[2]'.
		(ARM_FEATURE_CORE_HIGH_HIGH): New macro.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [4/10] arm: add 'pac' instruction for Armv8.1-M pacbti extension
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (T16_32_TAB): Add '_pac'.
		(insns): Add 'pac' insn.
		* testsuite/gas/arm/armv8_1-m-pacbti-bad.l: Add pac tests.
		* testsuite/gas/arm/armv8_1-m-pacbti-bad.s: Likewise.
		* testsuite/gas/arm/armv8_1-m-pacbti.d: Likewise.
		* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

	opcodes/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* arm-dis.c (thumb32_opcodes): Add 'pac'.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [3/10] arm: add 'aut' instruction for Armv8.1-M pacbti extension
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (insns): Add 'aut.'
		(T16_32_TAB): Add '_aut'.
		* testsuite/gas/arm/armv8_1-m-pacbti-bad.l: Add 'aut' tests.
		* testsuite/gas/arm/armv8_1-m-pacbti-bad.s: Likewise.
		* testsuite/gas/arm/armv8_1-m-pacbti.d: Likewise.
		* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

	opcodes/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* arm-dis.c (thumb32_opcodes): Add 'aut'.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [2/10] arm: add 'pacbti' instruction for Armv8.1-M pacbti extension
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c
		(enum operand_parse_code): Add OP_SP and OP_R12.
		(parse_operands): Add switch cases for OP_SP and OP_R12.
		(T16_32_TAB): Add '_pacbti'.
		(do_t_pacbti): New function.
		(insns): Add 'pacbti'.
		* testsuite/gas/arm/armv8_1-m-pacbti-bad.d: New file.
		* testsuite/gas/arm/armv8_1-m-pacbti-bad.l: Likewise.
		* testsuite/gas/arm/armv8_1-m-pacbti-bad.s: Likewise.
		* testsuite/gas/arm/armv8_1-m-pacbti.d: Add 'pacbti' to testcase.
		* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

	opcodes/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* arm-dis.c (thumb32_opcodes): Add 'pacbti' instruction.

2021-07-26  Andrea Corallo  <andrea.corallo@arm.com>

	PATCH [1/10] arm: add 'bti' instruction for Armv8.1-M pacbti extension
	gas/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* config/tc-arm.c (insns): Add 'bti' insn.
		* testsuite/gas/arm/armv8_1-m-pacbti.d: New file.
		* testsuite/gas/arm/armv8_1-m-pacbti.s: Likewise.

	opcodes/
	2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

		* arm-dis.c (thumb32_opcodes): Add bti instruction.

2021-07-26  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb: move remaining ChangeLogs to legacy files
	In commit:

	  commit f069ea46a03ae868581d1c852da28e979ea1245a
	  Date:   Sat Jul 3 16:29:08 2021 -0700

	      Rename gdb/ChangeLog to gdb/ChangeLog-2021

	The gdb/ChangeLog file was renamed, but all of the other ChangeLog
	files relating to gdb were left in place.

	As I understand things, the no ChangeLogs policy applies to all the
	GDB related directories, so this commit renames all of the remaining
	GDB related ChangeLog files.

	As with the original commit, the intention behind this commit is to
	hopefully stop people merging ChangeLog entries by mistake.

	The renames carried out in this commit are:

	    gdb/doc/ChangeLog -> gdb/doc/ChangeLog-1991-2021
	    gdb/stubs/ChangeLog -> gdb/stubs/ChangeLog-2012-2020
	    gdb/testsuite/ChangeLog -> gdb/testsuite/ChangeLog-2014-2021
	    gdbserver/ChangeLog -> gdbserver/ChangeLog-2002-2021
	    gdbsupport/ChangeLog -> gdbsupport/ChangeLog-2020-2021

2021-07-26  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	gdb/mi: handle no condition argument case for -break-condition
	As reported in PR gdb/28076 [1], passing no condition argument to the
	-break-condition command (e.g.: "-break-condition 2") should clear the
	condition for breakpoint 2, just like CLI's "condition 2", but instead
	an error message is returned:

	  ^error,msg="-break-condition: Missing the <number> and/or <expr> argument"

	The current implementation of the -break-condition command's argument
	handling (79aabb7308c "gdb/mi: add a '--force' flag to the
	'-break-condition' command") was done according to the documentation,
	where the condition argument seemed mandatory.  However, the
	-break-condition command originally (i.e. before the 79aabb7308c
	patch) used the CLI's "cond" command, and back then not passing a
	condition argument was clearing out the condition.  So, this is a
	regression in terms of the behavior.

	Fix the argument handling of the -break-condition command to allow not
	having a condition argument, and also update the document to make the
	behavior clear.  Also add test cases to test the scenarios which were
	previously not covered.

	[1] https://sourceware.org/bugzilla/show_bug.cgi?id=28076

2021-07-26  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-25  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-24  Alan Modra  <amodra@gmail.com>

	Revert: PowerPC: Don't generate unused section symbols
	Blindly following x86 broke linux kernel builds.

	bfd/
		* elf32-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define as true.
		* elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Likewise.
	gas/
		* testsuite/gas/ppc/power4.d: Adjust for section sym change.
		* testsuite/gas/ppc/test1elf32.d: Likewise.
		* testsuite/gas/ppc/test1elf64.d: Likewise.
	ld/
		* testsuite/ld-powerpc/tlsexe.r: Adjust for section sym change.
		* testsuite/ld-powerpc/tlsexe32.r: Likewise.
		* testsuite/ld-powerpc/tlsexe32no.r: Likewise.
		* testsuite/ld-powerpc/tlsexeno.r: Likewise.
		* testsuite/ld-powerpc/tlsexenors.r: Likewise.
		* testsuite/ld-powerpc/tlsexers.r: Likewise.
		* testsuite/ld-powerpc/tlsexetoc.r: Likewise.
		* testsuite/ld-powerpc/tlsexetocrs.r: Likewise.
		* testsuite/ld-powerpc/tlsget.d: Likewise.
		* testsuite/ld-powerpc/tlsget.wf: Likewise.
		* testsuite/ld-powerpc/tlsget2.d: Likewise.
		* testsuite/ld-powerpc/tlsget2.wf: Likewise.
		* testsuite/ld-powerpc/tlsso.r: Likewise.
		* testsuite/ld-powerpc/tlsso32.r: Likewise.
		* testsuite/ld-powerpc/tlstocso.r: Likewise.

2021-07-24  Alan Modra  <amodra@gmail.com>

	Re: ld script expression parsing
	Commit 40726f16a8d7 broke references to sections within ADDR(), and
	overlays with weird section names.

		* ldgram.y (paren_script_name): New rule.
		(exp): Use it for ALIGNOF, SIZEOF, ADDR, and LOADADDR.  Similarly
		ensure script mode parsing for section name in SEGMENT_START.
		(overlay_section): Delete unnecessary ldlex_script call.  Backup
		on a lookahead NAME parsed in expression mode.
		* testsuite/ld-elf/overlay.s: Add more sections.
		* testsuite/ld-elf/overlay.t: Test '-' in section names.

2021-07-24  Frederic Cambus  <fred@statdns.com>

	Update the NetBSD system call table to match NetBSD-current.
	Generated from sys/sys/syscall.h revision 1.319.

	We can safely remove the _lwp_gettid syscall, which was never exposed
	in libc and never made it into a release.

	gdb/ChangeLog:

	2021-07-23  Frederic Cambus  <fred@statdns.com>

		* syscalls/netbsd.xml: Regenerate.

2021-07-24  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: test get/set value of unregistered Guile parameter
	When creating a parameter in Guile, you have to create it using
	make-parameter and then register it with GDB with register-parameter!.
	In between, it's still possible (though not documented) to set the
	parameter's value.  I broke this use case by mistake while writing this
	series, so thought it would be good to have a test for it.

	I suppose that people could use this "feature" to give their parameter
	an initial value, even though make-parameter has an initial-value
	parameter for this.  Nevertheless, changing this behavior could break
	some scripts, which is why I think it's important for it to be tested.

	Change-Id: I5b2103e3cec0cfdcccf7ffb00eb05fed8626e66d

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove cmd_list_element::function::sfunc
	I don't understand what the sfunc function type in
	cmd_list_element::function is for.  Compared to cmd_simple_func_ftype,
	it has an extra cmd_list_element parameter, giving the callback access
	to the cmd_list_element for the command being invoked.  This allows
	registering the same callback with many commands, and alter the behavior
	using the cmd_list_element's context.

	From the comment in cmd_list_element, it sounds like at some point it
	was the callback function type for set and show functions, hence the
	"s".  But nowadays, it's used for many more commands that need to access
	the cmd_list_element object (see add_catch_command for example).

	I don't really see the point of having sfunc at all, since do_sfunc is
	just a trivial shim that changes the order of the arguments.  All
	commands using sfunc could just as well set cmd_list_element::func to
	their callback directly.

	Therefore, remove the sfunc field in cmd_list_element and everything
	that goes with it.  Rename cmd_const_sfunc_ftype to cmd_func_ftype and
	use it for cmd_list_element::func, as well as for the add_setshow
	commands.

	Change-Id: I1eb96326c9b511c293c76996cea0ebc51c70fac0

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: rename cfunc to simple_func
	After browsing the CLI code for quite a while and trying really hard, I
	reached the conclusion that I can't give a meaningful explanation of
	what "sfunc" and "cfunc" functions are, in cmd_list_element.  I don't
	see a logic at all.  That makes it very difficult to do any kind of
	change.  Unless somebody can make sense out of all that, I'd like to try
	to retro-fit some logic in the cmd_list_element callback function code
	so that we can understand what is going on, do some cleanups and add new
	features.

	The first change is about "cfunc".  I can't figure out what the "c" in
	cfunc means.  It's not const, because there's already "const" in
	"cmd_const_cfunc_ftype", and the previous "cmd_cfunc_ftype" had nothing
	const..  It's not "cmd" or "command", because there's already "cmd" in
	"cmd_const_cfunc_ftype".

	The "main" command callback, cmd_list_element::func, has three
	parameters, whereas cfunc has two.  It is missing the cmd_list_element
	parameter.  So the only reason I see for cfunc to exist is to be a shim
	between the three and two parameter versions.  Most commands don't need
	to receive the cmd_list_element object, so adding it everywhere would be
	long and would just add more unnecessary boilerplate.  So since this is
	the "simple" version of the callback, compared to the "full", I suggest
	renaming cmd_const_cfunc_ftype into cmd_simple_func_ftype, as well as
	everything (like the utility functions) that goes with it.

	Change-Id: I4e46cacfd77a66bc1cbf683f6a362072504b7868

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make inferior::m_terminal an std::string
	Same idea as the previous patch, but for m_terminal.

	Change-Id: If9367d5db8c976a4336680adca4ea5bc31ab64d2

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make inferior::m_cwd an std::string
	Same idea as the previous patch, but for m_cwd.

	To keep things consistent across the board, change get_inferior_cwd as
	well, which is shared with GDBserver.  So update the related GDBserver
	code too.

	Change-Id: Ia2c047fda738d45f3d18bc999eb67ceb8400ce4e

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make inferior::m_args an std::string
	With the current code, both a NULL pointer and an empty string can mean
	"no arguments".  We don't need this distinction.  Changing to a string
	has the advantage that there is now a single state for that (an empty
	string), which makes the code a bit simpler in my opinion.

	Change-Id: Icdc622820f7869478791dbaa84b4a1c7fec21ced

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add setter/getter for inferior cwd
	Add cwd/set_cwd to the inferior class, remove set_inferior_args.
	Keep get_inferior_args, because it is used from fork_inferior, in shared
	code.  The cwd could eventually be passed as a parameter eventually,
	though, I think that would be cleaner.

	Change-Id: Ifb72ea865d7e6f9a491308f0d5c1595579d8427e

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add setter/getter for inferior arguments
	Add args/set_args to the inferior class, remove the set_inferior_args
	and get_inferior_args functions, that would just be wrappers around
	them.

	Change-Id: If87d52f3402ce08be26c32897ae8915d9f6d1ea3

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: remove inferior::{argc,argv}
	There are currently two states that the inferior args can be stored.
	The main one is the `args` field, where they are stored as a single
	string.  The other one is the `argc`/`argv` fields.

	This last one is only used for arguments passed in GDB's
	command line.  And the only outcome is that when get_inferior_args is
	called, `argc`/`argv` are serialized into `args`.  So really,
	`argc`/`argv` is just a staging area before moving the arguments in
	`args`.

	Simplify this by only keeping the `args` field.  Change
	set_inferior_args_vector to immediately serialize the arguments into
	`args`, work that would be done in get_inferior_args later anyway.

	The only time where this work would be "wasted" is when the user passes
	some arguments on the command line, but does not end up running the
	program.  But that just seems unlikely.  And it's not that much work.

	Change-Id: Ica0b9859397c095f6530350c8fb3c36905f2044a

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: un-share set_inferior_cwd declaration
	The declaration of set_inferior_cwd is currently shared between gdb and
	gdbserver, in gdbsupport/common-inferior.h.  It doesn't need to be, as
	set_inferior_cwd is not called from common code.  Only get_inferior_cwd
	needs to.

	The motivation for this is that a future patch will change the prototype
	of set_inferior_cwd in gdb, and I don't want to change it for gdbserver
	unnecessarily.  I see this as a good cleanup in any case, to reduce to
	just the essential what is shared between GDB and GDBserver.

	Change-Id: I3127d27d078f0503ebf5ccc6fddf14f212426a73

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb.base/setshow.exp: fix duplicate test name
	Fix:

	    DUPLICATE: gdb.base/setshow.exp: test_setshow_args: show args

	by giving some explicit test names.

	Change-Id: I2a738d3d3675ab9b45929e71f5aee0ea6bf92072

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb.base/setshow.exp: split in procs
	Split in multiple procs, one per topic, and start with a fresh GDB in
	each.  I find it easier to work on a test with multiple smaller
	independent test procedures.  For example, it's possible to comment all
	but one when working on one.  It's also easier to add things without
	having to think about the impact on existing tests, and vice-versa.

	Change-Id: I19691eed8f9bcb975b2eeff7577cac66251bcbe2

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb.base/setshow.exp: use save_vars to save/restore gdb_prompt
	Using save_vars is a bit better than what we have now, as it ensures the
	variable gets restored if the code within it throws an error.

	Change-Id: I3bd6836e5b7efb61b078acadff1a1c8182c19a27

2021-07-23  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: split gdb.python/py-parameter.exp in procs
	Split the file into multiple independent test procs, where each proc
	starts with a fresh GDB.  I find it easier to understand what a test is
	doing when each part of the test is isolated and self-contained.  It
	makes it easier to comment out some parts of the test while working /
	debugging a specific part.  It also makes it easier to add new things
	(which a subsequent patch will do) without fear of impacting another part
	of the test.

	Change-Id: I8b4d52ac82b1492d79b679e13914ed177d8a836d

2021-07-23  Carl Love  <cel@us.ibm.com>

	Fix for gdb.python/py-breakpoint.exp
	Not all systems have hardware breakpoint support.  Add a check
	to see if the system supports hardware breakpoints.

	gdb/testsuite/ChangeLog

		* gdb.python/py-breakpoint.exp (test_hardware_breakpoints): Add
		check for hardware breakpoint support.

2021-07-23  Andrew Burgess  <andrew.burgess@embecosm.com>

	gdb/testsuite: don't error when trying to unset last_spawn_tty_name
	In spawn_capture_tty_name (lib/gdb.exp) we either set or unset
	last_spawn_tty_name depending on whether spawn_out(slave,name) exists
	or not.

	One situation that might cause spawn_out(slave,name) to not exists is
	if the spawn function is called with the argument -leaveopen, which is
	how it is called when processes are created as part of a pipeline, the
	created process has no tty, instead its output is written to a file
	descriptor.

	If a pipeline is created consisting of multiple processes then there
	will be multiple sequential calls to spawn, all using -leaveopen.  The
	first of these calls is fine, spawn_out(slave,name) is not set, and so
	in spawn_capture_tty_name we unset last_spawn_tty_name.  However, on
	the second call to spawn, spawn_out(slave,name) is still not set and
	so in spawn_capture_tty_name we again try to unset
	last_spawn_tty_name, this now throws an error (as last_spawn_tty_name
	is already unset).

	Fix this issue by using -nocomplain with the call to unset in
	spawn_capture_tty_name.

	Before this commit I was seeing gdb.base/gnu-debugdata.exp report 1
	pass, and 1 unsupported test.  After this commit I now see 16 passes
	from this test script.

	I have also improved the code that used to do this:

	    if { [info exists spawn_out] } {
		set ::last_spawn_tty_name $spawn_out(slave,name)
	    } else {
	        ...
	    }

	The problem here is that we check for the existence of spawn_out, and
	then unconditionally read spawn_out(slave,name).  A situation could
	arise where some other element of spawn_out is set,
	e.g. spawn_out(foo), in which case we would enter the if block and try
	to read a non-existent variable.  After this commit we now check
	specifically for spawn_out(slave,name).

	Finally, it is worth noting that before this issue was fixed runtest
	itself, or rather the expect process behind runtest, would segfault
	while exiting.  I haven't looked at all into what the problem is here
	that caused expect to crash, as fixing the bug in GDB's testing
	scripts made the segfault go away.

2021-07-23  Jan Beulich  <jbeulich@suse.com>

	x86: express unduly set rounding control bits in disassembly
	While EVEX.L'L are indeed ignored when EVEX.b stands for just SAE,
	EVEX.b itself is not ignored when an insn permits neither rounding
	control nor SAE.

	While changing this aspect of EVEX.b handling, also alter unduly set
	embedded broadcast: Don't call BadOp(), screwing up subsequent
	disassembly, but emit "{bad}" instead.

2021-07-23  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-22  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAILs due to PR gcc/101575
	When running test-case gdb.ada/formatted_ref.exp with gcc-11 and target board
	unix/gdb:debug_flags=-gdwarf-4 we run into:
	...
	(gdb) print/x s^M
	No definition of "s" in current context.^M
	(gdb) FAIL: gdb.ada/formatted_ref.exp: print/x s
	...
	which is caused by "runto defs.adb:20" taking us to defs__struct1IP:
	...
	(gdb) break defs.adb:20^M
	Breakpoint 1 at 0x402cfd: defs.adb:20. (2 locations)^M
	(gdb) run ^M
	Starting program: formatted_ref ^M
	^M
	Breakpoint 1, defs__struct1IP () at defs.adb:20^M
	20            return s.x;                   -- Set breakpoint marker here.^M
	(gdb) print s1'access^M
	...
	instead of the expected defs.f1:
	...
	(gdb) break defs.adb:20^M
	Breakpoint 1 at 0x402d0e: file defs.adb, line 20.^M
	(gdb) run ^M
	Starting program: formatted_ref ^M
	^M
	Breakpoint 1, defs.f1 (s=...) at defs.adb:20^M
	20            return s.x;                   -- Set breakpoint marker here.^M
	...

	This is caused by incorrect line info due to gcc PR 101575 - "[gcc-11,
	-gdwarf-4] Missing .file <n> directive causes invalid line info".

	Fix this by when landing in defs__struct1IP:
	- xfailing the runto, and
	- issuing a continue to land in defs.f1.

	Likewise in a few other test-cases.

	Tested on x86_64-linux, with:
	- system gcc.
	- gcc-11 and target boards unix/gdb:debug_flags=-gdwarf-4 and
	  unix/gdb:debug_flags=-gdwarf-5.

	gdb/testsuite/ChangeLog:

	2021-07-22  Tom de Vries  <tdevries@suse.de>

		* gdb.ada/formatted_ref.exp: Add xfail for PR gcc/101575.
		* gdb.ada/iwide.exp: Same.
		* gdb.ada/pkd_arr_elem.exp: Same.

2021-07-22  Jan Beulich  <jbeulich@suse.com>

	x86: drop dq{b,d}_mode
	Their sole use is for {,V}EXTRACTPS / {,V}P{EXT,INS}RB respectively; for
	consistency also limit use of dqw_mode to Jdqw. 64-bit disassembly
	reflecting REX.W / VEX.W is not in line with the assembler's opcode
	table having NoRex64 / VexWIG in all respective templates, i.e. assembly
	input isn't being honored there either. Obviously the 0FC5 encodings of
	{,V}PEXTRW then also need adjustment for consistency reasons.

	x86: drop vex_scalar_w_dq_mode
	It has only a single use and can easily be represented by dq_mode
	instead. Plus its handling in intel_operand_size() was duplicating
	that of vex_vsib_{d,q}_w_dq_mode anyway.

	x86: drop xmm_m{b,w,d,q}_mode
	They're effectively redundant with {b,w,d,q}_mode.

	x86: fold duplicate vector register printing code
	The bulk of OP_XMM() can be easily reused also for OP_EX(). Break the
	shared logic out of the function, and invoke the new helper from both
	places.

	x86: drop vex_mode and vex_scalar_mode
	These are fully redundant with, respectively, x_mode and scalar_mode.

	x86: correct EVEX.V' handling outside of 64-bit mode
	Unlike the high bit of VEX.vvvv / EVEX.vvvv, EVEX.V' is not ignored
	outside of 64-bit mode. Oddly enough there already are tests for these
	cases, but their expectations were wrong. (This may have been based on
	an old SDM version, where the restriction wasn't properly spelled out.)

	x86: fold duplicate code in MOVSXD_Fixup()
	There's no need to have two paths printing the "xd" mnemonic suffix.

	x86: fold duplicate register printing code
	What so far was OP_E_register() can be easily reused also for OP_G().
	Add suitable parameters to the function and move the invocation of
	swap_operand() to OP_E(). Adjust MOVSXD's first operand: There never was
	a need to use movsxd_mode there, and its use gets in the way of the code
	folding.

	x86-64: properly bounds-check %bnd<N> in OP_G()
	The restriction to %bnd0-%bnd3 requires to also check REX.R is clear,
	just like OP_E_Register() also includes REX.B in its check.

	x86-64: generalize OP_G()'s EVEX.R' handling
	EVEX.R' is invalid to be clear not only for mask registers, but also for
	GPRs - IOW everything handled in this function.

2021-07-22  Jan Beulich  <jbeulich@suse.com>

	x86: correct VCVT{,U}SI2SD rounding mode handling
	With EVEX.W clear the instruction doesn't ignore the rounding mode, but
	(like for other insns without rounding semantics) EVEX.b set causes #UD.
	Hence the handling of EVEX.W needs to be done when processing
	evex_rounding_64_mode, not at the decode stages.

	Derive a new 64-bit testcase from the 32-bit one to cover the different
	EVEX.W treatment in both cases.

2021-07-22  Jan Beulich  <jbeulich@suse.com>

	x86: drop OP_Mask()
	By moving its vex.r check there it becomes fully redundant with OP_G().

2021-07-22  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-21  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.cp/step-and-next-inline.exp with gcc-11
	When running test-case gdb.cp/step-and-next-inline.exp with gcc-11, I run
	into:
	...
	KPASS: gdb.cp/step-and-next-inline.exp: no_header: next step 1 \
	  (PRMS symtab/25507)
	FAIL: gdb.cp/step-and-next-inline.exp: no_header: next step 2
	KPASS: gdb.cp/step-and-next-inline.exp: no_header: next step 3 \
	  (PRMS symtab/25507)
	...

	[ Note that I get the same result with gcc-11 and target board
	unix/gdb:debug_flags=-gdwarf-4, so this is not a dwarf 4 vs 5 issue. ]

	With gcc-10, I have this trace:
	...
	64        get_alias_set (&xx);
	get_alias_set (t=0x601038 <xx>) at step-and-next-inline.cc:51
	51        if (t != NULL
	40        if (t->x != i)
	52            && TREE_TYPE (t).z != 1
	43        return x;
	53            && TREE_TYPE (t).z != 2
	43        return x;
	54            && TREE_TYPE (t).z != 3)
	43        return x;
	main () at step-and-next-inline.cc:65
	65        return 0;
	...
	and with gcc-11, I have instead:
	...
	64        get_alias_set (&xx);
	get_alias_set (t=0x601038 <xx>) at step-and-next-inline.cc:51
	51        if (t != NULL
	52            && TREE_TYPE (t).z != 1
	43        return x;
	53            && TREE_TYPE (t).z != 2
	43        return x;
	54            && TREE_TYPE (t).z != 3)
	43        return x;
	main () at step-and-next-inline.cc:65
	65        return 0;
	...
	and with clang-10, I have instead:
	...
	64        get_alias_set (&xx);
	get_alias_set (t=0x601034 <xx>) at step-and-next-inline.cc:51
	51        if (t != NULL
	52            && TREE_TYPE (t).z != 1
	53            && TREE_TYPE (t).z != 2
	54            && TREE_TYPE (t).z != 3)
	51        if (t != NULL
	57      }
	main () at step-and-next-inline.cc:65
	65        return 0;
	...

	The test-case tries to verify that we don't step into inlined function
	tree_check (lines 40-43) (so, with the clang trace we get that right).

	The test-case then tries to kfail the problems when using gcc, but this is
	done in such a way that the testing still gets out of sync after a failure.
	That is: the "next step 2" check that is supposed to match
	"TREE_TYPE (t).z != 2" is actually matching "TREE_TYPE (t).z != 1":
	...
	(gdb) next^M
	52            && TREE_TYPE (t).z != 1^M
	(gdb) PASS: gdb.cp/step-and-next-inline.exp: no_header: next step 2
	...

	Fix this by issuing extra nexts to arrive at the required lines.

	Tested on x86_64-linux, with gcc-8, gcc-9, gcc-10, gcc-11, clang-8, clang-10
	and clang-12.

	gdb/testsuite/ChangeLog:

	2021-07-20  Tom de Vries  <tdevries@suse.de>

		* gdb.cp/step-and-next-inline.cc (tree_check, get_alias_set, main):
		Tag closing brace with comment.
		* gdb.cp/step-and-next-inline.h: Update to keep identical with
		step-and-next-inline.cc.
		* gdb.cp/step-and-next-inline.exp: Issue extra next when required.

2021-07-21  Nick Clifton  <nickc@redhat.com>

	Updated Russian translation for the bfd library

2021-07-21  Luca Boccassi  <luca.boccassi@microsoft.com>

	Allows linker scripts to set the SEC_READONLY flag.
	* ld.texi: Document new output section type.
	* ldgram.y: Add new token.
	* ldlang.c: Handle the new flag.
	* ldlang.h: Add readonly_section to list of section types.
	* ldlex.l: Add a new identifier.
	* testsuite/ld-scripts/output-section-types.t: New example linker script.
	* testsuite/ld-scripts/output-section-types.d: Test driver.
	* testsyute/ld-scripts/script.exp: Run the new test.

2021-07-21  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix FAILs due to PR gcc/101452
	When running test-case gdb.base/ptype-offsets.exp with gcc-11 (with -gdwarf-5
	default) or gcc-10 with target board unix/gdb:debug_flags=-gdwarf-5 we run
	into this regression:
	...
	 (gdb) ptype/o static_member^M
	 /* offset      |    size */  type = struct static_member {^M
	-                               static static_member Empty;^M
	 /*      0      |       4 */    int abc;^M
	 ^M
	                                /* total size (bytes):    4 */^M
	                              }^M
	-(gdb) PASS: gdb.base/ptype-offsets.exp: ptype/o static_member
	+(gdb) FAIL: gdb.base/ptype-offsets.exp: ptype/o static_member
	...

	This is caused by missing debug info, which I filed as gcc PR101452 - "[debug,
	dwarf-5] undefined static member removed by
	-feliminate-unused-debug-symbols".

	It's not clear yet whether this is a bug or a feature, but work around this in
	the test-cases by:
	- defining the static member
	- adding additional_flags=-fno-eliminate-unused-debug-types.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-07-20  Tom de Vries  <tdevries@suse.de>

		* lib/gdb.exp (gcc_major_version): New proc.
		* gdb.base/ptype-offsets.cc: Define static member static_member::Empty.
		* gdb.cp/templates.exp: Define static member using -DGCC_BUG.
		* gdb.cp/m-static.exp: Add
		additional_flags=-fno-eliminate-unused-debug-types.
		* gdb.cp/pr-574.exp: Same.
		* gdb.cp/pr9167.exp: Same.

2021-07-21  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add KFAILs for gdb.ada FAILs with gcc-11
	With gcc-11 we run into:
	...
	(gdb) print pa_ptr.all^M
	That operation is not available on integers of more than 8 bytes.^M
	(gdb) KFAIL: gdb.ada/arrayptr.exp: scenario=all: print pa_ptr.all (PRMS: gdb/20991)
	...

	This is due to PR exp/20991 - "__int128 type support".  Mark this and similar
	FAILs as KFAIL.

	Also mark this FAIL:
	....
	(gdb) print pa_ptr(3)^M
	cannot subscript or call something of type `foo__packed_array_ptr'^M
	(gdb) FAIL: gdb.ada/arrayptr.exp: scenario=minimal: print pa_ptr(3)
	...
	as a KFAIL for PR ada/28115 - "Support packed array encoded as
	DW_TAG_subrange_type".

	Tested on x86_64-linux, with gcc-10 and gcc-11.

	gdb/testsuite/ChangeLog:

	2021-07-21  Tom de Vries  <tdevries@suse.de>

		* gdb.ada/arrayptr.exp: Add KFAILs for PR20991 and PR28115.
		* gdb.ada/exprs.exp: Add KFAILs for PR20991.
		* gdb.ada/packed_array_assign.exp: Same.

2021-07-21  Alan Modra  <amodra@gmail.com>

	as_bad_subtract
	Many places report errors of the nature "can't resolve a - b".
	This provides a utility function to report such errors consistently.
	I removed the section reporting and quotes around symbol names while I
	was at it.  Compare
	ifunc-2.s:4: Error: can't resolve `bar1' {.text.1 section} - `foo1' {.text.1 section}
	with
	ifunc-2.s:4: Error: can't resolve bar1 - foo1

	In many cases the section names don't help the user very much in
	figuring out what went wrong, and the quotes if present arguably ought
	to be placed around the entire expression:
	can't resolve `bar1 - foo1'

	The patch also tidies some tc_get_reloc functions that leak memory on
	error paths.

		* write.h (as_bad_subtract): Declare.
		* write.c (as_bad_subtract): New function.
		(fixup_segment): Use as_bad_subtract.
		* config/tc-arc.c (md_apply_fix): Likewise.
		* config/tc-avr.c (md_apply_fix, tc_gen_reloc): Likewise.
		* config/tc-cris.c (md_apply_fix): Likewise.
		* config/tc-d10v.c (md_apply_fix): Likewise.
		* config/tc-d30v.c (md_apply_fix): Likewise.
		* config/tc-ft32.c (md_apply_fix): Likewise.
		* config/tc-h8300.c (tc_gen_reloc): Likewise.
		* config/tc-m68hc11.c (md_apply_fix): Likewise.
		* config/tc-mmix.c (mmix_frob_file): Likewise.
		* config/tc-mn10200.c (tc_gen_reloc): Likewise.
		* config/tc-nds32.c (nds32_apply_fix): Likewise.
		* config/tc-pru.c (md_apply_fix): Likewise.
		* config/tc-riscv.c (md_apply_fix): Likewise.
		* config/tc-s12z.c (md_apply_fix): Likewise.
		* config/tc-s390.c (md_apply_fix): Likewise.
		* config/tc-tilegx.c (md_apply_fix): Likewise.
		* config/tc-tilepro.c (md_apply_fix): Likewise.
		* config/tc-v850.c (md_apply_fix): Likewise.
		* config/tc-vax.c (md_apply_fix): Likewise.
		* config/tc-xc16x.c (tc_gen_reloc): Likewise.
		* config/tc-xgate.c (md_apply_fix): Likewise.
		* config/tc-xstormy16.c (xstormy16_md_apply_fix): Likewise.
		* config/tc-xtensa.c (md_apply_fix): Likewise.
		* config/tc-z80.c (tc_gen_reloc): Likewise.
		* config/tc-spu.c (md_apply_fix): Likewise.
		(tc_gen_reloc): Delete dead code.  Free memory on error.
		* config/tc-cr16.c (tc_gen_reloc): Use as_bad_subtract.  Free
		on error.
		* config/tc-crx.c (tc_gen_reloc): Likewise.
		* config/tc-ppc.c (tc_gen_reloc): Likewise.
		* testsuite/gas/i386/ifunc-2.l: Adjust to suit changed error message.
		* testsuite/gas/mips/lui-2.l: Likewise.
		* testsuite/gas/tic6x/reloc-bad-1.l: Likewise.

2021-07-21  John Ericson  <git@JohnEricson.me>

	Remove `netbsdpe` support
	netbsdpe was deprecated in c2ce831330e10dab4703094491f80b6b9a5c2289.
	Since then, a release has passed (2.37), and it was marked obselete in
	5c9cbf07f3f972ecffe13d858010b3179df17b32. Unless I am mistaken, that
	means we can now remove support altogether.

	All branches in the "active" code are remove, and the target is
	additionally marked as obsolete next to the other removed ones for
	libbfd and gdb.

	Per [1] from the NetBSD toolchain list, PE/COFF support was removed a
	decade ago. Furthermore, the sole mention of this target in the binutils
	commit history was in 2002. Together, I'm led to believe this target
	hasn't seen much attention in quite a while.

	[1]: https://mail-index.netbsd.org/tech-toolchain/2021/06/16/msg003996.html

	bfd/
		* config.bfd: Remove netbsdpe entry.
	binutils/
		* configure.ac: Remove netbsdpe entry.
		* testsuite/lib/binutils-common.exp (is_pecoff_format): Likewise.
		* configure: Regenerate.
	gas/
		* configure.tgt: Remove netbsdpe entry.
	gdb/
		* configure.tgt: Add netbsdpe to removed targets.
	ld/
		* configure.tgt: Remove netbsdpe entry.
		* testsuite/ld-bootstrap/bootstrap.exp: Likewise.

2021-07-21  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-20  Alan Modra  <amodra@gmail.com>

	PR28106, build of 2.37 fails on FreeBSD and Clang
	https://en.cppreference.com/w/cpp/types/NULL says NULL might be
	defined as nullptr.
	https://en.cppreference.com/w/cpp/language/reinterpret_cast says
	reinterpret_cast can't be used on nullptr.

		PR gold/28106
		PR gold/27815
		* gc.h (gc_process_relocs): Use static_cast in Section_id constructor.

2021-07-20  Luis Machado  <luis.machado@linaro.org>

	Fix printing of non-address types when memory tagging is enabled
	When the architecture supports memory tagging, we handle
	pointer/reference types in a special way, so we can validate tags and
	show mismatches.

	Unfortunately, the currently implementation errors out when the user
	prints non-address values: composite types, floats, references, member
	functions and other things.

	Vector registers:

	 (gdb) p $v0
	 Value can't be converted to integer.

	Non-existent internal variables:

	 (gdb) p $foo
	 Value can't be converted to integer.

	The same happens for complex types and printing struct/union types.

	There are a few problems here.

	The first one is that after print_command_1 evaluates the expression
	to print, the tag validation code call value_as_address
	unconditionally, without making sure we have have a suitable type
	where it makes to sense to call it.  That results in value_as_address
	(if it isn't given a pointer-like type) trying to treat the value as
	an integer and convert it to an address, which #1 - doesn't make sense
	(i.e., no sense in validating tags after "print 1"), and throws for
	non-integer-convertible types.  We fix this by making sure we have a
	pointer or reference type first, and only if so then proceed to check
	if the address-like value has tags.

	The second is that we're calling value_as_address even if we have an
	optimized out or unavailable value, which throws, because the value's
	contents aren't fully accessible/readable.  This error currently
	escapes out and aborts the print.  This case is fixed by checking for
	optimized out / unavailable explicitly.

	Third, the tag checking process does not gracefully handle exceptions.
	If any exception is thrown from the tag validation code, we abort the
	print.  E.g., the target may fail to access tags via a running thread.
	Or the needed /proc files aren't available.  Or some other untold
	reason.  This is a bit too rigid.  This commit changes print_command_1
	to catch errors, print them, and still continue with the normal
	expression printing path instead of erroring out and printing nothing
	useful.

	With this patch, printing works correctly again:

	 (gdb) p $v0
	 $1 = {d = {f = {2.0546950501119882e-81, 2.0546950501119882e-81}, u = {3399988123389603631, 3399988123389603631}, s = {
	       3399988123389603631, 3399988123389603631}}, s = {f = {1.59329203e-10, 1.59329203e-10, 1.59329203e-10, 1.59329203e-10}, u = {
	       791621423, 791621423, 791621423, 791621423}, s = {791621423, 791621423, 791621423, 791621423}}, h = {bf = {1.592e-10,
	       1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10, 1.592e-10}, f = {0.11224, 0.11224, 0.11224, 0.11224, 0.11224,
	       0.11224, 0.11224, 0.11224}, u = {12079, 12079, 12079, 12079, 12079, 12079, 12079, 12079}, s = {12079, 12079, 12079, 12079,
	       12079, 12079, 12079, 12079}}, b = {u = {47 <repeats 16 times>}, s = {47 <repeats 16 times>}}, q = {u = {
	       62718710765820030520700417840365121327}, s = {62718710765820030520700417840365121327}}}
	 (gdb) p $foo
	 $2 = void
	 (gdb) p 2 + 2i
	 $3 = 2 + 2i

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28110

2021-07-20  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Minor updates for architecture parser.
	* Two add subset functions is redundant.  Keep the riscv_add_implicit_subset,
	and renamed it to riscv_add_subset.  Besides, if the subset is added in order,
	then we just add it at the tail of the subset list.

	* Removed the "-march:" prefix from the error messages.  Since not only the
	-march= option will use the parser, but also the architecture elf attributes,
	the default architecture setting and linker will use the same parser.

	* Use a function, riscv_parse_check_conflicts, to check the conflicts
	of extensions, including the rv64e and rv32q.

	The rv32emc-elf/rv32i-elf/rv32gc-linux/rv64gc-elf/rv64gc-linux regressions
	are tested and passed.

	bfd/
		* elfxx-riscv.c (riscv_lookup_subset): Check the subset tail list
		first.  If the subset is added in order, then we can just add it to
		the tail without searching the whole list.
		(riscv_add_subset): Replaced by riscv_add_implicit_subset.
		(riscv_add_implicit_subset): Renamed to riscv_add_subset.
		(riscv_parse_add_subset): Updated.
		(riscv_parsing_subset_version): Removed the "-march:" prefix from
		the error message.
		(riscv_parse_prefixed_ext): Likewise.
		(riscv_parse_std_ext): Likewise.  And move the rv<xlen>e check
		to riscv_parse_check_conflicts.
		(riscv_parse_check_conflicts): New function used to check conflicts.
		(riscv_parse_subset): Updated.
	gas/
		* testsuite/gas/riscv/march-fail-base-02.l: Updated.
		* testsuite/gas/riscv/march-fail-unknown-std.l: Likewise.

2021-07-20  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-19  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: set current thread in btrace_compute_ftrace_{bts,pt}
	As documented in bug 28086, test gdb.btrace/enable-new-thread.exp
	started failing with commit 0618ae414979 ("gdb: optimize
	all_matching_threads_iterator"):

	    (gdb) record btrace^M
	    (gdb) PASS: gdb.btrace/enable-new-thread.exp: record btrace
	    break 24^M
	    Breakpoint 2 at 0x555555555175: file /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.btrace/enable-new-thread.c, line 24.^M
	    (gdb) continue^M
	    Continuing.^M
	    /home/smarchi/src/binutils-gdb/gdb/inferior.c:303: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed.^M
	    A problem internal to GDB has been detected,^M
	    further debugging may prove unreliable.^M
	    Quit this debugging session? (y or n) FAIL: gdb.btrace/enable-new-thread.exp: continue to breakpoint: cont to bp.1 (GDB internal error)

	Note that I only see the failure if GDB is compiled without libipt
	support.  This is because GDB then makes use BTS instead of PT, so
	exercises different code paths.

	I think that the commit above just exposed an existing problem.  The
	stack trace of the internal error is:

	    #8  0x0000561cb81e404e in internal_error (file=0x561cb83aa2f8 "/home/smarchi/src/binutils-gdb/gdb/inferior.c", line=303, fmt=0x561cb83aa099 "%s: Assertion `%s' failed.") at /home/smarchi/src/binutils-gdb/gdbsupport/errors.cc:55
	    #9  0x0000561cb7b5c031 in find_inferior_pid (targ=0x561cb8aafb60 <the_amd64_linux_nat_target>, pid=0) at /home/smarchi/src/binutils-gdb/gdb/inferior.c:303
	    #10 0x0000561cb7b5c102 in find_inferior_ptid (targ=0x561cb8aafb60 <the_amd64_linux_nat_target>, ptid=...) at /home/smarchi/src/binutils-gdb/gdb/inferior.c:317
	    #11 0x0000561cb7f1d1c3 in find_thread_ptid (targ=0x561cb8aafb60 <the_amd64_linux_nat_target>, ptid=...) at /home/smarchi/src/binutils-gdb/gdb/thread.c:487
	    #12 0x0000561cb7f1b921 in all_matching_threads_iterator::all_matching_threads_iterator (this=0x7ffc4ee34678, filter_target=0x561cb8aafb60 <the_amd64_linux_nat_target>, filter_ptid=...) at /home/smarchi/src/binutils-gdb/gdb/thread-iter.c:125
	    #13 0x0000561cb77bc462 in filtered_iterator<all_matching_threads_iterator, non_exited_thread_filter>::filtered_iterator<process_stratum_target* const&, ptid_t const&> (this=0x7ffc4ee34670) at /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/filtered-iterator.h:42
	    #14 0x0000561cb77b97cb in all_non_exited_threads_range::begin (this=0x7ffc4ee34650) at /home/smarchi/src/binutils-gdb/gdb/thread-iter.h:243
	    #15 0x0000561cb7d8ba30 in record_btrace_target::record_is_replaying (this=0x561cb8aa6250 <record_btrace_ops>, ptid=...) at /home/smarchi/src/binutils-gdb/gdb/record-btrace.c:1411
	    #16 0x0000561cb7d8bb83 in record_btrace_target::xfer_partial (this=0x561cb8aa6250 <record_btrace_ops>, object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x7ffc4ee34c58 "\260g\343N\374\177", writebuf=0x0, offset=140737352774277, len=1, xfered_len=0x7ffc4ee34ad8) at /home/smarchi/src/binutils-gdb/gdb/record-btrace.c:1437
	    #17 0x0000561cb7ef73a9 in raw_memory_xfer_partial (ops=0x561cb8aa6250 <record_btrace_ops>, readbuf=0x7ffc4ee34c58 "\260g\343N\374\177", writebuf=0x0, memaddr=140737352774277, len=1, xfered_len=0x7ffc4ee34ad8) at /home/smarchi/src/binutils-gdb/gdb/target.c:1504
	    #18 0x0000561cb7ef77da in memory_xfer_partial_1 (ops=0x561cb8aa6250 <record_btrace_ops>, object=TARGET_OBJECT_CODE_MEMORY, readbuf=0x7ffc4ee34c58 "\260g\343N\374\177", writebuf=0x0, memaddr=140737352774277, len=1, xfered_len=0x7ffc4ee34ad8) at /home/smarchi/src/binutils-gdb/gdb/target.c:1635
	    #19 0x0000561cb7ef78b5 in memory_xfer_partial (ops=0x561cb8aa6250 <record_btrace_ops>, object=TARGET_OBJECT_CODE_MEMORY, readbuf=0x7ffc4ee34c58 "\260g\343N\374\177", writebuf=0x0, memaddr=140737352774277, len=1, xfered_len=0x7ffc4ee34ad8) at /home/smarchi/src/binutils-gdb/gdb/target.c:1664
	    #20 0x0000561cb7ef7ba4 in target_xfer_partial (ops=0x561cb8aa6250 <record_btrace_ops>, object=TARGET_OBJECT_CODE_MEMORY, annex=0x0, readbuf=0x7ffc4ee34c58 "\260g\343N\374\177", writebuf=0x0, offset=140737352774277, len=1, xfered_len=0x7ffc4ee34ad8) at /home/smarchi/src/binutils-gdb/gdb/target.c:1721
	    #21 0x0000561cb7ef8503 in target_read_partial (ops=0x561cb8aa6250 <record_btrace_ops>, object=TARGET_OBJECT_CODE_MEMORY, annex=0x0, buf=0x7ffc4ee34c58 "\260g\343N\374\177", offset=140737352774277, len=1, xfered_len=0x7ffc4ee34ad8) at /home/smarchi/src/binutils-gdb/gdb/target.c:1974
	    #22 0x0000561cb7ef861f in target_read (ops=0x561cb8aa6250 <record_btrace_ops>, object=TARGET_OBJECT_CODE_MEMORY, annex=0x0, buf=0x7ffc4ee34c58 "\260g\343N\374\177", offset=140737352774277, len=1) at /home/smarchi/src/binutils-gdb/gdb/target.c:2014
	    #23 0x0000561cb7ef809f in target_read_code (memaddr=140737352774277, myaddr=0x7ffc4ee34c58 "\260g\343N\374\177", len=1) at /home/smarchi/src/binutils-gdb/gdb/target.c:1869
	    #24 0x0000561cb7937f4d in gdb_disassembler::dis_asm_read_memory (memaddr=140737352774277, myaddr=0x7ffc4ee34c58 "\260g\343N\374\177", len=1, info=0x7ffc4ee34e88) at /home/smarchi/src/binutils-gdb/gdb/disasm.c:139
	    #25 0x0000561cb80ab66d in fetch_data (info=0x7ffc4ee34e88, addr=0x7ffc4ee34c59 "g\343N\374\177") at /home/smarchi/src/binutils-gdb/opcodes/i386-dis.c:194
	    #26 0x0000561cb80ab7e2 in ckprefix () at /home/smarchi/src/binutils-gdb/opcodes/i386-dis.c:8628
	    #27 0x0000561cb80adbd8 in print_insn (pc=140737352774277, info=0x7ffc4ee34e88) at /home/smarchi/src/binutils-gdb/opcodes/i386-dis.c:9587
	    #28 0x0000561cb80abe4f in print_insn_i386 (pc=140737352774277, info=0x7ffc4ee34e88) at /home/smarchi/src/binutils-gdb/opcodes/i386-dis.c:8894
	    #29 0x0000561cb7744a19 in default_print_insn (memaddr=140737352774277, info=0x7ffc4ee34e88) at /home/smarchi/src/binutils-gdb/gdb/arch-utils.c:1029
	    #30 0x0000561cb7b33067 in i386_print_insn (pc=140737352774277, info=0x7ffc4ee34e88) at /home/smarchi/src/binutils-gdb/gdb/i386-tdep.c:4013
	    #31 0x0000561cb7acd8f4 in gdbarch_print_insn (gdbarch=0x561cbae2fb60, vma=140737352774277, info=0x7ffc4ee34e88) at /home/smarchi/src/binutils-gdb/gdb/gdbarch.c:3478
	    #32 0x0000561cb793a32d in gdb_disassembler::print_insn (this=0x7ffc4ee34e80, memaddr=140737352774277, branch_delay_insns=0x0) at /home/smarchi/src/binutils-gdb/gdb/disasm.c:795
	    #33 0x0000561cb793a5b0 in gdb_print_insn (gdbarch=0x561cbae2fb60, memaddr=140737352774277, stream=0x561cb8ac99f8 <null_stream>, branch_delay_insns=0x0) at /home/smarchi/src/binutils-gdb/gdb/disasm.c:850
	    #34 0x0000561cb793a631 in gdb_insn_length (gdbarch=0x561cbae2fb60, addr=140737352774277) at /home/smarchi/src/binutils-gdb/gdb/disasm.c:859
	    #35 0x0000561cb77f53f4 in btrace_compute_ftrace_bts (tp=0x561cbba11210, btrace=0x7ffc4ee35188, gaps=...) at /home/smarchi/src/binutils-gdb/gdb/btrace.c:1107
	    #36 0x0000561cb77f55f5 in btrace_compute_ftrace_1 (tp=0x561cbba11210, btrace=0x7ffc4ee35180, cpu=0x0, gaps=...) at /home/smarchi/src/binutils-gdb/gdb/btrace.c:1527
	    #37 0x0000561cb77f5705 in btrace_compute_ftrace (tp=0x561cbba11210, btrace=0x7ffc4ee35180, cpu=0x0) at /home/smarchi/src/binutils-gdb/gdb/btrace.c:1560
	    #38 0x0000561cb77f583b in btrace_add_pc (tp=0x561cbba11210) at /home/smarchi/src/binutils-gdb/gdb/btrace.c:1589
	    #39 0x0000561cb77f5a86 in btrace_enable (tp=0x561cbba11210, conf=0x561cb8ac6878 <record_btrace_conf>) at /home/smarchi/src/binutils-gdb/gdb/btrace.c:1629
	    #40 0x0000561cb7d88d26 in record_btrace_enable_warn (tp=0x561cbba11210) at /home/smarchi/src/binutils-gdb/gdb/record-btrace.c:294
	    #41 0x0000561cb7c603dc in std::__invoke_impl<void, void (*&)(thread_info*), thread_info*> (__f=@0x561cbb6c4878: 0x561cb7d88cdc <record_btrace_enable_warn(thread_info*)>) at /usr/include/c++/10/bits/invoke.h:60
	    #42 0x0000561cb7c5e5a6 in std::__invoke_r<void, void (*&)(thread_info*), thread_info*> (__fn=@0x561cbb6c4878: 0x561cb7d88cdc <record_btrace_enable_warn(thread_info*)>) at /usr/include/c++/10/bits/invoke.h:153
	    #43 0x0000561cb7c5dc92 in std::_Function_handler<void (thread_info*), void (*)(thread_info*)>::_M_invoke(std::_Any_data const&, thread_info*&&) (__functor=..., __args#0=@0x7ffc4ee35310: 0x561cbba11210) at /usr/include/c++/10/bits/std_function.h:291
	    #44 0x0000561cb7f2600f in std::function<void (thread_info*)>::operator()(thread_info*) const (this=0x561cbb6c4878, __args#0=0x561cbba11210) at /usr/include/c++/10/bits/std_function.h:622
	    #45 0x0000561cb7f23dc8 in gdb::observers::observable<thread_info*>::notify (this=0x561cb8ac5aa0 <gdb::observers::new_thread>, args#0=0x561cbba11210) at /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/observable.h:150
	    #46 0x0000561cb7f1c436 in add_thread_silent (targ=0x561cb8aafb60 <the_amd64_linux_nat_target>, ptid=...) at /home/smarchi/src/binutils-gdb/gdb/thread.c:263
	    #47 0x0000561cb7f1c479 in add_thread_with_info (targ=0x561cb8aafb60 <the_amd64_linux_nat_target>, ptid=..., priv=0x561cbb3f7ab0) at /home/smarchi/src/binutils-gdb/gdb/thread.c:272
	    #48 0x0000561cb7bfa1d0 in record_thread (info=0x561cbb0413a0, tp=0x0, ptid=..., th_p=0x7ffc4ee35610, ti_p=0x7ffc4ee35620) at /home/smarchi/src/binutils-gdb/gdb/linux-thread-db.c:1380
	    #49 0x0000561cb7bf7a2a in thread_from_lwp (stopped=0x561cba81db20, ptid=...) at /home/smarchi/src/binutils-gdb/gdb/linux-thread-db.c:429
	    #50 0x0000561cb7bf7ac5 in thread_db_notice_clone (parent=..., child=...) at /home/smarchi/src/binutils-gdb/gdb/linux-thread-db.c:447
	    #51 0x0000561cb7bdc9a2 in linux_handle_extended_wait (lp=0x561cbae25720, status=4991) at /home/smarchi/src/binutils-gdb/gdb/linux-nat.c:1981
	    #52 0x0000561cb7bdf0f3 in linux_nat_filter_event (lwpid=435403, status=198015) at /home/smarchi/src/binutils-gdb/gdb/linux-nat.c:2920
	    #53 0x0000561cb7bdfed6 in linux_nat_wait_1 (ptid=..., ourstatus=0x7ffc4ee36398, target_options=...) at /home/smarchi/src/binutils-gdb/gdb/linux-nat.c:3202
	    #54 0x0000561cb7be0b68 in linux_nat_target::wait (this=0x561cb8aafb60 <the_amd64_linux_nat_target>, ptid=..., ourstatus=0x7ffc4ee36398, target_options=...) at /home/smarchi/src/binutils-gdb/gdb/linux-nat.c:3440
	    #55 0x0000561cb7bfa2fc in thread_db_target::wait (this=0x561cb8a9acd0 <the_thread_db_target>, ptid=..., ourstatus=0x7ffc4ee36398, options=...) at /home/smarchi/src/binutils-gdb/gdb/linux-thread-db.c:1412
	    #56 0x0000561cb7d8e356 in record_btrace_target::wait (this=0x561cb8aa6250 <record_btrace_ops>, ptid=..., status=0x7ffc4ee36398, options=...) at /home/smarchi/src/binutils-gdb/gdb/record-btrace.c:2547
	    #57 0x0000561cb7ef996d in target_wait (ptid=..., status=0x7ffc4ee36398, options=...) at /home/smarchi/src/binutils-gdb/gdb/target.c:2608
	    #58 0x0000561cb7b6d297 in do_target_wait_1 (inf=0x561cba6d8780, ptid=..., status=0x7ffc4ee36398, options=...) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:3640
	    #59 0x0000561cb7b6d43e in operator() (__closure=0x7ffc4ee36190, inf=0x561cba6d8780) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:3701
	    #60 0x0000561cb7b6d7b2 in do_target_wait (ecs=0x7ffc4ee36370, options=...) at /home/smarchi/src/binutils-gdb/gdb/infrun.c:3720
	    #61 0x0000561cb7b6e67d in fetch_inferior_event () at /home/smarchi/src/binutils-gdb/gdb/infrun.c:4069
	    #62 0x0000561cb7b4659b in inferior_event_handler (event_type=INF_REG_EVENT) at /home/smarchi/src/binutils-gdb/gdb/inf-loop.c:41
	    #63 0x0000561cb7be25f7 in handle_target_event (error=0, client_data=0x0) at /home/smarchi/src/binutils-gdb/gdb/linux-nat.c:4227
	    #64 0x0000561cb81e4ee2 in handle_file_event (file_ptr=0x561cbae24e10, ready_mask=1) at /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:575
	    #65 0x0000561cb81e5490 in gdb_wait_for_event (block=0) at /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:701
	    #66 0x0000561cb81e41be in gdb_do_one_event () at /home/smarchi/src/binutils-gdb/gdbsupport/event-loop.cc:212
	    #67 0x0000561cb7c18096 in start_event_loop () at /home/smarchi/src/binutils-gdb/gdb/main.c:421
	    #68 0x0000561cb7c181e0 in captured_command_loop () at /home/smarchi/src/binutils-gdb/gdb/main.c:481
	    #69 0x0000561cb7c19d7e in captured_main (data=0x7ffc4ee366a0) at /home/smarchi/src/binutils-gdb/gdb/main.c:1353
	    #70 0x0000561cb7c19df0 in gdb_main (args=0x7ffc4ee366a0) at /home/smarchi/src/binutils-gdb/gdb/main.c:1368
	    #71 0x0000561cb7693186 in main (argc=11, argv=0x7ffc4ee367b8) at /home/smarchi/src/binutils-gdb/gdb/gdb.c:32

	At frame 45, the new_thread observable is fired.  At this moment, the
	new thread isn't the current thread, inferior_ptid is null_ptid.  I
	think this is ok: the new_thread observable doesn't give any guarantee
	on the global context when observers are invoked.  Frame 35,
	btrace_compute_ftrace_bts, calls gdb_insn_length.  gdb_insn_length
	doesn't have a thread_info or other parameter what could indicate where
	to read memory from, it implicitly uses the global context
	(inferior_ptid).

	So we reach the all_non_exited_threads_range in
	record_btrace_target::record_is_replaying with a null inferior_ptid.
	The previous implemention of all_non_exited_threads_range didn't care,
	but the new one does.  The problem of calling gdb_insn_length and
	ultimately trying to read memory with a null inferior_ptid already
	existed, but the commit mentioned above made it visible.

	Something between frames 40 (record_btrace_enable_warn) and 35
	(btrace_compute_ftrace_bts) needs to be switching the global context to
	make TP the current thread.  Since btrace_compute_ftrace_bts takes the
	thread_info to work with as a parameter, that typically means that it
	doesn't require its caller to also set the global current context
	(current thread) when calling.  If it needs to call other functions
	that do require the global current thread to be set, then it needs to
	temporarily change the current thread while calling these other
	functions.  Therefore, switch and restore the current thread in
	btrace_compute_ftrace_bts.

	By inspection, it looks like btrace_compute_ftrace_pt may also call
	functions sensitive to the global context: it installs the
	btrace_pt_readmem_callback callback in the PT instruction decoder.  When
	this function gets called, inferior_ptid must be set appropriately.  Add
	a switch and restore in there too.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28086
	Change-Id: I407fbfe41aab990068bd102491aa3709b0a034b3

2021-07-19  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-18  Nick Clifton  <nickc@redhat.com>

	Move pending-obsolesence targets onto the obsolete list.
		* config.bfd: Move pending obsoletion targets to obsolete list.

	Update how-to-make-a-release checklist with latest changes from 2.37 release

2021-07-18  Michael Krasnyk  <mkrasnyk@argo.ai>

	PR28098 Skip R_*_NONE relocation entries with zero r_sym without counting
		PR gold/28098
		* reloc.cc (Track_relocs::advance): Skip R_*_NONE relocation entries
		with r_sym of zero without counting in advance method.

2021-07-18  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: convert nat/x86-dregs.c macros to functions
	I'm debugging why GDB crashes on OpenBSD/amd64, turns out it's because
	x86_dr_low.get_status is nullptr.  It would have been useful to be able
	to break on x86_dr_low_get_status, so I thought it would be a good
	reason to convert these function-like macros into functions.

	Change-Id: Ic200b50ef8455b4697bc518da0fa2bb704cf4721

2021-07-18  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-17  Tom Tromey  <tom@tromey.com>

	Fix file-name handling regression with DWARF index
	When run with the gdb-index or debug-names target boards, dup-psym.exp
	fails.  This came up for me because my new DWARF scanner reuses this
	part of the existing index code, and so it registers as a regression.
	This is PR symtab/25834.

	Looking into this, I found that the DWARF index code here is fairly
	different from the psymtab code.  I don't think there's a deep reason
	for this, and in fact, it seemed to me that the index code could
	simply mimic what the psymtab code already does.

	That is what this patch implements.  The DW_AT_name and DW_AT_comp_dir
	are now stored in the quick file names table.  This may require
	allocating a quick file names table even when DW_AT_stmt_list does not
	exist.  Then, the functions that work with this data are changed to
	use find_source_or_rewrite, just as the psymbol code does.  Finally,
	line_header::file_full_name is removed, as it is no longer needed.

	Currently, the index maintains a hash table of "quick file names".
	The hash table uses a deletion function to free the "real name"
	components when necessary.  There's also a second such function to
	implement the forget_cached_source_info method.

	This bug fix patch will create a quick file name object even when
	there is no DW_AT_stmt_list, meaning that the object won't be entered
	in the hash table.  So, this patch changes the memory management
	approach so that the entries are cleared when the per-BFD object is
	destroyed.  (A dwarf2_per_cu_data destructor is not introduced,
	because we have been avoiding adding a vtable to that class.)

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25834

2021-07-17  Tom Tromey  <tom@tromey.com>

	Check for debug-types in map_symbol_filenames
	map_symbol_filenames can skip type units -- in fact I think it has to,
	due to the assertion at the top of dw2_get_file_names.  This may be a
	regression due to the TU/CU unification patch, I did not check.

	Simplify DWARF file name caching
	The DWARF index file name caching code only records when a line table
	has been read and the reading failed.  However, the code would be
	simpler if it recorded any attempt, which is what this patch
	implements.

	Introduce find_source_or_rewrite
	The final bug fix in this series would duplicate the logic in
	psymtab_to_fullname, so this patch extracts the body of this function
	into a new function.

	Simplify file_and_directory storage management
	file_and_directory carries a std::string in case the compilation
	directory is computed, but a subsequent patch wants to preserve this
	string without also having to maintain the storage for it.  So, this
	patch arranges for the compilation directory string to be stored in
	the per-BFD string bcache instead.

	Pass file_and_directory through DWARF line-decoding code
	This patch removes the redundant "comp_unit" parameter from
	compute_include_file_name, and arranges to pass a file_and_directory
	object from the readers down to this function.  It also changes the
	partial symtab reader to use find_file_and_directory, rather than
	reimplement this functionality by hand.

	Rename and refactor psymtab_include_file_name
	In order to fix an index-related regression, I want to use
	psymtab_include_file_name in the DWARF index file-handling code.  This
	patch renames this function and changes it to no longer require a
	partial symtab to be passed in.  A subsequent patch will further
	refactor this code to remove the redundant parameter (which was always
	there but is now more obvious).

2021-07-17  Sergey Belyashov  <Sergey.Belyashov@gmail.com>

	Add basic Z80 CPU support
	Supported ISAs:
	- Z80 (all undocumented instructions)
	- Z180
	- eZ80 (Z80 mode only)

	Datasheets:
	Z80: https://www.zilog.com/manage_directlink.php?filepath=docs/z80/um0080&extn=.pdf
	Z180: https://www.zilog.com/manage_directlink.php?filepath=docs/z180/ps0140&extn=.pdf
	eZ80: http://www.zilog.com/force_download.php?filepath=YUhSMGNEb3ZMM2QzZHk1NmFXeHZaeTVqYjIwdlpHOWpjeTlWVFRBd056Y3VjR1Jt

	To debug Z80 programs using GDB you must configure and embed
	z80-stub.c to your program (SDCC compiler is required). Or
	you may use some simulator with GDB support.

	gdb/ChangeLog:

		* Makefile.in (ALL_TARGET_OBS): Add z80-tdep.c.
		* NEWS: Mention z80 support.
		* configure.tgt: Handle z80*.
		* features/Makefile (XMLTOC): Add z80.xml.
		* features/z80-cpu.xml: New.
		* features/z80.c: Generate.
		* features/z80.xml: New.
		* z80-tdep.c: New file.
		* z80-tdep.h: New file.

	gdb/stubs/ChangeLog:

		* z80-stub.c: New file.

	Change-Id: Id0b7a6e210c3f93c6853c5e3031b7bcee47d0db9

2021-07-17  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make all_inferiors_safe actually work
	The test gdb.threads/fork-plus-threads.exp fails since 08bdefb58b78
	("gdb: make inferior_list use intrusive_list"):

	    FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: only inferior 1 left

	Looking at the log, we see that we are left with a bunch of inferiors in
	the detach-on-fork=off case:

	    info inferiors^M
	      Num  Description       Connection           Executable        ^M
	    * 1    <null>                                 <snip>/fork-plus-threads ^M
	      2    <null>                                 <snip>/fork-plus-threads ^M
	      3    <null>                                 <snip>/fork-plus-threads ^M
	      4    <null>                                 <snip>/fork-plus-threads ^M
	      5    <null>                                 <snip>/fork-plus-threads ^M
	      6    <null>                                 <snip>/fork-plus-threads ^M
	      7    <null>                                 <snip>/fork-plus-threads ^M
	      8    <null>                                 <snip>/fork-plus-threads ^M
	      9    <null>                                 <snip>/fork-plus-threads ^M
	      10   <null>                                 <snip>/fork-plus-threads ^M
	      11   <null>                                 <snip>/fork-plus-threads ^M
	    (gdb) FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: only inferior 1 left

	when we expect to have just one.  The problem is prune_inferiors not
	pruning inferiors.  And this is caused by all_inferiors_safe not
	actually iterating on inferiors.  The current implementation:

	  inline all_inferiors_safe_range
	  all_inferiors_safe ()
	  {
	    return {};
	  }

	default-constructs an all_inferiors_safe_range, which default-constructs
	an all_inferiors_safe_iterator as its m_begin field, which
	default-constructs a all_inferiors_iterator.  A default-constructed
	all_inferiors_iterator is an end iterator, which means we have
	constructed an (end,end) all_inferiors_safe_range.

	We actually need to pass down the list on which we want to iterator
	(that is the inferior_list global), so that all_inferiors_iterator's
	first constructor is chosen.  We also pass nullptr as the proc_target
	filter.  In this case, we don't do any filtering, but if in the future
	all_inferiors_safe needed to allow filtering on process target (like
	all_inferiors does), we could pass down a process target pointer.

	basic_safe_iterator's constructor needs to be changed to allow
	constructing the wrapped iterator with multiple arguments, not just one.

	With this, gdb.threads/fork-plus-threads.exp is passing once again for
	me.

	Change-Id: I650552ede596e3590c4b7606ce403690a0278a01

2021-07-17  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-16  Lancelot SIX  <lsix@lancelotsix.com>

	gdb: Support stepping out from signal handler on riscv*-linux
	Currently, gdb cannot step outside of a signal handler on RISC-V
	platforms.  This causes multiple failures in gdb.base/sigstep.exp:

		FAIL: gdb.base/sigstep.exp: continue to handler, nothing in handler, step from handler: leave handler (timeout)
		FAIL: gdb.base/sigstep.exp: continue to handler, si+advance in handler, step from handler: leave handler (timeout)
		FAIL: gdb.base/sigstep.exp: continue to handler, nothing in handler, next from handler: leave handler (timeout)
		FAIL: gdb.base/sigstep.exp: continue to handler, si+advance in handler, next from handler: leave handler (timeout)
		FAIL: gdb.base/sigstep.exp: stepi from handleri: leave signal trampoline
		FAIL: gdb.base/sigstep.exp: nexti from handleri: leave signal trampoline

		                === gdb Summary ===

		# of expected passes            587
		# of unexpected failures        6

	This patch adds support for stepping outside of a signal handler on
	riscv*-*-linux*.

	Implementation is heavily inspired from mips_linux_syscall_next_pc and
	surroundings as advised by Pedro Alves.

	After this patch, all tests in gdb.base/sigstep.exp pass.

	Build and tested on riscv64-linux-gnu.

2021-07-16  Lancelot SIX  <lsix@lancelotsix.com>

	gdb/testsuite: Declare that riscv*-*-linux* cannot hardware_single_step
	Many tests fail in gdb/testsuite/gdb.base/sigstep.exp on
	riscv64-linux-gnu.  Those tests check that when stepping, if the
	debuggee received a signal it should step inside the signal handler.

	This feature requires hardware support for single stepping (or at least
	kernel support), but none are available on riscv*-linux-gnu hosts, at
	the moment at least.

	This patch adds RISC-V to the list of configurations that does not
	have hardware single step capability, disabling tests relying on such
	feature.

	Tested on riscv64-linux-gnu.

2021-07-16  Tom Tromey  <tom@tromey.com>

	Document quick_symbol_functions::expand_symtabs_matching invariant
	While working on my series to replace the DWARF psymbol reader, I
	noticed that the expand_symtabs_matching has an undocumented
	invariant.  I think that, if this invariant is not followed, then GDB
	will crash.  So, this patch documents this in the relevant spots and
	introduces some asserts to make it clear.

	Regression tested on x86-64 Fedora 32.

2021-07-16  Tom Tromey  <tromey@adacore.com>

	Fix array stride bug
	Investigation of using the Python API with an Ada program showed that
	an array of dynamic types was not being handled properly.  I tracked
	this down to an oddity of how array strides are handled.

	In gdb, an array stride can be attached to the range type, via the
	range_bounds object.  However, the stride can also be put into the
	array's first field.  From create_range_type_with_stride:

	  else if (bit_stride > 0)
	    TYPE_FIELD_BITSIZE (result_type, 0) = bit_stride;

	It's hard to be sure why this is done, but I would guess a combination
	of historical reasons plus a desire (mentioned in a comment somewhere)
	to avoid modifying the range type.

	This patch fixes the problem by changing type::bit_stride to
	understand this convention.  It also fixes one spot that reproduces
	this logic.

	Regression tested on x86-64 Fedora 32.

2021-07-16  Giulio Benetti  <giulio.benetti@benettiengineering.com>

	or1k: fix pc-relative relocation against dynamic on PC relative 26 bit relocation.
	bfd	* elf32-or1k.c (or1k_elf_relocate_section): Use a separate entry
		in switch case R_OR1K_INSN_REL_26 where we need to check for
		!SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().

2021-07-16  Nick Clifton  <nickc@redhat.com>

	Updated Swedish translation for the binutils sub-directory

2021-07-16  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-15  Tom Tromey  <tromey@adacore.com>

	Avoid expression parsing crash with unknown language
	PR gdb/28093 points out that gdb crashes when language is set to
	"unknown" and expression parsing is attempted.  At first I thought
	this was a regression due to the expression rewrite, but it turns out
	that older versions crash as well.

	This patch avoids the crash by changing the default expression parser
	to throw an exception.  I think this is preferable -- the current
	behavior of silently doing nothing does not really make sense.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28093

2021-07-15  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: pass child_ptid and fork kind to target_ops::follow_fork
	This is a small cleanup I think would be nice, that I spotted while
	doing the following patch.

	gdb/ChangeLog:

		* target.h (struct target_ops) <follow_fork>: Add ptid and
		target_waitkind parameters.
		(target_follow_fork): Likewise.
		* target.c (default_follow_fork): Likewise.
		(target_follow_fork): Likewise.
		* fbsd-nat.h (class fbsd_nat_target) <follow_fork>: Likewise.
		* fbsd-nat.c (fbsd_nat_target::follow_fork): Likewise.
		* linux-nat.h (class linux_nat_target) <follow_fork>: Likewise.
		* linux-nat.c (linux_nat_target::follow_fork): Likewise.
		* obsd-nat.h (class obsd_nat_target) <follow_fork>: Likewise.
		* obsd-nat.c (obsd_nat_target::follow_fork): Likewise.
		* remote.c (class remote_target) <follow_fork>: Likewise.
		* target-debug.h (target_debug_print_target_waitkind): New.
		* target-delegates.c: Re-generate.

	Change-Id: I5421a542f2e19100a22b74cc333d2b235d0de3c8

2021-07-15  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: call post_create_inferior at end of follow_fork_inferior
	GDB doesn't handle well the case of an inferior using the JIT interface
	to register JIT-ed objfiles and forking.  If an inferior registers a
	code object using the JIT interface and then forks, the child process
	conceptually has the same code object loaded, so GDB should look it up
	and learn about it (it currently doesn't).

	To achieve this, I think it would make sense to have the
	inferior_created observable called when an inferior is created due to a
	fork in follow_fork_inferior.  The inferior_created observable is
	currently called both after starting a new inferior and after attaching
	to an inferior, allowing various sub-components to learn about that new
	executing inferior.  We can see handling a fork child just like
	attaching to it, so any work done when attaching should also be done in
	the case of a fork child.

	Instead of just calling the inferior_created observable, this patch
	makes follow_fork_inferior call the whole post_create_inferior function.
	This way, the attach and follow-fork code code paths are more alike.

	Given that post_create_inferior calls solib_create_inferior_hook,
	follow_fork_inferior doesn't need to do it itself, so those calls to
	solib_create_inferior_hook are removed.

	One question you may have: why not just call post_create_inferior at the
	places where solib_create_inferior_hook is currently called, instead of
	after target_follow_fork?

	 - there's something fishy for the second solib_create_inferior_hook
	   call site: at this point we have switched the current program space
	   to the child's, but not the current inferior nor the current thread.
	   So solib_create_inferior_hook (and everything under, including
	   check_for_thread_db, for example) is called with inferior 1 as the
	   current inferior and inferior 2's program space as the current
	   program space.  I think that's wrong, because at this point we are
	   setting up inferior 2, and all that code relies on the current
	   inferior.  We could just add a switch_to_thread call before it to
	   make inferior 2 the current one, but there are other problems (see
	   below).

	 - solib_create_inferior_hook is currently not called on the
	   `follow_child && detach_fork` path.  I think we need to call it,
	   because we still get a new inferior in that case (even though we
	   detach the parent).  If we only call post_create_inferior where
	   solib_create_inferior_hook used to be called, then the JIT
	   subcomponent doesn't get informed about the new inferior, and that
	   introduces a failure in the new gdb.base/jit-elf-fork.exp test.

	 - if we try to put the post_create_inferior just after the
	   switch_to_thread that was originally at line 662, or just before the
	   call to target_follow_fork, we introduce a subtle failure in
	   gdb.threads/fork-thread-pending.exp.  What happens then is that
	   libthread_db gets loaded (somewhere under post_create_inferior)
	   before the linux-nat target learns about the LWPs (which happens in
	   linux_nat_target::follow_fork).  As a result, the ALL_LWPS loop in
	   try_thread_db_load_1 doesn't see the child LWP, and the thread-db
	   target doesn't have the chance to fill in thread_info::priv.  A bit
	   later, when the test does "info threads", and
	   thread_db_target::pid_to_str is called, the thread-db target doesn't
	   recognize the thread as one of its own, and delegates the request to
	   the target below.  Because the pid_to_str output is not the expected
	   one, the test fails.

	   This tells me that we need to call the process target's follow_fork
	   first, to make the process target create the necessary LWP and thread
	   structures.  Then, we can call post_create_inferior to let the other
	   components of GDB do their thing.

	   But then you may ask: check_for_thread_db is already called today,
	   somewhere under solib_create_inferior_hook, and that is before
	   target_follow_fork, why don't we see this ordering problem!?  Well,
	   because of the first bullet point: when check_for_thread_db /
	   thread_db_load are called, the current inferior is (erroneously)
	   inferior 1, the parent.  Because libthread_db is already loaded for
	   the parent, thread_db_load early returns.  check_for_thread_db later
	   gets called by linux_nat_target::follow_fork.  At this point, the
	   current inferior is the correct one and the child's LWP exists, so
	   all is well.

	Since we now call post_create_inferior after target_follow_fork, which
	calls the inferior_created observable, which calls check_for_thread_db,
	I don't think linux_nat_target needs to explicitly call
	check_for_thread_db itself, so that is removed.

	In terms of testing, this patch adds a new gdb.base/jit-elf-fork.exp
	test.  It makes an inferior register a JIT code object and then fork.
	It then verifies that whatever the detach-on-fork and follow-fork-child
	parameters are, GDB knows about the JIT code object in all the inferiors
	that survive the fork.  It verifies that the inferiors can unload that
	code object.

	There isn't currently a way to get visibility into GDB's idea of the JIT
	code objects for each inferior.  For the purpose of this test, add the
	"maintenance info jit" command.  There isn't much we can print about the
	JIT code objects except their load address.  So the output looks a bit
	bare, but it's good enough for the test.

	gdb/ChangeLog:

		* NEWS: Mention "maint info jit" command.
		* infrun.c (follow_fork_inferior): Don't call
		solib_create_inferior_hook, call post_create_inferior if a new
		inferior was created.
		* jit.c (maint_info_jit_cmd): New.
		(_initialize_jit): Register new command.
		* linux-nat.c (linux_nat_target::follow_fork): Don't call
		check_for_thread_db.
		* linux-nat.h (check_for_thread_db): Remove declaration.
		* linux-thread-db.c (check_thread_signals): Make static.

	gdb/doc/ChangeLog:

		* gdb.texinfo (Maintenance Commands): Mention "maint info jit".

	gdb/testsuite/ChangeLog:

		* gdb.base/jit-elf-fork-main.c: New test.
		* gdb.base/jit-elf-fork-solib.c: New test.
		* gdb.base/jit-elf-fork.exp: New test.

	Change-Id: I9a192e55b8a451c00e88100669283fc9ca60de5c

2021-07-15  Libor Bukata  <libor.bukata@oracle.com>

	[gdb/procfs.c] Fix build failure in find_stop_signal
	It fixes a regression caused by commit
	1edb66d856c82c389edfd7610143236a68c76846 where thread_info::suspend was
	made private.

	The public thread_info API has to be used to get stop signal and avoid
	build failures.

	gdb/ChangeLog:

	2021-07-14  Libor Bukata <libor.bukata@oracle.com>

	  * gdb/procfs.c (find_stop_signal): Use thread_info API.

	Change-Id: I53bc57a05cd0eca5f28ef0726d6faeeb306e7904

2021-07-15  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-14  H.J. Lu  <hjl.tools@gmail.com>

	x86: Add int1 as one byte opcode 0xf1
	Also change the x86 disassembler to disassemble 0xf1 as int1, instead of
	icebp.

	gas/

		PR gas/28088
		* testsuite/gas/i386/opcode.s: Add int1.
		* testsuite/gas/i386/x86-64-opcode.s: Add int1, int3 and int.
		* testsuite/gas/i386/opcode-intel.d: Updated.
		* testsuite/gas/i386/opcode-suffix.d: Likewise.
		* testsuite/gas/i386/opcode.d: Likewise.
		* testsuite/gas/i386/x86-64-opcode.d: Likewise.

	opcodes/

		PR gas/28088
		* i386-dis.c (dis386): Replace icebp with int1.
		* i386-opc.tbl: Add int1.
		* i386-tbl.h: Regenerate.

2021-07-14  Alan Modra  <amodra@gmail.com>

	gas: default TC_VALIDATE_FIX_SUB to 0
	gas/write.c provides a fallback TC_VALIDATE_FIX_SUB define that can be
	a problem for some targets, the problem being that a non-zero
	definition of TC_VALIDATE_FIX_SUB says that some uses of fx_subsy are
	OK, in effect that the target will handle fx_subsy in md_apply_fix
	and/or tc_gen_reloc.  A lot of targets don't have the necessary
	md_apply_fix and tc_gen_reloc support.  So a safer default is to
	disallow fx_subsy by default.

	I've had a good look over target usage of fx_subsy, and think I've
	caught all the cases where targets need TC_VALIDATE_FIX_SUB.  Possible
	failures would be limited to alpha, microblaze, ppc and s390 (the
	targets that define UNDEFINED_DIFFERENCE_OK), or targets that generate
	fixups with BFD_RELOC_GPREL32/16 and use a syntax explicitly showing
	a difference expression.

		* write.c (TC_VALIDATE_FIX_SUB): Default to 0.
		* config/tc-hppa.h (TC_VALIDATE_FIX_SUB): Define.
		* config/tc-microblaze.h (TC_VALIDATE_FIX_SUB): Define.
		* config/tc-alpha.h (TC_VALIDATE_FIX_SUB): Define for ECOFF.
		* config/tc-ppc.h (TC_VALIDATE_FIX_SUB): Don't define for ELF.
		Do define for XCOFF.

2021-07-14  Clément Chigot  <clement.chigot@atos.net>

	objdump: add DWARF support for AIX
	DWARF sections have special names on AIX which need be handled
	by objdump in order to correctly print them.
	This patch also adds the correlation in bfd for future uses.

	bfd/
		* libxcoff.h (struct xcoff_dwsect_name): Add DWARF name.
		* coff-rs6000.c (xcoff_dwsect_names): Update.
		* coffcode.h (sec_to_styp_flags): Likewise.
		(coff_new_section_hook): Likewise.
	binutils/
		* dwarf.h (struct dwarf_section): Add XCOFF name.
		* dwarf.c (struct dwarf_section_display): Update.
		* objdump.c (load_debug_section): Add XCOFF name handler.
		(dump_dwarf_section): Likewise.
	gas/
		* config/tc-ppc.c (ppc_change_debug_section): Update to
		match new name's field.

2021-07-14  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.base/gold-gdb-index.exp
	When running test-case gdb.base/gold-gdb-index.exp on openSUSE Tumbleweed,
	I run into:
	...
	FAIL: gdb.base/gold-gdb-index.exp: maint info symtabs
	...

	This is due to a dummy .gdb_index:
	...
	Contents of the .gdb_index section:

	Version 7

	CU table:

	TU table:

	Address table:

	Symbol table:
	...

	The dummy .gdb_index is ignored when loading the symbols, and instead partial
	symbols are used.  Consequently, we get the same result as if we'd removed
	-Wl,--gdb-index from the compilation.

	Presumably, gold fails to generate a proper .gdb_index because it lacks
	DWARF5 support.

	Anyway, without a proper .gdb_index we can't test the gdb behaviour we're
	trying to excercise.  Fix this by detecting whether we actually used a
	.gdb_index for symbol loading.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-07-14  Tom de Vries  <tdevries@suse.de>

		* lib/gdb.exp (have_index): New proc.
		* gdb.base/gold-gdb-index.exp: Use have_index.

2021-07-14  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Add missing skip_tui_tests
	When building gdb with --disable-tui, we run into:
	...
	(gdb) frame apply all -- -^M
	Undefined command: "-".  Try "help".^M
	(gdb) ERROR: Undefined command "frame apply all -- -".
	UNRESOLVED: gdb.base/options.exp: test-frame-apply: frame apply all -- -
	...

	Fix this by detecting whether tui is supported, and skipping the tui-related
	tests otherwise.  Same in some gdb.tui test-cases.

	Tested on x86_64-linux.

	gdb/testsuite/ChangeLog:

	2021-07-13  Tom de Vries  <tdevries@suse.de>

		* gdb.base/options.exp: Skip tui-related tests when tui is not
		supported.
		* gdb.python/tui-window-disabled.exp: Same.
		* gdb.python/tui-window.exp: Same.

2021-07-14  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-13  Lancelot SIX  <lsix@lancelotsix.com>

	Use /bin/sh as shebang in gdb/make-init-c
	While testing the NixOS[1] packaging for gdb-11.0.90.tar.xz, I got the
	following error:

	  [...]
	  CXX    aarch32-tdep.o
	  CXX    gdb.o
	  GEN    init.c
	  /nix/store/26a78ync552m8j4sbjavhvkmnqir8c9y-bash-4.4-p23/bin/bash: ./make-init-c: /usr/bin/env: bad interpreter: No such file or directory
	  make[2]: *** [Makefile:1866: stamp-init] Error 126
	  make[2]: *** Waiting for unfinished jobs....
	  make[2]: Leaving directory '/build/gdb-11.0.90/gdb'
	  make[1]: *** [Makefile:9814: all-gdb] Error 2
	  make[1]: Leaving directory '/build/gdb-11.0.90'
	  make: *** [Makefile:903: all] Error 2
	  builder for '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed with exit code 2
	  error: build of '/nix/store/xs8my3rrc3l4kdlbpx0azh6q0v0jxphr-gdb-gdb-11.0.90.drv' failed

	In the nix build environment, /usr/bin/env is not present, only /bin/sh
	is.  This patch makes sure that gdb/make-init-c uses '/bin/sh' as
	interpreter as this is the only one available on this platform.

	I do not think this change will cause regressions on any other
	configuration.

	[1] https://nixos.org/

	gdb/Changelog

		* make-init-c: Use /bin/sh as shebang.

2021-07-13  John Baldwin  <jhb@FreeBSD.org>

	arm-fbsd-nat: Use fetch_register_set and store_register_set.

	aarch64-fbsd-nat: Use fetch_register_set and store_register_set.

	riscv-fbsd-nat: Use fetch_register_set and store_register_set.

	fbsd-nat: Add helper functions to fetch and store register sets.
	In particular, this supports register sets described by a regcache_map
	which are fetched and stored with dedicated ptrace operations.  These
	functions are intended to be used in architecture-specific
	fetch_registers and store_registers target methods.

	Add regcache_map_supplies helper routine.
	This helper can be used in the fetch_registers and store_registers
	target methods to determine if a register set includes a specific
	register.

2021-07-13  Pedro Alves  <pedro@palves.net>

	Avoid letting exceptions escape gdb_bfd_iovec_fileio_close (PR gdb/28080)
	Before PR gdb/28080 was fixed by the previous patch, GDB was crashing
	like this:

	 (gdb) detach
	 Detaching from program: target:/any/program, process 3671843
	 Detaching from process 3671843
	 Ending remote debugging.
	 [Inferior 1 (process 3671843) detached]
	 In main
	 terminate called after throwing an instance of 'gdb_exception_error'
	 Aborted (core dumped)

	Here's the exception above being thrown:

	 (top-gdb) bt
	 #0  throw_error (error=TARGET_CLOSE_ERROR, fmt=0x555556035588 "Remote connection closed") at src/gdbsupport/common-exceptions.cc:222
	 #1  0x0000555555bbaa46 in remote_target::readchar (this=0x555556a11040, timeout=10000) at src/gdb/remote.c:9440
	 #2  0x0000555555bbb9e5 in remote_target::getpkt_or_notif_sane_1 (this=0x555556a11040, buf=0x555556a11058, forever=0, expecting_notif=0, is_notif=0x0) at src/gdb/remote.c:9928
	 #3  0x0000555555bbbda9 in remote_target::getpkt_sane (this=0x555556a11040, buf=0x555556a11058, forever=0) at src/gdb/remote.c:10030
	 #4  0x0000555555bc0e75 in remote_target::remote_hostio_send_command (this=0x555556a11040, command_bytes=13, which_packet=14, remote_errno=0x7fffffffcfd0, attachment=0x0, attachment_len=0x0) at src/gdb/remote.c:12137
	 #5  0x0000555555bc1b6c in remote_target::remote_hostio_close (this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12455
	 #6  0x0000555555bc1bb4 in remote_target::fileio_close (During symbol reading: .debug_line address at offset 0x64f417 is 0 [in module build/gdb/gdb]
	 this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12462
	 #7  0x0000555555c9274c in target_fileio_close (fd=3, target_errno=0x7fffffffcfd0) at src/gdb/target.c:3365
	 #8  0x000055555595a19d in gdb_bfd_iovec_fileio_close (abfd=0x555556b9f8a0, stream=0x555556b11530) at src/gdb/gdb_bfd.c:439
	 #9  0x0000555555e09e3f in opncls_bclose (abfd=0x555556b9f8a0) at src/bfd/opncls.c:599
	 #10 0x0000555555e0a2c7 in bfd_close_all_done (abfd=0x555556b9f8a0) at src/bfd/opncls.c:847
	 #11 0x0000555555e0a27a in bfd_close (abfd=0x555556b9f8a0) at src/bfd/opncls.c:814
	 #12 0x000055555595a9d3 in gdb_bfd_close_or_warn (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:626
	 #13 0x000055555595ad29 in gdb_bfd_unref (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:715
	 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573
	 #15 0x0000555555ae955a in std::_Sp_counted_ptr<objfile*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:377
	 #16 0x000055555572b7c8 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:155
	 #17 0x00005555557263c3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x555556bf0588, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:730
	 #18 0x0000555555ae745e in std::__shared_ptr<objfile, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:1169
	 #19 0x0000555555ae747e in std::shared_ptr<objfile>::~shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr.h:103
	 #20 0x0000555555b1c1dc in __gnu_cxx::new_allocator<std::_List_node<std::shared_ptr<objfile> > >::destroy<std::shared_ptr<objfile> > (this=0x5555564cdd60, __p=0x555556bf0580) at /usr/include/c++/9/ext/new_allocator.h:153
	 #21 0x0000555555b1bb1d in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<objfile> > > >::destroy<std::shared_ptr<objfile> > (__a=..., __p=0x555556bf0580) at /usr/include/c++/9/bits/alloc_traits.h:497
	 #22 0x0000555555b1b73e in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::_M_erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/stl_list.h:1921
	 #23 0x0000555555b1afeb in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/list.tcc:158
	 #24 0x0000555555b19576 in program_space::remove_objfile (this=0x5555564cdd20, objfile=0x555556515540) at src/gdb/progspace.c:210
	 #25 0x0000555555ae4502 in objfile::unlink (this=0x555556515540) at src/gdb/objfiles.c:487
	 #26 0x0000555555ae5a12 in objfile_purge_solibs () at src/gdb/objfiles.c:875
	 #27 0x0000555555c09686 in no_shared_libraries (ignored=0x0, from_tty=1) at src/gdb/solib.c:1236
	 #28 0x00005555559e3f5f in detach_command (args=0x0, from_tty=1) at src/gdb/infcmd.c:2769

	Note frame #14:

	 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573

	That's a dtor, thus noexcept.  That's the reason for the
	std::terminate.

	The previous patch fixed things such that the exception above isn't
	thrown anymore.  However, it's possible that e.g., the remote
	connection drops just while a user types "nosharedlibrary", or some
	other reason that leads to objfile::~objfile, and then we end up the
	same std::terminate problem.

	Also notice that frames #9-#11 are BFD frames:

	 #9  0x0000555555e09e3f in opncls_bclose (abfd=0x555556bc27e0) at src/bfd/opncls.c:599
	 #10 0x0000555555e0a2c7 in bfd_close_all_done (abfd=0x555556bc27e0) at src/bfd/opncls.c:847
	 #11 0x0000555555e0a27a in bfd_close (abfd=0x555556bc27e0) at src/bfd/opncls.c:814

	BFD is written in C and thus throwing exceptions over such frames may
	either not clean up properly, or, may abort if bfd is not compiled
	with -fasynchronous-unwind-tables (x86-64 defaults that on, but not
	all GCC ports do).

	Thus frame #8 seems like a good place to swallow exceptions.  More so
	since in this spot we already ignore target_fileio_close return
	errors.  That's what this commit does.  Without the previous fix, we'd
	see:

	 (gdb) detach
	 Detaching from program: target:/any/program, process 2197701
	 Ending remote debugging.
	 [Inferior 1 (process 2197701) detached]
	 warning: cannot close "target:/lib64/ld-linux-x86-64.so.2": Remote connection closed

	Note it prints a warning, which would still be a regression compared
	to GDB 10, if it weren't for the previous fix.

	gdb/ChangeLog:
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

		PR gdb/28080
		* gdb_bfd.c (gdb_bfd_close_warning): New.
		(gdb_bfd_iovec_fileio_close): Wrap target_fileio_close in
		try/catch and print warning on exception.
		(gdb_bfd_close_or_warn): Use gdb_bfd_close_warning.

	Change-Id: Ic7a26ddba0a4444e3377b0e7c1c89934a84545d7

2021-07-13  Pedro Alves  <pedro@palves.net>

	Fix detach with target remote (PR gdb/28080)
	Commit 408f66864a1a823591b26420410c982174c239a2 ("detach in all-stop
	with threads running") regressed "detach" with "target remote":

	 (gdb) detach
	 Detaching from program: target:/any/program, process 3671843
	 Detaching from process 3671843
	 Ending remote debugging.
	 [Inferior 1 (process 3671843) detached]
	 In main
	 terminate called after throwing an instance of 'gdb_exception_error'
	 Aborted (core dumped)

	Here's the exception above being thrown:

	 (top-gdb) bt
	 #0  throw_error (error=TARGET_CLOSE_ERROR, fmt=0x555556035588 "Remote connection closed") at src/gdbsupport/common-exceptions.cc:222
	 #1  0x0000555555bbaa46 in remote_target::readchar (this=0x555556a11040, timeout=10000) at src/gdb/remote.c:9440
	 #2  0x0000555555bbb9e5 in remote_target::getpkt_or_notif_sane_1 (this=0x555556a11040, buf=0x555556a11058, forever=0, expecting_notif=0, is_notif=0x0) at src/gdb/remote.c:9928
	 #3  0x0000555555bbbda9 in remote_target::getpkt_sane (this=0x555556a11040, buf=0x555556a11058, forever=0) at src/gdb/remote.c:10030
	 #4  0x0000555555bc0e75 in remote_target::remote_hostio_send_command (this=0x555556a11040, command_bytes=13, which_packet=14, remote_errno=0x7fffffffcfd0, attachment=0x0, attachment_len=0x0) at src/gdb/remote.c:12137
	 #5  0x0000555555bc1b6c in remote_target::remote_hostio_close (this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12455
	 #6  0x0000555555bc1bb4 in remote_target::fileio_close (During symbol reading: .debug_line address at offset 0x64f417 is 0 [in module build/gdb/gdb]
	 this=0x555556a11040, fd=8, remote_errno=0x7fffffffcfd0) at src/gdb/remote.c:12462
	 #7  0x0000555555c9274c in target_fileio_close (fd=3, target_errno=0x7fffffffcfd0) at src/gdb/target.c:3365
	 #8  0x000055555595a19d in gdb_bfd_iovec_fileio_close (abfd=0x555556b9f8a0, stream=0x555556b11530) at src/gdb/gdb_bfd.c:439
	 #9  0x0000555555e09e3f in opncls_bclose (abfd=0x555556b9f8a0) at src/bfd/opncls.c:599
	 #10 0x0000555555e0a2c7 in bfd_close_all_done (abfd=0x555556b9f8a0) at src/bfd/opncls.c:847
	 #11 0x0000555555e0a27a in bfd_close (abfd=0x555556b9f8a0) at src/bfd/opncls.c:814
	 #12 0x000055555595a9d3 in gdb_bfd_close_or_warn (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:626
	 #13 0x000055555595ad29 in gdb_bfd_unref (abfd=0x555556b9f8a0) at src/gdb/gdb_bfd.c:715
	 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573
	 #15 0x0000555555ae955a in std::_Sp_counted_ptr<objfile*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:377
	 #16 0x000055555572b7c8 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x555556c20db0) at /usr/include/c++/9/bits/shared_ptr_base.h:155
	 #17 0x00005555557263c3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x555556bf0588, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:730
	 #18 0x0000555555ae745e in std::__shared_ptr<objfile, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr_base.h:1169
	 #19 0x0000555555ae747e in std::shared_ptr<objfile>::~shared_ptr (this=0x555556bf0580, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/shared_ptr.h:103
	 #20 0x0000555555b1c1dc in __gnu_cxx::new_allocator<std::_List_node<std::shared_ptr<objfile> > >::destroy<std::shared_ptr<objfile> > (this=0x5555564cdd60, __p=0x555556bf0580) at /usr/include/c++/9/ext/new_allocator.h:153
	 #21 0x0000555555b1bb1d in std::allocator_traits<std::allocator<std::_List_node<std::shared_ptr<objfile> > > >::destroy<std::shared_ptr<objfile> > (__a=..., __p=0x555556bf0580) at /usr/include/c++/9/bits/alloc_traits.h:497
	 #22 0x0000555555b1b73e in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::_M_erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/stl_list.h:1921
	 #23 0x0000555555b1afeb in std::__cxx11::list<std::shared_ptr<objfile>, std::allocator<std::shared_ptr<objfile> > >::erase (this=0x5555564cdd60, __position=std::shared_ptr<objfile> (expired, weak count 1) = {get() = 0x555556515540}) at /usr/include/c++/9/bits/list.tcc:158
	 #24 0x0000555555b19576 in program_space::remove_objfile (this=0x5555564cdd20, objfile=0x555556515540) at src/gdb/progspace.c:210
	 #25 0x0000555555ae4502 in objfile::unlink (this=0x555556515540) at src/gdb/objfiles.c:487
	 #26 0x0000555555ae5a12 in objfile_purge_solibs () at src/gdb/objfiles.c:875
	 #27 0x0000555555c09686 in no_shared_libraries (ignored=0x0, from_tty=1) at src/gdb/solib.c:1236
	 #28 0x00005555559e3f5f in detach_command (args=0x0, from_tty=1) at src/gdb/infcmd.c:2769

	So frame #28 already detached the remote process, and then we're
	purging the shared libraries.  GDB had opened remote shared libraries
	via the target: sysroot, so it tries closing them.  GDBserver is
	tearing down already, so remote communication breaks down and we close
	the remote target and throw TARGET_CLOSE_ERROR.

	Note frame #14:

	 #14 0x0000555555ae4730 in objfile::~objfile (this=0x555556515540, __in_chrg=<optimized out>) at src/gdb/objfiles.c:573

	That's a dtor, thus noexcept.  That's the reason for the
	std::terminate.

	Stepping back a bit, why do we still have open remote files if we've
	managed to detach already, and, we're debugging with "target remote"?
	The reason is that commit 408f66864a1a823591b26420410c982174c239a2
	makes detach_command hold a reference to the target, so the remote
	target won't be finally closed until frame #28 returns.  It's closing
	the target that invalidates target file I/O handles.

	This commit fixes the issue by not relying on target_close to
	invalidate the target file I/O handles, instead invalidate them
	immediately in remote_unpush_target.  So when GDB purges the solibs,
	and we end up in target_fileio_close (frame #7 above), there's nothing
	to do, and we don't try to talk with the remote target anymore.

	The regression isn't seen when testing with
	--target_board=native-gdbserver, because that does "set sysroot" to
	disable the "target:" sysroot, for test run speed reasons.  So this
	commit adds a testcase that explicitly tests detach with "set sysroot
	target:".

	gdb/ChangeLog:
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

		PR gdb/28080
		* remote.c (remote_unpush_target): Invalidate file I/O target
		handles.
		* target.c (fileio_handles_invalidate_target): Make extern.
		* target.h (fileio_handles_invalidate_target): Declare.

	gdb/testsuite/ChangeLog:
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

		PR gdb/28080
		* gdb.base/detach-sysroot-target.exp: New.
		* gdb.base/detach-sysroot-target.c: New.

	Reported-By: Jonah Graham <jonah@kichwacoders.com>

	Change-Id: I851234910172f42a1b30e731161376c344d2727d

2021-07-13  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix check-libthread-db.exp FAILs with glibc 2.33
	When running test-case gdb.threads/check-libthread-db.exp on openSUSE
	Tumbleweed with glibc 2.33, I get:
	...
	(gdb) maint check libthread-db^M
	Running libthread_db integrity checks:^M
	  Got thread 0x7ffff7c79b80 => 9354 => 0x7ffff7c79b80; errno = 0 ... OK^M
	libthread_db integrity checks passed.^M
	(gdb) FAIL: gdb.threads/check-libthread-db.exp: user-initiated check: \
	  libpthread.so not initialized (pattern 2)
	...

	The test-case expects instead:
	...
	  Got thread 0x0 => 9354 => 0x0 ... OK^M
	...
	which is what I get on openSUSE Leap 15.2 with glibc 2.26, and what is
	described in the test-case like this:
	...
	    # libthread_db should fake a single thread with th_unique == NULL.
	...

	Using a breakpoint on check_thread_db_callback we can compare the two
	scenarios, and find that in the latter case we hit this code in glibc function
	iterate_thread_list in nptl_db/td_ta_thr_iter.c:
	...
	  if (next == 0 && fake_empty)
	    {
	      /* __pthread_initialize_minimal has not run.  There is just the main
	         thread to return.  We cannot rely on its thread register.  They
	         sometimes contain garbage that would confuse us, left by the
	         kernel at exec.  So if it looks like initialization is incomplete,
	         we only fake a special descriptor for the initial thread.  */
	      td_thrhandle_t th = { ta, 0 };
	      return callback (&th, cbdata_p) != 0 ? TD_DBERR : TD_OK;
	    }
	...
	while in the former case we don't because this preceding statement doesn't
	result in next == 0:
	...
	  err = DB_GET_FIELD (next, ta, head, list_t, next, 0);
	...

	Note that the comment mentions __pthread_initialize_minimal, but in both cases
	it has already run before we hit the callback, so it's possible the comment is
	no longer accurate.

	The change in behaviour bisect to glibc commit 1daccf403b "nptl: Move stack
	list variables into _rtld_global", which moves the initialization of stack
	list variables such as __stack_user to an earlier moment, which explains well
	enough the observed difference.

	Fix this by updating the regexp patterns to agree with what libthread-db is
	telling us.

	Tested on x86_64-linux, both with glibc 2.33 and 2.26.

	gdb/testsuite/ChangeLog:

	2021-07-07  Tom de Vries  <tdevries@suse.de>

		PR testsuite/27690
		* gdb.threads/check-libthread-db.exp: Update patterns for glibc 2.33.

2021-07-13  Felix Willgerodt  <felix.willgerodt@intel.com>

	gdb, dwarf: Don't follow the parent of a subprogram to get a prefix.
	During prefix resolution, if the parent is a subprogram, there is no need
	to go to the parent of the subprogram.  The DIE will be local.

	For a program like:
	~~~
	  class F1
	  {
	  public:
	    int a;
	    int
	    vvv ()
	    {
	      class F2
	      {
		int f;
	      };
	      F2 abcd;
	      return 1;
	    }
	  };
	~~~

	The class F2 should not be seen as a member of F1.

	Before:
	~~~
	(gdb) ptype abcd
	type = class F1::F2 {
	  private:
	    int f;
	}
	~~~

	After:
	~~~
	(gdb) ptype abcd
	type = class F2 {
	  private:
	    int f;
	}
	~~~

	gdb/ChangeLog:
	2021-06-23  Felix Willgerodt  <felix.willgerodt@intel.com>

		* dwarf2/read.c (determine_prefix): Return an empty prefix if the
		parent is a subprogram.

	gdb/testsuite/ChangeLog:
	2021-06-23  Felix Willgerodt  <felix.willgerodt@intel.com>

		* gdb.cp/nested-class-func-class.cc: New file.
		* gdb.cp/nested-class-func-class.exp: New file.

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: disable commit-resumed on -exec-interrupt --thread-group
	As reported in PR gdb/28077, we hit an internal error when using
	-exec-interrupt with --thread-group:

	    info threads
	    &"info threads\n"
	    ~"  Id   Target Id             Frame \n"
	    ~"* 1    process 403312 \"loop\" (running)\n"
	    ^done
	    (gdb)
	    -exec-interrupt --thread-group i1
	    ~"/home/simark/src/binutils-gdb/gdb/target.c:3768: internal-error: void target_stop(ptid_t): Assertion `!proc_target->commit_resumed_state' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? (y or n) "

	This is because this code path never disables commit-resumed (a
	requirement for calling target_stop, as documented in
	process_stratum_target::»commit_resumed_state) before calling
	target_stop.

	The other 3 code paths in mi_cmd_exec_interrupt use interrupt_target_1,
	which does it.  But the --thread-group code path uses its own thing
	which doesn't do it.  Fix this by adding a scoped_disable_commit_resumed
	in this code path.

	Calling -exec-interrupt with --thread-group is apparently not tested at
	the moment (which is why this bug could creep in).  Add a new test for
	that.  The test runs two inferiors and tries to interrupt them with
	"-exec-interrupt --thread-group X".

	This will need to be merged in the gdb-11-branch, so here are ChangeLog
	entries:

	gdb/ChangeLog:

		* mi/mi-main.c (mi_cmd_exec_interrupt): Use
		scoped_disable_commit_resumed in the --thread-group case.

	gdb/testsuite/ChangeLog:

		* gdb.mi/interrupt-thread-group.c: New.
		* gdb.mi/interrupt-thread-group.exp: New.

	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28077
	Change-Id: I615efefcbcaf2c15d47caf5e4b9d82854b2a2fcb

2021-07-13  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Enable elf attributes when default configure option isn't set.
	Since gcc commit, 3c70b3ca1ef58f302bf8c16d9e7c7bb8626408bf, we now enable
	elf attributes for all riscv targets by default in gcc.  Therefore, I
	think binutils should have the same behavior, in case users are writing
	assembly files.  If --enable-default-riscv-attribute isn't set, then we
	enable the elf attributes for all riscv targets by default.

	ChangLog:

	binutils/

		* testsuite/binutils-all/readelf.s: Add comments for riscv.
		* testsuite/binutils-all/readelf.s-64: Likewise.
		* testsuite/binutils-all/readelf.s-64-unused: Likewise.
		* testsuite/binutils-all/readelf.ss: Likewise.
		* testsuite/binutils-all/readelf.ss-64: Likewise.
		* testsuite/binutils-all/readelf.ss-64-unused: Likewise.

	gas/

		* configure.ac: If --enable-default-riscv-attribute isn't set,
		then we enable the elf attributes for all riscv targets by
		default.
		* configure: Regenerated.

2021-07-13  John Ericson  <git@JohnEricson.me>

	Fix some dangling references to `netbsd-tdep`
	These files were renamed in 1b71cfcfdc3e13a655fefa6566b5564cec044c10,
	but evidentially a few dangling references were left behind. This causes
	builds to fail:

	    $ ./configure --target i686-netbsdelf
	    $ make
	    make: *** No rule to make target 'nbsd-tdep.c', needed by 'nbsd-tdep.o'.  Stop.

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: optimize all_matching_threads_iterator
	all_matching_threads_iterator is used extensively in some pretty fast
	paths, often under the all_non_exited_threads function.

	If a filter target and thread-specific ptid are given, it iterates on
	all threads of all inferiors of that target, to ultimately yield exactly
	on thread.  And this happens quite often, which means we unnecessarily
	spend time iterating on threads to find the one we are looking for.  The
	same thing happens if an inferior-specific ptid is given, although there
	the iterator yields all the threads of that inferior.

	In those cases, the callers of all_non_exited_threads could have
	different behaviors depending on the kind of ptid, to avoid this
	inefficiency, but that would be very tedious.  Using
	all_non_exited_threads has the advantage that one simple implementation
	can work seamlessly on multiple threads or on one specific thread, just
	by playing with the ptid.

	Instead, optimize all_matching_threads_iterator directly to detect these
	different cases and limiting what we iterate on to just what we need.

	 - if filter_ptid is minus_one_ptid, do as we do now: filter inferiors
	   based on filter_target, iterate on all of the matching inferiors'
	   threads
	 - if filter_ptid is a pid-only ptid (then a filter_target must
	   necessarily be given), look up that inferior and iterate on all its
	   threads
	 - otherwise, filter_ptid is a thread-specific ptid, so look up that
	   specific thread and "iterate" only on it

	For the last case, what was an iteration on all threads of the filter
	target now becomes a call to find_thread_ptid, which is quite efficient
	now thanks to inferior::ptid_thread_map.

	gdb/ChangeLog:

		* thread-iter.h (class all_matching_threads_iterator)
		<all_matching_threads_iterator>: Use default.
		<enum class mode>: New.
		<m_inf, m_thr>: Initialize.
		<m_filter_ptid>: Remove.
		* thread-iter.c (all_matching_threads_iterator::m_inf_matches):
		Don't filter on m_filter_ptid.
		(all_matching_threads_iterator::all_matching_threads_iterator):
		Choose path based on filter_ptid (all threads, all threads of
		inferior, single thread).
		(all_matching_threads_iterator::advance): Likewise.

	Change-Id: Ic6a19845f5f760fa1b8eac8145793c0ff431bbc9

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: maintain ptid -> thread map, optimize find_thread_ptid
	When debugging a large number of threads (thousands), looking up a
	thread by ptid_t using the inferior::thread_list linked list can add up.

	Add inferior::thread_map, an std::unordered_map indexed by ptid_t, and
	change the find_thread_ptid function to look up a thread using
	std::unordered_map::find, instead of iterating on all of the
	inferior's threads.  This should make it faster to look up a thread
	from its ptid.

	Change-Id: I3a8da0a839e18dee5bb98b8b7dbeb7f3dfa8ae1c
	Co-Authored-By: Pedro Alves <pedro@palves.net>

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: optimize selection of resumed thread with pending event
	Consider a case where many threads (thousands) keep hitting a breakpoint
	whose condition evaluates to false.  random_pending_event_thread is
	responsible for selecting a thread from an inferior among all that are
	resumed with a pending wait status.  It is currently implemented by
	walking the inferior's thread list twice: once to count the number of
	candidates and once to select a random one.

	Since we now maintain a per target list of resumed threads with pending
	event, we can implement this more efficiently by walking that list and
	selecting the first thread that matches the criteria
	(random_pending_event_thread looks for an thread from a specific
	inferior, and possibly a filter ptid).  It will be faster especially in
	the common case where there isn't any resumed thread with pending
	event.  Currently, we have to iterate the thread list to figure this
	out.  With this patch, the list of resumed threads with pending event
	will be empty, so it's quick to figure out.

	The random selection is kept, but is moved to
	process_stratum_target::random_resumed_with_pending_wait_status.  The
	same technique is used: do a first pass to count the number of
	candidates, and do a second pass to select a random one.  But given that
	the list of resumed threads with pending wait statuses will generally be
	short, or at least shorter than the full thread list, it should be
	quicker.

	Note that this isn't completely true, in case there are multiple
	inferiors on the same target.  Imagine that inferior A has 10k resumed
	threads with pending wait statuses, and random_pending_event_thread is
	called with inferior B.  We'll need to go through the list that contains
	inferior A's threads to realize that inferior B has no resumed threads
	with pending wait status.  But I think that this is a corner /
	pathological case.  And a possible fix for this situation would be to
	make random_pending_event_thread work per-process-target, rather than
	per-inferior.

	Change-Id: I1b71d01beaa500a148b5b9797745103e13917325

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: optimize check for resumed threads with pending wait status in maybe_set_commit_resumed_all_targets
	Consider a test case where many threads (thousands) keep hitting a
	breakpoint whose condition evaluates to false.
	maybe_set_commit_resumed_all_targets is called at each handled event,
	when the scoped_disable_commit_resumed object in fetch_inferior_event is
	reset_and_commit-ed.  One particularly expensive check in there is
	whether the target has at least one resumed thread with a pending wait
	status (in which case, we don't want to commit the resumed threads, as
	we want to consume this status first).  It is currently implemented as
	walking all threads of the target.

	Since we now maintain a per-target list of resumed threads with pending
	status, we can do this check efficiently, by checking whether that list
	is empty or not.

	Add the process_stratum_target::has_resumed_with_pending_wait_status
	method for this, and use it in maybe_set_commit_resumed_all_targets.

	Change-Id: Ia1595baa1b358338f94fc3cb3af7f27092dad5b6

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: maintain per-process-target list of resumed threads with pending wait status
	Looking up threads that are both resumed and have a pending wait
	status to report is something that we do quite often in the fast path
	and is expensive if there are many threads, since it currently requires
	walking whole thread lists.

	The first instance is in maybe_set_commit_resumed_all_targets.  This is
	called after handling each event in fetch_inferior_event, to see if we
	should ask targets to commit their resumed threads or not.  If at least
	one thread is resumed but has a pending wait status, we don't ask the
	targets to commit their resumed threads, because we want to consume and
	handle the pending wait status first.

	The second instance is in random_pending_event_thread, where we want to
	select a random thread among all those that are resumed and have a
	pending wait status.  This is called every time we try to consume
	events, to see if there are any pending events that we we want to
	consume, before asking the targets for more events.

	To allow optimizing these cases, maintain a per-process-target list of
	threads that are resumed and have a pending wait status.

	In maybe_set_commit_resumed_all_targets, we'll be able to check in O(1)
	if there are any such threads simply by checking whether the list is
	empty.

	In random_pending_event_thread, we'll be able to use that list, which
	will be quicker than iterating the list of threads, especially when
	there are no resumed with pending wait status threads.

	About implementation details: using the new setters on class
	thread_info, it's relatively easy to maintain that list.  Any time the
	"resumed" or "pending wait status" property is changed, we check whether
	that should cause the thread to be added or removed from the list.

	In set_thread_exited, we try to remove the thread from the list, because
	keeping an exited thread in that list would make no sense (especially if
	the thread is freed).  My first implementation assumed that a process
	stratum target was always present when set_thread_exited is called.
	That's however, not the case: in some cases, targets unpush themselves
	from an inferior and then call "exit_inferior", which exits all the
	threads.  If the target is unpushed before set_thread_exited is called
	on the threads, it means we could mistakenly leave some threads in the
	list.  I tried to see how hard it would be to make it such that targets
	have to exit all threads before unpushing themselves from the inferior
	(that would seem logical to me, we don't want threads belonging to an
	inferior that has no process target).  That seemed quite difficult and
	not worth the time at the moment.  Instead, I changed
	inferior::unpush_target to remove all threads of that inferior from the
	list.

	As of this patch, the list is not used, this is done in the subsequent
	patches.

	The debug messages in process-stratum-target.c need to print some ptids.
	However, they can't use target_pid_to_str to print them without
	introducing a dependency on the current inferior (the current inferior
	is used to get the current target stack).  For debug messages, I find it
	clearer to print the spelled out ptid anyway (the pid, lwp and tid
	values).  Add a ptid_t::to_string method that returns a string
	representation of the ptid that is meant for debug messages, a bit like
	we already have frame_id::to_string.

	Change-Id: Iad8f93db2d13984dd5aa5867db940ed1169dbb67

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: make thread_info::suspend private, add getters / setters
	A following patch will want to take some action when a pending wait
	status is set on or removed from a thread.  Add a getter and a setter on
	thread_info for the pending waitstatus, so that we can add some code in
	the setter later.

	The thing is, the pending wait status field is in the
	thread_suspend_state, along with other fields that we need to backup
	before and restore after the thread does an inferior function call.
	Therefore, make the thread_suspend_state member private
	(thread_info::suspend becomes thread_info::m_suspend), and add getters /
	setters for all of its fields:

	 - pending wait status
	 - stop signal
	 - stop reason
	 - stop pc

	For the pending wait status, add the additional has_pending_waitstatus
	and clear_pending_waitstatus methods.

	I think this makes the thread_info interface a bit nicer, because we
	now access the fields as:

	  thread->stop_pc ()

	rather than

	  thread->suspend.stop_pc

	The stop_pc field being in the `suspend` structure is an implementation
	detail of thread_info that callers don't need to be aware of.

	For the backup / restore of the thread_suspend_state structure, add
	save_suspend_to and restore_suspend_from methods.  You might wonder why
	`save_suspend_to`, as opposed to a simple getter like

	  thread_suspend_state &suspend ();

	I want to make it clear that this is to be used only for backing up and
	restoring the suspend state, _not_ to access fields like:

	  thread->suspend ()->stop_pc

	Adding some getters / setters allows adding some assertions.  I find
	that this helps understand how things are supposed to work.  Add:

	 - When getting the pending status (pending_waitstatus method), ensure
	   that there is a pending status.
	 - When setting a pending status (set_pending_waitstatus method), ensure
	   there is no pending status.

	There is one case I found where this wasn't true - in
	remote_target::process_initial_stop_replies - which needed adjustments
	to respect that contract.  I think it's because
	process_initial_stop_replies is kind of (ab)using the
	thread_info::suspend::waitstatus to store some statuses temporarily, for
	its internal use (statuses it doesn't intent on leaving pending).

	process_initial_stop_replies pulls out stop replies received during the
	initial connection using target_wait.  It always stores the received
	event in `evthread->suspend.waitstatus`.  But it only sets
	waitstatus_pending_p, if it deems the event interesting enough to leave
	pending, to be reported to the core:

	      if (ws.kind != TARGET_WAITKIND_STOPPED
		  || ws.value.sig != GDB_SIGNAL_0)
		evthread->suspend.waitstatus_pending_p = 1;

	It later uses this flag a bit below, to choose which thread to make the
	"selected" one:

	      if (selected == NULL
		  && thread->suspend.waitstatus_pending_p)
		selected = thread;

	And ultimately that's used if the user-visible mode is all-stop, so that
	we print the stop for that interesting thread:

	  /* In all-stop, we only print the status of one thread, and leave
	     others with their status pending.  */
	  if (!non_stop)
	    {
	      thread_info *thread = selected;
	      if (thread == NULL)
		thread = lowest_stopped;
	      if (thread == NULL)
		thread = first;

	      print_one_stopped_thread (thread);
	    }

	But in any case (all-stop or non-stop), print_one_stopped_thread needs
	to access the waitstatus value of these threads that don't have a
	pending waitstatus (those that had TARGET_WAITKIND_STOPPED +
	GDB_SIGNAL_0).  This doesn't work with the assertions I've
	put.

	So, change the code to only set the thread's wait status if it is an
	interesting one that we are going to leave pending.  If the thread
	stopped due to a non-interesting event (TARGET_WAITKIND_STOPPED +
	GDB_SIGNAL_0), don't store it.  Adjust print_one_stopped_thread to
	understand that if a thread has no pending waitstatus, it's because it
	stopped with TARGET_WAITKIND_STOPPED + GDB_SIGNAL_0.

	The call to set_last_target_status also uses the pending waitstatus.
	However, given that the pending waitstatus for the thread may have been
	cleared in print_one_stopped_thread (and that there might not even be a
	pending waitstatus in the first place, as explained above), it is no
	longer possible to do it at this point.  To fix that, move the call to
	set_last_target_status in print_one_stopped_thread.  I think this will
	preserve the existing behavior, because set_last_target_status is
	currently using the current thread's wait status.  And the current
	thread is the last one for which print_one_stopped_thread is called.  So
	by calling set_last_target_status in print_one_stopped_thread, we'll get
	the same result.  set_last_target_status will possibly be called
	multiple times, but only the last call will matter.  It just means
	possibly more calls to set_last_target_status, but those are cheap.

	Change-Id: Iedab9653238eaf8231abcf0baa20145acc8b77a7

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: add setter / getter for thread_info resumed state
	A following patch will want to do things when a thread's resumed state
	changes.  Make the `resumed` field private (renamed to `m_resumed`) and
	add a getter and a setter for it.  The following patch in question will
	therefore be able to add some code to the setter.

	Change-Id: I360c48cc55a036503174313261ce4e757d795319

2021-07-13  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: use intrusive list for step-over chain
	The threads that need a step-over are currently linked using an
	hand-written intrusive doubly-linked list, so that seems a very good
	candidate for intrusive_list, convert it.

	For this, we have a use case of appending a list to another one (in
	start_step_over).  Based on the std::list and Boost APIs, add a splice
	method.  However, only support splicing the other list at the end of the
	`this` list, since that's all we need.

	Add explicit default assignment operators to
	reference_to_pointer_iterator, which are otherwise implicitly deleted.
	This is needed because to define thread_step_over_list_safe_iterator, we
	wrap reference_to_pointer_iterator inside a basic_safe_iterator, and
	basic_safe_iterator needs to be able to copy-assign the wrapped
	iterator.  The move-assignment operator is therefore not needed, only
	the copy-assignment operator is.  But for completeness, add both.

	Change-Id: I31b2ff67c7b78251314646b31887ef1dfebe510c

2021-07-13  Pedro Alves  <pedro@palves.net>

	gdb: make inferior_list use intrusive_list
	Change inferior_list, the global list of inferiors, to use
	intrusive_list.  I think most other changes are somewhat obvious
	fallouts from this change.

	There is a small change in behavior in scoped_mock_context.  Before this
	patch, constructing a scoped_mock_context would replace the whole
	inferior list with only the new mock inferior.  Tests using two
	scoped_mock_contexts therefore needed to manually link the two inferiors
	together, as the second scoped_mock_context would bump the first mock
	inferior from the thread list.  With this patch, a scoped_mock_context
	adds its mock inferior to the inferior list on construction, and removes
	it on destruction.  This means that tests run with mock inferiors in the
	inferior list in addition to any pre-existing inferiors (there is always
	at least one).  There is no possible pid clash problem, since each
	scoped mock inferior uses its own process target, and pids are per
	process target.

	Co-Authored-By: Simon Marchi <simon.marchi@efficios.com>
	Change-Id: I7eb6a8f867d4dcf8b8cd2dcffd118f7270756018

2021-07-13  Pedro Alves  <pedro@palves.net>

	gdb: introduce intrusive_list, make thread_info use it
	GDB currently has several objects that are put in a singly linked list,
	by having the object's type have a "next" pointer directly.  For
	example, struct thread_info and struct inferior.  Because these are
	simply-linked lists, and we don't keep track of a "tail" pointer, when
	we want to append a new element on the list, we need to walk the whole
	list to find the current tail.  It would be nice to get rid of that
	walk.  Removing elements from such lists also requires a walk, to find
	the "previous" position relative to the element being removed.  To
	eliminate the need for that walk, we could make those lists
	doubly-linked, by adding a "prev" pointer alongside "next".  It would be
	nice to avoid the boilerplate associated with maintaining such a list
	manually, though.  That is what the new intrusive_list type addresses.

	With an intrusive list, it's also possible to move items out of the
	list without destroying them, which is interesting in our case for
	example for threads, when we exit them, but can't destroy them
	immediately.  We currently keep exited threads on the thread list, but
	we could change that which would simplify some things.

	Note that with std::list, element removal is O(N).  I.e., with
	std::list, we need to walk the list to find the iterator pointing to
	the position to remove.  However, we could store a list iterator
	inside the object as soon as we put the object in the list, to address
	it, because std::list iterators are not invalidated when other
	elements are added/removed.  However, if you need to put the same
	object in more than one list, then std::list<object> doesn't work.
	You need to instead use std::list<object *>, which is less efficient
	for requiring extra memory allocations.  For an example of an object
	in multiple lists, see the step_over_next/step_over_prev fields in
	thread_info:

	  /* Step-over chain.  A thread is in the step-over queue if these are
	     non-NULL.  If only a single thread is in the chain, then these
	     fields point to self.  */
	  struct thread_info *step_over_prev = NULL;
	  struct thread_info *step_over_next = NULL;

	The new intrusive_list type gives us the advantages of an intrusive
	linked list, while avoiding the boilerplate associated with manually
	maintaining it.

	intrusive_list's API follows the standard container interface, and thus
	std::list's interface.  It is based the API of Boost's intrusive list,
	here:

	 https://www.boost.org/doc/libs/1_73_0/doc/html/boost/intrusive/list.html

	Our implementation is relatively simple, while Boost's is complicated
	and intertwined due to a lot of customization options, which our version
	doesn't have.

	The easiest way to use an intrusive_list is to make the list's element
	type inherit from intrusive_node.  This adds a prev/next pointers to
	the element type.  However, to support putting the same object in more
	than one list, intrusive_list supports putting the "node" info as a
	field member, so you can have more than one such nodes, one per list.

	As a first guinea pig, this patch makes the per-inferior thread list use
	intrusive_list using the base class method.

	Unlike Boost's implementation, ours is not a circular list.  An earlier
	version of the patch was circular: the intrusive_list type included an
	intrusive_list_node "head".  In this design, a node contained pointers
	to the previous and next nodes, not the previous and next elements.
	This wasn't great for when debugging GDB with GDB, as it was difficult
	to get from a pointer to the node to a pointer to the element.  With the
	design proposed in this patch, nodes contain pointers to the previous
	and next elements, making it easy to traverse the list by hand and
	inspect each element.

	The intrusive_list object contains pointers to the first and last
	elements of the list.  They are nullptr if the list is empty.
	Each element's node contains a pointer to the previous and next
	elements.  The first element's previous pointer is nullptr and the last
	element's next pointer is nullptr.  Therefore, if there's a single
	element in the list, both its previous and next pointers are nullptr.
	To differentiate such an element from an element that is not linked into
	a list, the previous and next pointers contain a special value (-1) when
	the node is not linked.  This is necessary to be able to reliably tell
	if a given node is currently linked or not.

	A begin() iterator points to the first item in the list.  An end()
	iterator contains nullptr.  This makes iteration until end naturally
	work, as advancing past the last element will make the iterator contain
	nullptr, making it equal to the end iterator.  If the list is empty,
	a begin() iterator will contain nullptr from the start, and therefore be
	immediately equal to the end.

	Iterating on an intrusive_list yields references to objects (e.g.
	`thread_info&`).  The rest of GDB currently expects iterators and ranges
	to yield pointers (e.g. `thread_info*`).  To bridge the gap, add the
	reference_to_pointer_iterator type.  It is used to define
	inf_threads_iterator.

	Add a Python pretty-printer, to help inspecting intrusive lists when
	debugging GDB with GDB.  Here's an example of the output:

	    (top-gdb) p current_inferior_.m_obj.thread_list
	    $1 = intrusive list of thread_info = {0x61700002c000, 0x617000069080, 0x617000069400, 0x61700006d680, 0x61700006eb80}

	It's not possible with current master, but with this patch [1] that I
	hope will be merged eventually, it's possible to index the list and
	access the pretty-printed value's children:

	    (top-gdb) p current_inferior_.m_obj.thread_list[1]
	    $2 = (thread_info *) 0x617000069080
	    (top-gdb) p current_inferior_.m_obj.thread_list[1].ptid
	    $3 = {
	      m_pid = 406499,
	      m_lwp = 406503,
	      m_tid = 0
	    }

	Even though iterating the list in C++ yields references, the Python
	pretty-printer yields pointers.  The reason for this is that the output
	of printing the thread list above would be unreadable, IMO, if each
	thread_info object was printed in-line, since they contain so much
	information.  I think it's more useful to print pointers, and let the
	user drill down as needed.

	[1] https://sourceware.org/pipermail/gdb-patches/2021-April/178050.html

	Co-Authored-By: Simon Marchi <simon.marchi@efficios.com>
	Change-Id: I3412a14dc77f25876d742dab8f44e0ba7c7586c0

2021-07-13  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-12  Tucker  <tuckkern@sourceware@gmail.com>

	Add the SEC_ELF_OCTETS flag to debug sections created by the assembler.
		PR 28054
	gas	* config/obj-elf.c (obj_elf_change_section): Set the
		SEF_ELF_OCTETS flag on debug sections.

2021-07-12  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.btrace/tsx.exp on system with tsx disabled in microcode
	Recently I started to see this fail with trunk:
	...
	(gdb) record instruction-history^M
	1          0x00000000004004ab <main+4>: call   0x4004b7 <test>^M
	2          0x00000000004004c6 <test+15>:        mov    $0x1,%eax^M
	3          0x00000000004004cb <test+20>:        ret    ^M
	(gdb) FAIL: gdb.btrace/tsx.exp: speculation indication
	...

	This is due to an intel microcode update (1) that disables Intel TSX by default.

	Fix this by updating the pattern.

	Tested on x86_64-linux, with both gcc 7.5.0 and clang 12.0.1.

	[1] https://www.intel.com/content/www/us/en/support/articles/000059422/processors.html

	gdb/testsuite/ChangeLog:

	2021-07-12  Tom de Vries  <tdevries@suse.de>

		PR testsuite/28057
		* gdb.btrace/tsx.exp: Add pattern for system with tsx disabled in
		microcode.

2021-07-12  Nick Clifton  <nickc@redhat.com>

	Updated French translation for the binutils sub-directory

	Fix a translation problem for the text generated by readelf at the start of a dump of a dynamic section.
		PR 28072
	binutils * readelf.c (process_dynamic_section): Use ngettext to help with translation of header text.

2021-07-12  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.mi/mi-info-sources.exp for extra debug info
	When running test-case gdb.mi/mi-info-sources.exp, I run into:
	...
	Running src/gdb/testsuite/gdb.mi/mi-info-sources.exp ...
	ERROR: internal buffer is full.
	...
	due to extra debug info from the shared libraries.

	Fix this by using "nosharedlibrary".

	Then I run into these FAILs:
	...
	FAIL: gdb.mi/mi-info-sources.exp: debug_read=false: \
	  -file-list-exec-source-files (unexpected output)
	FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
	  -file-list-exec-source-files (unexpected output)
	FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
	  -file-list-exec-source-files --group-by-objfile, look for \
	  mi-info-sources.c (unexpected output)
	FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
	  -file-list-exec-source-files --group-by-objfile, look for \
	  mi-info-sources-base.c (unexpected output)
	...
	due to openSUSE executables which have debug info for objects from sources
	like sysdeps/x86_64/crtn.S.

	Fix these by updating the patterns, and adding "maint expand-symtabs" to
	reliably get fully-read objfiles.

	Then I run into FAILs when using the readnow target board.  Fix these by
	skipping the relevant tests.

	Then I run into FAILs when using the cc-with-gnu-debuglink board.  Fix these
	by updating the patterns.

	Tested on x86_64-linux, with native, check-read1, readnow, cc-with-gdb-index,
	cc-with-debug-names, cc-with-gnu-debuglink, cc-with-dwz, cc-with-dwz-m.

	gdb/testsuite/ChangeLog:

	2021-07-05  Tom de Vries  <tdevries@suse.de>

		* lib/mi-support.exp (mi_readnow): New proc.
		* gdb.mi/mi-info-sources.exp: Use nosharedlibrary.  Update patterns.
		Skip tests for readnow.  Use "maint expand-symtabs".

2021-07-12  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	testsuite: fix whitespace problems in gdb.mi/mi-break.exp
	Replace leading 8-spaces with tab and remove trailing space in
	gdb.mi/mi-break.exp.

2021-07-12  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-11  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-10  Alan Modra  <amodra@gmail.com>

	Tidy commit 49910fd88dcd
	Pointer range checking is UB if the values compared are outside the
	underlying array elements (plus one).

		* dwarf2.c (read_address): Remove accidental commit.
		(read_ranges): Compare offset rather than pointers.

2021-07-10  Alan Modra  <amodra@gmail.com>

	PR28069, assertion fail in dwarf.c:display_discr_list
	We shouldn't be asserting on anything to do with leb128 values, or
	reporting file and line numbers when something unexpected happens.
	leb128 data is of indeterminate length, perfect for fuzzer mayhem.
	It would only make sense to assert or report dwarf.c/readelf.c source
	lines if the code had already sized and sanity checked the leb128
	values.

	After removing the assertions, the testcase then gave:

	    <37>   DW_AT_discr_list  : 5 byte block: 0 0 0 0 0 	(label 0, label 0, label 0, label 0, <corrupt>
	readelf: Warning: corrupt discr_list - unrecognized discriminant byte 0x5

	    <3d>   DW_AT_encoding    : 0	(void)
	    <3e>   DW_AT_identifier_case: 0	(case_sensitive)
	    <3f>   DW_AT_virtuality  : 0	(none)
	    <40>   DW_AT_decimal_sign: 5	(trailing separate)

	So the DW_AT_discr_list was showing more data than just the 5 byte
	block.  That happened due to "end" pointing a long way past the end of
	block, and uvalue decrementing past zero on one of the leb128 bytes.

		PR 28069
		* dwarf.c (display_discr_list): Remove assertions.  Delete "end"
		parameter, use initial "data" pointer as the end.  Formatting.
		Don't count down bytes as they are read.
		(read_and_display_attr_value): Adjust display_discr_list call.
		(read_and_print_leb128): Don't pass __FILE__ and __LINE__ to
		report_leb_status.
		* dwarf.h (report_leb_status): Don't report file and line
		numbers.  Delete file and lnum parameters,
		(READ_ULEB, READ_SLEB): Adjust.

2021-07-10  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-09  H.J. Lu  <hjl.tools@gmail.com>

	ld/NEWS: Clarify -z [no]indirect-extern-access
	-z [no]indirect-extern-access are only for x86 ELF linker.

2021-07-09  H.J. Lu  <hjl.tools@gmail.com>

	elf: Limits 2 GNU_PROPERTY_1_NEEDED tests to Linux/x86
	Run property-1_needed-1b.d and property-1_needed-1c.d, which pass
	-z [no]indirect-extern-access to linker, only run for Linux/x86 targets.

		* testsuite/ld-elf/property-1_needed-1b.d: Only run for
		Linux/x86 targets.
		* testsuite/ld-elf/property-1_needed-1c.d: Likewise.

2021-07-09  H.J. Lu  <hjl.tools@gmail.com>

	elf: Add GNU_PROPERTY_1_NEEDED check
	If GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS is set on any input
	relocatable files:

	1. Don't generate copy relocations.
	2. Turn off extern_protected_data since it implies
	GNU_PROPERTY_NO_COPY_ON_PROTECTED.
	3. Treate reference to protected symbols with indirect external access
	as local.
	4. Set GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS on output.
	5. When generating executable, clear this bit when there are non-GOT or
	non-PLT relocations in input relocatable files without the bit set.
	6. Add -z [no]indirect-extern-access to control indirect external access.

	bfd/

		* elf-bfd (elf_obj_tdata): Add has_indirect_extern_access.
		(elf_has_indirect_extern_access): New.
		* elf-properties.c (_bfd_elf_parse_gnu_properties): Set
		elf_has_indirect_extern_access and elf_has_no_copy_on_protected
		when seeing GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
		(elf_write_gnu_propertie): Add an argument to pass link_info.
		Set needed_1_p for GNU_PROPERTY_1_NEEDED in memory.
		(_bfd_elf_link_setup_gnu_properties): Handle
		GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS for
		-z indirect-extern-access.  Set nocopyreloc to true and
		extern_protected_data to false for indirect external access.
		(_bfd_elf_convert_gnu_properties): Updated.
		* elf32-i386.c (elf_i386_check_relocs): Set
		non_got_ref_without_indirect_extern_access on legacy non-GOT or
		non-PLT references.
		* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
		* elflink.c (_bfd_elf_symbol_refs_local_p): Return true for
		STV_PROTECTED symbols with indirect external access.
		* elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): Clear
		indirect_extern_access for legacy non-GOT/non-PLT references.
		* elfxx-x86.h (elf_x86_link_hash_entry): Add
		non_got_ref_without_indirect_extern_access.

	include/

		* bfdlink.h (bfd_link_info): Add indirect_extern_access and
		needed_1_p.  Change nocopyreloc to int.

	ld/

		* NEWS: Mention -z [no]indirect-extern-access
		* ld.texi: Document -z [no]indirect-extern-access
		* ldmain.c (main): Initialize link_info.indirect_extern_access
		to -1.
		* emulparams/extern_protected_data.sh: Support
		-z [no]indirect-extern-access.
		* testsuite/ld-elf/indirect-extern-access-1.rd: New file
		* testsuite/ld-elf/indirect-extern-access-1a.c: Likewise.
		* testsuite/ld-elf/indirect-extern-access-1b.c: Likewise.
		* testsuite/ld-elf/indirect-extern-access-2.rd: Likewise.
		* testsuite/ld-elf/indirect-extern-access-2a.c: Likewise.
		* testsuite/ld-elf/indirect-extern-access-2b.c: Likewise.
		* testsuite/ld-elf/indirect-extern-access-3.rd: Likewise.
		* testsuite/ld-elf/indirect-extern-access.S: Likewise.
		* testsuite/ld-elf/property-1_needed-1b.d: Likewise.
		* testsuite/ld-elf/property-1_needed-1c.d: Likewise.
		* testsuite/ld-x86-64/indirect-extern-access.rd: Likewise.
		* testsuite/ld-x86-64/protected-data-1.h: Likewise.
		* testsuite/ld-x86-64/protected-data-1a.c: Likewise.
		* testsuite/ld-x86-64/protected-data-1b.c: Likewise.
		* testsuite/ld-x86-64/protected-data-2a.S: Likewise.
		* testsuite/ld-x86-64/protected-data-2b.S: Likewise.
		* testsuite/ld-x86-64/protected-func-2a.S: Likewise.
		* testsuite/ld-x86-64/protected-func-2b.S: Likewise.
		* testsuite/ld-x86-64/protected-func-2c.c: Likewise.
		* testsuite/ld-elf/linux-x86.exp: Run test with
		GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS.
		* testsuite/ld-x86-64/x86-64.exp: Run tests for protected
		function and data with indirect external access.

2021-07-09  H.J. Lu  <hjl.tools@gmail.com>

	elf: Add GNU_PROPERTY_1_NEEDED
	Add GNU_PROPERTY_1_NEEDED:

	 #define GNU_PROPERTY_1_NEEDED      GNU_PROPERTY_UINT32_OR_LO

	to indicate the needed properties by the object file.

	Add GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS:

	 #define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS  (1U << 0)

	to indicate that the object file requires canonical function pointers and
	cannot be used with copy relocation.

	binutils/

		* readelf.c (decode_1_needed): New.
		(print_gnu_property_note): Handle GNU_PROPERTY_1_NEEDED.

	include/

		* elf/common.h (GNU_PROPERTY_1_NEEDED): New.
		(GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS): Likewise.

	ld/

		* testsuite/ld-elf/property-1_needed-1a.d: New file.
		* testsuite/ld-elf/property-1_needed-1.s: Likewise.

2021-07-09  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-09  Lancelot SIX  <lsix@lancelotsix.com>

	Remove unused parameter in maybe_software_singlestep
	While working around, I noticed that the last parameter of
	maybe_software_singlestep is never used.  This path removes
	it.

	Built on x86_64-linux-gnu and riscv64-linux-gnu.

	gdb/ChangeLog:

		* infrun.c (maybe_software_singlestep): Remove unused PC
		parameter.
		(resume_1): Update calls to maybe_software_singlestep.

2021-07-08  H.J. Lu  <hjl.tools@gmail.com>

	x86-64: Disallow PC reloc against weak undefined symbols in PIE
	Disallow PC relocations against weak undefined symbols in PIE since they
	can lead to non-zero address at run-time.

	bfd/

		PR ld/21782
		* elf64-x86-64.c (elf_x86_64_relocate_section): Disallow PC
		relocations against weak undefined symbols in PIE.

	ld/

		PR ld/21782
		* testsuite/ld-x86-64/pie3.d: Expect linker error.

2021-07-08  H.J. Lu  <hjl.tools@gmail.com>

	ld: Limit cache size and add --max-cache-size=SIZE
	When link_info.keep_memory is true, linker caches the relocation
	information and symbol tables of input files in memory.  When there
	are many input files with many relocations, we may run out of memory.
	Add --max-cache-size=SIZE to set the maximum cache size.

	bfd/

		PR ld/18028
		* bfd.c (bfd): Add alloc_size.
		* elf-bfd.h (_bfd_elf_link_info_read_relocs): New.
		* elf32-i386.c (elf_i386_check_relocs): Use _bfd_link_keep_memory.
		Update cache_size.
		* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
		* elflink.c (_bfd_elf_link_read_relocs): Renamed to ...
		(_bfd_elf_link_info_read_relocs): This.  Update cache_size.
		(_bfd_elf_link_read_relocs): New.
		(_bfd_elf_link_check_relocs): Call _bfd_elf_link_info_read_relocs
		instead of _bfd_elf_link_read_relocs.
		(elf_link_add_object_symbols): Likewise.
		(elf_link_input_bfd): Likewise.
		(init_reloc_cookie_rels): Likewise.
		(init_reloc_cookie): Update cache_size.  Call
		_bfd_elf_link_info_read_relocs instead of
		_bfd_elf_link_read_relocs.
		(link_info_ok): New.
		(elf_gc_smash_unused_vtentry_relocs): Updated.  Call
		_bfd_elf_link_info_read_relocs instead of
		_bfd_elf_link_read_relocs.
		(bfd_elf_gc_sections): Use link_info_ok.  Pass &link_info_ok
		to elf_gc_smash_unused_vtentry_relocs.
		* libbfd-in.h (_bfd_link_keep_memory): New.
		* linker.c (_bfd_link_keep_memory): New.
		* opncls.c (bfd_alloc): Update alloc_size.
		* bfd-in2.h: Regenerated.
		* libbfd.h: Likewise.

	include/

		PR ld/18028
		* bfdlink.h (bfd_link_info): Add cache_size and max_cache_size.

	ld/

		PR ld/18028
		* NEWS: Mention --max-cache-size=SIZE.
		* ld.texi: Document --max-cache-size=SIZE.
		* ldlex.h (option_values): Add OPTION_MAX_CACHE_SIZE.
		* ldmain.c: (main): Set link_info.max_cache_size to -1.
		* lexsup.c (ld_options): Add --max-cache-size=SIZE.
		(parse_args): Support OPTION_MAX_CACHE_SIZE.
		* testsuite/ld-bootstrap/bootstrap.exp: Add test for
		--max-cache-size=-1.

2021-07-08  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: don't set Linux-specific displaced stepping methods in s390_gdbarch_init
	According to bug 28056, running an s390x binary gives:

	    (gdb) run
	    Starting program: /usr/bin/ls
	    /home/ubuntu/tmp/gdb-11.0.90.20210705/gdb/linux-tdep.c:2550: internal-error: displaced_step_prepare_status linux_displaced_step_prepare(gdbarch*, thread_info*, CORE_ADDR&): Assertion `gdbarch_data->num_disp_step_buffers > 0' failed.

	This is because the s390 architecture registers some Linux-specific
	displaced stepping callbacks in the OS-agnostic s390_gdbarch_init:

	    set_gdbarch_displaced_step_prepare (gdbarch, linux_displaced_step_prepare);
	    set_gdbarch_displaced_step_finish (gdbarch, linux_displaced_step_finish);
	    set_gdbarch_displaced_step_restore_all_in_ptid
	      (gdbarch, linux_displaced_step_restore_all_in_ptid);

	But then the Linux-specific s390_linux_init_abi_any passes
	num_disp_step_buffers=0 to linux_init_abi:

	    linux_init_abi (info, gdbarch, 0);

	The problem happens when linux_displaced_step_prepare is called for the
	first time.  It tries to allocate the displaced stepping buffers, but
	sees that the number of displaced stepping buffers for that architecture
	is 0, which is unexpected / invalid.

	s390_gdbarch_init should not register the linux_* callbacks, that is
	expected to be done by linux_init_abi.  If debugging a bare-metal s390
	program, or an s390 program on another OS GDB doesn't know about, we
	wouldn't want to use them.  We would either register no callbacks, if
	displaced stepping isn't supported, or register a different set of
	callbacks if we wanted to support displaced stepping in those cases.

	The commit that refactored the displaced stepping machinery and
	introduced these set_gdbarch_displaced_step_* calls is 187b041e2514
	("gdb: move displaced stepping logic to gdbarch, allow starting
	concurrent displaced steps").  However, even before that,
	s390_gdbarch_init did:

	  set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location);

	... which already seemed wrong.  The Linux-specific callback was used
	even for non-Linux system.  Maybe that was on purpose, because it would
	also happen to work in some other non-Linux case, or maybe it was simply
	a mistake.  I'll assume that this was a small mistake when
	s390-tdep.{h,c} where factored out of s390-linux-tdep.c, in d6e589456475
	("s390: Split up s390-linux-tdep.c into two files").

	Fix this by removing the setting of these displaced step callbacks from
	s390_gdbarch_init.  Instead, pass num_disp_step_buffers=1 to
	linux_init_abi, in s390_linux_init_abi_any.  Doing so will cause
	linux_init_abi to register these same callbacks.  It will also mean that
	when debugging a bare-metal s390 executable or an executable on another
	OS that GDB doesn't know about, gdbarch_displaced_step_prepare won't be
	set, so displaced stepping won't be used.

	This patch will need to be merged in the gdb-11-branch, since this is a
	GDB 11 regression, so here's the ChangeLog entry:

	gdb/ChangeLog:

		* s390-linux-tdep.c (s390_linux_init_abi_any): Pass 1 (number
		of displaced stepping buffers to linux_init_abi.
		* s390-tdep.c (s390_gdbarch_init): Don't set the Linux-specific
		displaced-stepping gdbarch callbacks.

	Change-Id: Ieab2f8990c78fde845ce7378d6fd4ee2833800d5
	Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28056

2021-07-08  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/Makefile.in: remove testsuite from SUBDIRS
	When distclean-ing a configured / built gdb directory, like so:

	    $ ./configure && make all-gdb && make distclean

	The distclean operation fails with:

	    Missing testsuite/Makefile

	If we look at the SUBDIRS variable in the generated gdb/Makefile,
	testsuite is there twice:

	    SUBDIRS = doc  testsuite data-directory testsuite

	So we try distclean-ing the testsuite directory twice.  The second time,
	gdb/testsuite/Makefile doesn't exist, so it fails.

	The first "testsuite" comes from the @subdirs@ replacement, because of
	the `AC_CONFIG_SUBDIRS` macro in gdb/configure.ac.  The second one is
	hard-coded in gdb/Makefile.in:

	    SUBDIRS = doc @subdirs@ data-directory testsuite

	The hard-coded was added by:

	    bdbbcd577460 ("Always build 'all' in gdb/testsuite")

	which came after `testsuite` was removed from @subdirs@ by:

	    f99d1d37496f ("Remove gdb/testsuite/configure")

	My commit a100a94530eb ("gdb/testsuite: restore configure script")
	should have removed the hard-coded `testsuite`, since it added it back
	as a "subdir", but I missed it because I only looked f99d1d37496f to
	write my patch.

	Fix this by removing the hard-coded one.

	This patch should be pushed to both master and gdb-11-branch, hence the
	ChangeLog entry:

	gdb/ChangeLog:

		* Makefile.in (SUBDIRS): Remove testsuite.

	Change-Id: I63e5590b1a08673c646510b3ecc74600eae9f92d

2021-07-08  Nick Clifton  <nickc@redhat.com>

	Updated Portuguese translation for the BFD sub-directory

2021-07-08  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix gdb.guile/scm-breakpoint.exp with guile 3.0
	When running test-case gdb.guile/scm-breakpoint.exp on openSUSE Tumbleweed
	with guile 3.0, I run into:
	...
	(gdb) guile (define cp (make-breakpoint "syscall" #:type BP_CATCHPOINT))^M
	ERROR: In procedure make-breakpoint:^M
	In procedure gdbscm_make_breakpoint: unsupported breakpoint type in \
	  position 3: "BP_CATCHPOINT"^M
	Error while executing Scheme code.^M
	(gdb) FAIL: gdb.guile/scm-breakpoint.exp: test_catchpoints: \
	  create a catchpoint via the api
	...

	The same test passes on openSUSE Leap 15.2 with guile 2.0, where the second
	line of the error message starts with the same prefix as the first:
	...
	ERROR: In procedure gdbscm_make_breakpoint: unsupported breakpoint type in \
	  position 3: "BP_CATCHPOINT"^M
	...

	I observe the same difference in many other tests, f.i.:
	...
	(gdb) gu (print (value-add i '()))^M
	ERROR: In procedure value-add:^M
	In procedure gdbscm_value_add: Wrong type argument in position 2: ()^M
	Error while executing Scheme code.^M
	(gdb) PASS: gdb.guile/scm-math.exp: catch error in guile type conversion
	...
	but it doesn't cause FAILs anywhere else.

	Fix this by updating the regexp to make the "ERROR: " prefix optional.

	Tested on x86_64-linux, with both guile 2.0 and 3.0.

	gdb/testsuite/ChangeLog:

	2021-07-07  Tom de Vries  <tdevries@suse.de>

		* gdb.guile/scm-breakpoint.exp: Make additional "ERROR: " prefix in
		exception printing optional.

2021-07-08  Mike Frysinger  <vapier@gentoo.org>

	sim: erc32: use libsim.a for common objects
	We're starting to move more objects to the common build that sis did
	not need before, so linking them is causing problems (when common
	objects end up needing symbols from non-common objects).  Switch it
	to the libsim.a archive which will allow the link to pull out only
	what it needs.

2021-07-08  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-07  Nick Clifton  <nickc@redhat.com>

	Remove an accidental change to elfcode.h included as part of commit 6e0dfbf420.
		PR 27659
		* elfcode.h (elf_swap_symbol_out): Revert accidental change that
		removed an abort if the shndx pointer is NULL.

2021-07-07  H.J. Lu  <hjl.tools@gmail.com>

	ld: Check archive only for archive member
	Since plugin_maybe_claim calls bfd_close on the original input BFD if it
	isn't an archive member, pass NULL to bfd_plugin_close_file_descriptor
	to indicate that the BFD isn't an archive member.

	bfd/

		PR ld/18028
		* plugin.c (bfd_plugin_close_file_descriptor): Check archive
		only of abfd != NULL.
		(try_claim): Pass NULL to bfd_plugin_close_file_descriptor if
		it isn't an archive member.

	ld/

		PR ld/18028
		* plugin.c (plugin_input_file): Add comments for abfd and ibfd.
		(plugin_object_p): Set input->ibfd to NULL if it isn't an
		archive member.

2021-07-07  Andreas Krebbel  <krebbel@linux.ibm.com>

	Add changelog entries for last commit

2021-07-07  Andreas Krebbel  <krebbel@linux.ibm.com>

	IBM Z: Add another arch14 instruction
	opcodes/

		* opcodes/s390-opc.txt: Add qpaci.

	gas/

		* testsuite/gas/s390/zarch-arch14.d: Add qpaci.
		* testsuite/gas/s390/zarch-arch14.s: Add qpaci.

2021-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	Fix Solaris gprof build with --disable-nls
	gprof fails to compile on Solaris 10 and 11.3 with --disable-nls:

	In file included from /vol/src/gnu/binutils/hg/binutils-2.37-branch/git/gprof/gprof.h:33,
	                 from /vol/src/gnu/binutils/hg/binutils-2.37-branch/git/gprof/basic_blocks.c:24:
	/usr/include/libintl.h:45:14: error: expected identifier or '(' before 'const'
	   45 | extern char *dcgettext(const char *, const char *, const int);
	      |              ^~~~~~~~~
	/usr/include/libintl.h:46:14: error: expected identifier or '(' before 'const'
	   46 | extern char *dgettext(const char *, const char *);
	      |              ^~~~~~~~
	/usr/include/libintl.h:47:14: error: expected identifier or '(' before 'const'
	   47 | extern char *gettext(const char *);
	      |              ^~~~~~~
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/gprof/../bfd/sysdep.h:165:33:
	error: expected identifier or '(' before 'do'
	  165 | # define textdomain(Domainname) do {} while (0)
	      |                                 ^~
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/gprof/../bfd/sysdep.h:165:39:
	error: expected identifier or '(' before 'while'
	  165 | # define textdomain(Domainname) do {} while (0)
	      |                                       ^~~~~
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/gprof/../bfd/sysdep.h:166:46:
	error: expected identifier or '(' before 'do'
	  166 | # define bindtextdomain(Domainname, Dirname) do {} while (0)
	      |                                              ^~
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/gprof/../bfd/sysdep.h:166:52:
	error: expected identifier or '(' before 'while'
	  166 | # define bindtextdomain(Domainname, Dirname) do {} while (0)
	      |                                                    ^~~~~
	/usr/include/libintl.h:55:14: error: expected identifier or '(' before 'unsigned'
	   55 | extern char *dcngettext(const char *, const char *,
	      |              ^~~~~~~~~~
	/usr/include/libintl.h:57:14: error: expected identifier or '(' before 'unsigned'
	   57 | extern char *dngettext(const char *, const char *,
	      |              ^~~~~~~~~
	/usr/include/libintl.h:59:14: error: expected identifier or '(' before 'unsigned'
	   59 | extern char *ngettext(const char *, const char *, unsigned long int);
	      |              ^~~~~~~~

	This is a known issue already partially fixed in binutils/sysdep.h.  For
	gprof, the same fix needs to be applied in bfd/sysdep.h, as the
	following patch does.  Tested on i386-pc-solaris2.10 and
	i386-pc-solaris2.11.

	2021-07-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

		bfd:
		* sysdep.h [!ENABLE_NLS]: Prevent inclusion of <libintl.h> on
		Solaris.

2021-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	Check for strnlen declaration to fix Solaris 10 build
	binutils currently fails to compile on Solaris 10:

	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/bfd/opncls.c: In function 'bfd_get_debug_link_info_1':
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/bfd/opncls.c:1231:16: error: implicit declaration of function 'strnlen' [-Werror=implicit-function-declaration]
	 1231 |	  crc_offset = strnlen (name, size) + 1;
	      |		       ^~~~~~~
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/bfd/opncls.c:1231:16: error: incompatible implicit declaration of built-in function 'strnlen' [-Werror]
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/bfd/opncls.c: In function 'bfd_get_alt_debug_link_info':
	/vol/src/gnu/binutils/hg/binutils-2.37-branch/git/bfd/opncls.c:1319:20: error: incompatible implicit declaration of built-in function 'strnlen' [-Werror]
	 1319 |	  buildid_offset = strnlen (name, size) + 1;
	      |			   ^~~~~~~

	and in a couple of other places.  The platform lacks strnlen, and while
	libiberty.h can provide a fallback declaration, the necessary configure
	test isn't run.

	Fixed with the following patch.  Tested on i386-pc-solaris2.10.

	2021-07-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

		bfd:
		* configure.ac: Check for strnlen declaration.
		* configure, config.in: Regenerate.

		binutils:
		* configure.ac: Check for strnlen declaration.
		* configure, config.in: Regenerate.

2021-07-07  Nick Clifton  <nickc@redhat.com>

	Fix problems translating messages when a percentage sign appears at the end of a string.
		PR 28051
	gas	* config/tc-i386.c (offset_in_range): Reformat error messages in
		order to fix problems when translating.
		(md_assemble): Likewise.
		* messages.c (as_internal_value_out_of_range): Likewise.
		* read.c (emit_expr_with_reloc): Likewise.
		* testsuite/gas/all/overflow.l Change expected output format.
		* po/gas.pot: Regenerate.

	bfd	* coff-rs6000.c (xcoff_reloc_type_tls): Reformat error messages in
		order to fix problems when translating.
		* cofflink.c (_bfd_coff_write_global_sym): Likewise.
		* elfnn-aarch64.c (_bfd_aarch64_erratum_843419_branch_to_stub):
		Likewise.
		* po/bfd.pot: Regenerate.

2021-07-07  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-06  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: introduce iterator_range, remove next_adapter
	I was always a bit confused by next_adapter, because it kind of mixes
	the element type and the iterator type.  In reality, it is not much more
	than a class that wraps two iterators (begin and end).  However, it
	assumes that:

	 - you can construct the begin iterator by passing a pointer to the
	   first element of the iterable
	 - you can default-construct iterator to make the end iterator

	I think that by generalizing it a little bit, we can re-use it at more
	places.

	Rename it to "iterator_range".  I think it describes a bit better: it's
	a range made by wrapping a begin and end iterator.  Move it to its own
	file, since it's not related to next_iterator anymore.

	iterator_range has two constructors.  The variadic one, where arguments
	are forwarded to construct the underlying begin iterator.  The end
	iterator is constructed through default construction.  This is a
	generalization of what we have today.

	There is another constructor which receives already constructed begin
	and end iterators, useful if the end iterator can't be obtained by
	default-construction.  Or, if you wanted to make a range that does not
	end at the end of the container, you could pass any iterator as the
	"end".

	This generalization allows removing some "range" classes, like
	all_inferiors_range.  These classes existed only to pass some arguments
	when constructing the begin iterator.  With iterator_range, those same
	arguments are passed to the iterator_range constructed and then
	forwarded to the constructed begin iterator.

	There is a small functional difference in how iterator_range works
	compared to next_adapter.  next_adapter stored the pointer it received
	as argument and constructeur an iterator in the `begin` method.
	iterator_range constructs the begin iterator and stores it as a member.
	Its `begin` method returns a copy of that iterator.

	With just iterator_range, uses of next_adapter<foo> would be replaced
	with:

	  using foo_iterator = next_iterator<foo>;
	  using foo_range = iterator_range<foo_iterator>;

	However, I added a `next_range` wrapper as a direct replacement for
	next_adapter<foo>.  IMO, next_range is a slightly better name than
	next_adapter.

	The rest of the changes are applications of this new class.

	gdbsupport/ChangeLog:

		* next-iterator.h (class next_adapter): Remove.
		* iterator-range.h: New.

	gdb/ChangeLog:

		* breakpoint.h (bp_locations_range): Remove.
		(bp_location_range): New.
		(struct breakpoint) <locations>: Adjust type.
		(breakpoint_range): Use iterator_range.
		(tracepoint_range): Use iterator_range.
		* breakpoint.c (breakpoint::locations): Adjust return type.
		* gdb_bfd.h (gdb_bfd_section_range): Use iterator_range.
		* gdbthread.h (all_threads_safe): Pass argument to
		all_threads_safe_range.
		* inferior-iter.h (all_inferiors_range): Use iterator_range.
		(all_inferiors_safe_range): Use iterator_range.
		(all_non_exited_inferiors_range): Use iterator_range.
		* inferior.h (all_inferiors, all_non_exited_inferiors): Pass
		inferior_list as argument.
		* objfiles.h (struct objfile) <compunits_range>: Remove.
		<compunits>: Return compunit_symtab_range.
		* progspace.h (unwrapping_objfile_iterator)
		<unwrapping_objfile_iterator>: Take parameter by value.
		(unwrapping_objfile_range): Use iterator_range.
		(struct program_space) <objfiles_range>: Define with "using".
		<objfiles>: Adjust.
		<objfiles_safe_range>: Define with "using".
		<objfiles_safe>: Adjust.
		<solibs>: Return so_list_range, define here.
		* progspace.c (program_space::solibs): Remove.
		* psymtab.h (class psymtab_storage) <partial_symtab_iterator>:
		New.
		<partial_symtab_range>: Use iterator_range.
		* solist.h (so_list_range): New.
		* symtab.h (compunit_symtab_range):
		New.
		(symtab_range): New.
		(compunit_filetabs): Change to a function.
		* thread-iter.h (inf_threads_range,
		inf_non_exited_threads_range, safe_inf_threads_range,
		all_threads_safe_range): Use iterator_range.
		* top.h (ui_range): New.
		(all_uis): Use ui_range.

	Change-Id: Ib7a9d2a3547f45f01aa1c6b24536ba159db9b854

2021-07-06  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb/testsuite: restore configure script
	Commit f99d1d37496f ("Remove gdb/testsuite/configure") removed
	gdb/testsuite/configure, as anything gdb/testsuite/configure did could
	be done by gdb/configure.

	There is however one use case that popped up when this changed
	propagated to downstream consumers, to run the testsuite on an already
	built GDB.  In the workflow of ROCm-GDB at AMD, a GDB package is built
	in a CI job.  This GDB package is then tested on different machines /
	hardware configurations as part of other CI jobs.  To achieve this,
	those CI jobs only configure the testsuite directory and run "make
	check" with an appropriate board file.

	In light of this use case, the way I see it is that gdb/testsuite could
	be considered its own project.  It could be stored in a completely
	different repo if we want to, it just happens to be stored inside gdb/.

	Since the only downside of having gdb/testsuite/configure is that it
	takes a few more seconds to run, but on the other hand it's quite useful
	for some people, I propose re-adding it.

	In a sense, this is revert of f99d1d37496f, but it's not a direct
	git-revert, as some things have changed since.

	gdb/ChangeLog:

		* configure.ac: Remove things that were moved from
		testsuite/configure.ac.
		* configure: Re-generate.

	gdb/testsuite/ChangeLog:

		* configure.ac: Restore.
		* configure: Re-generate.
		* aclocal.m4: Re-generate.
		* Makefile.in (distclean): Add config.status.
		(Makefile): Adjust paths.
		(lib/pdtrace): Adjust paths.
		(config.status): Add.

	Change-Id: Ic38c79485e1835712d9c99649c9dfb59667254f1

2021-07-06  Joel Brobecker  <brobecker@adacore.com>

	Rename gdb/ChangeLog to gdb/ChangeLog-2021
	Now that ChangeLog entries are no longer used for GDB patches,
	this commit renames the file gdb/ChangeLog to gdb/ChangeLog-2021,
	similar to what we would do in the context of the "Start of New
	Year" procedure.

	The purpose of this change is to avoid people merging ChangeLog
	entries by mistake when applying existing commits that they are
	currently working on.

2021-07-06  Dan Streetman  <ddstreet@canonical.com>

	sim: ppc: add missing empty targets
	These are copied from sim/common/Make-common.in.

	On ppc the build fails without at least the 'info' target, e.g.:

	Making info in ppc
	make[4]: Entering directory '/<<BUILDDIR>>/gdb-10.2.2974.g5b45e89f56d+21.10.20210510155809/build/default/sim/ppc'
	make[4]: *** No rule to make target 'info'.  Stop.

2021-07-06  Yuri Chornoivan  <yurchor@ukr.net>

	PR 28053: Fix spelling mistakes: usupported -> unsupported and relocatation -> relocation.

2021-07-06  Michael Matz  <matz@suse.de>

	elf/riscv: Fix relaxation with aliases [PR28021]
	the fix for PR22756 only changed behaviour for hidden aliases,
	but the same situation exists for non-hidden aliases: sym_hashes[]
	can contain multiple entries pointing to the same symbol structure
	leading to relaxation adjustment to be applied twice.

	Fix this by testing for duplicates for everything that looks like it
	has a version.

	PR ld/28021

	bfd/
		* elfnn-riscv.c (riscv_relax_delete_bytes): Check for any
		versioning.

	ld/
		* testsuite/ld-riscv-elf/relax-twice.ver: New.
		* testsuite/ld-riscv-elf/relax-twice-1.s: New.
		* testsuite/ld-riscv-elf/relax-twice-2.s: New.
		* testsuite/ld-riscv-elf/ld-riscv-elf.exp
		(run_relax_twice_test): New, and call it.

2021-07-06  Pedro Alves  <pedro@palves.net>
	    Qingchuan Shi  <qingchuan.shi@amd.com>

	Update gdb performance testsuite to be compatible with Python 3.8
	Running "make check-perf" on a system with Python 3.8 (e.g., Ubuntu
	20.04) runs into this Python problem:

	  Traceback (most recent call last):
	    File "<string>", line 1, in <module>
	    File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/perftest.py", line 65, in run
	      self.execute_test()
	    File "<string>", line 35, in execute_test
	    File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/measure.py", line 45, in measure
	      m.start(id)
	    File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/measure.py", line 102, in start
	      self.start_time = time.clock()
	  AttributeError: module 'time' has no attribute 'clock'
	  Error while executing Python code.
	  (gdb) FAIL: gdb.perf/single-step.exp: python SingleStep(1000).run()

	... many times over.

	The problem is that the testsuite is using time.clock(), deprecated in
	Python 3.3 and finaly removed in Python 3.8.  The guidelines say to
	use time.perf_counter() or time.process_time() instead depending on
	requirements.  Looking at the current description of those functions,
	at:

	   https://docs.python.org/3.10/library/time.html

	we have:

	   time.perf_counter() -> float

	       Return the value (in fractional seconds) of a performance
	       counter, i.e. a clock with the highest available resolution to
	       measure a short duration. It does include time elapsed during
	       sleep and is system-wide. (...)

	   time.process_time() -> float

	       Return the value (in fractional seconds) of the sum of the
	       system and user CPU time of the current process. It does not
	       include time elapsed during sleep. It is process-wide by
	       definition. (...)

	I'm thinking that it's just best to record both instead of picking
	one.  So this patch replaces the MeasurementCpuTime measurement class
	with two new classes -- MeasurementPerfCounter and
	MeasurementProcessTime.  Correspondingly, this changes the reports in
	testsuite/perftest.log -- we have two new "perf_counter" and
	"process_time" measurements and the "cpu_time" measurement is gone.  I
	don't suppose breaking backward compatibility here is a big problem.
	I suspect no one is really tracking long term performance using the
	perf testsuite today.  And if they are, it shouldn't be hard to adjust.

	For backward compatility, with Python < 3.3, both perf_counter and
	process_time use the old time.clock.

	gdb/testsuite/ChangeLog:
	yyyy-mm-dd  Qingchuan Shi  <qingchuan.shi@amd.com>
		    Pedro Alves  <pedro@palves.net>

		* gdb.perf/lib/perftest/perftest.py: Import sys.
		(time.perf_counter, time.process_time): Map to time.clock on
		Python < 3.3.
		(MeasurementCpuTime): Delete, replaced by...
		(MeasurementPerfCounter, MeasurementProcessTime): .. these two new
		classes.
		* gdb.perf/lib/perftest/perftest.py: Import MeasurementPerfCounter
		and MeasurementProcessTime instead of MeasurementCpuTime.
		(TestCaseWithBasicMeasurements): Use MeasurementPerfCounter and
		MeasurementProcessTime instead of MeasurementCpuTime.


	Change-Id: Ia850c05d5ce57d2dada70ba5b0061f566444aa2b

2021-07-06  Pedro Alves  <pedro@palves.net>

	gdb.perf/: FAIL on Python errors, avoid "ERROR: internal buffer is full"
	Currently, if you run make check-perf on a system with Python 3.8,
	tests seen to PASS, but they actually test a lot less than intended,
	due to:

	 PerfTest::assemble, run ...
	 python BackTrace(64).run()
	 Traceback (most recent call last):
	   File "<string>", line 1, in <module>
	   File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/perftest.py", line 65, in run
	     self.execute_test()
	   File "<string>", line 49, in execute_test
	   File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/measure.py", line 45, in measure
	     m.start(id)
	   File "/home/pedro/rocm/gdb/src/gdb/testsuite/gdb.perf/lib/perftest/measure.py", line 102, in start
	     self.start_time = time.clock()
	 AttributeError: module 'time' has no attribute 'clock'
	 Error while executing Python code.
	 (gdb) PASS: gdb.perf/backtrace.exp: python BackTrace(64).run()

	And then, after fixing the above Python compatibility issues (which
	will be a separate patch), I get 86 instances of overflowing expect's
	buffer, like:

	  ERROR: internal buffer is full.
	  UNRESOLVED: gdb.perf/single-step.exp: python SingleStep(1000).run()

	This patch fixes both problems by adding & using a gdb_test_python_run
	routine that:

	 - checks for Python errors
	 - consumes output line by line

	gdb/testsuite/ChangeLog:
	yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

		* gdb.perf/backtrace.exp: Use gdb_test_python_run.
		* gdb.perf/disassemble.exp: Use gdb_test_python_run.
		* gdb.perf/single-step.exp: Use gdb_test_python_run.
		* gdb.perf/skip-command.exp: Use gdb_test_python_run.
		* gdb.perf/skip-prologue.exp: Use gdb_test_python_run.
		* gdb.perf/solib.exp: Use gdb_test_python_run.
		* gdb.perf/template-breakpoints.exp: Use gdb_test_python_run.
		* lib/perftest.exp (gdb_test_python_run): New.

	Change-Id: I007af36f164b3f4cda41033616eaaa4e268dfd2f

2021-07-06  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Remove read1 timeout factor from gdb.base/info-macros.exp
	At the moment some check-read1 timeouts are handled like this in
	gdb.base/info-macros.exp:
	...
	gdb_test_multiple_with_read1_timeout_factor 10 "$test" $testname {
	  -re "$r1$r2$r3" {
	     pass $testname
	  }
	  -re ".*#define TWO.*\r\n$gdb_prompt" {
	     fail $testname
	  }
	  -re ".*#define THREE.*\r\n$gdb_prompt" {
	     fail $testname
	  }
	  -re ".*#define FOUR.*\r\n$gdb_prompt" {
	     fail $testname
	  }
	}
	...
	which is not ideal.

	We could use gdb_test_lines, but it currently doesn't support verifying
	the absence of regexps, which is done using the clauses above calling fail.

	Fix this by using gdb_test_lines and adding a -re-not syntax to
	gdb_test_lines, such that we can do:
	...
	gdb_test_lines $test $testname $r1.*$r2 \
	    -re-not "#define TWO" \
	    -re-not "#define THREE" \
	    -re-not "#define FOUR"
	...

	Tested on x86_64-linux, whith make targets check and check-read1.

	Also observed that check-read1 execution time is reduced from 6m35s to 13s.

	gdb/testsuite/ChangeLog:

	2021-07-06  Tom de Vries  <tdevries@suse.de>

		* gdb.base/info-macros.exp: Replace use of
		gdb_test_multiple_with_read1_timeout_factor with gdb_test_lines.
		(gdb_test_multiple_with_read1_timeout_factor): Remove.
		* lib/gdb.exp (gdb_test_lines): Add handling or -re-not <regexp>.

2021-07-06  Nelson Chu  <nelson.chu@sifive.com>

	RISC-V: Fix the build broken with -Werror.
	ChangeLog:

	bfd/

		* elfnn-riscv.c(riscv_elf_additional_program_headers): Removed the
		unused variable s.
		(riscv_elf_modify_segment_map): Added ATTRIBUTE_UNUSED for the
		unused parameter info.

2021-07-06  Tom de Vries  <tdevries@suse.de>

	[gdb/symtab] Fix skipping of import of C++ CU
	Tom Tromey observed that when changing the language in
	gdb.dwarf2/imported-unit-bp.exp from c to c++, the test failed.

	This is due to this code in process_imported_unit_die:
	...
	      /* We're importing a C++ compilation unit with tag DW_TAG_compile_unit
	         into another compilation unit, at root level.  Regard this as a hint,
	         and ignore it.  */
	      if (die->parent && die->parent->parent == NULL
	          && per_cu->unit_type == DW_UT_compile
	          && per_cu->lang == language_cplus)
	        return;
	...
	which should have a partial symtabs counterpart.

	Add the missing counterpart in process_psymtab_comp_unit.

	Tested on x86_64-linux (openSUSE Leap 15.2), no regressions for config:
	- using default gcc version 7.5.0
	  (with 5 unexpected FAILs)
	- gcc 10.3.0 and target board
	  unix/-flto/-O0/-flto-partition=none/-ffat-lto-objects
	  (with 1000 unexpected FAILs)

	gdb/ChangeLog:

	2021-07-06  Tom de Vries  <tdevries@suse.de>

		* dwarf2/read.c (scan_partial_symbols): Skip top-level imports of
		c++ CU.
		* testsuite/gdb.dwarf2/imported-unit-bp.exp: Moved to ...
		* testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl: ... here.
		* testsuite/gdb.dwarf2/imported-unit-bp-c++.exp: New test.
		* testsuite/gdb.dwarf2/imported-unit-bp-c.exp: New test.
		* testsuite/gdb.dwarf2/imported-unit.exp: Update.

2021-07-06  Kito Cheng  <kito.cheng@sifive.com>

	RISC-V: Add PT_RISCV_ATTRIBUTES and add it to PHDR.
	We added PT_RISCV_ATTRIBUTES to program header to make
	.riscv.attribute easier to find in dynamic loader or kernel.

	Ref:
	https://github.com/riscv/riscv-elf-psabi-doc/pull/71

	ChangeLog:

	bfd/

		* elfnn-riscv.c(RISCV_ATTRIBUTES_SECTION_NAME): New.
		(riscv_elf_additional_program_headers): Ditto.
		(riscv_elf_modify_segment_map): Ditto.
		(elf_backend_additional_program_headers): Ditto.
		(elf_backend_modify_segment_map): Ditto.
		(elf_backend_obj_attrs_section): Use RISCV_ATTRIBUTES_SECTION_NAME
		rather than string literal.

	binutils/

		* readelf.c(get_riscv_segment_type): New.
		(get_segment_type): Handle EM_RISCV.

	include/

		* elf/riscv.h (PT_RISCV_ATTRIBUTES): New.
		* testsuite/ld-elf/orphan-region.ld: Discard .riscv.attributes
		section for simplify testcase.
		* testsuite/ld-riscv-elf/attr-phdr.d: New.
		* testsuite/ld-riscv-elf/attr-phdr.s: Ditto.
		* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Add attr-phdr to
		testcase.

2021-07-06  Alan Modra  <amodra@gmail.com>

	Re: PR28055, segfault in bpf special reloc function
		PR 28055
		* elf64-bpf.c (bpf_elf_generic_reloc): Add missing ATTRIBUTE_UNUSED.

2021-07-06  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-05  Tom Tromey  <tom@tromey.com>

	Simplify debug_names index writing
	This changes the .debug_names writer to find the TU indices in the
	main loop over all CUs and TUs.  (An earlier patch applied this same
	treatment to the .gdb_index writer.)

	Simplify gdb_index writing
	write_gdbindex writes the CUs first, then walks the signatured type
	hash table to write out the TUs.  However, now that CUs and TUs are
	unified in the DWARF reader, it's simpler to handle both of these in
	the same loop.

	Minor cleanup to addrmap_index_data::previous_valid
	This changes addrmap_index_data::previous_valid to a bool, and
	initializes it inline.

2021-07-05  Tom Tromey  <tom@tromey.com>

	Fix oddity in write_gdbindex
	My recent patch to unify CUs and TUs introduced an oddity in
	write_gdbindex.  Here, we pass 'i' to recursively_write_psymbols, but
	we must instead pass 'counter', to handle the situation where a TU is
	mixed in with the CUs.

	I am not sure a test case for this is possible.  I think it can only
	happen when using DWARF 5, where a TU appears in .debug_info.
	However, this situation is already not handled correctly by
	.gdb_index.  I filed a bug about this.

2021-07-05  Tom Tromey  <tom@tromey.com>

	Fix warning in symtab.c
	The compiler gives this warning when building symtab.c:

	../../binutils-gdb/gdb/symtab.c:4247:28: warning: 'to_match' may be used uninitialized in this function [-Wmaybe-uninitialized]

	This patch fixes the warning by adding a gdb_assert_not_reached.

2021-07-05  H.J. Lu  <hjl.tools@gmail.com>

	ld: Cache and reuse the IR archive file descriptor
	Linker plugin_object_p opens the IR archive for each IR archive member.
	For GCC plugin, plugin_object_p closes the archive file descriptor.  But
	for LLVM plugin, the archive file descriptor remains open.  If there are
	3000 IR archive members, there are 3000 file descriptors for them.  We
	can run out of file descriptors petty easily.

	1. Add archive_plugin_fd and archive_plugin_fd_open_count to bfd so that
	we can cache and reuse the IR archive file descriptor for all IR archive
	members in the archive.
	2. Add bfd_plugin_close_file_descriptor to properly close the IR archive
	file descriptor.

	bfd/

		PR ld/28040
		* archive.c (_bfd_archive_close_and_cleanup): Close the archive
		plugin file descriptor if needed.
		* bfd.c (bfd): Add archive_plugin_fd and
		archive_plugin_fd_open_count.
		* opncls.c (_bfd_new_bfd): Initialize to -1.
		* plugin.c (bfd_plugin_open_input): Cache and reuse the archive
		plugin file descriptor.
		(bfd_plugin_close_file_descriptor): New function.
		(try_claim): Call bfd_plugin_close_file_descriptor.
		* plugin.h (bfd_plugin_close_file_descriptor): New.
		* bfd-in2.h: Regenerated.

	ld/

		PR ld/28040
		* plugin.c (plugin_input_file): Add ibfd.
		(release_plugin_file_descriptor): New function.
		(release_input_file): Call release_plugin_file_descriptor to
		close input->fd.
		(plugin_object_p): Call release_plugin_file_descriptor to close
		input->fd.  Also call release_plugin_file_descriptor if not
		claimed.
		* testsuite/config/default.exp (RANLIB): New.
		* testsuite/ld-plugin/lto.exp: Run ranlib test.

2021-07-05  Nick Clifton  <nickc@redhat.com>

	Restore the libiberty component of commit 50ad1254d5030d0804cbf89c758359ae202e8d55.
	This commit has not yet been applied to the master sources in the gcc repository.
	It was submitted here: https://gcc.gnu.org/pipermail/gcc-patches/2021-July/574405.html
	The commit allows options to be set for the AR and RANLIB programs used when building libiberty, which in turn allows building with LTO enabled.

	Updated translations (mainly Ukranian and French) triggered by creation of 2.37 branch.

2021-07-05  Tom de Vries  <tdevries@suse.de>

	[gdb/testsuite] Fix fail in gdb.fortran/ptype-on-functions.exp with gcc-7
	Since commit 05b85772061 "gdb/fortran: Add type info of formal parameter for
	clang" I see:
	...
	(gdb) ptype say_string^M
	type = void (character*(*), integer(kind=4))^M
	(gdb) FAIL: gdb.fortran/ptype-on-functions.exp: ptype say_string
	...

	The part of the commit causing the fail is:
	...
	 gdb_test "ptype say_string" \
	-    "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)"
	+    "type = void \\(character\[^,\]+, $integer8\\)"
	...
	which fails to take into account that for gcc-7 and before, the type for
	string length of a string argument is int, not size_t.

	Fix this by allowing both $integer8 and $integer4.

	Tested on x86_64-linux, with gcc-7 and gcc-10.

	gdb/testsuite/ChangeLog:

	2021-07-05  Tom de Vries  <tdevries@suse.de>

		* gdb.fortran/ptype-on-functions.exp: Allow both $integer8 and
		$integer4 for size of string length.

2021-07-05  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: fall back on sigpending + sigwait if sigtimedwait is not available
	The macOS platform does not provide sigtimedwait, so we get:

	      CXX    compile/compile.o
	    In file included from /Users/smarchi/src/binutils-gdb/gdb/compile/compile.c:46:
	    /Users/smarchi/src/binutils-gdb/gdb/../gdbsupport/scoped_ignore_signal.h:69:4: error: use of undeclared identifier 'sigtimedwait'
	              sigtimedwait (&set, nullptr, &zero_timeout);
	              ^

	An alternative to sigtimedwait with a timeout of 0 is to use sigpending,
	to first check which signals are pending, and then sigwait, to consume
	them.  Since that's slightly more expensive (2 syscalls instead of 1),
	keep using sigtimedwait for the platforms that provide it, and fall back
	to sigpending + sigwait for the others.

	gdbsupport/ChangeLog:

		* scoped_ignore_signal.h (struct scoped_ignore_signal)
		<~scoped_ignore_signal>: Use sigtimedwait if HAVE_SIGTIMEDWAIT
		is defined, else use sigpending + sigwait.

	Change-Id: I2a72798337e81dd1bbd21214736a139dd350af87
	Co-Authored-By: John Baldwin <jhb@FreeBSD.org>

2021-07-05  Simon Marchi  <simon.marchi@polymtl.ca>

	gdbsupport/common.m4: check for sigtimedwait
	The next patch will make the use of sigtimedwait conditional to whether
	the platform provides it.  Start by adding a configure check for it.

	gdbsupport/ChangeLog:

		* common.m4 (GDB_AC_COMMON): Check for sigtimedwait.
		* config.in, configure: Re-generate.

	gdb/ChangeLog:

		* config.in, configure: Re-generate.

	gdbserver/ChangeLog:

		* config.in, configure: Re-generate.

	Change-Id: Ic7613fe14521b966b4d991bbcd0933ab14629c05

2021-07-05  Alan Modra  <amodra@gmail.com>

	Re: opcodes: constify & local meps macros
	Commit f375d32b35ce changed a generated file.  Edit the source instead.

		* mep.opc (macros): Make static and const.
		(lookup_macro): Return and use const pointer.
		(expand_macro): Make mac param const.
		(expand_string): Make pmacro const.

2021-07-05  Alan Modra  <amodra@gmail.com>

	PR28055, segfault in bpf special reloc function
	The testcase in this PR tickled two bugs fixed here.  output_bfd is
	NULL when a reloc special_function is called for final linking and
	when called from bfd_generic_get_relocated_section_contents.  Clearly
	using output_bfd is wrong as it results in segfaults.  Not only that,
	the endianness of the reloc field really should be that of the input.
	The second bug was not checking that the entire reloc field was
	contained in the section contents.

		PR 28055
		* elf64-bpf.c (bpf_elf_generic_reloc): Use correct bfd for bfd_put
		and bfd_put_32 calls.  Correct section limit checks.

2021-07-05  Alan Modra  <amodra@gmail.com>

	PR28047, readelf crash due to assertion failure
	DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref1, and
	DW_FORM_ref_udata are all supposed to be within the containing unit.

		PR 28047
		* dwarf.c (get_type_abbrev_from_form): Add cu_end parameter.
		Check DW_FORM_ref1 etc. arg against cu_end rather than end of
		section.  Adjust all callers.

2021-07-05  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-04  Simon Marchi  <simon.marchi@polymtl.ca>

	gdb: return early if no execution in darwin_solib_create_inferior_hook
	When loading a file using the file command on macOS, we get:

	    $ ./gdb -nx --data-directory=data-directory -q -ex "file ./test"
	    Reading symbols from ./test...
	    Reading symbols from /Users/smarchi/build/binutils-gdb/gdb/test.dSYM/Contents/Resources/DWARF/test...
	    /Users/smarchi/src/binutils-gdb/gdb/thread.c:72: internal-error: struct thread_info *inferior_thread(): Assertion `current_thread_ != nullptr' failed.
	    A problem internal to GDB has been detected,
	    further debugging may prove unreliable.
	    Quit this debugging session? (y or n)

	The backtrace is:

	    * frame #0: 0x0000000101fcb826 gdb`internal_error(file="/Users/smarchi/src/binutils-gdb/gdb/thread.c", line=72, fmt="%s: Assertion `%s' failed.") at errors.cc:52:3
	      frame #1: 0x00000001018a2584 gdb`inferior_thread() at thread.c:72:3
	      frame #2: 0x0000000101469c09 gdb`get_current_regcache() at regcache.c:421:31
	      frame #3: 0x00000001015f9812 gdb`darwin_solib_get_all_image_info_addr_at_init(info=0x0000603000006d00) at solib-darwin.c:464:34
	      frame #4: 0x00000001015f7a04 gdb`darwin_solib_create_inferior_hook(from_tty=1) at solib-darwin.c:515:5
	      frame #5: 0x000000010161205e gdb`solib_create_inferior_hook(from_tty=1) at solib.c:1200:3
	      frame #6: 0x00000001016d8f76 gdb`symbol_file_command(args="./test", from_tty=1) at symfile.c:1650:7
	      frame #7: 0x0000000100abab17 gdb`file_command(arg="./test", from_tty=1) at exec.c:555:3
	      frame #8: 0x00000001004dc799 gdb`do_const_cfunc(c=0x000061100000c340, args="./test", from_tty=1) at cli-decode.c:102:3
	      frame #9: 0x00000001004ea042 gdb`cmd_func(cmd=0x000061100000c340, args="./test", from_tty=1) at cli-decode.c:2160:7
	      frame #10: 0x00000001018d4f59 gdb`execute_command(p="t", from_tty=1) at top.c:674:2
	      frame #11: 0x0000000100eee430 gdb`catch_command_errors(command=(gdb`execute_command(char const*, int) at top.c:561), arg="file ./test", from_tty=1, do_bp_actions=true)(char const*, int), char const*, int, bool) at main.c:523:7
	      frame #12: 0x0000000100eee902 gdb`execute_cmdargs(cmdarg_vec=0x00007ffeefbfeba0 size=1, file_type=CMDARG_FILE, cmd_type=CMDARG_COMMAND, ret=0x00007ffeefbfec20) at main.c:618:9
	      frame #13: 0x0000000100eed3a4 gdb`captured_main_1(context=0x00007ffeefbff780) at main.c:1322:3
	      frame #14: 0x0000000100ee810d gdb`captured_main(data=0x00007ffeefbff780) at main.c:1343:3
	      frame #15: 0x0000000100ee8025 gdb`gdb_main(args=0x00007ffeefbff780) at main.c:1368:7
	      frame #16: 0x00000001000044f1 gdb`main(argc=6, argv=0x00007ffeefbff8a0) at gdb.c:32:10
	      frame #17: 0x00007fff20558f5d libdyld.dylib`start + 1

	The solib_create_inferior_hook call in symbol_file_command was added by
	commit ea142fbfc9c1 ("Fix breakpoints on file reloads for PIE
	binaries").  It causes solib_create_inferior_hook to be called while
	the inferior is not running, which darwin_solib_create_inferior_hook
	does not expect.  darwin_solib_get_all_image_info_addr_at_init, in
	particular, assumes that there is a current thread, as it tries to get
	the current thread's regcache.

	Fix it by adding a target_has_execution check and returning early.  Note
	that there is a similar check in svr4_solib_create_inferior_hook.

	gdb/ChangeLog:

		* solib-darwin.c (darwin_solib_create_inferior_hook): Return
		early if no execution.

	Change-Id: Ia11dd983a1e29786e5ce663d0fcaa6846dc611bb

2021-07-04  GDB Administrator  <gdbadmin@sourceware.org>

	Automatic date update in version.in

2021-07-03  H.J. Lu  <hjl.tools@gmail.com>

	gprof: Regenerate configure
		* configure: Regenerated.

2021-07-03  Joel Brobecker  <brobecker@adacore.com>

	Update NEWS post GDB 11 branch creation.
	gdb/ChangeLog:

		* NEWS: Create a new section for the next release branch.
		Rename the section of the current branch, now that it has
		been cut.

2021-07-03  Joel Brobecker  <brobecker@adacore.com>

	Bump version to 12.0.50.DATE-git.
	Now that the GDB 11 branch has been created, we can
	bump the version number.

	gdb/ChangeLog:

		GDB 11 branch created (4b51505e33441c6165e7789fa2b6d21930242927):
		* version.in: Bump version to 12.0.50.DATE-git.

	gdb/testsuite/ChangeLog:

		* gdb.base/default.exp: Change $_gdb_major to 12.

2021-07-03  Tom Tromey  <tom@tromey.com>

	Use 'bool' more idiomatically in dwarf_decode_lines
	I noticed a couple of spots related to dwarf_decode_lines where the
	'include_p' field was not being used idiomatically -- it is of type
	bool now, so treat it as such.

	gdb/ChangeLog
	2021-07-03  Tom Tromey  <tom@tromey.com>

		* dwarf2/read.c (lnp_state_machine::record_line): Use 'true'.
		(dwarf_decode_lines): Remove '=='.

2021-07-03  Nick Clifton  <nickc@redhat.com>

	More minor updates to the how-to-make-a-release documentation

	Update version number and regenerate files

	Add markers for 2.37 branch

	Synchronize libiberty sources (and include/demangle.h) with GCC master version