Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't create dynamic relocation R_386_32 with LLD #579

Closed
tpimh opened this issue Jun 28, 2019 · 9 comments
Closed

can't create dynamic relocation R_386_32 with LLD #579

tpimh opened this issue Jun 28, 2019 · 9 comments
Labels
[ARCH] x86 This bug impacts ARCH=i386 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.10 This bug was fixed in Linux 5.10 [TOOL] lld The issue is relevant to LLD linker

Comments

@tpimh
Copy link

tpimh commented Jun 28, 2019

ld.lld: error: can't create dynamic relocation R_386_32 against symbol: _bss in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in 
>>> referenced by arch/x86/boot/compressed/head_32.o:(.text+0x4)

This is specific to i386 and LLD. Not yet submitted to LLVM bugzilla.

@tpimh tpimh added [BUG] llvm A bug that should be fixed in upstream LLVM [TOOL] lld The issue is relevant to LLD linker [ARCH] x86 This bug impacts ARCH=i386 labels Jun 28, 2019
@nickdesaulniers
Copy link
Member

arch/x86/boot/compressed/Makefile resets KBUILD_CFLAGS and KBUILD_LDFLAGS. Can you try:

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 6b84afdd7538..90d59a064136 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -43,7 +43,7 @@ KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 GCOV_PROFILE := n
 UBSAN_SANITIZE :=n
 
-KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
+KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE) -z notext
 # Compressed kernel should be built as PIE since it may be loaded at any
 # address by the bootloader.
 ifeq ($(CONFIG_X86_32),y)

@nickdesaulniers
Copy link
Member

We do that in arch/arm64/Makefile if CONFIG_RELOCATABLE is set. So I'm guessing this issue might go away if KASLR (CONFIG_RANDOMIZE_BASE and CONFIG_RELOCATABLE) is used. If that's the case, then my diff above should probably similarly be guarded like in arch/arm64/Makefile by CONFIG_RELOCATABLE.

@tpimh
Copy link
Author

tpimh commented Jul 1, 2019

Builds fine with -z notext, confirmed.

@tpimh tpimh added [BUG] linux A bug that should be fixed in the mainline kernel. and removed [BUG] llvm A bug that should be fixed in upstream LLVM labels Jul 15, 2019
@tpimh tpimh self-assigned this Sep 29, 2019
@tpimh
Copy link
Author

tpimh commented Sep 29, 2019

I have tested with both CONFIG_RELOCATABLE set and unset and can confirm that the guess was right. I updated the patch:

--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -55,6 +55,12 @@ else
 KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
 	&& echo "-z noreloc-overflow -pie --no-dynamic-linker")
 endif
+ifeq ($(CONFIG_RELOCATABLE), y)
+# LLD by default disallows relocations in read-only segments. For a relocatable
+# kernel, we pass -z notext to the linker to explicitly allow relocations. This
+# behavior is default for BFD.
+KBUILD_LDFLAGS += -z notext
+endif
 LDFLAGS_vmlinux := -T

@tpimh tpimh added the [PATCH] Exists There is a patch that fixes this issue label Sep 29, 2019
@nickdesaulniers
Copy link
Member

I like the check for CONFIG_RELOCATABLE. @tpimh did you test that LLD can link the image both w/ and w/o that config enabled? The comment can go in the commit message, rather than in source I think.

@tpimh
Copy link
Author

tpimh commented Apr 29, 2020

Tested with both CONFIG_RELOCATABLE set and unset. Links and boots fine in both cases.

@nickdesaulniers
Copy link
Member

Cool, send it.

@tpimh
Copy link
Author

tpimh commented May 1, 2020

@tpimh tpimh added [PATCH] Submitted A patch has been submitted for review and removed [PATCH] Exists There is a patch that fixes this issue labels May 1, 2020
fengguang pushed a commit to 0day-ci/linux that referenced this issue May 1, 2020
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
krasCGQ pushed a commit to krasCGQ/linux that referenced this issue Jun 25, 2020
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Albert I <kras@raphielgang.org>
@nickdesaulniers
Copy link
Member

With this series applied: https://lore.kernel.org/lkml/20200717201801.3661843-2-nivedita@alum.mit.edu/T/#u

