[PATCH] D30169: Print unknown section header flags has hex in assembly output

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 09:31:34 PST 2017


Christof Douma <Christof.Douma at arm.com> writes:

> Personally, I agree with you. Having a textual representation is nicer. But I can’t make-up textual representations for those unknown flags. That is really for the owners of those targets. However, this patch does make sure that even without a textual representation, there is a not-nice-but-correct output as a fail-safe solution. Users might start asking questions why there is hex instead of textual output, and that could lead to fixes for the missing textual representation. 
>
> About the SHF_COMPRESSED flag. At first I thought you are right and we should special case that flag. But I am not sure anymore. What should happen if a tool asks the MC layer to emit assembly of a section that it also wants compressed? The options that I can come up with are:
> 	- emit an error
> 	- emit .byte directives with the compressed stream and set the SHF_COMPRESSED flag
>
> It seems that currently the MC layer ignores any compression request when emitting assembly but does not produce an error. My point is that the SHF_COMPRESSED flag is already never visible from assembly and if it would be visible, I would have expected the contents to be compressed already.

But that is the correct behavior for SHF_COMPRESSED. It is an assembler
option, not a codegen option.

Do we know for sure that all the flags that are missing are flags that
are supposed to be set by codegen? Always printing flags when a value is
unknown doesn't look like a safe behavior.

Cheers,
Rafael


More information about the llvm-commits mailing list