This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
elf.c:3701: off += (m->sections[0]->vma - off) % bed->maxpagesize
- From: Andrew Cagney <cagney at gnu dot org>
- To: binutils at sources dot redhat dot com
- Date: Tue, 20 Jan 2004 21:30:03 -0500
- Subject: elf.c:3701: off += (m->sections[0]->vma - off) % bed->maxpagesize
From elf.c:
3701 off += (m->sections[0]->vma - off) % bed->maxpagesize;
(gdb) print off
$51 = 0x54
(gdb) print m->sections[0]->vma
$52 = 0x0
(gdb) print bed->maxpagesize
$53 = 0x10000
ok:
(gdb) ptype m->sections[0]->vma
type = long unsigned int
(gdb) ptype off
type = long int
(gdb) ptype bed->maxpagesize
type = long unsigned int
(gdb) print off + (m->sections[0]->vma - off) % bed->maxpagesize
$50 = 0x10000
broken:
(gdb) ptype m->sections[0]->vma
type = long unsigned int
(gdb) ptype off
type = long long int
(gdb) ptype bed->maxpagesize
type = long unsigned int
(gdb) print off + (m->sections[0]->vma - off) % bed->maxpagesize
$39 = 0x0
I can make it work with:
(gdb) print off + (m->sections[0]->vma - off) % (ufile_ptr)
bed->maxpagesize
$40 = 0x10000
but is there a better way to write this expression? (that arithmetic
strikes me as weird) and just how many others like this are lurking :-/ :-)?
enjoy,
Andrew