diff options
author | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2004-09-23 07:05:40 +0000 |
---|---|---|
committer | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2004-09-23 07:05:40 +0000 |
commit | 7df9d0a317c1cf1f51498d994c3b281d506830e9 (patch) | |
tree | fb3c5623f45e329d413dcf106cd990645871b1a0 /ldso | |
parent | ea64c4b3c6fbf77577b7019182bc93cabe21fdd5 (diff) |
Make do_rem() safe. From Peter Kjellerstedt.
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/arm/dl-sysdep.h | 2 | ||||
-rw-r--r-- | ldso/ldso/cris/dl-sysdep.h | 2 | ||||
-rw-r--r-- | ldso/ldso/frv/dl-sysdep.h | 2 | ||||
-rw-r--r-- | ldso/ldso/i386/dl-sysdep.h | 2 | ||||
-rw-r--r-- | ldso/ldso/mips/dl-sysdep.h | 2 | ||||
-rw-r--r-- | ldso/ldso/powerpc/dl-sysdep.h | 2 | ||||
-rw-r--r-- | ldso/ldso/sh64/dl-sysdep.h | 2 | ||||
-rw-r--r-- | ldso/ldso/sparc/dl-sysdep.h | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/ldso/ldso/arm/dl-sysdep.h b/ldso/ldso/arm/dl-sysdep.h index ebd258a7f..6863e35a2 100644 --- a/ldso/ldso/arm/dl-sysdep.h +++ b/ldso/ldso/arm/dl-sysdep.h @@ -42,7 +42,7 @@ static inline unsigned long arm_modulus(unsigned long m, unsigned long p) } return m; } -#define do_rem(result, n, base) result=arm_modulus(n,base); +#define do_rem(result, n, base) ((result) = arm_modulus(n, base)) /* Here we define the magic numbers that this dynamic loader should accept */ #define MAGIC1 EM_ARM diff --git a/ldso/ldso/cris/dl-sysdep.h b/ldso/ldso/cris/dl-sysdep.h index aec396441..ab089072f 100644 --- a/ldso/ldso/cris/dl-sysdep.h +++ b/ldso/ldso/cris/dl-sysdep.h @@ -53,7 +53,7 @@ cris_mod(unsigned long m, unsigned long p) return m; } -#define do_rem(result, n, base) result = cris_mod(n, base); +#define do_rem(result, n, base) ((result) = cris_mod(n, base)) /* 8192 bytes alignment */ #define PAGE_ALIGN 0xffffe000 diff --git a/ldso/ldso/frv/dl-sysdep.h b/ldso/ldso/frv/dl-sysdep.h index d425b5c1c..32d540caf 100644 --- a/ldso/ldso/frv/dl-sysdep.h +++ b/ldso/ldso/frv/dl-sysdep.h @@ -65,7 +65,7 @@ struct funcdesc_value extern int _dl_linux_resolve(void) __attribute__((__visibility__("hidden"))); -#define do_rem(result, n, base) result = (n % base) +#define do_rem(result, n, base) ((result) = (n) % (base)) /* 16KiB page alignment. Should perhaps be made dynamic using getpagesize(), based on AT_PAGESZ from auxvt? */ diff --git a/ldso/ldso/i386/dl-sysdep.h b/ldso/ldso/i386/dl-sysdep.h index a92d89574..e8124d669 100644 --- a/ldso/ldso/i386/dl-sysdep.h +++ b/ldso/ldso/i386/dl-sysdep.h @@ -25,7 +25,7 @@ do { \ struct elf_resolve; extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry); -#define do_rem(result, n, base) result = (n % base) +#define do_rem(result, n, base) ((result) = (n) % (base)) /* 4096 bytes alignment */ #define PAGE_ALIGN 0xfffff000 diff --git a/ldso/ldso/mips/dl-sysdep.h b/ldso/ldso/mips/dl-sysdep.h index 549bcef9e..45a1f2e4e 100644 --- a/ldso/ldso/mips/dl-sysdep.h +++ b/ldso/ldso/mips/dl-sysdep.h @@ -45,7 +45,7 @@ unsigned long _dl_linux_resolver(unsigned long sym_index, struct elf_resolve; void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt); -#define do_rem(result, n, base) result = (n % base) +#define do_rem(result, n, base) ((result) = (n) % (base)) /* 4096 bytes alignment */ #define PAGE_ALIGN 0xfffff000 diff --git a/ldso/ldso/powerpc/dl-sysdep.h b/ldso/ldso/powerpc/dl-sysdep.h index b614318bb..6bbdb8c47 100644 --- a/ldso/ldso/powerpc/dl-sysdep.h +++ b/ldso/ldso/powerpc/dl-sysdep.h @@ -68,7 +68,7 @@ extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_ent void _dl_init_got(unsigned long *lpnt,struct elf_resolve *tpnt); -#define do_rem(result, n, base) result = (n % base) +#define do_rem(result, n, base) ((result) = (n) % (base)) /* 4096 bytes alignment */ #define PAGE_ALIGN 0xfffff000 diff --git a/ldso/ldso/sh64/dl-sysdep.h b/ldso/ldso/sh64/dl-sysdep.h index 266ec681c..98a21aedb 100644 --- a/ldso/ldso/sh64/dl-sysdep.h +++ b/ldso/ldso/sh64/dl-sysdep.h @@ -25,7 +25,7 @@ struct elf_resolve; extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry); -#define do_rem(result, n, base) result = (n % base) +#define do_rem(result, n, base) ((result) = (n) % (base)) /* 4096 bytes alignment */ #define PAGE_ALIGN 0xfffff000 diff --git a/ldso/ldso/sparc/dl-sysdep.h b/ldso/ldso/sparc/dl-sysdep.h index 448bef055..d48120e2d 100644 --- a/ldso/ldso/sparc/dl-sysdep.h +++ b/ldso/ldso/sparc/dl-sysdep.h @@ -84,7 +84,7 @@ sparc_mod(unsigned long m, unsigned long p) return m; } -#define do_rem(result, n, base) result = sparc_mod(n, base); +#define do_rem(result, n, base) ((result) = sparc_mod(n, base)) #endif /* |