aboutsummaryrefslogtreecommitdiff
blob: 874f08d19b36e726fc8f45cddc2d92f3bba669eb (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
2017-12-19  Alan Modra  <amodra@gmail.com>

	PR 22626
	* elflink.c (_bfd_elf_link_renumber_dynsyms): Don't set section
	dynindx when section_sym_count is NULL.
	(bfd_elf_size_dynamic_sections): Pass NULL section_sym_count to
	preliminary _bfd_elf_link_renumber_dynsyms call.

2017-11-24  Alan Modra  <amodra@gmail.com>

	Apply from master
	2017-11-14  Alan Modra  <amodra@gmail.com>
	PR 22431
	* elf64-ppc.c (ppc64_elf_size_dynamic_sections): Warn on discarding
	non-empty dynamic section.
	(ppc_build_one_stub): Take elf_gp from output bfd, not output
	section owner.
	(ppc_size_one_stub, ppc64_elf_next_toc_section): Likewise.

2017-11-05  Alan Modra  <amodra@gmail.com>

	PR 22397
	* bfd.c (_bfd_doprnt_scan): Check args index before storing, not
	after.

2017-11-05  Alan Modra  <amodra@gmail.com>

	PR 22397
	* bfd.c (union _bfd_doprnt_args): New.
	(PRINT_TYPE): Add FIELD arg.  Take value from args.
	(_bfd_doprnt): Replace ap parameter with args.  Adjust all
	PRINT_TYPE invocations and reading of format args to suit.
	Move "%%" handling out of switch handling args.  Support
	positional parameters.
	(_bfd_doprnt_scan): New function.
	(error_handler_internal): Call _bfd_doprnt_scan and read args.

2017-11-05  Alan Modra  <amodra@gmail.com>

	Apply from master
	2017-10-11  Pedro Alves  <palves@redhat.com>
	* bfd.c (_doprnt): Rename to ...
	(_bfd_doprnt): ... this.
	(error_handler_internal): Adjust.

2017-11-01  Alan Modra  <amodra@gmail.com>

	Apply from master
	2017-10-30  Alan Modra  <amodra@gmail.com>
	* elf32-frv.c (ELF_TARGET_ID): Don't define for generic
	elf target.

	2017-10-30  Alan Modra  <amodra@gmail.com>
	* elflink.c (elf_gc_sweep): Test elf_object_id in addition to
	relocs_compatible.
	(bfd_elf_gc_sections): Likewise.

	2017-10-28  Alan Modra  <amodra@gmail.com>
	PR 22300
	* elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
	* elf32-hppa.c (elf_backend_relocs_compatible): Define.
	* elf32-ppc.c (elf_backend_relocs_compatible): Define.
	* elf64-ppc.c (elf_backend_relocs_compatible): Define.

	2017-10-25  Alan Modra  <amodra@gmail.com>
	* archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
	optionally prefixed with "_".
	* linker.c (_bfd_generic_link_add_one_symbol): Likewise.

2017-10-05  Alan Modra  <amodra@gmail.com>

	* elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
	fini_array error value.

2017-10-04  Pavel I. Kryukov <kryukov@frtk.ru>

	PR 22245
	* bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
	undergoes default promotion.
	* bfd-in2.h: Regenerate.

2017-09-28  Alan Modra  <amodra@gmail.com>

	PR 22220
	* elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
	a case where plugin_notice isn't called.

2017-09-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/22199
	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
	output_bfd to info->callbacks->minfo.

2017-09-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/22170
	* elf32-i386.c (elf_i386_get_synthetic_symtab): Guard against
	corrupted PLT.
	* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

2017-09-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/22163
	* elf32-i386.c (elf_i386_get_synthetic_symtab): Also return -1
	if bfd_canonicalize_dynamic_reloc returns 0.
	* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

2017-09-21  Nick Clifton  <nickc@redhat.com>

	* development.sh (development): Revert previous delta.

2017-09-20  Nick Clifton  <nickc@redhat.com>

	* development.sh (development): Set to false.

2017-09-19  Nick Clifton  <nickc@redhat.com>

	2.29.1 Release

	* version.m4: Bump version to 2.29.1
	* configure: Regenerate.
	* po/bfd.pot: Regenerate.

2017-09-19  Nick Clifton  <nickc@redhat.com>

	Import from mainline:

	* xtensa-isa.c (xtensa_isa_init): Don't update lookup table
	entries for sysregs with negative indices.

2017-09-19  Alan Modra  <amodra@gmail.com>

	PR 21441
	* elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
	size.

2017-09-19  Alan Modra  <amodra@gmail.com>

	PR 22150
	* elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
	symbols before calculating verrefs.  Don't renumber dynsyms
	after gc.  Exclude .gnu.version when zero or one dynsym.
	Localize some vars and reindent.

	Apply from master
	2017-08-31  Alan Modra  <amodra@gmail.com>
	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
	for a section containing just a terminator.  Allow multiple
	terminators at end of section.
	* elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
	sections when not adding alignment.  Assert on terminator in
	the middle of FDEs.

	2017-08-31  Alan Modra  <amodra@gmail.com>
	PR 21441
	PR 22048
	* elflink.c (bfd_elf_discard_info): Don't pad embedded zero
	terminators.

	2017-08-14  Alan Modra  <amodra@gmail.com>
	PR 21441
	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
	alignment padding here.
	* elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
	in a reverse pass over sections.

2017-09-18  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/22148
	* elf32-i386.c (elf_i386_get_synthetic_symtab): Check error
	return from bfd_canonicalize_dynamic_reloc.
	* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

2017-09-14  Nick Clifton  <nickc@redhat.com>

	Import from mainline:

	PR binutils/22113
	* peXXigen.c (pe_print_idata): Extend check for HintName vector
	entries.

2017-08-21  Hans-Peter Nilsson  <hp@bitrange.com>

	Import from mainline:

	PR ld/20125
	* elf64-mmix.c (mmix_elf_relax_section): Correct handling of
	undefined weak symbols.

2017-09-10  Nick Clifton  <nickc@redhat.com>

	Import from mainline:

	PR 22047
	* dwarf2.c (read_section): If necessary add a terminating NUL byte
	to dwarf string sections.

2017-09-10  Alan Modra  <amodra@gmail.com>

	* elf64-ppp.c (plt_stub_pad): Handle positive and negative
	plt_stub_align.

2017-09-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/22018
	* elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
	PLT section size.
	* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

2017-09-05  Nick Clifton  <nickc@redhat.com>

	Import from mainline:

	PR binutils/22032
	* opncls.c (bfd_close_all_done): Don't call bfd_cache_close
	before _close_and_cleanup.  Call iovec->bclose after.
	(bfd_close): Remove code common to, and call, bfd_close_all_done.

2017-09-04  Nick Clifton  <nickc@redhat.com>

	Import from mainline:

	PR binutils/21781
	* coffcode.h (handle_COMDAT): Replace abort with an error message
	and return.

	PR 21786
	* coff-rs6000.c (_bfd_strntol): New function.
	(_bfd_strntoll): New function.
	(GET_VALUE_IN_FIELD): New macro.
	(EQ_VALUE_IN_FIELD): new macro.
	(_bfd_xcoff_slurp_armap): Use new macros.
	(_bfd_xcoff_archive_p): Likewise.
	(_bfd_xcoff_read_ar_hdr): Likewise.
	(_bfd_xcoff_openr_next_archived_file): Likewise.
	(_bfd_xcoff_stat_arch_elt): Likewise.
	* coff64-rs6000.c (_bfd_strntol): New function.
	(_bfd_strntoll): New function.
	(GET_VALUE_IN_FIELD): New macro.
	(xcoff64_slurp_armap): Use new macros.

	PR 21787
	* archive.c (bfd_generic_archive_p): If the bfd does not have the
	correct magic bytes at the start, set the error to wrong format
	and clear the format selector before returning NULL.

	PR 21813
	* mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
	of the relocs to the canonicalize_one_reloc routine.
	* mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
	for the _bfd_mach_o_canonicalize_one_reloc field.
	* mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
	res_base parameter.  Use to check for corrupt pair relocs.
	* mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
	Likewise.
	* mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
	Likewise.
	* mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
	Likewise.
	* vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
	enough data in the record before attempting to parse it.
	(_bfd_vms_slurp_eeom): Likewise.
	(_bfd_vms_slurp_egsd): Check for an invalid section index.
	(image_set_ptr): Likewise.
	(alpha_vms_slurp_relocs): Likewise.
	(alpha_vms_object_p): Check for a truncated record.

	PR 21824
	* elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
	16-bit absolute branches into 10-bit pc-relative branches on the
	MSP430 as well as the MSP430X.

	PR 21916
	* elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
	small section lengths.
	* elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
	table.
	(elfcore_grok_freebsd_prstatus): Add checks to make sure that
	there is enough data present in the note.

2017-09-04  Alan Modra  <amodra@gmail.com>

	PR 22067
	* elf32-i386.c (elf_i386_hash_table): Check is_elf_hash_table first.
	* elf64-x86-64.c (elf_x86_64_hash_table): Likewise.

2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/22064
	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
	ELF_COMMON_DEF_P for common symbols.

2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/22061
	* elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
	.eh_frame section for the second PLT.
	* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
	alignment of .eh_frame section for the second PLT.

2017-09-01  Nick Clifton  <nickc@redhat.com>

	PR 22059
	* dwarf2.c (decode_line_info): Fix test for an overlong line info
	structure.

2017-09-01  Nick Clifton  <nickc@redhat.com>

	PR 21933
	PR 22060
	* elf.c (elf_read_notes): Check for a note size of -1.

2017-09-01  Nick Clifton  <nickc@redhat.com>

	PR 22058
	* elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
	attribute buffer is NUL terminated.

2017-08-30  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
	branch offset interpretation.

2017-08-29  Nick Clifton  <nickc@redhat.com>

	Import from mainline:

	PR 21840
	* mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
	size is -1.
	* nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
	with error return.
	* section.c (bfd_make_section_with_flags): Fail if the name or bfd
	are NULL.
	* vms-alpha.c (bfd_make_section_with_flags): Correct computation
	of end pointer.
	(evax_bfd_print_emh): Check for invalid string lengths.

2017-08-23  Alan Modra  <amodra@gmail.com>

	PR 21988
	* elf64-ppc.c (ensure_undef_dynamic): Rename from
	ensure_undefweak_dynamic.  Handle undefined too.
	* elf32-ppc.c (ensure_undef_dynamic): Likewise.
	* elf32-hppa.c (ensure_undef_dynamic): Likewise.
	(allocate_dynrelocs): Discard undefined non-default visibility
	relocs first.  Make undefined syms dynamic.  Tidy goto.

2017-08-21  Alan Modra  <amodra@gmail.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21964
	* elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
	* elflink.c (bfd_elf_define_start_stop): Rewrite.

2017-08-07  Alan Modra  <amodra@gmail.com>

	PR 21910
	* elflink.c (bfd_elf_final_link): Don't segfault when sections
	needed to define various dynamic tags have been discarded.

2017-08-05  Alan Modra  <amodra@gmail.com>

	* elf32-hppa.c (elf32_hppa_set_gp): Don't require an
	hppa_link_hash_table.

2017-07-25  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
	(stub_eh_frame_size): New function.
	(ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
	(group_sections): Init group tls_get_addr_opt_bctrl.
	(ppc64_elf_size_stubs): Update sizing and initialization of
	.eh_frame.  Iteration over stubs via group list.
	(ppc64_elf_build_stubs): Iterate over stubs via group list.
	(ppc64_elf_finish_dynamic_sections): Update finalization of
	.eh_frame.

2017-08-18  Nick Clifton  <nickc@redhat.com>

	Import from mainline:

	PR binutils/21962
	* tekhex.c (getsym): Fix check for source pointer walking off the
	end of the input buffer.

2017-08-17  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	PR ld/18808
	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
	relocations in debug sections, change abort to _bfd_error_handler.

2017-08-17  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	PR ld/18841
	* elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
	reloc_class_ifunc for ifunc symbols.

2017-08-11  Nick Clifton  <nickc@redhat.com>

	PR 21884
	* elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
	has not been set then use the bfd returned by
	_bfd_elf_link_setup_gnu_properties.  If that is null then search
	through all the input bfds selecting the first normal, ELF format
	one.
	* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.

2017-08-08  Alan Modra  <amodra@gmail.com>

	PR 21017
	* elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
	got.refcount for GOTOFF relocs, just create .got section.

2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
	isn't the S/390 specific elf data.
	* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.

2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	Backport from mainline
	2017-07-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
	pointer check for htab->elf.irelplt.
	* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.

2017-07-31  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
	without ld.so checks.

2017-07-29  Alan Modra  <amodra@gmail.com>

	PR 21847
	* elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
	(ppc64_elf_merge_symbol): Set non_zero_localentry.
	(is_elfv2_localentry0): Test non_zero_localentry.
	(ppc64_elf_tls_setup): Default to --no-plt-localentry.

2017-07-25  Nick Clifton  <nickc@redhat.com>

	* po/fr.po: Updated French translation.

2017-07-24  Tristan Gingold  <gingold@adacore.com>

	* version.m4: Bump version to 2.29.0
	* configure: Regenerate.

2017-07-24  Tristan Gingold  <gingold@adacore.com>

	* development.sh: Set development to true.

2017-07-24  Tristan Gingold  <gingold@adacore.com>

	* version.m4: Bump version to 2.29
	* configure: Regenerate.

2017-07-24  Tristan Gingold  <gingold@adacore.com>

	* development.sh: Set development to false.

2017-07-23  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
	restore of LR.

2017-07-18  Nick Clifton  <nickc@redhat.com>

	* po/es.po: Updated translation.
	* po/fi.po: Likewise.
	* po/fr.po: Likewise.
	* po/id.po: Likewise.
	* po/ja.po: Likewise.
	* po/ro.po: Likewise.
	* po/ru.po: Likewise.
	* po/sr.po: Likewise.
	* po/sv.po: Likewise.
	* po/tr.po: Likewise.
	* po/uk.po: Likewise.
	* po/vi.po: Likewise.
	* po/zh_CN.po: Likewise.

	* po/hr.po: New translation.
	* configure.ac (ALL_LINGUAS): Add hr.
	* configure: Regenerate.

2017-07-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21782
	* elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
	to shared library.

2017-07-16  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
	__tls_index GOT entries when using __tls_get_addr_opt stub.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.

2017-07-12  Nick Clifton  <nickc@redhat.com>

	Fix compile time warnings using gcc 7.1.1.
	* elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
	plt_name buffer.
	(elf_xtensa_get_gotplt_section): Increase length of got_name
	buffer.
	* mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
	default return of FALSE.
	* mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
	default return of FALSE.

2017-07-10  Nick Clifton  <nickc@redhat.com>

	* coffcode.h (coff_slurp_symbol_table): Do not include an entry
	for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.

2017-07-07  Alan Modra  <amodra@gmail.com>

	* coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.

2017-07-07  Alan Modra  <amodra@gmail.com>

	* bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
	as long long.  Move code replacing "ll" with "I64", and simplify.

2017-07-06  H.J. Lu  <hongjiu.lu@intel.com>

	* bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
	to 1.

2017-07-05  H.J. Lu  <hongjiu.lu@intel.com>

	* dwarf2.c (line_info_add_include_dir_stub): Replace time with
	xtime.
	(line_info_add_file_name): Likewise.
	(decode_line_info): Likewise.

2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* version.m4: Bump version to 2.28.90
	* configure: Regenerate.

2017-07-04  Jiong Wang  <jiong.wang@arm.com>

	* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
	sanity check at the head of this function.

2017-07-04  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
	dwarf_line_str_size.
	(struct attr_abbrev): Add field implicit_const.
	(dwarf_debug_sections): Add .debug_line_str.
	(enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
	(dwarf_debug_section_assert): Add static assertion.
	(read_indirect_line_string): New.
	(read_abbrevs): Support DW_FORM_implicit_const.
	(is_str_attr): Support DW_FORM_line_strp.
	(read_attribute_value): Support DW_FORM_line_strp and
	DW_FORM_implicit_const.
	(read_attribute): Support DW_FORM_implicit_const.
	(line_info_add_include_dir, line_info_add_include_dir_stub):
	(line_info_add_file_name, read_formatted_entries): New.
	(decode_line_info, parse_comp_unit): Support DWARF 5.
	(_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.

2017-07-03  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>

        * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
        abort statement that was put for symbols that are not dynamic.

2017-07-03  Tristan Gingold  <gingold@adacore.com>

	* po/bfd.pot: Regenerate

2017-07-03  Alan Modra  <amodra@gmail.com>

	* bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
	__MSVCRT__.  Support "L" modifier for bfd_vma.  Formatting.
	* elf.c (setup_group): Use "Lx" to print sh_size.
	(_bfd_elf_setup_sections): Remove unnecessary cast and print
	unknown section type in hex.
	(copy_special_section_fields): Style fix.
	(bfd_section_from_shdr): Correct format for sh_link.  Use a
	common error message for all the variants of unrecognized
	section types.
	(assign_file_positions_for_load_sections): Use "Lx" for lma
	adjust error message.
	(assign_file_positions_for_non_load_sections): Formatting.
	(rewrite_elf_program_header): Formatting.  Use "Lx" for
	bfd_vma values in error messages.
	* elfcode.h (elf_slurp_reloc_table_from_section): Cast
	ELF_R_SYM value to type expected by format.
	* elflink.c (elf_link_read_relocs_from_section): Use "Lx"
	in error messages.
	(elf_link_add_object_symbols): Use "Lu" for symbol sizes.
	(elf_link_input_bfd): Use "Lx" for r_info.
	(bfd_elf_gc_record_vtinherit): Use "Lx" for offset.

2017-07-03  Alan Modra  <amodra@gmail.com>

	* bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
	* coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
	Microsoft C library variant of long long format specifier.
	(PRINT20): Cast value to bfd_uint64_t not long long.
	* coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
	* coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
	long long.  Don't cast to bfd_vma.
	* elf32-score.c (score3_bfd_getl48): Likewise.
	* vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.

2017-07-03  Alan Modra  <amodra@gmail.com>

	* elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
	print d_tag.
	(bfd_elf_print_symbol): Don't cast symbol->flags.
	(_bfd_elf_symbol_from_bfd_symbol): Likewise.
	* elf32-ppc.c (ppc_elf_begin_write_processing): Correct
	_bfd_error_handler argument order.
	(ppc_elf_merge_private_bfd_data): Don't cast flags.

2017-07-03  Alan Modra  <amodra@gmail.com>

	* configure.ac: Invoke AC_CHECK_TYPES for long long.  Invoke
	AC_TYPE_LONG_DOUBLE.
	* configure: Regenerate.
	* config.in: Regenerate.

2017-06-29  Andrew Waterman  <andrew@sifive.com>

	* elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
	relocs.

2017-06-29  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>

	* elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
	unless it is undefined weak.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
	relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
	relocation.
	* elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
        is not dynamic in PIC, abort.

2017-06-29  Jiong Wang  <jiong.wang@arm.com>

        PR ld/21402
	* elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
	undefined weak symbols into dynamic.
	(elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
	relocation for non-dynamic symbols.
	(elfNN_aarch64_finish_dynamic_symbol): Add sanity check.

2017-06-29  Jiong Wang  <jiong.wang@arm.com>

	* elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
	(elfNN_aarch64_final_link_relocate): Delete duplicated code for
	BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
	BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
	* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
	support for them.

2017-06-29  Andreas Arnez  <arnez@linux.vnet.ibm.com>

	* elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
	(elfcore_write_s390_gs_bc): Likewise.
	* elf.c (elfcore_grok_s390_gs_cb): New function.
	(elfcore_grok_s390_gs_bc): New function.
	(elfcore_grok_note): Call them.
	(elfcore_write_s390_gs_cb): New function.
	(elfcore_write_s390_gs_bc): New function.
	(elfcore_write_register_note): Call them.

2017-06-28  H.J. Lu  <hongjiu.lu@intel.com>

	* libbfd.c (_bfd_generic_get_section_contents): Don't call
	bfd_get_file_size.  Check archive element size.
	(_bfd_generic_get_section_contents_in_window): Likewise.

2017-06-28  H.J. Lu  <hongjiu.lu@intel.com>

	* bfd-in2.h: Regenerated.
	* bfdio.c (bfd_get_size): Change return type to ufile_ptr.
	(bfd_get_file_size): Likewise.

2017-06-28  Maciej W. Rozycki  <macro@imgtec.com>
	    Matthew Fortune  <matthew.fortune@imgtec.com>

	* archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
	* cpu-mips.c (I_interaptiv_mr2): New enum value.
	(arch_info_struct): Add "mips:interaptiv-mr2" entry.
	* elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
	case.
	(mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
	(bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
	(print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
	(mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
	`bfd_mach_mips_interaptiv_mr2' entries.
	* bfd-in2.h: Regenerate.

2017-06-27  Nick Clifton  <nickc@redhat.com>

	* tekhex.c (pass_over): Revert accidental conversion of a local
	array to a static array.

2017-06-27  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	PR ld/13402
	* elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
	reloc addend if necessary. Adjust diff only if
	shrinked_insn_address < end_address.

2017-06-27  Alan Modra  <amodra@gmail.com>

	PR binutils/21665
	* libbfd.c (_bfd_generic_get_section_contents): Warning fix.
	(_bfd_generic_get_section_contents_in_window): Likewise.

2017-06-26  Kuan-Lin Chen  <rufus@andestech.com>

	* elfnn-riscv.c (perform_relocation): Support the new
	R_RISCV_32_PCREL relocation.
	(riscv_elf_relocate_section): Likewise.
	* elfxx-riscv.c (howto_table): Likewise.
	(riscv_reloc_map): Likewise.
	* bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
	* libbfd.h: Regenerate.

2017-06-27  Alan Modra  <amodra@gmail.com>

	PR binutils/21665
	* libbfd.c (_bfd_generic_get_section_contents): Delete abort.
	Use unsigned file pointer type, and remove cast.
	* libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
	Add "count", not "sz".

2017-06-26  Pedro Alves  <palves@redhat.com>

	PR binutils/21665
	* libbfd.c (_bfd_generic_get_section_contents): Add "count", not
	"sz".

2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/21665
	* libbfd.c (_bfd_generic_get_section_contents_in_window): Add
	a missing line.

2017-06-26  Maciej W. Rozycki  <macro@imgtec.com>

	* cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
	* elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
	E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
	(mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
	`bfd_mach_mips6000' rather than `bfd_mach_mips4000'.

2017-06-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/21665
	* compress.c (bfd_get_full_section_contents): Don't check the
	file size here.
	* libbfd.c (_bfd_generic_get_section_contents): Check for and
	reject a section whose size + offset is greater than the size
	of the entire file.
	(_bfd_generic_get_section_contents_in_window): Likewise.

2017-06-26  Nick Clifton  <nickc@redhat.com>

	PR binutils/21670
	* tekhex.c (getvalue): Check for the source pointer exceeding the
	end pointer before the first byte is read.

2017-06-26  Nick Clifton  <nickc@redhat.com>

	PR binutils/21665
	* opncls.c (get_build_id): Check that the section is big enough
	to contain the whole note.
	* compress.c (bfd_get_full_section_contents): Check for and reject
	a section whose size is greater than the size of the entire file.
	* elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
	contain a notes section.

2017-06-26  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* elf64-s390.c (elf_s390_additional_program_headers): Add NULL
	pointer checks.
	(elf_s390_modify_segment_map): Likewise.
	(bfd_elf_s390_set_options): Lisewise.

2017-06-26  Alan Modra  <amodra@gmail.com>

	* elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
	a --just-syms bfd.
	(_bfd_elf_size_group_sections): Skip --just-syms bfds.
	(bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
	.preinit_array on --just-syms bfds.
	(_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
	(elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
	(bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.

2017-06-25  Sergei Trofimovich  <slyfox@gentoo.org>

	* elf.c (find_link): Bounds check "hint".

2017-06-24  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* elf32-arm.c (using_thumb_only): Update list of architectures in
	BFD_ASSERT for which the logic is valid.
	(using_thumb2_bl): Likewise.
	(using_thumb2): Likewise and return true for ARMv8-R.
	(arch_has_arm_nop): Likewise.
	(tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
	merging logic.  Update commentis for value 15 of v8m_baseline,
	v8m_mainline and v4t_plus_v6_m arrays.  Use v8r array to decide
	merging of value 15 of Tag_CPU_arch.

2017-06-23  Jiong Wang  <jiong.wang@arm.com>

	* reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
	BFD_RELOC_AARCH64_ADR_GOT_PAGE
	* bfd-in2.h: Regenerate.

2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
	the error_alignment label forward.  Properly align program
	property note section.

2017-06-22  Eric Christopher  <echristo@gmail.com>

	* elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
	abs to fix a truncation warning.

2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
	local undefined weak symbol to 0.
	* elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.

2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
	is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
	(elf_i386_link_setup_gnu_properties): If info->shstk is set,
	turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
	* elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
	info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
	(elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
	turn on GNU_PROPERTY_X86_FEATURE_1_IBT.

2017-06-22  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
	(elf_i386_lazy_ibt_plt_entry): Likewise.
	(elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
	(elf_i386_non_lazy_ibt_plt_entry): Likewise.
	(elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
	(elf_i386_eh_frame_lazy_ibt_plt): Likewise.
	(elf_i386_lazy_plt_layout): Likewise.
	(elf_i386_non_lazy_plt_layout): Likewise.
	(elf_i386_link_hash_entry): Add plt_second.
	(elf_i386_link_hash_table): Add plt_second and
	plt_second_eh_frame.
	(elf_i386_allocate_dynrelocs): Use the second PLT if needed.
	(elf_i386_size_dynamic_sections): Use .plt.got unwind info for
	the second PLT.  Check the second PLT.
	(elf_i386_relocate_section): Use the second PLT to resolve
	PLT reference if needed.
	(elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
	needed.
	(elf_i386_finish_dynamic_sections): Set sh_entsize on the
	second PLT.  Generate unwind info for the second PLT.
	(elf_i386_plt_type): Add plt_second.
	(elf_i386_get_synthetic_symtab): Support the second PLT.
	(elf_i386_parse_gnu_properties): Support
	GNU_PROPERTY_X86_FEATURE_1_AND.
	(elf_i386_merge_gnu_properties): Support
	GNU_PROPERTY_X86_FEATURE_1_AND.  If info->ibt is set, turn
	on GNU_PROPERTY_X86_FEATURE_1_IBT
	(elf_i386_link_setup_gnu_properties): If info->ibt is set,
	turn on GNU_PROPERTY_X86_FEATURE_1_IBT.  Use IBT-enabled PLT
	for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
	is set on all relocatable inputs.
	* elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
	(elf_x32_lazy_ibt_plt_entry): Likewise.
	(elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
	(elf_x32_non_lazy_ibt_plt_entry): Likewise.
	(elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
	(elf_x32_eh_frame_lazy_ibt_plt): Likewise.
	(elf_x86_64_lazy_ibt_plt): Likewise.
	(elf_x32_lazy_ibt_plt): Likewise.
	(elf_x86_64_non_lazy_ibt_plt): Likewise.
	(elf_x32_non_lazy_ibt_plt): Likewise.
	(elf_x86_64_get_synthetic_symtab): Support the second PLT.
	(elf_x86_64_parse_gnu_properties): Support
	GNU_PROPERTY_X86_FEATURE_1_AND.
	(elf_x86_64_merge_gnu_properties): Support
	GNU_PROPERTY_X86_FEATURE_1_AND.  If info->ibt is set, turn
	on GNU_PROPERTY_X86_FEATURE_1_IBT
	(elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
	turn on GNU_PROPERTY_X86_FEATURE_1_IBT.  Use IBT-enabled PLT
	for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
	is set on all relocatable inputs.

2017-06-22  Nick Clifton  <nickc@redhat.com>

	PR binutils/21649
	* som.c (setup_sections): NUL terminate the space_strings buffer.
	Check that the space.name field does not index beyond the end of
	the space_strings buffer.

2017-06-21  Nick Clifton  <nickc@redhat.com>

	PR binutils/21646
	* coff-sh.c (sh_reloc): Check for an out of range reloc.

2017-06-21  Nick Clifton  <nickc@redhat.com>

	PR binutils/21639
	* vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
	type of the size parameter.
	(_bfd_vms_save_counted_string): Add second parameter - the maximum
	length of the counted string.
	* vms.h (_bfd_vms_save_sized_string): Update prototype.
	(_bfd_vms_save_counted_string): Likewise.
	* vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
	_bfd_vms_save_counted_string.
	(_bfd_vms_slurp_ehdr): Likewise.
	(_bfd_vms_slurp_egsd): Likewise.
	(Parse_module): Likewise.

2017-06-21  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
	calls before tocsave calls.
	(ppc64_elf_relocate_section): Allow localentry:0 plt calls without
	following nop.

2017-06-21  Nick Clifton  <nickc@redhat.com>

	PR binutils/21645
	* reloc.c (bfd_generic_get_relocated_section_contents): Fail if
	bfd_get_full_section_contents returns no contents.

2017-06-21  Nick Clifton  <nickc@redhat.com>

	PR binutils/21638
	* vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
	record.

2017-06-21  Nick Clifton  <nickc@redhat.com>

	PR binutils/21637
	* vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
	list.
	(image_set_ptr): Likewise.
	(alpha_vms_fix_sec_rel): Likewise.
	(alpha_vms_slurp_relocs): Likewise.

2017-06-21  Nick Clifton  <nickc@redhat.com>

	PR binutils/21633
	* ieee.c (ieee_slurp_sections): Check for a NULL return from
	read_id.
	(ieee_archive_p): Likewise.
	(ieee_object_p): Likewise.

2017-06-21  Nick Clifton  <nickc@redhat.com>

	PR binutils/21640
	* elf.c (setup_group): Zero the group section pointer list after
	allocation so that loops can be caught.  Check for NULL pointers
	when processing a group list.

2017-06-20  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* elf-s390.h: New file.
	* elf64-s390.c (struct elf_s390_link_hash_table): Add params
	field.
	(elf_s390_additional_program_headers): New function.
	(elf_s390_modify_segment_map): New function.
	(bfd_elf_s390_set_options): New function.
	(elf_backend_additional_program_headers)
	(elf_backend_modify_segment_map): Add macro definitions.

2017-06-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21626
	* elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
	the DYNAMIC bit instead of bfd_count_sections.

2017-06-19  Nick Clifton  <nickc@redhat.com>

	PR binutils/21618
	* vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
	length.
	(evax_bfd_print_eeom): Likewise.
	(evax_bfd_print_egsd): Check for an overlarge record length.
	(evax_bfd_print_etir): Likewise.

2017-06-19  Nick Clifton  <nickc@redhat.com>

	PR binutils/21612
	* libieee.h (struct common_header_type): Add end_p field.
	* ieee.c (this_byte_and_next): Do not advance input_p beyond
	end_p.
	(read_id): Check for a length that exceeds the remaining bytes in
	the input buffer.
	(ieee_seek): Initialise end_p.
	(ieee_archive_p): Likewise.
	(ieee_object_p): Likewise.

2017-06-19  Nick Clifton  <nickc@redhat.com>

	PR binutils/21611
	* vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
	before reading the EIHS structure entries.

2017-06-19  Nick Clifton  <nickc@redhat.com>

	PR binutils/21615
	* vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
	gsd_size.  Check that there are enough bytes remaining to read the
	type and size of the next egsd.  Check that the size of the egsd
	does not exceed the size of the record.

2017-06-19  Alan Modra  <amodra@gmail.com>

	* config.bfd: Correct targ_underscore for cris.

2017-06-18  Alan Modra  <amodra@gmail.com>

	* config.bfd: Correct targ_underscore for epiphany, ip2k,
	m32c, mn10200, pru, rl78, rx, crisv32 and v850.

2017-06-16  Nick Clifton  <nickc@redhat.com>

	* elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
	bucketlist is empty because there are no symbols to add to the
	list.

2017-06-16  Alan Modra  <amodra@gmail.com>

	PR ld/20022
	PR ld/21557
	PR ld/21562
	PR ld/21571
	* targets.c (struct bfd_target): Add _bfd_define_start_stop.
	(BFD_JUMP_TABLE_LINK): Likewise.
	* elf-bfd.h (bfd_elf_define_start_stop): Declare.
	* elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
	(bfd_elf_define_start_stop): New function.
	* linker.c (bfd_generic_define_start_stop): New function.
	* coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
	new field.
	* aout-adobe.c (aout_32_bfd_define_start_stop): Define.
	* aout-target.h (MY_bfd_define_start_stop): Define.
	* aout-tic30.c (MY_bfd_define_start_stop): Define.
	* binary.c (binary_bfd_define_start_stop): Define.
	* bout.c (b_out_bfd_define_start_stop): Define.
	* coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
	* coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
	* coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
	* coffcode.h (coff_bfd_define_start_stop): Define.
	* elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
	* i386msdos.c (msdos_bfd_define_start_stop): Define.
	* i386os9k.c (os9k_bfd_define_start_stop): Define.
	* ieee.c (ieee_bfd_define_start_stop): Define.
	* ihex.c (ihex_bfd_define_start_stop): Define.
	* libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
	* mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
	* mmo.c (mmo_bfd_define_start_stop): Define.
	* nlm-target.h (nlm_bfd_define_start_stop): Define.
	* oasys.c (oasys_bfd_define_start_stop): Define.
	* pef.c (bfd_pef_bfd_define_start_stop): Define.
	* plugin.c (bfd_plugin_bfd_define_start_stop): Define.
	* ppcboot.c (ppcboot_bfd_define_start_stop): Define.
	* som.c (som_bfd_define_start_stop): Define.
	* srec.c (srec_bfd_define_start_stop): Define.
	* tekhex.c (tekhex_bfd_define_start_stop): Define.
	* versados.c (versados_bfd_define_start_stop): Define.
	* vms-alpha.c (vms_bfd_define_start_stop): Define.
	(alpha_vms_bfd_define_start_stop): Define.
	* xsym.c (bfd_sym_bfd_define_start_stop): Define.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

2017-06-16  Jiong Wang  <jiong.wang@arm.com>

	* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
	SYMBOL_REFERENCES_LOCAL.

2017-06-15  Jiong Wang  <jiong.wang@arm.com>

	PR ld/21532
	* elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
	(elfNN_aarch64_final_link_relocate): Also propagate relocations to
	runtime for if there needs copy relocation elimination.
	(need_copy_relocation_p): New function.  Return true for symbol with
	pc-relative references and if it's against read-only sections.
	(elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
	(elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
	that are related with accessing external objects.
	(elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
	in elfNN_aarch64_check_relocs.

2017-06-15  Nick Clifton  <nickc@redhat.com>

	PR binutils/21582
	* ieee.c (ieee_object_p): Use a static buffer to avoid compiler
	bugs.
	PR binutils/21581
	(ieee_archive_p): Likewise.

2017-06-15  Nick Clifton  <nickc@redhat.com>

	PR binutils/21579
	* vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.

2017-06-14  Max Filippov  <jcmvbkbc@gmail.com>

	* elf32-xtensa.c (elf_xtensa_be_plt_entry,
	elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
	keep both windowed and call0 ABI PLT definitions.
	(elf_xtensa_create_plt_entry): Use selected ABI to choose upper
	elf_xtensa_*_plt_entry endex.
	(ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.

2017-06-14  Nick Clifton  <nickc@redhat.com>

	PR binutils/21578
	* elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
	flag value.

2017-06-14  Nick Clifton  <nickc@redhat.com>

	PR binutils/21589
	* vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
	maximum value for the ascic pointer.  Check that name processing
	does not read beyond this value.
	(_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
	end of etir record.

2017-06-14  Nick Clifton  <nickc@redhat.com>

	PR binutils/21591
	* versados.c (versados_mkobject): Zero the allocated tdata structure.
	(process_otr): Check for an invalid offset in the otr structure.

2017-06-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* config.bfd (epiphany-*-elf): Accept epiphany-*-*.

2017-06-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/20022
	PR ld/21557
	PR ld/21562
	PR ld/21571
	* elf-bfd.h (elf_link_hash_entry): Add start_stop.  Change the
	vtable field to a union.
	(_bfd_elf_is_start_stop): Removed.
	* elf32-i386.c (elf_i386_convert_load_reloc): Also check for
	__start_SECNAME and __stop_SECNAME symbols.
	* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
	* elflink.c (_bfd_elf_is_start_stop): Removed.
	(_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
	_bfd_elf_is_start_stop.
	(elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
	__stop_SECNAME symbols.  Updated.
	(elf_gc_smash_unused_vtentry_relocs): Likewise.
	(bfd_elf_gc_record_vtinherit): Likewise.
	(bfd_elf_gc_record_vtentry): Likewise.

2017-06-13  Nick Clifton  <nickc@redhat.com>

	PR ld/21524
	* elflink.c (elf_link_adjust_relocs): Generate an error when
	encountering a reloc against a symbol removed by garbage
	collection.

2017-06-12  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
	to merge_gnu_properties.
	* elf-properties.c (elf_merge_gnu_properties): Add struct
	bfd_link_info * and pass it to merge_gnu_properties.
	(elf_merge_gnu_property_list): Add struct bfd_link_info *
	and pass it to elf_merge_gnu_properties.
	(_bfd_elf_link_setup_gnu_properties): Pass info to
	elf_merge_gnu_property_list.
	* elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
	bfd_link_info *.
	* elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.

2017-06-11  Joe Zbiciak  <joe.zbiciak@leftturnonly.info>

	PR 21564
	* binary.c (binary_set_section_contents): Scale lma by octets
	per byte to set filepos.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
	dynamic sections.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
	require TEXTREL.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
	patched section contents for TLS IE reloc.
	* elf32-arc.c: Remove TCB_SIZE preprocessor macro.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_relocate_section): Added "call" to
	RELOC_FOR_GLOBAL_SYMBOL macro.

2018-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
	changes.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* config/tc-arc.c (md_undefined_symbol): Changed.
	* config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
	symbols.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (elf_arc_check_relocs): Added condition to disable
	warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.

2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>

	* elf32-arc.c (ADD_RELA): Changed to only work when dynamic
	object is created.

2017-06-08  Richard Earnshaw  <rearnsha@arm.com>

	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
	that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
	is non-zero.  Add clarifying comments.

2017-06-08  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
	name.  Use local IFUNC symbol name string to report unsupported
	non-PIC call to IFUNC function.
	(elf_i386_relocate_section): Dump local IFUNC name with minfo
	when generating R_386_IRELATIVE relocation.
	(elf_i386_finish_dynamic_symbol): Likewise.
	* elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
	IFUNC symbol name.
	(elf_x86_64_relocate_section): Dump local IFUNC name with minfo
	when generating R_X86_64_IRELATIVE relocation.
	(elf_x86_64_finish_dynamic_symbol): Likewise.

2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* elf.c (setup_group): Make sure BFD sections are created for all
	group sections in the input file when processing SHF_GROUP
	sections.
	(bfd_section_from_shdr): Avoid duplicating logic already
	implemented in `setup_group'.

2017-06-06  Daniel Bonniot de Ruisselet  <bonniot@gmail.com>

	PR binutils/21546
	* peXXigen.c (pe_print_idata): Use the address of the first thunk
	if the hint address is zero.

2017-06-06  James Clarke  <jrtc27@jrtc27.com>

	PR ld/19579
	* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
	ELF_COMMON_DEF_P for common symbols.

2017-06-06  Andrew Burgess  <andrew.burgess@embecosm.com>

	* elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
	SEC_GROUP sections as SEC_EXCLUDE.
	(bfd_elf_set_group_contents): Replace use of abort with an assert.
	(assign_section_numbers): Use resolve_section_groups flag instead
	of relocatable link type.
	(_bfd_elf_init_private_section_data): Use resolve_section_groups
	flag instead of checking the final_link flag for part of the
	checks in here.  Fix white space as a result.
	* elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
	instead of relocatable link type.
	(bfd_elf_final_link): Likewise.

2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
	variable `bed'.
	* elf32-score.c (score_elf_final_link_relocate): Likewise.
	(s3_bfd_score_elf_check_relocs): Likewise.
	* elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
	(score_elf_final_link_relocate): Likewise.
	(s7_bfd_score_elf_check_relocs): Likewise.

2017-06-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* elflink.c (init_reloc_cookie_rels): Remove unused variable
	`bed'.

2017-06-06  Maciej W. Rozycki  <macro@imgtec.com>

	* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
	from `reloc_count' rather than decrementing it.
	* elf.c (bfd_section_from_shdr): Multiply the adjustment to
	`reloc_count' by `int_rels_per_ext_rel'.
	* elf32-score.c (score_elf_final_link_relocate): Do not multiply
	`reloc_count' by `int_rels_per_ext_rel' for last relocation
	entry determination.
	(s3_bfd_score_elf_check_relocs): Likewise.
	* elf32-score7.c (score_elf_final_link_relocate): Likewise.
	(s7_bfd_score_elf_relocate_section): Likewise.
	(s7_bfd_score_elf_check_relocs): Likewise.
	* elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
	prototype and function.
	(mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
	(mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
	triple rather than once the sum of REL and RELA relocation entry
	counts.
	(bfd_elf64_get_reloc_upper_bound): Remove macro.
	* elflink.c (_bfd_elf_link_read_relocs): Do not multiply
	`reloc_count' by `int_rels_per_ext_rel' for internal relocation
	storage allocation size determination.
	(elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
	size by `int_rels_per_ext_rel'.  Do not multiply `reloc_count'
	by `int_rels_per_ext_rel' for last relocation entry
	determination.
	(bfd_elf_final_link): Do not multiply `reloc_count' by
	`int_rels_per_ext_rel' for internal relocation storage
	allocation size determination.
	(init_reloc_cookie_rels): Do not multiply `reloc_count' by
	`int_rels_per_ext_rel' for last relocation entry determination.
	(elf_gc_smash_unused_vtentry_relocs): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
	(_bfd_mips_elf_relocate_section): Likewise.

2017-06-05  Alan Modra  <amodra@gmail.com>

	PR 21529
	* linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.

2017-06-01  John Baldwin  <jhb@FreeBSD.org>

	* elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
	determine structure sizes.
	(elfcore_grok_freebsd_prstatus): Likewise.

2017-06-01  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
	(ppc64_elf_merge_symbol_attribute): Merge localentry bits from
	dynamic objects.
	(is_elfv2_localentry0): New function.
	(ppc64_elf_tls_setup): Default params->plt_localentry0.
	(plt_stub_size): Adjust size for tls_get_addr_opt stub.
	(build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
	(ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
	optimized localentry:0 stubs.
	(ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
	(ppc64_elf_relocate_section): Leave nop unchanged for optimized
	localentry:0 stubs.
	(ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
	DT_PPC64_OPT.
	* elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.

2017-05-30  Casey Smith  <clegg89@gmail.com>

	PR ld/21523
	* elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
	value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.

2017-05-30  Anton Kolesov  Anton.Kolesov@synopsys.com

	* cpu-arc.c (arc_compatible): New function.

2017-05-30  Anton Kolesov  <anton.kolesov@synopsys.com>

	* cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.

2017-05-30  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/21519
	* bfdio.c (bfd_get_file_size): New function.
	* bfd-in2.h: Regenerated.

2017-05-23  Dilian Palauzov  <git-dpa@aegee.org>

	* elf32-arc.c (arc_elf_merge_attributes): Add fall through
	comments.

2017-05-22  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
	dynobj instead of htab->elf.dynobj.

2017-05-19  Maciej W. Rozycki  <macro@imgtec.com>

	* elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
	and function.
	(mips_elf64_canonicalize_dynamic_reloc): Likewise.
	(mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
	actual number of internal relocations retrieved.  Adjust
	function description.
	(bfd_elf64_canonicalize_reloc): Remove macro.
	(bfd_elf64_canonicalize_dynamic_reloc): Likewise.

2017-05-19  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* archures.c (bfd_mach_sparc_v9m8): Define.
	(bfd_mach_sparc_v8plusm8): Likewise.
	(bfd_mach_sparc_v9_p): Adjust to M8.
	(bfd_mach_sparc_64bit_p): Likewise.
	* aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
	bfd_mach_sparc_v8plusm8.
	* bfd-in2.h: Regenerated.
	* cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
	sparc:v8plusm8.
	* elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
	bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
	capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
	SHA3.
	* elf32-sparc.c (elf32_sparc_final_write_processing): Handle
	bfd_mach_sparc_v8plusm8.

2017-05-19  Alan Modra  <amodra@gmail.com>

	* elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
	debug and special sections when no non-note alloc sections in an
	object are kept.

2017-05-18  Alan Modra  <amodra@gmail.com>

	* arc-got.h: Don't compare boolean values against TRUE or FALSE.
	* elf-m10300.c: Likewise.
	* elf.c: Likewise.
	* elf32-arc.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-nds32.c: Likewise.
	* elf32-tilepro.c: Likewise.
	* elflink.c: Likewise.
	* elfnn-aarch64.c: Likewise.
	* elfnn-riscv.c: Likewise.
	* elfxx-tilegx.c: Likewise.
	* mach-o.c: Likewise.
	* peXXigen.c: Likewise.
	* vms-alpha.c: Likewise.
	* vms-lib.c: Likewise.

2017-05-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/20882
	* elflink.c (elf_gc_mark_debug_section): New function.
	(_bfd_elf_gc_mark_extra_sections): Mark any debug sections
	referenced by kept debug sections.

2017-05-16  Alan Modra  <amodra@gmail.com>

	* elf-m10300.c: Rename occurrences of non_ir_ref.
	* elf32-arm.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-cr16.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-d10v.c: Likewise.
	* elf32-dlx.c: Likewise.
	* elf32-fr30.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i370.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-iq2000.c: Likewise.
	* elf32-lm32.c: Likewise.
	* elf32-m32c.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-mcore.c: Likewise.
	* elf32-metag.c: Likewise.
	* elf32-microblaze.c: Likewise.
	* elf32-moxie.c: Likewise.
	* elf32-msp430.c: Likewise.
	* elf32-mt.c: Likewise.
	* elf32-nios2.c: Likewise.
	* elf32-or1k.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-rl78.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-score.c: Likewise.
	* elf32-score7.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-tic6x.c: Likewise.
	* elf32-tilepro.c: Likewise.
	* elf32-v850.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf32-xstormy16.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ia64-vms.c: Likewise.
	* elf64-mmix.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.c: Likewise.
	* elfnn-aarch64.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* elfnn-riscv.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* elfxx-tilegx.c: Likewise.
	* linker.c: Likewise.

2017-05-16  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
	* elflink.c (elf_link_add_object_symbols): Update to use
	non_ir_ref_dynamic.
	(elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
	non_ir_ref.
	* linker.c (_bfd_generic_link_add_one_symbol): Likewise.

2017-05-15  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.

2017-05-12  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_parse_gnu_properties): Merge
	GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
	properties.
	* elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.

2017-05-11  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
	to plt_second.
	(elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
	to plt_second/plt_second_eh_frame.
	(elf_x86_64_link_hash_newfunc): Updated.
	(elf_x86_64_allocate_dynrelocs): Likewise.
	(elf_x86_64_size_dynamic_sections): Likewise.
	(elf_x86_64_relocate_section): Likewise.
	(elf_x86_64_finish_dynamic_symbol): Likewise.
	(elf_x86_64_finish_dynamic_sections): Likewise.
	(elf_x86_64_plt_type): Rename plt_bnd to plt_second.
	(elf_x86_64_get_synthetic_symtab): Updated.  Also scan the
	.plt.sec section.
	(elf_backend_setup_gnu_properties): Updated.  Create the
	.plt.sec section instead of the .plt.sec section.

2017-05-11  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
	commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.

2017-05-10  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* elf64-sparc.c (elf64_sparc_set_reloc): New function.
	(bfd_elf64_set_reloc): Define.
	(elf64_sparc_write_relocs): Use `canon_reloc_count'.

2017-05-10  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
	(struct bfd_target): New field _bfd_set_reloc.
	* bfd.c (bfd_set_reloc): Call backend _set_bfd.
	* reloc.c (_bfd_generic_set_reloc): New function.
	* coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
	* nlm-target.h (nlm_set_reloc): Likewise.
	* coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
	* aout-tic30.c (MY_set_reloc): Likewise.
	* aout-target.h (MY_set_reloc): Likewise.
	* elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
	* coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
	* mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
	* vms-alpha.c (alpha_vms_set_reloc): Likewise.
	* aout-adobe.c (aout_32_set_reloc): Likewise.
	* bout.c (b_out_set_reloc): Likewise.
	* coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
	* i386os9k.c (aout_32_set_reloc): Likewise.
	* ieee.c (ieee_set_reloc): Likewise.
	* oasys.c (oasys_set_reloc): Likewise.
	* som.c (som_set_reloc): Likewise.
	* versados.c (versados_set_reloc): Likewise.
	* coff64-rs6000.c (rs6000_xcoff64_vec): Add
	_bfd_generic_set_reloc.
	(rs6000_xcoff64_aix_vec): LIkewise.
	* libbfd.c (_bfd_norelocs_set_reloc): New function.
	* libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
	* i386msdos.c (msdos_set_reloc): Define to
	_bfd_norelocs_set_reloc.
	* elfcode.h (elf_set_reloc): Define.
	* bfd-in2.h: Regenerated.

2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21481
	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
	for IFUNC function address.

2017-05-10  Claudiu Zissulescu  <claziss@synopsys.com>

	* elf32-arc.c (FEATURE_LIST_NAME): Define.
	(CONFLICT_LIST): Likewise.
	(opcode/arc-attrs.h): Include.
	(arc_elf_print_private_bfd_data): Print OSABI v4 flag.
	(arc_extract_features): New file.
	(arc_stralloc): Likewise.
	(arc_elf_merge_attributes): Likewise.
	(arc_elf_merge_private_bfd_data): Use object attributes.
	(bfd_arc_get_mach_from_attributes): New function.
	(arc_elf_object_p): Use object attributes.
	(arc_elf_final_write_processing): Likewise.
	(elf32_arc_obj_attrs_arg_type): New function.
	(elf32_arc_obj_attrs_handle_unknown): Likewise.
	(elf32_arc_section_from_shdr): Likewise.
	(elf_backend_obj_attrs_vendor): Define.
	(elf_backend_obj_attrs_section): Likewise.
	(elf_backend_obj_attrs_arg_type): Likewise.
	(elf_backend_obj_attrs_section_type): Likewise.
	(elf_backend_obj_attrs_handle_unknown): Likewise.
	(elf_backend_section_from_shdr): Likewise.

2017-05-09  Andrew Goedhart  <Andrewgoedhart@simplepowersolutions.co.za>

	PR ld/21458
	* elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
	of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
	and the destination is a Thumb symbol.

2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
	initializer to silence GCC 4.2.
	* lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
	(LAZY_PLT_ENTRY_SIZE): This.
	(NON_LAZY_PLT_ENTRY_SIZE): New.
	(elf_x86_64_plt0_entry): Renamed to ...
	(elf_x86_64_lazy_plt0_entry): This.
	(elf_x86_64_plt_entry): Renamed to ...
	(elf_x86_64_lazy_plt_entry): This.
	(elf_x86_64_bnd_plt0_entry): Renamed to ...
	(elf_x86_64_lazy_bnd_plt0_entry): This.
	(elf_x86_64_legacy_plt_entry): Removed.
	(elf_x86_64_bnd_plt_entry): Renamed to ...
	(elf_x86_64_lazy_bnd_plt_entry): This.
	(elf_x86_64_legacy_plt2_entry): Renamed to ...
	(elf_x86_64_non_lazy_plt_entry): This.
	(elf_x86_64_bnd_plt2_entry): Renamed to ...
	(elf_x86_64_non_lazy_bnd_plt_entry): This.
	(elf_x86_64_eh_frame_plt): Renamed to ...
	(elf_x86_64_eh_frame_lazy_plt): This.
	(elf_x86_64_eh_frame_bnd_plt): Renamed to ...
	(elf_x86_64_eh_frame_lazy_bnd_plt): This.
	(elf_x86_64_eh_frame_plt_got): Renamed to ...
	(elf_x86_64_eh_frame_non_lazy_plt): This.
	(elf_x86_64_lazy_plt_layout): New.
	(elf_x86_64_non_lazy_plt_layout): Likewise.
	(elf_x86_64_plt_layout): Likewise.
	(elf_x86_64_backend_data): Remove PLT layout information.  Add
	os for target system.
	(GET_PLT_ENTRY_SIZE): Removed.
	(elf_x86_64_lazy_plt): New.
	(elf_x86_64_non_lazy_plt): Likewise.
	(elf_x86_64_lazy_bnd_plt): Likewise.
	(elf_x86_64_non_lazy_bnd_plt): Likewise.
	(elf_x86-64_arch_bed): Updated.
	(elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
	(elf_x86_64_create_dynamic_sections): Removed.
	(elf_x86_64_check_relocs): Don't check elf.dynobj.  Don't call
	_bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
	(elf_x86-64_adjust_dynamic_symbol): Updated.
	(elf_x86_64_allocate_dynrelocs): Updated.  Pass 0 as PLT header
	size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
	size for PLT0 if there is no PLT0.  Get plt_entry_size from
	non_lazy_plt for non-lazy PLT entries.
	(elf_x86_64_size_dynamic_sections): Updated.  Get plt_entry_size
	from non_lazy_plt for non-lazy PLT entries.
	(elf_x86-64_relocate_section): Updated.  Properly get PLT index
	if there is no PLT0.
	(elf_x86_64_finish_dynamic_symbol): Updated.  Fill the first slot
	in the PLT entry with generic PLT layout.  Fill the non-lazy PLT
	entries with non-lazy PLT layout.  Don't fill the second and third
	slots in the PLT entry if there is no PLT0.
	(elf_x86_64_finish_dynamic_sections): Updated.  Don't fill PLT0
	if there is no PLT0.  Set sh_entsize on the .plt.got section.
	(compare_relocs): New.
	(elf_x86_64_plt_type): Likewise.
	(elf_x86_64_plt): Likewise.
	(elf_x86_64_nacl_plt): New. Forward declaration.
	(elf_x86_64_get_plt_sym_val): Removed.
	(elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
	against all dynamic relocations.
	(elf_x86_64_link_setup_gnu_properties): New function.
	(elf_backend_create_dynamic_sections): Updated.
	(elf_backend_setup_gnu_properties): New.
	(elf_x86_64_nacl_plt): New.
	(elf_x86_64_nacl_arch_bed): Updated.

2017-05-08  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
	(LAZY_PLT_ENTRY_SIZE): This.
	(NON_LAZY_PLT_ENTRY_SIZE): New.
	(elf_i386_plt0_entry): Renamed to ...
	(elf_i386_lazy_plt0_entry): This.
	(elf_i386_plt_entry): Renamed to ...
	(elf_i386_lazy_plt_entry): This.
	(elf_i386_pic_plt0_entry): Renamed to ...
	(elf_i386_pic_lazy_plt0_entry): This.
	(elf_i386_pic_plt_entry): Renamed to ...
	(elf_i386_pic_lazy_plt_entry): This.
	(elf_i386_got_plt_entry): Renamed to ...
	(elf_i386_non_lazy_plt_entry): This.
	(elf_i386_pic_got_plt_entry): Renamed to ...
	(elf_i386_pic_non_lazy_plt_entry): This.
	(elf_i386_eh_frame_plt): Renamed to ...
	(elf_i386_eh_frame_lazy_plt): This.
	(elf_i386_eh_frame_plt_got): Renamed to ...
	(elf_i386_eh_frame_non_lazy_plt): This.
	(elf_i386_plt_layout): Renamed to ...
	(elf_i386_lazy_plt_layout): This.  Remove eh_frame_plt_got and
	eh_frame_plt_got_size.
	(elf_i386_non_lazy_plt_layout): New.
	(elf_i386_plt_layout): Likewise.
	(elf_i386_non_lazy_plt): Likewise.
	(GET_PLT_ENTRY_SIZE): Removed.
	(elf_i386_plt): Renamed to ...
	(elf_i386_lazy_plt): This.
	(elf_i386_backend_data): Remove plt.  Rename is_vxworks to os.
	(elf_i386_arch_bed): Updated.
	(elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
	(elf_i386_create_dynamic_sections): Removed.
	(elf_i386_check_relocs): Don't check elf.dynobj.  Don't call
	_bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
	(elf_i386_adjust_dynamic_symbol): Updated.
	(elf_i386_allocate_dynrelocs): Updated.  Pass 0 as PLT header
	size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
	size for PLT0 if there is no PLT0.
	(elf_i386_size_dynamic_sections): Updated.  Check whether GOT
	output section is discarded only if GOT isn't empty.
	(elf_i386_relocate_section): Updated.  Properly get PLT index
	if there is no PLT0.
	(elf_i386_finish_dynamic_symbol): Updated.  Don't fill the
	second and third slots in the PLT entry if there is no PLT0.
	(elf_i386_finish_dynamic_sections): Updated.  Don't fill PLT0
	if there is no PLT0.  Set sh_entsize on the .plt.got section.
	(elf_i386_nacl_plt): Forward declaration.
	(elf_i386_get_plt_sym_val): Removed.
	(elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
	against all dynamic relocations.
	(elf_i386_link_setup_gnu_properties): New function.
	(elf_backend_create_dynamic_sections): Updated.
	(elf_backend_setup_gnu_properties): New.
	(elf_i386_nacl_plt): Updated.
	(elf_i386_nacl_arch_bed): Likewise.
	(elf_i386_vxworks_arch_bed): Likewise.

2017-05-08  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* elflink.c (elf_output_implib): Remove executable flag from import
	library bfd.
	* elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
	library is a relocatable object file.

2017-05-01  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	PR ld/21404
	* elf32-avr.c (avr_should_move_sym): New function.
	(avr_should_reduce_sym_size): Likewise.
	(avr_should_increase_sym_size): Likewise.
	(elf32_avr_relax_delete_bytes): Adjust symbol values
	and sizes by calling new functions.

2017-05-01  Palmer Dabbelt  <palmer@dabbelt.com>

	* config.bfd (riscv32-*): Enable rv64.

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

	PR 21384
	* elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
	rather than h->root.type == bfd_link_hash_new.
	(bfd_elf_record_link_assignment): Similarly, call
	bfd_elf_link_mark_dynamic_symbol when h->non_elf.

2017-04-29  Alan Modra  <amodra@gmail.com>

	PR 21432
	* reloc.c (reloc_offset_in_range): New function.
	(bfd_perform_relocation, bfd_install_relocation): Use it.
	(_bfd_final_link_relocate): Likewise.

2017-04-28  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
	before using .plt.got.
	* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.

2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
	instead of "+=" to update 0.

2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_create_dynamic_sections): Create the
	.plt.got section here.
	(elf_i386_check_relocs): Don't create the .plt.got section.
	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
	the .plt.got and .plt.bnd sections here.
	(elf_x86_64_check_relocs): Don't create the .plt.got nor
	.plt.bnd sections.

2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
	has_bnd_reloc.
	(elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
	(elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
	(elf_x86_64_check_relocs): Don't set has_bnd_reloc.
	(elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
	has_bnd_reloc.

2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (elf_backend_data): Change setup_gnu_properties
	to return bfd *.
	(_bfd_elf_link_setup_gnu_properties): Return bfd *.
	* elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
	the first relocatable ELF input with GNU properties.

2017-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
	VxWorks for non-PIC.

2017-04-27  Alan Modra  <amodra@gmail.com>

	* elf-bfd.h (struct elf_backend_data): Make asection param of
	elf_backend_eh_frame_address_size const.
	(_bfd_elf_eh_frame_address_size): Likewise.
	* elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
	* elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
	* elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
	* elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
	(next_cie_fde_offset): Constify params.
	(offset_adjust, adjust_eh_frame_local_symbols): Likewise.

2017-04-27  Alan Modra  <amodra@gmail.com>

	* elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
	(_bfd_elf_adjust_eh_frame_global_symbol): Declare.
	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
	aug_data_len.
	(offset_adjust): New function.
	(_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
	(adjust_eh_frame_local_symbols): Likewise.
	(_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
	after changing anything.  Return true if anything changed.
	* elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
	_bfd_elf_adjust_eh_frame_global_symbol for globals.

2017-04-27  Alan Modra  <amodra@gmail.com>

	* elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
	when force_local.

2017-04-27  Alan Modra  <amodra@gmail.com>

	* elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
	(ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
	(ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
	(ppc_elf_relocate_section): Likewise.  Delete silly optimisation
	for undef and undefweak dyn_relocs.
	* elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
	(ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
	(allocate_got, allocate_dynrelocs): Likewise.
	(ppc64_elf_relocate_section): Likewise.

2017-04-26  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
	DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
	* elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
	add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.

2017-04-26  Nick Clifton  <nickc@redhat.com>

	PR binutils/21434
	* reloc.c (bfd_perform_relocation): Check for a negative address
	in the reloc.

2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>

	PR ld/21334
	* elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
	member.
	* elfxx-target.h [!elf_backend_always_renumber_dynsyms]
	(elf_backend_always_renumber_dynsyms): Define.
	(elfNN_bed): Initialize `always_renumber_dynsyms' member.
	* elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
	* elflink.c (bfd_elf_size_dynamic_sections): Also call
	`_bfd_elf_link_renumber_dynsyms' if the backend has requested
	it.
	(bfd_elf_size_dynsym_hash_dynstr): Likewise.

2017-04-26  Maciej W. Rozycki  <macro@imgtec.com>

	* elflink.c (bfd_elf_size_dynamic_sections): Only call
	`_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
	sections have been created.

2017-04-26  Nick Clifton  <nickc@redhat.com>

	PR binutils/21431
	* compress.c (bfd_init_section_compress_status): Check the return
	value from bfd_malloc.

2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>

	* elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
	no_finish_dynamic_symbol.
	(elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
	0.
	(elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
	weak symbol, don't make it dynamic.
	(elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
	set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
	relocation for GOT reference.
	(elf_x86_64_finish_dynamic_symbol): Abort if
	no_finish_dynamic_symbol isn't 0.

2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21402
	* elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
	undefined weak symbol, don't make it dynamic.
	(elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
	set no_finish_dynamic_symbol and generate R_386_RELATIVE
	relocation for R_386_GOT32.

2017-04-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21425
	* elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.

2017-04-23  Alan Modra  <amodra@gmail.com>

	PR 21414
	* section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
	* elf.c (lcomm_sym): New.
	(_bfd_elf_large_com_section): Use lcomm_sym section symbol.
	* bfd-in2.h: Regenerate.

2017-04-23  Alan Modra  <amodra@gmail.com>

	PR 21412
	* elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
	parameters and comment.
	(_bfd_elf_get_reloc_section): Delete.
	(_bfd_elf_plt_get_reloc_section): Declare.
	* elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
	New functions.  Don't blindly skip over assumed .rel/.rela prefix.
	Extracted from..
	(_bfd_elf_get_reloc_section): ..here.  Delete.
	(assign_section_numbers): Call elf_get_reloc_section.
	* elf64-ppc.c (elf_backend_get_reloc_section): Define.
	* elfxx-target.h (elf_backend_get_reloc_section): Update.

2017-04-23  Alan Modra  <amodra@gmail.com>

	PR 21409
	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
	no symbols.

2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21402
	* elf32-i386.c (elf_i386_link_hash_entry): Add
	no_finish_dynamic_symbol.
	(elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
	(elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
	symbol, don't make it dynamic in PIE.
	(elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
	set no_finish_dynamic_symbol and generate R_386_RELATIVE
	relocation for R_386_GOT32
	(elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
	isn't 0.

2017-04-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/19617
	PR ld/21086
	* elflink.c (elf_link_add_object_symbols): Require
	--no-dynamic-linker with -E/--dynamic-list when creating
	dynamic sections.

2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>

	* elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
	if forced local.

2017-04-20  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
	dynamic symbol sorting.

2017-04-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21382
	* elflink.c (elf_link_add_object_symbols): Preserve
	dynamic_ref_after_ir_def when restoring the symbol table for
	unneeded dynamic object.

2017-04-19  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21401
	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
	on on undefined IFUNC symbol in the second PLT.

2017-04-19  Wedson Almeida Filho  <wedsonaf@gmail.com>

	* peXXigen.c (pe_print_reloc): Correct chunk_end.

2017-04-19  Alan Modra  <amodra@gmail.com>

	* elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
	or make dynamic for info->dynamic_undefined_weak 0 and 1.
	* elf32-ppc.c:Formatting.
	(ensure_undefweak_dynamic): Don't make dynamic when
	info->dynamic_undefined_weak is zero.
	(allocate_dynrelocs): Discard undefweak dyn_relocs for
	info->dynamic_undefined_weak.  Discard undef dyn_relocs when
	not default visibility.  Discard undef and undefweak
	dyn_relocs earlier.
	(ppc_elf_relocate_section): Adjust to suit.
	* elf64-ppc.c: Formatting.
	(ensure_undefweak_dynamic): Don't make dynamic when
	info->dynamic_undefined_weak is zero.
	(allocate_dynrelocs): Discard undefweak dyn_relocs for
	info->dynamic_undefined_weak.  Discard them earlier.

2017-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21389
	* elflink.c (bfd_elf_size_dynamic_sections): Get soname index
	before generating the version definition section.

2017-04-17  Alan Modra  <amodra@gmail.com>

	* elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
	state when a regular object file defines a symbol with
	incompatible type to that defined by an earlier shared lib.

2017-04-13  Alan Modra  <amodra@gmail.com>

	* coffcode.h: Wrap some overly long _bfd_error_handler args.
	* elf.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-mep.c: Likewise.
	* elf64-ia64-vms.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.

2017-04-13  Alan Modra  <amodra@gmail.com>

	* aoutx.h: Use %B and %A in error messages throughout file.
	* aout-cris.c: Likewise.
	* archive.c: Likewise.
	* binary.c: Likewise.
	* coff-rs6000.c: Likewise.
	* coff-tic4x.c: Likewise.
	* coffcode.h: Likewise.
	* coffgen.c: Likewise.
	* cofflink.c: Likewise.
	* coffswap.h: Likewise.
	* cpu-arm.c: Likewise.
	* elf-eh-frame.c: Likewise.
	* elf-m10300.c: Likewise.
	* elf.c: Likewise.
	* elf32-arc.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-iq2000.c: Likewise.
	* elf32-m32c.c: Likewise.
	* elf32-microblaze.c: Likewise.
	* elf32-nds32.c: Likewise.
	* elf32-rl78.c: Likewise.
	* elf32-rx.c: Likewise.
	* elf32-score.c: Likewise.
	* elf32-score7.c: Likewise.
	* elf32-sh64.c: Likewise.
	* elf32-v850.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf32-visium.c: Likewise.
	* elf64-ia64-vms.c: Likewise.
	* elf64-mmix.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elfcode.h: Likewise.
	* elfnn-aarch64.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* hpux-core.c: Likewise.
	* ieee.c: Likewise.
	* ihex.c: Likewise.
	* linker.c: Likewise.
	* merge.c: Likewise.
	* mmo.c: Likewise.
	* oasys.c: Likewise.
	* pdp11.c: Likewise.
	* peXXigen.c: Likewise.
	* rs6000-core.c: Likewise.
	* vms-alpha.c: Likewise.
	* xcofflink.c: Likewise.

2017-04-13  Alan Modra  <amodra@gmail.com>

	* bfd.c (PRINT_TYPE): Define.
	(_doprnt): New function.
	(error_handler_internal): Use _doprnt.
	* coff-arm.c: Put %A and %B arguments to _bfd_error_handler
	calls in their natural order, throughout file.
	* coff-mcore.c: Likewise.
	* coff-ppc.c: Likewise.
	* coff-tic80.c: Likewise.
	* cofflink.c: Likewise.
	* elf-s390-common.c: Likewise.
	* elf.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-msp430.c: Likewise.
	* elf32-spu.c: Likewise.
	* elf64-ia64-vms.c: Likewise.
	* elf64-sparc.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.c: Likewise.
	* elfnn-aarch64.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.

2017-04-13  Alan Modra  <amodra@gmail.com>

	* elf32-arm.c (arm_type_of_stub): Supply missing args to "long
	branch veneers" error.  Fix double space and format message.
	* elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
	* elf64-ppc.c (tocsave_find): Supply missing %B arg.

2017-04-13  Alan Modra  <amodra@gmail.com>

	* bfd-in2.h: Regenerate.

2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
	extra `\n' in warning/error messages.
	* elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
	* elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.

2017-04-11  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
	processor-specific properties with generic ELF target vector.

2017-04-10  Qing Zhao  <qing.zhao@oracle.com>

        * elf32-sparc.c (elf_backend_fixup_symbol): New.
        * elf64-sparc.c (elf_backend_fixup_symbol): New.
        * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
        (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
        has_non_got_reloc.
        (link_hash_newfunc): Initialize has_got_reloc and
	has_non_got_reloc.
        (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
        section.
        (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
        has_non_got_reloc.
        (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
        has_non_got_reloc.
        (_bfd_sparc_elf_fixup_symbol): New function.
        (allocate_dynrelocs): Don't allocate space for dynamic
        relocations and discard relocations against resolved undefined
        weak symbols in executable.  Don't make resolved undefined weak
        symbols in executable dynamic.  Keep dynamic non-GOT/non-PLT
        relocation against undefined weak symbols in PIE.
        (_bfd_sparc_elf_relocate_section): Don't generate dynamic
        relocations against resolved undefined weak symbols in PIE
        (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
        without ynamic PLT/GOT relocations for resolved undefined weak
        symbols.
        Don't generate dynamic relocation against resolved undefined
        weak symbol in executable.
        (pie_finish_undefweak_symbol): New function.
        (_bfd_sparc_elf_finish_dynamic_sections): Call
        pie_finish_undefweak_symbol on all symbols in PIE.
        * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
        (_bfd_sparc_elf_fixup_symbol): New function.

2017-04-10  Nick Clifton  <nickc@redhat.com>

	* config.bfd: Remove ns32k from obsolete list.

2017-04-10  Alan Modra  <amodra@gmail.com>

	PR 21287
	* elf.c (special_sections_f): Match .fini_array and .fini_array.*.
	(special_sections_i): Likewise for .init_array.
	(special_sections_p): Likewise for .preinit_array.

2017-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/19579
	PR ld/21306
	* elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
	ELF_COMMON_DEF_P for common symbols.
	* elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
	* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
	* elflink.c (_bfd_elf_merge_symbol): Revert commits
	202ac193bbbecc96a4978d1ac3d17148253f9b01 and
	07492f668d2173da7a2bda3707ff0985e0f460b6.

2017-04-07  Pedro Alves  <palves@redhat.com>

	* opncls.c (bfd_get_debug_link_info): Rename to...
	(bfd_get_debug_link_info_1): ... this.  Change type of second
	parameter to void pointer.  Adjust.
	(bfd_get_debug_link_info): Reimplement on top of
	bfd_get_debug_link_info_1.
	(separate_debug_file_exists, separate_alt_debug_file_exists):
	Change type of second parameter to void pointer.  Adjust.
	(get_func_type, check_func_type): Change type of second parameter
	to void pointer.
	(find_separate_debug_file): Add 'func_data' parameter.  Pass it to
	the callback functions instead of passing the address of a local.
	(bfd_follow_gnu_debuglink): Pass address of unsigned long local to
	find_separate_debug_file.
	(get_alt_debug_link_info_shim): Change type of second parameter to
	void pointer.  Adjust.
	(bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
	find_separate_debug_file.
	(get_build_id_name, bfd_boolean check_build_id_file): Change type
	of second parameter to void pointer.  Adjust.
	(bfd_follow_build_id_debuglink): Pass address of bfd_build_id
	pointer local to find_separate_debug_file.

2017-04-07  Tristan Gingold  <gingold@gingold-Precision-7510>

	* coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
	external symbols with a definition.
	(_bfd_coff_gc_mark_extra_sections): Fix typo.

2017-04-07  Alan Modra  <amodra@gmail.com>

	* po/SRC-POTFILES.in: Regenerate.

2017-04-05  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
	reference counting.

2017-04-02  Jon Turney  <jon.turney@dronecode.org.uk>

	(_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
	numbers for DataDirectory entry indicies passed to
	add_data_entry().

2017-04-04  H.J. Lu  <hongjiu.lu@intel.com>

	* elf.c (get_program_header_size): Add a GNU_MBIND segment for
	each GNU_MBIND section and align GNU_MBIND section to page size.
	(_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
	segment for each GNU_MBIND section.
	(_bfd_elf_init_private_section_data): Copy sh_info from input
	for GNU_MBIND section.

2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>

	* elfnn-riscv.c (GP_NAME): Delete.
	(riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
	(_bfd_riscv_relax_lui): Likewise.

2017-04-04  Nick Clifton  <nickc@redhat.com>

	PR binutils/21342
	* elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
	dereference.
	(bfd_elf_final_link): Only initialize the extended symbol index
	section if there are extended symbol tables to list.

2017-04-03  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
	(BFD32_BACKENDS_CFILES): Add elf-properties.c.
	* configure.ac (elf): Add elf-properties.lo.
	* Makefile.in: Regenerated.
	* configure: Likewise.
	* elf-bfd.h (elf_property_kind): New.
	(elf_property): Likewise.
	(elf_property_list): Likewise.
	(elf_properties): Likewise.
	(_bfd_elf_parse_gnu_properties): Likewise.
	(_bfd_elf_get_property): Likewise.
	(_bfd_elf_link_setup_gnu_properties): Likewise.
	(elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
	and setup_gnu_properties.
	(elf_obj_tdata): Add properties.
	* elf-properties.c: New file.
	* elf32-i386.c (elf_i386_parse_gnu_properties): New.
	(elf_i386_merge_gnu_properties): Likewise.
	(elf_backend_parse_gnu_properties): Likewise.
	(elf_backend_merge_gnu_properties): Likewise.
	* elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
	(elf_x86_64_merge_gnu_properties): Likewise.
	(elf_backend_parse_gnu_properties): Likewise.
	(elf_backend_merge_gnu_properties): Likewise.
	* elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
	(elf_backend_parse_gnu_properties): Likewise.
	(elf_backend_setup_gnu_properties): Likewise.
	(elfNN_bed): Add elf_backend_parse_gnu_properties,
	elf_backend_merge_gnu_properties and
	elf_backend_setup_gnu_properties.

2017-03-30  Pip Cet  <pipcet@gmail.com>

	* elf32-wasm32.c: Add relocation code, two relocs.
	* reloc.c: Add wasm32 relocations.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
	* bfd/po/bfd.pot: Regenerate.

2017-03-29  Nick Clifton  <nickc@redhat.com>

	PR binutils/18025
	* coff-bfd.h (struct coff_section_data): Add new fields:
	saved_bias and bias.
	* coffgen.c (coff_find_nearest_line_with_names): Cache the bias
	computed for PE binaries.
	* dwarf2.c (scan_unit_for_symbols): Only warn once about each
	missing abbrev.

2017-03-28  Hans-Peter Nilsson  <hp@axis.com>

	PR ld/16044
	* elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
	to handle a local symbol with a hash-symbol-entry; without PLT.
	Add BFD_ASSERT for an incidental case with GOT entry present.
	(cris_elf_check_relocs): Increment PLT refcount only if the symbol
	isn't forced-or-set local.

2017-03-27  Pip Cet  <pipcet@gmail.com>

	* wasm-module.c: New file to support WebAssembly modules.
	* wasm-module.h: New file to support WebAssembly modules.
	* doc/webassembly.texi: Start documenting wasm-module.c.
	* config.bfd: Add wasm_vec.
	* targets.c: Likewise.
	* configure.ac: Likewise.
	* Makefile.am: Add entries for wasm-module.c.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.

2017-03-27  Pip Cet  <pipcet@gmail.com>

	* cpu-wasm32.c: New file to support wasm32 architecture.
	* elf32-wasm32.c: New file to support wasm32 architecture.
	* Makefile.am: Add wasm32 architecture.
	* archures.c: Likewise.
	* config.bfd: Likewise.
	* configure.ac: Likewise.
	* targets.c: Likewise.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.

2017-03-20  Alan Modra  <amodra@gmail.com>

	PR 21266
	* elf64-ppc.c (compare_symbols): Stabilize sort.

2017-03-18  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (struct ppc_link_hash_table): Add
	local_ifunc_resolver and maybe_local_ifunc_resolver.
	(ppc_build_one_stub): Set flags on emitting dynamic
	relocation to ifunc.
	(ppc64_elf_relocate_section): Likewise.
	(ppc64_elf_finish_dynamic_symbol): Likewise.
	(ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
	local dynamic relocs to ifuncs.
	* elf32-ppc.c (struct ppc_elf_link_hash_table): Add
	local_ifunc_resolver and maybe_local_ifunc_resolver.
	(ppc_elf_relocate_section): Set flag on emitting dynamic
	relocation to ifuncs.
	(ppc_elf_finish_dynamic_symbol): Likewise.
	(ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
	dynamic relocs to ifuncs.

2017-03-13  Nick Clifton  <nickc@redhat.com>

	PR binutils/21202
	* reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
	BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
	(BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
	BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
	names.
	(IS_AARCH64_TLSDESC_RELOC): Likewise.
	(elfNN_aarch64_howto_table): Likewise.
	(aarch64_tls_transition_without_check): Likewise.
	(aarch64_reloc_got_type): Likewise.
	(elfNN_aarch64_final_link_relocate): Likewise.
	(elfNN_aarch64_tls_relax): Likewise.
	(elfNN_aarch64_relocate_section): Likewise.
	(elfNN_aarch64_gc_sweep_hook): Likewise.
	(elfNN_aarch64_check_relocs): Likewise.
	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
	(_bfd_aarch64_elf_resolve_relocation): Likewise.

2017-03-11  Alan Modra  <amodra@gmail.com>

	* elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
	parameter is in fact used.  Whitespace fixes.
	* elf64-ppc.c: Likewise.

2017-03-09  Sam Thursfield  <sam.thursfield@codethink.co.uk>

	* rs6000-core.c (CORE_NEW): Simplify macro when
	AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.

2017-03-07  Alan Modra  <amodra@gmail.com>

	PR 21224
	PR 20519
	* elf64-ppc.c (ppc64_elf_relocate_section): Add missing
	dyn_relocs check.

2017-03-05  Alan Modra  <amodra@gmail.com>

	* elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
	* elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
	(next_cie_fde_offset): New function.
	(_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
	(_bfd_elf_discard_section_eh_frame): Align zero terminator to
	four bytes.  Align CIEs to four or eight bytes depending on
	per_encoding_aligned8.  Align FDEs according to their encoding.
	Pad last FDE to output section alignment.
	(_bfd_elf_write_section_eh_frame): Adjust to suit.  Remove
	assertion.
	* elf64-ppc.c (glink_eh_frame_cie): Delete padding.
	(ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
	(ppc64_elf_finish_dynamic_sections): Adjust to suit.

2017-03-02  Martin Bickel  <binutils@ineranves.de>

	PR ld/21212
	* elf.c (rewrite_elf_program_header): Do not issue a warning for
	empty segments which have a zero filesz, but a non-zero memsz.

2017-03-02  Alan Modra  <amodra@gmail.com>

	* elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.

2017-02-28  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
	(ppc64_elf_relocate_section): Likewise.

2017-02-28  Alan Modra  <amodra@gmail.com>

	PR 20995
	* elf32-nios2.c (nios2_elf32_relocate_section): Use htab
	rather than elf32_nios2_hash_table or elf_hash_table.
	(create_got_section): Likewise.
	(nios2_elf32_finish_dynamic_symbol): Likewise.
	(nios2_elf32_adjust_dynamic_symbol): Likewise.
	(nios2_elf32_size_dynamic_sections): Likewise.
	(nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
	vars.  Use htab equivalents directly instead.  Don't create
	all dynamic sections on needing just the GOT.  Use a goto
	rather than a fall-through with reloc test.  Ensure
	htab->dynobj is set when making dynamic sreloc section.
	(nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
	equivalent directly instead.  Don't segfault on looking for
	.dynamic when dynamic sections have not been created.  Don't
	segfault on .got.plt being discarded.
	(nios2_elf32_size_dynamic_sections): Delete plt and got vars.
	Don't set "relocs" on .rela.plt.  Do handle .sbss.  Delete
	fixme and another not so relevant comment.
	(nios2_elf_add_symbol_hook): Delete dynobj var.  If not
	already set, set hash table dynobj on creating .sbss.

2017-02-28  Alan Modra  <amodra@gmail.com>

	* reloc.c (BFD_RELOC_PPC_16DX_HA): New.
	* elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
	(ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
	(ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
	(ppc64_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
	(ppc_elf_reloc_type_lookup): Translate new bfd reloc.
	(ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.

2017-02-28  Alan Modra  <amodra@gmail.com>

	* elflink.c (_bfd_elf_create_dynamic_sections): Don't make
	dynamic .data.rel.ro read-only.
	* elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
	rather than section flags when deciding where copy reloc goes.
	* elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
	* elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
	* elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
	* elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
	* elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
	* elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
	* elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
	* elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
	* elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
	* elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
	* elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
	* elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
	* elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
	* elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
	* elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.

2017-02-28  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (mips_elf_perform_relocation): Also handle the
	`jalr $0, $25' instruction encoding.

2017-02-27  Nick Clifton  <nickc@redhat.com>

	PR ld/21180
	* elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
	generating a seg-fault when encountering a symbol that has been
	deleted by garbage collection.

2017-02-25  Alan Modra  <amodra@gmail.com>

	* elf32-arc.c (struct dynamic_sections): Delete.
	(enum dyn_section_types): Delete.
	(dyn_section_names): Delete.
	(arc_create_dynamic_sections): Delete.
	(elf_arc_finish_dynamic_sections): Don't call the above.  Don't
	segfault on discarded .rela.plt section.
	(elf_arc_size_dynamic_sections): Formatting.  Don't call
	arc_create_dynamic_sections.  Don't allocate memory for sections
	handled by the generic linker.  Correct code finding relocs in
	read-only sections.  Set SEC_EXCLUDE on zero size .got,
	.got.plt, and .dynbss sections.  Do set .interp for pies.

2017-02-24  Andrew Waterman  <andrew@sifive.com>

	* elfnn-riscv.c (GP_NAME): New macro.
	(riscv_global_pointer_value): Use it.
	(_bfd_riscv_relax_lui): If symbol and global pointer are in same
	output section, consider only that section's alignment.

2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
	* elfxx-mips.c (_bfd_mips_relax_section): Remove function.
	* elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
	* elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.

2017-02-23  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
	<R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
	or misaligned.

2017-02-23  Alan Modra  <amodra@gmail.com>

	PR 20744
	* elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
	16D relocations.
	(ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
	(ppc_elf_relocate_section): Correct calculation for VLE SDAREL
	relocs.

2017-02-22  Maciej W. Rozycki  <macro@imgtec.com>

	PR ld/20828
	* elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
	processing ahead of the call to `elf_gc_sweep_symbol'.

2017-02-22  Nick Clifton  <nickc@redhat.com>

	PR binutils/21193
	* opncls.c (bfd_create_gnu_debuglink_section): Give the newly
	created section 4-byte alignment.

2017-02-22  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
	on .got or .plt output section being discarded by script.
	* elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise.  Move
	vxworks splt temp.

2017-02-21  Alan Modra  <amodra@gmail.com>

	* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
	DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.

2017-02-20  Alan Modra  <amodra@gmail.com>

	PR 21181
	* elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
	if DT_RELSZ/DT_RELASZ is zero.

2017-02-17  Nick Clifton  <nickc@redhat.com>

	* compress.c (bfd_get_full_section_contents): Remember to reduce
	compressed size by the sizeof the compression header when
	decompressing the contents.

2017-02-17  Pedro Alves  <palves@redhat.com>

	* srec.c (Chunk): Rename to ...
	(_bfd_srec_len): ... this.
	(S3Forced): Rename to ...
	(_bfd_srec_forceS3): ... this.
	* objcopy.c: Adjust all references.

2017-02-17  Pedro Alves  <palves@redhat.com>

	* archive.c (bsd_write_armap): Rename to ...
	(_bfd_bsd_write_armap): ... this.
	(coff_write_armap): Rename to ...
	(_bfd_coff_write_armap): ... this.
	* libbfd-in.h (bsd_write_armap): Rename to ...
	(_bfd_bsd_write_armap): ... this.
	(coff_write_armap): Rename to ...
	(_bfd_coff_write_armap): ... this.
	* aout-target.h, aout-tic30.c: Adjust all users.
	* libbfd.h: Regenerate.

2017-02-17  Pedro Alves  <palves@redhat.com>

	* bfd-in.h (bfd_read, bfd_write): Adjust to rename.
	(warn_deprecated): Rename to ...
	(_bfd_warn_deprecated): ... this.
	* libbfd.c (warn_deprecated): Rename to ...
	(_bfd_warn_deprecated): ... this.
	* bfd-in2.h: Regenerate.

2017-02-17  Pedro Alves  <palves@redhat.com>

	* bfdio.c (real_ftell): Rename to ...
	(_bfd_real_ftell): ... this.
	(real_fseek): Rename to ...
	(_bfd_real_fseek): ... this.
	(real_fopen): Rename to ...
	(_bfd_real_fopen): ... this.
	* libbfd-in.h (real_ftell): Rename to ...
	(_bfd_real_ftell): ... this.
	(real_fseek): Rename to ...
	(_bfd_real_fseek): ... this.
	(real_fopen): Rename to ...
	(_bfd_real_fopen): ... this.
	* cache.c, dwarf2.c, opncls.c: Adjust all callers.
	* libbfd.h: Regenerate.

2017-02-17  Pedro Alves  <palves@redhat.com>

	* dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
	* libbfd.c (read_unsigned_leb128): Rename to ...
	(_bfd_read_unsigned_leb128): ... this.
	(read_signed_leb128): Rename to ...
	(_bfd_read_signed_leb128): ... this.
	(safe_read_leb128): Rename to ...
	(_bfd_safe_read_leb128): ... this.
	* libbfd-in.h (read_unsigned_leb128): Rename to ...
	(_bfd_read_unsigned_leb128): ... this.
	(read_signed_leb128): Rename to ...
	(_bfd_read_signed_leb128): ... this.
	(safe_read_leb128): Rename to ...
	(_bfd_safe_read_leb128): ... this.
	* libbfd.h: Renegerate.

2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>

	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
	before trying to fine matching file and line information.

2017-02-16  Andrew Burgess  <andrew.burgess@embecosm.com>

	* dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
	(_bfd_dwarf2_slurp_debug_info): If stashed debug information does
	not match current bfd, then reload debug information.  Record bfd
	we're loading debug info for in the stash.  If we have debug
	informatin in the cache then perform section placement before
	returning.

2017-02-16  Alan Modra  <amodra@gmail.com>

	PR 21000
	* elf-bfd.h (struct elf_backend_data): Add no_page_alias.
	* elfxx-target.h (elf_backend_no_page_alias): Define.
	(elfNN_bed): Init new field.
	* elf.c (assign_file_positions_for_load_sections): If no_page_alias
	ensure PT_LOAD segment starts on a new page.
	* elf32-hppa.c (elf_backend_no_page_alias): Define.

2017-02-16  Alan Modra  <amodra@gmail.com>

	PR 21132
	* elf32-hppa.c (allocate_plt_static): Allocate space for relocs
	if pic.

2017-02-16  Jiong Wang <jiong.wang@arm.com>

	* bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
	* bfd-in2.h: Regenerated.

2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21168
	* elf32-i386.c (elf_i386_relocate_section): Allow
	"lea foo@GOT, %reg" in PIC.

2017-02-15  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/20244
	* elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
	symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
	error against local IFUNC symbol without a base register for
	PIC.

2017-02-15  Maciej W. Rozycki  <macro@imgtec.com>

	* elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
	`%P: %H:' with `info->callbacks->einfo'.
	(ppc_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
	(ppc64_elf_edit_toc): Likewise.
	(ppc64_elf_relocate_section): Likewise.

2017-02-14  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
	--gc-keep-exported, and test versioned field of sym rather than
	looking for @ in name.

2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>

	* elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
	__global_pointer$.

2017-02-13  Nick Clifton  <nickc@redhat.com>

	PR binutils/21151
	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
	unit length field.

2017-02-07  Andrew Waterman  <andrew@sifive.com>

	* elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
	entry size if PLT header is written.

2017-02-06  Sheldon Lobo  <sheldon.lobo@oracle.com>

	Fix sparc64 dynamic relocation processing to use the dynamic
        symbol count.
	* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
	to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
	should be used.

2017-02-03  Nick Clifton  <nickc@redhat.com>

	PR 21096
	* coffcode.h (coff_write_object_contents): Enlarge size of
	s_name_buf in order to avoid compile time warning about possible
	integer truncation.
	* elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
	32-bits of insn value before printing into buffer.

2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (mips_elf_hash_sort_data): Add
	`max_local_dynindx'.
	(mips_elf_sort_hash_table): Handle it.
	(mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
	symbols bump up `max_local_dynindx' rather than
	`max_non_got_dynindx'.

2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (mips_elf_hash_sort_data): Convert the
	`min_got_dynindx', `max_unref_got_dynindx' and
	`max_non_got_dynindx' members to the `bfd_size_type' data type.
	(mips_elf_sort_hash_table): Adjust accordingly.

2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
	to access the hash table.

2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
	non-NULL `htab' to the beginning.

2017-02-02  Maciej W. Rozycki  <macro@imgtec.com>

	* elflink.c (elf_gc_sweep): Wrap overlong line.

2017-01-30  Maciej W. Rozycki  <macro@imgtec.com>

	* elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
	(_bfd_mips_elf_linker_flags): ... this.  Add another parameter.
	* elfxx-mips.c (mips_elf_link_hash_table): Add
	`ignore_branch_isa' member.
	(mips_elf_perform_relocation): Do not treat an ISA mode mismatch
	in branch relocation calculation as an error if
	`ignore_branch_isa' has been set.
	(_bfd_mips_elf_insn32): Rename to...
	(_bfd_mips_elf_linker_flags): ... this.  Rename the `on'
	parameter to `insn32' and add an `ignore_branch_isa' parameter.
	Handle the new parameter.

2017-01-27  Hans-Peter Nilsson  <hp@axis.com>

	* elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
	local variable dynobj.

	PR ld/20995
	* elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
	(elf_cris_adjust_dynamic_symbol): Place variables copied into the
	executable from read-only sections into sdynrelro.
	(elf_cris_finish_dynamic_symbol): Select sreldynrelro for
	dynamic relocs in sdynrelro.
	(elf_backend_want_dynrelro): Define.

2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* config.bfd (*-*-rtemsaout*): Mark as removed.

2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* config.bfd (powerpcle-*-rtems*): Do not mark as removed.
	(arm-*-rtems*): Move to (arm*-*-eabi*).
	(i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
	(m68-*-rtems*): Move to (m68*-*-elf*).

2017-01-25  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* config.bfd (*-*-rtemscoff*): Mark as removed.

2017-01-24  Maciej W. Rozycki  <macro@imgtec.com>

	PR ld/20828
	* elflink.c (bfd_elf_record_link_assignment): Revert last
	change and don't ever clear `forced_local'.  Set `mark'
	unconditionally.
	(elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
	file.
	(elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
	(bfd_elf_size_dynamic_sections): ... here.
	* elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
	and set `mark' instead in `__tls_get_addr_opt' processing.
	* elf64-ppc.c (ppc64_elf_tls_setup): Likewise.

2017-01-24  Alan Modra  <amodra@gmail.com>

	* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
	where dynamic relocs are preferable.  Allow ifunc too.
	(ensure_undefweak_dynamic): New function.
	(allocate_dynrelocs): Use it here.  Move plt handling last and
	don't make symbols dynamic, simplifying loop.  Only make undef
	weak symbols with GOT entries dynamic.  Correct condition
	for GOT relocs.  Handle dynamic relocs on ifuncs.  Correct
	comments.  Remove goto.
	(ppc_elf_relocate_section): Correct test for using dynamic
	symbol on GOT relocs.  Rearrange test for emitting GOT relocs
	to suit.  Set up explicit tls_index entries and implicit GOT
	tls_index entries resolvable at link time for
	__tls_get_addr_opt.  Simplify test to clear mem for prelink.
	* elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
	(ensure_undefweak_dynamic): New function.
	(allocate_dynrelocs): Use it here.  Only make undef weak symbols
	with GOT entries dynamic.  Remove unnecessary test of
	WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
	(ppc64_elf_relocate_section): Correct test for using dynamic
	symbol on GOT relocs.  Rearrange test for emitting GOT relocs
	to suit.  Set up explicit tls_index entries and implicit GOT
	tls_index entries resolvable at link time for __tls_get_addr_opt.
	Simplify expression to clear mem for prelink.

2017-01-23  Yury Norov  <ynorov@caviumnetworks.com>

	* elfnn-aarch64.c: Fix relaxations for ILP32 mode.

2017-01-20  Jiong Wang <jiong.wang@arm.com>

	* elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
	(elf_backend_hash_symbol): Define.

2017-01-18  Maciej W. Rozycki  <macro@imgtec.com>

	PR ld/20828
	* elflink.c (bfd_elf_record_link_assignment): Clear any
	`forced_local' marking for DSO symbols that are not being
	provided.

2017-01-17  Kuan-Lin Chen  <kuanlinchentw@gmail.com>

	* elfnn-riscv.c (riscv_elf_object_p): New function.

2017-01-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21038
	* elf64-x86-64.c (elf_x86_64_link_hash_table): Add
	plt_bnd_eh_frame.
	(elf_x86_64_check_relocs): Create .eh_frame section for the
	.plt.bnd section.
	(elf_x86_64_size_dynamic_sections): Allocate and initialize
	.eh_frame section for the .plt.bnd section.
	(elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
	for the .plt.bnd section.

2017-01-12  Nick Clifton  <nickc@redhat.com>

	PR binutils/20876
	* opncls.c (find_separate_debug_file): Add include_dirs
	parameter.  Only include the directory part of the bfd's filename
	in search paths if include_dirs is true.  Add a couple of extra
	locations for looking for debug files.
	( bfd_follow_gnu_debuglink): Update invocation of
	find_separate_debug_file.
	(bfd_follow_gnu_debugaltlink): Likewise.
	(get_build_id): New function: Finds the build-id of the given bfd.
	(get_build_id_name): New function: Computes the name of the
	separate debug info file for a bfd, based upon its build-id.
	(check_build_id_file): New function: Checks to see if a separate
	debug info file exists at the given location, and that its
	build-id matches that of the original bfd.
	(bfd_follow_build_id_debuglink): New function: Finds a separate
	debug info file for a given bfd by using the build-id method.
	* dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
	method of locating a separate debug info file before using the
	debuglink method.
	* bfd-in2.h: Regenerate.

2017-01-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/21038
	* elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
	(elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
	elf_x86_64_eh_frame_plt_got.
	(elf_x86_64_size_dynamic_sections): Get unwind info from
	elf_x86_64_bnd_arch_bed for the BND PLT.

2017-01-11  Jeremy Soller  <jackpot51@gmail.com>

	* config.bfd: Add entries for i686-redox and x86_64-redox.

2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
	to 4 bytes.
	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
	.eh_frame section to 4 bytes for x32.
	(elf_x86_64_check_relocs): Likewise.

2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/20830
	* elf32-i386.c (elf_i386_eh_frame_plt_got): New.
	(PLT_GOT_FDE_LENGTH): Likewise.
	(elf_i386_plt_layout): Add eh_frame_plt_got and
	eh_frame_plt_got_size.
	(elf_i386_plt): Updated.
	(elf_i386_link_hash_table): Add plt_got_eh_frame.
	(elf_i386_check_relocs): Create .eh_frame section for .plt.got.
	(elf_i386_size_dynamic_sections): Allocate and initialize
	.eh_frame section for .plt.got.
	(elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
	.plt.got.
	(elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
	eh_frame_plt_got_size.
	* elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
	(PLT_GOT_FDE_LENGTH): Likewise.
	(elf_x86_64_backend_data): Add eh_frame_plt_got and
	eh_frame_plt_got_size.
	(elf_x86_64_arch_bed): Updated.
	(elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
	eh_frame_plt_got_size.
	(elf_x86_64_nacl_arch_bed): Likewise.
	(elf_x86_64_link_hash_table): Add plt_got_eh_frame.
	(elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
	(elf_x86_64_size_dynamic_sections): Allocate and initialize
	.eh_frame section for .plt.got.
	(elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
	for .plt.got.

2017-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	* elf32-i386.c (elf_i386_size_dynamic_sections): Set
	plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.

2017-01-09  Nick Clifton  <nickc@redhat.com>

	* dwarf2.c (lookup_address_in_function_table): Return early if
	there are no functions in the given comp unit, or if the high
	address of the last function in the comp unit is less than the
	desired address.

2017-01-09  Nick Clifton  <nickc@redhat.com>

	PR binutils/21013
	* coffgen.c (_bfd_coff_get_external_symbols): Generate an error
	message if there are too many symbols to load.

2017-01-04  James Clarke  <jrtc27@jrtc27.com>

	* elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
	if relocs are cached.

2017-01-03  Rich Felker  <bugdal@aerifal.cx>

	PR ld/21017
	* elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
	for R_MICROBLAZE_GOTOFF_64.

2017-01-03  Nick Clifton  <nickc@redhat.com>

	* mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
	warning about using a possibly uninitialised variable.

2017-01-02  Alan Modra  <amodra@gmail.com>

	* elf32-hppa.c (ensure_undef_weak_dynamic): New function.
	(allocate_plt_static, allocate_dynrelocs): Use it.

2017-01-02  Alan Modra  <amodra@gmail.com>

	* elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
	.PARISC.unwind section.

2017-01-02  Alan Modra  <amodra@gmail.com>

	PR ld/20989
	* elfxx-sparc.c (gdop_relative_offset_ok): New function.
	(_bfd_sparc_elf_relocate_section): Use it to validate GOT
	indirect to GOT pointer relative code edit.

2017-01-02  Alan Modra  <amodra@gmail.com>

	Update year range in copyright notice of all files.

For older changes see ChangeLog-2016

Copyright (C) 2017 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.

Local Variables:
mode: change-log
left-margin: 8
fill-column: 74
version-control: never
End: