GNU Binutils with patches for OS216
修訂 | 97a232d7335f3bd0231fd9cd39455bde1d563922 (tree) |
---|---|
時間 | 2018-01-12 17:15:55 |
作者 | Nick Clifton <nickc@redh...> |
Commiter | Nick Clifton |
Add -z undefs option to the ELF linker.
* emultempl/elf32.em (_handle_option): Add support for "-z undefs"
as the opposite of "-z defs".
* ld.texinfo: Document the new option. Update the description of
the -z defs option to make it clear that it does generate an error
if an undefined symbol reference is found in an object file whilst
creating a shared library.
* NEWS: Document this new feature.
@@ -1,3 +1,13 @@ | ||
1 | +2018-01-12 Nick Clifton <nickc@redhat.com> | |
2 | + | |
3 | + * emultempl/elf32.em (_handle_option): Add support for "-z undefs" | |
4 | + as the opposite of "-z defs". | |
5 | + * ld.texinfo: Document the new option. Update the description of | |
6 | + the -z defs option to make it clear that it does generate an error | |
7 | + if an undefined symbol reference is found in an object file whilst | |
8 | + creating a shared library. | |
9 | + * NEWS: Document this new feature. | |
10 | + | |
1 | 11 | 2018-01-11 H.J. Lu <hongjiu.lu@intel.com> |
2 | 12 | |
3 | 13 | * testsuite/ld-elf/pr22393-2a.rd: Replace "-z textonly" with |
@@ -1,6 +1,9 @@ | ||
1 | 1 | -*- text -*- |
2 | + | |
2 | 3 | * Add -z separate-code to generate separate code PT_LOAD segment. |
3 | 4 | |
5 | +* Add "-z undefs" command line option as the inverse of the "-z defs" option. | |
6 | + | |
4 | 7 | * Add -z globalaudit command line option to force audit libraries to be run |
5 | 8 | for every dynamic object loaded by an executable - provided that the loader |
6 | 9 | supports this functionality. |
@@ -2726,6 +2726,8 @@ fragment <<EOF | ||
2726 | 2726 | case 'z': |
2727 | 2727 | if (strcmp (optarg, "defs") == 0) |
2728 | 2728 | link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR; |
2729 | + else if (strcmp (optarg, "undefs") == 0) | |
2730 | + link_info.unresolved_syms_in_objects = RM_IGNORE; | |
2729 | 2731 | else if (strcmp (optarg, "muldefs") == 0) |
2730 | 2732 | link_info.allow_multiple_definition = TRUE; |
2731 | 2733 | else if (CONST_STRNEQ (optarg, "max-page-size=")) |
@@ -1147,8 +1147,9 @@ layout will be optimized to minimize memory pages if the system is | ||
1147 | 1147 | using pages of this size. |
1148 | 1148 | |
1149 | 1149 | @item defs |
1150 | -Disallows undefined symbols in object files. Undefined symbols in | |
1151 | -shared libraries are still allowed. | |
1150 | +Report unresolved symbol references from regular object files. This | |
1151 | +is done even if the linker is creating a non-symbolic shared library. | |
1152 | +This option is the inverse of @samp{-z undefs}. | |
1152 | 1153 | |
1153 | 1154 | @item dynamic-undefined-weak |
1154 | 1155 | @itemx nodynamic-undefined-weak |
@@ -1288,6 +1289,11 @@ Report an error if DT_TEXTREL is set, i.e., if the binary has dynamic | ||
1288 | 1289 | relocations in read-only sections. Don't report an error if |
1289 | 1290 | @samp{notext} or @samp{textoff}. |
1290 | 1291 | |
1292 | +@item undefs | |
1293 | +Do not report unresolved symbol references from regular object files, | |
1294 | +either when creating an executable, or when creating a shared library. | |
1295 | +This option is the inverse of @samp{-z defs}. | |
1296 | + | |
1291 | 1297 | @end table |
1292 | 1298 | |
1293 | 1299 | Other keywords are ignored for Solaris compatibility. |
@@ -1693,6 +1699,7 @@ while linking a large executable. | ||
1693 | 1699 | |
1694 | 1700 | @kindex --no-undefined |
1695 | 1701 | @kindex -z defs |
1702 | +@kindex -z undefs | |
1696 | 1703 | @item --no-undefined |
1697 | 1704 | @itemx -z defs |
1698 | 1705 | Report unresolved symbol references from regular object files. This |
@@ -1701,6 +1708,8 @@ The switch @option{--[no-]allow-shlib-undefined} controls the | ||
1701 | 1708 | behaviour for reporting unresolved references found in shared |
1702 | 1709 | libraries being linked in. |
1703 | 1710 | |
1711 | +The effects of this option can be reverted by using @code{-z undefs}. | |
1712 | + | |
1704 | 1713 | @kindex --allow-multiple-definition |
1705 | 1714 | @kindex -z muldefs |
1706 | 1715 | @item --allow-multiple-definition |