[PATCH] D30566: [ELF] - Do not try to create .eh_frame_hdr for relocatable output.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 10:25:21 PST 2017


ruiu added inline comments.


================
Comment at: ELF/Driver.cpp:230
+    if (Config->EhFrameHdr)
+      warn("--eh-frame-hdr is ignored when using -r");
+
----------------
grimar wrote:
> ruiu wrote:
> > grimar wrote:
> > > ruiu wrote:
> > > > grimar wrote:
> > > > > ruiu wrote:
> > > > > > Shouldn't we handle this as an error instead of a warning? All other incompatible combinations are handled as errors here.
> > > > > According to comments compiler driver implicitly added --eh-frame-hdr, I afraid we probably may get many complains about link fails if this be a error().
> > > > > Thats why I added it as a warning.
> > > > I don't want to add a warning that is too verbose and not helpful for users. That kind of warnings would educate users to ignore warnings rather than fixing them. If compilers automatically adds --eh-frame-hdr to the command line, there's no way for users to fix it, so you need to ignore this error message all the time.
> > > Users has a choice here - to call linker directly for generating relocatable output instead of calling compiler.
> > > 
> > > I have no strong opinion here though. I am ok to remove it.
> > Does gcc add this option too?
> Yes, gcc 5.4.1 do that.
OK, then it is too pervasive to warn. Probably we should just ignore --eh-frame-hdr if -r is passed rather than annoy users with the warning message.


https://reviews.llvm.org/D30566





More information about the llvm-commits mailing list