This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ret value of bfd_get_sign_extend_vma
- From: Michael Mueller <m dot mueller99 at kay-mueller dot de>
- To: binutils at sources dot redhat dot com
- Date: Mon, 21 Jun 2004 17:35:14 +0200
- Subject: ret value of bfd_get_sign_extend_vma
Can someone explain to me what the return value of function
bfd_get_sign_extend_vma means? What the docu says is a mystery to me:
"Indicates if the target architecture "naturally" sign extends an
address. Some architectures implicitly sign extend address values when
they are converted to types larger than the size of an address. For
instance, bfd_get_start_address() will return an address sign extended
to fill a bfd_vma when this is the case."
How can an address have a sign? I think of an address as an unsigned
quantity.
I found 2 uses of bfd_get_sign_extend_vma in gdb (I'm talking of solaris
sparc 32 and 64 bit):
1) In dbxread.c, macro INTERNALIZE_SYMBOL
There it's used (among others) to read a negative offset of a local
variable to the frame pointer. This should be sign extended.
See http://sources.redhat.com/ml/gdb-patches/2004-06/msg00433.html
and http://sources.redhat.com/ml/gdb/2001-08/msg00078.html
2) In dwarfread2.c
There it's used to read addresses which have no sign.