X-Git-Url: https://git.wh0rd.org/?p=ICEs.git;a=blobdiff_plain;f=bfin-text-sect-attrs%2Fldso.i;fp=bfin-text-sect-attrs%2Fldso.i;h=f6ff13ad57e826e9c984f21dd72804e2f1a533c5;hp=0000000000000000000000000000000000000000;hb=bd3239d2bbe0de3a200b266503e3330b1e391489;hpb=dbff64cb4b7530861c2309c794efdd4e0cf47a23 diff --git a/bfin-text-sect-attrs/ldso.i b/bfin-text-sect-attrs/ldso.i new file mode 100644 index 0000000..f6ff13a --- /dev/null +++ b/bfin-text-sect-attrs/ldso.i @@ -0,0 +1,37 @@ +typedef unsigned int uint32_t; +typedef uint32_t Elf32_Addr; +typedef struct { + unsigned char e_ident[(16)]; +} Elf32_Ehdr; +typedef struct { +} Elf32_Dyn; +static void + __attribute__ ((used)) _dl_start(Elf32_Addr dl_boot_got_pointer, + struct elf32_fdpic_loadmap + *dl_boot_progmap, + struct elf32_fdpic_loadmap + *dl_boot_ldsomap, + Elf32_Dyn * dl_boot_ldso_dyn_pointer, + struct funcdesc_value *dl_main_funcdesc, + unsigned long args) +{ + Elf32_Ehdr *header; + uint32_t *p32; + if (!header || header->e_ident[4] != 1 || header->e_ident[6] != 1 + || *(p32 = + (uint32_t *) & header->e_ident) != + ((uint32_t) (0x7f + 0x100 * ('E' + (0x100 * ('L' + 0x100 * 'F')))))) + { + do { + static const char + __attribute__ ((section(".text"))) __s[] = + ("Invalid ELF header\n"); + { + int __t; + for (__t = 0; __t < 0x1000000; __t++) + __asm__ __volatile__(""); + } + } + while (0); + } +}