Discussion:
[Patch][ld] ELF: update ld man page on `--gc-sections`
Christoph Conrads
2018-10-25 19:21:41 UTC
Permalink
A recent patch fixes the behavior of ld when `--gc-sections` and
`--gc-keep-exported` are both given on the linker command line [1].
This commit below complements the patch and updates the ld man page.

This is my first binutils contribution and I will happily fix submission issues.

[1] https://sourceware.org/ml/binutils/2018-10/msg00241.html


commit ed3d9a69d8532942ae9e354bbfdb6cd3592f21db
Author: Christoph Conrads <***@fluent.ai>
Date: Thu, 25 Oct 2018 21:11:17 +0200

ELF: update ld man page on `--gc-sections`

This commit complements commit 91ae from Oct 19, 2018.

diff --git a/ld/ld.texi b/ld/ld.texi
index 6e0b48ba..b304ea20 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -1605,12 +1605,14 @@ referenced by dynamic objects. Note that when
building shared
libraries, the linker must assume that any visible symbol is
referenced. Once this initial set of sections has been determined,
the linker recursively marks as used any section referenced by their
-relocations. See @samp{--entry} and @samp{--undefined}.
+relocations. See @samp{--entry}, @samp{--undefined}, and
+@samp{--gc-keep-exported}.

This option can be set when doing a partial link (enabled with option
@samp{-r}). In this case the root of symbols kept must be explicitly
-specified either by an @samp{--entry} or @samp{--undefined} option or by
-a @code{ENTRY} command in the linker script.
+specified either by one of the options @samp{--entry},
+@samp{--undefined}, or @samp{--gc-keep-exported} or by a @code{ENTRY}
+command in the linker script.

@kindex --print-gc-sections
@kindex --no-print-gc-sections
Alan Modra
2018-10-25 22:50:26 UTC
Permalink
Post by Christoph Conrads
A recent patch fixes the behavior of ld when `--gc-sections` and
`--gc-keep-exported` are both given on the linker command line [1].
This commit below complements the patch and updates the ld man page.
Thanks, applied.
Post by Christoph Conrads
This is my first binutils contribution and I will happily fix submission issues.
There were two small issues to bear in mind for future patches. We
normally expect a ChangeLog entry in the body of your email, so I made
one saying:

2018-10-26 Christoph Conrads <***@fluent.ai>

* ld.texi (--gc-sections): Update.

Secondly, your email client wraps long lines

$ git am /tmp/christoph.conrads
Applying: ELF: update ld man page on `--gc-sections`
error: corrupt patch at line 6
Patch failed at 0001 ELF: update ld man page on `--gc-sections`
--
Alan Modra
Australia Development Lab, IBM
Loading...