All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix and simplify -z noreloc-overflow" linker check in arch/x86/boot/compressed/Makefile
@ 2019-03-12  9:13 Sedat Dilek
  2019-03-12 16:05 ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Sedat Dilek @ 2019-03-12  9:13 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild

Hi Masahiro Yamada,

do you have an idea how to fix this properly - as for example LLD
hasn't this option?
Speaking of the shell-line.
I mean use the method "call ld-option".

The below should be if $linker supports z noreloc-overflow then set
-pie together with --no-dynamic-linker.
AFAICS this is for x86-64-only?

Is it possible to simplify and have have one single line...?

KBUILD_LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)

[ arch/x86/boot/compressed/Makefile ]

KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
# Compressed kernel should be built as PIE since it may be loaded at any
# address by the bootloader.
ifeq ($(CONFIG_X86_32),y)
KBUILD_LDFLAGS += $(call ld-option, -pie) $(call ld-option, --no-dynamic-linker)
else
# To build 64-bit compressed kernel as PIE, we disable relocation
# overflow check to avoid relocation overflow error with a new linker
# command-line option, -z noreloc-overflow.
KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
        && echo "-z noreloc-overflow -pie --no-dynamic-linker")
endif
LDFLAGS_vmlinux := -T

If you need more infos let me know.

Thanks.

Regards,
- Sedat -

Link: https://github.com/ClangBuiltLinux/linux/issues/411

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-19  0:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12  9:13 Fix and simplify -z noreloc-overflow" linker check in arch/x86/boot/compressed/Makefile Sedat Dilek
2019-03-12 16:05 ` Masahiro Yamada
2019-03-13  8:51   ` Sedat Dilek
2019-03-18  9:45     ` Masahiro Yamada
2019-03-18  9:49       ` Sedat Dilek
2019-03-18 11:51       ` Sedat Dilek
2019-03-19  0:53         ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.