Print this page
5688 ELF tools need to be more careful with dwarf data

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/include/dwarf.h
          +++ new/usr/src/cmd/sgs/include/dwarf.h
↓ open down ↓ 239 lines elided ↑ open up ↑
 240  240                                          /*  relocation */
 241  241  
 242  242  
 243  243  /* language/compiler enumeration */
 244  244  
 245  245  typedef enum _LANG {
 246  246          LANG_UNK = 0,
 247  247          LANG_ANSI_C_V1 = 1
 248  248  } LANG;
 249  249  
      250 +typedef enum {
      251 +        DW_SUCCESS = 0,
      252 +        DW_BAD_ENCODING,
      253 +        DW_OVERFLOW,
      254 +} dwarf_error_t;
      255 +
 250  256  /*
 251  257   * Little Endian Base 128 (leb128) encoding/decoding routines
 252  258   */
 253      -extern  uint64_t        uleb_extract(unsigned char *, uint64_t *);
 254      -extern  int64_t         sleb_extract(unsigned char *, uint64_t *);
 255      -extern  uint64_t        dwarf_ehe_extract(unsigned char *, uint64_t *,
 256      -                            uint_t, unsigned char *, boolean_t, uint64_t,
 257      -                            uint64_t, uint64_t);
      259 +extern  dwarf_error_t   uleb_extract(unsigned char *, uint64_t *, size_t,
      260 +                            uint64_t *);
      261 +extern  dwarf_error_t   sleb_extract(unsigned char *, uint64_t *, size_t,
      262 +                            int64_t *);
      263 +extern  dwarf_error_t   dwarf_ehe_extract(unsigned char *, size_t, uint64_t *,
      264 +                            uint64_t *, uint_t, unsigned char *, boolean_t,
      265 +                            uint64_t, uint64_t, uint64_t);
 258  266  
 259  267  #ifdef  __cplusplus
 260  268  }
 261  269  #endif
 262  270  
 263  271  
 264  272  #endif /* _DWARF_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX