-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alignment of section does not reflect the maximum alignment of its contents #19475
Labels
Comments
yshuiv7 commented on 2018-08-08T01:23:04ZWhops, not the problem. But ldc still crashes, looking into it... |
yshuiv7 commented on 2018-08-09T10:14:28ZLooks like dmd mis-aligned a __gshared variable. .alignof reports an alignment of 16 bytes, while the variable is aligned only to 8 bytes. |
yshuiv7 commented on 2018-08-10T00:39:25ZI found the actual bug in codegen. In elfobj.c data_start(), when a symbol doesn't have a explicit alignment (Salignment <= 0), the symbol itself is aligned, but its section's alignment is not updated.
To reproduce:
__gshared real x;
pragma(msg, x.alignof);
Compiling it prints: 16LU, but the .data section of the resulting object file is only aligned to 8 bytes. |
dbugz commented on 2018-08-25T15:25:27ZWhich ldc and DMD versions? Does the just-released LDC 1.11 have this problem? |
yshuiv7 commented on 2018-08-25T19:21:19Z(In reply to Joakim from comment #4)
> Which ldc and DMD versions? Does the just-released LDC 1.11 have this
> problem?
Most recent ldc release fix the build problem. But this is a dmd bug nonetheless.
This bug still exists in dmd master |
dbugz commented on 2018-08-26T04:13:40ZThere was an issue with a ldc header mismatch that kinke found when merging the 2.081 frontend into ldc: are you sure that's not what you're seeing instead?
https://github.com/ldc-developers/ldc/pull/2752#issuecomment-398897813
https://github.com/ldc-developers/ldc/pull/2752#issuecomment-399691107
It's a known bug that DMD 2.081 won't build a working ldc 1.10, have to use 1.11. |
yshuiv7 commented on 2018-08-26T04:18:15Z(In reply to Joakim from comment #6)
> There was an issue with a ldc header mismatch that kinke found when merging
> the 2.081 frontend into ldc: are you sure that's not what you're seeing
> instead?
>
> https://github.com/ldc-developers/ldc/pull/2752#issuecomment-398897813
> https://github.com/ldc-developers/ldc/pull/2752#issuecomment-399691107
>
> It's a known bug that DMD 2.081 won't build a working ldc 1.10, have to use
> 1.11.
I have inspected the generated binary, and found problem in DMD's code. This bug is real. Please read comment #3 |
dbugz commented on 2018-08-26T04:26:27ZOK, if you're so sure it's a problem in dmd's backend, a pull request is welcome. |
yshuiv7 commented on 2018-08-26T18:55:51Z(In reply to Joakim from comment #8)
> OK, if you're so sure it's a problem in dmd's backend, a pull request is
> welcome.
While I know where the problem is, I don't know what is the proper fix. So I would need some help. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yuxuan Shui (@yshui) reported this on 2018-08-08T00:46:05Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=19148
Description
The text was updated successfully, but these errors were encountered: