[PATCH] sysdeps/generic/dl-fptr.c, default CAS parameter order wrong.

Carlos O'Donell carlos@baldric.uwo.ca
Thu Dec 11 21:50:00 GMT 2003


libc-alpha,

Porting hppa over to use the generic function descriptor code.

Noticed a small mistake in the CAS define. I'm assuming that
include/atomic.h is correct and that CAS here was defined to match the
version that ia64 has defined. So I'm swapping the order so that
atomic_compare_and_exchange_bool_acq sees the right values.

Cheers,
Carlos.

2003-12-11  Carlos O'Donell  <carlos@baldric.uwo.ca>

	* sysdeps/generic/dl-fptr.c [COMPARE_AND_SWAP]: Pass new and old
	in the right order.

Index: sysdeps/generic/dl-fptr.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/generic/dl-fptr.c,v
retrieving revision 1.5
diff -u -p -r1.5 dl-fptr.c
--- sysdeps/generic/dl-fptr.c	2 May 2003 22:37:14 -0000	1.5
+++ sysdeps/generic/dl-fptr.c	11 Dec 2003 21:44:15 -0000
@@ -40,7 +40,7 @@
 
 #ifndef COMPARE_AND_SWAP
 #define COMPARE_AND_SWAP(ptr,old,new) \
-  atomic_compare_and_exchange_bool_acq ((ptr), (old), (new))
+  atomic_compare_and_exchange_bool_acq ((ptr), (new), (old))
 #endif
 
 ElfW(Addr) _dl_boot_fptr_table [ELF_MACHINE_BOOT_FPTR_TABLE_LEN];



More information about the Libc-alpha mailing list