This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [rfa] bfd_elf_sign_extend_vma()


Andrew Cagney wrote:
> 
> Ok?
> 
> The attatched exports the internal ELF target value
> ``sign_extend_vma''.  GDB, when it is reading in dwarf2 debug tables
> needs this information to determine exactly how it should treat any
> dwarf2 debug addresses.
> 
> The name and return value conventions are consistent with
> bfd_elf_get_arch_size().

FYI,  I've also checked this one in.  Now for GDB...

	Andrew

>   ------------------------------------------------------------------------
> Mon Jun 19 20:53:14 2000  Andrew Cagney  <cagney@b1.cygnus.com>
> 
>         * elf.c (bfd_elf_get_sign_extend_vma): Return tendency of VMA
>         addresses to be "naturally" sign extended.  Return -1 if unknown.
>         * bfd-in2.h (bfd_elf_get_sign_extend_vma): : Add declaration.
> 
> Index: bfd-in2.h
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/bfd/bfd-in2.h,v
> retrieving revision 1.383
> diff -p -r1.383 bfd-in2.h
> *** bfd-in2.h   2000/05/31 15:50:12     1.383
> --- bfd-in2.h   2000/06/23 06:50:51
> *************** extern int bfd_get_elf_phdrs PARAMS ((bf
> *** 647,652 ****
> --- 647,655 ----
>   /* Return the arch_size field of an elf bfd, or -1 if not elf.  */
>   extern int bfd_elf_get_arch_size PARAMS ((bfd *));
> 
> + /* Return true if address "naturally" sign extends, or -1 if not elf. */
> + extern int bfd_elf_get_sign_extend_vma PARAMS ((bfd *));
> +
>   /* SunOS shared library support routines for the linker.  */
> 
>   extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
> Index: elf.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/bfd/elf.c,v
> retrieving revision 1.257
> diff -p -r1.257 elf.c
> *** elf.c       2000/05/31 15:50:13     1.257
> --- elf.c       2000/06/23 06:51:03
> *************** bfd_elf_get_arch_size (abfd)
> *** 1771,1776 ****
> --- 1771,1790 ----
>     return (get_elf_backend_data (abfd))->s->arch_size;
>   }
> 
> + /* True if addresses "naturally" sign extend.  Return 0/1 if known.
> +    -1 if unknown. */
> + int
> + bfd_elf_get_sign_extend_vma (abfd)
> +      bfd *abfd;
> + {
> +   if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
> +     {
> +       bfd_set_error (bfd_error_wrong_format);
> +       return -1;
> +     }
> +   return (get_elf_backend_data (abfd)->sign_extend_vma);
> + }
> +
>   /* Assign all ELF section numbers.  The dummy first section is handled here
>      too.  The link/info pointers for the standard section types are filled
>      in here too, while we're at it.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]