[PATCH] D53864: [ELF] - Do not crash when -r output uses linker script with `/DISCARD/`

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 13:16:23 PDT 2018


ruiu added inline comments.


================
Comment at: ELF/InputFiles.cpp:652
+      // -emit-relocs below. This is useful for case when linker script contains
+      // the "/DISCARD/". It is uncommon to have script with -r, but arm64 linux
+      // kernel use it and we have to handle such case and do not crash.
----------------
grimar wrote:
> peter.smith wrote:
> > My understanding is that it is all Linux kernel modules use that fragment of linker script and not just arm64.
> Maybe it is just better to omit the name completely. It does not seem to be important that we observed this in Linux kernel, it could be anywhere.
I think it is actually important to mention Linux kernel module as a use case of linker script + the -r flag, because using -r with a linker script sounds like a really bad idea (perhaps it is though).


https://reviews.llvm.org/D53864





More information about the llvm-commits mailing list