[llvm-dev] Using '__attribute__((section("name")))' for inline assembly injection

mats petersson via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 5 13:48:00 PDT 2016


On 5 October 2016 at 21:39, Joerg Sonnenberger via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> On Wed, Oct 05, 2016 at 12:44:29PM -0500, Hal Finkel via llvm-dev wrote:
> > Would it be useful for Clang to warn about section names with unusual
> characters?
>
> I don't think it is common enough and you can always check the output
> easily with readelf/objdump.
>

I would think that it's very uncommon, however, it is also terribly
difficult to detect, and I'd argue that it's unlikely that someone actually
wishes to have newlines or other "non-printable"/"control" characters in
the section name. And if it's a warning that is enabled by default but
possible to turn off with "-wno-weird-sectionname", I'd say it would be
little harm - and not a huge maintenance burden.

Knowing to check that the section names contain weirdness or otherwise
debug "why the heck doesn't this code work in Clang, when it compiels
without warning, and is fine when compiled in gcc or whatever" is really
not at all easy.

I do realise that "every warning and such is a maintenance burden", but
although I have not encountered this problem, I'd definitely prefer a
warning than having to figure what went wrong...

--
Mats

>
> Joerg
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161005/086c0126/attachment.html>


More information about the llvm-dev mailing list