aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pe/pdb-syms1b.s
blob: 876757dea102ce37ecf94c6ce9e728ec9490fced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
.equ CV_SIGNATURE_C13, 4
.equ DEBUG_S_SYMBOLS, 0xf1

.equ T_VOID, 0x0003
.equ T_UQUAD, 0x0023
.equ T_UINT4, 0x0075

.equ LF_MODIFIER, 0x1001
.equ LF_POINTER, 0x1002
.equ LF_PROCEDURE, 0x1008
.equ LF_MFUNCTION, 0x1009
.equ LF_ARGLIST, 0x1201
.equ LF_FIELDLIST, 0x1203
.equ LF_CLASS, 0x1504
.equ LF_STRUCTURE, 0x1505
.equ LF_MEMBER, 0x150d
.equ LF_ONEMETHOD, 0x1511
.equ LF_FUNC_ID, 0x1601
.equ LF_MFUNC_ID, 0x1602

.equ LF_UQUADWORD, 0x800a

.equ S_END, 0x0006
.equ S_CONSTANT, 0x1107
.equ S_UDT, 0x1108
.equ S_LDATA32, 0x110c
.equ S_GDATA32, 0x110d
.equ S_LPROC32, 0x110f
.equ S_GPROC32, 0x1110
.equ S_LTHREAD32, 0x1112
.equ S_GTHREAD32, 0x1113
.equ S_LPROC32_ID, 0x1146
.equ S_GPROC32_ID, 0x1147
.equ S_PROC_ID_END, 0x114f

.equ CV_PTR_64, 0xc

.section ".debug$S", "rn"

.long CV_SIGNATURE_C13

.long DEBUG_S_SYMBOLS
.long .syms_end - .syms_start

.syms_start:

.ldata1:
.short .ldata1a - .ldata1 - 2
.short S_LDATA32
.long 0x1000 /* const uint32_t */
.secrel32 lvar1
.secidx lvar1
.asciz "lvar1"

.ldata1a: /* duplicate with same address */
.short .ldata1b - .ldata1a - 2
.short S_LDATA32
.long 0x1000 /* const uint32_t */
.secrel32 lvar1
.secidx lvar1
.asciz "lvar1"

.ldata1b: /* duplicate with different address */
.short .ldata2 - .ldata1b - 2
.short S_LDATA32
.long 0x1000 /* const uint32_t */
.secrel32 lvar1a
.secidx lvar1a
.asciz "lvar1"

.ldata2:
.short .gdata1 - .ldata2 - 2
.short S_LDATA32
.long 0x1000 /* const uint32_t */
.secrel32 lvar2
.secidx lvar2
.asciz "lvar2"

.gdata1:
.short .gdata2 - .gdata1 - 2
.short S_GDATA32
.long 0x1000 /* const uint32_t */
.secrel32 gvar1
.secidx gvar1
.asciz "gvar1"

.gdata2:
.short .gproc1 - .gdata2 - 2
.short S_GDATA32
.long 0x1000 /* const uint32_t */
.secrel32 gvar2
.secidx gvar2
.asciz "gvar2"

.gproc1:
.short .gproc1_end - .gproc1 - 2
.short S_GPROC32
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc1_end - proc1 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x1002 /* type */
.secrel32 proc1
.secidx proc1
.byte 0 /* flags */
.asciz "proc1"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.gproc1_end:
.short .gproc2 - .gproc1_end - 2
.short S_END

.gproc2:
.short .udt1 - .gproc2 - 2
.short S_GPROC32
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc2_end - proc2 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x1002 /* type */
.secrel32 proc2
.secidx proc2
.byte 0 /* flags */
.asciz "proc2"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.udt1:
.short .ldata3 - .udt1 - 2
.short S_UDT
.long 0x1011 /* struct bar */
.asciz "bar"

.ldata3:
.short .lthread1 - .ldata3 - 2
.short S_LDATA32
.long 0x1000 /* const uint32_t */
.secrel32 lvar3
.secidx lvar3
.asciz "lvar3"

