[PATCH] D37567: [llvm-readobj] - Teach tool to report error if some section is in multiple COMDAT groups at once.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 04:17:02 PDT 2017


> Can the testcase be created with yaml2obj?

I'll try to do this.

> Can we have a common code path for printing the error in both cases?

I think no, because GNU style and LLVM styles are (or can be at least) different.
As far I understand we must follow the GNU style when -elf-output-style=GNU,
but I would use more suitable/convinent one for LLVM style (like in this patch, for example).

> Should the error go to stderr?

Probably yes, I'll change it.

> Should we exit with 1 when there is an error?

Usually tool uses reportError() which writes to stderr and exits with 1, but it does not seem
this one error is so much critical. We can safely continue parsing the file until real issue happens,
I think it is better behavior for dumping as allows to see more possible errors ? 
That is why I did not use reportError.

FWIW I just checked that GNU readelf does not stop dumping on that error either.

>Cheers,
>Rafael

George.


More information about the llvm-commits mailing list