Can't add the allocated section to elf file using inline assembly

drug drug2004 at bk.ru
Wed Nov 6 10:24:06 UTC 2019


On 11/5/19 7:55 PM, kinke wrote:
> On Tuesday, 5 November 2019 at 12:20:14 UTC, drug wrote:
>> How can I compile .s file?
> 
> The .s file is just the textual representation of the .o object file, so 
> compiling it shouldn't be necessary.

Ah, I see, thanks

> 
>> So I guess the generated assembly is correct and the problem is in 
>> another place.
> 
> I'd look at the surrounding assembly as well, probably easiest when 
> wrapping your inline asm in a trivial `extern(C++) void foo() { ... }` 
> (no other functions, and using -betterC) for direct comparability with 
> clang's output.

I try to add support for SystemTap userland probes in D. They shall be 
`injectable` in any place in your source.
I took a look at the surrounding assembly and as I understood 
considering my low skill the problem was in this section definition:
```
.section	".linker-options","e", at llvm_linker_options
```
clang complained about the code after this line no matter what code it 
was. I read the documentation about section directive 
https://sourceware.org/binutils/docs/as/Section.html but didn't see 
anything wrong


More information about the digitalmars-d-ldc mailing list