0

I have an MSP430 ELF executable file whose e_flags field is 0x0000000E. I cannot find any documentation for e_flags for this architecture. The application note "MSP430 Embedded Application Binary Interface" from TI explicitly states:

There are no MSP430-specific flags for e_flags field.

I was hoping that these flags could help me identify whether the binary is contains instructions in the base MSP430 or the extended MSP430X ISA. Are they documented anywhere?

2
  • Do you know what compiler produced your file?
    – Igor Skochinsky
    Commented Sep 17, 2023 at 16:18
  • I don't see a lot of hints as to which compiler built it. I see the string "MSP430F148 FreeRTOS Demo program" and not much else. The symbols are consistent with FreeRTOS. Commented Sep 18, 2023 at 21:49

1 Answer 1

0

I could find this patch set with the comment:

/* Pre-uniarch versions of binutils stored machine types in the
 * e_flags field, with values up to 471 decimal.  Now we store the
 * machine type in the e_mach field, and use e_flags to identify the
 * characteristics of the code.
 *
 * Use the following flag to indicate that this object file uses the
 * uniarch flag layout. */
#define EF_MSP430_UNIARCH        0x10000000

#define EF_MSP430_ARCH_430       0x00000000
#define EF_MSP430_ARCH_430X      0x00000001
#define EF_MSP430_ARCH           0x000000FF
#if 0
/* These are symbol-associated, not archive-associated, attributes.
 * Not sure what to do with them. */
#define EF_MSP430_CPU_430        0x00000000
#define EF_MSP430_CPU_430X       0x00000200
#define EF_MSP430_CPU_430XV2     0x00000300
#define EF_MSP430_CPU            0x00000300
#define EF_MSP430_MPY_NONE       0x00000000
#define EF_MSP430_MPY_16         0x00001000
#define EF_MSP430_MPY_16_SE      (0x00008000 + EF_MSP430_MPY_16)
#define EF_MSP430_MPY_32         0x00002000
#define EF_MSP430_MPY_32_DW      (0x00008000 + EF_MSP430_MPY_32)
#define EF_MSP430_MPY_CLASS      0x00003000
#define EF_MSP430_MPY            0x0000F000
#define EF_MSP430_CODE_NEAR      0x00010000
#define EF_MSP430_CODE_FAR       0x00020000
#define EF_MSP430_CODE_MIXED     0x00030000
#define EF_MSP430_CODE           0x00030000
#define EF_MSP430_DATA_NEAR      0x00040000
#define EF_MSP430_DATA_FAR       0x00080000
#define EF_MSP430_DATA_MIXED     0x000c0000
#define EF_MSP430_DATA           0x000c0000
#define EF_MSP430_A20            0x000F0000
#endif

And apparrently an older version:

/* Processor specific flags for the ELF header e_flags field.  */
#define EF_MSP430_MACH      0xff

#define E_MSP430_MACH_MSP430x11  11
#define E_MSP430_MACH_MSP430x11x1  110
#define E_MSP430_MACH_MSP430x12  12
#define E_MSP430_MACH_MSP430x13  13
#define E_MSP430_MACH_MSP430x14  14
#define E_MSP430_MACH_MSP430x15  15
#define E_MSP430_MACH_MSP430x16  16
#define E_MSP430_MACH_MSP430x31  31
#define E_MSP430_MACH_MSP430x32  32
#define E_MSP430_MACH_MSP430x33  33
#define E_MSP430_MACH_MSP430x41  41
#define E_MSP430_MACH_MSP430x42  42
#define E_MSP430_MACH_MSP430x43  43
#define E_MSP430_MACH_MSP430x44  44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.