DMD win32 static library link errors

Neal Alexander wqeqweuqy at hotmail.com
Tue Jan 8 09:28:02 PST 2008


Neal Alexander wrote:
> Robert DaSilva wrote:
>> Neal Alexander wrote:
>>> link.exe (Assertion failure: 'len <= IDMAX' on line 129 in file
>>> 'libin.cpp')
>>>
>>> I saw on the C++ newsgroup it happens when identifiers are too long in
>>> an object file. The question is whats the best way igure out which ID is
>>> causing it? All the symbols in the source code are nowhere near the 512
>>> limit.
>>>
>>> I tried playing with the dmd/objdump tool but diddnt diddnt see anything
>>>  glancing over the output.
>>
>> Do you have any templates, they tend to have long mangled names.
>> It could also be a deeply nested identifier.
> 
> Yea its a mixin template causing it im pretty sure. I tried making 
> identifiers 1-2 chars long but it doesnt help.
> 
> http://paste.dprogramming.com/dpfxrbb1 If youre interested.
> 
> The point of the code is to transparently wrap 32/64bit structs and 
> endian conversion. It uses a proxy struct with enum indexing and 
> offset/size tables.

Ok so, obj2asm.exe gave much more useful output.

It turns out the length of a mixin string affects the symbol names 
generated.

__body__ generated a 750 byte identifier:

extrn	_D14reflect_txtgen3635__T8ÙbodyéVG4yaa4_45686472VA€„�8€„�c6633325f€ˆœ2a2078€”š3b€‡–É4€—°€�š3b€…è1746_656e7Ùd€ƒ¬bÙ655f74797€ƒŠ2c€„Ž6d61€ƒ¿8696e€ˆ”76é7273€ƒ”f6e€‡¨€„È€ƒÜ79€‡¤0€ƒ´f66É€‡�€„Ä€‹�€ƒ‰ù16773€‰À8€„Ò7a€‰æ€„€†Ö€’˜�†´€ŠÚ€”¨€„˜€�¨Ù�„¤�ƒÊé82c7d3b€„’6‚„Š963‚ƒ€3�„Ò€„”‚ƒ�5�†´�ƒÔ45b5‚„¢‚ƒÄ€‰ä03€ƒ’5‚ˆúƒŽª€ƒÂ€†¦�„ò2cƒ•ž€�¤5�­Œ�†�‚†Ð€ƒš5€„¤�†��š”ƒ�Üe€Œ¼��¦€“¶„�„€­¼„�¬€®ø„ŠÔ€®ô„Šü€®¸…Ф�®¨…ŠÌ�°à…Šô�²â…Žô€²À††œ‚²¢€¼ø‡Š”€±¸‡�¼€“¾†ƒ’Ù…ˆü†�ì…§ü€“¶…©ü€”ò…¨ü€”ø…¤ü€”ô…¤ü€”¸…¤ü�”¨…¤ü�–à…¤ü�˜â…¨„€˜À… „‚˜¢€¼ø…¤ü€—¸…¥üd3b€„¨61Ú96320€ƒÏ„ƒø€„”2075ƒ†â„ƒÒ45b5dÛ€ƒ–�ˆÊ03€ƒŽ5bÛ‡›††‰Â€ˆ¸‡ ¸†�¾€¨¸†�º€©ð†‹¶€©ì†‹²€©´†‹®�©œ†‹ª�«Ð†‹¦�­Ò…�ª€­¼…‡¦‚­Ž€¸ð†‹–€¬´†Ž’€Žº†…Ž…ˆÈ†”Ò…žÈ€“²…¥È€”ꅤȀ”ð… È€”ì… È€”´… È�”œ… È�–Ð… È�˜Ò„¤Ø€˜¼„œØ‚˜Ž€¸ð… È€—´…¡Èd3bZ8__bodyéxAya


Splitting up the struct definition into smaller const char[] variables 
and concatenating them in __body__ fixed it (making each their own 
template crashes DMD).


More information about the Digitalmars-d-learn mailing list