Skip to content

Commit 30d679d

Browse files
thomasnyman06kellyjacthesamesam
committed
Clarify linker options in the guide are for GNU BFD
Co-authored-by: Jack Kelly <[email protected]> Co-authored-by: Sam James <[email protected]> Signed-off-by: Thomas Nyman <[email protected]>
1 parent df7e528 commit 30d679d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ The recommendations in Table 1 and Table 2 are primarily applicable to compiling
157157
- supported both by the GCC and Clang / LLVM toolchains.
158158
- cross-platform and supported on (at least) Intel and AMD 64-bit x86 architectures as well as the 64-bit version of the ARM architecture (AArch64).
159159

160+
Linker options covered by this guide are (unless otherwise noted) valid for GNU Linker (LD) provided as part of GNU Binary Utilities (binutils) and built off the GNU BFD (Binary File Descriptor) library. They may not be valid options for other linkers, such as binutils gold or the LLVM Linker (LLD).
161+
160162
[^compiler-flags-distro]: Voisin, Julien et al., [Default compiler hardening flags used to build packages for Linux distributions](https://github.com/jvoisin/compiler-flags-distro), GitHub jvoisin/compiler-flags-distro, 2025-02-14.
161163

162164
For historical reasons, the GCC compiler and Binutils upstream projects do not enable optimization or security hardening options by default. While some aspects of the default options can be changed when building GCC and Binutils from source, the defaults used in the toolchains shipped with GNU/Linux distributions vary. Distributions may also ship multiple versions of toolchains with different defaults. Consequently, developers need to pay attention to compiler and linker option flags, and manage them according to their need of optimization, level of warning and error detection, and security hardening of the project.

0 commit comments

Comments
 (0)