summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* libdw: Fix eu_search_tree TOCTOU bugsAaron Merey2025-06-021-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eu_tfind is used to facilitate lazy loading throughout libdw. If a result is not found via eu_tfind, work is done to load the result and cache it in an eu_search_tree. Some calls to eu_tfind allow for TOCTOU bugs. Multiple threads might race to call eu_tfind on some result that hasn't yet been cached. Multiple threads may then attempt to load the result which might cause an unnecessary amount of memory to be allocated. Additionally this memory may not get released when the associated libdw data structure is freed. Fix this by adding additional locking to ensure that only one thread performs lazy loading. One approach used in this patch is to preserve calls to eu_tfind without additional locking, but when the result isn't found then a lock is then used to synchronize access to the lazy loading code. An extra eu_tfind call has been added at the start of these critical section to synchronize verification that lazy loading should proceed. Another approach used is to simply synchronize entire calls to functions where lazy loading via eu_tfind might occur (__libdw_find_fde and __libdw_intern_expression). In this case, new _nolock variants of the eu_t* functions are used to avoid unnecessary double locking. lib/ * eu-search.c: Add eu_tsearch_nolock, eu_tfind_nolock and eu_tdelete_nolock functions. * eu-search.h: Ditto. libdw/ * cfi.h (struct Dwarf_CFI_s): Declare new mutex. * dwarf_begin_elf.c (valid_p): Initialize all locks for fake CUs. * dwarf_cfi_addrframe.c (dwarf_cfi_addrframe): Place lock around __libdw_find_fde. * dwarf_end.c (cu_free): Deallocate all locks unconditionally, whether or not the CU is fake. * dwarf_frame_cfa.c (dwarf_frame_cfa): Place lock around __libdw_intern_expression. * dwarf_frame_register.c (dwarf_frame_register): Ditto. * dwarf_getcfi.c (dwarf_getcfi): Initialize cfi lock. * dwarf_getlocation.c (is_constant_offset): Synchronize access to lazy loading section. (getlocation): Place lock around __libdw_intern_expression. * dwarf_getmacros.c (cache_op_table): Synchronize access to lazy loading section. * frame-cache.c (__libdw_destroy_frame_cache): Free Dwarf_CFI mutex. * libdwP.h (struct Dwarf): Update macro_lock comment. (struct Dwarf_CU): Declare new mutex. libdw_findcu.c (__libdw_intern_next_unit): Initialize intern_lock. (__libdw_findcu): Adjust locking so that the first eu_tfind can be done without extra lock overhead. Signed-off-by: Aaron Merey <[email protected]>
* Prepare for 0.193elfutils-0.193Aaron Merey2025-04-251-1/+1
| | | | | | | | Set version to 0.193. Update NEWS, elftuils.spec.in and lib/printversion.c. Regenerate po/*.po files. Signed-off-by: Aaron Merey <[email protected]>
* lib: Prevent double inclusion of config.h through system.hMark Wielaard2025-04-063-3/+10
| | | | | | | | | | | | | | Files that include both <config.h> and "system.h" might include config.h twice. Prevent that by adding a guard check in system.h before including config.h. * lib/crc32.c: Use #ifdef HAVE_CONFIG_H instead of #if. * lib/error.h: Check HAVE_CONFIG_H before including config.h. * lib/system.h: Check both HAVE_CONFIG_H and whether EU_CONFIG_H is defined before including config.h. Suggested-by: Dmitry V. Levin <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Change type of dwarf_lock from rwlock to mutexAaron Merey2025-03-261-0/+16
| | | | | | | | | | | | | | | | | Change type of dwarf_lock to mutex in order to take advantage of built-in support for recursive locking. * lib/locks.h: Add macros for locking, unlocking, initializing and destroying mutexes. * libdw/dwarf_begin_elf.c (dwarf_end): Replace rwlock macro with mutex macro. * libdw/dwarf_formref_die.c (dwarf_formref_die): Ditto. * libdw/dwarf_getalt.c (dwarf_getalt): Ditto. * libdw/dwarf_setalt.c (dwarf_setalt): Ditto. * libdw/libdwP.h (struct Dwarf): Ditto. * libdw/libdw_findcu.c (__libdw_findcu): Ditto. Signed-off-by: Aaron Merey <[email protected]>
* libelf, readelf: Use validate_str also to check dynamic symstr dataMark Wielaard2025-02-141-0/+27
| | | | | | | | | | | | | | | | | | When dynsym/str was read through eu-readelf --dynamic by readelf process_symtab the string data was not validated, possibly printing unallocated memory past the end of the symstr data. Fix this by turning the elf_strptr validate_str function into a generic lib/system.h helper function and use it in readelf to validate the strings before use. * libelf/elf_strptr.c (validate_str): Remove to... * lib/system.h (validate_str): ... here. Make inline, simplify check and document. * src/readelf.c (process_symtab): Use validate_str on symstr_data. https://sourceware.org/bugzilla/show_bug.cgi?id=32654 Signed-off-by: Mark Wielaard <[email protected]>
* Replace usage of ar with stored library manifest filesMichael Pratt2025-01-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ar program is called to assemble a list of objects within each archive to assist in building combined libraries, however make already has this information when processing the subdirectory for that respective library. The list can be saved in a "manifest" file instead of being generated whenever it is needed for use with other subdirectories. Even though the difference in time is insignificant, a simple "echo" and "cat" is as much as 10 times faster than a call to "ar t" for printing the archive members. Since elfutils builds ar, this also removes the awkward circular dependency where an installation of ar is required to build the libraries for ar. Additionally, not every version of ar is equally portable, as native versions of ar on macOS and other BSD-like distributions may print out a special archive member like "__.SYMDEF" which is not a compiled object but rather just metadata from ranlib, leading to a build failure. Avoid these limitations by removing usage of ar and adding build and clean rules for the usage of archive manifest files. * .gitignore: exclude ".manifest" file extension. * backends/Makefile.am: add manifest file build and clean rules. * debuginfod/Makefile.am: Likewise. * lib/Makefile.am: Likewise. * libasm/Makefile.am: Likewise. * libcpu/Makefile.am: Likewise. * libdw/Makefile.am: Likewise, and set object lists to manifest contents. * libdwelf/Makefile.am: Likewise. * libdwfl/Makefile.am: Likewise. * libebl/Makefile.am: Likewise. * libelf/Makefile.am: Likewise, and set object lists to manifest contents. * src/Makefile.am: Likewise. Signed-off-by: Michael Pratt <[email protected]>
* Update minimum C compiler supported to C11 plus stdatomic.hMark Wielaard2025-01-114-481/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using a somewhat odd mix of gnu99 with a fallback atomics.h so we could build with gcc 4.7. Lets requires a compiler that can do at least C11 and has a stdatomic.h. So we can build against any C standard >= C11 (including C17 and C23). That means GCC 4.9+. GCC 4.9 was released in 2014. The lowest compiler version we check in the buildbots is currently GCC 8.3.0 (Debian old old stable, released in 2018). Also update the minimum autoconf version to 2.69. We would really like 2.70+ so we don't need the gnulib gnu11.m4. But 2.69 still seems in use on various stable systems. autoconf 2.70 was released end of 2020, autoconf 2.69 in 2012. * configure.ac (AC_PACKAGE_URL): Removed workaround for autoconf < 2.64. (AC_PREREQ): Update from 2.63 to 2.69. (AC_PROG_CC): Test for ac_cv_prog_cc_c11. (AC_CACHE_CHECK for stdatomic.h * config/eu.am (AM_CFLAGS): Remove -std=gnu99. * lib/Makefile.am (noinst_HEADERS): Remove atomics.h and stdatomic-fbsd.h. * lib/atomics.h: Removed. * lib/stdatomic-fbsd.h: Removed. * lib/dynamicsizehash_concurrent.h: Include stdatomic.h. * libdw/libdw_alloc.c: Likewise. * m4/.gitignore: Add !/std-gnu11.m4. * m4/std-gnu11.m4: New file from gnulib to provide AC_PROG_CC from autoconf 2.70. Signed-off-by: Mark Wielaard <[email protected]>
* Consolidate and add files to clean target variablesupstream/users/amerey/try-cleanMichael Pratt2024-11-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | To increase the consistency of how automatic clean targets run, define the variables together without +=, default to MOSTLYCLEANFILES when there is no need for different levels or add more clean levels to match other subdirectories, add more files that are built, remove duplication, and cleanup. Do the same for EXTRA_DIST where it is equally messy. * backends/Makefile.am: add more objects to clean, improve spacing. * debuginfod/Makefile.am: Likewise, and remove duplicates. * lib/Makefile.am: improve spacing. * libasm/Makefile.am: add more objects to clean, split similar to debuginfod. * libcpu/Makefile.am: use normal =, add more objects to clean. * libdw/Makefile.am: add more objects to clean, split similar to debuginfod. * libdwelf/Makefile.am: add more objects to clean, use lowest clean level. * libdwfl/Makefile.am: Likewise. * libebl/Makefile.am: add more objects to clean. * libelf/Makefile.am: add more objects to clean, split similar to debuginfod. * src/Makefile.am: consolidate including EXTRA_DIST, split clean levels, define with normal =, define with variables. * tests/Makefile.am: Likewise, but not including EXTRA_DIST. Signed-off-by: Michael Pratt <[email protected]>
* lib: Add missing config.h include to next_prime.cMichael Pratt2024-10-141-0/+4
| | | | | | | | | | This is the last remaining C source file as of this commit without the standard conditional inclusion of config.h as the very first header. * lib/next_prime.c: add missing config.h header. Signed-off-by: Michael Pratt <[email protected]>
* lib: Add eu_tsearch, eu_tfind, eu_tdelete and eu_tdestroyHeather McIntyre2024-08-205-31/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add struct search_tree to hold tree root and lock. Add new eu_t* functions for ensuring synchronized tree access. Replace tsearch, tfind, etc with eu_t* equivalents. lib: * Makefile.am (libeu_a_SOURCES): Add eu-search.c. (noinst_HEADERS): Add eu-search.h and locks.h. * eu-config.h: Move rwlock macros to locks.h. * eu-search.c: New file containing tree search functions with locking. * eu-search.h: New file. * locks.h: New file containing rwlock macros previously in eu-config.h. libdw: * cfi.h (struct Dwarf_CFI_s): Change type of search tree members from void * to search_tree. * cie.c: Replace tree search functions with eu-search equivalents. * dwarf_begin_elf.c (valid_p): Initialize search trees. * dwarf_end.c (cu_free): Replace tree search functions with eu-search equivalents. * dwarf_getcfi.c (dwarf_getcfi): Initialize search trees. * dwarf_getlocations.c: Replace search tree functions with eu-search equivalents. (__libdw_intern_expression): Change type of cache parameter to search_tree *. * dwarf_getmacros.c: Replace tree search functions with eu-search equivalents. * dwarf_getsrclines.c: Ditto. * fde.c: Ditto. * frame-cache.c (__libdw_destroy_frame_cache): Initialize search trees. * libdwP.h (struct Dwarf): Change type of search tree members from void * to search_tree. (struct Dwarf_CU): Ditto. (__libdw_intern_expression): Change type of cache parameter to search_tree *. * libdw_find_split_unit.c: Replace tree search functions with eu-search equivalents. * libdw_findcu.c: Ditto. libdwfl: * cu.c: Ditto. * libdwflP.h (struct Dwfl_Module): Replace void *lazy_cu_root with search_tree lazy_cu_tree. libelf: * elf_begin.c (file_read_elf): Initialize rawchunck_tree. * elf_end.c (elf_end): Replace tree search function with eu-search equivalent. * elf_getdata_rawchunck.c: Ditto. * libelfP.h (struct Elf): Replace void * rawchuncks member with search_tree rawchunk_tree. Signed-off-by: Heather S. McIntyre <[email protected]> Signed-off-by: Aaron Merey <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Prepare for 0.191elfutils-0.191Aaron Merey2024-03-011-1/+1
| | | | | | | | Set version to 0.191 Update NEWS, elfutils.spec.in and printversion.c. Regenerate po/*.po files. Signed-off-by: Aaron Merey <[email protected]>
* Add helper function for basenameKhem Raj2023-12-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | musl does not provide GNU version of basename and lately have removed the definiton from string.h [1] which exposes this problem. It can be made to work by providing a local implementation of basename which implements the GNU basename behavior, this makes it work across C libraries which have POSIX implementation only. [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 * lib/system.h (xbasename): New static inline functions. Poison basename. * libdw/dwarf_getsrc_file.c (dwarf_getsrc_file): Use xbasename. * libdwfl/core-file.c (dwfl_core_file_report): Likewise. * libdwfl/dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Likewise. * libdwfl/dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise. * libdwfl/find-debuginfo.c (find_debuginfo_in_path): Likewise. * libdwfl/link_map.c (report_r_debug): Likewise. * libdwfl/linux-kernel-modules.c (try_kernel_name): Likewise. * src/addr2line.c (print_dwarf_function): Likewise. (print_src): Likewise. * src/ar.c (do_oper_insert): Likewise. And cast away const in entry.key assignment. * src/nm.c (show_symbols): Use xbasename. * src/stack.c (module_callback): Likewise. * src/strip.c (handle_elf): Likewise. * tests/show-die-info.c: Include system.h. (dwarf_tag_string): Use xbasename. * tests/varlocs.c: Likewise. * debuginfod/debuginfod.cxx: Move include system.h to the end. (register_file_name): Rename basename to filename. Signed-off-by: Khem Raj <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* PR 30000: debuginfod-find should have a source-list verbHousam Alamour2023-10-241-0/+7
| | | | | | | | | | | | | | | | | | * seclines.cxx: Introduce new tool that compiles a list of source files associated with a specified dwarf/elf file. This compilation relies on searching the dwarf debug information, which can be automatically retrieved via debuginfod using libdwfl functions when required. The target file can encompass various types, such as an executable, a coredump, a running process, or the currently executing kernel. The source file names are rendered as unique entries and then displayed on the standard output. * run-srcfiles-self.sh: New test-case for tool. https://sourceware.org/bugzilla/show_bug.cgi?id=30000 Signed-off-by: Housam Alamour <[email protected]>
* lib: Add new once_define and once macros to eu-config.hHeather McIntyre2023-10-141-0/+7
| | | | | | | | * lib/eu-config.h New macros. [USE_LOCKS] (ONCE_CALL): (once_define, once) Signed-off-by: Heather S. McIntyre <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Prepare for 0.189elfutils-0.189Mark Wielaard2023-03-031-1/+1
| | | | | | | | | Set version to 0.189 Update NEWS and elfutils.spec.in Set copyright year in configure.ac and printversion. Regenerate po/*.po files. Signed-off-by: Mark Wielaard <[email protected]>
* printversion: Fix unused variableIlya Leoshkevich2023-02-141-1/+4
| | | | | | | | | | | | | | | | | | clang complains: debuginfod.cxx:354:1: error: unused variable 'apba__' [-Werror,-Wunused-const-variable] ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT; ^ ../lib/printversion.h:47:21: note: expanded from macro 'ARGP_PROGRAM_BUG_ADDRESS_DEF' const char *const apba__ __asm ("argp_program_bug_address") ^ The default linkage for consts in C++ is internal, so declare them extern. While at it, remove the debuginfod workaround for argp_program_version_hook. Co-developed-by: Mark Wielaard <[email protected]> Signed-off-by: Ilya Leoshkevich <[email protected]>
* Fix typos from codespellSam James2023-01-132-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debuginfod/ChangeLog: * debuginfod-client.c: Typo simultaniously. doc/ChangeLog: * debuginfod.8: Typo succesfully. lib/ChangeLog: * dynamicsizehash_concurrent.c: Typo modul. * system.h: Typo dependend. libdwfl/ChangeLog: * open.c: Typo non-existant. src/ChangeLog: * nm.c: Typo Covert. * strings.c: Likewise. tests/ChangeLog: * elfstrmerge.c: Typo outselves. * run-debuginfod-extraction.sh: Typo accidentially. * run-debuginfod-fd-prefetch-caches.sh: Likewise. Signed-off-by: Sam James <[email protected]>
* lib: Remove -ffunction-sections for xmallocMark Wielaard2022-12-212-4/+4
| | | | | | The build used -ffunction-sections just for one file. Signed-off-by: Mark Wielaard <[email protected]>
* lib{asm,cpu,dw,dwfl,dwelf}: Move platform depended include into system.hYonggang Luo2022-10-282-1/+4
| | | | Signed-off-by: Yonggang Luo <[email protected]>
* Strip __ prefix from __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIANYonggang Luo2022-10-172-2/+6
| | | | | | | | __BYTE_ORDER, __LITTLE_ENDIAN and __BIG_ENDIAN are defined by the gcc/clang preprocessor. BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN are defined in <endian.h>. Signed-off-by: Yonggang Luo <[email protected]>
* Move the #include <libintl.h> into eu-config.hYonggang Luo2022-10-165-4/+1
| | | | | | | | | | So we do not need include in each file. And indeed the macro #define _(Str) dgettext ("elfutils", Str) access libintl function dgettext, so it's make more sense #include <libintl.h> in file eu-config.h Signed-off-by: Yonggang Luo <[email protected]>
* move platform depended include into system.h of libelfYonggang Luo2022-10-162-4/+17
| | | | | | | | All of these files either #include <system.h> directly or #include "libelfP.h" And now "libelfP.h also #include <system.h>, so the platform depended include can be moved to system.h safely Signed-off-by: Yonggang Luo <[email protected]>
* lib: Add documentation to explain concurrent htab resizing.Mark Wielaard2022-08-082-6/+28
| | | | | | | Document which lock is held by which thread and how moving the htab data is coordinated. Signed-off-by: Mark Wielaard <[email protected]>
* Prepare for 0.187elfutils-0.187Mark Wielaard2022-04-252-1/+5
| | | | | | | | | Set version to 0.187 Update NEWS and elfutils.spec.in Set copyright year in configure.ac and printversion. Regenerate po/*.po files. Signed-off-by: Mark Wielaard <[email protected]>
* Introduce error_exit as a noreturn variant of error (EXIT_FAILURE, ...)Mark Wielaard2022-03-302-0/+14
| | | | | | | | | | | | error (EXIT_FAILURE, ...) should be noreturn but on some systems it isn't. This may cause warnings about code that should not be reachable. So have an explicit error_exit wrapper that is noreturn (because it calls exit explicitly). Use error_exit in all tools under the src directory. https://bugzilla.redhat.com/show_bug.cgi?id=2068692 Signed-off-by: Mark Wielaard <[email protected]>
* Improve building with LTOAlexander Miller2021-11-082-12/+66
| | | | | | | | | | | | | | Use symver attribute for symbol versioning instead of .symver assembler directive when available. Convert to use double @ syntax for default version in all cases (required when using the attribute). Add the attributes externally_visible, no_reorder if available when using assembler directives to improve the situation for < gcc-10. This is not 100% reliable, though; -flto-partition=none may still be needed in some cases. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24498 Signed-off-by: Alexander Miller <[email protected]>
* lib: Make error.c more like error(3)Colin Cross2021-09-122-3/+34
| | | | | | | | | | | | | | | | | | | Fix some issues with the error reimplementation to make it match the specification for error(3). Flush stdout before printing to stderr. Also flush stderr afterwards, which is not specified in the man page for error(3), but is what bionic does. error(3) prints strerror(errnum) if and only if errnum is nonzero, but verr prints strerror(errno) unconditionaly. When errnum is nonzero copy it to errno and use verr, and when it is not set use verrx that doesn't print errno. error(3) only exits if status is nonzero, but verr exits uncondtionally. Use vwarn/vwarnx when status is zero, which don't exit. Signed-off-by: Colin Cross <[email protected]>
* Use xasprintf instead of asprintf followed by error(EXIT_FAILURE)Dmitry V. Levin2021-09-092-4/+5
| | | | Signed-off-by: Dmitry V. Levin <[email protected]>
* Introduce xasprintfDmitry V. Levin2021-09-094-1/+59
| | | | | | | Similar to other x* functions, xasprintf is like asprintf except that it dies in case of an error. Signed-off-by: Dmitry V. Levin <[email protected]>
* Remove redundant casts of memory allocating functions returning void *Dmitry V. Levin2021-09-093-2/+8
| | | | | | | Return values of functions returning "void *", e.g. calloc, malloc, realloc, xcalloc, xmalloc, and xrealloc, do not need explicit casts. Signed-off-by: Dmitry V. Levin <[email protected]>
* Add lib/error.cMark Wielaard2021-08-271-0/+49
| | | | | | | This new file was supposed to be part of 4d6dd0e5a "lib: avoid potential problems with `-fno-common`". Signed-off-by: Mark Wielaard <[email protected]>
* lib: avoid potential problems with `-fno-common`Saleem Abdulrasool2021-08-273-16/+12
| | | | | | | | | | This properly homes the fallback function into a translation unit rather than trying to define an inline common definition for the fallback path. The intent of the original approach was to actually simply avoid adding a new source file that is used for the fallback path. However, that may cause trouble with multiple definitions if the symbol does not get vague linkage (which itself is not particularly great). This simplifies the behaviour at the cost of an extra inode.
* lib: remove unused `STROF` definition (NFC)Saleem Abdulrasool2021-08-272-1/+4
| | | | | | | | This definition was in the fallback path, where `sys/cdefs.h` is not available. Now that we have a single path through here, this macro gets defined, though is unused. Remove the unused macro definition. Signed-off-by: Saleem Abdulrasool <[email protected]>
* handle libc implementations which do not provide `error.h`Saleem Abdulrasool2021-08-272-1/+30
| | | | | | | | | | | | | Introduce a configure time check for the presence of `error.h`. In the case that `error.h` is not available, we can fall back to `err.h`. Although `err.h` is not a C standard header (it is a BSD extension), many libc implementations provide. If there are targets which do not provide an implementation of `err.h`, it would be possible to further extend the implementation to be more portable. This resolves bug #21008. Signed-off-by: Saleem Abdulrasool <[email protected]>
* lib: remove usage of `sys/cdefs.h`Saleem Abdulrasool2021-08-272-5/+5
| | | | | | | | | | This header is a BSD header that is also available in glibc. However, this is a not a standard C header and was used for `__CONCAT`. Because this is not a standard header, not all libc implementations provide the header. Remove the usage of the header and always use the previously fallback path. This is needed in order to build with musl. Signed-off-by: Saleem Abdulrasool <[email protected]>
* lib: Add static inline reallocarray fallback functionMark Wielaard2021-07-292-0/+18
| | | | Signed-off-by: Mark Wielaard <[email protected]>
* Come up with startswith function.Martin Liska2021-05-122-3/+19
| | | | | | | New function in system.h that returns true if a string has a given prefix, false otherwise. Use it in place of strncmp. Signed-off-by: Martin Liška <[email protected]>
* Prepare for 0.183Mark Wielaard2021-02-052-1/+5
| | | | | | | | | Set version to 0.183 Update NEWS and elfutils.spec.in. Set copyright year in configure.ac and printversion. Regenerate po/*.po files. Signed-off-by: Mark Wielaard <[email protected]>
* lib: consistently use _(Str) instead of gettext(Str)Dmitry V. Levin2020-12-164-4/+9
| | | | | | | | | | | | eu-config.h defines _(Str) to dgettext ("elfutils", Str) instead of a simple gettext (Str) for a reason: the library might be indirectly used by clients that called bindtextdomain with a domain different from "elfutils". The change was made automatically using the following command: $ git grep -l '\<gettext *(' lib |xargs sed -i 's/\<gettext *(/_(/g' Signed-off-by: Dmitry V. Levin <[email protected]>
* Consistently define _(Str) using dgettext ("elfutils", Str)Dmitry V. Levin2020-12-163-5/+7
| | | | | | | | | | | | | | Move the definition of _(Str) macro to lib/eu-config.h which already provides a definition of N_(Str) macro. Since lib/eu-config.h is appended to config.h, it is included into every compilation unit and therefore both macros are now universally available. Remove all other definitions of N_(Str) and _(Str) macros from other files to avoid conflicts and redundancies. The next step is to replace all uses of gettext(Str) with _(Str). Signed-off-by: Dmitry V. Levin <[email protected]>
* Switch from numerical to defined constants for permissions.Érico Rolim2020-11-032-0/+18
| | | | | | | | | | | Use defined constants for permission values. Also add fallback definitions for them in system.h, to allow for compatibility with systems that don't provide these macros. Include system.h in all tests/ files that required it. Signed-off-by: Érico Rolim <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Prepare for 0.180elfutils-0.180Mark Wielaard2020-06-112-1/+5
| | | | | | | | | | Set version to 0.180. Update NEWS and elfutils.spec.in. Set copyright year in printversion. Regenerate po/*.po files. Update .gitignore. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Add and use a concurrent version of the dynamic-size hash table.Srđan Milaković2019-11-084-2/+607
| | | | | Signed-off-by: Srđan Milaković <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Add some supporting framework for C11-style atomics.Jonathon Anderson2019-10-224-1/+487
| | | | | | | Uses the stdatomic.h provided by FreeBSD when GCC doesn't (ie. GCC < 4.9) Signed-off-by: Jonathon Anderson <[email protected]> Signed-off-by: Srđan Milaković <[email protected]>
* Implement RISC-V disassemblerUlrich Drepper2019-09-062-3/+13
|
* lib/color: Fix compilation with uClibcRosen Penev2019-05-052-1/+5
| | | | | | | elfutils passed -Werror and this call errors on uClibc with a mismatching pointer type. Cast to char * to fix. Signed-off-by: Rosen Penev <[email protected]>
* libcpu: Recognize bpf jump variants BPF_JLT, BPF_JLE, BPF_JSLT and BPF_JSLEMark Wielaard2018-11-092-0/+8
| | | | | | | | | | | | | | | | | | Linux kernel 4.13 introduced 4 more jump class variants. commit 92b31a9af73b3a3fc801899335d6c47966351830 Author: Daniel Borkmann <[email protected]> Date: Thu Aug 10 01:39:55 2017 +0200 bpf: add BPF_J{LT,LE,SLT,SLE} instructions For conditional jumping on unsigned and signed < and <= between a register and another register or immediate. Add these new constants to bpf.h, recognize them in bpf_disasm and update the testfile-bpf-dis1.expect file. Signed-off-by: Mark Wielaard <[email protected]>
* Consolidate error.h inclusion in system.hRoss Burton2018-07-054-2/+8
| | | | | | | | | error.h isn't standard and so isn't part of the musl C library. To easy future porting, consolidate the inclusion of error.h into system.h. https://sourceware.org/bugzilla/show_bug.cgi?id=21008 Signed-off-by: Ross Burton <[email protected]>
* Prepare for 0.171.elfutils-0.171Mark Wielaard2018-06-012-2/+6
| | | | | | | Set version to 0.171. Update po/*.po files. Mention DWARF5, split dwarf and GNU DebugFission support in NEWS. Signed-off-by: Mark Wielaard <[email protected]>
* Use fallthrough attribute.Joshua Watt2018-02-102-0/+11
| | | | | | | | | | | | | | | Use __attribute__ ((fallthrough)) to indicate switch case fall through instead of a comment. This ensures that the fallthrough warning is not triggered even if the file is pre-processed (hence stripping the comments) before it is compiled. The actual fallback implementation is hidden behind a FALLBACK macro in case the compiler doesn't support it. Finally, the -Wimplict-fallthrough warning was upgraded to only allow the attribute to satisfy it; a comment alone is no longer sufficient. Signed-off-by: Joshua Watt <[email protected]>