Update Makefile.am output about libnuma not found
[lttng-ust.git] / liblttng-ust / lttng-ust-elf.c
index c9d2b6b3c406dcb33a8a39dfaab51af7dbe39917..a496841adb8804d6182ce901f52e9835828c5744 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <helper.h>
 #include <string.h>
 #include <lttng/align.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <stdbool.h>
 #include "lttng-tracer-core.h"
 
 #define BUF_LEN        4096
 
+#ifndef NT_GNU_BUILD_ID
+# define NT_GNU_BUILD_ID       3
+#endif
+
 /*
  * Retrieve the nth (where n is the `index` argument) phdr (program
  * header) from the given elf instance.
@@ -376,9 +382,9 @@ int lttng_ust_elf_get_memsz(struct lttng_ust_elf *elf, uint64_t *memsz)
                        goto next_loop;
                }
 
-               low_addr = phdr->p_vaddr < low_addr ? phdr->p_vaddr : low_addr;
-               high_addr = phdr->p_vaddr + phdr->p_memsz > high_addr ?
-                               phdr->p_vaddr + phdr->p_memsz : high_addr;
+               low_addr = min_t(uint64_t, low_addr, phdr->p_vaddr);
+               high_addr = max_t(uint64_t, high_addr,
+                               phdr->p_vaddr + phdr->p_memsz);
        next_loop:
                free(phdr);
        }
This page took 0.023988 seconds and 4 git commands to generate.