Add is_pic field to statedump soinfo event
[lttng-ust.git] / liblttng-ust / lttng-ust-elf.c
index e90626906b6ea72c24d19bbcd4a3b7cee92e0821..346545583c3a23b399b9a71911c59e5ded6bc387 100644 (file)
@@ -316,6 +316,18 @@ error:
        return NULL;
 }
 
+/*
+ * Test whether the ELF file is position independent code (PIC)
+ */
+uint8_t lttng_ust_elf_is_pic(struct lttng_ust_elf *elf)
+{
+       /*
+        * PIC has and e_type value of ET_DYN, see ELF specification
+        * version 1.1 p. 1-3.
+        */
+       return elf->ehdr->e_type == ET_DYN;
+}
+
 /*
  * Destroy the given lttng_ust_elf instance.
  */
This page took 0.023408 seconds and 4 git commands to generate.