I was able to link and boot an i386_defconfig with LLD. (Also https://lore.kernel.org/linux-next/20200717213127.3bd426e1@canb.auug.org.au/, and a series I recently sent to Linus most of patches from Brian Gerst plus one). So this is close to working.

krasCGQ pushed a commit to krasCGQ/linux that referenced this issue Aug 24, 2020
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Albert I <kras@raphielgang.org>
krasCGQ pushed a commit to krasCGQ/linux that referenced this issue Aug 24, 2020
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Albert I <kras@raphielgang.org>
@nickdesaulniers nickdesaulniers added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Sep 24, 2020
jro1979oliver pushed a commit to jro1979oliver/android_kernel_motorola_sm7325 that referenced this issue Oct 9, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
jro1979oliver pushed a commit to jro1979oliver/android_kernel_motorola_sm7325 that referenced this issue Oct 11, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Oct 16, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Oct 21, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
Pascoato pushed a commit to Pascoato/android_kernel_xiaomi_lahaina that referenced this issue Nov 1, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
Pascoato pushed a commit to Pascoato/android_kernel_xiaomi_lahaina that referenced this issue Nov 2, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
pa-gerrit pushed a commit to AOSPA/android_kernel_realme_sm8350 that referenced this issue Nov 13, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Nov 25, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Nov 25, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Dec 3, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Dec 9, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Dec 9, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
nobregaX pushed a commit to SM7325-AE/android_kernel_motorola_dubai that referenced this issue Dec 17, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
pa-gerrit pushed a commit to AOSPA/android_kernel_realme_sm8350 that referenced this issue Dec 28, 2023
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Jan 7, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aosparsche/android_kernel_realme_sm8350 that referenced this issue Jan 17, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
Pascoato pushed a commit to Pascoato/android_kernel_xiaomi_lahaina that referenced this issue Feb 18, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
Pascoato pushed a commit to Pascoato/android_kernel_xiaomi_lahaina that referenced this issue Feb 24, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
Pascoato pushed a commit to Pascoato/android_kernel_xiaomi_lahaina that referenced this issue Feb 24, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
Pascoato pushed a commit to Pascoato/android_kernel_xiaomi_lahaina that referenced this issue Mar 15, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
pa-gerrit pushed a commit to AOSPA/android_kernel_nothing_sm7325 that referenced this issue Apr 14, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
gotenksIN pushed a commit to gotenksIN/android_kernel_nothing_sm7325 that referenced this issue Apr 17, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
gotenksIN pushed a commit to gotenksIN/android_kernel_nothing_sm7325 that referenced this issue Apr 17, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
pa-gerrit pushed a commit to AOSPA/android_kernel_nothing_sm7325 that referenced this issue Apr 18, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
Mashopy pushed a commit to Mashopy/android_kernel_huawei_sm8325 that referenced this issue May 1, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
Mashopy pushed a commit to Mashopy/android_kernel_huawei_sm8325 that referenced this issue May 2, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
Mashopy pushed a commit to Mashopy/android_kernel_huawei_sm8325 that referenced this issue May 2, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
Pascoato pushed a commit to Pascoato/android_kernel_xiaomi_lahaina that referenced this issue May 7, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d

Change-Id: I17e94568de08e2e0362b00e9ce956ff7bdf349f5
ElectroPerf pushed a commit to aospa-dubai/android_kernel_motorola_sm7325 that referenced this issue Jun 18, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
ElectroPerf pushed a commit to aospa-dubai/android_kernel_motorola_sm7325 that referenced this issue Jun 18, 2024
LLD by default disallows relocations in read-only segments. For a
relocatable kernel, we pass -z notext to the linker to explicitly
allow relocations. This behavior is the default for BFD.

Link: ClangBuiltLinux/linux#579
Signed-off-by: Dmitry Golovin <dima@golovin.in>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
[adelva: ndesaulniers notes this is a simpler alternative to the
         upstream fix that is hard to backport to 5.4 due to many
         x86 assembler changes]
Link: https://lore.kernel.org/lkml/20200501084215.242-1-dima@golovin.in/
Bug: 65987925
Signed-off-by: Alistair Delva <adelva@google.com>
Change-Id: Ie0085504ff58e468ad5b3f71014b58151b2f2f2d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] x86 This bug impacts ARCH=i386 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.10 This bug was fixed in Linux 5.10 [TOOL] lld The issue is relevant to LLD linker
Projects
None yet
Development

No branches or pull requests

2 participants