summaryrefslogtreecommitdiffstats
path: root/src/arlib.c
Commit message (Collapse)AuthorAgeFilesLines
* Move the #include <libintl.h> into eu-config.hYonggang Luo2022-10-161-1/+0
| | | | | | | | | | 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]>
* Introduce error_exit as a noreturn variant of error (EXIT_FAILURE, ...)Mark Wielaard2022-03-301-4/+4
| | | | | | | | | | | | 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]>
* src: consistently use _(Str) instead of gettext(Str)Dmitry V. Levin2020-12-161-2/+2
| | | | | | | | | Make use of the _(Str) macro provided by <config.h>. The change was made automatically using the following command: $ git grep -l '\<gettext *(' src |xargs sed -i 's/\<gettext *(/_(/g' Signed-off-by: Dmitry V. Levin <[email protected]>
* arlib: Check that sh_entsize isn't zero.Mark Wielaard2018-10-201-0/+3
| | | | | | | | | A bogus ELF file could have sh_entsize as zero. Don't divide by zero, but just assume there are no symbols in the section. https://sourceware.org/bugzilla/show_bug.cgi?id=23786 Signed-off-by: Mark Wielaard <[email protected]>
* Consolidate error.h inclusion in system.hRoss Burton2018-07-051-1/+1
| | | | | | | | | 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]>
* ar: Fix GCC7 -Wformat-length issues.Mark Wielaard2016-11-111-6/+10
| | | | | | | | | | | | GCC7 adds warnings for snprintf formatting into too small buffers. Fix the two issues pointed out by the new warning. The ar header fields are fixed length containing left-justified strings without zero terminator. snprintf always adds a '\0' char at the end (which we then don't copy into the ar header field) and numbers are decimal strings of fixed 10 chars (-Wformat-length thinks formatting them as size_t might overflow the buffer on 64bit arches). Signed-off-by: Mark Wielaard <[email protected]>
* lib: Provide MAX and MIN in system.hAkihiko Odaki2016-10-121-1/+1
| | | | | | | | | | This change also creates a new header file libeu.h to provide the prototypes for the function of libeu. That hides the definition of function crc32, which can conflict with zlib, from libelf. It also prevents mistakes to refer those functions from a component which doesn't link with libeu, such as libelf. Signed-off-by: Akihiko Odaki <[email protected]>
* Fix some (harmless) cppcheck warnings.Mark Wielaard2013-11-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | [dwarf_getaranges.c:149]: (warning) Ineffective statement similar to '*A++;'. Did you intend to write '(*A)++;'? There was already an XXX statement that we weren't using the result. Explicitly read the segment_size and check it is zero. And report an error if it isn't, since we aren't prepared to handle such a case. [arlib.c:62]: (error) Uninitialized variable: tmpbuf [arlib.c:124]: (error) Uninitialized variable: tmpbuf cppcheck is wrong. tmpbuf is initialized in the snprintf call whose result is use in the same memcpy call. It does make the code less readable and harder to understand. So explicitly split the snprintf and memcpy calls. [nm.c:766]: (warning) Assert statement modifies 'cnt'. The cnt variable was only used for this assert sanity check. But it is bad style to do have side effects inside an assert statement. Increase cnt after the assert. Reported-by: David Binderman <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Update name, license and contributor policy.Mark Wielaard2012-06-051-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change name from "Red Hat elfutils" to "elfutils". * Update license of standalone tools and test from GPLv2 to GPLv3+. * Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+. * Add Developer Certificate of Origin based contributor policy. top-level: - COPYING: Upgraded from GPLv2 to GPLv3. - CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files. - NEWS: Added note about new contribution and license policy. - Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST. - configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'. backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf: - All files updated to GPLv2/LGPLv3+. Except some very small files (<5 lines) which didn't have any headers at all before, the linker .maps files and the libcpu/defs files which only contain data and libelf/elf.h which comes from glibc and is under LGPLv2+. config: - elfutils.spec.in: Add new License: headers and new %doc files. - Update all license headers to GPLv2/LGPLv3+ for files used by libs. src, tests: - All files updated to GPLv3+. Except for the test bz2 data files, the linker maps and script files and some very small files (<5 lines) that don't have any headers. Signed-off-by: Richard Fontana <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
* Support -D in ranlib as in ar.Roland McGrath2012-01-201-2/+3
|
* Fix doubled words.Marek Polacek2011-04-161-1/+1
|
* merge of '92c36bfdbc6468d1711c043b530e0dfe5abb6dec'Ulrich Drepper2007-10-161-0/+7
| | | | and 'c22c8c43f8f68b0bffd4d5ccdb2282c958268742'
* Make symtab a global variable in arlib.c.Ulrich Drepper2007-02-051-47/+50
|
* Implement ar program.Ulrich Drepper2007-02-051-0/+269
Relax elflint in GNU ld mode for latest idiosyncracies.