@@ -252,7 +252,13 @@ func parseModuledata(fileInfo *FileInfo, f fileHandler) (moduledata, error) {
252
252
253
253
// Determine what kind of struct we need to extract the module data from the file.
254
254
255
- if GoVersionCompare ("go1.18beta1" , fileInfo .goversion .Name ) <= 0 {
255
+ if GoVersionCompare ("go1.20rc1" , fileInfo .goversion .Name ) <= 0 {
256
+ if is32bit {
257
+ buf = & moduledata2032 {}
258
+ } else {
259
+ buf = & moduledata2064 {}
260
+ }
261
+ } else if GoVersionCompare ("go1.18beta1" , fileInfo .goversion .Name ) <= 0 {
256
262
if is32bit {
257
263
buf = & moduledata1832 {}
258
264
} else {
@@ -402,7 +408,105 @@ func extractModFieldValue(md *moduledata, dst string, val reflect.Value, src str
402
408
Internal module structures from Go's runtime.
403
409
*/
404
410
405
- // Moduledata structure for Go 1.18 and newer
411
+ // Moduledata structure for Go 1.20 and newer
412
+
413
+ type moduledata2064 struct {
414
+ PcHeader uint64
415
+ Funcnametab , Funcnametablen , Funcnametabcap uint64
416
+ Cutab , Cutablen , Cutabcap uint64
417
+ Filetab , Filetablen , Filetabcap uint64
418
+ Pctab , Pctablen , Pctabcap uint64
419
+ Pclntable , Pclntablelen , Pclntablecap uint64
420
+ Ftab , Ftablen , Ftabcap uint64
421
+ Findfunctab uint64
422
+ Minpc , Maxpc uint64
423
+
424
+ Text , Etext uint64
425
+ Noptrdata , Enoptrdata uint64
426
+ Data , Edata uint64
427
+ Bss , Ebss uint64
428
+ Noptrbss , Enoptrbss uint64
429
+ Covctrs , Ecovctrs uint64
430
+ End , Gcdata , Gcbss uint64
431
+ Types , Etypes uint64
432
+ RData uint64
433
+ GoFunc uint64
434
+
435
+ Textsectmap , Textsectmaplen , Textsectmapcap uint64
436
+ Typelinks , Typelinkslen , Typelinkscap uint64 // offsets from types
437
+ Itablinks , Itablinkslen , Itablinkscap uint64
438
+
439
+ Ptab , Ptablen , Ptabcap uint64
440
+
441
+ Pluginpath , Pluginpathlen uint64
442
+ Pkghashes , Pkghasheslen , Pkghashescap uint64
443
+
444
+ Modulename , Modulenamelen uint64
445
+ Modulehashes , Modulehasheslen , Modulehashescap uint64
446
+
447
+ /* These fields we are not planning to use so skipping the parsing of them.
448
+
449
+ hasmain uint8 // 1 if module contains the main function, 0 otherwise
450
+
451
+ gcdatamask, gcbssmask bitvector
452
+
453
+ typemap map[typeOff]*_type // offset to *_rtype in previous module
454
+
455
+ bad bool // module failed to load and should be ignored
456
+
457
+ next *moduledata
458
+ */
459
+ }
460
+
461
+ type moduledata2032 struct {
462
+ PcHeader uint32
463
+ Funcnametab , Funcnametablen , Funcnametabcap uint32
464
+ Cutab , Cutablen , Cutabcap uint32
465
+ Filetab , Filetablen , Filetabcap uint32
466
+ Pctab , Pctablen , Pctabcap uint32
467
+ Pclntable , Pclntablelen , Pclntablecap uint32
468
+ Ftab , Ftablen , Ftabcap uint32
469
+ Findfunctab uint32
470
+ Minpc , Maxpc uint32
471
+
472
+ Text , Etext uint32
473
+ Noptrdata , Enoptrdata uint32
474
+ Data , Edata uint32
475
+ Bss , Ebss uint32
476
+ Noptrbss , Enoptrbss uint32
477
+ Covctrs , Ecovctrs uint32
478
+ End , Gcdata , Gcbss uint32
479
+ Types , Etypes uint32
480
+ RData uint32
481
+ GoFunc uint32
482
+
483
+ Textsectmap , Textsectmaplen , Textsectmapcap uint32
484
+ Typelinks , Typelinkslen , Typelinkscap uint32 // offsets from types
485
+ Itablinks , Itablinkslen , Itablinkscap uint32
486
+
487
+ Ptab , Ptablen , Ptabcap uint32
488
+
489
+ Pluginpath , Pluginpathlen uint32
490
+ Pkghashes , Pkghasheslen , Pkghashescap uint32
491
+
492
+ Modulename , Modulenamelen uint32
493
+ Modulehashes , Modulehasheslen , Modulehashescap uint32
494
+
495
+ /* These fields we are not planning to use so skipping the parsing of them.
496
+
497
+ hasmain uint8 // 1 if module contains the main function, 0 otherwise
498
+
499
+ gcdatamask, gcbssmask bitvector
500
+
501
+ typemap map[typeOff]*_type // offset to *_rtype in previous module
502
+
503
+ bad bool // module failed to load and should be ignored
504
+
505
+ next *moduledata
506
+ */
507
+ }
508
+
509
+ // Moduledata structure for Go 1.18 and Go 1.19
406
510
407
511
type moduledata1864 struct {
408
512
PcHeader uint64
0 commit comments