[PATCH] D42324: [WebAssembly] Remove --emit-relocs

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 17:20:06 PST 2018


ruiu added a comment.

I'm not sure if I understand it correctly, so let me write down a few facts I believe true.

- --emit-relocs is not the same as -r. IIUC, they were created for pretty different purposes. --emit-relocs is to let the linker to emit the regular linked dso/executables along with relocation information (which is usually consumed by the linker and then removed from output), so that some post-processing tool can analyze the binary to do whatever they want to do. So, relocations in --emit-relocs is just "informative". OTOH, -r lets the linker to create a re-linkable, regular object files. With that feature, you can combine multiple .o files into a single .o.

- The output of -r is naturally quite different from the normal output. That's a natural consequence that the normal output is assumed to be consumed by the dynamic linker while the -r output is consumed by the static linker. So the difference is as large as the .o file and the .exe file, and that's not odd.

- I don't know why you wanted --emit-relocs at this point -- lld have that option because, IIRC, the Linux kernel needs it to do some tricky thing. Normally, you don't need that option.

Hope this helps.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42324





More information about the llvm-commits mailing list