[PATCH] D14382: [ELF2] - Basic implementation of -r/--relocatable

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 09:27:31 PST 2015


grimar added a comment.

In http://reviews.llvm.org/D14382#282370, @ruiu wrote:

> I took a quick look at the code. This patch doesn't remove relocations that were successfully resolved within an object file the linker is writing, does this? Is it hard to support that? I think that's the reason why users want to use -r in the first place (so that the number of relocations in a combined object file is much smaller than the total number of relocations in the input files.) If it's going to be more code, it's fine to do in a follow up patch, though.


Actually no relocations are applied atm. See ELF/InputFiles.cpp (215) has "break;" so nothing is added to S->RelocSections list and no relocations resolved during that link. I can put correcting that into plan at first place but would be nice to split this to following patches. That one looks large already.

I am also have plan to add support for rel[a].eh_frame sections in following one(s) as well.


================
Comment at: ELF/Driver.cpp:155
@@ -152,1 +154,3 @@
 
+  Config->Relocatable = Args.hasArg(OPT_relocatable);
+  if (Config->Relocatable) {
----------------
ruiu wrote:
> Move this into the code block above and sort.
Ok. I just wasn`t sure here how to highlight that Relocatable affects on other options. Thats why put it outside as well.



http://reviews.llvm.org/D14382





More information about the llvm-commits mailing list