aboutsummaryrefslogtreecommitdiff
path: root/ld/ld.texi
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-06-05 23:18:06 +0100
committerNick Alcock <nick.alcock@oracle.com>2020-07-22 18:03:57 +0100
commit5dba6f05b7ba3d0e1c99da54592815564c782b39 (patch)
tree61183e2ed21e7b52a7f8540a844f2208cb6e28b9 /ld/ld.texi
parentf320bba50ff0aab7ce342ab9e3d25f49fc45d468 (diff)
downloadbinutils-5dba6f05b7ba3d0e1c99da54592815564c782b39.zip
binutils-5dba6f05b7ba3d0e1c99da54592815564c782b39.tar.gz
binutils-5dba6f05b7ba3d0e1c99da54592815564c782b39.tar.bz2
ld: new options --ctf-variables and --ctf-share-types
libctf recently changed to make it possible to not emit the CTF variables section. Make this the default for ld: the variables section is a simple name -> type mapping, and the names can be quite voluminous. Nothing in the variables section appears in the symbol table, by definition, so GDB cannot make use of them: special-purpose projects that implement their own analogues of symbol table lookup can do so, but they'll need to tell the linker to emit the variables section after all. The new --ctf-variables option does this. The --ctf-share-types option (valid values "share-duplicated" and "share-unconflicted") allow the caller to specify the CTF link mode. Most users will want share-duplicated, since it allows for more convenient debugging: but very large projects composed of many decoupled components may want to use share-unconflicted mode, which places types that appear in only one TU into per-TU dicts. (They may also want to relink the CTF using the ctf_link API and cu-mapping, to make their "components" larger than a single TU. Right now the linker does not expose the CU-mapping machinery. Perhaps it should in future to make this use case easier.) For now, giving the linker the ability to emit share-duplicated CTF lets us add testcases for that mode to the testsuite. ld/ * ldlex.h (option_values) <OPTION_CTF_VARIABLES, OPTION_NO_CTF_VARIABLES, OPTION_CTF_SHARE_TYPES>: New. * ld.h (ld_config_type) <ctf_variables, ctf_share_duplicated>: New fields. * ldlang.c (lang_merge_ctf): Use them. * lexsup.c (ld_options): Add ctf-variables, no-ctf-variables, ctf-share-types. (parse_args) <OPTION_CTF_VARIABLES, OPTION_NO_CTF_VARIABLES, OPTION_CTF_SHARE_TYPES>: New cases. * ld.texi: Document new options. * NEWS: Likewise.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r--ld/ld.texi34
1 files changed, 34 insertions, 0 deletions
diff --git a/ld/ld.texi b/ld/ld.texi
index 2a93e94..b9b331b 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -1612,6 +1612,40 @@ definition. If the symbol is defined as a common value then any files
where this happens appear next. Finally any files that reference the
symbol are listed.
+@cindex ctf variables
+@kindex --ctf-variables
+@kindex --no-ctf-variables
+@item --ctf-variables
+@item --no-ctf-variables
+The CTF debuginfo format supports a section which encodes the names and
+types of variables found in the program which do not appear in any symbol
+table. These variables clearly cannot be looked up by address by
+conventional debuggers, so the space used for their types and names is
+usually wasted: the types are usually small but the names are often not.
+@option{--ctf-variables} causes the generation of such a section.
+The default behaviour can be restored with @option{--no-ctf-variables}.
+
+@cindex ctf type sharing
+@kindex --ctf-share-types
+@item --ctf-share-types=@var{method}
+Adjust the method used to share types between translation units in CTF.
+
+@table @samp
+@item share-unconflicted
+Put all types that do not have ambiguous definitions into the shared dictionary,
+where debuggers can easily access them, even if they only occur in one
+translation unit. This is the default.
+
+@item share-duplicated
+Put only types that occur in multiple translation units into the shared
+dictionary: types with only one definition go into per-translation-unit
+dictionaries. Types with ambiguous definitions in multiple translation units
+always go into per-translation-unit dictionaries. This tends to make the CTF
+larger, but may reduce the amount of CTF in the shared dictionary. For very
+large projects this may speed up opening the CTF and save memory in the CTF
+consumer at runtime.
+@end table
+
@cindex common allocation
@kindex --no-define-common
@item --no-define-common