Lines Matching +full:keep +full:- +full:a +full:- +full:live
1 -z start-stop-gc
4 If your ``-Wl,--gc-sections`` build fail with a linker error like this:
8 …mbol needs to be retained under --gc-sections properly; consider -z nostart-stop-gc (see https://l…
11 suffice under ``--gc-sections``.
14 symbols. In October 2015, GNU ld switched behavior and made a ``__start_meta``
15 reference from a live section retain all ``meta`` input sections. This
20 GNU ld 2.37 added ``-z start-stop-gc`` to restore the traditional behavior
21 ld.lld 13.0.0 defaults to ``-z start-stop-gc`` and supports ``-z nostart-stop-gc``
24 The Apple ld64 linker has a similar ``section$start`` feature and always
25 allowed GC (like ``-z start-stop-gc``).
28 -----------------------------------
30 A C identifier name section (``meta``) sometimes depends on another section.
31 Let that section reference ``meta`` via a relocation.
33 .. code-block:: c
39 If a relocation is inconvenient, consider using ``__attribute__((retain))``
42 .. code-block:: c
45 #pragma GCC diagnostic ignored "-Wattributes"
51 so ``-Wattributes`` may need to be ignored. On ELF targets,
53 linker ``--gc-sections``.
55 In a macro, you may use:
57 .. code-block:: c
60 _Pragma("GCC diagnostic ignored \"-Wattributes\"")
64 If you use the ``SECTIONS`` command in a linker script, use
65 `the ``KEEP`` keyword <https://sourceware.org/binutils/docs/ld/Input-Section-Keep.html>`_, e.g.
66 ``meta : { KEEP(*(meta)) }``