// Interpreter
const char* interpreter;
+ // SONAME
+ const char* soname;
+
// GNU Build ID
char* build_id;
return self->interpreter;
}
+static int pakfire_elf_fetch_soname(struct pakfire_elf* self,
+ const GElf_Shdr* shdr, const GElf_Dyn* dyn, void* data) {
+ switch (dyn->d_tag) {
+ case DT_SONAME:
+ self->soname = elf_strptr(self->elf, shdr->sh_link, dyn->d_un.d_val);
+
+ return 1;
+ }
+
+ return 0;
+}
+
+const char* pakfire_elf_soname(struct pakfire_elf* self) {
+ int r;
+
+ // Fetch the SONAME if not available
+ if (!self->soname) {
+ r = pakfire_elf_dyn_walk(self, pakfire_elf_fetch_soname, NULL);
+ if (r < 0)
+ return NULL;
+ }
+
+ return self->soname;
+}
+
int pakfire_elf_is_pie(struct pakfire_elf* self) {
switch (pakfire_elf_type(self)) {
// Shared Object files are good
const char* pakfire_elf_build_id(struct pakfire_elf* self);
const char* pakfire_elf_debuglink(struct pakfire_elf* self);
const char* pakfire_elf_interpreter(struct pakfire_elf* elf);
+const char* pakfire_elf_soname(struct pakfire_elf* self);
int pakfire_elf_is_pie(struct pakfire_elf* self);
int pakfire_elf_has_ssp(struct pakfire_elf* self);