mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-26 13:05:18 +01:00
enable --build-id for the kernel link
A Build-ID is an identifier generated at link time to uniquely identify ELF binaries. It allows efficient confirmation that an executable or shared library and a corresponding standalone debuginfo file match. (Otherwise, a checksum of the debuginfo file must be calculated when opening it in a debugger.) The FreeBSD base system includes GNU bfd ld 2.17.50 as the linker for architectures other than arm64. Build-ID support was added to bfd ld shortly after that version, so was not previously available to us. We can now start making use of Build-ID as we migrate to using lld or bfd ld from ports, conditionally enabled based on the LINKER_TYPE and LINKER_VERSION make variables added in r320244 and subsequent commits. Reviewed by: dim MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11314
This commit is contained in:
parent
4d17a48343
commit
53e0bebaca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320272
@ -114,6 +114,10 @@ DEFINED_PROF= ${PROF}
|
||||
# can override the others.
|
||||
CFLAGS+= ${CONF_CFLAGS}
|
||||
|
||||
.if ${LINKER_TYPE} != "bfd" || ${LINKER_VERSION} > 21750
|
||||
LDFLAGS+= -Wl,--build-id=sha1
|
||||
.endif
|
||||
|
||||
# Optional linting. This can be overridden in /etc/make.conf.
|
||||
LINTFLAGS= ${LINTOBJKERNFLAGS}
|
||||
|
||||
|
@ -125,6 +125,10 @@ CFLAGS.gcc+= --param large-function-growth=1000
|
||||
CFLAGS+= -fno-common
|
||||
LDFLAGS+= -d -warn-common
|
||||
|
||||
.if ${LINKER_TYPE} != "bfd" || ${LINKER_VERSION} > 21750
|
||||
LDFLAGS+= -Wl,--build-id=sha1
|
||||
.endif
|
||||
|
||||
CFLAGS+= ${DEBUG_FLAGS}
|
||||
.if ${MACHINE_CPUARCH} == amd64
|
||||
CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
|
||||
|
Loading…
Reference in New Issue
Block a user