JDK-8048214 : Linker error when compiling G1SATBCardTableModRefBS after include order changes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-06-26
  • Updated: 2015-08-21
  • Resolved: 2014-06-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u40Fixed 9 b24Fixed openjdk7uFixed
Related Reports
Relates :  
Description
If the include order is changed sligthly the following error occurs in the Windows build:

g1SATBCardTableModRefBS.obj : error LNK2019: unresolved external symbol "public: void __thiscall G1SATBCardTableModRefBS::write_ref_array_pre_work<class oopDesc *>(class oopDesc * *,int)" (??$write_ref_array_pre_work@PAVoopDesc@@@G1SATBCardTableModRefBS@@QAEXPAPAVoopDesc@@H@Z) referenced in function "public: virtual void __thiscall G1SATBCardTableModRefBS::write_ref_array_pre(class oopDesc * *,int,bool)" (?write_ref_array_pre@G1SATBCardTableModRefBS@@UAEXPAPAVoopDesc@@H_N@Z)
g1SATBCardTableModRefBS.obj : error LNK2019: unresolved external symbol "public: void __thiscall G1SATBCardTableModRefBS::write_ref_array_pre_work<unsigned int>(unsigned int *,int)" (??$write_ref_array_pre_work@I@G1SATBCardTableModRefBS@@QAEXPAIH@Z) referenced in function "public: virtual void __thiscall G1SATBCardTableModRefBS::write_ref_array_pre(unsigned int *,int,bool)" (?write_ref_array_pre@G1SATBCardTableModRefBS@@UAEXPAIH_N@Z)
jvm.dll : fatal error LNK1120: 2 unresolved externals

Move the callers of the write_ref_array_work template to g1SATBCardTableModRefBS.cpp to avoid this problem.