~ubuntu-branches/debian/lenny/elfutils/lenny

« back to all changes in this revision

Viewing changes to libelf/gelf_update_dyn.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx, Christian Aichinger
  • Date: 2006-08-27 15:48:23 UTC
  • Revision ID: james.westby@ubuntu.com-20060827154823-gmbm698yux21k7fs
Tags: 0.123-2
[ Kurt Roeckx ]
* Add backend support for alpha: adding the registers.
* Add backend support for arm: adding regs and retval.
  Thanks to Eugeniy Meshcheryakov <eugeniy.meshcheryakov@googlemail.com>
* Add backend support for hppa, thanks to
  Eugeniy Meshcheryakov <eugeniy.meshcheryakov@googlemail.com>
* Add some missing ELFOSABI_* and EM_* to elf.h

[ Christian Aichinger ]
* Fix sparc backend retval
* Add mips backend.
* Rewrite the static backend so making changes to the backends
  is easier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
  if (data == NULL)
72
72
    return 0;
73
73
 
74
 
  if (unlikely (ndx < 0))
75
 
    {
76
 
      __libelf_seterrno (ELF_E_INVALID_INDEX);
77
 
      return 0;
78
 
    }
79
 
 
80
74
  if (unlikely (data_scn->d.d_type != ELF_T_DYN))
81
75
    {
82
76
      /* The type of the data better should match.  */
102
96
        }
103
97
 
104
98
      /* Check whether we have to resize the data buffer.  */
105
 
      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
 
99
      if (INVALID_NDX (ndx, Elf32_Dyn)
 
100
          || unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
106
101
        {
107
102
          __libelf_seterrno (ELF_E_INVALID_INDEX);
108
103
          goto out;
116
111
  else
117
112
    {
118
113
      /* Check whether we have to resize the data buffer.  */
119
 
      if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
 
114
      if (INVALID_NDX (ndx, Elf64_Dyn)
 
115
          || unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
120
116
        {
121
117
          __libelf_seterrno (ELF_E_INVALID_INDEX);
122
118
          goto out;