/* sample program demonstrating use of the ELF AUX table on PowerPC Linux. */ #include #include #include int main(int argc, char *argv[], char *envp[], Elf32_auxv_t *aux_table) { Elf32_auxv_t *entry; for (entry = aux_table; entry->a_type != AT_NULL; entry++) { if (entry->a_type == AT_HWCAP) { if (entry->a_un.a_val & PPC_FEATURE_HAS_ALTIVEC) { printf("have Altivec\n"); } else { printf("don't have Altivec\n"); } break; } } return 0; }