summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-11 06:31:57 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-11 06:31:57 +0000
commite5ffa64a7003b5886c85c6434ced62ebc468b40d (patch)
tree562631f19dcbb5479eab1336d1fbc94daac53571 /elf
parentd9dd121ebe3e983e450c7189cf06dcf000f76178 (diff)
downloadglibc-e5ffa64a7003b5886c85c6434ced62ebc468b40d.tar.gz
glibc-e5ffa64a7003b5886c85c6434ced62ebc468b40d.tar.xz
glibc-e5ffa64a7003b5886c85c6434ced62ebc468b40d.zip
Update.
2003-02-10  Ulrich Drepper  <drepper@redhat.com>

	* elf/Makefile (check-textrel-CFLAGS): Pass _XOPEN_SOURCE and
	_BSD_SOURCE to compiler.
	* elf/check-textrel.c (SWAP): Add parenthesis to avoid warnings.
	Patches by Alan Modra.
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile2
-rw-r--r--elf/check-textrel.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 09ea94800d..56322f1d1a 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -601,7 +601,7 @@ $(objpfx)tst-array4.out: $(objpfx)tst-array4 $(objpfx)tst-array2dep.so
 	  $< > $@
 	cmp $@ tst-array4.exp > /dev/null
 
-check-textrel-CFLAGS = -O
+check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
 $(objpfx)check-textrel: check-textrel.c
 	$(native-compile)
 
diff --git a/elf/check-textrel.c b/elf/check-textrel.c
index 69210b2be8..ec97e4b0c9 100644
--- a/elf/check-textrel.c
+++ b/elf/check-textrel.c
@@ -1,5 +1,5 @@
 /* Check for text relocations in DSOs.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contribute by Ulrich Drepper <drepper@redhat.com>. 2002.
 
@@ -38,8 +38,10 @@
 # define __E(name, bits) Elf##bits##_##name
 # define SWAP(val) \
   ({ __typeof (val) __res;						      \
-     if ((ehdr.e_ident[EI_DATA] == ELFDATA2MSB && BYTE_ORDER == LITTLE_ENDIAN \
-	  || ehdr.e_ident[EI_DATA] == ELFDATA2LSB && BYTE_ORDER == BIG_ENDIAN)\
+     if (((ehdr.e_ident[EI_DATA] == ELFDATA2MSB				      \
+	   && BYTE_ORDER == LITTLE_ENDIAN)				      \
+	  || (ehdr.e_ident[EI_DATA] == ELFDATA2LSB			      \
+	      && BYTE_ORDER == BIG_ENDIAN))				      \
 	 && sizeof (val) != 1)						      \
        {								      \
 	 if (sizeof (val) == 2)						      \