.lthread1:
.short .gproc2_end - .lthread1 - 2
.short S_LTHREAD32
.long 0x1000 /* const uint32_t */
.secrel32 lvar4
.secidx lvar4
.asciz "lvar4"

.gproc2_end:
.short .gproc3 - .gproc2_end - 2
.short S_END

.gproc3:
.short .gproc3_end - .gproc3 - 2
.short S_LPROC32
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc3_end - proc3 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x1002 /* type */
.secrel32 proc3
.secidx proc3
.byte 0 /* flags */
.asciz "proc3"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.gproc3_end:
.short .gproc4 - .gproc3_end - 2
.short S_END

.gproc4:
.short .gproc4_end - .gproc4 - 2
.short S_LPROC32
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc4_end - proc4 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x1002 /* type */
.secrel32 proc4
.secidx proc4
.byte 0 /* flags */
.asciz "proc4"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.gproc4_end:
.short .gproc5 - .gproc4_end - 2
.short S_END

.gproc5:
.short .gproc5_end - .gproc5 - 2
.short S_GPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc5_end - proc5 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x1003 /* func ID */
.secrel32 proc5
.secidx proc5
.byte 0 /* flags */
.asciz "proc5"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.gproc5_end:
.short .gproc6 - .gproc5_end - 2
.short S_PROC_ID_END

.gproc6:
.short .gproc6_end - .gproc6 - 2
.short S_GPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc6_end - proc6 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x1004 /* func ID */
.secrel32 proc6
.secidx proc6
.byte 0 /* flags */
.asciz "proc6"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.gproc6_end:
.short .gproc7 - .gproc6_end - 2
.short S_PROC_ID_END

.gproc7:
.short .gproc7_end - .gproc7 - 2
.short S_GPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc7_end - proc7 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x100a /* func ID */
.secrel32 proc7
.secidx proc7
.byte 0 /* flags */
.asciz "foo::method"
.byte 0xf1 /* padding */

.gproc7_end:
.short .gproc8 - .gproc7_end - 2
.short S_PROC_ID_END

.gproc8:
.short .gproc8_end - .gproc8 - 2
.short S_GPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc8_end - proc8 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x100b /* func ID */
.secrel32 proc8
.secidx proc8
.byte 0 /* flags */
.asciz "foo::method2"

.gproc8_end:
.short .gproc9 - .gproc8_end - 2
.short S_PROC_ID_END

.gproc9:
.short .gproc9_end - .gproc9 - 2
.short S_LPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc9_end - proc9 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x100c /* func ID */
.secrel32 proc9
.secidx proc9
.byte 0 /* flags */
.asciz "proc9"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.gproc9_end:
.short .gproc10 - .gproc9_end - 2
.short S_PROC_ID_END

.gproc10:
.short .gproc10_end - .gproc10 - 2
.short S_GPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc10_end - proc10 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x100d /* func ID */
.secrel32 proc10
.secidx proc10
.byte 0 /* flags */
.asciz "proc10"
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.gproc10_end:
.short .gproc11 - .gproc10_end - 2
.short S_PROC_ID_END

.gproc11:
.short .gproc11_end - .gproc11 - 2
.short S_LPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc11_end - proc11 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x100e /* func ID */
.secrel32 proc11
.secidx proc11
.byte 0 /* flags */
.asciz "foo::method3"

.gproc11_end:
.short .gproc12 - .gproc11_end - 2
.short S_PROC_ID_END

.gproc12:
.short .gproc12_end - .gproc12 - 2
.short S_LPROC32_ID
.long 0 /* parent */
.long 0 /* end */
.long 0 /* next symbol */
.long .proc12_end - proc12 /* length */
.long 0 /* debug start offset */
.long 0 /* debug end offset */
.long 0x100f /* func ID */
.secrel32 proc12
.secidx proc12
.byte 0 /* flags */
.asciz "foo::method4"

.gproc12_end:
.short .udt2 - .gproc12_end - 2
.short S_PROC_ID_END

.udt2:
.short .constant1 - .udt2 - 2
.short S_UDT
.long 0x1009 /* class foo */
.asciz "foo"

