[Help] all __gshared vairable address is 0.

lili akozhao at tencent.com
Thu Aug 29 02:52:37 UTC 2019


On Sunday, 25 August 2019 at 12:57:58 UTC, kinke wrote:
> On Sunday, 25 August 2019 at 12:12:51 UTC, lili wrote:
>> I'm writing a OS kernel in D.
>
> Are you aware of https://github.com/PowerNex/PowerNex, a 
> similar project?
>
>> and when i call asm_fn in d the return value of asm_fn is 
>> return 0x106000 not 0.
>>  so why did it occur.
>
> I'd suggest writing the same function in D and comparing the 
> produced assembly. Use `-output-s` to generate textual assembly 
> files (*.s) directly with LDC.
> I guess you need to play around with `-relocation-model`.

You are right, the problem was fixed when I set 
-relocation-mode=static. Thanks very much.


More information about the digitalmars-d-ldc mailing list