Can't add the allocated section to elf file using inline assembly
drug
drug2004 at bk.ru
Thu Nov 7 14:58:24 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.
>
>> 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 found that if I compile sources to object file by means of ldc2 and
then link it using clang then the resulting binary has this section.
```
ldc2 source/app.d source/sdt.d -c -ofsdt.o
clang sdt.o -osdt
```
if I use ldc2 for everything:
```
ldc2 source/app.d source/sdt.d -of sdt
```
The resulting binary has no the section.
What can be the reason of this?
More information about the digitalmars-d-ldc
mailing list