[PATCH] D30256: [ELF] - Implemented -z noreloc-overflow.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 08:14:26 PST 2017


>That is a really odd name if that is what it does. What fails to link if
>you just ignore the option?
>
>Cheers,
>Rafael

Currently LLD links kernel fine because next lines that used as check:

LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \
	&& echo "-z noreloc-overflow -pie --no-dynamic-linker")

never work for us, so build system does not add
-z noreloc-overflow -pie --no-dynamic-linker to invokation.
That works now because KASLR is disabled (kernel does not execute self relocation code).

But when I take reproduce and ignore that option then BFD output for reproduce is:
/usr/bin/ld: home/umb/linux_kernel/linux/linux/arch/x86/boot/compressed/head_64.o: relocation R_X86_64_32 against symbol `z_input_len' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output

I think generally this option is used just to skip all possible checks for dynamic relocations and let the
user of output to do all job on his side.

George.


More information about the llvm-commits mailing list