.constant1:
.short .constant2 - .constant1 - 2
.short S_CONSTANT
.long T_UINT4
.short 42
.asciz "answer"
.byte 0xf3 /* padding */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.constant2:
.short .lthread2 - .constant2 - 2
.short S_CONSTANT
.long T_UQUAD
.short LF_UQUADWORD
.quad 0x0123456789abcdef
.asciz "answer2"
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.lthread2:
.short .lthread3 - .lthread2 - 2
.short S_LTHREAD32
.long 0x1000 /* const uint32_t */
.secrel32 lvar5
.secidx lvar5
.asciz "lvar5"

.lthread3:
.short .gthread1 - .lthread3 - 2
.short S_LTHREAD32
.long 0x1000 /* const uint32_t */
.secrel32 lvar6
.secidx lvar6
.asciz "lvar6"

.gthread1:
.short .gthread2 - .gthread1 - 2
.short S_GTHREAD32
.long 0x1000 /* const uint32_t */
.secrel32 gvar3
.secidx gvar3
.asciz "gvar3"

.gthread2:
.short .syms_end - .gthread2 - 2
.short S_GTHREAD32
.long 0x1000 /* const uint32_t */
.secrel32 gvar4
.secidx gvar4
.asciz "gvar4"

.p2align 2
.syms_end:

.section ".debug$T", "rn"

.long CV_SIGNATURE_C13

/* Type 1000, const uint32_t */
.mod1:
.short .arglist1 - .mod1 - 2
.short LF_MODIFIER
.long T_UINT4
.short 1 /* const */
.p2align 2

/* Type 1001, arglist (uint32_t) */
.arglist1:
.short .proctype1 - .arglist1 - 2
.short LF_ARGLIST
.long 1 /* no. entries */
.long T_UINT4

/* Type 1002, procedure (return type T_VOID, arglist 1001) */
.proctype1:
.short .funcid1 - .proctype1 - 2
.short LF_PROCEDURE
.long T_VOID
.byte 0 /* calling convention */
.byte 0 /* attributes */
.short 1 /* no. parameters */
.long 0x1001

/* Type 1003, func ID for proc5 */
.funcid1:
.short .funcid2 - .funcid1 - 2
.short LF_FUNC_ID
.long 0 /* parent scope */
.long 0x1002 /* type */
.asciz "proc5"
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

/* Type 1004, func ID for proc6 */
.funcid2:
.short .class1 - .funcid2 - 2
.short LF_FUNC_ID
.long 0 /* parent scope */
.long 0x1002 /* type */
.asciz "proc6"
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

/* Type 1005, forward declaration of class foo */
.class1:
.short .ptr1 - .class1 - 2
.short LF_CLASS
.short 0 /* no. members */
.short 0x80 /* property (forward declaration) */
.long 0 /* field list */
.long 0 /* type derived from */
.long 0 /* type of vshape table */
.short 0 /* size */
.asciz "foo" /* name */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

/* Type 1006, pointer to 1005 */
.ptr1:
.short .mfunction1 - .ptr1 - 2
.short LF_POINTER
.long 0x1005
.long (8 << 13) | CV_PTR_64

/* Type 1007, member function of 1005, return type void, arg list 1001 */
.mfunction1:
.short .fieldlist1 - .mfunction1 - 2
.short LF_MFUNCTION
.long T_VOID
.long 0x1005
.long 0x1006 /* type of "this" pointer */
.byte 0 /* calling convention */
.byte 0 /* attributes */
.short 1 /* no. parameters */
.long 0x1001 /* arg list */
.long 0 /* "this" adjustment */

/* Type 1008, field list for class foo */
.fieldlist1:
.short .class2 - .fieldlist1 - 2
.short LF_FIELDLIST
.short LF_ONEMETHOD
.short 0 /* method attribute */
.long 0x1007 /* method type */
.asciz "method"
.byte 0xf1 /* padding */
.short LF_ONEMETHOD
.short 0 /* method attribute */
.long 0x1007 /* method type */
.asciz "method2"
.short LF_ONEMETHOD
.short 0 /* method attribute */
.long 0x1007 /* method type */
.asciz "method3"
.short LF_ONEMETHOD
.short 0 /* method attribute */
.long 0x1007 /* method type */
.asciz "method4"

