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

« back to all changes in this revision

Viewing changes to libelf/gelf_update_rela.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:
68
68
  if (dst == NULL)
69
69
    return 0;
70
70
 
71
 
  if (unlikely (ndx < 0))
72
 
    {
73
 
      __libelf_seterrno (ELF_E_INVALID_INDEX);
74
 
      return 0;
75
 
    }
76
 
 
77
71
  if (unlikely (data_scn->d.d_type != ELF_T_RELA))
78
72
    {
79
73
      /* The type of the data better should match.  */
101
95
        }
102
96
 
103
97
      /* Check whether we have to resize the data buffer.  */
104
 
      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
 
98
      if (INVALID_NDX (ndx, Elf32_Rela)
 
99
          || unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
105
100
        {
106
101
          __libelf_seterrno (ELF_E_INVALID_INDEX);
107
102
          goto out;
117
112
  else
118
113
    {
119
114
      /* Check whether we have to resize the data buffer.  */
120
 
      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
 
115
      if (INVALID_NDX (ndx, Elf64_Rela)
 
116
          || unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
121
117
        {
122
118
          __libelf_seterrno (ELF_E_INVALID_INDEX);
123
119
          goto out;