@@ -6270,6 +6270,172 @@ pub const R_XTENSA_NDIFF8: u32 = 60;
6270
6270
pub const R_XTENSA_NDIFF16 : u32 = 61 ;
6271
6271
pub const R_XTENSA_NDIFF32 : u32 = 62 ;
6272
6272
6273
+ // E2K values for `FileHeader*::e_flags`.
6274
+ pub const EF_E2K_IPD : u32 = 3 ;
6275
+ pub const EF_E2K_X86APP : u32 = 4 ;
6276
+ pub const EF_E2K_4MB_PAGES : u32 = 8 ;
6277
+ pub const EF_E2K_INCOMPAT : u32 = 16 ;
6278
+ pub const EF_E2K_PM : u32 = 32 ;
6279
+ pub const EF_E2K_PACK_SEGMENTS : u32 = 64 ;
6280
+
6281
+ /// Encode `E_E2K_MACH_*` into `FileHeader*::e_flags`.
6282
+ pub const fn ef_e2k_mach_to_flag ( e_flags : u32 , x : u32 ) -> u32 {
6283
+ ( e_flags & 0xffffff ) | ( x << 24 )
6284
+ }
6285
+
6286
+ /// Decode `E_E2K_MACH_*` from `FileHeader*::e_flags`.
6287
+ pub const fn ef_e2k_flag_to_mach ( e_flags : u32 ) -> u32 {
6288
+ e_flags >> 24
6289
+ }
6290
+
6291
+ // Codes of supported E2K machines.
6292
+
6293
+ /// -march=generic code.
6294
+ ///
6295
+ /// Legacy. Shouldn't be created nowadays.
6296
+ pub const E_E2K_MACH_BASE : u32 = 0 ;
6297
+ /// -march=elbrus-v1 code.
6298
+ ///
6299
+ /// Legacy. Shouldn't be created nowadays.
6300
+ pub const E_E2K_MACH_EV1 : u32 = 1 ;
6301
+ /// -march=elbrus-v2 code.
6302
+ pub const E_E2K_MACH_EV2 : u32 = 2 ;
6303
+ /// -march=elbrus-v3 code.
6304
+ pub const E_E2K_MACH_EV3 : u32 = 3 ;
6305
+ /// -march=elbrus-v4 code.
6306
+ pub const E_E2K_MACH_EV4 : u32 = 4 ;
6307
+ /// -march=elbrus-v5 code.
6308
+ pub const E_E2K_MACH_EV5 : u32 = 5 ;
6309
+ /// -march=elbrus-v6 code.
6310
+ pub const E_E2K_MACH_EV6 : u32 = 6 ;
6311
+ /// -march=elbrus-v7 code.
6312
+ pub const E_E2K_MACH_EV7 : u32 = 7 ;
6313
+ /// -mtune=elbrus-8c code.
6314
+ pub const E_E2K_MACH_8C : u32 = 19 ;
6315
+ /// -mtune=elbrus-1c+ code.
6316
+ pub const E_E2K_MACH_1CPLUS : u32 = 20 ;
6317
+ /// -mtune=elbrus-12c code.
6318
+ pub const E_E2K_MACH_12C : u32 = 21 ;
6319
+ /// -mtune=elbrus-16c code.
6320
+ pub const E_E2K_MACH_16C : u32 = 22 ;
6321
+ /// -mtune=elbrus-2c3 code.
6322
+ pub const E_E2K_MACH_2C3 : u32 = 23 ;
6323
+ /// -mtune=elbrus-48c code.
6324
+ pub const E_E2K_MACH_48C : u32 = 24 ;
6325
+ /// -mtune=elbrus-8v7 code.
6326
+ pub const E_E2K_MACH_8V7 : u32 = 25 ;
6327
+
6328
+ // E2K values `Rel*::r_type`.
6329
+
6330
+ /// Direct 32 bit.
6331
+ pub const R_E2K_32_ABS : u32 = 0 ;
6332
+ /// PC relative 32 bit.
6333
+ pub const R_E2K_32_PC : u32 = 2 ;
6334
+ /// 32-bit offset of AP GOT entry.
6335
+ pub const R_E2K_AP_GOT : u32 = 3 ;
6336
+ /// 32-bit offset of PL GOT entry.
6337
+ pub const R_E2K_PL_GOT : u32 = 4 ;
6338
+ /// Create PLT entry.
6339
+ pub const R_E2K_32_JMP_SLOT : u32 = 8 ;
6340
+ /// Copy relocation, 32-bit case.
6341
+ pub const R_E2K_32_COPY : u32 = 9 ;
6342
+ /// Adjust by program base, 32-bit case.
6343
+ pub const R_E2K_32_RELATIVE : u32 = 10 ;
6344
+ /// Adjust indirectly by program base, 32-bit case.
6345
+ pub const R_E2K_32_IRELATIVE : u32 = 11 ;
6346
+ /// Size of symbol plus 32-bit addend.
6347
+ pub const R_E2K_32_SIZE : u32 = 12 ;
6348
+ /// Symbol value if resolved by the definition in the same
6349
+ /// compilation unit or NULL otherwise, 32-bit case.
6350
+ pub const R_E2K_32_DYNOPT : u32 = 13 ;
6351
+ /// Direct 64 bit.
6352
+ pub const R_E2K_64_ABS : u32 = 50 ;
6353
+ /// Direct 64 bit for literal.
6354
+ pub const R_E2K_64_ABS_LIT : u32 = 51 ;
6355
+ /// PC relative 64 bit for literal.
6356
+ pub const R_E2K_64_PC_LIT : u32 = 54 ;
6357
+ /// Create PLT entry, 64-bit case.
6358
+ pub const R_E2K_64_JMP_SLOT : u32 = 63 ;
6359
+ /// Copy relocation, 64-bit case.
6360
+ pub const R_E2K_64_COPY : u32 = 64 ;
6361
+ /// Adjust by program base, 64-bit case.
6362
+ pub const R_E2K_64_RELATIVE : u32 = 65 ;
6363
+ /// Adjust by program base for literal, 64-bit case.
6364
+ pub const R_E2K_64_RELATIVE_LIT : u32 = 66 ;
6365
+ /// Adjust indirectly by program base, 64-bit case.
6366
+ pub const R_E2K_64_IRELATIVE : u32 = 67 ;
6367
+ /// Size of symbol plus 64-bit addend.
6368
+ pub const R_E2K_64_SIZE : u32 = 68 ;
6369
+ /// 64-bit offset of the symbol from GOT.
6370
+ pub const R_E2K_64_GOTOFF : u32 = 69 ;
6371
+
6372
+ /// GOT entry for ID of module containing symbol.
6373
+ pub const R_E2K_TLS_GDMOD : u32 = 70 ;
6374
+ /// GOT entry for offset in module TLS block.
6375
+ pub const R_E2K_TLS_GDREL : u32 = 71 ;
6376
+ /// Static TLS block offset GOT entry.
6377
+ pub const R_E2K_TLS_IE : u32 = 74 ;
6378
+ /// Offset relative to static TLS block, 32-bit case.
6379
+ pub const R_E2K_32_TLS_LE : u32 = 75 ;
6380
+ /// Offset relative to static TLS block, 64-bit case.
6381
+ pub const R_E2K_64_TLS_LE : u32 = 76 ;
6382
+ /// ID of module containing symbol, 32-bit case.
6383
+ pub const R_E2K_TLS_32_DTPMOD : u32 = 80 ;
6384
+ /// Offset in module TLS block, 32-bit case.
6385
+ pub const R_E2K_TLS_32_DTPREL : u32 = 81 ;
6386
+ /// ID of module containing symbol, 64-bit case.
6387
+ pub const R_E2K_TLS_64_DTPMOD : u32 = 82 ;
6388
+ /// Offset in module TLS block, 64-bit case.
6389
+ pub const R_E2K_TLS_64_DTPREL : u32 = 83 ;
6390
+ /// Offset in static TLS block, 32-bit case.
6391
+ pub const R_E2K_TLS_32_TPREL : u32 = 84 ;
6392
+ /// Offset in static TLS block, 64-bit case.
6393
+ pub const R_E2K_TLS_64_TPREL : u32 = 85 ;
6394
+
6395
+ /// Direct AP.
6396
+ pub const R_E2K_AP : u32 = 100 ;
6397
+ /// Direct PL.
6398
+ pub const R_E2K_PL : u32 = 101 ;
6399
+
6400
+ /// 32-bit offset of the symbol's entry in GOT.
6401
+ pub const R_E2K_GOT : u32 = 108 ;
6402
+ /// 32-bit offset of the symbol from GOT.
6403
+ pub const R_E2K_GOTOFF : u32 = 109 ;
6404
+ /// PC relative 28 bit for DISP.
6405
+ pub const R_E2K_DISP : u32 = 110 ;
6406
+ /// Prefetch insn line containing the label (symbol).
6407
+ pub const R_E2K_PREF : u32 = 111 ;
6408
+ /// No reloc.
6409
+ pub const R_E2K_NONE : u32 = 112 ;
6410
+ /// 32-bit offset of the symbol's entry in .got.plt.
6411
+ pub const R_E2K_GOTPLT : u32 = 114 ;
6412
+ /// Is symbol resolved locally during the link.
6413
+ /// The result is encoded in 5-bit ALS.src1.
6414
+ pub const R_E2K_ISLOCAL : u32 = 115 ;
6415
+ /// Is symbol resloved locally during the link.
6416
+ /// The result is encoded in a long 32-bit LTS.
6417
+ pub const R_E2K_ISLOCAL32 : u32 = 118 ;
6418
+ /// The symbol's offset from GOT encoded within a 64-bit literal.
6419
+ pub const R_E2K_64_GOTOFF_LIT : u32 = 256 ;
6420
+ /// Symbol value if resolved by the definition in the same
6421
+ /// compilation unit or NULL otherwise, 64-bit case.
6422
+ pub const R_E2K_64_DYNOPT : u32 = 257 ;
6423
+ /// PC relative 64 bit in data.
6424
+ pub const R_E2K_64_PC : u32 = 258 ;
6425
+
6426
+ // E2K values for `Dyn32::d_tag`.
6427
+
6428
+ pub const DT_E2K_LAZY : u32 = DT_LOPROC + 1 ;
6429
+ pub const DT_E2K_LAZY_GOT : u32 = DT_LOPROC + 3 ;
6430
+
6431
+ pub const DT_E2K_INIT_GOT : u32 = DT_LOPROC + 0x101c ;
6432
+ pub const DT_E2K_EXPORT_PL : u32 = DT_LOPROC + 0x101d ;
6433
+ pub const DT_E2K_EXPORT_PLSZ : u32 = DT_LOPROC + 0x101e ;
6434
+ pub const DT_E2K_REAL_PLTGOT : u32 = DT_LOPROC + 0x101f ;
6435
+ pub const DT_E2K_NO_SELFINIT : u32 = DT_LOPROC + 0x1020 ;
6436
+
6437
+ pub const DT_E2K_NUM : u32 = 0x1021 ;
6438
+
6273
6439
#[ allow( non_upper_case_globals) ]
6274
6440
pub const Tag_File : u8 = 1 ;
6275
6441
#[ allow( non_upper_case_globals) ]
0 commit comments