Hi,
jankratochvil/bele
if you made some #include in link_maps.c it could:
link_map.c:51:0: error: "LE32" redefined [-Werror] In file included from link_map.c:32:0: ../lib/system.h:40:0: note: this is the location of the previous definition
Thanks, Jan
commit 1704baf67698c269bc81fbaec0483e53d9709702 Author: Jan Kratochvil jan.kratochvil@redhat.com Date: Fri Apr 26 17:00:50 2013 +0200
Unify {BE,LE}{32,64} in lib/system.h.
lib/ * system.h (LE64, BE64): Move here the definitions from libdwfl/link_map.c.
libdwfl/ * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move them to lib/system.h.
Signed-off-by: Jan Kratochvil jan.kratochvil@redhat.com
diff --git a/lib/ChangeLog b/lib/ChangeLog index b97aba3..1fa4249 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2013-04-26 Jan Kratochvil jan.kratochvil@redhat.com + + * system.h (LE64, BE64): Move here the definitions from + libdwfl/link_map.c. + 2013-04-24 Mark Wielaard mjw@redhat.com
* Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. diff --git a/lib/system.h b/lib/system.h index 8367f2b..f31cfd0 100644 --- a/lib/system.h +++ b/lib/system.h @@ -38,10 +38,14 @@
#if __BYTE_ORDER == __LITTLE_ENDIAN # define LE32(n) (n) +# define LE64(n) (n) # define BE32(n) bswap_32 (n) +# define BE64(n) bswap_64 (n) #elif __BYTE_ORDER == __BIG_ENDIAN # define BE32(n) (n) +# define BE64(n) (n) # define LE32(n) bswap_32 (n) +# define LE64(n) bswap_64 (n) #else # error "Unknown byte order" #endif diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index e8285d1..0160534 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2013-04-26 Jan Kratochvil jan.kratochvil@redhat.com + + * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move + them to lib/system.h. + 2013-04-24 Mark Wielaard mjw@redhat.com
* Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c index 00913fe..19f92df 100644 --- a/libdwfl/link_map.c +++ b/libdwfl/link_map.c @@ -39,18 +39,6 @@ #define PROBE_VAL32 sizeof (Elf32_Phdr) #define PROBE_VAL64 sizeof (Elf64_Phdr)
-#if BYTE_ORDER == BIG_ENDIAN -# define BE32(x) (x) -# define BE64(x) (x) -# define LE32(x) bswap_32 (x) -# define LE64(x) bswap_64 (x) -#else -# define LE32(x) (x) -# define LE64(x) (x) -# define BE32(x) bswap_32 (x) -# define BE64(x) bswap_64 (x) -#endif -
/* Examine an auxv data block and determine its format. Return true iff we figured it out. */
On Fri, 2013-04-26 at 17:03 +0200, Jan Kratochvil wrote:
libdwfl/
- link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move them to lib/system.h.
But then you do have to include system.h to pick up those definitions or the file won't compile anymore. Fixed as follows:
commit 9efa9e6803992567576963f381fbd9cd6a7b9b86 Author: Mark Wielaard mjw@redhat.com Date: Sat Apr 27 20:50:32 2013 +0200
libdwfl/link_map.c: #include system.h.
Signed-off-by: Mark Wielaard mjw@redhat.com
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 0160534..42f720c 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2013-04-27 Mark Wielaard mjw@redhat.com + + * link_map.c: #include system.h. + 2013-04-26 Jan Kratochvil jan.kratochvil@redhat.com
* link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c index 19f92df..c6ec29c 100644 --- a/libdwfl/link_map.c +++ b/libdwfl/link_map.c @@ -29,6 +29,7 @@ #include <config.h> #include "libdwflP.h" #include "../libdw/memory-access.h" +#include "system.h"
#include <byteswap.h> #include <endian.h>
elfutils-devel@lists.fedorahosted.org