Skip to content

Salted build ids via linker sections

Laura Abbott linux-kbuild lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 11 repliesIn review
  2. v32 patches 10 repliesSuperseded
  3. v2 RFC3 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC3 patches3 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3scripts: Preprocess module-common.ldsscripts/.gitignore scripts/Makefile scripts/module-common.lds.S+2 -14 replies
2/3kbuild: Introduce build-salt linker section and config optioninclude/asm-generic/vmlinux.lds.h init/Kconfig scripts/module-common.lds.S+19 -02 replies
3/3x86: Add build salt to the vDSO and kernel linker scriptsarch/x86/entry/vdso/vdso-layout.lds.S arch/x86/kernel/vmlinux.lds.S+3 -13 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchIngo Molnar
1/3
2/3
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCHv4 0/3] Salted build ids via linker sections

Hi,

This is v4 of the series to allow unique build ids in the kernel. As a reminder of the context:

""
In Fedora, the debug information is packaged separately (foo-debuginfo) and can be installed separately. There's been a long standing issue where only one version of a debuginfo info package can be installed at a time. Mark Wielaard made an effort for Fedora 27 to allow parallel installation of debuginfo (see
https://fedoraproject.org/wiki/Changes/ParallelInstallableDebuginfo for more details)

Part of the requirement to allow this to work is that build ids are unique between builds. The existing upstream rpm implementation ensures this by re-calculating the build-id using the version and release as a seed. This doesn't work 100% for the kernel because of the vDSO which is its own binary and doesn't get updated. After poking holes in a few of my ideas, there was a discussion with some people from the binutils team about adding --build-id-salt to let ld do the calculation debugedit is doing. There was a counter proposal made to add in the salt while building. The easiest proposal was to add an item in the linker script vs. linking in an object since we need the salt to go in every module as well as the kernel and vmlinux.
""

v4 takes Linus' suggestion of using linker fill to insert the build id. This removes the need to use a generated header which makes things much easier. One change is that because this section isn't .comment it won't get stripped automatically. This is pretty small but I also know people can be picky so I'm open to opinions or suggestions here.

Laura Abbott (3):
scripts: Preprocess module-common.lds
kbuild: Introduce build-salt linker section and config option
x86: Add build salt to the vDSO and kernel linker scripts

 arch/x86/entry/vdso/vdso-layout.lds.S              | 3 ++-
 arch/x86/kernel/vmlinux.lds.S                      | 1 +
 include/asm-generic/vmlinux.lds.h                  | 6 ++++++
 init/Kconfig                                       | 9 +++++++++
 scripts/.gitignore                                 | 1 +
 scripts/Makefile                                   | 2 +-
 scripts/{module-common.lds => module-common.lds.S} | 4 ++++
 7 files changed, 24 insertions(+), 2 deletions(-)
 rename scripts/{module-common.lds => module-common.lds.S} (94%)
Signature · 1 line
2.18.0.rc1