Commit 79fd58d
committed
[AArch64][GCS][LLD] Introduce -z gcs-report-dynamic option
When GCS was introduced to LLD, the gcs-report option allowed
for a user to gain information relating to if their relocatable objects
supported the feature. For an executable or shared-library to support
GCS, all relocatable objects must declare that they support GCS.
The gcs-report checks were only done on relocatable object files,
however for a program to enable GCS, the executable and all
shared libraries that it loads must enable GCS.
gcs-report-dynamic enables checks to be performed on all shared
objects loaded by LLD, and in cases where GCS is not supported,
a warning or error will be emitted.
It should be noted that only shared files directly passed to LLD
are checked for GCS support. Files that are noted in the `DT_NEEDED`
tags are assumed to have had their GCS support checked when they
were created.
The behaviour of the -zgcs-dynamic-report option matches that of
GNU ld. The behaviour is as follows unless the user explicitly
sets the value:
* -zgcs-report=warning or -zgcs-report=error implies
-zgcs-report-dynamic=warning.
This approach avoids inheriting an error level if the
user wishes to continue building a module without rebuilding all
the shared libraries. The same approach was taken for the GNU ld
linker, so behaviour is identical across the toolchains.
This implementation matches the error message and command
line interface used within the GNU ld Linker. See here:
https://inbox.sourceware.org/binutils/[email protected]/
To enable the checking of the GNU GCS Attributes when linking together
an application, LLD needs to be able to parse a Shared Files program
headers. This will enable a new option, allowing the user to output
diagnostic information relating to if there are shared files being
used that do not support the GCS extension.
To define if a shared file support GCS, the GNU GCS Attribute will
be stored within the Program Header, so this is parsed and, if
found, the `andFeatures` value updated to reflect the support level.1 parent 84b665c commit 79fd58d
File tree
6 files changed
+186
-60
lines changed- lld
- ELF
- docs
- test/ELF
6 files changed
+186
-60
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
749 | 750 | | |
750 | 751 | | |
751 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
752 | 765 | | |
753 | 766 | | |
754 | 767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
| |||
574 | 576 | | |
575 | 577 | | |
576 | 578 | | |
577 | | - | |
578 | | - | |
| 579 | + | |
| 580 | + | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
582 | | - | |
| 584 | + | |
583 | 585 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
592 | 597 | | |
593 | 598 | | |
594 | 599 | | |
595 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
596 | 608 | | |
597 | 609 | | |
598 | 610 | | |
| |||
1569 | 1581 | | |
1570 | 1582 | | |
1571 | 1583 | | |
1572 | | - | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
1573 | 1588 | | |
1574 | 1589 | | |
1575 | 1590 | | |
| |||
1642 | 1657 | | |
1643 | 1658 | | |
1644 | 1659 | | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
1648 | | - | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
1649 | 1665 | | |
1650 | 1666 | | |
1651 | 1667 | | |
| |||
2927 | 2943 | | |
2928 | 2944 | | |
2929 | 2945 | | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
2930 | 2962 | | |
2931 | 2963 | | |
2932 | 2964 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 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 | + | |
921 | 975 | | |
922 | 976 | | |
923 | 977 | | |
| |||
955 | 1009 | | |
956 | 1010 | | |
957 | 1011 | | |
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 | | - | |
| 1012 | + | |
| 1013 | + | |
994 | 1014 | | |
995 | 1015 | | |
996 | 1016 | | |
| |||
1418 | 1438 | | |
1419 | 1439 | | |
1420 | 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 | + | |
1421 | 1472 | | |
1422 | 1473 | | |
1423 | 1474 | | |
| |||
1454 | 1505 | | |
1455 | 1506 | | |
1456 | 1507 | | |
| 1508 | + | |
1457 | 1509 | | |
1458 | 1510 | | |
1459 | 1511 | | |
1460 | 1512 | | |
| 1513 | + | |
1461 | 1514 | | |
1462 | 1515 | | |
1463 | 1516 | | |
| |||
1528 | 1581 | | |
1529 | 1582 | | |
1530 | 1583 | | |
| 1584 | + | |
1531 | 1585 | | |
1532 | 1586 | | |
1533 | 1587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
56 | 73 | | |
57 | 74 | | |
58 | | - | |
| 75 | + | |
59 | 76 | | |
60 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
61 | 80 | | |
62 | 81 | | |
63 | 82 | | |
| |||
0 commit comments