static void elf32jmp(Putl putl) { /* describe a tiny text section at end with jmp to start; see below */ elf32phdr(putl, PT_LOAD, HEADR+textsize-JMPSZ, 0xFFFFFFFC, 0xFFFFFFFC, JMPSZ, JMPSZ, R|X, 0); /* text */ }
uint32 elfwritephdrs(void) { int i; if (elf64) { for (i = 0; i < hdr.phnum; i++) elf64phdr(phdr[i]); return hdr.phnum * ELF64PHDRSIZE; } for (i = 0; i < hdr.phnum; i++) elf32phdr(phdr[i]); return hdr.phnum * ELF32PHDRSIZE; }