[PATCH] Fix PR18381 - print a minimal diagnostic rather than assert on unresolved .secidx target

Timur Iskhodzhanov timurrrr at google.com
Thu Jan 30 12:18:44 PST 2014


Ah, ok - there are two problems then, not one.

2014-01-30 Jim Grosbach <grosbach at apple.com>

> That subtraction diagnostic doesn’t generate a stack trace, does it? I
> don’t see one on Darwin, anyway. Perhaps a platform difference?
>

It doesn't generate a stack trace with `-triple i686-pc-linux` but does
with `-triple i686-pc-win32`.
Looks like the COFFStreamer doesn't play well with SMLoc.
It looks like a bigger issue and I don't think it should be a part of this
change.


> The top level report_fatal_error() function has a parameter for whether to
> consider the failure a crasher or not, but doesn’t look like this is going
> through that path.
>
> -Jim
>
> On Jan 30, 2014, at 10:54 AM, Reid Kleckner <rnk at google.com> wrote:
>
> I'd leave the stack trace alone for now.  That's what all other MC errors
> do.  If somebody wants to fix that, they can do it later.
>
> Agree.

> For the wording, IMO it'd be more consistent to say that this was an
> "undefined symbol".  It's not clear what "couldn't resolve" means, and
> "undefined" feels more precise.
>
> OK, see the updated version of the patch.

> Also, we should mention .secidx.
>
> We have other errors like:
>           Twine("symbol '") + B->getName() +
>               "' can not be undefined in a subtraction expression");
>
> So we could do something like:
> Cannot get section of undefined symbol 'bar' in .secidx directive
>
> I'm not sure - the condition might theoretically be (un)met for other
directives as well.
Long-term, when the locations are threaded properly, we'll get a nice
diagnostic pointing at the very instruction and saying
  C:\src\llvm\test\MC\COFF\secidx_diagnostic.s:8:17: error: symbol 'bar'
can not be undefined
        .secidx bar
               ^
(this one is manually crafted based on the `-triple i686-pc-linux` output)

Does that sound good?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140130/e5b98e2e/attachment.html>


More information about the llvm-commits mailing list