Iain Buclaw
Iain Buclaw
[Github search](https://github.com/search?q=%22symbol+count+from+symbol+table+and+dynamic+symbol+table+differ%22&type=code) to the rescue. https://github.com/apple-oss-distributions/dyld/blob/d1a0f6869ece370913a3f749617e457f3b4cd7c4/mach_o/Image.cpp#L346-L347 ```c if ( hasIndSymTab && (symCount != indSymCount)) return Error("symbol count from symbol table and dynamic symbol table differ"); ``` - [hasIndSymTab = LC_DYSYMTAB](https://github.com/apple-open-source/macos/blob/ea4cd5a06831aca49e33df829d2976d6de5316ec/dyld/mach_o/Image.cpp#L259C18-L260)...
> 1. Compile (without linking) the following code with LDC and DMD: > ```d > extern (C) int printf(const char*, ...); > > void main() > { > printf("foo\n"); >...
This is ridiculous https://github.com/dlang/dmd/blob/9471b25db9ed44d71e0e27956430c0c6a09c16db/compiler%2Fsrc%2Fdmd%2Fbackend%2Fmachobj.d#L1409-L1430
I count no fewer than half a dozen issues. https://issues.dlang.org/show_bug.cgi?id=23517 https://issues.dlang.org/show_bug.cgi?id=24137 https://issues.dlang.org/show_bug.cgi?id=24399 https://issues.dlang.org/show_bug.cgi?id=20297 https://issues.dlang.org/show_bug.cgi?id=24402 https://issues.dlang.org/show_bug.cgi?id=24401 https://issues.dlang.org/show_bug.cgi?id=22556 #16194 is in and there's no appetite to address them for now.
> What about basic types like integers? They have the same alignment as their nonatomic equivalent. Any potential deviations don't apply to targets DMD cares about (ie. SystemZ) - GDC...
> > What about basic types like integers? > > They have the same alignment as their nonatomic equivalent. Any potential deviations don't apply to targets DMD cares about (ie....
> What about basic types like integers? > The CPU cares about the size and the pointer address alignment. So then the question is not just basic types, but also...
> This also covers another question, regarding validation. Maximum sizes of the type is just as important for a CT error as alignment is (which should be forced based upon...
> I've had some more time to think about this. ``isValidMangling`` needs to be removed. Linkers should not care about what characters go into a symbol name. But they do...
Without it, you'd also be permitted to have `\0` and other non-printable characters in a symbol name - yes, someone put `pragma(mangle, "foo\0bar")` in the testsuite and I complained about...