/* Type 1009, actual declaration of class foo */
.class2:
.short .mfunc1 - .class2 - 2
.short LF_CLASS
.short 0 /* no. members */
.short 0 /* property */
.long 0x1008 /* field list */
.long 0 /* type derived from */
.long 0 /* type of vshape table */
.short 0 /* size */
.asciz "foo" /* name */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

/* Type 100a, function "method" within class "foo" */
.mfunc1:
.short .mfunc2 - .mfunc1 - 2
.short LF_MFUNC_ID
.long 0x1009 /* parent class */
.long 0x1002 /* function type */
.asciz "method"
.byte 0xf1 /* padding */

/* Type 100b, function "method2" within class "foo" */
.mfunc2:
.short .funcid3 - .mfunc2 - 2
.short LF_MFUNC_ID
.long 0x1009 /* parent class */
.long 0x1002 /* function type */
.asciz "method2"

/* Type 100c, func ID for proc9 */
.funcid3:
.short .funcid4 - .funcid3 - 2
.short LF_FUNC_ID
.long 0 /* parent scope */
.long 0x1002 /* type */
.asciz "proc9"
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

/* Type 100d, func ID for proc10 */
.funcid4:
.short .mfunc3 - .funcid4 - 2
.short LF_FUNC_ID
.long 0 /* parent scope */
.long 0x1002 /* type */
.asciz "proc10"
.byte 0xf1 /* padding */

/* Type 100e, function "method3" within class "foo" */
.mfunc3:
.short .mfunc4 - .mfunc3 - 2
.short LF_MFUNC_ID
.long 0x1009 /* parent class */
.long 0x1002 /* function type */
.asciz "method3"

/* Type 100f, function "method4" within class "foo" */
.mfunc4:
.short .fieldlist2 - .mfunc4 - 2
.short LF_MFUNC_ID
.long 0x1009 /* parent class */
.long 0x1002 /* function type */
.asciz "method4"

/* Type 1010, field list for struct bar */
.fieldlist2:
.short .struct1 - .fieldlist2 - 2
.short LF_FIELDLIST
.short LF_MEMBER
.short 3 /* public */
.long T_UINT4
.short 0 /* offset */
.asciz "num1"
.byte 0xf1 /* padding */

/* Type 1011, declaration of struct bar */
.struct1:
.short .types_end - .struct1 - 2
.short LF_STRUCTURE
.short 1 /* no. members */
.short 0 /* property */
.long 0x1010 /* field list */
.long 0 /* type derived from */
.long 0 /* type of vshape table */
.short 4 /* size */
.asciz "bar" /* name */
.byte 0xf2 /* padding */
.byte 0xf1 /* padding */

.types_end:

.data

.long 0x12345678
.long 0x12345678

lvar1:
.long 42

lvar1a:
.long 0x12345678

lvar3:
.long 84

lvar4:
.long 85

.global gvar1
gvar1:
.long 43

.global gvar3
gvar3:
.long 41

lvar5:
.long 86

.text

.global main
main:
    .short 0
    .secrel32 .data

.global proc2
proc2:
    .byte 0
.proc2_end:

.global proc4
proc4:
    .byte 0
.proc4_end:

.global proc6
proc6:
    .byte 0
.proc6_end:

.global proc8
proc8:
    .byte 0
.proc8_end:

.global proc10
proc10:
    .byte 0
.proc10_end:

.global proc12
proc12:
    .byte 0
.proc12_end:

.section "gcsect"

lvar2:
.long 84

.global gvar2
gvar2:
.long 85

.global gvar4
gvar4:
.long 86

.global proc1
proc1:
    .byte 0
.proc1_end:

.global proc3
proc3:
    .byte 0
.proc3_end:

.global proc5
proc5:
    .byte 0
.proc5_end:

.global proc7
proc7:
    .byte 0
.proc7_end:

.global proc9
proc9:
    .byte 0
.proc9_end:

.global proc11
proc11:
    .byte 0
.proc11_end:

lvar6:
.long 86