Fix: erroneous computation of ELF in-memory size
[lttng-ust.git] / include / lttng / ust-elf.h
index 6e9d99518dce20027b11e9a2ebf343a8dec42d25..c4abee2dbf1158717cbb0fd0e91485a155965bcf 100644 (file)
@@ -77,6 +77,7 @@
                bswap((phdr).p_filesz); \
                bswap((phdr).p_memsz);  \
                bswap((phdr).p_align);  \
+               bswap((phdr).p_vaddr);  \
        } while (0)
 
 #define bswap_shdr(shdr)                   \
                (dst_phdr).p_filesz = (src_phdr).p_filesz;      \
                (dst_phdr).p_memsz = (src_phdr).p_memsz;        \
                (dst_phdr).p_align = (src_phdr).p_align;        \
+               (dst_phdr).p_vaddr = (src_phdr).p_vaddr;        \
        } while (0)
 
 #define copy_shdr(src_shdr, dst_shdr)                                  \
@@ -172,6 +174,7 @@ struct lttng_ust_elf_phdr {
        uint64_t p_filesz;
        uint64_t p_memsz;
        uint64_t p_align;
+       uint64_t p_vaddr;
 };
 
 struct lttng_ust_elf_shdr {
@@ -219,6 +222,7 @@ int is_elf_native_endian(struct lttng_ust_elf *elf)
 
 struct lttng_ust_elf *lttng_ust_elf_create(const char *path);
 void lttng_ust_elf_destroy(struct lttng_ust_elf *elf);
+uint8_t lttng_ust_elf_is_pic(struct lttng_ust_elf *elf);
 int lttng_ust_elf_get_memsz(struct lttng_ust_elf *elf, uint64_t *memsz);
 int lttng_ust_elf_get_build_id(struct lttng_ust_elf *elf, uint8_t **build_id,
                        size_t *length, int *found);
This page took 0.026174 seconds and 4 git commands to generate.