Commit Graph

15 Commits

Author SHA1 Message Date
Nick Alcock e755667f94 libctf, elfcpp, gold: do not assume that <byteswap.h> contains bswap_*
At least one C library (uclibc-ng) defines some of these only when
the compiler is GCC.  We might as well test for all three cases and
handle any of them being missing.

Very similar code exists in libctf and split between elfcpp and gold:
fix both.

(Also sync up elfcpp with a change made to libctf swap.h a few months
ago: since there is no out-of-line definition of the bswap replacements,
they should be declared static inline, not just inline, to prevent the
linker generating out-of-line references to them.)

	PR libctf/25120
libctf/
	* configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
	* swap.h (bswap_16): Do not assume that presence of <byteswap.h>
	means this is declared.
	(bswap_32): Likewise.
	(bswap_64): Likewise.
	(bswap_identity_64): Remove, unused.
	* configure: Regenerated.
	* config.h.in: Likewise.
gold/
	* configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
	* configure: Regenerated.
	* config.h.in: Likewise.
elfcpp/
	* elfcpp_swap.h (bswap_16): Do not assume that presence of
	<byteswap.h> means this is declared.  Make static inline, matching
	recent change to libctf, since there is no non-inline definition
	of these functions.
	(bswap_32): Likewise.
	(bswap_64): Likewise.
2020-06-26 15:56:39 +01:00
Alan Modra b3adc24a07 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
Alan Modra 827041555a Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
Alan Modra 219d1afa89 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
Alan Modra 2571583aed Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
Alan Modra 6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Cary Coutant 1d50909894 elfcpp/
* elfcpp_swap.h (struct Swap_aligned32): New template.

gold/

	* gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
	CU range table of gdb index.
2012-04-23 23:31:15 +00:00
Ian Lance Taylor 15d5fa1607 elfcpp:/
* elfcpp_swap.h: #include "config.h".  Only #include <byteswap.h>
	if HAVE_BYTESWAP_H is defined; if not, provide definitions for
	bswap_{16,32,64}.  For gcc 4.3 and later, use the builtin bswap
	functions.  Check WORDS_BIGENDIAN rather than __BYTE_ORDER.
gold:/
	* configure.ac: Check for byteswap.h.
	* configure: Rebuild.
	* config.in: Rebuild.
2009-03-02 02:45:29 +00:00
Ian Lance Taylor 15fb9978c9 * elfcpp_swap.h (Swap_unaligned<64, true>::writeval): Correct
byte order.
2008-04-03 23:33:20 +00:00
Ian Lance Taylor 5b3463d9ee Add Signed_valtype and use it for sign extension. Fix names of rela8. 2007-10-01 21:25:23 +00:00
Ian Lance Taylor 6cb15b7f89 Add licensing text to every source file. 2007-09-22 21:02:10 +00:00
Ian Lance Taylor a3ad94edd4 Hash tables, dynamic section, i386 PLT, gold_assert. 2006-11-29 17:56:40 +00:00
Ian Lance Taylor 8d9455b422 Rework swapping code. 2006-11-06 22:45:08 +00:00