elfutils: bump to 0.165
[openwrt/openwrt.git] / package / libs / elfutils / patches / 100-musl-compat.patch
index 076b9cf83f64ed93da402b73c2a2acfa1117059d..25e15047a5b283c5c571f4e47677c45237c05da6 100644 (file)
  #include <gelf.h>
 --- a/src/ldlex.c
 +++ b/src/ldlex.c
-@@ -1099,7 +1099,7 @@ char *ldtext;
+@@ -1106,7 +1106,7 @@ char *ldtext;
  #include <assert.h>
  #include <ctype.h>
  #include <elf.h>
 +#include <err.h>
  #include <unistd.h>
  #include <dwarf.h>
- #include <sys/resource.h>
+ #ifdef __linux__
 --- a/tests/backtrace-data.c
 +++ b/tests/backtrace-data.c
 @@ -27,7 +27,7 @@
 +#include <err.h>
  #include <unistd.h>
  #include <dwarf.h>
- #include <sys/resource.h>
+ #if defined(__x86_64__) && defined(__linux__)
 --- a/tests/buildid.c
 +++ b/tests/buildid.c
 @@ -23,7 +23,7 @@
  #include <stdio.h>
 --- a/tests/ecp.c
 +++ b/tests/ecp.c
-@@ -16,7 +16,7 @@
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+@@ -20,7 +20,7 @@
+ #endif
  
  #include <errno.h>
 -#include <error.h>
  #include "sha1.h"
 --- a/tests/rdwrmmap.c
 +++ b/tests/rdwrmmap.c
-@@ -15,7 +15,7 @@
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+@@ -19,7 +19,7 @@
+ #endif
  
  #include <errno.h>
 -#include <error.h>
  #define _LIBELF_H 1
  
 +#include <fcntl.h>
+ #include <stdint.h>
  #include <sys/types.h>
  
- /* Get the ELF types.  */
 --- a/libasm/asm_end.c
 +++ b/libasm/asm_end.c
 @@ -32,7 +32,7 @@
  #include <stdlib.h>
 --- a/libcpu/i386_lex.c
 +++ b/libcpu/i386_lex.c
-@@ -571,7 +571,7 @@ char *i386_text;
+@@ -578,7 +578,7 @@ char *i386_text;
  #endif
  
  #include <ctype.h>
    for (subs = nodep->next; subs != NULL; subs = subs->next)
 --- a/libdwfl/dwfl_error.c
 +++ b/libdwfl/dwfl_error.c
-@@ -128,6 +128,7 @@ const char *
- dwfl_errmsg (error)
-      int error;
+@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
+ const char *
+ dwfl_errmsg (int error)
  {
 +  static __thread char s[64] = "";
    if (error == 0 || error == -1)
      {
        int last_error = global_error;
-@@ -142,7 +143,8 @@ dwfl_errmsg (error)
+@@ -154,7 +155,8 @@ dwfl_errmsg (int error)
    switch (error &~ 0xffff)
      {
      case OTHER_ERROR (ERRNO):
  typedef struct Dwfl Dwfl;
 --- a/libdwfl/find-debuginfo.c
 +++ b/libdwfl/find-debuginfo.c
-@@ -338,7 +338,7 @@ dwfl_standard_find_debuginfo (Dwfl_Modul
+@@ -372,7 +372,7 @@ dwfl_standard_find_debuginfo (Dwfl_Modul
        /* If FILE_NAME is a symlink, the debug file might be associated
         with the symlink target name instead.  */
  
                                     debuglink_file, debuglink_crc,
 --- a/libdwfl/dwfl_build_id_find_elf.c
 +++ b/libdwfl/dwfl_build_id_find_elf.c
-@@ -80,7 +80,7 @@ __libdwfl_open_by_build_id (Dwfl_Module
+@@ -94,7 +94,7 @@ __libdwfl_open_by_build_id (Dwfl_Module
        {
          if (*file_name != NULL)
            free (*file_name);
              *file_name = name;
 --- a/libelf/elf_getarsym.c
 +++ b/libelf/elf_getarsym.c
-@@ -284,7 +284,7 @@ elf_getarsym (elf, ptr)
-               arsym[cnt].as_off = file_data->u32[cnt];
+@@ -297,7 +297,7 @@ elf_getarsym (Elf *elf, size_t *ptr)
+               arsym[cnt].as_off = (*u32)[cnt];
  
              arsym[cnt].as_hash = _dl_elf_hash (str_data);
 -            str_data = rawmemchr (str_data, '\0') + 1;