• Rafael Ávila de Espíndola's avatar
    x86/build: Mark per-CPU symbols as absolute explicitly for LLD · c8a8dd1d
    Rafael Ávila de Espíndola authored
    [ Upstream commit d071ae09 ]
    
    Accessing per-CPU variables is done by finding the offset of the
    variable in the per-CPU block and adding it to the address of the
    respective CPU's block.
    
    Section 3.10.8 of ld.bfd's documentation states:
    
      For expressions involving numbers, relative addresses and absolute
      addresses, ld follows these rules to evaluate terms:
    
      Other binary operations, that is, between two relative addresses
      not in the same section, or between a relative address and an
      absolute address, first convert any non-absolute term to an
      absolute address before applying the operator."
    
    Note that LLVM's linker does not adhere to the GNU ld's implementation
    and as such requires implicitly-absolute terms to be explicitly marked
    as absolute in the linker script. If not, it fails currently with:
    
      ld.lld: error: ./arch/x86/kernel/vmlinux.lds:153: at least one side of the expression must be absolute
      ld.lld: error: ./arch/x86/kernel/vmlinux.lds:154: at least one side of the expression must be absolute
      Makefile:1040: recipe for target 'vmlinux' failed
    
    This is not a functional change for ld.bfd which converts the term to an
    absolute symbol anyways as specified above.
    
    Based on a previous submission by Tri Vo <trong@android.com>.
    Reported-by: Dmitry Golovin's avatarDmitry Golovin <dima@golovin.in>
    Signed-off-by: Rafael Ávila de Espíndola's avatarRafael Ávila de Espíndola <rafael@espindo.la>
    [ Update commit message per Boris' and Michael's suggestions. ]
    Signed-off-by: 's avatarNick Desaulniers <ndesaulniers@google.com>
    [ Massage commit message more, fix typos. ]
    Signed-off-by: 's avatarBorislav Petkov <bp@suse.de>
    Tested-by: Dmitry Golovin's avatarDmitry Golovin <dima@golovin.in>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Brijesh Singh <brijesh.singh@amd.com>
    Cc: Cao Jin <caoj.fnst@cn.fujitsu.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Joerg Roedel <jroedel@suse.de>
    Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tri Vo <trong@android.com>
    Cc: dima@golovin.in
    Cc: morbo@google.com
    Cc: x86-ml <x86@kernel.org>
    Link: https://lkml.kernel.org/r/20181219190145.252035-1-ndesaulniers@google.comSigned-off-by: 's avatarSasha Levin <sashal@kernel.org>
    c8a8dd1d
Name
Last commit
Last update
Documentation Loading commit data...
LICENSES Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.clang-format Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...