Skip to content

Commit 640341d

Browse files
committed
Initial 2
1 parent ed80584 commit 640341d

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

compiler/src/dmd/backend/mscoffobj.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,11 @@ void MsCoffObj_term(const(char)[] objfilename)
667667
hashBuf.write(pseg.SDbuf.buf[0 .. pseg.SDbuf.length()]);
668668
}
669669
}
670-
670+
671671
// Calculate the hash based on all sections
672672
if (hashBuf.length > 0)
673673
f_timedat = calcHash(hashBuf.buf[0 .. hashBuf.length]);
674-
674+
675675
// Add fixed value to make the hash recognizable (timestamp starts from 1970)
676676
f_timedat = (f_timedat & 0x7FFFFFFF) | 0x40000000; // Make sure it's a reasonable timestamp
677677
uint symtable_offset;

compiler/src/dmd/lib/elf.d

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,16 +305,16 @@ final class LibElf : Library
305305
static assert(0, "unsupported operating system");
306306

307307
time_t file_time = 0;
308-
308+
309309
// Use deterministic timestamp instead of current time
310310
import dmd.root.hash : calcHash;
311311
// Create a hash from the object module content
312312
if (om.base && om.length > 0)
313313
file_time = calcHash(om.base[0 .. om.length]);
314-
314+
315315
// Add fixed value to make the hash recognizable (start from 1970s)
316316
file_time = (file_time & 0x7FFFFFFF) | 0x40000000;
317-
317+
318318
om.file_time = cast(long)file_time;
319319
om.file_mode = (1 << 15) | (6 << 6) | (4 << 3) | (4 << 0); // 0100644
320320
}
@@ -443,31 +443,31 @@ private:
443443
om.length = cast(uint)(hoffset - (8 + ElfLibHeader.sizeof));
444444
om.offset = 8;
445445
om.name = "";
446-
446+
447447
// Use deterministic timestamp instead of current time
448448
// Calculate a hash based on library contents
449449
import dmd.root.hash : calcHash;
450-
450+
451451
// Collect all symbol and module data in a buffer
452452
OutBuffer hashBuf;
453453
foreach (os; objsymbols)
454454
{
455455
// Add symbol names to the buffer
456456
hashBuf.writestring(os.name);
457-
457+
458458
// Add module content to the buffer if available
459459
if (os.om && os.om.base && os.om.length > 0)
460460
hashBuf.write(os.om.base[0 .. os.om.length]);
461461
}
462-
462+
463463
// Calculate the hash from the buffer
464464
om.file_time = 0;
465465
if (hashBuf.length > 0)
466466
om.file_time = calcHash(hashBuf.buf[0 .. hashBuf.length]);
467-
467+
468468
// Add fixed value to make the hash recognizable (start from 1970s)
469469
om.file_time = (om.file_time & 0x7FFFFFFF) | 0x40000000;
470-
470+
471471
om.user_id = 0;
472472
om.group_id = 0;
473473
om.file_mode = 0;

compiler/src/dmd/lib/mach.d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ final class LibMach : Library
265265
time_t file_time = 0;
266266
if (om.base && om.length > 0)
267267
file_time = calcHash(om.base[0 .. om.length]);
268-
268+
269269
// Add fixed value to make the hash recognizable (start from 1970s)
270270
file_time = (file_time & 0x7FFFFFFF) | 0x40000000;
271-
271+
272272
om.file_time = file_time;
273273
om.file_mode = (1 << 15) | (6 << 6) | (4 << 3) | (4 << 0); // 0100644
274274
}
@@ -405,28 +405,28 @@ private:
405405
om.length = cast(uint)(hoffset - (8 + MachLibHeader.sizeof));
406406
om.offset = 8;
407407
om.name = "";
408-
408+
409409
// Use deterministic timestamp instead of current time
410410
// Calculate a hash based on library contents
411411
import dmd.root.hash : calcHash;
412-
412+
413413
// Collect all symbol and module data in a buffer
414414
OutBuffer hashBuf;
415415
foreach (os; objsymbols)
416416
{
417417
// Add symbol names to the buffer
418418
hashBuf.writestring(os.name);
419-
419+
420420
// Add module content to the buffer if available
421421
if (os.om && os.om.base && os.om.length > 0)
422422
hashBuf.write(os.om.base[0 .. os.om.length]);
423423
}
424-
424+
425425
// Calculate the hash from the buffer
426426
om.file_time = 0;
427427
if (hashBuf.length > 0)
428428
om.file_time = calcHash(hashBuf.buf[0 .. hashBuf.length]);
429-
429+
430430
// Add fixed value to make the hash recognizable (start from 1970s)
431431
om.file_time = (om.file_time & 0x7FFFFFFF) | 0x40000000;
432432

compiler/src/dmd/lib/mscoff.d

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ final class LibMSCoff : Library
367367
time_t file_time = 0;
368368
if (om.base && om.length > 0)
369369
file_time = calcHash(om.base[0 .. om.length]);
370-
370+
371371
// Add fixed value to make the hash recognizable (start from 1970s)
372372
file_time = (file_time & 0x7FFFFFFF) | 0x40000000;
373-
373+
374374
om.file_time = cast(long)file_time;
375375
om.file_mode = (1 << 15) | (6 << 6) | (4 << 3) | (4 << 0); // 0100644
376376
}
@@ -502,31 +502,31 @@ private:
502502
om.length = cast(uint)(4 + objsymbols.length * 4 + slength);
503503
om.offset = 8;
504504
om.name = "";
505-
505+
506506
// Use deterministic timestamp instead of current time
507507
// Calculate a hash based on library contents
508508
import dmd.root.hash : calcHash;
509-
509+
510510
// Collect all symbol and module data in a buffer
511511
OutBuffer hashBuf;
512512
foreach (os; objsymbols)
513513
{
514514
// Add symbol names to the buffer
515515
hashBuf.writestring(os.name);
516-
516+
517517
// Add module content to the buffer if available
518518
if (os.om && os.om.base && os.om.length > 0)
519519
hashBuf.write(os.om.base[0 .. os.om.length]);
520520
}
521-
521+
522522
// Calculate the hash from the buffer
523523
om.file_time = 0;
524524
if (hashBuf.length > 0)
525525
om.file_time = calcHash(hashBuf.buf[0 .. hashBuf.length]);
526-
526+
527527
// Add fixed value to make the hash recognizable (start from 1970s)
528528
om.file_time = (om.file_time & 0x7FFFFFFF) | 0x40000000;
529-
529+
530530
om.user_id = 0;
531531
om.group_id = 0;
532532
om.file_mode = 0;

0 commit comments

Comments
 (0)