summaryrefslogtreecommitdiff
path: root/bfd/elf32-nds32.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-09-21 10:27:30 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-09-21 10:27:30 -0400
commita767a1c4d3c7c5dd2f32cc106a21c1e01eddebcc (patch)
tree2e7136e26fcf5824de044f41db40a63b3ec997ad /bfd/elf32-nds32.c
parent4daf19021fef36767e70845608a8a2c3b4d72f99 (diff)
downloadbinutils-gdb-a767a1c4d3c7c5dd2f32cc106a21c1e01eddebcc.tar.gz
elf32-nds32: Don't define fls if it is provided by the system
The fls function already exists on macOS and FreeBSD (and probably others), leading to this error: /Users/simark/src/binutils-gdb/bfd/elf32-nds32.c:5074:1: error: static declaration of 'fls' follows non-static declaration fls (register unsigned int x) ^ /usr/include/strings.h:87:6: note: previous declaration is here int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); ^ Add a configure-time check for it, and only define it if the system doesn't provide it. bfd/ChangeLog: * configure.ac: Check for fls. * elf32-nds32.c (fls): Only define if !HAVE_FLS. * config.in: Re-generate. * configure: Re-generate.
Diffstat (limited to 'bfd/elf32-nds32.c')
-rw-r--r--bfd/elf32-nds32.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index 6215f288009..88441669211 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -5083,11 +5083,13 @@ ones32 (register unsigned int x)
return (x & 0x0000003f);
}
+#if !HAVE_FLS
static unsigned int
fls (register unsigned int x)
{
return ffs (x & (-x));
}
+#endif /* !HAVE_FLS */
#define nds32_elf_local_tlsdesc_gotent(bfd) \
(elf_nds32_tdata (bfd)->local_tlsdesc_gotent)