[PATCH 1/1] Modifying fs/binfmt_elf.c:elf_core_dump() to use round_up()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since roundup() will use plain division which might cause the compiler
to use its own integer library routines (i.e. __divid3() in libgcc) on
32bit mahcines when "O0" is specified. The problem won't occur if it
uses round_up() which utilize bitwise operations (shift & and), and the
limitation that "the divisor must be the power of 2" is true on
ELF_EXEC_PAGESIZE.

Signed-off-by: Ruinland Chuan-Tzu Tsai <ruinland@xxxxxxxxxxxxx>
---
 fs/binfmt_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index b12ba98ae..01d4d6d2b 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -2209,7 +2209,7 @@ static int elf_core_dump(struct coredump_params *cprm)
 		offset += sz;
 	}
 
-	dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
+	dataoff = offset = round_up(offset, ELF_EXEC_PAGESIZE);
 
 	offset += vma_data_size;
 	offset += elf_core_extra_data_size();
-- 
2.17.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux