"error: expected string in directive" on ARM
| Bugzilla Link | 43759 |
| Resolution | FIXED |
| Resolved on | Jan 27, 2020 15:41 |
| Version | trunk |
| OS | All |
| CC | @nickdesaulniers,@smithp35 |
Extended Description
$ cat foo.s .section ".foo", #alloc $ arm-linux-gnueabihf-gcc -c foo.s $ echo $? 0 $ ~/storage/llvm-project/build/release/bin/clang -target arm-linux-gnueabihf -c foo.s foo.s:1:18: error: expected string in directive .section ".foo", #alloc
Fixed linux upstream: https://git.kernel.org/linus/790756c7e0229dedc83bf058ac69633045b1000e
https://reviews.llvm.org/rG03de2f84fc4acf06c719cd007b5459c9d4d0a20c
Ignore my last comment, I misinterpreted the test case. This is support for Solaris style switching.
.section "name"[, flags...]
It is also worth noting: https://reviews.llvm.org/D69296
Yes, and thanks for the posting the differential link here.
$ cat foo.s .section ".foo", #alloc $ arm-linux-gnueabihf-gcc -c foo.s $ echo $? 0 $ ~/storage/llvm-project/build/release/bin/clang -target arm-linux-gnueabihf -c foo.s foo.s:1:18: error: expected string in directive .section ".foo", #alloc
Ignore my last comment, I misinterpreted the test case. This is support for Solaris style switching.
.section "name"[, flags...]
It is also worth noting: https://reviews.llvm.org/D69296
Reassigning to MC as this is not ARM specific.
The .section directive described in: https://sourceware.org/binutils/docs/as/Section.html has the form: .section name [, "flags"[, @type[,flag_specific_arguments]]] Where "flags" and "@type" are described as optional.
MC permits: .section name .section name , "flags" .section name , "flags", @type but not: .section name , @type
It looks like MC is missing the case where "flags" is optional but @type is not.
Probably not a common occurrence as not setting the flags with a non-recognised section name results in a non SHF_ALLOC non-writeable, non-executable section which is usually not what is wanted, but still a difference in behaviour.
assigned to @jcai19