1675 – "Identifier too long" error with OMF object files

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1675 - "Identifier too long" error with OMF object files
Summary: "Identifier too long" error with OMF object files
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: rejects-valid
Depends on:
Blocks:
Reported: 2007年11月15日 22:18 UTC by Jarrett Billingsley
Modified: 2014年02月15日 13:13 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Jarrett Billingsley 2007年11月15日 22:18:17 UTC
If there were an "OPTLINK" component, I would have filed this under it.
When dealing with complex template tuples, it's very easy to overflow the maximum symbol length allowed by OPTLINK. This is, simply put, a damn shame, because it prevents otherwise completely legal code from compiling and linking with DMDWin, whereas it works perfectly fine when using DMDNix or GDC. 
I know that this is neither a simple nor a small issue to fix: either the ancient, nearly-immutable OPTLINK would have to be modified, or DMDWin would have to be changed to output a more reasonable format, in which case a new linker would probably have to be written. Until then, this issue should stand as a reminder that DMDWin is inherently limited.
Comment 1 BCS 2007年11月15日 22:31:25 UTC
Oplink isn't the issue. The OMF file format has a hard limit. This results in the only solutions being: convert DMD to use some other .obj format or have DMD do something else for name mangling.
In talking to Walter, the issue is that it's easy to get symbols that have more info in them than can be fit into the limit. (the limit has already stretched by gziping the symbols.)
The "simple solution" I have proposed is to just MD5 (or what not) the symbols. The only issue (besides a vanishingly small chance of a hash collision) is that this looses information so you can't look at a symbol and directly determine what it was. My answer to that is, who cares? The only place where hashing provides less info than compressing is in a debugger and it can grab the full symbol from a table in the static data segment.
Comment 2 Jarrett Billingsley 2007年11月15日 23:52:45 UTC
(In reply to comment #1)
> Oplink isn't the issue. The OMF file format has a hard limit. This results in
> the only solutions being: convert DMD to use some other .obj format or have DMD
> do something else for name mangling.
> 
> In talking to Walter, the issue is that it's easy to get symbols that have more
> info in them than can be fit into the limit. (the limit has already stretched
> by gziping the symbols.)
> 
> The "simple solution" I have proposed is to just MD5 (or what not) the symbols.
> The only issue (besides a vanishingly small chance of a hash collision) is that
> this looses information so you can't look at a symbol and directly determine
> what it was. My answer to that is, who cares? The only place where hashing
> provides less info than compressing is in a debugger and it can grab the full
> symbol from a table in the static data segment.
> 
I suppose as a stopgap measure that'd work fine, and might even be controlled by a compiler switch, so that in the general case debugger info wouldn't be affected. And what's more -- the only time these issues come up is with templates, which a lot of debuggers have serious problems with anyway, so..
Comment 3 BCS 2007年11月16日 10:30:34 UTC
I would set it up as a method of last resort. It wouldn't be used unless the symbol can't be used any other way.
Comment 4 Walter Bright 2008年06月22日 18:53:05 UTC
Fixed dmd 1.031 and 2.015


AltStyle によって変換されたページ (->オリジナル) /