1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
|
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
include $(SRC)/cmd/sgs/Makefile.sub
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2016 RackTop Systems.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
LIBRARY = liblddbg.a
VERS = .4
COMOBJS = args.o audit.o basic.o debug.o \
syminfo.o tls.o
COMOBJS32 = bindings32.o cap32.o dlfcns32.o dynamic32.o \
elf32.o entry32.o files32.o got32.o \
libs32.o map32.o move32.o phdr32.o \
relocate32.o sections32.o segments32.o shdr32.o \
statistics32.o support32.o syms32.o unused32.o \
util32.o version32.o
COMOBJS64 = bindings64.o cap64.o dlfcns64.o dynamic64.o \
elf64.o entry64.o files64.o got64.o \
libs64.o map64.o move64.o phdr64.o \
relocate64.o sections64.o segments64.o shdr64.o \
statistics64.o support64.o syms64.o unused64.o \
util64.o version64.o
BLTOBJ = msg.o
SGSCOMMONOBJ = alist.o
OBJECTS = $(BLTOBJ) $(COMOBJS) $(COMOBJS32) $(COMOBJS64) $(SGSCOMMONOBJ)
include $(SRC)/lib/Makefile.lib
include $(SRC)/lib/Makefile.rootfs
include $(SRC)/cmd/sgs/Makefile.com
LIBS = $(DYNLIB)
# Hammerhead: removed stale COMPATLINKS/COMPATLINKS64 overrides.
# Makefile.rootfs sets correct COMPATLINKS for flattened layout.
SRCDIR = $(SGSHOME)/liblddbg
MAPFILEDIR = $(SRCDIR)/common
CERRWARN += -Wno-unused-value
CERRWARN += $(CNOWARN_UNINIT)
CERRWARN += -Wno-parentheses
CPPFLAGS += -I$(SRC)/lib/libc/inc
DYNFLAGS += $(VERSREF) '-R$$ORIGIN'
# Hammerhead: -ldl needed because libconv (static archive) contains demangle.o
# which calls dlopen/dlsym for C++ symbol demangling
LDLIBS += $(CONVLIBDIR) -lconv -ldl -lc
BLTDEFS = msg.h
BLTDATA = msg.c
BLTMESG = $(SGSMSGDIR)/liblddbg
BLTFILES = $(BLTDEFS) $(BLTDATA) $(BLTMESG)
SGSMSGCOM = $(SRCDIR)/common/liblddbg.msg
SGSMSGALL = $(SGSMSGCOM)
SGSMSGTARG = $(SGSMSGCOM)
SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) -m $(BLTMESG) -n liblddbg_msg
CHKSRCS = $(COMOBJS32:%32.o=$(SRCDIR)/common/%.c)
LIBSRCS = $(COMOBJS:%.o=$(SRCDIR)/common/%.c) \
$(SGSCOMMONOBJ:%.o=$(SGSCOMMON)/%.c) $(BLTDATA)
CLEANFILES += $(BLTFILES)
CLOBBERFILES += $(DYNLIB) $(LIBLINKS)
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright 2016 RackTop Systems.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
pics/%.o: $(SRCDIR)/common/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
pics/%.o: $(SGSCOMMON)/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
pics/%32.o: $(SRCDIR)/common/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
pics/%64.o: $(SRCDIR)/common/%.c
$(COMPILE.c) -D_ELF64 -o $@ $<
$(POST_PROCESS_O)
$(LIBLINKS):
-$(RM) $@; $(SYMLINK) $(DYNLIB) $@
$(PICS): pics
include $(SRC)/lib/Makefile.targ
# Derived source and header files (messaging).
catalog: $(BLTMESG)
chkmsg: $(LIBSRCS) $(CHKSRCS)
sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS) $(CHKSRCS)
# Hammerhead: Ensure messages directory exists, use grouped target syntax
$(SGSMSGDIR):
$(MKDIR) -p $@
$(BLTDEFS) $(BLTDATA) $(BLTMESG) &: $(SGSMSGALL) | $(SGSMSGDIR)
$(SGSMSG) $(SGSMSGFLAGS) $(SGSMSGALL)
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include ../Makefile.com
CONVLIBDIR = $(CONVLIBDIR64)
.KEEP_STATE:
$(ROOTFS_DYNLIB64) : FILEMODE= 755
all: $(DYNLIB) $(LIBLINKS)
install: all $(ROOTLIBS64) $(ROOTCOMPATLINKS64)
include ../Makefile.targ
include $(SRC)/Makefile.master.64
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DEBUG_DOT_H
#define _DEBUG_DOT_H
#include <debug.h>
#include <conv.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Debugging is enabled by various tokens (see debug.c) that result in an
* internal bit mask (d_class) being initialized. Each debugging function is
* appropriate for one or more of the classes specified by the bit mask. Each
* debugging function validates whether it is appropriate for the present
* classes before printing anything.
*/
#define DBG_NOTCLASS(c) !(dbg_desc->d_class & (c))
#define DBG_C_ARGS 0x00000001
#define DBG_C_AUDITING 0x00000002
#define DBG_C_BASIC 0x00000004
#define DBG_C_BINDINGS 0x00000008
#define DBG_C_CAP 0x00000010
#define DBG_C_DEMANGLE 0x00000020
#define DBG_C_ENTRY 0x00000040
#define DBG_C_FILES 0x00000080
#define DBG_C_GOT 0x00000100
#define DBG_C_INIT 0x00000200
#define DBG_C_LIBS 0x00000400
#define DBG_C_MAP 0x00000800
#define DBG_C_MOVE 0x00001000
#define DBG_C_RELOC 0x00002000
#define DBG_C_SECTIONS 0x00004000
#define DBG_C_SEGMENTS 0x00008000
#define DBG_C_STATS 0x00010000
#define DBG_C_STRTAB 0x00020000
#define DBG_C_SUPPORT 0x00040000
#define DBG_C_SYMBOLS 0x00080000
#define DBG_C_TLS 0x00100000
#define DBG_C_UNUSED 0x00200000
#define DBG_C_VERSIONS 0x00400000
#define DBG_C_DL 0x00800000
#define DBG_C_ALL 0xffffffff
typedef struct {
const char *o_name; /* command line argument name */
uint_t o_class; /* associated class for this name */
uint_t o_extra; /* associated extra for this name */
} DBG_options;
#define AL_CNT_DEBUG 4
/*
* Some Dbg_*() format strings differ depending on whether they are used for
* 32-bit or 64-bit values.
*/
#if defined(_ELF64)
#define MSG_EDATA_TITLE MSG_EDATA_TITLE_64
#define MSG_EDATA_ENTRY MSG_EDATA_ENTRY_64
#else
#define MSG_EDATA_TITLE MSG_EDATA_TITLE_32
#define MSG_EDATA_ENTRY MSG_EDATA_ENTRY_32
#endif
/*
* Some Elf_*() format strings differ depending on whether they are used for
* 32-bit or 64-bit values.
*/
#if defined(_ELF64)
#define MSG_DL_IPHDR_ADDR MSG_DL_IPHDR_ADDR_64
#define MSG_DL_IPHDR_PHDR MSG_DL_IPHDR_PHDR_64
#define MSG_GOT_TITLE MSG_GOT_TITLE_64
#define MSG_GOT_ENTRY_RE MSG_GOT_ENTRY_RE_64
#define MSG_GOT_ENTRY_NR MSG_GOT_ENTRY_NR_64
#define MSG_GOT_COLUMNS1 MSG_GOT_COLUMNS1_64
#define MSG_GOT_COLUMNS2 MSG_GOT_COLUMNS2_64
#define MSG_GOT_FORMAT1 MSG_GOT_FORMAT1_64
#define MSG_GOT_FORMAT2 MSG_GOT_FORMAT2_64
#define MSG_PHD_VADDR MSG_PHD_VADDR_64
#define MSG_PHD_PADDR MSG_PHD_PADDR_64
#define MSG_PHD_FILESZ MSG_PHD_FILESZ_64
#define MSG_PHD_OFFSET MSG_PHD_OFFSET_64
#define MSG_REL_EFSA_TITLE MSG_REL_EFSA_TITLE_64
#define MSG_REL_EFLA_TITLE MSG_REL_EFLA_TITLE_64
#define MSG_REL_EFSN_TITLE MSG_REL_EFSN_TITLE_64
#define MSG_REL_EFLN_TITLE MSG_REL_EFLN_TITLE_64
#define MSG_REL_EFSA_ENTRY MSG_REL_EFSA_ENTRY_64
#define MSG_REL_EFLA_ENTRY MSG_REL_EFLA_ENTRY_64
#define MSG_REL_EFSN_ENTRY MSG_REL_EFSN_ENTRY_64
#define MSG_REL_EFLN_ENTRY MSG_REL_EFLN_ENTRY_64
#define MSG_REL_RT_APLREG MSG_REL_RT_APLREG_64
#define MSG_REL_RT_APLVAL MSG_REL_RT_APLVAL_64
#define MSG_REL_RTA_TITLE MSG_REL_RTA_TITLE_64
#define MSG_REL_RTN_TITLE MSG_REL_RTN_TITLE_64
#define MSG_REL_RTV_TITLE MSG_REL_RTV_TITLE_64
#define MSG_REL_RTA_ENTRY MSG_REL_RTA_ENTRY_64
#define MSG_REL_RTN_ENTRY MSG_REL_RTN_ENTRY_64
#define MSG_REL_LDSA_TITLE MSG_REL_LDSA_TITLE_64
#define MSG_REL_LDSN_TITLE MSG_REL_LDSN_TITLE_64
#define MSG_REL_LDSA_ENTRY MSG_REL_LDSA_ENTRY_64
#define MSG_REL_LDSN_ENTRY MSG_REL_LDSN_ENTRY_64
#define MSG_REL_LDSV_TITLE MSG_REL_LDSV_TITLE_64
#define MSG_REL_LDSV_ENTRY MSG_REL_LDSV_ENTRY_64
#define MSG_REL_LDLA_TITLE MSG_REL_LDLA_TITLE_64
#define MSG_REL_LDLN_TITLE MSG_REL_LDLN_TITLE_64
#define MSG_REL_LDLA_ENTRY MSG_REL_LDLA_ENTRY_64
#define MSG_REL_LDLN_ENTRY MSG_REL_LDLN_ENTRY_64
#define MSG_REL_LDLV_TITLE MSG_REL_LDLV_TITLE_64
#define MSG_REL_LDLV_ENTRY MSG_REL_LDLV_ENTRY_64
#define MSG_SHD_ADDR MSG_SHD_ADDR_64
#define MSG_SHD_SIZE MSG_SHD_SIZE_64
#define MSG_SHD_OFFSET MSG_SHD_OFFSET_64
#define MSG_SHD_OFFSET_ENT MSG_SHD_OFFSET_ENT_64
#define MSG_SHD_ALIGN MSG_SHD_ALIGN_64
#define MSG_SHD_LINK MSG_SHD_LINK_64
#define MSG_SYM_EFS_ENTRY MSG_SYM_EFS_ENTRY_64
#define MSG_SYM_EFL_ENTRY MSG_SYM_EFL_ENTRY_64
#define MSG_SYM_EFS_TITLE MSG_SYM_EFS_TITLE_64
#define MSG_SYM_EFL_TITLE MSG_SYM_EFL_TITLE_64
#define MSG_SYM_LDS_TITLE MSG_SYM_LDS_TITLE_64
#define MSG_SYM_LDL_TITLE MSG_SYM_LDL_TITLE_64
#else
#define MSG_DL_IPHDR_ADDR MSG_DL_IPHDR_ADDR_32
#define MSG_DL_IPHDR_PHDR MSG_DL_IPHDR_PHDR_32
#define MSG_GOT_TITLE MSG_GOT_TITLE_32
#define MSG_GOT_ENTRY_RE MSG_GOT_ENTRY_RE_32
#define MSG_GOT_ENTRY_NR MSG_GOT_ENTRY_NR_32
#define MSG_GOT_COLUMNS1 MSG_GOT_COLUMNS1_32
#define MSG_GOT_COLUMNS2 MSG_GOT_COLUMNS2_32
#define MSG_GOT_FORMAT1 MSG_GOT_FORMAT1_32
#define MSG_GOT_FORMAT2 MSG_GOT_FORMAT2_32
#define MSG_PHD_VADDR MSG_PHD_VADDR_32
#define MSG_PHD_PADDR MSG_PHD_PADDR_32
#define MSG_PHD_FILESZ MSG_PHD_FILESZ_32
#define MSG_PHD_OFFSET MSG_PHD_OFFSET_32
#define MSG_REL_EFSA_TITLE MSG_REL_EFSA_TITLE_32
#define MSG_REL_EFLA_TITLE MSG_REL_EFLA_TITLE_32
#define MSG_REL_EFSN_TITLE MSG_REL_EFSN_TITLE_32
#define MSG_REL_EFLN_TITLE MSG_REL_EFLN_TITLE_32
#define MSG_REL_EFSA_ENTRY MSG_REL_EFSA_ENTRY_32
#define MSG_REL_EFLA_ENTRY MSG_REL_EFLA_ENTRY_32
#define MSG_REL_EFSN_ENTRY MSG_REL_EFSN_ENTRY_32
#define MSG_REL_EFLN_ENTRY MSG_REL_EFLN_ENTRY_32
#define MSG_REL_RT_APLREG MSG_REL_RT_APLREG_32
#define MSG_REL_RT_APLVAL MSG_REL_RT_APLVAL_32
#define MSG_REL_RTA_TITLE MSG_REL_RTA_TITLE_32
#define MSG_REL_RTN_TITLE MSG_REL_RTN_TITLE_32
#define MSG_REL_RTV_TITLE MSG_REL_RTV_TITLE_32
#define MSG_REL_RTA_ENTRY MSG_REL_RTA_ENTRY_32
#define MSG_REL_RTN_ENTRY MSG_REL_RTN_ENTRY_32
#define MSG_REL_LDSA_TITLE MSG_REL_LDSA_TITLE_32
#define MSG_REL_LDSN_TITLE MSG_REL_LDSN_TITLE_32
#define MSG_REL_LDSA_ENTRY MSG_REL_LDSA_ENTRY_32
#define MSG_REL_LDSN_ENTRY MSG_REL_LDSN_ENTRY_32
#define MSG_REL_LDSV_TITLE MSG_REL_LDSV_TITLE_32
#define MSG_REL_LDSV_ENTRY MSG_REL_LDSV_ENTRY_32
#define MSG_REL_LDLA_TITLE MSG_REL_LDLA_TITLE_32
#define MSG_REL_LDLN_TITLE MSG_REL_LDLN_TITLE_32
#define MSG_REL_LDLA_ENTRY MSG_REL_LDLA_ENTRY_32
#define MSG_REL_LDLN_ENTRY MSG_REL_LDLN_ENTRY_32
#define MSG_REL_LDLV_TITLE MSG_REL_LDLV_TITLE_32
#define MSG_REL_LDLV_ENTRY MSG_REL_LDLV_ENTRY_32
#define MSG_SHD_ADDR MSG_SHD_ADDR_32
#define MSG_SHD_SIZE MSG_SHD_SIZE_32
#define MSG_SHD_OFFSET MSG_SHD_OFFSET_32
#define MSG_SHD_OFFSET_ENT MSG_SHD_OFFSET_ENT_32
#define MSG_SHD_ALIGN MSG_SHD_ALIGN_32
#define MSG_SHD_LINK MSG_SHD_LINK_32
#define MSG_SYM_EFS_ENTRY MSG_SYM_EFS_ENTRY_32
#define MSG_SYM_EFL_ENTRY MSG_SYM_EFL_ENTRY_32
#define MSG_SYM_EFS_TITLE MSG_SYM_EFS_TITLE_32
#define MSG_SYM_EFL_TITLE MSG_SYM_EFL_TITLE_32
#define MSG_SYM_LDS_TITLE MSG_SYM_LDS_TITLE_32
#define MSG_SYM_LDL_TITLE MSG_SYM_LDL_TITLE_32
#endif
#define INDEX_STR_SIZE 10
/*
* Buffer used by dbg_isec_name() to format input section
* names. The size was selected to satisfy two opposing
* constraints:
* - To be large enough to handle the largest C++ mangled name.
* Although we can malloc buffers, we don't want that to happen.
* - To be small enough on the thread stack to not cause problems.
*/
typedef char dbg_isec_name_buf_t[INDEX_STR_SIZE + 2048];
#if defined(_ELF64)
#define dbg_fmt_isec_name dbg64_fmt_isec_name
#define dbg_fmt_isec_name2 dbg64_fmt_isec_name2
#else
#define dbg_fmt_isec_name dbg32_fmt_isec_name
#define dbg_fmt_isec_name2 dbg32_fmt_isec_name2
#endif
extern const char *dbg_fmt_isec_name(Is_desc *, dbg_isec_name_buf_t,
char **);
extern const char *dbg_fmt_isec_name2(const char *, Word,
dbg_isec_name_buf_t, char **);
#ifdef __cplusplus
}
#endif
#endif /* _DEBUG_DOT_H */
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <debug.h>
#include "_debug.h"
#include "msg.h"
void
Dbg_args_option(Lm_list *lml, int ndx, int c, char *optarg)
{
if (DBG_NOTCLASS(DBG_C_ARGS))
return;
if (optarg)
dbg_print(lml, MSG_INTL(MSG_ARG_OPTARG), ndx, c, optarg);
else
dbg_print(lml, MSG_INTL(MSG_ARG_OPTION), ndx, c);
}
void
Dbg_args_str2chr(Lm_list *lml, int ndx, const char *opt, int c)
{
if (DBG_NOTCLASS(DBG_C_ARGS))
return;
dbg_print(lml, MSG_INTL(MSG_ARG_STR2CHR), ndx, opt, c);
}
void
Dbg_args_Wldel(Lm_list *lml, int ndx, const char *opt)
{
if (DBG_NOTCLASS(DBG_C_ARGS))
return;
dbg_print(lml, MSG_INTL(MSG_ARG_WLDEL), ndx, opt);
}
void
Dbg_args_file(Lm_list *lml, int ndx, char *file)
{
if (DBG_NOTCLASS(DBG_C_ARGS))
return;
dbg_print(lml, MSG_INTL(MSG_ARG_FILE), ndx, file);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <dlfcn.h>
#include <stdio.h>
#include "_debug.h"
#include "msg.h"
#include "libld.h"
void
Dbg_audit_lib(Rt_map *clmp, const char *lib, int type)
{
Lm_list *clml = LIST(clmp);
const char *str;
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
Dbg_util_nl(clml, DBG_NL_STD);
switch (type) {
case DBG_AUD_PRELOAD:
str = MSG_ORIG(MSG_AUD_PRELOAD);
break;
case DBG_AUD_GLOBAL:
str = MSG_ORIG(MSG_AUD_GLOBAL);
break;
case DBG_AUD_LOCAL:
/* FALLTHROUGH */
default:
str = MSG_ORIG(MSG_STR_EMPTY);
}
dbg_print(clml, MSG_INTL(MSG_AUD_LIB), lib, NAME(clmp), str);
}
void
Dbg_audit_interface(Lm_list *lml, const char *lib, const char *interface)
{
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
dbg_print(lml, MSG_INTL(MSG_AUD_INTERFACE), lib, interface);
}
void
Dbg_audit_version(Lm_list *lml, const char *lib, uint_t overs, uint_t nvers)
{
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
dbg_print(lml, MSG_INTL(MSG_AUD_VERSION), lib, overs, nvers);
}
void
Dbg_audit_activity(Lm_list *lml, const char *lib, const char *obj, uint_t flags)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_ACTIVITY), lib, obj,
conv_la_activity(flags, CONV_FMT_ALT_DEFAULT, &inv_buf));
}
void
Dbg_audit_preinit(Lm_list *lml, const char *lib, const char *obj)
{
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_PREINIT), lib, obj);
}
void
Dbg_audit_objsearch(Lm_list *lml, int call, const char *lib,
const char *oobj, uint_t flags, const char *nobj)
{
Conv_la_search_buf_t la_search_buf;
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
if (call == DBG_AUD_CALL) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_OBJSEARCH), lib, oobj,
conv_la_search(flags, &la_search_buf));
} else {
if (nobj)
dbg_print(lml, MSG_INTL(MSG_AUD_OBJSEARCH_R), lib,
oobj, nobj);
else
dbg_print(lml, MSG_INTL(MSG_AUD_OBJSEARCH_S), lib,
oobj);
}
}
void
Dbg_audit_objfilter(Lm_list *lml, int call, const char *lib,
const char *filter, const char *filtee, const char *ref)
{
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
if (call == DBG_AUD_CALL) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_OBJFILTER), lib, filter,
filtee, ref);
} else
dbg_print(lml, MSG_INTL(MSG_AUD_OBJFILTER_R), lib, filter);
}
void
Dbg_audit_objopen(Lm_list *lml, int call, const char *lib, const char *obj,
uint_t flags, Boolean ignore)
{
Conv_la_bind_buf_t la_bind_buf;
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
if (call == DBG_AUD_CALL) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_OBJOPEN), lib, obj);
} else {
if (ignore)
dbg_print(lml, MSG_INTL(MSG_AUD_OBJOPEN_RI), lib, obj,
conv_la_bind(flags, &la_bind_buf));
else
dbg_print(lml, MSG_INTL(MSG_AUD_OBJOPEN_R), lib, obj,
conv_la_bind(flags, &la_bind_buf));
}
}
void
Dbg_audit_objclose(Lm_list *lml, const char *lib, const char *obj)
{
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_OBJCLOSE), lib, obj);
}
void
Dbg_audit_symbind(Lm_list *lml, int call, const char *lib, const char *name,
Addr value, uint_t flags)
{
Conv_la_symbind_buf_t la_symbind_buf;
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
if (call == DBG_AUD_CALL) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_SYMBIND), lib, name,
EC_XWORD(value), conv_la_symbind(flags, &la_symbind_buf));
} else {
dbg_print(lml, MSG_INTL(MSG_AUD_SYMBIND_R), lib, name,
EC_XWORD(value), conv_la_symbind(flags, &la_symbind_buf));
}
}
void
Dbg_audit_pltenter(Lm_list *lml, int call, const char *lib, const char *name,
Addr value)
{
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
if (call == DBG_AUD_CALL) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_AUD_PLTENTER), lib, name,
EC_XWORD(value));
} else {
dbg_print(lml, MSG_INTL(MSG_AUD_PLTENTER_R), lib, name,
EC_XWORD(value));
}
}
void
Dbg_audit_pltexit(Lm_list *lml, const char *lib, const char *name)
{
if (DBG_NOTCLASS(DBG_C_AUDITING))
return;
dbg_print(lml, MSG_INTL(MSG_AUD_PLTEXIT), lib, name);
}
void
Dbg_audit_skip(Lm_list *lml, const char *name, const char *lmid)
{
if (DBG_NOTCLASS(DBG_C_AUDITING | DBG_C_FILES))
return;
dbg_print(lml, MSG_INTL(MSG_AUD_SKIP), name, lmid);
}
void
Dbg_audit_terminate(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
dbg_print(lml, MSG_INTL(MSG_AUD_TERM), name);
}
void
Dbg_audit_ignore(Rt_map *lmp)
{
if (DBG_NOTCLASS(DBG_C_AUDITING | DBG_C_FILES))
return;
dbg_print(LIST(lmp), MSG_INTL(MSG_AUD_IGNORE), NAME(lmp));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <debug.h>
#include "_debug.h"
#include "msg.h"
/*
* This file contains a number of simple title interfaces, that give a basic
* trace of a link-edit. These interfaces cross several functional boundaries,
* but are consolidated here to ensure consistent use of the DBG_C_BASIC and
* DBG_NOTTIME macros.
*/
void
Dbg_basic_collect(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_BASIC) && DBG_NOTTIME())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_BASIC_COLLECT));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_basic_create(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_BASIC) && DBG_NOTTIME())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_BASIC_CREATE));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_basic_files(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_BASIC) && DBG_NOTTIME())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_BASIC_FILES));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_basic_finish(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_BASIC) && DBG_NOTTIME())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_BASIC_FINISHED));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_basic_options(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_BASIC) && DBG_NOTTIME())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_BASIC_OPTIONS));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_basic_relocate(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_BASIC) && DBG_NOTTIME())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_BASIC_RELOCATE));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_basic_validate(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_BASIC) && DBG_NOTTIME())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_BASIC_VALIDATE));
Dbg_util_nl(lml, DBG_NL_STD);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/types.h>
#include <string.h>
#include <debug.h>
#include <conv.h>
#include "_debug.h"
#include "msg.h"
void
Dbg_bind_plt_summary(Lm_list *lml, Half mach, Word pltcnt21d, Word pltcnt24d,
Word pltcntu32, Word pltcntu44, Word pltcntfull, Word pltcntfar)
{
Word plttotal = pltcnt21d + pltcnt24d + pltcntu32 +
pltcntu44 + pltcntfull + pltcntfar;
if (DBG_NOTCLASS(DBG_C_BINDINGS))
return;
switch (mach) {
case EM_SPARC:
dbg_print(lml, MSG_INTL(MSG_BND_PSUM_SPARC), EC_WORD(pltcnt21d),
EC_WORD(pltcnt24d), EC_WORD(pltcntfull), EC_WORD(plttotal));
break;
case EM_SPARCV9:
dbg_print(lml, MSG_INTL(MSG_BND_PSUM_SPARCV9),
EC_WORD(pltcnt21d), EC_WORD(pltcnt24d), EC_WORD(pltcntu32),
EC_WORD(pltcntu44), EC_WORD(pltcntfull), EC_WORD(pltcntfar),
EC_WORD(plttotal));
break;
default:
dbg_print(lml, MSG_INTL(MSG_BND_PSUM_DEFAULT),
EC_WORD(plttotal));
break;
};
}
static const char *pltbindtypes[PLT_T_NUM] = {
MSG_ORIG(MSG_STR_EMPTY), /* PLT_T_NONE */
MSG_ORIG(MSG_PLT_21D), /* PLT_T_21D */
MSG_ORIG(MSG_PLT_24D), /* PLT_T_24D */
MSG_ORIG(MSG_PLT_U32), /* PLT_T_U32 */
MSG_ORIG(MSG_PLT_U44), /* PLT_T_U44 */
MSG_ORIG(MSG_PLT_FULL), /* PLT_T_FULL */
MSG_ORIG(MSG_PLT_FAR) /* PLT_T_FAR */
};
#define BINFOSZ MSG_BINFO_START_SIZE + \
MSG_BINFO_DIRECT_SIZE + MSG_BINFO_SEP_SIZE + \
MSG_BINFO_INTERPOSE_SIZE + MSG_BINFO_SEP_SIZE + \
MSG_BINFO_COPYREF_SIZE + MSG_BINFO_SEP_SIZE + \
MSG_BINFO_FILTEE_SIZE + MSG_BINFO_SEP_SIZE + \
MSG_BINFO_PLTADDR_SIZE + \
CONV_INV_BUFSIZE + MSG_BINFO_END_SIZE
void
Dbg_bind_global(Rt_map *flmp, Addr fabs, Off foff, Xword pltndx,
Pltbindtype pbtype, Rt_map *tlmp, Addr tabs, Off toff,
const char *sym, uint_t binfo)
{
/*
* MSG_ORIG(MSG_BINFO_DIRECT)
* MSG_ORIG(MSG_BINFO_INTERPOSE)
* MSG_ORIG(MSG_BINFO_COPYREF)
* MSG_ORIG(MSG_BINFO_FILTEE)
* MSG_ORIG(MSG_BINFO_PLTADDR)
*/
static char binfostr[BINFOSZ];
static Val_desc vda[] = {
{ DBG_BINFO_DIRECT, MSG_BINFO_DIRECT },
{ DBG_BINFO_INTERPOSE, MSG_BINFO_INTERPOSE },
{ DBG_BINFO_COPYREF, MSG_BINFO_COPYREF },
{ DBG_BINFO_FILTEE, MSG_BINFO_FILTEE },
{ DBG_BINFO_PLTADDR, MSG_BINFO_PLTADDR },
{ 0, 0 }
};
static CONV_EXPN_FIELD_ARG conv_arg = { binfostr, sizeof (binfostr),
NULL, 0, 0, MSG_ORIG(MSG_BINFO_START),
MSG_ORIG(MSG_BINFO_SEP), MSG_ORIG(MSG_BINFO_END) };
const char *ffile = NAME(flmp);
const char *tfile = NAME(tlmp);
Lm_list *lml = LIST(flmp);
if (DBG_NOTCLASS(DBG_C_BINDINGS))
return;
if (DBG_NOTDETAIL()) {
dbg_print(lml, MSG_INTL(MSG_BND_BASIC), ffile, tfile,
Dbg_demangle_name(sym));
return;
}
/*
* Determine if this binding has any associated information, such as
* interposition, direct binding, copy-relocations, etc.
*/
binfo &= ~DBG_BINFO_FOUND;
binfo &= DBG_BINFO_MSK;
if (binfo) {
conv_arg.oflags = conv_arg.rflags = binfo;
(void) conv_expn_field(&conv_arg, vda, 0);
} else {
binfostr[0] = '\0';
}
if (pltndx != (Xword)-1) {
const char *pltstring;
if (pbtype < PLT_T_NUM)
pltstring = pltbindtypes[pbtype];
else
pltstring = pltbindtypes[PLT_T_NONE];
/*
* Called from a plt offset.
*/
dbg_print(lml, MSG_INTL(MSG_BND_PLT), ffile, EC_ADDR(fabs),
EC_OFF(foff), EC_XWORD(pltndx), pltstring, tfile,
EC_ADDR(tabs), EC_OFF(toff), Dbg_demangle_name(sym),
binfostr);
} else if ((fabs == 0) && (foff == 0)) {
/*
* Called from a dlsym(). We're not performing a relocation,
* but are handing the address of the symbol back to the user.
*/
dbg_print(lml, MSG_INTL(MSG_BND_DLSYM), ffile, tfile,
EC_ADDR(tabs), EC_OFF(toff), Dbg_demangle_name(sym),
binfostr);
} else {
/*
* Standard relocation.
*/
dbg_print(lml, MSG_INTL(MSG_BND_DEFAULT), ffile, EC_ADDR(fabs),
EC_OFF(foff), tfile, EC_ADDR(tabs), EC_OFF(toff),
Dbg_demangle_name(sym), binfostr);
}
}
void
Dbg_bind_reject(Rt_map *flmp, Rt_map *tlmp, const char *sym, int why)
{
static Msg reason[DBG_BNDREJ_NUM + 1] = {
MSG_BNDREJ_DIRECT, /* MSG_INTL(MSG_BNDREJ_DIRECT) */
MSG_BNDREJ_GROUP, /* MSG_INTL(MSG_BNDREJ_GROUP) */
MSG_BNDREJ_SINGLE /* MSG_INTL(MSG_BNDREJ_SINGLE) */
};
if (DBG_NOTCLASS(DBG_C_BINDINGS))
return;
dbg_print(LIST(flmp), MSG_INTL(MSG_BND_REJECT), NAME(flmp), NAME(tlmp),
sym, MSG_INTL(reason[why]));
}
void
Dbg_bind_weak(Rt_map *flmp, Addr fabs, Addr frel, const char *sym)
{
Lm_list *lml = LIST(flmp);
const char *ffile = NAME(flmp);
if (DBG_NOTCLASS(DBG_C_BINDINGS))
return;
if (DBG_NOTDETAIL())
dbg_print(lml, MSG_INTL(MSG_BND_WEAK_1), ffile,
Dbg_demangle_name(sym));
else
dbg_print(lml, MSG_INTL(MSG_BND_WEAK_2), ffile, EC_ADDR(fabs),
EC_ADDR(frel), Dbg_demangle_name(sym));
}
#if defined(_ELF64)
void
Dbg_bind_pltpad_to(Rt_map *lmp, Addr pltpad, const char *dfile,
const char *sname)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(LIST(lmp), MSG_INTL(MSG_BND_PLTPAD_TO), EC_ADDR(pltpad),
NAME(lmp), dfile, sname);
}
void
Dbg_bind_pltpad_from(Rt_map *lmp, Addr pltpad, const char *sname)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(LIST(lmp), MSG_INTL(MSG_BND_PLTPAD_FROM), EC_ADDR(pltpad),
NAME(lmp), sname);
}
#endif
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2022 Oxide Computer Company
*/
#include <stdio.h>
#include <debug.h>
#include <libld.h>
#include <conv.h>
#include "msg.h"
#include "_debug.h"
void
Dbg_cap_candidate(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_CAP | DBG_C_FILES))
return;
dbg_print(lml, MSG_INTL(MSG_CAP_CANDIDATE), name);
}
void
Dbg_cap_filter(Lm_list *lml, const char *dir, Rt_map *flmp)
{
if (DBG_NOTCLASS(DBG_C_CAP | DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
if (flmp)
dbg_print(lml, MSG_INTL(MSG_CAP_FILTER_1), dir, NAME(flmp));
else
dbg_print(lml, MSG_INTL(MSG_CAP_FILTER_2), dir);
}
void
Dbg_cap_identical(Lm_list *lml, const char *file1, const char *file2)
{
if (DBG_NOTCLASS(DBG_C_CAP | DBG_C_FILES))
return;
dbg_print(lml, MSG_INTL(MSG_CAP_IDENTICAL), file1, file2);
}
void
Dbg_cap_val(Lm_list *lml, Syscapset *sys, Syscapset *alt, Half mach)
{
Conv_cap_val_buf_t cap_val_buf;
if ((sys->sc_plat == NULL) && (sys->sc_mach == NULL) &&
(sys->sc_hw_2 == 0) && (sys->sc_hw_1 == 0) &&
(sys->sc_sf_1 == 0))
return;
Dbg_util_nl(lml, DBG_NL_FRC);
/*
* Print any capabilities in precedence order.
*/
if (sys->sc_plat) {
dbg_print(lml, MSG_INTL(MSG_CAP_SYS_PLAT), sys->sc_plat);
}
if (sys->sc_mach) {
dbg_print(lml, MSG_INTL(MSG_CAP_SYS_MACH), sys->sc_mach);
}
if (sys->sc_hw_3) {
dbg_print(lml, MSG_INTL(MSG_CAP_SYS_HW_3),
conv_cap_val_hw3(sys->sc_hw_3, mach, 0,
&cap_val_buf.cap_val_hw3_buf));
}
if (sys->sc_hw_2) {
dbg_print(lml, MSG_INTL(MSG_CAP_SYS_HW_2),
conv_cap_val_hw2(sys->sc_hw_2, mach, 0,
&cap_val_buf.cap_val_hw2_buf));
}
if (sys->sc_hw_1) {
dbg_print(lml, MSG_INTL(MSG_CAP_SYS_HW_1),
conv_cap_val_hw1(sys->sc_hw_1, mach, 0,
&cap_val_buf.cap_val_hw1_buf));
}
if (sys->sc_sf_1) {
dbg_print(lml, MSG_INTL(MSG_CAP_SYS_SF_1),
conv_cap_val_sf1(sys->sc_sf_1, mach, 0,
&cap_val_buf.cap_val_sf1_buf));
}
if (alt != sys) {
Dbg_util_nl(lml, DBG_NL_FRC);
if (alt->sc_plat != sys->sc_plat) {
dbg_print(lml, MSG_INTL(MSG_CAP_ALT_PLAT),
alt->sc_plat);
}
if (alt->sc_mach != sys->sc_mach) {
dbg_print(lml, MSG_INTL(MSG_CAP_ALT_MACH),
alt->sc_mach);
}
if (alt->sc_hw_3 != sys->sc_hw_3) {
dbg_print(lml, MSG_INTL(MSG_CAP_ALT_HW_3),
conv_cap_val_hw3(alt->sc_hw_3, mach, 0,
&cap_val_buf.cap_val_hw3_buf));
}
if (alt->sc_hw_2 != sys->sc_hw_2) {
dbg_print(lml, MSG_INTL(MSG_CAP_ALT_HW_2),
conv_cap_val_hw2(alt->sc_hw_2, mach, 0,
&cap_val_buf.cap_val_hw2_buf));
}
if (alt->sc_hw_1 != sys->sc_hw_1) {
dbg_print(lml, MSG_INTL(MSG_CAP_ALT_HW_1),
conv_cap_val_hw1(alt->sc_hw_1, mach, 0,
&cap_val_buf.cap_val_hw1_buf));
}
if (alt->sc_sf_1 != sys->sc_sf_1) {
dbg_print(lml, MSG_INTL(MSG_CAP_ALT_SF_1),
conv_cap_val_sf1(alt->sc_sf_1, mach, 0,
&cap_val_buf.cap_val_sf1_buf));
}
}
Dbg_util_nl(lml, DBG_NL_FRC);
}
/*
* This version takes a pointer to a Capmask, and will report the exclusion
* bits if they exist.
*/
void
Dbg_cap_ptr_entry(Lm_list *lml, dbg_state_t dbg_state, Xword tag,
const char *ptr)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_CAP))
return;
dbg_print(lml, MSG_INTL(MSG_CAP_SEC_ENTRY), Dbg_state_str(dbg_state),
conv_cap_tag(tag, 0, &inv_buf), ptr);
}
/*
* This version takes a pointer to a CapMask, and will report the exclusion
* bits if they exist.
*/
void
Dbg_cap_val_entry(Lm_list *lml, dbg_state_t dbg_state, Xword tag, Xword val,
Half mach)
{
Conv_inv_buf_t inv_buf;
Conv_cap_val_buf_t cap_val_buf;
if (DBG_NOTCLASS(DBG_C_CAP))
return;
dbg_print(lml, MSG_INTL(MSG_CAP_SEC_ENTRY), Dbg_state_str(dbg_state),
conv_cap_tag(tag, 0, &inv_buf), conv_cap_val(tag, val, mach, 0,
&cap_val_buf));
}
void
Dbg_cap_sec_title(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_CAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_CAP_SEC_TITLE), name);
}
void
Dbg_cap_mapfile_title(Lm_list *lml, Lineno lineno)
{
if (DBG_NOTCLASS(DBG_C_MAP | DBG_C_CAP))
return;
dbg_print(lml, MSG_INTL(MSG_MAP_CAP), EC_LINENO(lineno));
}
void
Dbg_cap_id(Lm_list *lml, Lineno lineno, const char *oid, const char *nid)
{
Dbg_cap_mapfile_title(lml, lineno);
Dbg_cap_ptr_entry(lml, DBG_STATE_CURRENT, CA_SUNW_ID, oid);
Dbg_cap_ptr_entry(lml, DBG_STATE_NEW, CA_SUNW_ID, nid);
Dbg_cap_ptr_entry(lml, DBG_STATE_RESOLVED, CA_SUNW_ID, nid);
}
void
Dbg_cap_post_title(Lm_list *lml, int *title)
{
if (DBG_NOTCLASS(DBG_C_CAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
if ((*title)++ == 0)
dbg_print(lml, MSG_INTL(MSG_CAP_POST_TITLE));
}
void
Elf_cap_title(Lm_list *lml)
{
dbg_print(lml, MSG_INTL(MSG_CAP_ELF_TITLE));
}
void
Elf_cap_entry(Lm_list *lml, Cap *cap, int ndx, const char *str, size_t str_size,
Half mach)
{
Conv_inv_buf_t inv_buf;
Conv_cap_val_buf_t cap_val_buf;
char index[INDEX_STR_SIZE];
(void) snprintf(index, INDEX_STR_SIZE, MSG_ORIG(MSG_FMT_INDEX), ndx);
switch (cap->c_tag) {
case CA_SUNW_PLAT:
case CA_SUNW_MACH:
case CA_SUNW_ID:
/* If offset is in range, format as a string */
if (str && (cap->c_un.c_ptr < str_size)) {
str += cap->c_un.c_ptr;
break;
}
/*FALLTHROUGH*/
default:
/* Format numerically */
str = conv_cap_val(cap->c_tag, cap->c_un.c_val, mach, 0,
&cap_val_buf);
}
dbg_print(lml, MSG_INTL(MSG_CAP_ELF_ENTRY), index,
conv_cap_tag(cap->c_tag, 0, &inv_buf), str);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <libintl.h>
#include <sys/varargs.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <alist.h>
#include <debug.h>
#include <_debug.h>
#include <msg.h>
/*
* Define a debug descriptor. Note, although this provides the default
* definition to which most users bind, ld.so.1 must provide its own definition,
* and thus interposition is expected. This item should be defined NODIRECT.
*/
static Dbg_desc _dbg_desc = { 0, 0, NULL, { 0, 0 }, { 0, 0 } };
Dbg_desc *dbg_desc = &_dbg_desc;
int _Dbg_cnt = 0;
/*
* Debugging initialization and processing. The dbg_options[] array defines
* a set of option strings that can be specified using the -D flag or from an
* environment variable. For each option, a class is enabled in the d_class
* bit mask, or an extra flag is enabled in the d_extra bit mask.
*/
static DBG_options _Dbg_options[] = { /* Options accepted by both linkers */
{MSG_ORIG(MSG_TOK_DETAIL), 0, DBG_E_DETAIL},
{MSG_ORIG(MSG_TOK_LONG), 0, DBG_E_LONG},
{MSG_ORIG(MSG_TOK_HELP), 0, DBG_E_HELP},
{MSG_ORIG(MSG_TOK_TTIME), 0, DBG_E_TTIME},
{MSG_ORIG(MSG_TOK_DTIME), 0, DBG_E_DTIME},
{MSG_ORIG(MSG_TOK_ALL), DBG_C_ALL & ~DBG_C_DEMANGLE, 0},
{MSG_ORIG(MSG_TOK_BASIC), DBG_C_BASIC, 0},
{MSG_ORIG(MSG_TOK_CAP), DBG_C_CAP, 0},
{MSG_ORIG(MSG_TOK_DEMANGLE), DBG_C_DEMANGLE, 0},
{MSG_ORIG(MSG_TOK_FILES), DBG_C_FILES, 0},
{MSG_ORIG(MSG_TOK_LIBS), DBG_C_LIBS, 0},
{MSG_ORIG(MSG_TOK_MOVE), DBG_C_MOVE, 0},
{MSG_ORIG(MSG_TOK_RELOC), DBG_C_RELOC, 0},
{MSG_ORIG(MSG_TOK_SYMBOLS), DBG_C_SYMBOLS, 0},
{MSG_ORIG(MSG_TOK_TLS), DBG_C_TLS, 0},
{MSG_ORIG(MSG_TOK_UNUSED), DBG_C_UNUSED, 0},
{MSG_ORIG(MSG_TOK_VERSIONS), DBG_C_VERSIONS, 0},
{NULL, 0, 0},
};
static DBG_options _Dbg_options_ld[] = { /* ld only options */
{MSG_ORIG(MSG_TOK_CLASS), 0, DBG_E_SNAME | DBG_E_CLASS},
{MSG_ORIG(MSG_TOK_FULLNAME), 0, DBG_E_SNAME | DBG_E_FNAME},
{MSG_ORIG(MSG_TOK_NAME), 0, DBG_E_SNAME},
{MSG_ORIG(MSG_TOK_ARGS), DBG_C_ARGS, 0},
{MSG_ORIG(MSG_TOK_ENTRY), DBG_C_ENTRY, 0},
{MSG_ORIG(MSG_TOK_GOT), DBG_C_GOT, 0},
{MSG_ORIG(MSG_TOK_MAP), DBG_C_MAP, 0},
{MSG_ORIG(MSG_TOK_SECTIONS), DBG_C_SECTIONS, 0},
{MSG_ORIG(MSG_TOK_SEGMENTS), DBG_C_SEGMENTS, 0},
{MSG_ORIG(MSG_TOK_STATS), DBG_C_STATS, 0},
{MSG_ORIG(MSG_TOK_STRTAB), DBG_C_STRTAB, 0},
{MSG_ORIG(MSG_TOK_SUPPORT), DBG_C_SUPPORT, 0},
{NULL, 0, 0},
};
static DBG_options _Dbg_options_rtld[] = { /* ld.so.1 only options */
{MSG_ORIG(MSG_TOK_AUDIT), DBG_C_AUDITING, 0},
{MSG_ORIG(MSG_TOK_BINDINGS), DBG_C_BINDINGS, 0},
{MSG_ORIG(MSG_TOK_DL), DBG_C_DL, 0},
{MSG_ORIG(MSG_TOK_INIT), DBG_C_INIT, 0},
{NULL, 0, 0},
};
/*
* Compare name to the options found in optarr. If one matches,
* update *dbp and return TRUE. Otherwise, FALSE.
*/
static Boolean
process_options(const char *name, Boolean set, Dbg_desc *dbp,
DBG_options *optarr)
{
DBG_options *opt;
for (opt = optarr; opt->o_name != NULL; opt++) {
if (strcmp(name, opt->o_name) != 0)
continue;
if (set == TRUE) {
if (opt->o_class)
dbp->d_class |= opt->o_class;
if (opt->o_extra)
dbp->d_extra |= opt->o_extra;
} else {
if (opt->o_class)
dbp->d_class &= ~(opt->o_class);
if (opt->o_extra)
dbp->d_extra &= ~(opt->o_extra);
}
return (TRUE);
}
return (FALSE);
}
/*
* Provide a debugging usage message
*/
void
Dbg_help(void)
{
Dbg_util_nl(0, DBG_NL_STD);
dbg_print(0, MSG_INTL(MSG_USE_R1_A));
dbg_print(0, MSG_INTL(MSG_USE_R1_B));
dbg_print(0, MSG_INTL(MSG_USE_R1_C));
dbg_print(0, MSG_INTL(MSG_USE_R1_D));
dbg_print(0, MSG_INTL(MSG_USE_R1_E));
dbg_print(0, MSG_INTL(MSG_USE_R1_F));
dbg_print(0, MSG_INTL(MSG_USE_R1_G));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_R2_A));
dbg_print(0, MSG_INTL(MSG_USE_R2_B));
dbg_print(0, MSG_INTL(MSG_USE_R2_C));
dbg_print(0, MSG_INTL(MSG_USE_R2_D));
dbg_print(0, MSG_INTL(MSG_USE_R2_E));
dbg_print(0, MSG_INTL(MSG_USE_R2_F));
dbg_print(0, MSG_INTL(MSG_USE_R2_G));
dbg_print(0, MSG_INTL(MSG_USE_R2_H));
dbg_print(0, MSG_INTL(MSG_USE_R2_I));
dbg_print(0, MSG_INTL(MSG_USE_R2_J));
dbg_print(0, MSG_INTL(MSG_USE_R2_K));
dbg_print(0, MSG_INTL(MSG_USE_R2_L));
dbg_print(0, MSG_INTL(MSG_USE_R2_M));
dbg_print(0, MSG_INTL(MSG_USE_R2_N));
dbg_print(0, MSG_INTL(MSG_USE_R2_O));
dbg_print(0, MSG_INTL(MSG_USE_R2_P));
dbg_print(0, MSG_INTL(MSG_USE_R2_Q));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_R2_R));
dbg_print(0, MSG_INTL(MSG_USE_R2_S));
dbg_print(0, MSG_INTL(MSG_USE_R2_T));
dbg_print(0, MSG_INTL(MSG_USE_R2_U));
dbg_print(0, MSG_INTL(MSG_USE_R2_V));
dbg_print(0, MSG_INTL(MSG_USE_R2_W));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_R3_A));
dbg_print(0, MSG_INTL(MSG_USE_R3_B));
dbg_print(0, MSG_INTL(MSG_USE_R3_C));
dbg_print(0, MSG_INTL(MSG_USE_R3_D));
dbg_print(0, MSG_INTL(MSG_USE_R3_E));
dbg_print(0, MSG_INTL(MSG_USE_R3_F));
dbg_print(0, MSG_INTL(MSG_USE_R3_G));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_R3_H));
dbg_print(0, MSG_INTL(MSG_USE_R3_F));
dbg_print(0, MSG_INTL(MSG_USE_R3_I));
dbg_print(0, MSG_INTL(MSG_USE_R3_J));
dbg_print(0, MSG_INTL(MSG_USE_R3_K));
dbg_print(0, MSG_INTL(MSG_USE_R3_L));
dbg_print(0, MSG_INTL(MSG_USE_R3_M));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_R3_N));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_HDR_DCT));
dbg_print(0, MSG_INTL(MSG_USE_HDR_BOTH));
dbg_print(0, MSG_INTL(MSG_USE_R4_A));
dbg_print(0, MSG_INTL(MSG_USE_R4_B));
dbg_print(0, MSG_INTL(MSG_USE_R4_B2));
dbg_print(0, MSG_INTL(MSG_USE_R4_C));
dbg_print(0, MSG_INTL(MSG_USE_R4_C2));
dbg_print(0, MSG_INTL(MSG_USE_R4_C3));
dbg_print(0, MSG_INTL(MSG_USE_R4_D));
dbg_print(0, MSG_INTL(MSG_USE_R4_E));
dbg_print(0, MSG_INTL(MSG_USE_R4_E2));
dbg_print(0, MSG_INTL(MSG_USE_R4_E3));
dbg_print(0, MSG_INTL(MSG_USE_R4_F));
dbg_print(0, MSG_INTL(MSG_USE_R4_F2));
dbg_print(0, MSG_INTL(MSG_USE_R4_F3));
dbg_print(0, MSG_INTL(MSG_USE_R4_F4));
dbg_print(0, MSG_INTL(MSG_USE_R4_F5));
dbg_print(0, MSG_INTL(MSG_USE_R4_F6));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_HDR_RTLD));
dbg_print(0, MSG_INTL(MSG_USE_R5_A));
dbg_print(0, MSG_INTL(MSG_USE_R5_A2));
dbg_print(0, MSG_INTL(MSG_USE_R5_A3));
dbg_print(0, MSG_INTL(MSG_USE_R5_A4));
dbg_print(0, MSG_INTL(MSG_USE_R5_A5));
dbg_print(0, MSG_INTL(MSG_USE_R5_A6));
dbg_print(0, MSG_INTL(MSG_USE_R5_A7));
dbg_print(0, MSG_INTL(MSG_USE_R5_A8));
dbg_print(0, MSG_INTL(MSG_USE_R5_A9));
dbg_print(0, MSG_INTL(MSG_USE_R5_A0));
dbg_print(0, MSG_INTL(MSG_USE_R5_B));
dbg_print(0, MSG_INTL(MSG_USE_R5_C));
dbg_print(0, MSG_INTL(MSG_USE_R5_D));
dbg_print(0, MSG_INTL(MSG_USE_R5_E));
dbg_print(0, MSG_INTL(MSG_USE_R5_F));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_HDR_LD));
dbg_print(0, MSG_INTL(MSG_USE_R6_A));
dbg_print(0, MSG_INTL(MSG_USE_R6_B));
dbg_print(0, MSG_INTL(MSG_USE_R6_C));
dbg_print(0, MSG_INTL(MSG_USE_R6_C2));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_HDR_CST));
dbg_print(0, MSG_INTL(MSG_USE_HDR_BOTH));
dbg_print(0, MSG_INTL(MSG_USE_R7_A));
dbg_print(0, MSG_INTL(MSG_USE_R7_B));
dbg_print(0, MSG_INTL(MSG_USE_R7_C));
dbg_print(0, MSG_INTL(MSG_USE_R7_D));
dbg_print(0, MSG_INTL(MSG_USE_R7_E));
dbg_print(0, MSG_INTL(MSG_USE_R7_F));
dbg_print(0, MSG_INTL(MSG_USE_R7_F2));
dbg_print(0, MSG_INTL(MSG_USE_R7_G));
dbg_print(0, MSG_INTL(MSG_USE_R7_H));
dbg_print(0, MSG_INTL(MSG_USE_R7_I));
dbg_print(0, MSG_INTL(MSG_USE_R7_I2));
dbg_print(0, MSG_INTL(MSG_USE_R7_J));
dbg_print(0, MSG_INTL(MSG_USE_R7_K));
dbg_print(0, MSG_INTL(MSG_USE_R7_K2));
dbg_print(0, MSG_INTL(MSG_USE_R7_L));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_HDR_RTLD));
dbg_print(0, MSG_INTL(MSG_USE_R8_A));
dbg_print(0, MSG_INTL(MSG_USE_R8_B));
dbg_print(0, MSG_INTL(MSG_USE_R8_B2));
dbg_print(0, MSG_INTL(MSG_USE_R8_C));
dbg_print(0, MSG_INTL(MSG_USE_R8_D));
Dbg_util_nl(0, DBG_NL_FRC);
dbg_print(0, MSG_INTL(MSG_USE_HDR_LD));
dbg_print(0, MSG_INTL(MSG_USE_R9_A));
dbg_print(0, MSG_INTL(MSG_USE_R9_B));
dbg_print(0, MSG_INTL(MSG_USE_R9_C));
dbg_print(0, MSG_INTL(MSG_USE_R9_D));
dbg_print(0, MSG_INTL(MSG_USE_R9_E));
dbg_print(0, MSG_INTL(MSG_USE_R9_F));
dbg_print(0, MSG_INTL(MSG_USE_R9_F2));
dbg_print(0, MSG_INTL(MSG_USE_R9_G));
dbg_print(0, MSG_INTL(MSG_USE_R9_H));
dbg_print(0, MSG_INTL(MSG_USE_R9_H2));
dbg_print(0, MSG_INTL(MSG_USE_R9_I));
Dbg_util_nl(0, DBG_NL_FRC);
}
/*
* Provide a debugging message showing the version of the linker package
*/
void
Dbg_version(void)
{
Dbg_util_nl(0, DBG_NL_STD);
dbg_print(0, MSG_ORIG(MSG_STR_LDVER), link_ver_string);
Dbg_util_nl(0, DBG_NL_STD);
}
/*
* Messaging support - funnel everything through dgettext() as this provides
* the real binding to libc.
*/
const char *
_liblddbg_msg(Msg mid)
{
return (dgettext(MSG_ORIG(MSG_SUNW_OST_SGS), MSG_ORIG(mid)));
}
/*
* Given a name starting with "lmid", finish processing it. Return TRUE
* if a valid lmid token was seen, and FALSE for any error.
*
* exit:
* On failure, returns FALSE, indicating a syntax error
*
* On success:
* - Appropriate flags in dbg->d_extra have been set
* - Any link-map list names specified have been added to
* d_list, for the rtld dbg_print() to compare against
* link-map list names.
* - TRUE is returned.
*/
static Boolean
process_lmid(char *name, Dbg_desc *dbp)
{
/*
* "lmid" can have an optional argument. Allowed values are "all",
* "alt[0-9]+", "base", or "ldso". Alt has a variable ending, but
* we can use process_options() to handle the other three.
*/
static DBG_options options_lmid[] = {
{MSG_ORIG(MSG_TOK_LMID_ALL), 0, DBG_E_LMID_ALL},
{MSG_ORIG(MSG_TOK_LMID_BASE), 0, DBG_E_LMID_BASE},
{MSG_ORIG(MSG_TOK_LMID_LDSO), 0, DBG_E_LMID_LDSO},
{NULL, 0, 0},
};
Dbg_desc tmp_db;
const char *lmid_opt;
/* If it's a plain "lmid", we can set the flag and return now */
if (name[MSG_TOK_LMID_SIZE] == '\0') {
dbp->d_extra |= DBG_E_LMID;
return (TRUE);
}
/* If there's no value, its an error */
if (conv_strproc_extract_value(name, MSG_TOK_LMID_SIZE,
CONV_SPEXV_F_UCASE, &lmid_opt) == 0)
return (FALSE);
/*
* ALL, BASE, or LDSO?
*/
tmp_db.d_extra = 0;
if (process_options(lmid_opt, TRUE, &tmp_db, options_lmid)) {
/*
* If BASE, and we haven't already seen it, add it to the
* rtld name matching list. For the others, setting the
* e_extra bit suffices.
*/
if (((tmp_db.d_extra & DBG_E_LMID_BASE) != 0) &&
((dbp->d_extra & DBG_E_LMID_BASE) == 0) &&
(aplist_append(&dbp->d_list, MSG_ORIG(MSG_TOK_LMID_BASE),
AL_CNT_DEBUG) == NULL))
return (FALSE);
/* Add the resulting flags into the callers descriptor */
dbp->d_extra |= DBG_E_LMID | tmp_db.d_extra;
return (TRUE);
}
/*
* ALT?
*/
if (strncmp(lmid_opt, MSG_ORIG(MSG_TOK_LMID_ALT),
MSG_TOK_LMID_ALT_SIZE) == 0) {
const char *tail = lmid_opt + MSG_TOK_LMID_ALT_SIZE;
/* 'ALT' without a # means "all alternative link-map lists" */
if (*tail == '\0') {
dbp->d_extra |= DBG_E_LMID | DBG_E_LMID_ALT;
return (TRUE);
}
/*
* It is ALT[0-9]+. Make sure the characters following 'ALT'
* are numbers, and then add it to the rtld name matching list.
*/
for (; *tail; tail++)
if ((*tail < '0') || (*tail > '9'))
return (FALSE);
if (aplist_append(&dbp->d_list, lmid_opt, AL_CNT_DEBUG) == NULL)
return (FALSE);
dbp->d_extra |= DBG_E_LMID;
return (TRUE);
}
/* It's nothing we recognize */
return (FALSE);
}
/*
* Validate and enable the appropriate debugging classes.
*
* entry:
* string - String to be analyzed for debugging options
* dbp - Pointer to debug descriptor to be initialized
* outfile_ret - NULL, or pointer to receive result of 'output='
* token. A NULL value means that the 'output=' token
* is not accepted. A non-NULL value means that it is.
*
* exit:
* On failure, False (0) is returned.
*
* On success, string has been parsed, and the descriptor referenced
* by dbp has been initialized. If outfile is non-NULL, *outfile will
* be set to NULL if the 'output=' token is not present, and to the
* user supplied string otherwise. True (1) is returned.
*/
int
Dbg_setup(dbg_setup_caller_t caller, const char *string, Dbg_desc *dbp,
const char **outfile)
{
char *name, *_name; /* buffer in which to perform */
/* strtok_r() operations. */
char *lasts;
const char *delimit = MSG_ORIG(MSG_STR_DELIMIT);
/*
* Clear the help flags --- these items only apply for a single
* call to Dbg_setup().
*/
dbp->d_extra &= ~(DBG_E_HELP | DBG_E_HELP_EXIT);
if ((_name = (char *)malloc(strlen(string) + 1)) == NULL)
return (0);
(void) strcpy(_name, string);
if (outfile)
*outfile = NULL; /* No output file yet */
/*
* The token should be of the form "-Dtok,tok,tok,...". Separate the
* pieces and build up the appropriate mask, unrecognized options are
* flagged.
*/
if ((name = strtok_r(_name, delimit, &lasts)) != NULL) {
do {
Boolean set;
/* Remove leading and trailing whitespace */
name = conv_strproc_trim(name);
if (name[0] == '!') {
set = FALSE;
name++;
} else
set = TRUE;
if (*name == '\0')
continue; /* Skip null token */
/*
* First, determine if the token represents a class or
* extra.
*/
if (process_options(name, set, dbp, _Dbg_options))
continue;
switch (caller) {
case DBG_CALLER_LD: /* ld only tokens */
if (process_options(name, set, dbp,
_Dbg_options_ld))
continue;
break;
case DBG_CALLER_RTLD: /* rtld only tokens */
if (process_options(name, set, dbp,
_Dbg_options_rtld))
continue;
break;
}
/* The remaining options do not accept negation */
if (!set) {
dbg_print(0, MSG_INTL(MSG_USE_CNTNEGOPT), name);
continue;
}
/*
* Is it an 'output=' token? This item is a special
* case because it depends on the presence of
* a non-NULL outfile argument, and because the
* part following the '=' is variable.
*/
if ((outfile != NULL) &&
strncmp(name, MSG_ORIG(MSG_TOK_OUTFILE),
MSG_TOK_OUTFILE_SIZE) == 0) {
if (conv_strproc_extract_value(name,
MSG_TOK_OUTFILE_SIZE, 0, outfile))
continue;
}
/*
* Only the rtld "lmid" token is left.
*/
if ((caller == DBG_CALLER_RTLD) && (strncmp(name,
MSG_ORIG(MSG_TOK_LMID), MSG_TOK_LMID_SIZE) == 0) &&
process_lmid(name, dbp))
continue;
/* If we make it here, the token is not understood */
dbg_print(0, MSG_INTL(MSG_USE_UNRECOG), name);
} while ((name = strtok_r(NULL, delimit, &lasts)) != NULL);
}
/*
* If the debug help option was specified and this is the only debug
* class, return an indication that the user should exit.
*/
if ((_Dbg_cnt++ == 0) && (dbp->d_extra & DBG_E_HELP) &&
(dbp->d_class == 0))
dbp->d_extra |= DBG_E_HELP_EXIT;
return (1);
}
/*
* Define our own printing routine. This provides a basic fallback, as ld(1)
* and ld.so.1(1) provide their own routines that augment their diagnostic
* output, and direct the output to stderr. This item should be defined
* NODIRECT.
*/
/* PRINTFLIKE2 */
void
dbg_print(Lm_list *lml, const char *format, ...)
{
va_list ap;
#if defined(lint)
/*
* The lml argument is only meaningful for diagnostics sent to ld.so.1.
* Supress the lint error by making a dummy assignment.
*/
lml = 0;
#endif
va_start(ap, format);
(void) vprintf(format, ap);
(void) printf(MSG_ORIG(MSG_STR_NL));
va_end(ap);
}
/*
* Return an internationalized state transition string. These are used by
* various debugging output.
*/
const char *
Dbg_state_str(dbg_state_t type)
{
static const Msg state[DBG_STATE_NUM] = {
MSG_STR_ADD, /* MSG_INTL(MSG_STR_ADD) */
MSG_STR_CURRENT, /* MSG_INTL(MSG_STR_CURRENT) */
MSG_STR_EXCLUDE, /* MSG_INTL(MSG_STR_EXCLUDE) */
MSG_STR_IGNORE, /* MSG_INTL(MSG_STR_IGNORE) */
MSG_STR_MOD_BEFORE, /* MSG_INTL(MSG_STR_MOD_BEFORE) */
MSG_STR_MOD_AFTER, /* MSG_INTL(MSG_STR_MOD_AFTER) */
MSG_STR_NEW, /* MSG_INTL(MSG_STR_NEW) */
MSG_STR_NEW_IMPLICIT, /* MSG_INTL(MSG_STR_NEW_IMPLICIT) */
MSG_STR_RESET, /* MSG_INTL(MSG_STR_RESET) */
MSG_STR_ORIGINAL, /* MSG_INTL(MSG_STR_ORIGINAL) */
MSG_STR_RESOLVED, /* MSG_INTL(MSG_STR_RESOLVED) */
};
#if DBG_STATE_NUM != (DBG_STATE_RESOLVED + 1)
#error DBG_SEG_NUM has changed. Update segtype[]
#endif
assert(type < DBG_STATE_NUM);
return (MSG_INTL(state[type]));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "msg.h"
#include "_debug.h"
#include "libld.h"
void
Dbg_dl_iphdr_enter(Rt_map *clmp, u_longlong_t cnt_map, u_longlong_t cnt_unmap)
{
Lm_list *lml = LIST(clmp);
if (DBG_NOTCLASS(DBG_C_DL))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_ENTER), NAME(clmp));
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_MAPCNT), cnt_map, cnt_unmap);
}
void
Dbg_dl_iphdr_callback(Lm_list *lml, struct dl_phdr_info *info)
{
if (DBG_NOTCLASS(DBG_C_DL))
return;
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_CALLBACK));
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_NAME), info->dlpi_name);
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_ADDR), EC_ADDR(info->dlpi_addr));
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_PHDR),
EC_ADDR(CAST_PTRINT(Addr, info->dlpi_phdr)),
EC_WORD(info->dlpi_phnum));
}
void
Dbg_dl_iphdr_mapchange(Lm_list *lml, u_longlong_t cnt_map,
u_longlong_t cnt_unmap)
{
if (DBG_NOTCLASS(DBG_C_DL))
return;
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_MAPCNG));
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_MAPCNT), cnt_map, cnt_unmap);
}
void
Dbg_dl_iphdr_unmap_ret(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_DL))
return;
dbg_print(lml, MSG_INTL(MSG_DL_IPHDR_UNMAP));
}
void
Dbg_dl_dlopen(Rt_map *clmp, const char *name, int *in_nfavl, int mode)
{
Conv_dl_mode_buf_t dl_mode_buf;
Lm_list *lml = LIST(clmp);
const char *retry;
if (DBG_NOTCLASS(DBG_C_FILES | DBG_C_DL))
return;
/*
* The core functionality of dlopen() can be called twice. The first
* attempt can be affected by path names that exist in the "not-found"
* AVL tree. Should a "not-found" path name be found, a second attempt
* is made to locate the required file (in_nfavl is NULL). This fall-
* back provides for file system changes while a process executes.
*/
if (in_nfavl)
retry = MSG_ORIG(MSG_STR_EMPTY);
else
retry = MSG_INTL(MSG_STR_RETRY);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_DL_DLOPEN), name, NAME(clmp), retry,
conv_dl_mode(mode, 0, &dl_mode_buf));
}
void
Dbg_dl_dlclose(Rt_map *clmp, const char *name, int flag)
{
const char *str;
Lm_list *lml = LIST(clmp);
if (DBG_NOTCLASS(DBG_C_FILES | DBG_C_DL))
return;
if (flag == DBG_DLCLOSE_IGNORE)
str = MSG_INTL(MSG_STR_IGNORE);
else
str = MSG_ORIG(MSG_STR_EMPTY);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_DL_DLCLOSE), name, NAME(clmp), str);
}
void
Dbg_dl_dldump(Rt_map *clmp, const char *ipath, const char *opath, int flags)
{
Conv_dl_flag_buf_t dl_flag_buf;
Lm_list *lml = LIST(clmp);
if (DBG_NOTCLASS(DBG_C_FILES | DBG_C_DL))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_DL_DLDUMP), ipath, NAME(clmp),
opath ? opath : MSG_INTL(MSG_STR_NULL),
conv_dl_flag(flags, 0, &dl_flag_buf));
}
void
Dbg_dl_dlerror(Rt_map *clmp, const char *str)
{
Lm_list *lml = LIST(clmp);
if (DBG_NOTCLASS(DBG_C_DL))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_DL_DLERROR), NAME(clmp),
str ? str : MSG_INTL(MSG_STR_NULL));
}
void
Dbg_dl_dladdr(Rt_map *clmp, void *addr)
{
Lm_list *lml = LIST(clmp);
if (DBG_NOTCLASS(DBG_C_DL))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_DL_DLADDR), NAME(clmp), EC_NATPTR(addr));
}
void
Dbg_dl_dlsym(Rt_map *clmp, const char *sym, int *in_nfavl, const char *next,
int type)
{
const char *str, *retry, *from = NAME(clmp);
Lm_list *lml = LIST(clmp);
static const Msg dlsym_msg[DBG_DLSYM_NUM] = {
MSG_STR_EMPTY, /* MSG_ORIG(MSG_STR_EMPTY) */
MSG_DLSYM_NEXT, /* MSG_ORIG(MSG_DLSYM_NEXT) */
MSG_DLSYM_DEFAULT, /* MSG_ORIG(MSG_DLSYM_DEFAULT) */
MSG_DLSYM_SELF, /* MSG_ORIG(MSG_DLSYM_SELF) */
MSG_DLSYM_PROBE, /* MSG_ORIG(MSG_DLSYM_PROBE) */
MSG_DLSYM_SINGLETON /* MSG_ORIG(MSG_DLSYM_SINGLETON) */
};
#if DBG_DLSYM_NUM != (DBG_DLSYM_SINGLETON + 1)
#error DBG_DLSYM_NUM has grown
#endif
if (DBG_NOTCLASS(DBG_C_SYMBOLS | DBG_C_DL))
return;
/*
* The core functionality of dlsym() can be called twice. The first
* attempt can be affected by path names that exist in the "not-found"
* AVL tree. Should a "not-found" path name be found, a second attempt
* is made to locate the required file (in_nfavl is NULL). This fall-
* back provides for file system changes while a process executes.
*/
if (in_nfavl)
retry = MSG_ORIG(MSG_STR_EMPTY);
else
retry = MSG_INTL(MSG_STR_RETRY);
if (type >= DBG_DLSYM_NUM)
type = 0;
str = MSG_ORIG(dlsym_msg[type]);
Dbg_util_nl(lml, DBG_NL_STD);
if (next == 0)
dbg_print(lml, MSG_INTL(MSG_DLSYM_1), Dbg_demangle_name(sym),
from, retry, str);
else
dbg_print(lml, MSG_INTL(MSG_DLSYM_2), Dbg_demangle_name(sym),
from, next, retry, str);
}
void
Dbg_dl_dlinfo(Rt_map *clmp, const char *name, int request, void *addr)
{
Lm_list *lml = LIST(clmp);
if (DBG_NOTCLASS(DBG_C_DL))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_DL_DLINFO), NAME(clmp), name,
conv_dl_info(request), EC_NATPTR(addr));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sgs.h>
#include <stdio.h>
#include <debug.h>
#include <conv.h>
#include <_debug.h>
#include <msg.h>
/*
* Print out the dynamic section entries.
*/
void
Elf_dyn_title(Lm_list *lml)
{
dbg_print(lml, MSG_INTL(MSG_DYN_TITLE));
}
void
Elf_dyn_entry(Lm_list *lml, Dyn *dyn, int ndx, const char *name,
uchar_t osabi, Half mach)
{
Conv_inv_buf_t inv_buf;
char index[INDEX_STR_SIZE];
(void) snprintf(index, sizeof (index), MSG_ORIG(MSG_FMT_INDEX), ndx);
dbg_print(lml, MSG_INTL(MSG_DYN_ENTRY), index,
conv_dyn_tag(dyn->d_tag, osabi, mach, 0, &inv_buf),
EC_XWORD(dyn->d_un.d_val), name);
}
/*
* Variant of Elf_dyn_entry() specifically for DT_NULL. Handles the
* case of multiple adjacent DT_NULL entries by displaying them on
* a single line using an index range instead of a single index.
*/
void
Elf_dyn_null_entry(Lm_list *lml, Dyn *dyn, int start_ndx, int end_ndx)
{
Conv_inv_buf_t inv_buf;
char index[2 * INDEX_STR_SIZE];
if (start_ndx == end_ndx) {
Elf_dyn_entry(lml, dyn, start_ndx, MSG_ORIG(MSG_STR_EMPTY),
ELFOSABI_NONE, 0);
} else {
(void) snprintf(index, sizeof (index),
MSG_ORIG(MSG_FMT_INDEX_RANGE), start_ndx, end_ndx);
dbg_print(lml, MSG_INTL(MSG_DYN_ENTRY), index,
conv_dyn_tag(DT_NULL, ELFOSABI_NONE, 0, 0, &inv_buf),
EC_XWORD(dyn->d_un.d_val), MSG_ORIG(MSG_STR_EMPTY));
}
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sgs.h>
#include <_debug.h>
#include <conv.h>
#include <msg.h>
void
Elf_ehdr(Lm_list *lml, Ehdr *ehdr, Shdr *shdr0)
{
Conv_inv_buf_t inv_buf1, inv_buf2;
Conv_ehdr_flags_buf_t flags_buf;
Conv_sec_flags_buf_t sec_flags_buf;
Byte *byte = &(ehdr->e_ident[0]);
const char *flgs;
int xshdr = 0;
uchar_t osabi = ehdr->e_ident[EI_OSABI];
Half mach = ehdr->e_machine;
dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
dbg_print(lml, MSG_INTL(MSG_ELF_HEADER));
dbg_print(lml, MSG_ORIG(MSG_ELF_MAGIC), byte[EI_MAG0],
(byte[EI_MAG1] ? byte[EI_MAG1] : '0'),
(byte[EI_MAG2] ? byte[EI_MAG2] : '0'),
(byte[EI_MAG3] ? byte[EI_MAG3] : '0'));
dbg_print(lml, MSG_ORIG(MSG_ELF_CLASS),
conv_ehdr_class(ehdr->e_ident[EI_CLASS], 0, &inv_buf1),
conv_ehdr_data(ehdr->e_ident[EI_DATA], 0, &inv_buf2));
dbg_print(lml, MSG_ORIG(MSG_ELF_OSABI),
conv_ehdr_osabi(ehdr->e_ident[EI_OSABI], 0, &inv_buf1),
conv_ehdr_abivers(ehdr->e_ident[EI_OSABI],
ehdr->e_ident[EI_ABIVERSION], CONV_FMT_DECIMAL, &inv_buf2));
dbg_print(lml, MSG_ORIG(MSG_ELF_MACHINE),
conv_ehdr_mach(mach, 0, &inv_buf1),
conv_ehdr_vers(ehdr->e_version, 0, &inv_buf2));
dbg_print(lml, MSG_ORIG(MSG_ELF_TYPE),
conv_ehdr_type(osabi, ehdr->e_type, 0, &inv_buf1));
/*
* Line up the flags differently depending on whether we received a
* numeric (e.g. "0x200") or text representation (e.g.
* "[ EF_SPARC_SUN_US1 ]").
*/
flgs = conv_ehdr_flags(mach, ehdr->e_flags, 0, &flags_buf);
if (flgs[0] == '[')
dbg_print(lml, MSG_ORIG(MSG_ELF_FLAGS_FMT), flgs);
else
dbg_print(lml, MSG_ORIG(MSG_ELF_FLAGS), flgs);
/*
* The e_shnum, e_shstrndx and e_phnum entries may have a different
* meaning if extended sections exist.
*/
if (ehdr->e_shstrndx == SHN_XINDEX) {
dbg_print(lml, MSG_ORIG(MSG_ELFX_ESIZE),
EC_ADDR(ehdr->e_entry), ehdr->e_ehsize);
xshdr++;
} else
dbg_print(lml, MSG_ORIG(MSG_ELF_ESIZE), EC_ADDR(ehdr->e_entry),
ehdr->e_ehsize, ehdr->e_shstrndx);
if (ehdr->e_shnum == 0) {
dbg_print(lml, MSG_ORIG(MSG_ELFX_SHOFF), EC_OFF(ehdr->e_shoff),
ehdr->e_shentsize);
xshdr++;
} else
dbg_print(lml, MSG_ORIG(MSG_ELF_SHOFF), EC_OFF(ehdr->e_shoff),
ehdr->e_shentsize, ehdr->e_shnum);
if (ehdr->e_phnum == PN_XNUM) {
dbg_print(lml, MSG_ORIG(MSG_ELFX_PHOFF), EC_OFF(ehdr->e_phoff),
ehdr->e_phentsize);
xshdr++;
} else
dbg_print(lml, MSG_ORIG(MSG_ELF_PHOFF), EC_OFF(ehdr->e_phoff),
ehdr->e_phentsize, ehdr->e_phnum);
if ((xshdr == 0) || (shdr0 == NULL))
return;
/*
* If we have Extended ELF headers - print shdr[0].
*/
dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
dbg_print(lml, MSG_ORIG(MSG_SHD0_TITLE));
dbg_print(lml, MSG_ORIG(MSG_SHD0_ADDR), EC_ADDR(shdr0->sh_addr),
conv_sec_flags(osabi, mach, shdr0->sh_flags, 0, &sec_flags_buf));
dbg_print(lml, MSG_ORIG(MSG_SHD0_SIZE), EC_XWORD(shdr0->sh_size),
conv_sec_type(osabi, mach, shdr0->sh_type, 0, &inv_buf1));
dbg_print(lml, MSG_ORIG(MSG_SHD0_OFFSET), EC_OFF(shdr0->sh_offset),
EC_XWORD(shdr0->sh_entsize));
dbg_print(lml, MSG_ORIG(MSG_SHD0_LINK), EC_WORD(shdr0->sh_link),
EC_WORD(shdr0->sh_info));
dbg_print(lml, MSG_ORIG(MSG_SHD0_ALIGN), EC_XWORD(shdr0->sh_addralign));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "msg.h"
#include "_debug.h"
#include "libld.h"
/*
* Print out a single `entry descriptor' entry.
*/
void
Dbg_ent_entry(Lm_list *lml, uchar_t osabi, Half mach, Ent_desc *enp)
{
union {
Conv_inv_buf_t inv;
Conv_sec_flags_buf_t sec_flags;
Conv_ent_flags_buf_t ent_flags;
Conv_ent_files_flags_buf_t ent_files_flags;
} buf;
Aliste idx;
Ent_desc_file *edfp;
if (enp->ec_name != NULL)
dbg_print(lml, MSG_ORIG(MSG_ECR_NAME), enp->ec_name);
dbg_print(lml, MSG_ORIG(MSG_ECR_FLAGS),
conv_ent_flags(enp->ec_flags, &buf.ent_flags));
dbg_print(lml, MSG_ORIG(MSG_ECR_IS_NAME),
(enp->ec_is_name ? enp->ec_is_name : MSG_INTL(MSG_STR_NULL)),
conv_sec_flags(osabi, mach, enp->ec_attrmask, 0, &buf.sec_flags));
dbg_print(lml, MSG_ORIG(MSG_ECR_SEGMENT),
(enp->ec_segment->sg_name ? enp->ec_segment->sg_name :
MSG_INTL(MSG_STR_NULL)),
conv_sec_flags(osabi, mach, enp->ec_attrbits, 0, &buf.sec_flags));
dbg_print(lml, MSG_ORIG(MSG_ECR_NDX), EC_WORD(enp->ec_ordndx),
conv_sec_type(osabi, mach, enp->ec_type, 0, &buf.inv));
if (enp->ec_files) {
dbg_print(lml, MSG_ORIG(MSG_ECR_FILES));
for (ALIST_TRAVERSE(enp->ec_files, idx, edfp))
dbg_print(lml, MSG_ORIG(MSG_ECR_FILE),
conv_ent_files_flags(edfp->edf_flags, 0,
&buf.ent_files_flags), edfp->edf_name);
}
}
/*
* Print out all `entrance descriptor' entries.
*/
void
Dbg_ent_print(Lm_list *lml, uchar_t osabi, Half mach, APlist *alp)
{
Ent_desc *enp;
Aliste ndx;
if (DBG_NOTCLASS(DBG_C_ENTRY))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_ECR_TITLE));
for (APLIST_TRAVERSE(alp, ndx, enp)) {
dbg_print(lml, MSG_INTL(MSG_ECR_DESC), EC_WORD(ndx));
Dbg_ent_entry(lml, osabi, mach, enp);
}
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2022 Oxide Computer Company
*/
#include <sys/auxv.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <libld.h>
#include <rtld.h>
#include <conv.h>
#include "msg.h"
#include "_debug.h"
void
Dbg_file_analyze(Rt_map *lmp)
{
Conv_dl_mode_buf_t dl_mode_buf;
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_ANALYZE), NAME(lmp),
conv_dl_mode(MODE(lmp), 1, &dl_mode_buf));
}
void
Dbg_file_mmapobj(Lm_list *lml, const char *name, mmapobj_result_t *ompp,
uint_t onum)
{
mmapobj_result_t *mpp;
uint_t mnum;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_MMAPOBJ), name, onum);
for (mnum = 0, mpp = ompp; mnum < onum; mnum++, mpp++) {
const char *str;
uint_t type = MR_GET_TYPE(mpp->mr_flags);
if (type == MR_PADDING)
str = MSG_ORIG(MSG_MR_PADDING);
else if (type == MR_HDR_ELF)
str = MSG_ORIG(MSG_MR_HDR_ELF);
else
str = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(lml, MSG_INTL(MSG_FIL_MMAPOBJ_1), mnum,
EC_NATPTR(mpp->mr_addr), EC_OFF(mpp->mr_fsize), str);
dbg_print(lml, MSG_INTL(MSG_FIL_MMAPOBJ_2),
EC_OFF(mpp->mr_offset), EC_OFF(mpp->mr_msize));
}
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_file_elf(Lm_list *lml, const char *name, Addr addr, size_t size,
const char *lmid, Aliste lmco)
{
const char *str;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (addr == 0)
str = MSG_INTL(MSG_STR_TEMPORARY);
else
str = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(lml, MSG_INTL(MSG_FIL_ELF), name, str);
dbg_print(lml, MSG_INTL(MSG_FIL_DATA_AS), EC_ADDR(addr), EC_OFF(size));
dbg_print(lml, MSG_INTL(MSG_FIL_DATA_LL), lmid, EC_XWORD(lmco));
}
void
Dbg_file_ldso(Rt_map *lmp, char **envp, auxv_t *auxv, const char *lmid,
Aliste lmco)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_LDSO), PATHNAME(lmp));
dbg_print(lml, MSG_INTL(MSG_FIL_DATA_AS), EC_ADDR(ADDR(lmp)),
EC_OFF(MSIZE(lmp)));
dbg_print(lml, MSG_INTL(MSG_FIL_DATA_EA), EC_NATPTR(envp),
EC_NATPTR(auxv));
dbg_print(lml, MSG_INTL(MSG_FIL_DATA_LL), lmid, EC_XWORD(lmco));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_file_prot(Rt_map *lmp, int prot)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_PROT), NAME(lmp), (prot ? '+' : '-'));
}
void
Dbg_file_delete(Rt_map *lmp)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_DELETE), NAME(lmp));
}
static int hdl_title = 0;
static Msg hdl_str = 0;
void
Dbg_file_hdl_title(int type)
{
static const Msg titles[] = {
MSG_FIL_HDL_CREATE, /* MSG_INTL(MSG_FIL_HDL_CREATE) */
MSG_FIL_HDL_ADD, /* MSG_INTL(MSG_FIL_HDL_ADD) */
MSG_FIL_HDL_DELETE, /* MSG_INTL(MSG_FIL_HDL_DELETE) */
MSG_FIL_HDL_ORPHAN, /* MSG_INTL(MSG_FIL_HDL_ORPHAN) */
MSG_FIL_HDL_REINST, /* MSG_INTL(MSG_FIL_HDL_REINST) */
};
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
/*
* Establish a binding title for later use in Dbg_file_hdl_action.
*/
if (type <= DBG_HDL_REINST) {
hdl_str = titles[type];
hdl_title = 1;
} else {
hdl_str = 0;
hdl_title = 0;
}
}
void
Dbg_file_hdl_collect(Grp_hdl *ghp, const char *name)
{
Conv_grphdl_flags_buf_t grphdl_flags_buf;
Lm_list *lml = ghp->gh_ownlml;
const char *str;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
if (ghp->gh_ownlmp)
str = NAME(ghp->gh_ownlmp);
else
str = MSG_INTL(MSG_STR_ORPHAN);
if (hdl_title) {
hdl_title = 0;
Dbg_util_nl(lml, DBG_NL_STD);
}
if (name)
dbg_print(lml, MSG_INTL(MSG_FIL_HDL_RETAIN), str, name);
else
dbg_print(lml, MSG_INTL(MSG_FIL_HDL_COLLECT), str,
conv_grphdl_flags(ghp->gh_flags, &grphdl_flags_buf));
}
void
Dbg_file_hdl_action(Grp_hdl *ghp, Rt_map *lmp, int type, uint_t flags)
{
Conv_grpdesc_flags_buf_t grpdesc_flags_buf;
const char *mode, *group;
Lm_list *lml = LIST(lmp);
Msg str;
static const Msg fmt[] = {
MSG_FIL_DEP_ADD, /* MSG_INTL(MSG_FIL_DEP_ADD) */
MSG_FIL_DEP_UPDATE, /* MSG_INTL(MSG_FIL_DEP_UPDATE) */
MSG_FIL_DEP_DELETE, /* MSG_INTL(MSG_FIL_DEP_DELETE) */
MSG_FIL_DEP_REMOVE, /* MSG_INTL(MSG_FIL_DEP_REMOVE) */
MSG_FIL_DEP_REMAIN, /* MSG_INTL(MSG_FIL_DEP_REMAIN) */
MSG_FIL_DEP_ORPHAN, /* MSG_INTL(MSG_FIL_DEP_ORPHAN) */
MSG_FIL_DEP_REINST, /* MSG_INTL(MSG_FIL_DEP_REINST) */
};
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
if (hdl_title) {
Dbg_util_nl(lml, DBG_NL_STD);
if (hdl_str) {
Conv_grphdl_flags_buf_t grphdl_flags_buf;
const char *name;
/*
* Protect ourselves in case this handle has no
* originating owner.
*/
if (ghp->gh_ownlmp)
name = NAME(ghp->gh_ownlmp);
else
name = MSG_INTL(MSG_STR_UNKNOWN);
dbg_print(lml, MSG_INTL(hdl_str), name,
conv_grphdl_flags(ghp->gh_flags, &grphdl_flags_buf),
EC_NATPTR(ghp));
}
hdl_title = 0;
}
/*
* Establish a binding descriptor format string.
*/
if (type > DBG_DEP_REINST)
return;
str = fmt[type];
if (((type == DBG_DEP_ADD) || (type == DBG_DEP_UPDATE)) && flags)
group = conv_grpdesc_flags(flags, &grpdesc_flags_buf);
else
group = MSG_ORIG(MSG_STR_EMPTY);
if ((MODE(lmp) & (RTLD_GLOBAL | RTLD_NODELETE)) ==
(RTLD_GLOBAL | RTLD_NODELETE))
mode = MSG_ORIG(MSG_MODE_GLOBNODEL);
else if (MODE(lmp) & RTLD_GLOBAL)
mode = MSG_ORIG(MSG_MODE_GLOB);
else if (MODE(lmp) & RTLD_NODELETE)
mode = MSG_ORIG(MSG_MODE_NODEL);
else
mode = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(lml, MSG_INTL(str), NAME(lmp), mode, group);
}
void
Dbg_file_bind_entry(Lm_list *lml, Bnd_desc *bdp)
{
Conv_bnd_type_buf_t bnd_type_buf;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
/*
* Print the dependency together with the modes of the binding.
*/
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_BND_ADD), NAME(bdp->b_caller));
dbg_print(lml, MSG_INTL(MSG_FIL_BND_FILE), NAME(bdp->b_depend),
conv_bnd_type(bdp->b_flags, &bnd_type_buf));
}
void
Dbg_file_bindings(Rt_map *lmp, int flag)
{
Conv_bnd_obj_buf_t bnd_obj_buf;
Conv_bnd_type_buf_t bnd_type_buf;
const char *str;
Rt_map *tlmp;
Lm_list *lml = LIST(lmp);
int next = 0;
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
if (flag & RT_SORT_REV)
str = MSG_ORIG(MSG_SCN_INIT);
else
str = MSG_ORIG(MSG_SCN_FINI);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_DEP_TITLE), str,
conv_bnd_obj(lml->lm_flags, &bnd_obj_buf));
/* LINTED */
for (tlmp = lmp; tlmp; tlmp = (Rt_map *)NEXT(tlmp)) {
Bnd_desc *bdp;
Aliste idx;
/*
* For .init processing, only collect objects that have been
* relocated and haven't already been collected.
* For .fini processing, only collect objects that have had
* their .init collected, and haven't already been .fini
* collected.
*/
if (flag & RT_SORT_REV) {
if ((FLAGS(tlmp) & (FLG_RT_RELOCED |
FLG_RT_INITCLCT)) != FLG_RT_RELOCED)
continue;
} else {
if ((flag & RT_SORT_DELETE) &&
((FLAGS(tlmp) & FLG_RT_DELETE) == 0))
continue;
if (((FLAGS(tlmp) &
(FLG_RT_INITCLCT | FLG_RT_FINICLCT)) ==
FLG_RT_INITCLCT) == 0)
continue;
}
if (next++)
Dbg_util_nl(lml, DBG_NL_STD);
if (DEPENDS(tlmp) == NULL)
dbg_print(lml, MSG_INTL(MSG_FIL_DEP_NONE), NAME(tlmp));
else {
dbg_print(lml, MSG_INTL(MSG_FIL_DEP_ENT), NAME(tlmp));
for (APLIST_TRAVERSE(DEPENDS(tlmp), idx, bdp)) {
dbg_print(lml, MSG_INTL(MSG_FIL_BND_FILE),
NAME(bdp->b_depend),
conv_bnd_type(bdp->b_flags,
&bnd_type_buf));
}
}
}
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_file_bindings_done(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
DBG_CALL(Dbg_util_nl(lml, DBG_NL_STD));
}
void
Dbg_file_lazyload(Rt_map *clmp, const char *fname, const char *sname)
{
Lm_list *lml = LIST(clmp);
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_LAZYLOAD), fname, NAME(clmp),
Dbg_demangle_name(sname));
}
void
Dbg_file_preload(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_PRELOAD), name);
}
void
Dbg_file_needed(Rt_map *lmp, const char *name)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_NEEDED), name, NAME(lmp));
}
void
Dbg_file_filter(Lm_list *lml, const char *filter, const char *filtee,
int config)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
if (config)
dbg_print(lml, MSG_INTL(MSG_FIL_FILTER_1), filter, filtee);
else
dbg_print(lml, MSG_INTL(MSG_FIL_FILTER_2), filter, filtee);
}
void
Dbg_file_filtee(Lm_list *lml, const char *filter, const char *filtee, int audit)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
if (audit)
dbg_print(lml, MSG_INTL(MSG_FIL_FILTEE_3), filtee);
else if (filter)
dbg_print(lml, MSG_INTL(MSG_FIL_FILTEE_1), filtee, filter);
else
dbg_print(lml, MSG_INTL(MSG_FIL_FILTEE_2), filtee);
}
void
Dbg_file_fixname(Lm_list *lml, const char *oname, const char *nname)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_FIXNAME), oname, nname);
}
void
Dbg_file_output(Ofl_desc *ofl)
{
const char *prefix = MSG_ORIG(MSG_PTH_OBJECT);
char *oname, *nname, *ofile;
int fd;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
/*
* Obtain the present input object filename for concatenation to the
* prefix name.
*/
oname = (char *)ofl->ofl_name;
if ((ofile = strrchr(oname, '/')) == NULL)
ofile = oname;
else
ofile++;
/*
* Concatenate the prefix with the object filename, open the file and
* write out the present Elf memory image. As this is debugging we
* ignore all errors.
*/
if ((nname = malloc(strlen(prefix) + strlen(ofile) + 1)) != 0) {
(void) strcpy(nname, prefix);
(void) strcat(nname, ofile);
if ((fd = open(nname, O_RDWR | O_CREAT | O_TRUNC,
0666)) != -1) {
(void) write(fd, ofl->ofl_nehdr, ofl->ofl_size);
(void) close(fd);
}
free(nname);
}
}
void
Dbg_file_config_dis(Lm_list *lml, const char *config, int features)
{
Conv_config_feat_buf_t config_feat_buf;
const char *str;
if (features == 0)
return;
switch (features & ~CONF_FEATMSK) {
case DBG_CONF_IGNORE:
str = MSG_INTL(MSG_FIL_CONFIG_ERR_1);
break;
case DBG_CONF_VERSION:
str = MSG_INTL(MSG_FIL_CONFIG_ERR_2);
break;
case DBG_CONF_PRCFAIL:
str = MSG_INTL(MSG_FIL_CONFIG_ERR_3);
break;
case DBG_CONF_CORRUPT:
str = MSG_INTL(MSG_FIL_CONFIG_ERR_4);
break;
case DBG_CONF_ABIMISMATCH:
str = MSG_INTL(MSG_FIL_CONFIG_ERR_5);
break;
default:
str = conv_config_feat(features, &config_feat_buf);
break;
}
Dbg_util_nl(lml, DBG_NL_FRC);
dbg_print(lml, MSG_INTL(MSG_FIL_CONFIG_ERR), config, str);
Dbg_util_nl(lml, DBG_NL_FRC);
}
void
Dbg_file_config_obj(Lm_list *lml, const char *dir, const char *file,
const char *config)
{
char *name, _name[PATH_MAX];
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (file) {
(void) snprintf(_name, PATH_MAX, MSG_ORIG(MSG_FMT_PATH),
dir, file);
name = _name;
} else
name = (char *)dir;
dbg_print(lml, MSG_INTL(MSG_FIL_CONFIG), name, config);
}
void
Dbg_file_del_rescan(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_DEL_RESCAN));
}
void
Dbg_file_mode_promote(Rt_map *lmp, int mode)
{
Conv_dl_mode_buf_t dl_mode_buf;
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_PROMOTE), NAME(lmp),
conv_dl_mode(mode, 0, &dl_mode_buf));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_file_deferred(Lm_list *lml, const char *oname, const char *nname)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_DEFERRED), oname, nname);
}
void
Dbg_file_cntl(Lm_list *lml, Aliste flmco, Aliste tlmco)
{
Lm_cntl *lmc;
Aliste off;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_CNTL_TITLE), EC_XWORD(flmco),
EC_XWORD(tlmco));
for (ALIST_TRAVERSE_BY_OFFSET(lml->lm_lists, off, lmc)) {
Rt_map *lmp;
/* LINTED */
for (lmp = lmc->lc_head; lmp; lmp = (Rt_map *)NEXT(lmp))
dbg_print(lml, MSG_ORIG(MSG_CNTL_ENTRY), EC_XWORD(off),
NAME(lmp));
}
Dbg_util_nl(lml, DBG_NL_STD);
}
/*
* Report archive rescan operation.
* argv_start_ndx, argv_end_ndx - Index range of command line arguments
* from which archives are to be reprocessed.
*/
void
Dbg_file_ar_rescan(Lm_list *lml, int argv_start_ndx, int argv_end_ndx)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_AR_RESCAN),
argv_start_ndx, argv_end_ndx);
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_file_ar(Lm_list *lml, const char *name, Boolean again)
{
const char *str;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (again)
str = MSG_INTL(MSG_STR_AGAIN);
else
str = MSG_ORIG(MSG_STR_EMPTY);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_ARCHIVE), name, str);
}
void
Dbg_file_generic(Lm_list *lml, Ifl_desc *ifl)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_BASIC), ifl->ifl_name,
conv_ehdr_type(ifl->ifl_ehdr->e_ident[EI_OSABI],
ifl->ifl_ehdr->e_type, 0, &inv_buf));
}
#if SGS_REJ_NUM != (SGS_REJ_HWCAP_3 + 1)
#error SGS_REJ_NUM has changed
#endif
static const Msg reject[SGS_REJ_NUM] = {
MSG_STR_EMPTY,
MSG_REJ_MACH, /* MSG_INTL(MSG_REJ_MACH) */
MSG_REJ_CLASS, /* MSG_INTL(MSG_REJ_CLASS) */
MSG_REJ_DATA, /* MSG_INTL(MSG_REJ_DATA) */
MSG_REJ_TYPE, /* MSG_INTL(MSG_REJ_TYPE) */
MSG_REJ_BADFLAG, /* MSG_INTL(MSG_REJ_BADFLAG) */
MSG_REJ_MISFLAG, /* MSG_INTL(MSG_REJ_MISFLAG) */
MSG_REJ_VERSION, /* MSG_INTL(MSG_REJ_VERSION) */
MSG_REJ_HAL, /* MSG_INTL(MSG_REJ_HAL) */
MSG_REJ_US3, /* MSG_INTL(MSG_REJ_US3) */
MSG_REJ_STR, /* MSG_INTL(MSG_REJ_STR) */
MSG_REJ_UNKFILE, /* MSG_INTL(MSG_REJ_UNKFILE) */
MSG_REJ_UNKCAP, /* MSG_INTL(MSG_REJ_UNKCAP) */
MSG_REJ_HWCAP_1, /* MSG_INTL(MSG_REJ_HWCAP_1) */
MSG_REJ_SFCAP_1, /* MSG_INTL(MSG_REJ_SFCAP_1) */
MSG_REJ_MACHCAP, /* MSG_INTL(MSG_REJ_MACHCAP) */
MSG_REJ_PLATCAP, /* MSG_INTL(MSG_REJ_PLATCAP) */
MSG_REJ_HWCAP_2, /* MSG_INTL(MSG_REJ_HWCAP_2) */
MSG_REJ_ARCHIVE, /* MSG_INTL(MSG_REJ_ARCHIVE) */
MSG_REJ_KMOD, /* MSG_INTL(MSG_REJ_KMOD) */
MSG_REJ_HWCAP_3 /* MSG_INTL(MSG_REJ_HWCAP_3) */
};
void
Dbg_file_rejected(Lm_list *lml, Rej_desc *rej, Half mach)
{
Conv_reject_desc_buf_t rej_buf;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(reject[rej->rej_type]), rej->rej_name ?
rej->rej_name : MSG_INTL(MSG_STR_UNKNOWN),
conv_reject_desc(rej, &rej_buf, mach));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_file_reuse(Lm_list *lml, const char *nname, const char *oname)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_REUSE), nname, oname);
}
void
Dbg_file_skip(Lm_list *lml, const char *oname, const char *nname)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (oname && strcmp(nname, oname))
dbg_print(lml, MSG_INTL(MSG_FIL_SKIP_1), nname, oname);
else
dbg_print(lml, MSG_INTL(MSG_FIL_SKIP_2), nname);
}
void
Dbg_file_modified(Lm_list *lml, const char *obj, const char *oname,
const char *nname, int ofd, int nfd, Elf *oelf, Elf *nelf)
{
const char *str;
if (DBG_NOTCLASS(DBG_C_FILES | DBG_C_SUPPORT))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_MODIFIED), oname, obj);
if (nname != oname)
dbg_print(lml, MSG_INTL(MSG_FIL_NAMECHANGE), nname);
if (nfd != ofd) {
if (nfd == -1)
str = MSG_INTL(MSG_FIL_IGNORE);
else
str = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(lml, MSG_INTL(MSG_FIL_FDCHANGE), ofd, nfd, str);
}
if (nelf != oelf) {
if (nelf == 0)
str = MSG_INTL(MSG_FIL_IGNORE);
else
str = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(lml, MSG_INTL(MSG_FIL_ELFCHANGE), EC_NATPTR(oelf),
EC_NATPTR(nelf), str);
}
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_file_cleanup(Lm_list *lml, const char *name, Aliste lmco)
{
if (DBG_NOTCLASS(DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_FIL_CLEANUP), name, EC_XWORD(lmco));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include "_debug.h"
#include "msg.h"
#include "libld.h"
static int
Dbg_got_compare(Gottable *gtp1, Gottable *gtp2)
{
Gotndx *gnp1 = >p1->gt_gndx;
Gotndx *gnp2 = >p2->gt_gndx;
if (gnp1->gn_gotndx > gnp2->gn_gotndx)
return (1);
if (gnp1->gn_gotndx < gnp2->gn_gotndx)
return (-1);
return (0);
}
void
Dbg_got_display(Ofl_desc *ofl, Off goff, int stage,
Word m_got_xnumber, size_t m_got_entsize)
{
Lm_list *lml = ofl->ofl_lml;
Gottable *gtp = ofl->ofl_gottable;
Word gotndx;
Xword *gptr;
if (DBG_NOTCLASS(DBG_C_GOT))
return;
if (ofl->ofl_gotcnt == m_got_xnumber)
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_GOT_INFO), EC_WORD(ofl->ofl_gotcnt));
if (DBG_NOTDETAIL())
return;
qsort((char *)gtp, ofl->ofl_gotcnt, sizeof (Gottable),
(int(*)(const void *, const void *))Dbg_got_compare);
if (stage == 0)
dbg_print(lml, MSG_INTL(MSG_GOT_COLUMNS1));
else
dbg_print(lml, MSG_INTL(MSG_GOT_COLUMNS2));
gptr = (Xword *)ofl->ofl_osgot->os_outdata->d_buf;
for (gotndx = 0; gotndx < ofl->ofl_gotcnt; gotndx++, gtp++, gptr++) {
Sym_desc *sdp = gtp->gt_sym;
const char *refstr, *name;
Gotndx *gnp = >p->gt_gndx;
Lword gotaddval;
Off off = goff + (gotndx * m_got_entsize);
char index[INDEX_STR_SIZE];
(void) snprintf(index, INDEX_STR_SIZE, MSG_ORIG(MSG_GOT_INDEX),
EC_SWORD(gnp->gn_gotndx));
if (sdp == 0)
refstr = MSG_ORIG(MSG_STR_EMPTY);
else if (sdp->sd_flags & FLG_SY_SMGOT)
refstr = MSG_ORIG(MSG_GOT_SMALL_PIC);
else
refstr = MSG_ORIG(MSG_GOT_BIG_PIC);
if (sdp == 0)
name = MSG_ORIG(MSG_STR_EMPTY);
else if (sdp->sd_name)
name = Dbg_demangle_name(sdp->sd_name);
else
name = MSG_INTL(MSG_STR_UNKNOWN);
if (stage == 0)
gotaddval = gnp->gn_addend;
else
gotaddval = *gptr;
if ((sdp == 0) || (sdp->sd_sym->st_shndx == SHN_UNDEF) ||
(sdp->sd_file == 0)) {
dbg_print(lml, MSG_INTL(MSG_GOT_FORMAT1), index,
refstr, EC_OFF(off), EC_XWORD(gotaddval), name);
} else {
dbg_print(lml, MSG_INTL(MSG_GOT_FORMAT2), index,
refstr, EC_OFF(off), EC_XWORD(gotaddval),
sdp->sd_file->ifl_name, name);
}
}
}
void
Elf_got_title(Lm_list *lml)
{
dbg_print(lml, MSG_INTL(MSG_GOT_TITLE));
}
void
Elf_got_entry(Lm_list *lml, Sword ndx, Addr addr, Xword value, Half mach,
uchar_t ei_target_data, uchar_t ei_host_data, Word type, void *reloc,
const char *name)
{
Rela *rela;
Rel *rel;
const char *str;
Conv_inv_buf_t inv_buf;
char index[INDEX_STR_SIZE];
(void) snprintf(index, INDEX_STR_SIZE, MSG_ORIG(MSG_GOT_INDEX),
EC_SWORD(ndx));
/*
* Got sections are SHT_PROGBITS, and are therefore not xlated by
* libelf. If the target system has a different byte order than
* the system displaying the data, swap the bytes so they are
* presented properly.
*/
if (ei_target_data != ei_host_data)
value = BSWAP_XWORD(value);
if (reloc) {
if (type == SHT_RELA) {
rela = (Rela *)reloc;
str = conv_reloc_type(mach,
ELF_R_TYPE(rela->r_info, mach), 0, &inv_buf);
} else {
rel = (Rel *)reloc;
str = conv_reloc_type(mach,
ELF_R_TYPE(rel->r_info, mach), 0, &inv_buf);
}
if (name)
name = Elf_demangle_name(name);
else
name = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(lml, MSG_INTL(MSG_GOT_ENTRY_RE), index, EC_ADDR(addr),
EC_XWORD(value), str, name);
} else
dbg_print(lml, MSG_INTL(MSG_GOT_ENTRY_NR), index, EC_ADDR(addr),
EC_XWORD(value));
}
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2022 Oxide Computer Company
#
@ _START_
# Message file for cmd/sgs/liblddbg.
@ MSG_ID_LIBLDDBG
# Usage messages
@ MSG_USE_UNRECOG "warning: unrecognized debug option (try help): %s"
@ MSG_USE_CNTNEGOPT "warning: ignoring non-negatable debug option: %s"
@ MSG_USE_HDR_DCT "Display Control Tokens:"
@ MSG_USE_HDR_CST "Category Selection Tokens:"
@ MSG_USE_HDR_BOTH " [ld and ld.so.1]"
@ MSG_USE_HDR_RTLD " [ld.so.1 only]"
@ MSG_USE_HDR_LD " [ld only]"
# TRANSLATION_NOTE - Use the following output in the C locale as reference 1.
#
# The runtime linker and link-editor support a shared debugging
# facility. Options are selected via a comma separated list of tokens,
# each of which specifies a display option or a category for which
# information is desired. Many tokens apply to both linker components,
# while some are specific to one or the other. Diagnostics are printed,
# one per line, with a standard prefix prepended to each one. Diagnostic
# output is sent to stderr unless otherwise redirected.
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
@ MSG_USE_R1_A "The runtime linker and link-editor support a \
shared debugging"
@ MSG_USE_R1_B "facility. Options are selected via a comma separated list \
of tokens,"
@ MSG_USE_R1_C "each of which specifies a display option or a category \
for which"
@ MSG_USE_R1_D "information is desired. Many tokens apply to both linker \
components,"
@ MSG_USE_R1_E "while some are specific to one or the other. Diagnostics \
are printed,"
@ MSG_USE_R1_F "one per line, with a standard prefix prepended to each one. \
Diagnostic"
# TRANSLATION_NOTE -- do not translate "stderr"
@ MSG_USE_R1_G "output is sent to stderr unless otherwise redirected."
# TRANSLATION_NOTE - End of reference 1
# TRANSLATION_NOTE - Use the following output in the C locale as reference 2.
#
# Runtime Linking (ld.so.1):
# Diagnostics that trace the runtime linking of an application
# can be enabled via the LD_DEBUG environment variable:
# LD_DEBUG=token1,token2 app ...
# In addition to the "output" token described below, diagnostic
# output from the runtime linker can be redirected to an output
# file using the additional environment variable:
# LD_DEBUG_OUTPUT=file
# If the "output" token and LD_DEBUG_OUTPUT are both specified,
# the file specified by LD_DEBUG_OUTPUT is used. If LD_DEBUG_OUTPUT
# is used, the output file name is suffixed with the process id.
# An output file specified via the "output" token is used as
# specified, without a process id suffix. Use of the "output"
# token with programs that call fork() results in each process
# writing debug output to the same file. The debug output will be
# jumbled and incomplete. LD_DEBUG_OUTPUT should be used in such
# cases to direct debug output for each process to a unique file.
#
# All runtime linker diagnostics are prepended with the process
# id. If thread capabilities are enabled for the process, the
# thread id is also shown. All Solaris applications are thread
# capable, and a single threaded application may use threads via
# the libraries it links to. Diagnostics from such applications
# reference thread id 1.
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
@ MSG_USE_R2_A "Runtime Linking (ld.so.1):"
@ MSG_USE_R2_B " Diagnostics that trace the runtime linking \
of an application"
# TRANSLATION_NOTE -- do not translate "LD_DEBUG"
@ MSG_USE_R2_C " can be enabled via the LD_DEBUG environment variable:"
# TRANSLATION_NOTE -- do not translate "LD_DEBUG"
@ MSG_USE_R2_D " LD_DEBUG=token1,token2 app ..."
# TRANSLATION_NOTE -- do not translate "output"
@ MSG_USE_R2_E " In addition to the \"output\" token described \
below, diagnostic"
@ MSG_USE_R2_F " output from the runtime linker can be redirected to \
an output"
@ MSG_USE_R2_G " file using the additional environment variable:"
# TRANSLATION_NOTE -- do not translate "LD_DEBUG_OUTPUT"
@ MSG_USE_R2_H " LD_DEBUG_OUTPUT=file"
# TRANSLATION_NOTE -- do not translate "output" or "LD_DEBUG_OUTPUT"
@ MSG_USE_R2_I " If the \"output\" token and LD_DEBUG_OUTPUT are \
both specified,"
# TRANSLATION_NOTE -- do not translate "LD_DEBUG_OUTPUT"
@ MSG_USE_R2_J " the file specified by LD_DEBUG_OUTPUT is used. \
If LD_DEBUG_OUTPUT"
@ MSG_USE_R2_K " is used, the output file name is suffixed with \
the process id."
# TRANSLATION_NOTE -- do not translate "output"
@ MSG_USE_R2_L " An output file specified via the \"output\" token \
is used as"
# TRANSLATION_NOTE -- do not translate "output"
@ MSG_USE_R2_M " specified, without a process id suffix. Use \
of the \"output\""
# TRANSLATION_NOTE -- do not translate "fork"
@ MSG_USE_R2_N " token with programs that call fork() results in \
each process"
@ MSG_USE_R2_O " writing debug output to the same file. The debug \
output will be"
@ MSG_USE_R2_P " jumbled and incomplete. LD_DEBUG_OUTPUT should be \
used in such"
@ MSG_USE_R2_Q " cases to direct debug output for each process to \
a unique file."
@ MSG_USE_R2_R " All runtime linker diagnostics are prepended with \
the process"
@ MSG_USE_R2_S " id. If thread capabilities are enabled for the \
process, the"
@ MSG_USE_R2_T " thread id is also shown. All Solaris applications are \
thread"
@ MSG_USE_R2_U " capable, and a single threaded application may \
use threads via"
@ MSG_USE_R2_V " the libraries it links to. Diagnostics from such \
applications"
@ MSG_USE_R2_W " reference thread id 1."
# TRANSLATION_NOTE - End of reference 2
# TRANSLATION_NOTE - Use the following output in the C locale as reference 3.
#
# Link-Editing (ld):
# Diagnostics that trace the link-editing of an application are
# enabled using the -D option:
# ld -Dtoken1,token2 -o prog ...
# As compiler drivers may assign -D a different meaning, the
# LD_OPTIONS environment variable is often used:
# LD_OPTIONS=-Dtoken1,token2 cc -o prog ...
#
# The position of -D on the link-edit command line is significant.
# Diagnostics are enabled when a debug token is first encountered,
# and can be switched off by prepending the token with "!".
#
# Diagnostic output can be directed to a file using the "output"
# token, The output file is used as specified, without a process
# id suffix.
#
# All link-editor diagnostics are prepended with the string "debug".
#
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
@ MSG_USE_R3_A " Link-Editing (ld):"
@ MSG_USE_R3_B " Diagnostics that trace the link-editing of an \
application are"
@ MSG_USE_R3_C " enabled using the -D option:"
@ MSG_USE_R3_D " ld -Dtoken1,token2 -o prog ..."
@ MSG_USE_R3_E " As compiler drivers may assign -D a different meaning, the"
# TRANSLATION_NOTE -- do not translate "LD_OPTIONS"
@ MSG_USE_R3_F " LD_OPTIONS environment variable is often used:"
# TRANSLATION_NOTE -- do not translate "LD_OPTIONS"
@ MSG_USE_R3_G " LD_OPTIONS=-Dtoken1,token2 cc -o prog ..."
@ MSG_USE_R3_H " The position of -D on the link-edit command line \
is significant."
@ MSG_USE_R3_I " Diagnostics are enabled when a debug token is \
first encountered,"
@ MSG_USE_R3_J " and can be switched off by prepending the token \
with \"!\"."
# TRANSLATION_NOTE -- do not translate "output"
@ MSG_USE_R3_K " Diagnostic output can be directed to a file using \
the \"output\""
@ MSG_USE_R3_L " token, The output file is used as specified, \
without a process"
@ MSG_USE_R3_M " id suffix."
# TRANSLATION_NOTE -- do not translate "debug"
@ MSG_USE_R3_N " All link-editor diagnostics are prepended with the \
string \"debug\"."
# TRANSLATION_NOTE - End of reference 3
# TRANSLATION_NOTE - Use the following output in the C locale as reference 4.
#
# demangle show C++ symbol names in their demangled form
# detail provide more information in conjunction with
# other options
# dtime prepend a time delta to diagnostics. The value
# appears as seconds.fraction, and represents
# the elapsed time since that last diagnostic.
# long display long object names without truncation
# output=file debug output is sent to the named file
# instead of stderr. If file is empty (\"\"),
# following output will be sent to stderr.
# ttime prepend a time stamp to diagnostics. The value
# appears as seconds.fraction, and represents
# the time since entering ld or ld.so.1.
# Note, all diagnostics induce a probe affect,
# which should be taken into account when
# interpreting dtime and ttime information.
#
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
# TRANSLATION_NOTE -- do not translate the first token "demangle".
@ MSG_USE_R4_A " demangle show C++ symbol names in their \
demangled form"
# TRANSLATION_NOTE -- do not translate the first token "detail".
@ MSG_USE_R4_B " detail provide more information in \
conjunction with"
@ MSG_USE_R4_B2 " other options"
# TRANSLATION_NOTE -- do not translate the first token "dtime".
@ MSG_USE_R4_C " dtime prepend a time delta to diagnostics. \
The value"
@ MSG_USE_R4_C2 " appears as seconds.fraction, and \
represents"
@ MSG_USE_R4_C3 " the elapsed time since that last \
diagnostic."
# TRANSLATION_NOTE -- do not translate the first token "long".
@ MSG_USE_R4_D " long display long object names without \
truncation"
# TRANSLATION_NOTE -- do not translate the first token "output".
@ MSG_USE_R4_E " output=file debug output is sent to the \
named file"
@ MSG_USE_R4_E2 " instead of stderr. If file is \
empty (\"\"),"
@ MSG_USE_R4_E3 " following output will be \
sent to stderr."
# TRANSLATION_NOTE -- do not translate the first token "ttime".
@ MSG_USE_R4_F " ttime prepend a time stamp to diagnostics. \
The value"
@ MSG_USE_R4_F2 " appears as seconds.fraction, and \
represents"
@ MSG_USE_R4_F3 " the time since entering ld or \
ld.so.1."
@ MSG_USE_R4_F4 " Note all diagnostics induce a \
probe affect,"
@ MSG_USE_R4_F5 " which should be taken into \
account when"
@ MSG_USE_R4_F6 " interpreting dtime and ttime \
information."
# TRANSLATION_NOTE - End of reference 4
# TRANSLATION_NOTE - Use the following output in the C locale as reference 5.
#
# lmid[=name] prepend link-map list id to diagnostics, and
# optionally filter the lists: By default,
# diagnostics are produced for all link-map
# lists except that of the runtime linker
# (ldso), without identification. "lmid" causes
# the link-map list id to be prepended.
# "name" limits diagnostics to the named
# link-map list. Additional "lmid" tokens
# can specify multiple link-map lists.
# Valid names are:
# all all link-map lists except ldso
# alt all alternative link-map lists
# alt[0-9]+ specific alternative link-map list
# base the base, or main, link-map list
# ldso the runtime linker link-map list
#
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
# TRANSLATION_NOTE -- do not translate the first token "lmid".
@ MSG_USE_R5_A " lmid[=name] prepend link-map list id to \
diagnostics, and"
@ MSG_USE_R5_A2 " optionally filter the lists: By \
default,"
@ MSG_USE_R5_A3 " diagnostics are produced for all \
link-map"
@ MSG_USE_R5_A4 " lists except that of the runtime \
linker"
@ MSG_USE_R5_A5 " (ldso), without identification. \
\"lmid\" causes"
# TRANSLATION_NOTE -- do not translate "name"
@ MSG_USE_R5_A6 " the link-map list id to be prepended."
@ MSG_USE_R5_A7 " \"name\" limits diagnostics to the \
named"
@ MSG_USE_R5_A8 " link-map list. Additional \"lmid\" \
tokens"
@ MSG_USE_R5_A9 " can specify multiple link-map \
lists."
@ MSG_USE_R5_A0 " Valid names are:"
# TRANSLATION_NOTE -- do not translate the token "all".
@ MSG_USE_R5_B " all all link-map lists \
except ldso"
# TRANSLATION_NOTE -- do not translate the token "alt".
@ MSG_USE_R5_C " alt all alternative \
link-map lists"
# TRANSLATION_NOTE -- do not translate the token "alt".
@ MSG_USE_R5_D " alt[0-9]+ specific alt \
link-map list"
# TRANSLATION_NOTE -- do not translate the token "base".
@ MSG_USE_R5_E " base base (main) \
link-map list"
@ MSG_USE_R5_F " ldso runtime linker \
link-map list "
# TRANSLATION_NOTE - End of reference 5
# TRANSLATION_NOTE - Use the following output in the C locale as reference 6.
#
# name prepend output file basename to diagnostics
# fullname prepend full output file name to diagnostics
# class prepend output file elfclass (32/64) to
# diagnostics
#
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
# TRANSLATION_NOTE -- do not translate the first token "name".
@ MSG_USE_R6_A " name prepend output file basename \
to diagnostics"
# TRANSLATION_NOTE -- do not translate the first token "fullname".
@ MSG_USE_R6_B " fullname prepend full output file name \
to diagnostics"
# TRANSLATION_NOTE -- do not translate the first token "class".
@ MSG_USE_R6_C " class prepend output file elfclass \
(32/64) to"
@ MSG_USE_R6_C2 " diagnostics"
# TRANSLATION_NOTE - End of reference 6
# TRANSLATION_NOTE - Use the following output in the C locale as reference 7.
#
# all display information for all categories
# basic basic trace information/warnings
# cap platform/machine/hardware/software capabilities
# files input file processing (files and libraries)
# help this help message
# libs library search paths; detail flag shows
# actual library lookup (-l) processing
# move move sections
# reloc relocations
# symbols symbol tables; detail flag shows internal
# symbol table addition and resolution (ld only)
# tls thread local storage (TLS)
# unused unused/unreferenced files; detail flag
# shows unused sections (ld only)
# versions ELF versioning
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
# TRANSLATION_NOTE -- do not translate the first token "all".
@ MSG_USE_R7_A " all display information for \
all categories"
# TRANSLATION_NOTE -- do not translate the first token "basic".
@ MSG_USE_R7_B " basic basic trace information/warnings"
# TRANSLATION_NOTE -- do not translate the first token "cap".
@ MSG_USE_R7_C " cap platform/machine/hardware/software \
capabilities"
# TRANSLATION_NOTE -- do not translate the first token "files".
@ MSG_USE_R7_D " files input file processing (files \
and libraries)"
# TRANSLATION_NOTE -- do not translate the first token "help".
@ MSG_USE_R7_E " help this help message"
# TRANSLATION_NOTE -- do not translate the first token "libs".
@ MSG_USE_R7_F " libs library search paths; detail \
flag shows"
@ MSG_USE_R7_F2 " actual library lookup (-l) \
processing"
# TRANSLATION_NOTE -- do not translate the first token "move".
@ MSG_USE_R7_G " move move sections"
# TRANSLATION_NOTE -- do not translate the first token "reloc".
@ MSG_USE_R7_H " reloc relocations"
# TRANSLATION_NOTE -- do not translate the first token "symbols".
@ MSG_USE_R7_I " symbols symbol tables; detail flag shows \
internal"
@ MSG_USE_R7_I2 " symbol table addition/resolution \
(ld only)"
# TRANSLATION_NOTE -- do not translate the first token "tls".
@ MSG_USE_R7_J " tls thread local storage (TLS)"
# TRANSLATION_NOTE -- do not translate the first token "unused".
@ MSG_USE_R7_K " unused unused/unreferenced files; \
detail flag"
@ MSG_USE_R7_K2 " shows unused sections (ld only)"
# TRANSLATION_NOTE -- do not translate the first token "versions".
@ MSG_USE_R7_L " versions ELF versioning"
# TRANSLATION_NOTE - End of reference 7
# TRANSLATION_NOTE - Use the following output in the C locale as reference 8.
#
# audit runtime link-audit processing
# bindings symbol binding; detail flag shows
# absolute:relative addresses
# callback user supplied code executed by ld.so.1
# (i.e. dl_iterate_phdr)
# init init and fini processing
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
# TRANSLATION_NOTE -- do not translate the first token "audit".
@ MSG_USE_R8_A " audit runtime link-audit processing"
# TRANSLATION_NOTE -- do not translate the first token "bindings".
@ MSG_USE_R8_B " bindings symbol binding; detail flag shows"
@ MSG_USE_R8_B2 " absolute:relative addresses"
# TRANSLATION_NOTE -- do not translate the first token "dl".
@ MSG_USE_R8_C " dl user calls to the dl*() family"
# TRANSLATION_NOTE -- do not translate the first token "init".
@ MSG_USE_R8_D " init init and fini processing"
# TRANSLATION_NOTE - End of reference 8
# TRANSLATION_NOTE - Use the following output in the C locale as reference 9.
#
# args input arguments
# entry entrance criteria descriptors
# got GOT symbol information
# map mapfile processing
# sections input sections
# segments output segments and address/offset processing;
# detail flag shows associated sections
# statistics symbol table and relocation statistics
# strtab string table compression statistics;
# detail flag shows layout of string tables
# support support libraries
# TRANSLATION_NOTE - The next series of messages makes the above output in C
# locale.
# TRANSLATION_NOTE -- do not translate the first token "args".
@ MSG_USE_R9_A " args input arguments"
# TRANSLATION_NOTE -- do not translate the first token "entry".
@ MSG_USE_R9_B " entry entrance criteria descriptors"
# TRANSLATION_NOTE -- do not translate the first token "got".
@ MSG_USE_R9_C " got GOT symbol information"
# TRANSLATION_NOTE -- do not translate the first token "map".
@ MSG_USE_R9_D " map mapfile processing"
# TRANSLATION_NOTE -- do not translate the first token "sections".
@ MSG_USE_R9_E " sections input sections"
# TRANSLATION_NOTE -- do not translate the first token "segments".
@ MSG_USE_R9_F " segments output segments and address/offset \
processing;"
@ MSG_USE_R9_F2 " detail flag shows associated \
sections"
# TRANSLATION_NOTE -- do not translate the first token "statistics".
@ MSG_USE_R9_G " statistics symbol table and relocation \
statistics"
# TRANSLATION_NOTE -- do not translate the first token "strtab".
@ MSG_USE_R9_H " strtab string table compression statistics;"
@ MSG_USE_R9_H2 " detail flag shows layout of \
string tables"
# TRANSLATION_NOTE -- do not translate the first token "support".
@ MSG_USE_R9_I " support support libraries"
# TRANSLATION_NOTE - End of reference 9
# Basic processing (ld).
@ MSG_BASIC_COLLECT "collect relocations"
@ MSG_BASIC_CREATE "create output image"
@ MSG_BASIC_FILES "process files"
@ MSG_BASIC_FINISHED "processing finished"
@ MSG_BASIC_OPTIONS "process options"
@ MSG_BASIC_RELOCATE "relocate output image"
@ MSG_BASIC_VALIDATE "validating symbols"
# Argument messages
@ MSG_ARG_OPTION "arg[%d]\toption=-%c"
@ MSG_ARG_OPTARG "arg[%d]\toption=-%c: option-argument: %s"
@ MSG_ARG_STR2CHR "arg[%d]\toption=-%s: translated: new option=-%c"
@ MSG_ARG_WLDEL "arg[%d]\toption=-W%s: translated: prefix -Wl,: \
removed"
@ MSG_ARG_FILE "arg[%d]\tfile=%s"
# Bindings messages
# NOTE: these are used by appcert(1) and lari(1), use care when changing.
@ MSG_BND_BASIC "binding file=%s to file=%s: symbol '%s'"
@ MSG_BND_PLT "binding file=%s (%#llx:%#llx) at plt[%lld]:%s to \
file=%s (%#llx:%#llx): symbol '%s'%s"
@ MSG_BND_DLSYM "binding file=%s (dlsym) to file=%s \
(%#llx:%#llx): symbol '%s'%s"
@ MSG_BND_DEFAULT "binding file=%s (%#llx:%#llx) to file=%s \
(%#llx:%#llx): symbol '%s'%s"
@ MSG_BND_WEAK_1 "binding file=%s to 0x0 (undefined weak): symbol '%s'"
@ MSG_BND_WEAK_2 "binding file=%s (%#llx:%#llx) to 0x0 \
(undefined weak): symbol '%s'"
# NOTE: the rejected message is used by lari(1), use care when changing. This
# message is formatted to conform to the pattern used by the MSG_BINFO messages.
@ MSG_BND_REJECT "binding file=%s to file=%s: symbol '%s' \
(rejected: %s)"
@ MSG_BNDREJ_DIRECT "attempt to directly bind to a NODIRECT definition"
@ MSG_BNDREJ_GROUP "attempt to bind within a group to a NODIRECT \
definition"
@ MSG_BNDREJ_SINGLE "attempt to bind to a SINGLETON definition without \
following default search model"
@ MSG_BND_PLTPAD_TO " pltpad: %#llx: file=%s bound to file=%s: \
symbol '%s'"
@ MSG_BND_PLTPAD_FROM " pltpad: %#llx: bound from file=%s: symbol '%s'"
@ MSG_BND_PSUM_SPARCV9 "Summary of PLT types bound: 21d=%d, 24d=%d, u32=%d, \
u44=%d, full=%d, far=%d, Total=%d"
@ MSG_BND_PSUM_SPARC "Summary of PLT types bound: 21d=%d, 24d=%d, \
full=%d, Total=%d"
@ MSG_BND_PSUM_DEFAULT "Summary of PLT types bound: total=%d"
# Relocation messages
@ MSG_REL_GENERATE "generating input relocations: section=%s"
@ MSG_REL_COLLECT "collecting input relocations: section=%s, file=%s"
@ MSG_REL_ACTIVE "performing active relocations"
@ MSG_REL_CREATING "creating output relocations"
@ MSG_REL_START "relocation processing: file=%s%s"
@ MSG_REL_FINISH "relocation processing: file=%s; finished%s"
@ MSG_REL_NONE "relocation processing: file=%s%s; nothing to do"
@ MSG_REL_PLT " (plt processing only)"
@ MSG_REL_FAIL " (failed)"
@ MSG_REL_BADROFFSET "<offset lies outside memory image; \
relocation discarded>"
@ MSG_REL_TRANSITION "relocation: %s: section=%s; input from file=%s; \
offset=0x%llx; symbol=%s; transitioned to: %s"
@ MSG_REL_DISCARDED "relocation against discarded section=%s from file=%s; \
relocation type=%s offset=0x%llx; relocation discarded"
@ MSG_REL_COPY "copy data from file=%s to file=%s: symbol '%s'%s"
@ MSG_REL_SLOPPYCOMDAT "the following relocation references a discarded \
section; relocation redirected to section %s in \
file %s"
# Entrance criteria messages
@ MSG_ECR_TITLE "Segment Entrance Criteria Descriptor List"
@ MSG_ECR_DESC "entrance descriptor[%u]"
# Elf Data (section) messages
# TRANSLATION_NOTE - the following two entries provide for a series of one or
# more standard 32-bit Elf_Data entries that align with the initial title.
@ MSG_EDATA_TITLE_32 " addr type size offset al file"
@ MSG_EDATA_ENTRY_32 " %3s %#10llx %-5s %#10llx %#8llx %2lld %s %s%s"
# TRANSLATION_NOTE - the following two entries provide for a series of one or
# more standard 64-bit Elf_Data entries that align with the initial title.
@ MSG_EDATA_TITLE_64 " addr type \
size offset al file"
@ MSG_EDATA_ENTRY_64 " %3s %#18llx %-5s %#18llx %#16llx %2lld %s %s%s"
@ MSG_EDATA_IGNSCN " (section ignored)"
# File messages
@ MSG_FIL_BASIC "file=%s [ %s ]"
@ MSG_FIL_ARCHIVE "file=%s [ archive ] %s"
@ MSG_FIL_SKIP_1 "file=%s; skipped: already processed as %s"
@ MSG_FIL_SKIP_2 "file=%s; skipped: already processed"
@ MSG_FIL_REUSE "file=%s; reusing: originally processed as %s"
@ MSG_FIL_PROT "file=%s; modifying memory protections (%c PROT_WRITE)"
@ MSG_FIL_DELETE "file=%s; deleting"
@ MSG_FIL_CLEANUP "file=%s; loading failed: cleaning up lmco 0x%llx"
@ MSG_FIL_LAZYLOAD "file=%s; lazy loading from file=%s: symbol=%s"
@ MSG_FIL_PRELOAD "file=%s; preloading"
@ MSG_FIL_NEEDED "file=%s; needed by %s"
@ MSG_FIL_FILTER_1 "file=%s; filter for %s (configuration definition)"
@ MSG_FIL_FILTER_2 "file=%s; filter for %s"
@ MSG_FIL_FILTEE_2 "file=%s; filtee processing failed"
@ MSG_FIL_FILTEE_3 "file=%s; filtee skipped (auditor directed)"
@ MSG_FIL_FIXNAME "file=%s; required name=%s"
@ MSG_FIL_PROMOTE "file=%s; promoting mode to %s"
@ MSG_FIL_DEFERRED "file=%s; deferred dependency exchanged for file=%s"
@ MSG_FIL_ELF "file=%s [ ELF ]; generating link map%s"
@ MSG_FIL_LDSO "file=%s [ ELF ]"
# NOTE: these are used by lari(1), use care when changing.
@ MSG_FIL_ANALYZE "file=%s; analyzing %s"
@ MSG_FIL_FILTEE_1 "file=%s; filtered by %s"
@ MSG_FIL_CONFIG "file=%s [ ELF ]; configuration alternate found: %s"
@ MSG_FIL_DATA_AS " addr: %#18llx size: %#18llx"
@ MSG_FIL_DATA_LL " lmid: %18.18s lmco: %#18llx"
@ MSG_FIL_DATA_EA " envp: %#18llx auxv: %#18llx"
@ MSG_FIL_MMAPOBJ "file=%s mmapobj entries=%d"
@ MSG_FIL_MMAPOBJ_1 " [%d]: addr: %#18llx fsize: %#18llx %s"
@ MSG_FIL_MMAPOBJ_2 " offset: %#17llx msize: %#18llx"
@ MSG_FIL_BND_ADD "file=%s; add binding to:"
@ MSG_FIL_BND_FILE " file=%s %s"
@ MSG_FIL_DEP_TITLE "processing %s dependencies %s:"
@ MSG_FIL_DEP_NONE " file=%s; has no dependencies"
@ MSG_FIL_DEP_ENT " file=%s; depends on:"
@ MSG_FIL_DEP_ADD " file=%s; object added %s %s"
@ MSG_FIL_DEP_UPDATE " file=%s; object updated %s %s"
@ MSG_FIL_DEP_DELETE " file=%s; object deleting %s"
@ MSG_FIL_DEP_REMOVE " file=%s; object removed from handle %s"
@ MSG_FIL_DEP_REMAIN " file=%s; object must remain on handle %s"
@ MSG_FIL_DEP_ORPHAN " file=%s; object remains on orphan handle %s"
@ MSG_FIL_DEP_REINST " file=%s; object reinstated %s"
@ MSG_FIL_HDL_CREATE "handle=%s; creating %s 0x%llx:"
@ MSG_FIL_HDL_ADD "handle=%s; adding dependent objects %s:"
@ MSG_FIL_HDL_DELETE "handle=%s; inspecting for deletion:"
@ MSG_FIL_HDL_ORPHAN "handle=%s; deletion cannot be completed: moving to \
orphan list:"
@ MSG_FIL_HDL_REINST "handle=%s; reinstating from orphan list:"
@ MSG_FIL_HDL_COLLECT "handle=%s; collected for possible removal %s"
@ MSG_FIL_HDL_RETAIN "handle=%s; externally referenced from %s: handle \
retained"
@ MSG_FIL_DEL_RESCAN "pending deletions; rescanning orphan list for \
available deletions"
@ MSG_FIL_AR_RESCAN "rescanning archives from args[%d-%d]; additional \
members may satisfy prior extractions"
@ MSG_FIL_CONFIG_ERR "configuration file=%s: %s"
@ MSG_FIL_CONFIG_ERR_1 "ignored (configuration building)"
@ MSG_FIL_CONFIG_ERR_2 "invalid version"
@ MSG_FIL_CONFIG_ERR_3 "unable to process file"
@ MSG_FIL_CONFIG_ERR_4 "corrupt or truncated file"
@ MSG_FIL_CONFIG_ERR_5 "incompatible ELF class, byte order, or machine \
architecture"
@ MSG_FIL_MODIFIED "file=%s; open modified by support library: %s"
@ MSG_FIL_NAMECHANGE " name changed to: %s"
@ MSG_FIL_FDCHANGE " file descriptor changed from: %d to: %d %s"
@ MSG_FIL_ELFCHANGE " ELF descriptor changed from: 0x%llx to: 0x%llx %s"
@ MSG_FIL_IGNORE " (file will be ignored)"
@ MSG_CNTL_TITLE "control list processing complete: moving lmco 0x%llx \
to lmco 0x%llx"
@ MSG_REJ_MACH "file=%s; rejected: wrong machine type: %s"
@ MSG_REJ_CLASS "file=%s; rejected: wrong ELF class: %s"
@ MSG_REJ_DATA "file=%s; rejected: wrong ELF data format: %s"
@ MSG_REJ_TYPE "file=%s; rejected: bad ELF type: %s"
@ MSG_REJ_BADFLAG "file=%s; rejected: bad ELF flags value: %s"
@ MSG_REJ_MISFLAG "file=%s; rejected: mismatched ELF flags value: %s"
@ MSG_REJ_VERSION "file=%s; rejected: mismatched ELF/lib version: %s"
@ MSG_REJ_HAL "file=%s; rejected: HAL R1 extensions required"
@ MSG_REJ_US3 "file=%s; rejected: Sun UltraSPARC III extensions \
required"
@ MSG_REJ_STR "obj=%s; rejected: %s"
@ MSG_REJ_UNKFILE "obj=%s; rejected: unknown file type"
@ MSG_REJ_UNKCAP "obj=%s; rejected: unknown capability: %d"
@ MSG_REJ_HWCAP_1 "obj=%s; rejected: hardware capability (CA_SUNW_HW_1) \
unsupported: %s"
@ MSG_REJ_SFCAP_1 "obj=%s; rejected: software capability (CA_SUNW_SF_1) \
unsupported: %s"
@ MSG_REJ_MACHCAP "obj=%s; rejected: machine capability (CA_SUNW_MACH) \
unsupported: %s"
@ MSG_REJ_PLATCAP "obj=%s; rejected: platform capability (CA_SUNW_PLAT) \
unsupported: %s"
@ MSG_REJ_HWCAP_2 "obj=%s; rejected: hardware capability (CA_SUNW_HW_2) \
unsupported: %s"
@ MSG_REJ_ARCHIVE "obj=%s; rejected: archive unsed incorrectly"
@ MSG_REJ_KMOD "obj=%s; rejected: kernel module"
@ MSG_REJ_HWCAP_3 "obj=%s; rejected: hardware capability (CA_SUNW_HW_3) \
unsupported: %s"
# Libs messages
@ MSG_LIB_INITPATH "Library Search Paths (initial)"
@ MSG_LIB_UPPATH "Library Search Paths (-L updated)"
@ MSG_LIB_LOPT "find lib=-l%s; path=%s"
@ MSG_LIB_REQUIRED "find lib=%s; path=%s (required by %s)"
@ MSG_LIB_LDLIBPATH " search path=%s (LD_LIBRARY_PATH)"
@ MSG_LIB_LDLIBPATHC " search path=%s (configuration LD_LIBRARY_PATH - %s)"
@ MSG_LIB_RUNPATH " search path=%s (RUNPATH/RPATH from file %s)"
@ MSG_LIB_DEFAULT " search path=%s (default)"
@ MSG_LIB_DEFAULTC " search path=%s (configuration default - %s)"
@ MSG_LIB_TDEFAULT " search path=%s (trusted default)"
@ MSG_LIB_TDEFAULTC " search path=%s (trusted configuration default - %s)"
@ MSG_LIB_LIBPATH " search path=%s (LIBPATH or -YP)"
@ MSG_LIB_YPATH " search path=%s replaces path=%s (-Y%c)"
@ MSG_LIB_FIND "find object=%s; searching"
@ MSG_LIB_TRYING " trying path=%s%s"
@ MSG_LIB_ALTER " trying path=%s (auditor returned alternative)"
@ MSG_LIB_SKIP " skip path=%s (auditor directed)"
@ MSG_LIB_IGNORE " ignore path=%s (insecure directory name)"
@ MSG_LIB_INUSE " use path=%s (implicitly secure, as directory \
has already provided dependencies)"
# Mapfile messages
@ MSG_MAP_MAPFILE "mapfile=%s; version=%d (%s)"
@ MSG_MAP_SEG "segment directive; line=%llu; %s"
@ MSG_MAP_SEG_ORDER "segment order directive; line=%llu; list_cnt=%lld; %s"
@ MSG_MAP_CAP "capability directive; line=%llu"
@ MSG_MAP_EC "entrance criteria; line=%llu; added"
@ MSG_MAP_OS_ORDER "output section ordering; line=%llu; segment=%s \
section=%s; index=%d"
@ MSG_MAP_HDR_NOALLOC "header noalloc directive; line=%llu; first loadable \
segment will not contain ELF and program headers"
@ MSG_MAP_SYM_SCOPE "symbol scope definition"
@ MSG_MAP_SYM_SIZE "size-symbol directive; line=%llu; segment=%s; \
symbol=%s; %s"
@ MSG_MAP_SYM_VER_1 "%s, %s; symbol=%s (%s)"
@ MSG_MAP_SYM_VER_2 "%s; symbol=%s (%s)"
@ MSG_MAP_DV "depend versions directive; line=%llu, object=%s"
@ MSG_MAP_DV_ENTRY "%12.12s %s; line=%llu"
@ MSG_MAP_SORT_TITLE "mapfile additions: segment sorting required"
@ MSG_MAP_SORT_TITLE_O "before:"
@ MSG_MAP_SORT_TITLE_S "after:"
@ MSG_MAP_POST_TITLE "mapfile post processing"
@ MSG_MAP_ENT_ORD_TITLE "set entrance criteria input section sort keys; \
segment=%s"
@ MSG_MAP_ID_ADD "%s: %lld: enter conditional expression id: %s"
@ MSG_MAP_ID_CLEAR "%s: %lld: delete conditional expression id: %s"
@ MSG_MAP_PASS "%s: %lld: input enabled by %s"
@ MSG_MAP_NOPASS "%s: %lld: input disabled by %s"
# Move messages
@ MSG_MOVE_FILE "file=%s processing move data"
@ MSG_MOVE_TITLE1 " i/o offset size repeat stride \
value with respect to"
@ MSG_MOVE_TITLE2 " i/o address size repeat stride \
value with respect to"
@ MSG_MOVE_ENTRYIN " in %#10llx %6d %6d %6d %#16llx %s"
@ MSG_MOVE_ENTRYOUT " out %#10llx %6d %6d %6d %#16llx %s"
@ MSG_MOVE_EXPAND " %#10llx %#16llx (expanded)"
@ MSG_MOVE_ADJEXPAND "for symbol=%s roffset: new=0x%llx"
@ MSG_MOVE_ADJMOVE "for symbol=%s roffset: from=0x%llx, to=0x%llx"
@ MSG_MOVE_OUTSCTADJ "adjusting addend for symbol=%s"
@ MSG_MOVE_PAREXPN "expanding symbol=%s into .data: %s"
@ MSG_MOVE_OUTMOVE "copying move entries for symbol=%s into .SUNW_move"
@ MSG_MOVE_INPUT "collecting move entries: file=%s"
@ MSG_MOVE_BAD "move %lld offset invalid: %s: offset=0x%llx \
lies outside memory image; move discarded"
# Section header messages
@ MSG_SHD_MODIFIED "section=%s; section header modified by support \
library: %s"
@ MSG_SHD_ORIG " original:"
@ MSG_SHD_NEW " new:"
# TRANSLATION_NOTE - The following two items are used following a number in
# the MSG_SHD_OFFSET_ENT_XX format strings below. For example "1 entry"
# or "23 entries".
#
@ MSG_SHD_ENTRY_1 "entry"
@ MSG_SHD_ENTRY_N "entries"
# Section messages
@ MSG_SEC_BACKING "mapfile symbol definitions: create backing storage:"
@ MSG_SEC_INPUT "section=%s; input from file=%s"
@ MSG_SEC_INPUT_GEN "section=%s"
@ MSG_SEC_INPUT_GENSTR "section=%s; input generated merged string section"
@ MSG_SEC_ADDED "section=%s; added to segment=%s"
@ MSG_SEC_CREATED "section=%s; added to segment=%s (created)"
@ MSG_SEC_REDIRECTED "section=%s; redirected to section=%s"
@ MSG_SEC_DISCARDED "section=%s; input from file=%s; \
discarded in favor of section=%s; file=%s"
@ MSG_SEC_GNU_COMDAT_1 "section=%s; identified as COMDAT with \
relaxed relocations enabled"
@ MSG_SEC_GNU_COMDAT_2 "section=%s; identified as COMDAT"
@ MSG_SEC_GNU_COMDAT_3 "section=%s; relaxed relocations enabled"
@ MSG_SEC_GRP_DEFINE "section=%s; input from file=%s; defines %s\
group: signature symbol: %s"
@ MSG_SEC_GRP_MEMBER "section=%s; input from file=%s; member of %s\
group: signature symbol: %s"
@ MSG_SEC_GRP_DISCARDED "section=%s; input from file=%s; discarded in \
favor of group: signature symbol: %s: file=%s"
@ MSG_SEC_STRMERGE_DISCARDED "section=%s; input from file=%s; \
discarded in favor of generated merged string section"
@ MSG_SEC_STRMERGE_UNSUP "section=%s; input from file=%s; sh_addralign=%lld; \
sh_entsize=%lld; unable to merge sections with this \
size and alignment"
@ MSG_SEC_STRTAB_STND "strtab=%s; full size: %lld; uncompressed"
@ MSG_SEC_STRTAB_COMP "strtab=%s; full size: %lld; compressed down to: %lld"
@ MSG_SEC_GENSTR_COMP "section=%s (generated merged string section); \
full size: %lld; compressed down to: %lld"
@ MSG_SEC_STRTAB_HD "strtab=%s; compression information [%d buckets]:"
@ MSG_SEC_STRTAB_BCKT " bucket[%d]:"
@ MSG_SEC_STRTAB_MSTR " [%lld] %s <master>"
@ MSG_SEC_STRTAB_SUFSTR " [%lld] %s <suffix of: %s>"
# Unused messages
@ MSG_USD_SEC "section=%s; size=0x%llx; input from file=%s; \
unused: does not satisfy any references%s"
@ MSG_USD_SECDISCARD "; discarded"
@ MSG_USD_FILE "file=%s unused: does not satisfy any references"
@ MSG_USD_NEEDSTR "file=%s unused: unable to determine use"
@ MSG_USD_UNREF "file=%s unreferenced: unused dependency of %s"
@ MSG_USD_FILECYCLIC "file=%s unused: cyclic group [%d] member: \
unreferenced outside of group"
@ MSG_USD_LCINTERFACE "file=%s unused interface [%s]: using interface \
from previously loaded object: file=%s"
@ MSG_USD_LDLIBPATH " search path=%s unused: LD_LIBRARY_PATH entry"
@ MSG_DUP_LDLIBPATH " search path=%s unused: (duplicate) LD_LIBRARY_PATH \
entry"
@ MSG_USD_LDLIBPATHC " search path=%s unused: configuration \
LD_LIBRARY_PATH entry - %s"
@ MSG_DUP_LDLIBPATHC " search path=%s unused: (duplicate) configuration \
LD_LIBRARY_PATH entry - %s"
@ MSG_USD_RUNPATH " search path=%s unused: RUNPATH/RPATH from file %s"
# Segment messages
@ MSG_SEG_DESC_INUSE "Program Header / Segment Descriptor List (in use)"
@ MSG_SEG_DESC_AVAIL "Program Header / Segment Descriptor List (available)"
# Support messages
@ MSG_SUP_REQ "support object request=%s (%s)"
@ MSG_SUP_REQ_ENV "supplied via SGS_SUPPORT"
@ MSG_SUP_REQ_CMD "supplied via -S"
@ MSG_SUP_ROUTINE " support object=%s: provides routine %s"
@ MSG_SUP_CALLING_1 " calling routine=%s (%s)"
@ MSG_SUP_CALLING_2 " calling routine=%s (%s) %s=%s"
@ MSG_SUP_VNONE " unloading object=%s: version=LD_SUP_VNONE"
@ MSG_SUP_OUTFILE "output file"
@ MSG_SUP_INFILE "input file"
@ MSG_SUP_INSEC "input section"
@ MSG_SUP_SEC "section"
# Symbol strings
@ MSG_SYM_AR_FILE "symbol table processing; input file=%s [ archive ] %s"
@ MSG_SYM_AR_SKIP "file=%s, symbol=%s, skipped"
@ MSG_SYM_AR_CHECK "file=%s(%s), symbol=%s, checking for tentative or \
restricted visibility override"
@ MSG_SYM_AR_RESOLVE "file=%s(%s), symbol=%s, resolves undefined or \
tentative symbol"
@ MSG_SYM_AR_FORCE "file=%s(%s), forced extraction"
@ MSG_SYM_SPECIAL "symbol table processing; building special symbols"
@ MSG_SYM_PROCESS "symbol table processing; input file=%s [ %s ]"
@ MSG_SYM_FINAL "symbol table processing; final update"
@ MSG_SYM_INDEX "symbol table processing; determining section \
symbol's index"
@ MSG_SYM_BSS "symbol table processing; assigning to bss \
(possible copy relocations)"
@ MSG_SYM_REDUCED "symbol table processing; reducing global symbols"
@ MSG_SYM_RETAINING "symbol table processing; retaining local symbols"
@ MSG_SYM_VERSION "symbol table processing; adding version symbols"
@ MSG_SYM_CAPABILITIES "symbol table processing; adding local capabilities \
symbols"
@ MSG_SYM_BASIC "symbol[%d]=%s"
@ MSG_SYM_ADDING "symbol[%d]=%s (global); adding"
@ MSG_SYM_SECTION "symbol[%d]=%s (section); segment=%s"
@ MSG_SYM_RESOLVING "symbol[%d]=%s (global); resolving [%d][%d]"
@ MSG_SYM_UPDATE "symbol=%s; updated"
@ MSG_SYM_CREATE "symbol=%s; creating"
@ MSG_SYM_REDUCING "symbol=%s; reducing to local"
@ MSG_SYM_ELIMINATING "symbol=%s; eliminating"
@ MSG_SYM_NOTELIMINATE "symbol=%s; not eliminated: referenced by \
section=%s, entry[%d]"
@ MSG_SYM_DISCARD_SEC "symbol=%s; discarded: originates from unused or \
discarded section=%s from file=%s"
@ MSG_SYM_DISCARD_FILE "symbol=%s; discarded: originates from unused or \
discarded file=%s"
@ MSG_SYM_DISCARD_DUP "symbol[%d]=%s; discarded duplicate: originates from \
file=%s"
@ MSG_SYM_WRAP "symbol[%d]=%s renamed to %s (-z wrap)"
@ MSG_SYM_CAP_ORIG "symbol[%d]=%s converting to symbol capability \
(-z symbolcap)"
@ MSG_SYM_CAP_LOCAL "symbol[%d]=%s creating local capability \
(-z symbolcap)"
@ MSG_SYM_COPY_DST "symbol=%s; copy destination: alignment: 0x%x"
@ MSG_SYM_COPY_REF "symbol=%s; copy reference"
@ MSG_SYM_LOOKUP "symbol=%s; lookup in file=%s [ %s ]"
@ MSG_DLSYM_1 "symbol=%s; dlsym() called from file=%s %s %s"
@ MSG_DLSYM_2 "symbol=%s; dlsym() called from file=%s; starting \
at file=%s %s %s"
@ MSG_CAP_SYM_DEFAULT " symbol=%s[%u]: capability family default"
@ MSG_CAP_SYM_USED " symbol=%s[%u]: used"
@ MSG_CAP_SYM_CANDIDATE " symbol=%s[%u]: capability candidate"
@ MSG_CAP_SYM_REJECTED " symbol=%s[%u]: capability rejected"
@ MSG_CAP_SYM_HW_1 " symbol=%s[%u]: capability specific \
(CA_SUNW_HW_1): [ %s ]"
@ MSG_CAP_SYM_SF_1 " symbol=%s[%u]: capability specific \
(CA_SUNW_SF_1): [ %s ]"
@ MSG_CAP_SYM_MACH " symbol=%s[%u]: capability specific \
(CA_SUNW_MACH): [ %s ]"
@ MSG_CAP_SYM_PLAT " symbol=%s[%u]: capability specific \
(CA_SUNW_PLAT): [ %s ]"
@ MSG_CAP_SYM_HW_2 " symbol=%s[%u]: capability specific \
(CA_SUNW_HW_2): [ %s ]"
@ MSG_CAP_SYM_HW_3 " symbol=%s[%u]: capability specific \
(CA_SUNW_HW_3): [ %s ]"
@ MSG_SYM_LAZY_RESCAN "rescanning for lazy dependencies for symbol: %s"
@ MSG_SYM_DUPSORTADDR "section %s: symbol '%s' and symbol '%s' have the \
same address: %#llx"
@ MSG_SYM_IGNGNUVER "symbol=%s; hash index=%d; version=%d; skipping \
symbol with GNU version hidden bit set in file=%s"
# Syminfo string
@ MSG_SYMINFO_INFO "syminfo information"
# Version strings
@ MSG_VER_AVAIL_1 "version availability: file=%s"
@ MSG_VER_AVAIL_2 " available version selected from"
@ MSG_VER_DEF_TITLE "version definition processing: file=%s"
@ MSG_VER_NEED_TITLE "version needed processing: file=%s"
@ MSG_VER_NOINTERFACE "version definition has no interface symbols: %s"
# SHF_ORDERED related messages. Token used is sections.
@ MSG_ORD_SORT_BEFORE "section=%s; requires output section reordering:"
@ MSG_ORD_SORT_AFTER "section=%s; output section reordered:"
@ MSG_ORD_HDR_1 " number of SHN_BEGIN=%u, ordered=%u, default=%u, \
SHN_AFTER=%u"
@ MSG_ORD_TITLE_1 " %s=SHN_BEGIN: section=%s from %s"
@ MSG_ORD_TITLE_2 " %s=SHN_AFTER: section=%s from %s"
@ MSG_ORD_TITLE_3 " sort key=%u: section=%s from %s, %s=%s"
@ MSG_ORD_ERR_TITLE "the SHF_ORDERED section %s from %s has \
an error; flag ignored"
@ MSG_ORD_ERR_INFORANGE " the sh_info field is out of range"
@ MSG_ORD_ERR_ORDER " the section pointed by sh_info is an ordered section"
@ MSG_ORD_ERR_LINKRANGE " the sh_link field is out of range"
@ MSG_ORD_ERR_FLAGS " the sh_flag is incorrect"
@ MSG_ORD_ERR_CYCLIC " the sh_link is cyclic"
@ MSG_ORD_ERR_LINKINV " a section pointed to by sh_link has an error"
# Link-Auditing Messages
@ MSG_AUD_LIB "auditor %s: required by: %s %s"
@ MSG_AUD_INTERFACE "auditor %s: provides interface: %s"
@ MSG_AUD_VERSION "auditor %s: la_version(): %d: returned %d"
@ MSG_AUD_ACTIVITY "auditor %s: la_activity(): %s %s"
@ MSG_AUD_PREINIT "auditor %s: la_preinit(): %s"
@ MSG_AUD_OBJFILTER "auditor %s: la_objfilter(): %s: filtee=%s [ %s ]"
@ MSG_AUD_OBJFILTER_R "auditor %s: la_objfilter(): %s: returned 0 (filtee \
ignored)"
@ MSG_AUD_OBJOPEN "auditor %s: la_objopen(): %s"
@ MSG_AUD_OBJOPEN_R "auditor %s: la_objopen(): %s: returned %s"
@ MSG_AUD_OBJOPEN_RI "auditor %s: la_objopen(): %s: returned %s (flags \
ignored)"
@ MSG_AUD_OBJSEARCH "auditor %s: la_objsearch(): %s %s"
@ MSG_AUD_OBJSEARCH_R "auditor %s: la_objsearch(): %s: alternative path \
returned: %s"
@ MSG_AUD_OBJSEARCH_S "auditor %s: la_objsearch(): %s: alternative path \
returned: 0 (path skipped)"
@ MSG_AUD_OBJCLOSE "auditor %s: la_objclose(): %s"
@ MSG_AUD_SYMBIND "auditor %s: la_symbind(): %s: value: 0x%llx %s"
@ MSG_AUD_SYMBIND_R "auditor %s: la_symbind(): %s: returned value: \
0x%llx %s"
@ MSG_AUD_PLTENTER "auditor %s: la_pltenter(): %s: value: 0x%llx"
@ MSG_AUD_PLTENTER_R "auditor %s: la_pltenter(): %s: returned value: 0x%llx"
@ MSG_AUD_PLTEXIT "auditor %s: la_pltexit(): %s"
@ MSG_AUD_IGNORE "file=%s; global auditing request ignored: object \
did not initiate process"
@ MSG_AUD_SKIP "file=%s; skipped: using auditor from %s"
@ MSG_AUD_TERM "file=%s; auditor has indicated path should be skipped"
# GOT Messages
@ MSG_GOT_INFO "Global Offset Table information: (%u entries)"
# TRANSLATION_NOTE
# Do not translate .init or .fini, they represent reserved section names.
@ MSG_UTL_INIT "calling .init (%s): %s"
@ MSG_UTL_FINI "calling .fini: %s"
@ MSG_UTL_ARRAY "calling %s[%d]:0x%llx: %s"
@ MSG_UTL_TRANS "transferring control: %s"
@ MSG_UTL_INTOOLATE "loading after relocation has started: interposition \
request (DF_1_INTERPOSE) ignored: %s"
@ MSG_UTL_EDGE_TITLE_I "traversing %s dependency edge for interposer:"
@ MSG_UTL_EDGE_TITLE_S "traversing %s dependency edge:"
@ MSG_UTL_EDGE_START " node (%d): file=%s"
@ MSG_UTL_EDGE_IN " node (%d): file=%s: referenced by %s %s"
@ MSG_UTL_EDGE_OUT " node (%d): file=%s; cyclic dependency on %s"
@ MSG_UTL_COLLECT " [%d] %s; collecting %s section"
@ MSG_UTL_SORT "from sorted order"
@ MSG_UTL_PEND "pending"
@ MSG_UTL_DYN "dynamically triggered"
@ MSG_UTL_DONE "done"
@ MSG_UTL_DBNOTIFY "notify debugger: event: %s state: %s"
@ MSG_UTL_SCC_TITLE " cycle detected - sorting cyclic dependencies in %s"
@ MSG_UTL_SCC_SUBI "reverse load-order"
@ MSG_UTL_SCC_SUBF "load-order"
@ MSG_UTL_LCINTERFACE "file=%s; provides interface [%s]: 0x%llx"
# Generic strings
@ MSG_STR_IGNORE "ignored"
@ MSG_STR_ENTERED "entered"
@ MSG_STR_ORIGINAL "original"
@ MSG_STR_EXCLUDE "exclude"
@ MSG_STR_RESET "reset"
@ MSG_STR_IN " in"
@ MSG_STR_OUT "out"
@ MSG_STR_ACT "act"
@ MSG_STR_CURRENT "current"
@ MSG_STR_ADD "add"
@ MSG_STR_OLD "old"
@ MSG_STR_NEW "new"
@ MSG_STR_NEW_IMPLICIT "new (implicit)"
@ MSG_STR_RESOLVED "resolved"
@ MSG_STR_ADDING "adding"
@ MSG_STR_UP_1 "updating"
@ MSG_STR_UP_2 "updated"
@ MSG_STR_ALLOW "allow"
@ MSG_STR_REQUIRE "require"
@ MSG_STR_MOD_BEFORE "modify (before)"
@ MSG_STR_MOD_AFTER "modify (after)"
@ MSG_STR_UNKNOWN "<unknown>"
@ MSG_STR_ORPHAN "<orphan>"
@ MSG_STR_UNUSED "(unused)"
@ MSG_STR_AGAIN "(again)"
@ MSG_STR_NULL "(null)"
@ MSG_STR_ALTER " (alternate)"
@ MSG_STR_COPYZERO " (copy zero's unnecessary)"
@ MSG_STR_TEMPORARY " (temporary)"
@ MSG_STR_RETRY " (retry) "
# TLS related messages
@ MSG_TLS_STATBLOCK1 "static TLS module: [%ld] %s"
@ MSG_TLS_STATBLOCK2 "static TLS reservation: in use %#llx: \
additional backup: %#llx"
@ MSG_TLS_STATBLOCK3 "static TLS requirement: [%ld] %s: size %#llx: \
satisfied from backup reservation: remaining %#llx"
@ MSG_TLS_MODENT1 " block: %#18llx soff: %#10llx flags: %#llx \
%s"
@ MSG_TLS_MODENT2 " filesz: %#18llx memsz: %#10llx modid: %lld"
@ MSG_TLS_MODACT "%s TLS module: %s"
@ MSG_TLS_ADD "add"
@ MSG_TLS_REMOVE "remove"
# Statistics related messages
@ MSG_STATS_AR "archive %s: count=%d, used=%d (%d%%)"
@ MSG_STATS_GENERAL "General Statistics:"
@ MSG_STATS_FILES " Input files: relocatables=%lld \
shared objects=%lld archives=%lld"
@ MSG_STATS_SYMBOLS_OUT " Symbols output: globals=%-10lld locals=%lld"
@ MSG_STATS_SYMBOLS_IN " Symbols input: globals=%-10lld scoped=%-10lld \
eliminated=%lld"
@ MSG_STATS_REL_OUT " Relocations output: records=%lld"
@ MSG_STATS_REL_IN " Relocations input: records=%-10lld applied=%lld"
@ MSG_STATS_REL_TICACHE " Relocation Cache"
@ MSG_STATS_REL_TIACT "Active"
@ MSG_STATS_REL_TIOUT "Output"
@ MSG_STATS_REL_CACHE " %s: buffers=%d, used=%lld/%lld (%d%%), \
size=%lld%s"
@ MSG_STATS_REL_ACACHE " Aux: buffers=%d, used=%lld/%lld (%d%%), \
size=%lld%s"
# Capabilities messages
@ MSG_CAP_SYS_HW_1 "hardware capabilities (CA_SUNW_HW_1) - %s"
@ MSG_CAP_SYS_SF_1 "software capabilities (CA_SUNW_SF_1) - %s"
@ MSG_CAP_SYS_MACH "machine capability (CA_SUNW_MACH) - %s"
@ MSG_CAP_SYS_PLAT "platform capability (CA_SUNW_PLAT) - %s"
@ MSG_CAP_SYS_HW_2 "hardware capabilities (CA_SUNW_HW_2) - %s"
@ MSG_CAP_SYS_HW_3 "hardware capabilities (CA_SUNW_HW_3) - %s"
@ MSG_CAP_ALT_HW_1 "alternative hardware capabilities (CA_SUNW_HW_1) - %s"
@ MSG_CAP_ALT_SF_1 "alternative software capabilities (CA_SUNW_SF_1) - %s"
@ MSG_CAP_ALT_MACH "alternative machine capability (CA_SUNW_MACH) - %s"
@ MSG_CAP_ALT_PLAT "alternative platform capability (CA_SUNW_PLAT) - %s"
@ MSG_CAP_ALT_HW_2 "alternative hardware capabilities (CA_SUNW_HW_2) - %s"
@ MSG_CAP_ALT_HW_3 "alternative hardware capabilities (CA_SUNW_HW_3) - %s"
@ MSG_CAP_SEC_TITLE "capabilities; input file=%s"
@ MSG_CAP_SEC_ENTRY "%12.12s %-15.15s %s"
@ MSG_CAP_CANDIDATE "obj=%s; capabilities candidate"
@ MSG_CAP_POST_TITLE "capabilities post processing"
@ MSG_CAP_FILTER_1 "dir=%s; capability directory filtered by %s"
@ MSG_CAP_FILTER_2 "dir=%s; no capability objects found"
@ MSG_CAP_IDENTICAL "obj=%s and obj=%s: have identical capabilities: both \
objects ignored"
@ MSG_ELF_HEADER "ELF Header"
# Capabilities entries.
# TRANSLATION_NOTE - the following two entries provide for a series of one or
# more capabilities table entries that align with the initial title.
@ MSG_CAP_ELF_TITLE " index tag value"
@ MSG_CAP_ELF_ENTRY "%10.10s %-15.15s %s"
# Dynamic entries.
# TRANSLATION_NOTE - the following two entries provide for a series of one or
# more dynamic table entries that align with the initial title.
@ MSG_DYN_TITLE " index tag value"
@ MSG_DYN_ENTRY "%10.10s %-16.16s %-#16llx %s"
# Symbol table entries.
# TRANSLATION_NOTE - the following entries provide for a series of one or more
# standard 32-bit symbol table entries that align with the initial title.
@ MSG_SYM_EFS_TITLE_32 " index value size type bind \
oth ver shndx name"
@ MSG_SYM_LDS_TITLE_32 " value size type bind \
oth ver shndx"
@ MSG_SYM_EFS_ENTRY_32 "%10.10s %10.10s 0x%8.8x %4s %4s %2s %4s \
%-14.14s %s"
# TRANSLATION_NOTE - the following entries provide for a series of one or more
# long 32-bit symbol table entries that align with the initial title.
@ MSG_SYM_EFL_TITLE_32 " index value size type bind \
oth ver shndx / name"
@ MSG_SYM_LDL_TITLE_32 " value size type bind \
oth ver shndx"
@ MSG_SYM_EFL_ENTRY_32 "%10.10s %10.10s 0x%8.8x %4s %4s %2s %4s \
%-14s %s"
# TRANSLATION_NOTE - the following entries provide for a series of one or more
# standard 64-bit symbol table entries that align with the initial title.
@ MSG_SYM_EFS_TITLE_64 " index value size \
type bind oth ver shndx name"
@ MSG_SYM_LDS_TITLE_64 " value size \
type bind oth ver shndx"
@ MSG_SYM_EFS_ENTRY_64 "%10.10s %18.18s 0x%16.16llx %4s %4s %2s %4s \
%-14.14s %s"
# TRANSLATION_NOTE - the following entries provide for a series of one or more
# long 64-bit symbol table entries that align with the initial title.
@ MSG_SYM_EFL_TITLE_64 " index value size \
type bind oth ver shndx / name"
@ MSG_SYM_LDL_TITLE_64 " value size \
type bind oth ver shndx"
@ MSG_SYM_EFL_ENTRY_64 "%10.10s %18.18s 0x%16.16llx %4s %4s %2s %4s \
%-14s %s"
# Syminfo entries.
# TRANSLATION_NOTE - the following two entries provide for a series of one or
# more symbol information table entries that align with the initial title.
@ MSG_SYMINFO_TITLE " index flags \
bound to symbol"
@ MSG_SYMINFO_ENTRY "%10.10s %-8s %7s %-24s %s"
@ MSG_SYMINFO_CAP "<symbol capabilities>"
@ MSG_SYMINFO_SELF "<self>"
@ MSG_SYMINFO_PARENT "<parent>"
@ MSG_SYMINFO_EXTERN "<extern>"
# Global offset table entries.
# TRANSLATION_NOTE - the following two entries are used by elfdump(1), and
# provide for a series of one or more 32-bit got table entries that align with
# the initial title.
@ MSG_GOT_TITLE_32 " index addr value \
pending relocation"
@ MSG_GOT_ENTRY_RE_32 "%10.10s 0x%08llx 0x%08llx %-24s %s"
@ MSG_GOT_ENTRY_NR_32 "%10.10s 0x%08llx 0x%08llx"
# TRANSLATION_NOTE - the following two entries are used by elfdump(1), and
# provide for a series of one or more 64-bit got table entries that align with
# the initial title.
@ MSG_GOT_TITLE_64 " index addr \
value pending relocation"
@ MSG_GOT_ENTRY_RE_64 "%10.10s 0x%016llx 0x%016llx %-24s %s"
@ MSG_GOT_ENTRY_NR_64 "%10.10s 0x%016llx 0x%016llx"
# TRANSLATION_NOTE - the following three entries are used by ld(1), and provide
# for a series of one or more 32-bit got table entries that align with one of
# the initial titles.
@ MSG_GOT_COLUMNS1_32 " index ref offset addend symbol"
@ MSG_GOT_COLUMNS2_32 " index ref offset value symbol"
@ MSG_GOT_FORMAT1_32 "%10.10s %3s 0x%08llx 0x%08llx %s"
@ MSG_GOT_FORMAT2_32 "%10.10s %3s 0x%08llx 0x%08llx %s:%s"
# TRANSLATION_NOTE - the following three entries are used by ld(1), and provide
# for a series of one or more 64-bit got table entries that align with one of
# the initial titles.
@ MSG_GOT_COLUMNS1_64 " index ref offset \
addend symbol"
@ MSG_GOT_COLUMNS2_64 " index ref offset \
value symbol"
@ MSG_GOT_FORMAT1_64 "%10.10s %3s 0x%016llx 0x%016llx %s"
@ MSG_GOT_FORMAT2_64 "%10.10s %3s 0x%016llx 0x%016llx %s:%s"
# Version table entries.
@ MSG_VER_DEF " index version dependency"
@ MSG_VER_NEED " file version"
@ MSG_VER_NEED_GNUVER " index file version"
@ MSG_VER_LINE_1 "%10.10s %-26.26s %-20s %s"
@ MSG_VER_LLINE_1 "%10s %-26s %-20s %s"
@ MSG_VER_LINE_2 "%47s %s"
@ MSG_VER_LINE_3 "%38s %-20s %s"
@ MSG_VER_LINE_4 " %s"
@ MSG_VER_LINE_5 " %-26.26s %s"
@ MSG_VER_LLINE_5 " %-26s %s"
# Relocation entries.
# TRANSLATION_NOTE - the following strings are used by elfdump(1). These
# strings provide for a series of one or more 32-bit relocation table entries,
# using truncated section names, that align with one of the initial titles.
@ MSG_REL_EFSA_TITLE_32 " type offset addend \
section symbol"
@ MSG_REL_EFSN_TITLE_32 " type offset \
section symbol"
@ MSG_REL_EFSA_ENTRY_32 " %-24s %#10llx %#10llx %-14.14s %s"
@ MSG_REL_EFSN_ENTRY_32 " %-24s %#10llx %-14.14s %s"
# TRANSLATION_NOTE - the following strings are used by elfdump(1). These
# strings provide for a series of one or more 32-bit relocation table entries,
# using long section names, that align with one of the initial titles.
@ MSG_REL_EFLA_TITLE_32 " type offset addend \
section / symbol"
@ MSG_REL_EFLN_TITLE_32 " type offset \
section / symbol"
@ MSG_REL_EFLA_ENTRY_32 " %-24s %#10llx %#10llx %-14s %s"
@ MSG_REL_EFLN_ENTRY_32 " %-24s %#10llx %-14s %s"
# TRANSLATION_NOTE - the following strings are used by ld.so.1(1). These
# strings provide for a series of one or more 32-bit relocation table entries,
# that align with the initial titles.
@ MSG_REL_RTA_TITLE_32 " type offset \
addend symbol"
@ MSG_REL_RTN_TITLE_32 " type offset \
value symbol"
@ MSG_REL_RTV_TITLE_32 " value"
@ MSG_REL_RTA_ENTRY_32 " %5s %-24s %#10llx %#10llx %s %s"
@ MSG_REL_RTN_ENTRY_32 " %5s %-24s %#10llx %s %s"
@ MSG_REL_RT_APLVAL_32 " apply %#10llx %#10llx"
@ MSG_REL_RT_APLREG_32 " apply %10.10s %#10llx"
# TRANSLATION_NOTE - the following strings are used by ld(1). These strings
# provide for a series of one or more 32-bit relocation table entries, using
# truncated section names, that align with one of the initial titles.
@ MSG_REL_LDSA_TITLE_32 " type \
offset addend section symbol"
@ MSG_REL_LDSN_TITLE_32 " type \
offset section symbol"
@ MSG_REL_LDSA_ENTRY_32 " %5s %-24s %#10llx %#10llx %-14.14s %s %s"
@ MSG_REL_LDSN_ENTRY_32 " %5s %-24s %#10llx %-14.14s %s %s"
@ MSG_REL_LDSV_TITLE_32 " type \
offset value section symbol"
# TRANSLATION_NOTE - the following strings are used by ld(1). These strings
# provide for a series of one or more 32-bit relocation table entries, using
# long section names, that align with one of the initial titles.
@ MSG_REL_LDLA_TITLE_32 " type \
offset addend section / symbol"
@ MSG_REL_LDLN_TITLE_32 " type \
offset section / symbol"
@ MSG_REL_LDLA_ENTRY_32 " %5s %-24s %#10llx %#10llx %-14s %s %s"
@ MSG_REL_LDLN_ENTRY_32 " %5s %-24s %#10llx %-14s %s %s"
@ MSG_REL_LDLV_TITLE_32 " type \
offset value section / symbol"
# TRANSLATION_NOTE - the following strings are used by elfdump(1). These
# strings provide for a series of one or more 64-bit relocation table entries,
# using truncated section names, that align with one of the initial titles.
@ MSG_REL_EFSA_TITLE_64 " type \
offset addend section symbol"
@ MSG_REL_EFSN_TITLE_64 " type \
offset section symbol"
@ MSG_REL_EFSA_ENTRY_64 " %-24s %#18llx %#18llx %-14.14s %s"
@ MSG_REL_EFSN_ENTRY_64 " %-24s %#18llx %-14.14s %s"
# TRANSLATION_NOTE - the following strings are used by elfdump(1). These
# strings provide for a series of one or more 64-bit relocation table entries,
# using long section names, that align with one of the initial titles.
@ MSG_REL_EFLA_TITLE_64 " type \
offset addend section / symbol"
@ MSG_REL_EFLN_TITLE_64 " type \
offset section / symbol"
@ MSG_REL_EFLA_ENTRY_64 " %-24s %#18llx %#18llx %-14s %s"
@ MSG_REL_EFLN_ENTRY_64 " %-24s %#18llx %-14s %s"
# TRANSLATION_NOTE - the following strings are used by ld.so.1(1). These
# strings provide for a series of one or more 64-bit relocation table entries,
# that align with the initial titles.
@ MSG_REL_RTA_TITLE_64 " type \
offset addend symbol"
@ MSG_REL_RTN_TITLE_64 " type \
offset value symbol"
@ MSG_REL_RTV_TITLE_64 " value"
@ MSG_REL_RTA_ENTRY_64 " %5s %-24s %#18llx %#18llx %s %s"
@ MSG_REL_RTN_ENTRY_64 " %5s %-24s %#18llx %s %s"
@ MSG_REL_RT_APLVAL_64 " apply %#18llx %#18llx"
@ MSG_REL_RT_APLREG_64 " apply %18.18s %#18llx"
# TRANSLATION_NOTE - the following strings are used by ld(1). These strings
# provide for a series of one or more 64-bit relocation table entries, using
# truncated section names, that align with one of the initial titles.
@ MSG_REL_LDSA_TITLE_64 " type \
offset addend section symbol"
@ MSG_REL_LDSN_TITLE_64 " type \
offset section symbol"
@ MSG_REL_LDSA_ENTRY_64 " %5s %-24s %#18llx %#18llx %-14.14s %s %s"
@ MSG_REL_LDSN_ENTRY_64 " %5s %-24s %#18llx %-14.14s %s %s"
@ MSG_REL_LDSV_TITLE_64 " type \
offset value section symbol"
# TRANSLATION_NOTE - the following strings are used by ld(1). These strings
# provide for a series of one or more 64-bit relocation table entries, using
# long section names, that align with one of the initial titles.
@ MSG_REL_LDLA_TITLE_64 " type \
offset addend section / symbol"
@ MSG_REL_LDLN_TITLE_64 " type \
offset section / symbol"
@ MSG_REL_LDLA_ENTRY_64 " %5s %-24s %#18llx %#18llx %-14s %s %s"
@ MSG_REL_LDLN_ENTRY_64 " %5s %-24s %#18llx %-14s %s %s"
@ MSG_REL_LDLV_TITLE_64 " type \
offset value section / symbol"
# dl*() family messages
@ MSG_DL_IPHDR_ENTER "dl_iterate_phdr() called from file=%s"
@ MSG_DL_IPHDR_MAPCNG "dl_iterate_phdr() object map/unmap in callback"
@ MSG_DL_IPHDR_UNMAP "dl_iterate_phdr() early return due to object unmap"
@ MSG_DL_IPHDR_CALLBACK "dl_iterate_phdr() callback"
@ MSG_DL_IPHDR_NAME " dlpi_name: %s"
@ MSG_DL_IPHDR_MAPCNT " dlpi_adds: %-18llu dlpi_subs: %-18llu"
@ MSG_DL_IPHDR_ADDR_32 " dlpi_addr: %#-10llx"
@ MSG_DL_IPHDR_PHDR_32 " dlpi_phdr: %#-10llx dlpi_phnum: %u"
@ MSG_DL_IPHDR_ADDR_64 " dlpi_addr: %#-18llx"
@ MSG_DL_IPHDR_PHDR_64 " dlpi_phdr: %#-18llx dlpi_phnum: %u"
@ MSG_DL_DLCLOSE "file=%s; dlclose() called from file=%s %s"
@ MSG_DL_DLDUMP "file=%s; dldump() called from file=%s: dumping to \
file=%s %s"
@ MSG_DL_DLOPEN "file=%s; dlopen() called from file=%s %s %s"
@ MSG_DL_DLADDR "dladdr() called from file=%s: %#llx"
@ MSG_DL_DLERROR "dlerror() called from file=%s: %s"
@ MSG_DL_DLINFO "dlinfo() called from file=%s: handle=%s, request=%s, \
user data=%#llx"
@ _END_
# Debug enabling tokens (for now these are untranslated)
@ MSG_TOK_ALL "all"
@ MSG_TOK_ARGS "args"
@ MSG_TOK_BINDINGS "bindings"
@ MSG_TOK_DL "dl"
@ MSG_TOK_CAP "cap"
@ MSG_TOK_BASIC "basic"
@ MSG_TOK_ENTRY "entry"
@ MSG_TOK_FILES "files"
@ MSG_TOK_HELP "help"
@ MSG_TOK_INIT "init"
@ MSG_TOK_LIBS "libs"
@ MSG_TOK_MAP "map"
@ MSG_TOK_RELOC "reloc"
@ MSG_TOK_SECTIONS "sections"
@ MSG_TOK_SEGMENTS "segments"
@ MSG_TOK_SUPPORT "support"
@ MSG_TOK_SYMBOLS "symbols"
@ MSG_TOK_TLS "tls"
@ MSG_TOK_VERSIONS "versions"
@ MSG_TOK_AUDIT "audit"
@ MSG_TOK_GOT "got"
@ MSG_TOK_MOVE "move"
@ MSG_TOK_DEMANGLE "demangle"
@ MSG_TOK_STRTAB "strtab"
@ MSG_TOK_STATS "statistics"
@ MSG_TOK_UNUSED "unused"
@ MSG_TOK_DETAIL "detail"
@ MSG_TOK_LONG "long"
@ MSG_TOK_NAME "name"
@ MSG_TOK_FULLNAME "fullname"
@ MSG_TOK_CLASS "class"
@ MSG_TOK_LMID "lmid"
@ MSG_TOK_TTIME "ttime"
@ MSG_TOK_DTIME "dtime"
@ MSG_TOK_OUTFILE "output"
@ MSG_TOK_LMID_ALL "ALL"
@ MSG_TOK_LMID_ALT "ALT"
@ MSG_TOK_LMID_BASE "BASE"
@ MSG_TOK_LMID_LDSO "LDSO"
# The following strings represent reserved words, files, pathnames and symbols.
# Reference to this strings is via the MSG_ORIG() macro, and thus no message
# translation is required.
@ MSG_STR_EMPTY ""
@ MSG_STR_DELIMIT ",:"
@ MSG_STR_COMDAT "COMDAT "
@ MSG_SCN_GOT ".got"
@ MSG_SCN_PLT ".plt"
@ MSG_SCN_BSS ".bss"
@ MSG_SCN_INIT ".init"
@ MSG_SCN_FINI ".fini"
@ MSG_SCN_INITARRAY ".initarray"
@ MSG_SCN_FINIARRAY ".finiarray"
@ MSG_SCN_PREINITARRAY ".preinitarray"
@ MSG_SH_INFO "sh_info"
@ MSG_SH_LINK "sh_link"
@ MSG_UTL_SCC_ENTRY " [%d] %s"
@ MSG_FMT_INDEX " [%d]"
@ MSG_FMT_INDEX_RANGE " [%d-%d]"
@ MSG_FMT_STR "%s"
@ MSG_FMT_PATH "%s/%s"
@ MSG_PTH_OBJECT "/tmp/ld.so-OBJECT-"
@ MSG_SUNW_OST_SGS "SUNW_OST_SGS"
# Entrance criteria messages
@ MSG_ECR_NAME " ec_name: %s"
@ MSG_ECR_FLAGS " ec_flags: %s"
@ MSG_ECR_IS_NAME " ec_is_name: %-8s ec_attrmask: %s"
@ MSG_ECR_SEGMENT " ec_segment: %-8s ec_attrbits: %s"
@ MSG_ECR_NDX " ec_ordndx: %-8d ec_type: %s"
@ MSG_ECR_FILES " ec_files:"
@ MSG_ECR_FILE " %-21s %s"
@ MSG_MAP_SORT_SEG " %s"
@ MSG_MAP_SORT_SEG_NAME " %-20s %s"
@ MSG_MAP_SORT_SEG_V " %-20s %-20s p_vaddr=0x%llx"
@ MSG_MAP_SORT_SEG_O " %-20s %-20s order=%d"
# Libs messages
@ MSG_LIB_FILE " %s"
# PLT binding methods
@ MSG_PLT_21D "21d"
@ MSG_PLT_24D "24d"
@ MSG_PLT_U32 "u32"
@ MSG_PLT_U44 "u44"
@ MSG_PLT_FULL "full"
@ MSG_PLT_FAR "far"
# Segment messages
@ MSG_SEG_DESC "segment[%d]"
@ MSG_SEG_NAME " sg_name: %s"
@ MSG_SEG_LENGTH " sg_length: %#llx"
@ MSG_SEG_ROUND " sg_round: %#llx"
@ MSG_SEG_ALIGN " sg_align: %#llx"
@ MSG_SEG_FLAGS " sg_flags: %s"
@ MSG_SEG_SIZESYM_TITLE " sg_sizesym:"
@ MSG_SEG_SIZESYM " %s"
@ MSG_SEG_IS_ORDER_TITLE " sg_is_order:"
@ MSG_SEG_OS_ORDER_TITLE " sg_os_order:"
@ MSG_SEG_LIST_ITEM " %s"
# Section messages (used when expanding segment information)
@ MSG_SEC_NAME " section[%d] os_name: %s"
# Symbol strings
@ MSG_SYM_GLOBAL "global"
@ MSG_SYM_LOCAL "local"
@ MSG_SYM_COPY "copy"
@ MSG_DLSYM_NEXT "[ RTLD_NEXT ]"
@ MSG_DLSYM_DEFAULT "[ RTLD_DEFAULT ]"
@ MSG_DLSYM_SELF "[ RTLD_SELF ]"
@ MSG_DLSYM_PROBE "[ RTLD_PROBE ]"
@ MSG_DLSYM_SINGLETON "( singleton reference )"
# Link-map mode strings
@ MSG_MODE_GLOBNODEL "[ GLOBAL NODELETE ]"
@ MSG_MODE_GLOB "[ GLOBAL ]"
@ MSG_MODE_NODEL "[ NODELETE ]"
# NOTE: these are used by lari(1), use care when changing.
@ MSG_BINFO_START " ("
@ MSG_BINFO_DIRECT "direct"
@ MSG_BINFO_INTERPOSE "interpose"
@ MSG_BINFO_COPYREF "copy-ref"
@ MSG_BINFO_FILTEE "filtee"
@ MSG_BINFO_PLTADDR "plt-addr"
@ MSG_BINFO_END ")"
@ MSG_BINFO_SEP ","
# Utility messages
@ MSG_UTL_EVNT_PREINIT "RD_PREINIT"
@ MSG_UTL_EVNT_POSTINIT "RD_POSTINIT"
@ MSG_UTL_EVNT_DLACT "RD_DLACTIVITY"
@ MSG_UTL_STA_ADD "RT_ADD"
@ MSG_UTL_STA_DELETE "RT_DELETE"
@ MSG_UTL_STA_CONSIST "RT_CONSISTENT"
# Version messages
@ MSG_VER_SELECTED " SELECTED %-26.26s %s"
@ MSG_VER_L_SELECTED " SELECTED %-26s %s"
@ MSG_VER_ALL " ALL %-26.26s"
@ MSG_VER_L_ALL " ALL %-26s"
# Global offset table entries.
@ MSG_GOT_INDEX " [%d]"
@ MSG_GOT_SMALL_PIC "pic"
@ MSG_GOT_BIG_PIC "PIC"
@ MSG_CNTL_ENTRY " [0x%llx] %s"
@ MSG_STR_NL "\n"
@ MSG_STR_LDVER "Solaris Linkers: %s"
@ MSG_FMT_INDEX " [%d]"
@ MSG_FMT_ISEC_NAME "[%u]%s"
@ MSG_FMT_MEMUNIT " (%lld%c)"
@ MSG_SUNW_OST_SGS "SUNW_OST_SGS"
@ MSG_ELF_MAGIC " ei_magic: { 0x%x, %c, %c, %c }"
@ MSG_ELF_CLASS " ei_class: %-18s ei_data: %s"
@ MSG_ELF_OSABI " ei_osabi: %-18s ei_abiversion: %s"
@ MSG_ELF_MACHINE " e_machine: %-18s e_version: %s"
@ MSG_ELF_TYPE " e_type: %s"
@ MSG_ELF_FLAGS " e_flags: %18s"
@ MSG_ELF_FLAGS_FMT " e_flags: %s"
@ MSG_ELF_ESIZE " e_entry: %#18llx e_ehsize: %2d \
e_shstrndx: %d"
@ MSG_ELFX_ESIZE " e_entry: %#18llx e_ehsize: %2d \
e_shstrndx: SHN_XINDEX (see shdr[0].sh_link)"
@ MSG_ELF_SHOFF " e_shoff: %#18llx e_shentsize: %2d \
e_shnum: %d"
@ MSG_ELFX_SHOFF " e_shoff: %#18llx e_shentsize: %2d \
e_shnum: 0 (see shdr[0].sh_size)"
@ MSG_ELF_PHOFF " e_phoff: %#18llx e_phentsize: %2d \
e_phnum: %d"
@ MSG_ELFX_PHOFF " e_phoff: %#18llx e_phentsize: %2d \
e_phnum: PN_XNUM (see shdr[0].sh_info)"
# Shdr[0] messages
@ MSG_SHD0_TITLE "Section Header[0]: (ELF Ehdr extensions)"
@ MSG_SHD0_ADDR " sh_addr: %-6lld sh_flags: %s"
@ MSG_SHD0_SIZE " sh_size: %-6lld (e_shnum) sh_type: %s"
@ MSG_SHD0_OFFSET " sh_offset: %-6lld \
sh_entsize: %lld"
@ MSG_SHD0_LINK " sh_link: %-6d (e_shstrndx) sh_info: \
%d (e_phnum)"
@ MSG_SHD0_ALIGN " sh_addralign: %-6lld"
# Section header messages
@ MSG_SHD_ADDR_32 " sh_addr: %#-10llx sh_flags: %s"
@ MSG_SHD_SIZE_32 " sh_size: %#-10llx sh_type: %s"
@ MSG_SHD_OFFSET_32 " sh_offset: %#-10llx sh_entsize: %#llx"
@ MSG_SHD_OFFSET_ENT_32 " sh_offset: %#-10llx sh_entsize: %#llx \
(%lld %s)"
@ MSG_SHD_LINK_32 " sh_link: %-14s sh_info: %s"
@ MSG_SHD_ALIGN_32 " sh_addralign: %#-10llx"
@ MSG_SHD_ADDR_64 " sh_addr: %#-18llx sh_flags: %s"
@ MSG_SHD_SIZE_64 " sh_size: %#-18llx sh_type: %s"
@ MSG_SHD_OFFSET_64 " sh_offset: %#-18llx sh_entsize: %#llx"
@ MSG_SHD_OFFSET_ENT_64 " sh_offset: %#-18llx sh_entsize: %#llx \
(%lld %s)"
@ MSG_SHD_LINK_64 " sh_link: %-18s sh_info: %s"
@ MSG_SHD_ALIGN_64 " sh_addralign: %#-18llx"
# Program header messages
@ MSG_PHD_VADDR_32 " p_vaddr: %#-10llx p_flags: %s"
@ MSG_PHD_PADDR_32 " p_paddr: %#-10llx p_type: %s"
@ MSG_PHD_FILESZ_32 " p_filesz: %#-10llx p_memsz: %#llx"
@ MSG_PHD_OFFSET_32 " p_offset: %#-10llx p_align: %#llx"
@ MSG_PHD_VADDR_64 " p_vaddr: %#-18llx p_flags: %s"
@ MSG_PHD_PADDR_64 " p_paddr: %#-18llx p_type: %s"
@ MSG_PHD_FILESZ_64 " p_filesz: %#-18llx p_memsz: %#llx"
@ MSG_PHD_OFFSET_64 " p_offset: %#-18llx p_align: %#llx"
# Syminfo formats
@ MSG_SYMINFO_UNKFLAG "[0x%x]"
# Lc_interface interface tags.
@ MSG_CI_NULL "NULL"
@ MSG_CI_VERSION "VERSION"
@ MSG_CI_ATEXIT "ATEXIT"
@ MSG_CI_LCMESSAGES "LCMESSAGES"
@ MSG_CI_BIND_GUARD "BIND_GUARD"
@ MSG_CI_BIND_CLEAR "BIND_CLEAR"
@ MSG_CI_THR_SELF "THR_SELF"
@ MSG_CI_TLS_MODADD "TLS_MODADD"
@ MSG_CI_TLS_MODREM "TLS_MODREM"
@ MSG_CI_TLS_STATMOD "TLS_STATMOD"
@ MSG_CI_THRINIT "THRINIT"
@ MSG_CI_CRITICAL "CRITICAL"
# TLS information flags
@ MSG_TLS_FLAG_STATIC "STATIC-TLS"
# mmapobj() mr_flags.
@ MSG_MR_PADDING "[ PADDING ]"
@ MSG_MR_HDR_ELF "[ HDR_ELF ]"
# audit originator
@ MSG_AUD_PRELOAD "[ LD_AUDIT ]"
@ MSG_AUD_GLOBAL "[ GLOBAL AUDIT ]"
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include "msg.h"
#include "_debug.h"
#include "libld.h"
void
Dbg_libs_audit(Lm_list *lml, const char *opath, const char *npath)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
if (npath == opath)
return;
if (npath == NULL)
dbg_print(lml, MSG_INTL(MSG_LIB_SKIP), opath);
else
dbg_print(lml, MSG_INTL(MSG_LIB_ALTER), npath);
}
void
Dbg_libs_find(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_LIB_FIND), name);
}
void
Dbg_libs_found(Lm_list *lml, const char *path, int alter)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
dbg_print(lml, MSG_INTL(MSG_LIB_TRYING), path, alter ?
MSG_INTL(MSG_STR_ALTER) : MSG_ORIG(MSG_STR_EMPTY));
}
void
Dbg_libs_insecure(Lm_list *lml, const char *path, int usable)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
if (usable)
dbg_print(lml, MSG_INTL(MSG_LIB_INUSE), path);
else
dbg_print(lml, MSG_INTL(MSG_LIB_IGNORE), path);
}
static void
Dbg_lib_dir_print(Lm_list *lml, APlist *libdir)
{
Aliste idx;
char *cp;
for (APLIST_TRAVERSE(libdir, idx, cp))
dbg_print(lml, MSG_ORIG(MSG_LIB_FILE), cp);
}
void
Dbg_libs_init(Lm_list *lml, APlist *ulibdir, APlist *dlibdir)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
dbg_print(lml, MSG_INTL(MSG_LIB_INITPATH));
Dbg_lib_dir_print(lml, ulibdir);
Dbg_lib_dir_print(lml, dlibdir);
}
void
Dbg_libs_l(Lm_list *lml, const char *name, const char *path)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_LIB_LOPT), name, path);
}
void
Dbg_libs_path(Lm_list *lml, const char *path, uint_t orig, const char *obj)
{
const char *fmt;
uint_t search;
if (path == NULL)
return;
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
search = orig &
(LA_SER_LIBPATH | LA_SER_RUNPATH | LA_SER_DEFAULT | LA_SER_SECURE);
switch (search) {
case LA_SER_LIBPATH:
if (orig & LA_SER_CONFIG)
fmt = MSG_INTL(MSG_LIB_LDLIBPATHC);
else
fmt = MSG_INTL(MSG_LIB_LDLIBPATH);
break;
case LA_SER_RUNPATH:
fmt = MSG_INTL(MSG_LIB_RUNPATH);
break;
case LA_SER_DEFAULT:
if (orig & LA_SER_CONFIG)
fmt = MSG_INTL(MSG_LIB_DEFAULTC);
else
fmt = MSG_INTL(MSG_LIB_DEFAULT);
break;
case LA_SER_SECURE:
if (orig & LA_SER_CONFIG)
fmt = MSG_INTL(MSG_LIB_TDEFAULTC);
else
fmt = MSG_INTL(MSG_LIB_TDEFAULT);
break;
default:
return;
}
dbg_print(lml, fmt, path, obj);
}
void
Dbg_libs_req(Lm_list *lml, const char *so_name, const char *ref_file,
const char *name)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_LIB_REQUIRED), so_name, name, ref_file);
}
void
Dbg_libs_update(Lm_list *lml, APlist *ulibdir, APlist *dlibdir)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
dbg_print(lml, MSG_INTL(MSG_LIB_UPPATH));
Dbg_lib_dir_print(lml, ulibdir);
Dbg_lib_dir_print(lml, dlibdir);
}
void
Dbg_libs_yp(Lm_list *lml, const char *path)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
dbg_print(lml, MSG_INTL(MSG_LIB_LIBPATH), path);
}
void
Dbg_libs_ylu(Lm_list *lml, const char *path, const char *orig, int index)
{
if (DBG_NOTCLASS(DBG_C_LIBS))
return;
dbg_print(lml, MSG_INTL(MSG_LIB_YPATH), path, orig,
(index == YLDIR) ? 'L' : 'U');
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "msg.h"
#include "_debug.h"
#include "libld.h"
/*
* Report change in input enable status caused by evaluating
* $if/$elif control directives.
*/
void
Dbg_map_pass(Lm_list *lml, Boolean enable, const char *file,
Lineno lineno, const char *directive)
{
const char *fmt;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
fmt = enable ? MSG_INTL(MSG_MAP_PASS) : MSG_INTL(MSG_MAP_NOPASS);
dbg_print(lml, fmt, file, EC_LINENO(lineno), directive);
}
/*
* Report entry/removal of boolean identifier from conditional expression
* known values.
*/
void
Dbg_map_cexp_id(Lm_list *lml, Boolean add, const char *file,
Lineno lineno, const char *id)
{
const char *fmt;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
fmt = add ? MSG_INTL(MSG_MAP_ID_ADD) : MSG_INTL(MSG_MAP_ID_CLEAR);
dbg_print(lml, fmt, file, EC_LINENO(lineno), id);
}
void
Dbg_map_version(Lm_list *lml, const char *version, const char *name, int scope)
{
const char *str, *scp;
if (DBG_NOTCLASS(DBG_C_MAP | DBG_C_SYMBOLS))
return;
str = MSG_INTL(MSG_MAP_SYM_SCOPE);
if (scope)
scp = MSG_ORIG(MSG_SYM_GLOBAL);
else
scp = MSG_ORIG(MSG_SYM_LOCAL);
if (version)
dbg_print(lml, MSG_INTL(MSG_MAP_SYM_VER_1), str, version,
Dbg_demangle_name(name), scp);
else
dbg_print(lml, MSG_INTL(MSG_MAP_SYM_VER_2), str,
Dbg_demangle_name(name), scp);
}
void
Dbg_map_size_new(Lm_list *lml, const char *symname, const char *segname,
Lineno lineno)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_SYM_SIZE), EC_LINENO(lineno), segname,
Dbg_demangle_name(symname), MSG_INTL(MSG_STR_ADDING));
}
void
Dbg_map_size_old(Ofl_desc *ofl, Sym_desc *sdp, const char *segname,
Lineno lineno)
{
Conv_inv_buf_t inv_buf;
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_SYM_SIZE), EC_LINENO(lineno), segname,
sdp->sd_name, MSG_INTL(MSG_STR_UP_1));
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_INTL(MSG_STR_UP_2),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine,
sdp->sd_sym, sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
void
Dbg_map_symbol(Ofl_desc *ofl, Sym_desc *sdp)
{
Conv_inv_buf_t inv_buf;
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_MAP | DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_INTL(MSG_STR_ENTERED),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine,
sdp->sd_sym, sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
/*
* Object version dependency. In the v1 syntax, this is the 'dash' operator.
* In the v2 syntax, the DEPEND_VERSIONS directive.
*/
void
Dbg_map_dv(Lm_list *lml, const char *obj_name, Lineno lineno)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
dbg_print(lml, MSG_INTL(MSG_MAP_DV), EC_LINENO(lineno), obj_name);
}
/*
* Add a version to an object dependency
*/
void
Dbg_map_dv_entry(Lm_list *lml, Lineno lineno, int require, const char *version)
{
const char *attr;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
attr = require ? MSG_INTL(MSG_STR_REQUIRE) : MSG_INTL(MSG_STR_ALLOW);
dbg_print(lml, MSG_INTL(MSG_MAP_DV_ENTRY), attr, version,
EC_LINENO(lineno));
}
void
Dbg_map_sort_title(Lm_list *lml, Boolean orig)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
if (DBG_NOTDETAIL())
return;
if (orig) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_SORT_TITLE));
dbg_print(lml, MSG_INTL(MSG_MAP_SORT_TITLE_O));
} else {
dbg_print(lml, MSG_INTL(MSG_MAP_SORT_TITLE_S));
}
}
void
Dbg_map_sort_seg(Lm_list *lml, uchar_t osabi, Half mach, Sg_desc *sgp)
{
const char *type_str;
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
if (DBG_NOTDETAIL())
return;
type_str = conv_phdr_type(osabi, mach, sgp->sg_phdr.p_type,
0, &inv_buf);
if (sgp->sg_name) {
if (sgp->sg_flags & FLG_SG_P_VADDR) {
dbg_print(lml, MSG_ORIG(MSG_MAP_SORT_SEG_V),
type_str, sgp->sg_name,
EC_ADDR(sgp->sg_phdr.p_vaddr));
} else if (sgp->sg_flags & FLG_SG_ORDERED) {
/*
* All FLG_SG_ORDERED have adjacent sg_id values
* that start at SGID_TEXT. Subtract out the base
* in order to present the order values based at 0.
*/
dbg_print(lml, MSG_ORIG(MSG_MAP_SORT_SEG_O),
type_str, sgp->sg_name,
EC_WORD(sgp->sg_id - SGID_TEXT));
} else {
dbg_print(lml, MSG_ORIG(MSG_MAP_SORT_SEG_NAME),
type_str, sgp->sg_name);
}
} else {
dbg_print(lml, MSG_ORIG(MSG_MAP_SORT_SEG), type_str);
}
}
void
Dbg_map_parse(Lm_list *lml, const char *file, int version)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_MAPFILE), file, EC_WORD(version),
conv_mapfile_version(version, 0, &inv_buf));
}
void
Dbg_map_ent(Lm_list *lml, Ent_desc *enp, Ofl_desc *ofl, Lineno lineno)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_EC), EC_LINENO(lineno));
Dbg_ent_entry(lml, ofl->ofl_dehdr->e_ident[EI_OSABI],
ofl->ofl_dehdr->e_machine, enp);
}
void
Dbg_map_ent_ord_title(Lm_list *lml, const char *segname)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_ENT_ORD_TITLE), segname);
}
void
Dbg_map_seg_os_order(Lm_list *lml, Sg_desc *sgp, const char *sec_name,
Word ndx, Lineno lineno)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
dbg_print(lml, MSG_INTL(MSG_MAP_OS_ORDER), EC_LINENO(lineno),
sgp->sg_name, sec_name, EC_WORD(ndx));
}
void
Dbg_map_seg(Ofl_desc *ofl, dbg_state_t dbg_state, int ndx, Sg_desc *sgp,
Lineno lineno)
{
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_SEG), EC_LINENO(lineno),
Dbg_state_str(dbg_state));
Dbg_seg_desc_entry(ofl->ofl_lml, ofl->ofl_dehdr->e_ident[EI_OSABI],
ofl->ofl_dehdr->e_machine, ndx, sgp, FALSE);
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_map_seg_order(Ofl_desc *ofl, uchar_t osabi, Half mach,
dbg_state_t dbg_state, Lineno lineno)
{
Lm_list *lml = ofl->ofl_lml;
Aliste idx;
Sg_desc *sgp;
Conv_inv_buf_t inv_buf;
const char *type_str;
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_SEG_ORDER), EC_LINENO(lineno),
EC_XWORD(aplist_nitems(ofl->ofl_segs_order)),
Dbg_state_str(dbg_state));
for (APLIST_TRAVERSE(ofl->ofl_segs_order, idx, sgp)) {
type_str = conv_phdr_type(osabi, mach, sgp->sg_phdr.p_type,
0, &inv_buf);
dbg_print(lml, MSG_ORIG(MSG_MAP_SORT_SEG_NAME), type_str,
sgp->sg_name);
}
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_map_post_title(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_POST_TITLE));
}
void
Dbg_map_hdr_noalloc(Lm_list *lml, Lineno lineno)
{
if (DBG_NOTCLASS(DBG_C_MAP))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MAP_HDR_NOALLOC), EC_LINENO(lineno));
}
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
# Generic interface definition for usr/src/cmd/sgs/liblddbg.
#
#
# MAPFILE HEADER START
#
# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
# Object versioning must comply with the rules detailed in
#
# usr/src/lib/README.mapfiles
#
# You should not be making modifications here until you've read the most current
# copy of that file. If you need help, contact a gatekeeper for guidance.
#
# MAPFILE HEADER END
#
$mapfile_version 2
SYMBOL_VERSION SUNWprivate_4.83 {
global:
dbg_desc {
# interposed - ld.so.1(1)
FLAGS = NODIRECT;
ASSERT = {
TYPE = OBJECT;
SIZE = addrsize;
};
};
dbg_print {
# interposed - ld(1) and ld.so.1(1)
FLAGS = NODIRECT;
};
Dbg_args_file;
Dbg_args_option;
Dbg_args_str2chr;
Dbg_args_Wldel;
Dbg_audit_activity;
Dbg_audit_ignore;
Dbg_audit_interface;
Dbg_audit_lib;
Dbg_audit_objclose;
Dbg_audit_objfilter;
Dbg_audit_objopen;
Dbg_audit_objsearch;
Dbg_audit_pltenter;
Dbg_audit_pltexit;
Dbg_audit_preinit;
Dbg_audit_symbind;
Dbg_audit_skip;
Dbg_audit_terminate;
Dbg_audit_version;
Dbg_basic_collect;
Dbg_basic_create;
Dbg_basic_files;
Dbg_basic_finish;
Dbg_basic_options;
Dbg_basic_relocate;
Dbg_basic_validate;
Dbg_help;
Dbg_setup;
Dbg_state_str;
Dbg_version;
Dbg32_bind_global;
Dbg64_bind_global;
Dbg32_bind_plt_summary;
Dbg64_bind_plt_summary;
Dbg64_bind_pltpad_from;
Dbg64_bind_pltpad_to;
Dbg32_bind_reject;
Dbg64_bind_reject;
Dbg32_bind_weak;
Dbg64_bind_weak;
Dbg32_cap_candidate;
Dbg64_cap_candidate;
Dbg32_cap_filter;
Dbg64_cap_filter;
Dbg32_cap_id;
Dbg64_cap_id;
Dbg32_cap_identical;
Dbg64_cap_identical;
Dbg32_cap_mapfile_title;
Dbg64_cap_mapfile_title;
Dbg32_cap_post_title;
Dbg64_cap_post_title;
Dbg32_cap_ptr_entry;
Dbg64_cap_ptr_entry;
Dbg32_cap_sec_title;
Dbg64_cap_sec_title;
Dbg32_cap_val;
Dbg64_cap_val;
Dbg32_cap_val_entry;
Dbg64_cap_val_entry;
Dbg32_dl_dladdr;
Dbg64_dl_dladdr;
Dbg32_dl_dlclose;
Dbg64_dl_dlclose;
Dbg32_dl_dldump;
Dbg64_dl_dldump;
Dbg32_dl_dlerror;
Dbg64_dl_dlerror;
Dbg32_dl_dlinfo;
Dbg64_dl_dlinfo;
Dbg32_dl_dlopen;
Dbg64_dl_dlopen;
Dbg32_dl_dlsym;
Dbg64_dl_dlsym;
Dbg32_dl_iphdr_callback;
Dbg64_dl_iphdr_callback;
Dbg32_dl_iphdr_enter;
Dbg64_dl_iphdr_enter;
Dbg32_dl_iphdr_mapchange;
Dbg64_dl_iphdr_mapchange;
Dbg32_dl_iphdr_unmap_ret;
Dbg64_dl_iphdr_unmap_ret;
Dbg32_demangle_name;
Dbg64_demangle_name;
Dbg32_ent_print;
Dbg64_ent_print;
Dbg32_file_analyze;
Dbg64_file_analyze;
Dbg32_file_ar;
Dbg64_file_ar;
Dbg32_file_ar_rescan;
Dbg64_file_ar_rescan;
Dbg32_file_bind_entry;
Dbg64_file_bind_entry;
Dbg32_file_bindings;
Dbg64_file_bindings;
Dbg32_file_bindings_done;
Dbg64_file_bindings_done;
Dbg32_file_cntl;
Dbg64_file_cntl;
Dbg32_file_config_dis;
Dbg64_file_config_dis;
Dbg32_file_config_obj;
Dbg64_file_config_obj;
Dbg32_file_deferred;
Dbg64_file_deferred;
Dbg32_file_del_rescan;
Dbg64_file_del_rescan;
Dbg32_file_delete;
Dbg64_file_delete;
Dbg32_file_elf;
Dbg64_file_elf;
Dbg32_file_cleanup;
Dbg64_file_cleanup;
Dbg32_file_filtee;
Dbg64_file_filtee;
Dbg32_file_filter;
Dbg64_file_filter;
Dbg32_file_fixname;
Dbg64_file_fixname;
Dbg32_file_generic;
Dbg64_file_generic;
Dbg32_file_hdl_action;
Dbg64_file_hdl_action;
Dbg32_file_hdl_collect;
Dbg64_file_hdl_collect;
Dbg32_file_hdl_title;
Dbg64_file_hdl_title;
Dbg32_file_lazyload;
Dbg64_file_lazyload;
Dbg32_file_ldso;
Dbg64_file_ldso;
Dbg32_file_mmapobj;
Dbg64_file_mmapobj;
Dbg32_file_mode_promote;
Dbg64_file_mode_promote;
Dbg32_file_modified;
Dbg64_file_modified;
Dbg32_file_needed;
Dbg64_file_needed;
Dbg32_file_output;
Dbg64_file_output;
Dbg32_file_preload;
Dbg64_file_preload;
Dbg32_file_prot;
Dbg64_file_prot;
Dbg32_file_rejected;
Dbg64_file_rejected;
Dbg32_file_reuse;
Dbg64_file_reuse;
Dbg32_file_skip;
Dbg64_file_skip;
Dbg32_got_display;
Dbg64_got_display;
Dbg32_libs_audit;
Dbg64_libs_audit;
Dbg32_libs_find;
Dbg64_libs_find;
Dbg32_libs_found;
Dbg64_libs_found;
Dbg32_libs_insecure;
Dbg64_libs_insecure;
Dbg32_libs_init;
Dbg64_libs_init;
Dbg32_libs_l;
Dbg64_libs_l;
Dbg32_libs_path;
Dbg64_libs_path;
Dbg32_libs_req;
Dbg64_libs_req;
Dbg32_libs_update;
Dbg64_libs_update;
Dbg32_libs_yp;
Dbg64_libs_yp;
Dbg32_libs_ylu;
Dbg64_libs_ylu;
Dbg32_map_cexp_id;
Dbg64_map_cexp_id;
Dbg32_map_dv;
Dbg64_map_dv;
Dbg32_map_dv_entry;
Dbg64_map_dv_entry;
Dbg32_map_ent;
Dbg64_map_ent;
Dbg32_map_ent_ord_title;
Dbg64_map_ent_ord_title;
Dbg32_map_hdr_noalloc;
Dbg64_map_hdr_noalloc;
Dbg32_map_parse;
Dbg64_map_parse;
Dbg32_map_pass;
Dbg64_map_pass;
Dbg32_map_post_title;
Dbg64_map_post_title;
Dbg32_map_seg;
Dbg64_map_seg;
Dbg32_map_seg_order;
Dbg64_map_seg_order;
Dbg32_map_seg_os_order;
Dbg64_map_seg_os_order;
Dbg32_map_size_new;
Dbg64_map_size_new;
Dbg32_map_size_old;
Dbg64_map_size_old;
Dbg32_map_sort_seg;
Dbg64_map_sort_seg;
Dbg32_map_sort_title;
Dbg64_map_sort_title;
Dbg32_map_symbol;
Dbg64_map_symbol;
Dbg32_map_version;
Dbg64_map_version;
Dbg32_move_adjexpandreloc;
Dbg64_move_adjexpandreloc;
Dbg32_move_adjmovereloc;
Dbg64_move_adjmovereloc;
Dbg32_move_bad;
Dbg64_move_bad;
Dbg32_move_data;
Dbg64_move_data;
Dbg32_move_entry1;
Dbg64_move_entry1;
Dbg32_move_entry2;
Dbg64_move_entry2;
Dbg32_move_expand;
Dbg64_move_expand;
Dbg32_move_input;
Dbg64_move_input;
Dbg32_move_outmove;
Dbg64_move_outmove;
Dbg32_move_outsctadj;
Dbg64_move_outsctadj;
Dbg32_move_parexpn;
Dbg64_move_parexpn;
Dbg32_reloc_apply_reg;
Dbg64_reloc_apply_reg;
Dbg32_reloc_apply_val;
Dbg64_reloc_apply_val;
Dbg32_reloc_ars_entry;
Dbg64_reloc_ars_entry;
Dbg32_reloc_copy;
Dbg64_reloc_copy;
Dbg32_reloc_discard;
Dbg64_reloc_discard;
Dbg32_reloc_doact;
Dbg64_reloc_doact;
Dbg32_reloc_doact_title;
Dbg64_reloc_doact_title;
Dbg32_reloc_dooutrel;
Dbg64_reloc_dooutrel;
Dbg32_reloc_entry;
Dbg64_reloc_entry;
Dbg32_reloc_error;
Dbg64_reloc_error;
Dbg32_reloc_generate;
Dbg64_reloc_generate;
Dbg32_reloc_in;
Dbg64_reloc_in;
Dbg32_reloc_ors_entry;
Dbg64_reloc_ors_entry;
Dbg32_reloc_out;
Dbg64_reloc_out;
Dbg32_reloc_proc;
Dbg64_reloc_proc;
Dbg32_reloc_run;
Dbg64_reloc_run;
Dbg32_reloc_sloppycomdat;
Dbg64_reloc_sloppycomdat;
Dbg32_reloc_transition;
Dbg64_reloc_transition;
Dbg32_sec_added;
Dbg64_sec_added;
Dbg32_sec_backing;
Dbg64_sec_backing;
Dbg32_sec_created;
Dbg64_sec_created;
Dbg32_sec_discarded;
Dbg64_sec_discarded;
Dbg32_sec_genstr_compress;
Dbg64_sec_genstr_compress;
Dbg32_sec_group;
Dbg64_sec_group;
Dbg32_sec_gnu_comdat;
Dbg64_sec_gnu_comdat;
Dbg32_sec_in;
Dbg64_sec_in;
Dbg32_sec_order_error;
Dbg64_sec_order_error;
Dbg32_sec_order_list;
Dbg64_sec_order_list;
Dbg32_sec_redirected;
Dbg64_sec_redirected;
Dbg32_sec_strtab;
Dbg64_sec_strtab;
Dbg32_sec_unsup_strmerge;
Dbg64_sec_unsup_strmerge;
Dbg32_seg_entry;
Dbg64_seg_entry;
Dbg32_seg_list;
Dbg64_seg_list;
Dbg32_seg_os;
Dbg64_seg_os;
Dbg32_seg_title;
Dbg64_seg_title;
Dbg32_shdr_modified;
Dbg64_shdr_modified;
Dbg32_statistics_ar;
Dbg64_statistics_ar;
Dbg32_statistics_ld;
Dbg64_statistics_ld;
Dbg32_support_action;
Dbg64_support_action;
Dbg32_support_load;
Dbg64_support_load;
Dbg32_support_req;
Dbg64_support_req;
Dbg32_support_vnone;
Dbg64_support_vnone;
Dbg32_syminfo_entry;
Dbg64_syminfo_entry;
Dbg32_syminfo_title;
Dbg64_syminfo_title;
Dbg32_syms_ar_checking;
Dbg64_syms_ar_checking;
Dbg32_syms_ar_force;
Dbg64_syms_ar_force;
Dbg32_syms_ar_resolve;
Dbg64_syms_ar_resolve;
Dbg32_syms_ar_skip;
Dbg64_syms_ar_skip;
Dbg32_syms_ar_title;
Dbg64_syms_ar_title;
Dbg32_syms_cap_convert;
Dbg64_syms_cap_convert;
Dbg32_syms_cap_local;
Dbg64_syms_cap_local;
Dbg32_syms_cap_lookup;
Dbg64_syms_cap_lookup;
Dbg32_syms_cap_title;
Dbg64_syms_cap_title;
Dbg32_syms_copy_reloc;
Dbg64_syms_copy_reloc;
Dbg32_syms_created;
Dbg64_syms_created;
Dbg32_syms_discarded;
Dbg64_syms_discarded;
Dbg32_syms_dup_discarded;
Dbg64_syms_dup_discarded;
Dbg32_syms_dup_sort_addr;
Dbg64_syms_dup_sort_addr;
Dbg32_syms_entered;
Dbg64_syms_entered;
Dbg32_syms_entry;
Dbg64_syms_entry;
Dbg32_syms_global;
Dbg64_syms_global;
Dbg32_syms_ignore;
Dbg64_syms_ignore;
Dbg32_syms_ignore_gnuver;
Dbg64_syms_ignore_gnuver;
Dbg32_syms_lazy_rescan;
Dbg64_syms_lazy_rescan;
Dbg32_syms_lookup;
Dbg64_syms_lookup;
Dbg32_syms_new;
Dbg64_syms_new;
Dbg32_syms_old;
Dbg64_syms_old;
Dbg32_syms_process;
Dbg64_syms_process;
Dbg32_syms_reduce;
Dbg64_syms_reduce;
Dbg32_syms_resolved;
Dbg64_syms_resolved;
Dbg32_syms_resolving;
Dbg64_syms_resolving;
Dbg32_syms_sec_entry;
Dbg64_syms_sec_entry;
Dbg32_syms_sec_title;
Dbg64_syms_sec_title;
Dbg32_syms_spec_title;
Dbg64_syms_spec_title;
Dbg32_syms_updated;
Dbg64_syms_updated;
Dbg32_syms_up_title;
Dbg64_syms_up_title;
Dbg32_syms_wrap;
Dbg64_syms_wrap;
Dbg_tls_modactivity;
Dbg_tls_static_block;
Dbg_tls_static_resv;
Dbg32_util_call_array;
Dbg64_util_call_array;
Dbg32_util_call_fini;
Dbg64_util_call_fini;
Dbg32_util_call_init;
Dbg64_util_call_init;
Dbg32_util_call_main;
Dbg64_util_call_main;
Dbg32_util_collect;
Dbg64_util_collect;
Dbg32_util_dbnotify;
Dbg64_util_dbnotify;
Dbg32_util_edge_in;
Dbg64_util_edge_in;
Dbg32_util_edge_out;
Dbg64_util_edge_out;
Dbg32_util_lcinterface;
Dbg64_util_lcinterface;
Dbg32_util_intoolate;
Dbg64_util_intoolate;
Dbg32_util_nl;
Dbg64_util_nl;
Dbg32_util_scc_entry;
Dbg64_util_scc_entry;
Dbg32_util_scc_title;
Dbg64_util_scc_title;
Dbg32_util_str;
Dbg64_util_str;
Dbg32_unused_file;
Dbg64_unused_file;
Dbg32_unused_lcinterface;
Dbg64_unused_lcinterface;
Dbg32_unused_path;
Dbg64_unused_path;
Dbg32_unused_sec;
Dbg64_unused_sec;
Dbg32_unused_unref;
Dbg64_unused_unref;
Dbg32_ver_avail_entry;
Dbg64_ver_avail_entry;
Dbg32_ver_avail_title;
Dbg64_ver_avail_title;
Dbg32_ver_def_title;
Dbg64_ver_def_title;
Dbg32_ver_desc_entry;
Dbg64_ver_desc_entry;
Dbg32_ver_need_done;
Dbg64_ver_need_done;
Dbg32_ver_need_entry;
Dbg64_ver_need_entry;
Dbg32_ver_need_title;
Dbg64_ver_need_title;
Dbg32_ver_nointerface;
Dbg64_ver_nointerface;
Dbg32_ver_symbol;
Dbg64_ver_symbol;
} SUNWprivate_3.23;
# The following interfaces are used by various parts of the link-editors and
# elfdump(1). The link-editors are always packaged together but there
# seems to be a variety of old elfdump's lying around. elfdump only uses
# this interface, and thus by separating in from the ever changing Dbg_*
# interfaces we can provide a stable versioning environment for this utility.
SYMBOL_VERSION SUNWprivate_3.23 {
global:
Elf_syminfo_entry;
Elf_syminfo_title;
Elf32_cap_entry;
Elf64_cap_entry;
Elf32_cap_title;
Elf64_cap_title;
Elf32_demangle_name;
Elf64_demangle_name;
Elf32_dyn_entry;
Elf64_dyn_entry;
Elf32_dyn_null_entry;
Elf64_dyn_null_entry;
Elf32_dyn_title;
Elf64_dyn_title;
Elf32_ehdr;
Elf64_ehdr;
Elf32_got_entry;
Elf64_got_entry;
Elf32_got_title;
Elf64_got_title;
Elf32_phdr;
Elf64_phdr;
Elf32_reloc_apply_reg;
Elf64_reloc_apply_reg;
Elf32_reloc_apply_val;
Elf64_reloc_apply_val;
Elf32_reloc_entry_1;
Elf64_reloc_entry_1;
Elf32_reloc_entry_2;
Elf64_reloc_entry_2;
Elf32_reloc_title;
Elf64_reloc_title;
Elf32_shdr;
Elf64_shdr;
Elf32_syms_table_title;
Elf64_syms_table_title;
Elf32_syms_table_entry;
Elf64_syms_table_entry;
Elf32_ver_def_title;
Elf64_ver_def_title;
Elf32_ver_line_1;
Elf64_ver_line_1;
Elf32_ver_line_2;
Elf64_ver_line_2;
Elf32_ver_line_3;
Elf64_ver_line_3;
Elf32_ver_line_4;
Elf64_ver_line_4;
Elf32_ver_line_5;
Elf64_ver_line_5;
Elf32_ver_need_title;
Elf64_ver_need_title;
local:
*;
};
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "msg.h"
#include "_debug.h"
#include "libld.h"
void
Dbg_move_data(Rt_map *lmp)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
dbg_print(lml, MSG_INTL(MSG_MOVE_FILE), NAME(lmp));
dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE2));
}
void
Dbg_move_adjexpandreloc(Lm_list *lml, Xword offset, const char *name)
{
if (DBG_NOTCLASS(DBG_C_MOVE | DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_MOVE_ADJEXPAND), Dbg_demangle_name(name),
EC_XWORD(offset));
}
void
Dbg_move_adjmovereloc(Lm_list *lml, Xword offset1, Xword offset2,
const char *name)
{
if (DBG_NOTCLASS(DBG_C_MOVE | DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_MOVE_ADJMOVE), Dbg_demangle_name(name),
EC_XWORD(offset1), EC_XWORD(offset2));
}
void
Dbg_move_outsctadj(Lm_list *lml, Sym_desc *sdp)
{
if (DBG_NOTCLASS(DBG_C_MOVE | DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_MOVE_OUTSCTADJ),
Dbg_demangle_name(sdp->sd_name));
}
void
Dbg_move_parexpn(Lm_list *lml, const char *name, const char *reason)
{
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MOVE_PAREXPN), name, reason);
dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE1));
}
void
Dbg_move_outmove(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MOVE_OUTMOVE), name);
dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE1));
}
void
Dbg_move_expand(Lm_list *lml, Move *mv, Addr addr)
{
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
dbg_print(lml, MSG_INTL(MSG_MOVE_EXPAND), EC_ADDR(addr),
EC_LWORD(mv->m_value));
}
void
Dbg_move_input(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_MOVE_INPUT), name);
dbg_print(lml, MSG_INTL(MSG_MOVE_TITLE1));
}
void
Dbg_move_entry1(Lm_list *lml, int which, Move *mv, Sym_desc *s)
{
const char *str;
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
if (which)
str = MSG_INTL(MSG_MOVE_ENTRYIN);
else
str = MSG_INTL(MSG_MOVE_ENTRYOUT);
dbg_print(lml, str, EC_XWORD(mv->m_poffset), ELF_M_SIZE(mv->m_info),
mv->m_repeat, mv->m_stride, EC_LWORD(mv->m_value), s->sd_name);
}
void
Dbg_move_entry2(Lm_list *lml, Move *mv, Word st_name, const char *name)
{
const char *sname;
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
if (st_name)
sname = name;
else
sname = MSG_INTL(MSG_STR_UNKNOWN);
dbg_print(lml, MSG_INTL(MSG_MOVE_ENTRYIN), EC_XWORD(mv->m_poffset),
ELF_M_SIZE(mv->m_info), mv->m_repeat, mv->m_stride,
EC_LWORD(mv->m_value), sname);
}
void
Dbg_move_bad(Lm_list *lml, ulong_t num, const char *name, Addr addr)
{
if (DBG_NOTCLASS(DBG_C_MOVE))
return;
dbg_print(lml, MSG_INTL(MSG_MOVE_BAD), EC_XWORD(num), name,
EC_ADDR(addr));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sgs.h>
#include <_debug.h>
#include <conv.h>
#include <msg.h>
void
Elf_phdr(Lm_list *lml, uchar_t osabi, Half mach, Phdr *phdr)
{
Conv_inv_buf_t inv_buf;
Conv_phdr_flags_buf_t phdr_flags_buf;
dbg_print(lml, MSG_ORIG(MSG_PHD_VADDR), EC_ADDR(phdr->p_vaddr),
conv_phdr_flags(osabi, phdr->p_flags, 0, &phdr_flags_buf));
dbg_print(lml, MSG_ORIG(MSG_PHD_PADDR), EC_ADDR(phdr->p_paddr),
conv_phdr_type(osabi, mach, phdr->p_type, 0, &inv_buf));
dbg_print(lml, MSG_ORIG(MSG_PHD_FILESZ), EC_XWORD(phdr->p_filesz),
EC_XWORD(phdr->p_memsz));
dbg_print(lml, MSG_ORIG(MSG_PHD_OFFSET), EC_OFF(phdr->p_offset),
EC_XWORD(phdr->p_align));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/elf_SPARC.h>
#include <debug.h>
#include <libld.h>
#include <conv.h>
#include "_debug.h"
#include "msg.h"
void
Dbg_reloc_apply_reg(Lm_list *lml, int caller, Half mach, Xword off, Xword value)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
/*
* Print the actual relocation being applied to the specified output
* section, the offset represents the actual relocation address, and the
* value is the new data being written to that address.
*/
Elf_reloc_apply_reg(lml, caller, mach, off, value);
}
void
Dbg_reloc_apply_val(Lm_list *lml, int caller, Xword off, Xword value)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
/*
* Print the actual relocation being applied to the specified output
* section, the offset represents the actual relocation address, and the
* value is the new data being written to that address.
*/
Elf_reloc_apply_val(lml, caller, off, value);
}
void
Dbg_reloc_error(Lm_list *lml, int caller, Half mach, Word type, void *reloc,
const char *sname)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
Elf_reloc_entry_1(lml, caller, MSG_INTL(MSG_STR_IN), mach, type, reloc,
NULL, sname, MSG_INTL(MSG_REL_BADROFFSET));
}
void
Dbg_reloc_run(Rt_map *lmp, uint_t rtype, int info, int dtype)
{
Lm_list *lml = LIST(lmp);
const char *str, *name = NAME(lmp);
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (dtype == DBG_REL_FINISH) {
if (info)
str = MSG_ORIG(MSG_STR_EMPTY);
else
str = MSG_INTL(MSG_REL_FAIL);
} else {
if (info)
str = MSG_INTL(MSG_REL_PLT);
else
str = MSG_ORIG(MSG_STR_EMPTY);
}
if (dtype == DBG_REL_START) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_REL_START), name, str);
if (DBG_NOTDETAIL())
return;
Elf_reloc_title(lml, ELF_DBG_RTLD, rtype);
} else {
if (dtype == DBG_REL_NONE) {
dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
dbg_print(lml, MSG_INTL(MSG_REL_NONE), name, str);
} else
dbg_print(lml, MSG_INTL(MSG_REL_FINISH), name,
str);
Dbg_util_nl(lml, DBG_NL_STD);
}
}
void
Dbg_reloc_copy(Rt_map *dlmp, Rt_map *nlmp, const char *name, int zero)
{
const char *str;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
if (zero)
str = MSG_INTL(MSG_STR_COPYZERO);
else
str = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(LIST(dlmp), MSG_INTL(MSG_REL_COPY), NAME(dlmp), NAME(nlmp),
name, str);
}
void
Dbg_reloc_generate(Lm_list *lml, Os_desc *osp, Word type)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_REL_GENERATE), osp->os_name);
if (DBG_NOTDETAIL())
return;
Elf_reloc_title(lml, ELF_DBG_LD, type);
}
/*
* Issue relocation collecting header message prior to listing
* each relocation.
*
* entry:
* lml - Link map control list
* osp - If sh_info was non-NULL, output section to which
* relocation applies. Otherwise NULL.
* isp - If sh_info was non-NULL, input section to which
* relocation applies. Otherwise NULL.
* risp - Relocation section
*
* note: osp and isp must both be NULL, or both non-NULL. risp is never NULL.
*/
void
Dbg_reloc_proc(Lm_list *lml, Os_desc *osp, Is_desc *isp, Is_desc *risp)
{
const char *str1, *str2;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (osp && osp->os_name)
str1 = osp->os_name;
else
str1 = MSG_INTL(MSG_STR_NULL);
if (isp && isp->is_file)
str2 = isp->is_file->ifl_name;
else if (risp && risp->is_file)
str2 = risp->is_file->ifl_name;
else
str2 = MSG_INTL(MSG_STR_NULL);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_REL_COLLECT), str1, str2);
if (DBG_NOTDETAIL())
return;
Elf_reloc_title(lml, ELF_DBG_LD, risp->is_shdr->sh_type);
}
void
Dbg_reloc_doact_title(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_REL_ACTIVE));
Elf_reloc_title(lml, ELF_DBG_LD_ACT, 0);
}
void
Dbg_reloc_doact(Lm_list *lml, int caller, Half mach, Word type, Rel_desc *rdesc,
Xword off, Xword value, rel_desc_sname_func_t rel_desc_sname_func)
{
Conv_inv_buf_t inv_buf;
const char *secname;
Os_desc *osp;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
osp = RELAUX_GET_OSDESC(rdesc);
if (osp) {
secname = osp->os_name;
off += osp->os_shdr->sh_offset;
} else
secname = MSG_ORIG(MSG_STR_EMPTY);
Elf_reloc_entry_2(lml, caller, MSG_ORIG(MSG_STR_EMPTY), type,
conv_reloc_type(mach, rdesc->rel_rtype, 0, &inv_buf),
off, value, secname, (*rel_desc_sname_func)(rdesc),
MSG_ORIG(MSG_STR_EMPTY));
}
void
Dbg_reloc_dooutrel(Lm_list *lml, Word type)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_REL_CREATING));
Elf_reloc_title(lml, ELF_DBG_LD, type);
}
void
Dbg_reloc_discard(Lm_list *lml, Half mach, Rel_desc *rsp)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
Conv_inv_buf_t inv_buf;
Is_desc *isp;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
isp = rsp->rel_isdesc;
dbg_print(lml, MSG_INTL(MSG_REL_DISCARDED),
dbg_fmt_isec_name(isp, buf, &alloc_mem), isp->is_file->ifl_name,
conv_reloc_type(mach, rsp->rel_rtype, 0, &inv_buf),
EC_OFF(rsp->rel_roffset));
if (alloc_mem != NULL)
free(alloc_mem);
}
void
Dbg_reloc_transition(Lm_list *lml, Half mach, Word rtype, Rel_desc *rsp,
rel_desc_sname_func_t rel_desc_sname_func)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
Conv_inv_buf_t inv_buf1, inv_buf2;
Is_desc *isp;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
isp = rsp->rel_isdesc;
dbg_print(lml, MSG_INTL(MSG_REL_TRANSITION),
conv_reloc_type(mach, rsp->rel_rtype, 0, &inv_buf1),
dbg_fmt_isec_name(isp, buf, &alloc_mem), isp->is_file->ifl_name,
EC_OFF(rsp->rel_roffset), (*rel_desc_sname_func)(rsp),
conv_reloc_type(mach, rtype, 0, &inv_buf2));
if (alloc_mem != NULL)
free(alloc_mem);
}
void
Dbg_reloc_out(Ofl_desc *ofl, int caller, Word type, void *reloc,
const char *secname, const char *symname)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
Elf_reloc_entry_1(ofl->ofl_lml, caller, MSG_ORIG(MSG_STR_EMPTY),
ofl->ofl_dehdr->e_machine, type, reloc, secname, symname,
MSG_ORIG(MSG_STR_EMPTY));
}
void
Dbg_reloc_in(Lm_list *lml, int caller, Half mach, Word type, void *reloc,
const char *secname, Word secndx, const char *symname)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
Elf_reloc_entry_1(lml, caller, MSG_INTL(MSG_STR_IN), mach, type, reloc,
dbg_fmt_isec_name2(secname, secndx, buf, &alloc_mem), symname,
MSG_ORIG(MSG_STR_EMPTY));
if (alloc_mem != NULL)
free(alloc_mem);
}
/*
* Used by ld when '-z relaxreloc' is in use and a relocation
* is redirected to a kept section.
*
* entry:
* lml - Link map control list
* sdp - The replacement symbol to be used with the relocation,
* which references the kept section.
*/
void
Dbg_reloc_sloppycomdat(Lm_list *lml, Sym_desc *sdp)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *nfname;
if (DBG_NOTCLASS(DBG_C_RELOC) || DBG_NOTDETAIL())
return;
nfname = (sdp && sdp->sd_file && sdp->sd_file->ifl_name)
? sdp->sd_file->ifl_name : MSG_INTL(MSG_STR_NULL);
dbg_print(lml, MSG_INTL(MSG_REL_SLOPPYCOMDAT),
dbg_fmt_isec_name(sdp->sd_isc, buf, &alloc_mem), nfname);
if (alloc_mem != NULL)
free(alloc_mem);
}
/*
* Print a output relocation structure (Rel_desc).
*/
void
Dbg_reloc_ors_entry(Lm_list *lml, int caller, Word type, Half mach,
Rel_desc *orsp)
{
Conv_inv_buf_t inv_buf;
const char *secname, *symname;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
if (orsp->rel_flags & (FLG_REL_GOT | FLG_REL_RFPTR1 | FLG_REL_RFPTR2)) {
secname = MSG_ORIG(MSG_SCN_GOT);
} else if (orsp->rel_flags & FLG_REL_PLT) {
secname = MSG_ORIG(MSG_SCN_PLT);
} else if (orsp->rel_flags & FLG_REL_BSS) {
secname = MSG_ORIG(MSG_SCN_BSS);
} else {
Os_desc *osp = RELAUX_GET_OSDESC(orsp);
secname = osp ? osp->os_name : MSG_INTL(MSG_STR_NULL);
}
/*
* Register symbols can be relocated/initialized to a constant, which
* is a special case where the symbol index is 0.
*/
if (orsp->rel_sym != NULL)
symname = orsp->rel_sym->sd_name;
else
symname = MSG_ORIG(MSG_STR_EMPTY);
Elf_reloc_entry_2(lml, caller, MSG_INTL(MSG_STR_OUT), type,
conv_reloc_type(mach, orsp->rel_rtype, 0, &inv_buf),
orsp->rel_roffset, orsp->rel_raddend, secname, symname,
MSG_ORIG(MSG_STR_EMPTY));
}
/*
* Print a Active relocation structure (Rel_desc).
*/
void
Dbg_reloc_ars_entry(Lm_list *lml, int caller, Word type, Half mach,
Rel_desc *arsp)
{
Conv_inv_buf_t inv_buf;
const char *secname;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
if (arsp->rel_flags & (FLG_REL_GOT | FLG_REL_FPTR))
secname = MSG_ORIG(MSG_SCN_GOT);
else
secname = RELAUX_GET_OSDESC(arsp)->os_name;
Elf_reloc_entry_2(lml, caller, MSG_INTL(MSG_STR_ACT), type,
conv_reloc_type(mach, arsp->rel_rtype, 0, &inv_buf),
arsp->rel_roffset, arsp->rel_raddend, secname,
arsp->rel_sym->sd_name, MSG_ORIG(MSG_STR_EMPTY));
}
void
Dbg_reloc_entry(Lm_list *lml, const char *prestr, Half mach, Word type,
void *reloc, const char *secname, const char *symname, const char *poststr)
{
/*
* Register relocations can use a constant initializer, in which case
* the associated symbol is 0.
*/
if (symname == NULL)
symname = MSG_ORIG(MSG_STR_EMPTY);
Elf_reloc_entry_1(lml, ELF_DBG_LD, prestr, mach, type, reloc, secname,
symname, poststr);
}
#if defined(_ELF64)
void
Dbg64_pltpad_to(Lm_list *lml, const char *file, Addr pltpad,
const char *dfile, const char *symname)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_BND_PLTPAD_TO), EC_ADDR(pltpad), file,
dfile, symname);
}
void
Dbg64_pltpad_from(Lm_list *lml, const char *file, const char *sname,
Addr pltpad)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_BND_PLTPAD_FROM), EC_ADDR(pltpad), file,
Dbg_demangle_name(sname));
}
#endif
/*
* Relocation output can differ depending on the caller and the type of
* relocation record. However, the final diagnostic is maintained here so
* that the various message strings remain consistent.
*
* elfdump:
* type offset addend section symbol
* X X X X X (Rela)
*
* type offset section symbol
* X X X X (Rel)
*
* Note, it could be argued that the section name output with elfdump(1) is
* unnecessary, as the table itself is identified with a title that reveals
* the section name. However, the output does provide for grep(1)'ing for
* individual entries and obtaining the section name with this type of input.
*
* ld.so.1:
* (prestr) type offset addend symbol
* value
* in X X X X (Rela)
* apply X X
*
* (prestr) type offset value symbol
* in X X X (Rel)
* apply X X
*
* ld:
* (prestr) type offset addend section symbol
* in X X X X X (Rela)
* act X X X X
* out X X X X
*
* (prestr) type offset section symbol
* in X X X X (Rel)
* act X X X X
* out X X X X
*
* Both Rela and Rel active relocations are printed as:
*
* type offset value section symbol
* X X X X X
*/
void
Elf_reloc_title(Lm_list *lml, int caller, Word type)
{
if (caller == ELF_DBG_ELFDUMP) {
if (type == SHT_RELA) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_EFSA_TITLE));
else
dbg_print(lml, MSG_INTL(MSG_REL_EFLA_TITLE));
} else {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_EFSN_TITLE));
else
dbg_print(lml, MSG_INTL(MSG_REL_EFLN_TITLE));
}
return;
}
if (caller == ELF_DBG_RTLD) {
if (type == SHT_RELA) {
dbg_print(lml, MSG_INTL(MSG_REL_RTA_TITLE));
dbg_print(lml, MSG_INTL(MSG_REL_RTV_TITLE));
} else
dbg_print(lml, MSG_INTL(MSG_REL_RTN_TITLE));
return;
}
if (caller == ELF_DBG_LD) {
if (type == SHT_RELA) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_LDSA_TITLE));
else
dbg_print(lml, MSG_INTL(MSG_REL_LDLA_TITLE));
} else {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_LDSN_TITLE));
else
dbg_print(lml, MSG_INTL(MSG_REL_LDLN_TITLE));
}
return;
}
if (caller == ELF_DBG_LD_ACT) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_LDSV_TITLE));
else
dbg_print(lml, MSG_INTL(MSG_REL_LDLV_TITLE));
return;
}
}
void
Elf_reloc_entry_2(Lm_list *lml, int caller, const char *prestr, Word type,
const char *typestr, Addr off, Sxword add, const char *secname,
const char *symname, const char *poststr)
{
if (symname)
symname = Elf_demangle_name(symname);
else
symname = MSG_ORIG(MSG_STR_EMPTY);
if (caller == ELF_DBG_ELFDUMP) {
if (type == SHT_RELA) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_EFSA_ENTRY),
typestr, EC_OFF(off), EC_SXWORD(add),
secname, symname);
else
dbg_print(lml, MSG_INTL(MSG_REL_EFLA_ENTRY),
typestr, EC_OFF(off), EC_SXWORD(add),
secname, symname);
} else {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_EFSN_ENTRY),
typestr, EC_OFF(off), secname, symname);
else
dbg_print(lml, MSG_INTL(MSG_REL_EFLN_ENTRY),
typestr, EC_OFF(off), secname, symname);
}
return;
}
if (caller == ELF_DBG_RTLD) {
if (type == SHT_RELA)
dbg_print(lml, MSG_INTL(MSG_REL_RTA_ENTRY), prestr,
typestr, EC_OFF(off), EC_SXWORD(add), symname,
poststr);
else
dbg_print(lml, MSG_INTL(MSG_REL_RTN_ENTRY), prestr,
typestr, EC_OFF(off), symname, poststr);
return;
}
if (caller == ELF_DBG_LD) {
if (type == SHT_RELA) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_LDSA_ENTRY),
prestr, typestr, EC_OFF(off),
EC_SXWORD(add), secname, symname, poststr);
else
dbg_print(lml, MSG_INTL(MSG_REL_LDLA_ENTRY),
prestr, typestr, EC_OFF(off),
EC_SXWORD(add), secname, symname, poststr);
} else {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_LDSN_ENTRY),
prestr, typestr, EC_OFF(off), secname,
symname, poststr);
else
dbg_print(lml, MSG_INTL(MSG_REL_LDLN_ENTRY),
prestr, typestr, EC_OFF(off), secname,
symname, poststr);
}
return;
}
if (caller == ELF_DBG_LD_ACT) {
longlong_t value = EC_SXWORD(add);
/*
* The following diagnostics are used to create active
* relocation output. A "value" field is specified in the
* same column as a RELA addend.
*
* We have to work around an issue caused by the use of a
* common format string to handle both the 32-bit and 64-bit
* cases. 'add' is a signed value. In the ELFCLASS32 case
* where add is a 32-bit value, the EC_SXWORD() macro widens
* it to a 64-bit signed value, which will cause sign extension
* in the upper 32-bits. As we are displaying the value in hex,
* this causes our 32-bit value to be displayed with 16 hex
* digits instead of 8, as would be appropriate for ELFCLASS32.
*
* The solution is to mask off the unwanted bits before
* formatting the value. The use of 'longlong_t' instead of
* Elf64_Sxword (used by the EC_SXWORD macro) is for the
* benefit of lint.
*/
#if !defined(_ELF64)
value &= 0xffffffff;
#endif
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_REL_LDSA_ENTRY),
prestr, typestr, EC_OFF(off),
value, secname, symname, poststr);
else
dbg_print(lml, MSG_INTL(MSG_REL_LDLA_ENTRY),
prestr, typestr, EC_OFF(off),
value, secname, symname, poststr);
}
}
void
Elf_reloc_entry_1(Lm_list *lml, int caller, const char *prestr, Half mach,
Word type, void *reloc, const char *secname, const char *symname,
const char *poststr)
{
Conv_inv_buf_t inv_buf;
Addr off;
Sxword add;
const char *str;
if (type == SHT_RELA) {
Rela *rela = (Rela *)reloc;
str = conv_reloc_type(mach, ELF_R_TYPE(rela->r_info, mach),
0, &inv_buf);
off = rela->r_offset;
add = rela->r_addend;
} else {
Rel *rel = (Rel *)reloc;
str = conv_reloc_type(mach, ELF_R_TYPE(rel->r_info, mach),
0, &inv_buf);
off = rel->r_offset;
add = 0;
}
Elf_reloc_entry_2(lml, caller, prestr, type, str, off, add, secname,
symname, poststr);
}
/*
* Display any applied relocations. Presently, these are only called from
* ld.so.1, but the interfaces are maintained here to insure consistency with
* other relocation diagnostics.
*/
void
Elf_reloc_apply_val(Lm_list *lml, int caller, Xword offset, Xword value)
{
if (caller == ELF_DBG_RTLD)
dbg_print(lml, MSG_INTL(MSG_REL_RT_APLVAL), EC_XWORD(offset),
EC_XWORD(value));
}
void
Elf_reloc_apply_reg(Lm_list *lml, int caller, Half mach, Xword offset,
Xword value)
{
Conv_inv_buf_t inv_buf;
if (caller == ELF_DBG_RTLD)
dbg_print(lml, MSG_INTL(MSG_REL_RT_APLREG),
conv_sym_value(mach, STT_SPARC_REGISTER,
offset, &inv_buf), EC_XWORD(value));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include "msg.h"
#include "_debug.h"
#include "libld.h"
#include "_string_table.h"
/*
* Format an input section descriptor name for output, in the format
* [ndx]name
* If possible, a user supplied fixed size buffer is used. Failing that,
* dynamic memory is allocated, which must be freed by the caller.
*
* entry:
* [dbg_fmt_isec_name2]: name, scnndx - Name and section index
* [dbg_fmt_isec_name]: isp - Input section descriptor giving name
* and index.
*
* buf - Caller supplied buffer
* alloc_mem - Address of pointer to be set to address of allocated
* memory, or NULL if no memory is allocated.
*
* exit:
* A pointer to the formatted string is returned. If the supplied buffer
* was sufficient, *alloc_mem is set to NULL. If memory was allocated,
* *alloc_mem references it. The caller must free this memory after use.
*/
const char *
dbg_fmt_isec_name2(const char *name, Word scnndx, dbg_isec_name_buf_t buf,
char **alloc_mem)
{
int cnt;
/*
* If the section index is 0, it's not a real section.
* Just use the name as is.
*/
if (scnndx == 0) {
*alloc_mem = NULL;
return (name);
}
/* Format into the fixed buffer */
cnt = snprintf(buf, sizeof (dbg_isec_name_buf_t),
MSG_ORIG(MSG_FMT_ISEC_NAME), EC_WORD(scnndx), name);
/*
* If the name was too long, try to allocate a dynamic buffer.
* Failing that, fall through and use the clipped one already
* formatted into buf, as that's better than nothing.
*/
if ((cnt >= sizeof (dbg_isec_name_buf_t)) &&
((*alloc_mem = malloc(cnt + 1)) != NULL)) {
(void) snprintf(*alloc_mem, cnt + 1,
MSG_ORIG(MSG_FMT_ISEC_NAME), EC_WORD(scnndx), name);
return (*alloc_mem);
}
/* Return the caller supplied buffer */
*alloc_mem = NULL;
return (buf);
}
const char *
dbg_fmt_isec_name(Is_desc *isp, dbg_isec_name_buf_t buf, char **alloc_mem)
{
return (dbg_fmt_isec_name2(isp->is_name, isp->is_scnndx, buf,
alloc_mem));
}
void
Dbg_sec_strtab(Lm_list *lml, Os_desc *osp, Str_tbl *stp)
{
uint_t cnt;
if (DBG_NOTCLASS(DBG_C_STRTAB))
return;
if (!osp)
return;
Dbg_util_nl(lml, DBG_NL_STD);
if (stp->st_flags & FLG_STTAB_COMPRESS)
dbg_print(lml, MSG_INTL(MSG_SEC_STRTAB_COMP), osp->os_name,
EC_XWORD(stp->st_fullstrsize), EC_XWORD(stp->st_strsize));
else
dbg_print(lml, MSG_INTL(MSG_SEC_STRTAB_STND), osp->os_name,
EC_XWORD(stp->st_fullstrsize));
if ((DBG_NOTDETAIL()) ||
((stp->st_flags & FLG_STTAB_COMPRESS) == 0))
return;
dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
dbg_print(lml, MSG_INTL(MSG_SEC_STRTAB_HD), osp->os_name,
stp->st_hbckcnt);
for (cnt = 0; cnt < stp->st_hbckcnt; cnt++) {
Str_hash *strhash = stp->st_hashbcks[cnt];
if (strhash == NULL)
continue;
dbg_print(lml, MSG_INTL(MSG_SEC_STRTAB_BCKT), cnt);
while (strhash) {
size_t stroff = strhash->hi_mstr->sm_strlen -
strhash->hi_strlen;
if (stroff == 0) {
dbg_print(lml, MSG_INTL(MSG_SEC_STRTAB_MSTR),
EC_XWORD(strhash->hi_refcnt),
strhash->hi_mstr->sm_str);
} else {
dbg_print(lml, MSG_INTL(MSG_SEC_STRTAB_SUFSTR),
EC_XWORD(strhash->hi_refcnt),
&strhash->hi_mstr->sm_str[stroff],
strhash->hi_mstr->sm_str);
}
strhash = strhash->hi_next;
}
}
}
void
Dbg_sec_genstr_compress(Lm_list *lml, const char *os_name,
Xword raw_size, Xword merge_size)
{
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
dbg_print(lml, MSG_INTL(MSG_SEC_GENSTR_COMP), os_name,
EC_XWORD(raw_size), EC_XWORD(merge_size));
}
void
Dbg_sec_unsup_strmerge(Lm_list *lml, Is_desc *isp)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *str;
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
/*
* We can only merge string table sections with single byte
* (char) characters. For any other (wide) character types,
* issue a message so the user will understand why these
* sections are not being picked up.
*/
if ((isp->is_shdr->sh_entsize > 1) ||
(isp->is_shdr->sh_addralign > 1)) {
str = (isp->is_file != NULL) ? isp->is_file->ifl_name :
MSG_INTL(MSG_STR_NULL);
dbg_print(lml, MSG_INTL(MSG_SEC_STRMERGE_UNSUP),
dbg_fmt_isec_name(isp, buf, &alloc_mem), str,
EC_XWORD(isp->is_shdr->sh_addralign),
EC_XWORD(isp->is_shdr->sh_entsize));
if (alloc_mem != NULL)
free(alloc_mem);
}
}
void
Dbg_sec_backing(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SEC_BACKING));
}
void
Dbg_sec_in(Lm_list *lml, Is_desc *isp)
{
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
if (isp->is_flags & FLG_IS_GNSTRMRG) {
/*
* This section was generated because we have 1 or
* more SHF_MERGE|SHF_STRINGS input sections that we
* wish to merge. This new section will ultimately
* end up replacing those sections once it has been filled
* with their strings (merged and compressed) and relocations
* have been redirected.
*/
dbg_print(lml, MSG_INTL(MSG_SEC_INPUT_GENSTR), isp->is_name);
} else if (isp->is_file == NULL) {
/* Generated input section */
dbg_print(lml, MSG_INTL(MSG_SEC_INPUT_GEN), isp->is_name);
} else {
/* Standard input section */
dbg_isec_name_buf_t buf;
char *alloc_mem;
dbg_print(lml, MSG_INTL(MSG_SEC_INPUT),
dbg_fmt_isec_name(isp, buf, &alloc_mem),
isp->is_file->ifl_name);
if (alloc_mem != NULL)
free(alloc_mem);
}
}
void
Dbg_sec_added(Lm_list *lml, Os_desc *osp, Sg_desc *sgp)
{
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
dbg_print(lml, MSG_INTL(MSG_SEC_ADDED), osp->os_name,
(sgp->sg_name ? sgp->sg_name : MSG_INTL(MSG_STR_NULL)));
}
void
Dbg_sec_created(Lm_list *lml, Os_desc *osp, Sg_desc *sgp)
{
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
dbg_print(lml, MSG_INTL(MSG_SEC_CREATED), osp->os_name,
(sgp->sg_name ? sgp->sg_name : MSG_INTL(MSG_STR_NULL)));
}
void
Dbg_sec_discarded(Lm_list *lml, Is_desc *isp, Is_desc *disp)
{
if (DBG_NOTCLASS(DBG_C_SECTIONS | DBG_C_UNUSED))
return;
if ((isp->is_flags & FLG_IS_INSTRMRG) &&
(disp->is_flags & FLG_IS_GNSTRMRG)) {
/*
* This SHF_MERGE|SHF_STRINGS input section is being
* discarded in favor of the generated merged string section.
*/
dbg_isec_name_buf_t buf;
char *alloc_mem;
dbg_print(lml, MSG_INTL(MSG_SEC_STRMERGE_DISCARDED),
dbg_fmt_isec_name(isp, buf, &alloc_mem),
isp->is_file->ifl_name);
if (alloc_mem != NULL)
free(alloc_mem);
} else {
/* Generic section discard */
dbg_isec_name_buf_t buf1, buf2;
char *alloc_mem1, *alloc_mem2;
dbg_print(lml, MSG_INTL(MSG_SEC_DISCARDED),
dbg_fmt_isec_name(isp, buf1, &alloc_mem1),
isp->is_file->ifl_name,
dbg_fmt_isec_name(disp, buf2, &alloc_mem2),
disp->is_file->ifl_name);
if (alloc_mem1 != NULL)
free(alloc_mem1);
if (alloc_mem2 != NULL)
free(alloc_mem2);
}
}
void
Dbg_sec_group(Lm_list *lml, Is_desc *isp, Group_desc *gdp)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *comdat, *isp_str;
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
if (gdp->gd_data[0] & GRP_COMDAT)
comdat = MSG_ORIG(MSG_STR_COMDAT);
else
comdat = MSG_ORIG(MSG_STR_EMPTY);
isp_str = dbg_fmt_isec_name(isp, buf, &alloc_mem);
if (isp->is_shdr->sh_type == SHT_GROUP) {
dbg_print(lml, MSG_INTL(MSG_SEC_GRP_DEFINE), isp_str,
isp->is_file->ifl_name, comdat, gdp->gd_name);
} else {
dbg_print(lml, MSG_INTL(MSG_SEC_GRP_MEMBER), isp_str,
isp->is_file->ifl_name, comdat, gdp->gd_name);
}
if (gdp->gd_oisc) {
dbg_print(lml, MSG_INTL(MSG_SEC_GRP_DISCARDED), isp_str,
isp->is_file->ifl_name, gdp->gd_name,
gdp->gd_oisc->is_file->ifl_name);
}
if (alloc_mem != NULL)
free(alloc_mem);
}
void
Dbg_sec_order_list(Ofl_desc *ofl, int flag)
{
Os_desc *osp;
Is_desc *isp1;
Aliste idx1;
Lm_list *lml = ofl->ofl_lml;
const char *str;
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
/*
* If the flag == 0, then the routine is called before sorting.
*/
if (flag == 0)
str = MSG_INTL(MSG_ORD_SORT_BEFORE);
else
str = MSG_INTL(MSG_ORD_SORT_AFTER);
for (APLIST_TRAVERSE(ofl->ofl_ordered, idx1, osp)) {
int os_isdescs_idx;
Aliste idx2;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, str, osp->os_name);
dbg_print(lml, MSG_INTL(MSG_ORD_HDR_1),
EC_WORD(aplist_nitems(osp->os_isdescs[OS_ISD_BEFORE])),
EC_WORD(aplist_nitems(osp->os_isdescs[OS_ISD_ORDERED])),
EC_WORD(aplist_nitems(osp->os_isdescs[OS_ISD_DEFAULT])),
EC_WORD(aplist_nitems(osp->os_isdescs[OS_ISD_AFTER])));
OS_ISDESCS_TRAVERSE(os_isdescs_idx, osp, idx2, isp1) {
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *isp1_str;
Word link;
Ifl_desc *ifl = isp1->is_file;
Is_desc *isp2;
const char *msg;
/*
* An output segment that requires ordering might have
* as little as two sorted input sections. For example,
* the crt's can provide a SHN_BEGIN and SHN_AFTER, and
* only these two sections must be processed. Thus, if
* a input section is unordered, move on. Diagnosing
* any unsorted section can produce way too much noise.
*/
if ((isp1->is_flags & FLG_IS_ORDERED) == 0)
continue;
if (isp1->is_shdr->sh_flags & SHF_ORDERED) {
link = isp1->is_shdr->sh_info;
msg = MSG_ORIG(MSG_SH_INFO);
} else { /* SHF_LINK_ORDER */
link = isp1->is_shdr->sh_link;
msg = MSG_ORIG(MSG_SH_LINK);
}
isp1_str = dbg_fmt_isec_name(isp1, buf, &alloc_mem);
if (link == SHN_BEFORE) {
dbg_print(lml, MSG_INTL(MSG_ORD_TITLE_1), msg,
isp1_str, isp1->is_file->ifl_name);
} else if (link == SHN_AFTER) {
dbg_print(lml, MSG_INTL(MSG_ORD_TITLE_2), msg,
isp1_str, isp1->is_file->ifl_name);
} else {
isp2 = ifl->ifl_isdesc[link];
dbg_print(lml, MSG_INTL(MSG_ORD_TITLE_3),
EC_WORD(isp2->is_keyident), isp1_str,
ifl->ifl_name, msg, isp2->is_name);
}
if (alloc_mem != NULL)
free(alloc_mem);
}
}
Dbg_util_nl(lml, DBG_NL_STD);
}
/*
* Error message string table.
*/
static const Msg order_errors[] = {
MSG_ORD_ERR_INFORANGE, /* MSG_INTL(MSG_ORD_ERR_INFORANGE) */
MSG_ORD_ERR_ORDER, /* MSG_INTL(MSG_ORD_ERR_ORDER) */
MSG_ORD_ERR_LINKRANGE, /* MSG_INTL(MSG_ORD_ERR_LINKRANGE) */
MSG_ORD_ERR_FLAGS, /* MSG_INTL(MSG_ORD_ERR_FLAGS) */
MSG_ORD_ERR_CYCLIC, /* MSG_INTL(MSG_ORD_ERR_CYCLIC) */
MSG_ORD_ERR_LINKINV /* MSG_INTL(MSG_ORD_ERR_LINKINV) */
};
void
Dbg_sec_order_error(Lm_list *lml, Ifl_desc *ifl, Word ndx, int error)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
if (DBG_NOTDETAIL())
return;
if (error == 0)
return;
dbg_print(lml, MSG_INTL(MSG_ORD_ERR_TITLE),
dbg_fmt_isec_name(ifl->ifl_isdesc[ndx], buf, &alloc_mem),
ifl->ifl_name);
if (alloc_mem != NULL)
free(alloc_mem);
if (error)
dbg_print(lml, MSG_INTL(order_errors[error - 1]));
}
void
Dbg_sec_redirected(Lm_list *lml, Is_desc *isp, const char *nname)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
dbg_print(lml, MSG_INTL(MSG_SEC_REDIRECTED),
dbg_fmt_isec_name(isp, buf, &alloc_mem), nname);
if (alloc_mem != NULL)
free(alloc_mem);
}
void
Dbg_sec_gnu_comdat(Lm_list *lml, Is_desc *isp, Boolean comdat, Boolean relax)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *fmt;
if (DBG_NOTCLASS(DBG_C_SECTIONS))
return;
if (comdat && relax)
fmt = MSG_INTL(MSG_SEC_GNU_COMDAT_1);
else if (comdat)
fmt = MSG_INTL(MSG_SEC_GNU_COMDAT_2);
else
fmt = MSG_INTL(MSG_SEC_GNU_COMDAT_3);
dbg_print(lml, fmt, dbg_fmt_isec_name(isp, buf, &alloc_mem));
if (alloc_mem != NULL)
free(alloc_mem);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include "msg.h"
#include "_debug.h"
#include "libld.h"
/*
* Print out a single `segment descriptor' entry.
*/
void
Dbg_seg_desc_entry(Lm_list *lml, uchar_t osabi, Half mach, int ndx,
Sg_desc *sgp, Boolean space_nl)
{
Conv_seg_flags_buf_t seg_flags_buf;
Aliste idx;
Sym_desc *sdp;
if (space_nl)
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_ORIG(MSG_SEG_DESC), ndx);
if (sgp->sg_name)
dbg_print(lml, MSG_ORIG(MSG_SEG_NAME), sgp->sg_name);
dbg_print(lml, MSG_ORIG(MSG_SEG_FLAGS),
conv_seg_flags(sgp->sg_flags, &seg_flags_buf));
Elf_phdr(lml, osabi, mach, &sgp->sg_phdr);
if (sgp->sg_flags & FLG_SG_P_ALIGN)
dbg_print(lml, MSG_ORIG(MSG_SEG_ALIGN),
EC_ADDR(sgp->sg_align));
if (sgp->sg_flags & FLG_SG_LENGTH)
dbg_print(lml, MSG_ORIG(MSG_SEG_LENGTH),
EC_ADDR(sgp->sg_length));
if (sgp->sg_flags & FLG_SG_ROUND)
dbg_print(lml, MSG_ORIG(MSG_SEG_ROUND),
EC_ADDR(sgp->sg_round));
if (aplist_nitems(sgp->sg_sizesym) > 0) {
dbg_print(lml, MSG_ORIG(MSG_SEG_SIZESYM_TITLE));
for (APLIST_TRAVERSE(sgp->sg_sizesym, idx, sdp))
if (sdp->sd_name)
dbg_print(lml, MSG_ORIG(MSG_SEG_SIZESYM),
Dbg_demangle_name(sdp->sd_name));
}
if (aplist_nitems(sgp->sg_is_order) > 0) {
Aliste idx;
Ent_desc *enp;
dbg_print(lml, MSG_ORIG(MSG_SEG_IS_ORDER_TITLE));
for (APLIST_TRAVERSE(sgp->sg_is_order, idx, enp))
dbg_print(lml, MSG_ORIG(MSG_SEG_LIST_ITEM),
enp->ec_name);
}
if (alist_nitems(sgp->sg_os_order) > 0) {
Aliste idx;
Sec_order *scop;
dbg_print(lml, MSG_ORIG(MSG_SEG_OS_ORDER_TITLE));
for (ALIST_TRAVERSE(sgp->sg_os_order, idx, scop))
dbg_print(lml, MSG_ORIG(MSG_SEG_LIST_ITEM),
scop->sco_secname);
}
if (space_nl)
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_seg_title(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_SEGMENTS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SEG_DESC_INUSE));
}
void
Dbg_seg_entry(Ofl_desc *ofl, int ndx, Sg_desc *sgp)
{
if (DBG_NOTCLASS(DBG_C_SEGMENTS))
return;
Dbg_seg_desc_entry(ofl->ofl_lml, ofl->ofl_dehdr->e_ident[EI_OSABI],
ofl->ofl_dehdr->e_machine, ndx, sgp, TRUE);
}
/*
* Print out the available segment descriptors.
*/
void
Dbg_seg_list(Lm_list *lml, uchar_t osabi, Half mach, APlist *apl)
{
Aliste idx;
Sg_desc *sgp;
int ndx = 0;
if (DBG_NOTCLASS(DBG_C_SEGMENTS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SEG_DESC_AVAIL));
for (APLIST_TRAVERSE(apl, idx, sgp))
Dbg_seg_desc_entry(lml, osabi, mach, ndx++, sgp, TRUE);
}
/*
* Print the output section information. This includes the section header
* information and the output elf buffer information. If the detail flag is
* set, traverse the input sections displaying all the input buffers that
* have been concatenated to form this output buffer.
*/
void
Dbg_seg_os(Ofl_desc *ofl, Os_desc *osp, int ndx)
{
Conv_inv_buf_t inv_buf;
Lm_list *lml = ofl->ofl_lml;
Aliste idx;
Is_desc *isp;
Elf_Data *data;
Shdr *shdr;
const char *empty = MSG_ORIG(MSG_STR_EMPTY);
int os_isdescs_idx;
if (DBG_NOTCLASS(DBG_C_SEGMENTS))
return;
dbg_print(lml, MSG_ORIG(MSG_SEC_NAME), ndx, osp->os_name);
Elf_shdr(lml, ofl->ofl_dehdr->e_ident[EI_OSABI],
ofl->ofl_dehdr->e_machine, osp->os_shdr);
dbg_print(lml, MSG_INTL(MSG_EDATA_TITLE));
shdr = osp->os_shdr;
data = osp->os_outdata;
dbg_print(lml, MSG_INTL(MSG_EDATA_ENTRY), MSG_INTL(MSG_STR_OUT),
EC_ADDR(shdr->sh_addr), conv_elfdata_type(data->d_type, &inv_buf),
EC_XWORD(data->d_size), EC_OFF(data->d_off),
EC_XWORD(data->d_align), empty, empty, empty);
if (DBG_NOTDETAIL())
return;
OS_ISDESCS_TRAVERSE(os_isdescs_idx, osp, idx, isp) {
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *file, *str;
Addr addr;
data = isp->is_indata;
if (isp->is_flags & FLG_IS_DISCARD) {
str = MSG_INTL(MSG_EDATA_IGNSCN);
addr = 0;
} else {
str = empty;
addr = (Addr)(shdr->sh_addr + data->d_off);
}
if (isp->is_file && isp->is_file->ifl_name)
file = isp->is_file->ifl_name;
else
file = empty;
dbg_print(lml, MSG_INTL(MSG_EDATA_ENTRY), MSG_INTL(MSG_STR_IN),
EC_ADDR(addr), conv_elfdata_type(data->d_type, &inv_buf),
EC_XWORD(data->d_size), EC_OFF(data->d_off),
EC_XWORD(data->d_align), file,
dbg_fmt_isec_name(isp, buf, &alloc_mem), str);
if (alloc_mem != NULL)
free(alloc_mem);
}
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sgs.h>
#include <_debug.h>
#include <conv.h>
#include <msg.h>
void
Elf_shdr(Lm_list *lml, uchar_t osabi, Half mach, Shdr *shdr)
{
Conv_inv_buf_t inv_buf1, inv_buf2;
Conv_sec_flags_buf_t sec_flags_buf;
dbg_print(lml, MSG_ORIG(MSG_SHD_ADDR), EC_ADDR(shdr->sh_addr),
conv_sec_flags(osabi, mach, shdr->sh_flags, 0, &sec_flags_buf));
dbg_print(lml, MSG_ORIG(MSG_SHD_SIZE), EC_XWORD(shdr->sh_size),
conv_sec_type(osabi, mach, shdr->sh_type, 0, &inv_buf1));
if (shdr->sh_entsize == 0) {
dbg_print(lml, MSG_ORIG(MSG_SHD_OFFSET),
EC_OFF(shdr->sh_offset), EC_XWORD(shdr->sh_entsize));
} else { /* Provide an entry count */
Xword nelts = shdr->sh_size / shdr->sh_entsize;
const char *entstr = (nelts == 1) ? MSG_INTL(MSG_SHD_ENTRY_1) :
MSG_INTL(MSG_SHD_ENTRY_N);
dbg_print(lml, MSG_ORIG(MSG_SHD_OFFSET_ENT),
EC_OFF(shdr->sh_offset), EC_XWORD(shdr->sh_entsize),
EC_XWORD(nelts), entstr);
}
dbg_print(lml, MSG_ORIG(MSG_SHD_LINK),
conv_sec_linkinfo(shdr->sh_link, shdr->sh_flags, &inv_buf1),
conv_sec_linkinfo(shdr->sh_info, shdr->sh_flags, &inv_buf2));
dbg_print(lml, MSG_ORIG(MSG_SHD_ALIGN), EC_XWORD(shdr->sh_addralign));
}
void
Dbg_shdr_modified(Lm_list *lml, const char *obj, uchar_t osabi, Half mach,
Word ndx, Shdr *oshdr, Shdr *nshdr, const char *name)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
if (DBG_NOTCLASS(DBG_C_SECTIONS | DBG_C_SUPPORT))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SHD_MODIFIED),
dbg_fmt_isec_name2(name, ndx, buf, &alloc_mem), obj);
if (alloc_mem != NULL)
free(alloc_mem);
dbg_print(lml, MSG_INTL(MSG_SHD_ORIG));
Elf_shdr(lml, osabi, mach, oshdr);
dbg_print(lml, MSG_INTL(MSG_SHD_NEW));
Elf_shdr(lml, osabi, mach, nshdr);
Dbg_util_nl(lml, DBG_NL_STD);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <stdio.h>
#include "_debug.h"
#include "msg.h"
#include "libld.h"
static const char *
fmt_human_units(size_t bytes, char *buf, size_t bufsize)
{
static int unit_arr[] = { 'K', 'M', 'G', 'T' };
int i, unit_ch;
size_t unit_bytes = bytes;
/* Convert to human readable units */
for (i = 0; i < sizeof (unit_arr) / sizeof (unit_arr[0]); i++) {
if (unit_bytes < 1024)
break;
unit_ch = unit_arr[i];
unit_bytes /= 1024;
}
if (unit_bytes == bytes)
buf[0] = '\0';
else
(void) snprintf(buf, bufsize, MSG_ORIG(MSG_FMT_MEMUNIT),
EC_XWORD(unit_bytes), unit_ch);
return (buf);
}
/*
* Generate a relocation cache statistics line for the active or
* output relocation cache.
*
* entry:
* ofl - output file descriptor
* alp - One of ofl->ofl_actrels or ofl->ofl_outrels.
*/
static void
rel_cache_statistics(Ofl_desc *ofl, const char *title, APlist *alp)
{
Lm_list *lml = ofl->ofl_lml;
size_t desc_cnt = 0, desc_used = 0, bytes;
Aliste idx;
Rel_cachebuf *rcp;
char unit_buf[CONV_INV_BUFSIZE + 10];
/* Sum the total memory allocated across all the buffers */
for (APLIST_TRAVERSE(alp, idx, rcp)) {
desc_cnt += rcp->rc_end - rcp->rc_arr;
desc_used += rcp->rc_free - rcp->rc_arr;
}
bytes = desc_cnt * sizeof (Rel_desc);
dbg_print(lml, MSG_INTL(MSG_STATS_REL_CACHE), title,
EC_WORD(aplist_nitems(alp)),
EC_XWORD(desc_used), EC_XWORD(desc_cnt),
(desc_cnt == 0) ? 100 : EC_WORD((desc_used * 100) / desc_cnt),
EC_XWORD(bytes),
fmt_human_units(bytes, unit_buf, sizeof (unit_buf)));
}
/*
* Generate a statistics line for the auxiliary relocation descriptor cache.
*
* entry:
* ofl - output file descriptor
*/
static void
rel_aux_cache_statistics(Ofl_desc *ofl)
{
Rel_aux_cachebuf *racp;
Lm_list *lml = ofl->ofl_lml;
size_t desc_cnt = 0, desc_used = 0, bytes;
Aliste idx;
char unit_buf[CONV_INV_BUFSIZE + 10];
/* Sum the total memory allocated across all the buffers */
for (APLIST_TRAVERSE(ofl->ofl_relaux, idx, racp)) {
desc_cnt += racp->rac_end - racp->rac_arr;
desc_used += racp->rac_free - racp->rac_arr;
}
bytes = desc_cnt * sizeof (Rel_desc);
dbg_print(lml, MSG_INTL(MSG_STATS_REL_ACACHE),
EC_WORD(aplist_nitems(ofl->ofl_relaux)),
EC_XWORD(desc_used), EC_XWORD(desc_cnt),
(desc_cnt == 0) ? 100 : EC_WORD((desc_used * 100) / desc_cnt),
EC_XWORD(bytes),
fmt_human_units(bytes, unit_buf, sizeof (unit_buf)));
}
void
Dbg_statistics_ld(Ofl_desc *ofl)
{
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_STATS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_STATS_GENERAL));
if (ofl->ofl_objscnt || ofl->ofl_soscnt || ofl->ofl_arscnt) {
dbg_print(lml, MSG_INTL(MSG_STATS_FILES),
EC_XWORD(ofl->ofl_objscnt), EC_XWORD(ofl->ofl_soscnt),
EC_XWORD(ofl->ofl_arscnt));
}
if (ofl->ofl_locscnt || ofl->ofl_globcnt) {
dbg_print(lml, MSG_INTL(MSG_STATS_SYMBOLS_OUT),
EC_XWORD(ofl->ofl_globcnt), EC_XWORD(ofl->ofl_locscnt));
}
if (ofl->ofl_entercnt || ofl->ofl_scopecnt || ofl->ofl_elimcnt) {
dbg_print(lml, MSG_INTL(MSG_STATS_SYMBOLS_IN),
EC_XWORD(ofl->ofl_entercnt), EC_XWORD(ofl->ofl_scopecnt),
EC_XWORD(ofl->ofl_elimcnt));
}
dbg_print(lml, MSG_INTL(MSG_STATS_REL_OUT),
EC_XWORD(ofl->ofl_outrels.rc_cnt));
dbg_print(lml, MSG_INTL(MSG_STATS_REL_IN),
EC_XWORD(ofl->ofl_entrelscnt), EC_XWORD(ofl->ofl_actrels.rc_cnt));
dbg_print(lml, MSG_INTL(MSG_STATS_REL_TICACHE));
rel_cache_statistics(ofl, MSG_INTL(MSG_STATS_REL_TIOUT),
ofl->ofl_outrels.rc_list);
rel_cache_statistics(ofl, MSG_INTL(MSG_STATS_REL_TIACT),
ofl->ofl_actrels.rc_list);
rel_aux_cache_statistics(ofl);
}
void
Dbg_statistics_ar(Ofl_desc *ofl)
{
Aliste idx;
Ar_desc *adp;
Elf_Arsym *arsym;
Ar_aux *aux;
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_STATS | DBG_C_UNUSED))
return;
Dbg_util_nl(lml, DBG_NL_STD);
for (APLIST_TRAVERSE(ofl->ofl_ars, idx, adp)) {
size_t poffset = 0;
uint_t count = 0, used = 0;
if ((adp->ad_flags & FLG_ARD_EXTRACT) == 0) {
Dbg_unused_file(lml, adp->ad_name, 0, 0);
continue;
}
if (DBG_NOTCLASS(DBG_C_STATS))
continue;
arsym = adp->ad_start;
aux = adp->ad_aux;
while ((arsym != NULL) && (arsym->as_off != 0)) {
/*
* Assume that symbols from the same member file are
* adjacent within the archive symbol table.
*/
if (poffset != arsym->as_off) {
count++;
poffset = arsym->as_off;
if (aux->au_mem == FLG_ARMEM_PROC)
used++;
}
aux++, arsym++;
}
if ((count == 0) || (used == 0))
continue;
dbg_print(lml, MSG_INTL(MSG_STATS_AR), adp->ad_name, count,
used, ((used * 100) / count));
}
Dbg_util_nl(lml, DBG_NL_STD);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "msg.h"
#include "_debug.h"
void
Dbg_support_req(Lm_list *lml, const char *define, int flag)
{
const char *str;
if (DBG_NOTCLASS(DBG_C_SUPPORT))
return;
switch (flag) {
case DBG_SUP_ENVIRON:
str = MSG_INTL(MSG_SUP_REQ_ENV);
break;
case DBG_SUP_CMDLINE:
str = MSG_INTL(MSG_SUP_REQ_CMD);
break;
default:
str = MSG_ORIG(MSG_STR_EMPTY);
break;
}
dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
dbg_print(lml, MSG_INTL(MSG_SUP_REQ), define, str);
}
void
Dbg_support_load(Lm_list *lml, const char *obj, const char *func)
{
if (DBG_NOTCLASS(DBG_C_SUPPORT))
return;
dbg_print(lml, MSG_INTL(MSG_SUP_ROUTINE), obj, func);
}
void
Dbg_support_vnone(Lm_list *lml, const char *obj)
{
if (DBG_NOTCLASS(DBG_C_SUPPORT))
return;
dbg_print(lml, MSG_INTL(MSG_SUP_VNONE), obj);
}
void
Dbg_support_action(Lm_list *lml, const char *obj, const char *func,
Support_ndx ndx, const char *name)
{
const char *str;
if (DBG_NOTCLASS(DBG_C_SUPPORT))
return;
if (DBG_NOTDETAIL())
return;
if (ndx == LDS_START)
str = MSG_INTL(MSG_SUP_OUTFILE);
else if ((ndx == LDS_OPEN) || (ndx == LDS_FILE))
str = MSG_INTL(MSG_SUP_INFILE);
else if (ndx == LDS_INSEC)
str = MSG_INTL(MSG_SUP_INSEC);
else if (ndx == LDS_SEC)
str = MSG_INTL(MSG_SUP_SEC);
if ((ndx == LDS_ATEXIT) || (ndx == LDS_VERSION) ||
(ndx == LDS_INPUT_DONE))
dbg_print(lml, MSG_INTL(MSG_SUP_CALLING_1), func, obj);
else
dbg_print(lml, MSG_INTL(MSG_SUP_CALLING_2), func, obj,
str, name);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sgs.h>
#include <stdio.h>
#include <debug.h>
#include <msg.h>
void
Elf_syminfo_title(Lm_list *lml)
{
dbg_print(lml, MSG_INTL(MSG_SYMINFO_TITLE));
}
#define FLAGSZ 16
#define NDXSZ 10
void
Elf_syminfo_entry(Lm_list *lml, Word ndx, Syminfo *sip, const char *name,
const char *needed)
{
const char *bndstr = NULL, *str;
char flagstr[FLAGSZ], sndxstr[NDXSZ], dndxstr[NDXSZ];
int flgndx = 0;
Half flags = sip->si_flags;
if (flags & SYMINFO_FLG_CAP) {
bndstr = MSG_INTL(MSG_SYMINFO_CAP);
flagstr[flgndx++] = 'S';
flags &= ~SYMINFO_FLG_CAP;
}
if (flags & SYMINFO_FLG_DIRECT) {
if (bndstr == NULL) {
if (sip->si_boundto == SYMINFO_BT_SELF)
bndstr = MSG_INTL(MSG_SYMINFO_SELF);
else if (sip->si_boundto == SYMINFO_BT_PARENT)
bndstr = MSG_INTL(MSG_SYMINFO_PARENT);
else
bndstr = needed;
}
flagstr[flgndx++] = 'D';
flags &= ~SYMINFO_FLG_DIRECT;
} else if (flags & SYMINFO_FLG_FILTER) {
bndstr = needed;
flagstr[flgndx++] = 'F';
flags &= ~SYMINFO_FLG_FILTER;
} else if (flags & SYMINFO_FLG_AUXILIARY) {
bndstr = needed;
flagstr[flgndx++] = 'A';
flags &= ~SYMINFO_FLG_AUXILIARY;
} else if (sip->si_boundto == SYMINFO_BT_EXTERN)
bndstr = MSG_INTL(MSG_SYMINFO_EXTERN);
else if (bndstr == NULL)
bndstr = MSG_ORIG(MSG_STR_EMPTY);
if (flags & SYMINFO_FLG_DIRECTBIND) {
flagstr[flgndx++] = 'B';
flags &= ~SYMINFO_FLG_DIRECTBIND;
}
if (flags & SYMINFO_FLG_COPY) {
flagstr[flgndx++] = 'C';
flags &= ~SYMINFO_FLG_COPY;
}
if (flags & SYMINFO_FLG_LAZYLOAD) {
flagstr[flgndx++] = 'L';
flags &= ~SYMINFO_FLG_LAZYLOAD;
}
if (flags & SYMINFO_FLG_NOEXTDIRECT) {
flagstr[flgndx++] = 'N';
flags &= ~SYMINFO_FLG_NOEXTDIRECT;
}
if (flags & SYMINFO_FLG_INTERPOSE) {
flagstr[flgndx++] = 'I';
flags &= ~SYMINFO_FLG_INTERPOSE;
}
if (flags & SYMINFO_FLG_DEFERRED) {
flagstr[flgndx++] = 'P';
flags &= ~SYMINFO_FLG_DEFERRED;
}
/*
* Did we account for all of the flags?
*/
if (flags)
(void) snprintf(&flagstr[flgndx], FLAGSZ - flgndx,
MSG_ORIG(MSG_SYMINFO_UNKFLAG), flags);
else
flagstr[flgndx] = '\0';
/*
* If we've bound to a dependency, determine the dynamic entry index.
*/
if (bndstr == needed) {
(void) snprintf(dndxstr, NDXSZ, MSG_ORIG(MSG_FMT_INDEX),
sip->si_boundto);
str = dndxstr;
} else
str = MSG_ORIG(MSG_STR_EMPTY);
(void) snprintf(sndxstr, NDXSZ, MSG_ORIG(MSG_FMT_INDEX), ndx);
dbg_print(lml, MSG_INTL(MSG_SYMINFO_ENTRY), sndxstr, flagstr, str,
bndstr, Elf_demangle_name(name));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2022 Oxide Computer Company
*/
#include <stdio.h>
#include "msg.h"
#include "_debug.h"
#include "libld.h"
void
Dbg_syms_lookup(Rt_map *lmp, const char *name, const char *type)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_LOOKUP), Dbg_demangle_name(name),
NAME(lmp), type);
}
static const Msg captype[DBG_CAP_HW_3 + 1] = {
MSG_CAP_SYM_DEFAULT, /* MSG_INTL(MSG_CAP_SYM_DEFAULT) */
MSG_CAP_SYM_USED, /* MSG_INTL(MSG_CAP_SYM_USED) */
MSG_CAP_SYM_CANDIDATE, /* MSG_INTL(MSG_CAP_SYM_CANDIDATE) */
MSG_CAP_SYM_REJECTED, /* MSG_INTL(MSG_CAP_SYM_REJECTED) */
MSG_CAP_SYM_HW_1, /* MSG_INTL(MSG_CAP_SYM_HW_1) */
MSG_CAP_SYM_SF_1, /* MSG_INTL(MSG_CAP_SYM_SF_1) */
MSG_CAP_SYM_HW_2, /* MSG_INTL(MSG_CAP_SYM_HW_2) */
MSG_CAP_SYM_PLAT, /* MSG_INTL(MSG_CAP_SYM_PLAT) */
MSG_CAP_SYM_MACH, /* MSG_INTL(MSG_CAP_SYM_MACH) */
MSG_CAP_SYM_HW_3 /* MSG_INTL(MSG_CAP_SYM_HW_3) */
};
void
Dbg_syms_cap_lookup(Rt_map *lmp, uint_t type, const char *name, uint_t ndx,
Half mach, Syscapset *scapset)
{
Lm_list *lml = LIST(lmp);
const char *str = NULL;
Conv_cap_val_buf_t cap_val_buf;
if (DBG_NOTCLASS(DBG_C_CAP | DBG_C_SYMBOLS))
return;
switch (type) {
case DBG_CAP_HW_1:
str = conv_cap_val_hw1(scapset->sc_hw_1, mach, 0,
&cap_val_buf.cap_val_hw1_buf);
break;
case DBG_CAP_SF_1:
str = conv_cap_val_sf1(scapset->sc_sf_1, mach, 0,
&cap_val_buf.cap_val_sf1_buf);
break;
case DBG_CAP_HW_2:
str = conv_cap_val_hw2(scapset->sc_hw_2, mach, 0,
&cap_val_buf.cap_val_hw2_buf);
break;
case DBG_CAP_MACH:
str = scapset->sc_mach;
break;
case DBG_CAP_PLAT:
str = scapset->sc_plat;
break;
case DBG_CAP_HW_3:
str = conv_cap_val_hw3(scapset->sc_hw_3, mach, 0,
&cap_val_buf.cap_val_hw3_buf);
break;
}
dbg_print(lml, MSG_INTL(captype[type]), Dbg_demangle_name(name),
ndx, str);
}
void
Dbg_syms_ignore_gnuver(Rt_map *lmp, const char *name, Word symndx,
Versym verndx)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_IGNGNUVER), Dbg_demangle_name(name),
EC_WORD(symndx), EC_HALF(verndx), NAME(lmp));
}
void
Dbg_syms_lazy_rescan(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS | DBG_C_FILES))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_LAZY_RESCAN), Dbg_demangle_name(name));
}
void
Dbg_syms_ar_title(Lm_list *lml, const char *file, Boolean again)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_AR_FILE), file,
again ? MSG_INTL(MSG_STR_AGAIN) : MSG_ORIG(MSG_STR_EMPTY));
}
void
Dbg_syms_ar_skip(Lm_list *lml, const char *archive, Elf_Arsym *arsym)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_AR_SKIP), archive,
Dbg_demangle_name(arsym->as_name));
}
void
Dbg_syms_ar_checking(Lm_list *lml, const char *fname, const char *objname,
Elf_Arsym *arsym)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_AR_CHECK), fname, objname,
Dbg_demangle_name(arsym->as_name));
}
void
Dbg_syms_ar_resolve(Lm_list *lml, const char *fname, const char *objname,
Elf_Arsym *arsym)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_AR_RESOLVE), fname, objname,
Dbg_demangle_name(arsym->as_name));
}
void
Dbg_syms_ar_force(Lm_list *lml, const char *fname, const char *objname)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_AR_FORCE), fname, objname);
}
void
Dbg_syms_spec_title(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_SPECIAL));
}
void
Dbg_syms_discarded(Lm_list *lml, Sym_desc *sdp)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *file;
if (DBG_NOTCLASS(DBG_C_SYMBOLS | DBG_C_UNUSED))
return;
if (DBG_NOTDETAIL())
return;
if ((sdp->sd_file == NULL) || ((file = sdp->sd_file->ifl_name) == NULL))
file = MSG_INTL(MSG_STR_UNKNOWN);
if (sdp->sd_isc) {
dbg_print(lml, MSG_INTL(MSG_SYM_DISCARD_SEC),
Dbg_demangle_name(sdp->sd_name),
dbg_fmt_isec_name(sdp->sd_isc, buf, &alloc_mem), file);
if (alloc_mem != NULL)
free(alloc_mem);
} else
dbg_print(lml, MSG_INTL(MSG_SYM_DISCARD_FILE),
Dbg_demangle_name(sdp->sd_name), file);
}
void
Dbg_syms_dup_discarded(Lm_list *lml, Word ndx, Sym_desc *sdp)
{
const char *file;
if (DBG_NOTCLASS(DBG_C_SYMBOLS | DBG_C_UNUSED))
return;
if (DBG_NOTDETAIL())
return;
if ((sdp->sd_file == NULL) || ((file = sdp->sd_file->ifl_name) == NULL))
file = MSG_INTL(MSG_STR_UNKNOWN);
dbg_print(lml, MSG_INTL(MSG_SYM_DISCARD_DUP), EC_WORD(ndx),
Dbg_demangle_name(sdp->sd_name), file);
}
void
Dbg_syms_entered(Ofl_desc *ofl, Sym *sym, Sym_desc *sdp)
{
Conv_inv_buf_t inv_buf;
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_INTL(MSG_STR_ENTERED),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine, sym,
sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
void
Dbg_syms_process(Lm_list *lml, Ifl_desc *ifl)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_PROCESS), ifl->ifl_name,
conv_ehdr_type(ifl->ifl_ehdr->e_ident[EI_OSABI],
ifl->ifl_ehdr->e_type, 0, &inv_buf));
}
void
Dbg_syms_entry(Lm_list *lml, Word ndx, Sym_desc *sdp)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_BASIC), EC_WORD(ndx),
Dbg_demangle_name(sdp->sd_name));
}
void
Dbg_syms_global(Lm_list *lml, Word ndx, const char *name)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_ADDING), EC_WORD(ndx),
Dbg_demangle_name(name));
}
void
Dbg_syms_cap_convert(Ofl_desc *ofl, Word ndx, const char *name, Sym *sym)
{
if (DBG_NOTCLASS(DBG_C_CAP | DBG_C_SYMBOLS))
return;
dbg_print(ofl->ofl_lml, MSG_INTL(MSG_SYM_CAP_ORIG), EC_WORD(ndx),
Dbg_demangle_name(name));
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD,
MSG_INTL(MSG_STR_ORIGINAL), ofl->ofl_dehdr->e_ident[EI_OSABI],
ofl->ofl_dehdr->e_machine, sym, 0, 0, NULL,
MSG_ORIG(MSG_STR_EMPTY));
}
void
Dbg_syms_cap_local(Ofl_desc *ofl, Word ndx, const char *name, Sym *sym,
Sym_desc *sdp)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_CAP | DBG_C_SYMBOLS))
return;
dbg_print(ofl->ofl_lml, MSG_INTL(MSG_SYM_CAP_LOCAL), EC_WORD(ndx),
Dbg_demangle_name(name));
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD,
MSG_INTL(MSG_STR_ENTERED), ofl->ofl_dehdr->e_ident[EI_OSABI],
ofl->ofl_dehdr->e_machine, sym,
sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
void
Dbg_syms_wrap(Lm_list *lml, Word ndx, const char *orig_name, const char *name)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_WRAP), EC_WORD(ndx),
Dbg_demangle_name(orig_name), Dbg_demangle_name(name));
}
void
Dbg_syms_sec_title(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_INDEX));
}
void
Dbg_syms_sec_entry(Lm_list *lml, Word ndx, Sg_desc *sgp, Os_desc *osp)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_SYM_SECTION), EC_WORD(ndx), osp->os_name,
(*sgp->sg_name ? sgp->sg_name : MSG_INTL(MSG_STR_NULL)));
}
void
Dbg_syms_up_title(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_FINAL));
Elf_syms_table_title(lml, ELF_DBG_LD);
}
void
Dbg_syms_ignore(Ofl_desc *ofl, Sym_desc *sdp)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_INTL(MSG_STR_IGNORE),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine,
sdp->sd_sym, 0, 0, NULL, MSG_INTL(MSG_STR_UNUSED));
}
void
Dbg_syms_old(Ofl_desc *ofl, Sym_desc *sdp)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_INTL(MSG_STR_OLD),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine,
sdp->sd_sym, sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0,
0, NULL, sdp->sd_name);
}
void
Dbg_syms_new(Ofl_desc *ofl, Sym *sym, Sym_desc *sdp)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_INTL(MSG_STR_NEW),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine, sym,
sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
void
Dbg_syms_updated(Ofl_desc *ofl, Sym_desc *sdp, const char *name)
{
Conv_inv_buf_t inv_buf;
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_UPDATE), name);
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_ORIG(MSG_STR_EMPTY),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine,
sdp->sd_sym, sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
void
Dbg_syms_created(Lm_list *lml, const char *name)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_CREATE), Dbg_demangle_name(name));
}
void
Dbg_syms_resolving(Ofl_desc *ofl, Word ndx, const char *name, int row,
int col, Sym *osym, Sym *nsym, Sym_desc *sdp, Ifl_desc *ifl)
{
Lm_list *lml = ofl->ofl_lml;
uchar_t osabi = ofl->ofl_dehdr->e_ident[EI_OSABI];
Half mach = ofl->ofl_dehdr->e_machine;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
dbg_print(lml, MSG_INTL(MSG_SYM_RESOLVING), EC_WORD(ndx),
Dbg_demangle_name(name), row, col);
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_INTL(MSG_STR_OLD),
osabi, mach, osym, sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0,
0, NULL, sdp->sd_file->ifl_name);
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_INTL(MSG_STR_NEW),
osabi, mach, nsym, 0, 0, NULL, ifl->ifl_name);
}
void
Dbg_syms_resolved(Ofl_desc *ofl, Sym_desc *sdp)
{
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD,
MSG_INTL(MSG_STR_RESOLVED), ofl->ofl_dehdr->e_ident[EI_OSABI],
ofl->ofl_dehdr->e_machine, sdp->sd_sym,
sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
void
Dbg_syms_copy_reloc(Ofl_desc *ofl, Sym_desc *sdp, Word align)
{
static Boolean symbol_title = TRUE;
Conv_inv_buf_t inv_buf;
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (symbol_title) {
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_BSS));
symbol_title = FALSE;
}
/*
* Copy relocation symbols come in pairs, the original reference
* (within a dependency), and the new destination (within the .bss of
* the executable). The latter is accompanied with a computed
* alignment.
*/
if (align) {
dbg_print(lml, MSG_INTL(MSG_SYM_COPY_DST),
Dbg_demangle_name(sdp->sd_name), EC_WORD(align));
} else {
dbg_print(lml, MSG_INTL(MSG_SYM_COPY_REF),
Dbg_demangle_name(sdp->sd_name));
}
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_ORIG(MSG_SYM_COPY),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine,
sdp->sd_sym, sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
conv_def_tag(sdp->sd_ref, &inv_buf));
}
void
Dbg_syms_reduce(Ofl_desc *ofl, int which, Sym_desc *sdp, int idx,
const char *sname)
{
static Boolean sym_reduce_title = TRUE;
static Boolean sym_retain_title = TRUE;
Boolean isfromglobal = (which == DBG_SYM_REDUCE_GLOBAL);
Boolean isfromretain = (which == DBG_SYM_REDUCE_RETAIN);
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_SYMBOLS | DBG_C_VERSIONS))
return;
if (sym_reduce_title && isfromglobal) {
sym_reduce_title = FALSE;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_REDUCED));
} else if (sym_retain_title && isfromretain) {
sym_retain_title = FALSE;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_RETAINING));
}
if ((sdp->sd_flags & FLG_SY_ELIM) && isfromglobal)
dbg_print(lml, MSG_INTL(MSG_SYM_ELIMINATING),
Dbg_demangle_name(sdp->sd_name));
else if (isfromglobal)
dbg_print(lml, MSG_INTL(MSG_SYM_REDUCING),
Dbg_demangle_name(sdp->sd_name));
else
dbg_print(lml, MSG_INTL(MSG_SYM_NOTELIMINATE),
Dbg_demangle_name(sdp->sd_name), sname, idx);
if (DBG_NOTDETAIL())
return;
Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_ORIG(MSG_SYM_LOCAL),
ofl->ofl_dehdr->e_ident[EI_OSABI], ofl->ofl_dehdr->e_machine,
sdp->sd_sym, sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
sdp->sd_file->ifl_name);
}
void
Dbg_syms_dup_sort_addr(Lm_list *lml, const char *secname, const char *symname1,
const char *symname2, Addr addr)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS) || DBG_NOTDETAIL())
return;
dbg_print(lml, MSG_INTL(MSG_SYM_DUPSORTADDR), secname,
symname1, symname2, EC_ADDR(addr));
}
void
Dbg_syminfo_title(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYMINFO_INFO));
Elf_syminfo_title(lml);
}
void
Dbg_syminfo_entry(Lm_list *lml, Word ndx, Syminfo *sip, Sym *sym,
const char *strtab, Dyn *dyn)
{
const char *needed;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
if (sip->si_boundto < SYMINFO_BT_LOWRESERVE)
needed = strtab + dyn[sip->si_boundto].d_un.d_val;
else
needed = 0;
Elf_syminfo_entry(lml, ndx, sip,
Dbg_demangle_name(strtab + sym->st_name), needed);
}
/*
* Symbol table output can differ slightly depending on the caller. However,
* the final diagnostic is maintained here so hat the various message strings
* remain consistent
*
* elfdump: index value size type bind oth ver shndx name
* ld: value size type bind oth ver shndx
*/
void
Elf_syms_table_title(Lm_list *lml, int caller)
{
if (caller == ELF_DBG_ELFDUMP) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_SYM_EFS_TITLE));
else
dbg_print(lml, MSG_INTL(MSG_SYM_EFL_TITLE));
return;
}
if (caller == ELF_DBG_LD) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_SYM_LDS_TITLE));
else
dbg_print(lml, MSG_INTL(MSG_SYM_LDL_TITLE));
return;
}
}
void
Elf_syms_table_entry(Lm_list *lml, int caller, const char *prestr,
uchar_t osabi, Half mach, Sym *sym, Versym verndx, int gnuver,
const char *sec, const char *poststr)
{
Conv_inv_buf_t inv_buf1, inv_buf2, inv_buf3;
Conv_inv_buf_t inv_buf4, inv_buf5, inv_buf6;
uchar_t type = ELF_ST_TYPE(sym->st_info);
uchar_t bind = ELF_ST_BIND(sym->st_info);
const char *msg;
if ((caller == ELF_DBG_ELFDUMP) ||
(caller == ELF_DBG_LD)) {
if (DBG_NOTLONG())
msg = MSG_INTL(MSG_SYM_EFS_ENTRY);
else
msg = MSG_INTL(MSG_SYM_EFL_ENTRY);
if (sec == NULL)
sec = conv_sym_shndx(osabi, mach, sym->st_shndx,
CONV_FMT_DECIMAL, &inv_buf6);
dbg_print(lml, msg, prestr,
conv_sym_value(mach, type, sym->st_value, &inv_buf1),
sym->st_size, conv_sym_info_type(mach, type, 0, &inv_buf2),
conv_sym_info_bind(bind, 0, &inv_buf3),
conv_sym_other(sym->st_other, &inv_buf4),
conv_ver_index(verndx, gnuver, &inv_buf5),
sec, Elf_demangle_name(poststr));
}
}
void
Dbg_syms_cap_title(Ofl_desc *ofl)
{
Lm_list *lml = ofl->ofl_lml;
if (DBG_NOTCLASS(DBG_C_SYMBOLS))
return;
if (DBG_NOTDETAIL())
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_CAPABILITIES));
Elf_syms_table_title(lml, ELF_DBG_LD);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <link.h>
#include <libc_int.h>
#include <rtld.h>
#include <strings.h>
#include <debug.h>
#include "msg.h"
#include "_debug.h"
#define FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
MSG_TLS_FLAG_STATIC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
static void
Dbg_tls_modent(Lm_list *lml, TLS_modinfo * tmodent)
{
/*
* MSG_ORIG(MSG_TLS_FLAG_STATIC)
*/
static char flagstr[FLAGSZ];
static Val_desc vda[] = {
{ TM_FLG_STATICTLS, MSG_TLS_FLAG_STATIC },
{ 0, 0 }
};
static CONV_EXPN_FIELD_ARG conv_arg = { flagstr, sizeof (flagstr) };
ulong_t flags;
if ((flags = tmodent->tm_flags) != 0) {
conv_arg.oflags = conv_arg.rflags = flags;
(void) conv_expn_field(&conv_arg, vda, 0);
} else {
flagstr[0] = '\0';
}
dbg_print(lml, MSG_INTL(MSG_TLS_MODENT1),
EC_XWORD((uintptr_t)tmodent->tm_tlsblock),
EC_XWORD(tmodent->tm_stattlsoffset), EC_XWORD(tmodent->tm_flags),
flagstr);
dbg_print(lml, MSG_INTL(MSG_TLS_MODENT2),
EC_XWORD(tmodent->tm_filesz), EC_XWORD(tmodent->tm_memsz),
EC_XWORD(tmodent->tm_modid));
}
void
Dbg_tls_static_block(Lm_list *lml, void *list, ulong_t size, ulong_t resv)
{
if (DBG_NOTCLASS(DBG_C_TLS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
if (list) {
ulong_t ndx;
TLS_modinfo **tlsmodlist;
tlsmodlist = (TLS_modinfo **)list;
for (ndx = 0; tlsmodlist[ndx]; ndx++) {
dbg_print(lml, MSG_INTL(MSG_TLS_STATBLOCK1), ndx,
tlsmodlist[ndx]->tm_modname);
Dbg_tls_modent(lml, tlsmodlist[ndx]);
Dbg_util_nl(lml, DBG_NL_STD);
}
}
dbg_print(lml, MSG_INTL(MSG_TLS_STATBLOCK2), EC_XWORD(size),
EC_XWORD(resv));
}
void
Dbg_tls_static_resv(Rt_map *lmp, ulong_t size, ulong_t resv)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_TLS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_TLS_STATBLOCK3), TLSMODID(lmp), NAME(lmp),
EC_XWORD(size), EC_XWORD(resv));
}
void
Dbg_tls_modactivity(Lm_list *lml, void *vtlsmodent, uint_t flag)
{
const char *str;
TLS_modinfo *tlsmodent;
if (DBG_NOTCLASS(DBG_C_TLS))
return;
if (flag == TM_FLG_MODADD)
str = MSG_INTL(MSG_TLS_ADD);
else
str = MSG_INTL(MSG_TLS_REMOVE);
tlsmodent = (TLS_modinfo *)vtlsmodent;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_TLS_MODACT), str, tlsmodent->tm_modname);
Dbg_tls_modent(lml, tlsmodent);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "msg.h"
#include "_debug.h"
#include "libld.h"
void
Dbg_unused_unref(Rt_map *lmp, const char *depend)
{
if (DBG_NOTCLASS(DBG_C_UNUSED))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(LIST(lmp), MSG_INTL(MSG_USD_UNREF), NAME(lmp), depend);
}
void
Dbg_unused_sec(Lm_list *lml, Is_desc *isp)
{
dbg_isec_name_buf_t buf;
char *alloc_mem;
const char *str;
if (DBG_NOTCLASS(DBG_C_UNUSED))
return;
if (DBG_NOTDETAIL())
return;
/*
* If the file from which this section originates hasn't been referenced
* at all, skip this diagnostic, as it would have been covered under
* Dbg_unused_file() called from ignore_section_processing().
*/
if (isp->is_file &&
((isp->is_file->ifl_flags & FLG_IF_FILEREF) == 0))
return;
if (isp->is_flags & FLG_IS_DISCARD)
str = MSG_INTL(MSG_USD_SECDISCARD);
else
str = MSG_ORIG(MSG_STR_EMPTY);
dbg_print(lml, MSG_INTL(MSG_USD_SEC),
dbg_fmt_isec_name(isp, buf, &alloc_mem),
EC_XWORD(isp->is_shdr->sh_size), isp->is_file->ifl_name, str);
if (alloc_mem != NULL)
free(alloc_mem);
}
void
Dbg_unused_file(Lm_list *lml, const char *name, int needstr, uint_t cycle)
{
if (DBG_NOTCLASS(DBG_C_UNUSED))
return;
if (needstr)
dbg_print(lml, MSG_INTL(MSG_USD_NEEDSTR), name);
else if (cycle)
dbg_print(lml, MSG_INTL(MSG_USD_FILECYCLIC), name, cycle);
else
dbg_print(lml, MSG_INTL(MSG_USD_FILE), name);
}
void
Dbg_unused_path(Lm_list *lml, const char *path, uint_t orig, uint_t dup,
const char *obj)
{
const char *fmt;
if (DBG_NOTCLASS(DBG_C_UNUSED))
return;
if (DBG_NOTDETAIL())
return;
if (orig & LA_SER_LIBPATH) {
if (orig & LA_SER_CONFIG) {
if (dup)
fmt = MSG_INTL(MSG_DUP_LDLIBPATHC);
else
fmt = MSG_INTL(MSG_USD_LDLIBPATHC);
} else {
if (dup)
fmt = MSG_INTL(MSG_DUP_LDLIBPATH);
else
fmt = MSG_INTL(MSG_USD_LDLIBPATH);
}
} else if (orig & LA_SER_RUNPATH) {
fmt = MSG_INTL(MSG_USD_RUNPATH);
} else
return;
dbg_print(lml, fmt, path, obj);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2018 Jason King
*/
#include "msg.h"
#include "_debug.h"
#include "libld.h"
/*
* If any run-time linker debugging is being carried out always indicate the
* fact and specify the point at which we transfer control to the main program.
*/
void
Dbg_util_call_main(Rt_map *lmp)
{
Lm_list *lml = LIST(lmp);
Dbg_util_nl(lml, DBG_NL_FRC);
dbg_print(lml, MSG_INTL(MSG_UTL_TRANS), NAME(lmp));
Dbg_util_nl(lml, DBG_NL_FRC);
}
void
Dbg_util_call_init(Rt_map *lmp, int flag)
{
Lm_list *lml = LIST(lmp);
const char *str;
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (flag == DBG_INIT_SORT)
str = MSG_INTL(MSG_UTL_SORT);
else if (flag == DBG_INIT_PEND)
str = MSG_INTL(MSG_UTL_PEND);
else if (flag == DBG_INIT_DYN)
str = MSG_INTL(MSG_UTL_DYN);
else
str = MSG_INTL(MSG_UTL_DONE);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_UTL_INIT), str, NAME(lmp));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_util_intoolate(Rt_map *lmp)
{
Lm_list *lml = LIST(lmp);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_UTL_INTOOLATE), NAME(lmp));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_util_dbnotify(Lm_list *lml, rd_event_e event, r_state_e state)
{
const char *estr;
const char *sstr;
if (DBG_NOTCLASS(DBG_C_FILES))
return;
if (DBG_NOTDETAIL())
return;
switch (event) {
case RD_PREINIT:
estr = MSG_ORIG(MSG_UTL_EVNT_PREINIT);
sstr = MSG_INTL(MSG_STR_NULL);
break;
case RD_POSTINIT:
estr = MSG_ORIG(MSG_UTL_EVNT_POSTINIT);
sstr = MSG_INTL(MSG_STR_NULL);
break;
case RD_DLACTIVITY:
estr = MSG_ORIG(MSG_UTL_EVNT_DLACT);
switch (state) {
case RT_CONSISTENT:
sstr = MSG_ORIG(MSG_UTL_STA_CONSIST);
break;
case RT_ADD:
sstr = MSG_ORIG(MSG_UTL_STA_ADD);
break;
case RT_DELETE:
sstr = MSG_ORIG(MSG_UTL_STA_DELETE);
break;
default:
sstr = MSG_INTL(MSG_STR_NULL);
break;
}
break;
default:
sstr = MSG_INTL(MSG_STR_NULL);
estr = MSG_INTL(MSG_STR_UNKNOWN);
break;
}
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_UTL_DBNOTIFY), estr, sstr);
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_util_call_array(Rt_map *lmp, void *addr, int ndx, Word shtype)
{
Lm_list *lml = LIST(lmp);
const char *str;
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (shtype == SHT_INIT_ARRAY)
str = MSG_ORIG(MSG_SCN_INITARRAY);
else if (shtype == SHT_FINI_ARRAY)
str = MSG_ORIG(MSG_SCN_FINIARRAY);
else
str = MSG_ORIG(MSG_SCN_PREINITARRAY);
dbg_print(lml, MSG_INTL(MSG_UTL_ARRAY), str, ndx, EC_NATPTR(addr),
NAME(lmp));
}
void
Dbg_util_call_fini(Rt_map *lmp)
{
Lm_list *lml = LIST(lmp);
if (DBG_NOTCLASS(DBG_C_INIT))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_UTL_FINI), NAME(lmp));
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_util_str(Lm_list *lml, const char *str)
{
Dbg_util_nl(lml, DBG_NL_STD);
Dbg_util_nl(lml, DBG_NL_FRC);
dbg_print(lml, MSG_ORIG(MSG_FMT_STR), str);
Dbg_util_nl(lml, DBG_NL_FRC);
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_util_scc_title(Lm_list *lml, int sec)
{
const char *_sec;
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
if (sec)
_sec = MSG_INTL(MSG_UTL_SCC_SUBI);
else
_sec = MSG_INTL(MSG_UTL_SCC_SUBF);
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_UTL_SCC_TITLE), _sec);
}
void
Dbg_util_scc_entry(Rt_map *lmp, uint_t idx)
{
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(LIST(lmp), MSG_ORIG(MSG_UTL_SCC_ENTRY), idx, NAME(lmp));
}
static int ectoggle = 0;
void
Dbg_util_edge_in(Lm_list *lml, Rt_map *clmp, uint_t flags, Rt_map *dlmp,
int ndx, int flag)
{
Conv_bnd_type_buf_t bnd_type_buf;
const char *str;
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
if (flag & RT_SORT_REV)
str = MSG_ORIG(MSG_SCN_INIT);
else
str = MSG_ORIG(MSG_SCN_FINI);
if ((clmp == 0) || (ectoggle == 0))
Dbg_util_nl(lml, DBG_NL_STD);
if (clmp == 0) {
if (flag & RT_SORT_INTPOSE)
dbg_print(lml, MSG_INTL(MSG_UTL_EDGE_TITLE_I), str);
else
dbg_print(lml, MSG_INTL(MSG_UTL_EDGE_TITLE_S), str);
dbg_print(lml, MSG_INTL(MSG_UTL_EDGE_START), ndx, NAME(dlmp));
} else
dbg_print(lml, MSG_INTL(MSG_UTL_EDGE_IN), ndx, NAME(dlmp),
NAME(clmp), conv_bnd_type(flags, &bnd_type_buf));
ectoggle = 1;
}
void
Dbg_util_edge_out(Rt_map *clmp, Rt_map *dlmp)
{
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
dbg_print(LIST(clmp), MSG_INTL(MSG_UTL_EDGE_OUT), SORTVAL(clmp),
NAME(clmp), NAME(dlmp));
}
void
Dbg_util_collect(Rt_map *lmp, int ndx, int flag)
{
Lm_list *lml = LIST(lmp);
const char *str;
if (DBG_NOTCLASS(DBG_C_INIT))
return;
if (DBG_NOTDETAIL())
return;
if (flag & RT_SORT_REV)
str = MSG_ORIG(MSG_SCN_INIT);
else
str = MSG_ORIG(MSG_SCN_FINI);
if (ectoggle == 1) {
Dbg_util_nl(lml, DBG_NL_STD);
ectoggle = 0;
}
dbg_print(lml, MSG_INTL(MSG_UTL_COLLECT), ndx, NAME(lmp), str);
}
static const Msg tags[] = {
MSG_CI_NULL, /* MSG_ORIG(MSG_CI_NULL) */
MSG_CI_VERSION, /* MSG_ORIG(MSG_CI_VERSION) */
MSG_CI_ATEXIT, /* MSG_ORIG(MSG_CI_ATEXIT) */
MSG_CI_LCMESSAGES, /* MSG_ORIG(MSG_CI_LCMESSAGES) */
MSG_CI_BIND_GUARD, /* MSG_ORIG(MSG_CI_BIND_GUARD) */
MSG_CI_BIND_CLEAR, /* MSG_ORIG(MSG_CI_BIND_CLEAR) */
MSG_CI_THR_SELF, /* MSG_ORIG(MSG_CI_THR_SELF) */
MSG_CI_TLS_MODADD, /* MSG_ORIG(MSG_CI_TLS_MODADD) */
MSG_CI_TLS_MODREM, /* MSG_ORIG(MSG_CI_TLS_MODREM) */
MSG_CI_TLS_STATMOD, /* MSG_ORIG(MSG_CI_TLS_STATMOD) */
MSG_CI_THRINIT, /* MSG_ORIG(MSG_CI_THRINIT) */
MSG_CI_CRITICAL /* MSG_ORIG(MSG_CI_CRITICAL) */
};
void
Dbg_util_lcinterface(Rt_map *lmp, int tag, char *val)
{
const char *str;
Conv_inv_buf_t inv_buf;
if (DBG_NOTDETAIL())
return;
if (tag < CI_MAX)
str = MSG_ORIG(tags[tag]);
else
str = conv_invalid_val(&inv_buf, tag, 0);
dbg_print(LIST(lmp), MSG_INTL(MSG_UTL_LCINTERFACE), NAME(lmp), str,
EC_NATPTR(val));
}
void
Dbg_unused_lcinterface(Rt_map *nlmp, Rt_map *olmp, int tag)
{
const char *str;
Conv_inv_buf_t inv_buf;
if (DBG_NOTCLASS(DBG_C_UNUSED))
return;
if (tag < CI_MAX)
str = MSG_ORIG(tags[tag]);
else
str = conv_invalid_val(&inv_buf, tag, 0);
dbg_print(LIST(nlmp), MSG_INTL(MSG_USD_LCINTERFACE), NAME(nlmp), str,
NAME(olmp));
}
/*
* Generic new line generator. To prevent multiple newlines from being
* generated, a flag is maintained in the global debug descriptor. This flag
* is cleared by the callers dbg_print() function to indicate that a newline
* (actually, any line) has been printed. Multiple newlines can be generated
* using the DBG_NL_FRC flag.
*/
void
Dbg_util_nl(Lm_list *lml, int flag)
{
if ((flag == DBG_NL_STD) && (dbg_desc->d_extra & DBG_E_STDNL))
return;
dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
if (flag == DBG_NL_STD)
dbg_desc->d_extra |= DBG_E_STDNL;
}
/*
* Define name demanglers.
*/
const char *
Dbg_demangle_name(const char *name)
{
static char *buf = NULL;
if (DBG_NOTCLASS(DBG_C_DEMANGLE))
return (name);
free(buf);
buf = (char *)conv_demangle_name(name);
if (buf == name) {
buf = NULL;
return (name);
}
return (buf);
}
const char *
Elf_demangle_name(const char *name)
{
static char *buf = NULL;
if (!DBG_ISDEMANGLE())
return (name);
free(buf);
buf = (char *)conv_demangle_name(name);
if (buf == name) {
buf = NULL;
return (name);
}
return (buf);
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <debug.h>
#include "msg.h"
#include "_debug.h"
void
Dbg_ver_avail_title(Lm_list *lml, const char *file)
{
if (DBG_NOTCLASS(DBG_C_VERSIONS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_VER_AVAIL_1), file);
dbg_print(lml, MSG_INTL(MSG_VER_AVAIL_2));
}
void
Dbg_ver_def_title(Lm_list *lml, const char *file)
{
if (DBG_NOTCLASS(DBG_C_VERSIONS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_VER_DEF_TITLE), file);
Elf_ver_def_title(lml);
}
void
Dbg_ver_need_title(Lm_list *lml, const char *file)
{
if (DBG_NOTCLASS(DBG_C_VERSIONS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_VER_NEED_TITLE), file);
Elf_ver_need_title(lml, 0);
}
void
Dbg_ver_need_entry(Lm_list *lml, Half cnt, const char *file,
const char *version)
{
if (DBG_NOTCLASS(DBG_C_VERSIONS))
return;
if (cnt)
Elf_ver_line_4(lml, version);
else
Elf_ver_line_5(lml, file, version);
}
void
Dbg_ver_symbol(Lm_list *lml, const char *name)
{
static Boolean ver_symbol_title = TRUE;
if (DBG_NOTCLASS(DBG_C_VERSIONS | DBG_C_SYMBOLS))
return;
if (DBG_NOTCLASS(DBG_C_VERSIONS))
if (ver_symbol_title) {
ver_symbol_title = FALSE;
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_SYM_VERSION));
}
Dbg_syms_created(lml, name);
}
/*
* This function doesn't test for any specific debugging category, thus it will
* be generated for any debugging family.
*/
void
Dbg_ver_nointerface(Lm_list *lml, const char *name)
{
Dbg_util_nl(lml, DBG_NL_STD);
dbg_print(lml, MSG_INTL(MSG_VER_NOINTERFACE), name);
Dbg_util_nl(lml, DBG_NL_STD);
}
void
Dbg_ver_desc_entry(Lm_list *lml, Ver_desc *vdp)
{
Conv_ver_flags_buf_t ver_flags_buf;
const char *dep;
Ver_desc *_vdp, *__vdp;
Aliste idx;
char index[10];
if (DBG_NOTCLASS(DBG_C_VERSIONS))
return;
if (vdp->vd_deps) {
_vdp = (Ver_desc *)vdp->vd_deps->apl_data[0];
dep = _vdp->vd_name;
} else {
_vdp = 0;
dep = MSG_ORIG(MSG_STR_EMPTY);
}
(void) sprintf(index, MSG_ORIG(MSG_FMT_INDEX), vdp->vd_ndx);
Elf_ver_line_1(lml, index, vdp->vd_name, dep,
conv_ver_flags(vdp->vd_flags, 0, &ver_flags_buf));
/*
* Loop through the dependency list in case there are more that one
* dependency.
*/
for (APLIST_TRAVERSE(vdp->vd_deps, idx, __vdp)) {
if (_vdp == __vdp)
continue;
Elf_ver_line_4(lml, __vdp->vd_name);
}
}
void
Dbg_ver_avail_entry(Lm_list *lml, Ver_index *vip, const char *select)
{
if (DBG_NOTCLASS(DBG_C_VERSIONS))
return;
if (select) {
if (DBG_NOTLONG())
dbg_print(lml, MSG_ORIG(MSG_VER_SELECTED),
vip->vi_name, select);
else
dbg_print(lml, MSG_ORIG(MSG_VER_L_SELECTED),
vip->vi_name, select);
} else {
if (DBG_NOTLONG())
dbg_print(lml, MSG_ORIG(MSG_VER_ALL), vip->vi_name);
else
dbg_print(lml, MSG_ORIG(MSG_VER_L_ALL), vip->vi_name);
}
}
void
Elf_ver_def_title(Lm_list *lml)
{
dbg_print(lml, MSG_INTL(MSG_VER_DEF));
}
/*
* entry:
* gnuver - If True (non-zero), the version rules used by the
* GNU ld are assumed. If False (0), Solaris ld rules apply.
*/
void
Elf_ver_need_title(Lm_list *lml, int gnuver)
{
if (gnuver)
dbg_print(lml, MSG_INTL(MSG_VER_NEED_GNUVER));
else
dbg_print(lml, MSG_INTL(MSG_VER_NEED));
}
void
Elf_ver_line_1(Lm_list *lml, const char *index, const char *name,
const char *dep, const char *flags)
{
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_VER_LINE_1), index, name,
dep, flags);
else
dbg_print(lml, MSG_INTL(MSG_VER_LLINE_1), index, name,
dep, flags);
}
void
Elf_ver_line_2(Lm_list *lml, const char *name, const char *dep)
{
dbg_print(lml, MSG_INTL(MSG_VER_LINE_2), name, dep);
}
void
Elf_ver_line_3(Lm_list *lml, const char *name, const char *dep,
const char *flags)
{
dbg_print(lml, MSG_INTL(MSG_VER_LINE_3), name, dep, flags);
}
void
Elf_ver_line_4(Lm_list *lml, const char *version)
{
dbg_print(lml, MSG_INTL(MSG_VER_LINE_4), version);
}
void
Elf_ver_line_5(Lm_list *lml, const char *file, const char *version)
{
if (DBG_NOTLONG())
dbg_print(lml, MSG_INTL(MSG_VER_LINE_5), file, version);
else
dbg_print(lml, MSG_INTL(MSG_VER_LLINE_5), file, version);
}
/*
* Called after final call to Dbg_ver_need() to inject final newline.
*/
void
Dbg_ver_need_done(Lm_list *lml)
{
if (DBG_NOTCLASS(DBG_C_VERSIONS))
return;
Dbg_util_nl(lml, DBG_NL_STD);
}
|