diff --git a/compiler/src/dmd/backend/dcgcv.d b/compiler/src/dmd/backend/dcgcv.d index a1339a06532a..609228b431bc 100644 --- a/compiler/src/dmd/backend/dcgcv.d +++ b/compiler/src/dmd/backend/dcgcv.d @@ -1756,11 +1756,7 @@ private void cv4_outsym(Symbol* s) idx1 = DGROUPIDX; idx2 = SegData[s.Sseg].segidx; } - /* Because of the linker limitations, the length cannot - * exceed 0x1000. - * See optlink\cv\cvhashes.asm - */ - assert(length <= 0x1000); + if (idx2 != 0) { assert(0); @@ -1875,9 +1871,6 @@ private void cv4_func(Funcsym* s, ref symtab_t symtab) } static void endBlock() { - if (cntOpenBlocks-- >= 255) - return; // optlink does not like more than 255 scope blocks - __gshared ushort[2] endargs = [ 2, S_END ]; objmod.write_bytes(SegData[DEBSYM],endargs[]); } diff --git a/compiler/src/dmd/glue.d b/compiler/src/dmd/glue.d index 58f0e1ca9847..922998b00266 100644 --- a/compiler/src/dmd/glue.d +++ b/compiler/src/dmd/glue.d @@ -1345,16 +1345,7 @@ private void genObjFile(Module m, bool multiobj) if (!s.Sxtrnnum) { //printf("%s\n", s.Sident); -//#if 0 /* This should work, but causes optlink to fail in common/newlib.asm */ -// objextdef(s.Sident); -//#else - Symbol* sref = symbol_generate(SC.static_, type_fake(TYnptr)); - sref.Sfl = FL.data; - auto dtb = DtBuilder(0); - dtb.xoff(s, 0, TYnptr); - sref.Sdt = dtb.finish(); - outdata(sref); -//#endif + objextdef(s.Sident); } } } diff --git a/compiler/src/dmd/main.d b/compiler/src/dmd/main.d index 84497773df0e..b2f7dbf4a9a9 100644 --- a/compiler/src/dmd/main.d +++ b/compiler/src/dmd/main.d @@ -953,9 +953,6 @@ bool parseCommandlineAndConfig(size_t argc, const(char)** argv, out Param params bool isX86_64 = arch[0] == '6'; - version(Windows) // delete LIB entry in [Environment] (necessary for optlink) to allow inheriting environment for MS-COFF - environment.update("LIB", 3).value = null; - // read from DFLAGS in [Environment{arch}] section char[80] envsection = void; snprintf(envsection.ptr, envsection.length, "Environment%.*s", cast(int) arch.length, arch.ptr); diff --git a/compiler/src/dmd/toir.d b/compiler/src/dmd/toir.d index 2e3aa5de4e5b..7d1c11b85d30 100644 --- a/compiler/src/dmd/toir.d +++ b/compiler/src/dmd/toir.d @@ -1155,8 +1155,6 @@ void buildCapture(FuncDeclaration fd) { if (!driverParams.symdebug) return; - if (target.objectFormat() != Target.ObjectFormat.coff) // toDebugClosure only implemented for CodeView, - return; // but optlink crashes for negative field offsets if (fd.closureVars.length && !fd.needsClosure) {