Other values are \fI4\fP for Motorola 68000 (m68k)
and \fI20\fP for PowerPC.
.TP
+.BI \-f number
+Set the processor flags in the ELF header to \fInumber\fP.
+The default value is 0.
+.TP
.B \-v
Be verbose.
.PP
int bigendian = 0;
int elfabi = 3; /* abi = Linux */
int elfmachine = 3; /* machine = EM_386 */
+uint32_t elfflags = 0; /* elf processor flags */
/* Header and section table of an ack object file. */
switch (argv[1][1])
{
case 'a':
- elfabi = atoi(&argv[1][2]);
+ elfabi = strtoul(&argv[1][2], NULL, 0);
break;
case 'b':
break;
case 'm':
- elfmachine = atoi(&argv[1][2]);
+ elfmachine = strtoul(&argv[1][2], NULL, 0);
+ break;
+
+ case 'f':
+ elfflags = strtoul(&argv[1][2], NULL, 0);
break;
case 'v':
emit32(outsect[TEXT].os_base); /* entry point */
emit32(ELF_HEADER_SIZE); /* program header offset */
emit32(sh_offset); /* section header offset */
- emit32(0); /* flags */
+ emit32(elfflags); /* flags */
emit16(ELF_HEADER_SIZE); /* elf header size */
emit16(PROGRAM_HEADER_SIZE); /* program header entry size */
emit16(1); /* number of program header entries */