00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "config.h"
00043 #include "dwarf_incl.h"
00044 #if defined(BUILD_OS_DARWIN)
00045 #include "darwin_elf.h"
00046 #else
00047 #ifdef HAVE_ELF_H
00048 #include <elf.h>
00049 #endif
00050 #endif
00051 #ifdef __SGI_FAST_LIBELF
00052 #include <libelf_sgi.h>
00053 #else
00054 #ifdef HAVE_LIBELF_H
00055 #include <libelf.h>
00056 #else
00057 #ifdef HAVE_LIBELF_LIBELF_H
00058 #include <libelf/libelf.h>
00059 #endif
00060 #endif
00061 #endif
00062
00063 #include <stdio.h>
00064 #include <sys/stat.h>
00065 #include <sys/types.h>
00066 #include <string.h>
00067 #include <stdlib.h>
00068 #if ! defined(BUILD_OS_DARWIN)
00069 #include <malloc.h>
00070 #endif
00071
00072 #include "dwarf_incl.h"
00073
00074 #define DWARF_DBG_ERROR(dbg,errval,retval) \
00075 _dwarf_error(dbg, error, errval); return(retval);
00076
00077 #define FALSE 0
00078 #define TRUE 1
00079
00080 #ifdef __SGI_FAST_LIBELF
00081 #else
00082 #ifdef HAVE_ELF64_GETEHDR
00083 extern Elf64_Ehdr *elf64_getehdr(Elf *);
00084 #endif
00085 #ifdef HAVE_ELF64_GETSHDR
00086 extern Elf64_Shdr *elf64_getshdr(Elf_Scn *);
00087 #endif
00088 #endif
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 static Dwarf_Small _dwarf_assume_string_bad;
00099
00100
00101 int
00102 dwarf_set_stringcheck(int newval)
00103 {
00104 int oldval = _dwarf_assume_string_bad;
00105
00106 _dwarf_assume_string_bad = newval;
00107 return oldval;
00108 }
00109
00110 #ifdef __SGI_FAST_LIBELF
00111
00112
00113
00114
00115 static int
00116 _dwarf_error_code_from_elf_sgi_error_code(enum elf_sgi_error_type val)
00117 {
00118 switch (val) {
00119 case ELF_SGI_ERROR_OK: return DW_DLE_NE;
00120 case ELF_SGI_ERROR_BAD_ALLOC: return DW_DLE_MAF;
00121 case ELF_SGI_ERROR_FORMAT: return DW_DLE_MDE;
00122 case ELF_SGI_ERROR_ERRNO: return DW_DLE_IOF;
00123 case ELF_SGI_ERROR_TOO_BIG: return DW_DLE_MOF;
00124 default: return DW_DLE_LEE;
00125 }
00126 }
00127 #endif
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 static int
00147 _dwarf_setup(Dwarf_Debug dbg, dwarf_elf_handle elf, Dwarf_Error * error)
00148 {
00149 #ifdef __SGI_FAST_LIBELF
00150 Elf64_Ehdr ehdr;
00151 Elf64_Shdr shdr;
00152 enum elf_sgi_error_type sres;
00153 unsigned char const* ehdr_ident;
00154 #else
00155 Elf32_Ehdr *ehdr32;
00156
00157 #ifdef HAVE_ELF64_GETEHDR
00158 Elf64_Ehdr *ehdr64;
00159 #endif
00160 Elf32_Shdr *shdr32;
00161
00162 #ifdef HAVE_ELF64_GETSHDR
00163 Elf64_Shdr *shdr64;
00164 #endif
00165 Elf_Scn *scn;
00166 char *ehdr_ident;
00167 #endif
00168 Dwarf_Half machine;
00169 char *scn_name;
00170 int is_64bit;
00171 int foundDwarf;
00172
00173 Dwarf_Unsigned section_size;
00174 Dwarf_Unsigned section_count;
00175 Dwarf_Half section_index;
00176
00177 foundDwarf = FALSE;
00178 dbg->de_elf = elf;
00179
00180 dbg->de_assume_string_in_bounds = _dwarf_assume_string_bad;
00181
00182 #ifdef __SGI_FAST_LIBELF
00183 sres = elf_sgi_ehdr(elf, &ehdr);
00184 if (sres != ELF_SGI_ERROR_OK) {
00185 DWARF_DBG_ERROR(dbg, _dwarf_error_code_from_elf_sgi_error_code(sres),
00186 DW_DLV_ERROR);
00187 }
00188 ehdr_ident = ehdr.e_ident;
00189 section_count = ehdr.e_shnum;
00190 machine = ehdr.e_machine;
00191 #else
00192 if ((ehdr_ident = elf_getident(elf, NULL)) == NULL) {
00193 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_GETIDENT_ERROR, DW_DLV_ERROR);
00194 }
00195 #endif
00196
00197 is_64bit = (ehdr_ident[EI_CLASS] == ELFCLASS64);
00198
00199
00200 dbg->de_same_endian = 1;
00201 dbg->de_copy_word = memcpy;
00202 #ifdef WORDS_BIGENDIAN
00203 dbg->de_big_endian_object = 1;
00204 if (ehdr_ident[EI_DATA] == ELFDATA2LSB) {
00205 dbg->de_same_endian = 0;
00206 dbg->de_big_endian_object = 0;
00207 dbg->de_copy_word = _dwarf_memcpy_swap_bytes;
00208 }
00209 #else
00210 dbg->de_big_endian_object = 0;
00211 if (ehdr_ident[EI_DATA] == ELFDATA2MSB) {
00212 dbg->de_same_endian = 0;
00213 dbg->de_big_endian_object = 1;
00214 dbg->de_copy_word = _dwarf_memcpy_swap_bytes;
00215 }
00216 #endif
00217
00218
00219
00220 dbg->de_length_size = is_64bit ? 8 : 4;
00221 dbg->de_pointer_size = is_64bit ? 8 : 4;
00222
00223
00224 #ifdef __SGI_FAST_LIBELF
00225
00226 #else
00227 #ifdef HAVE_ELF64_GETEHDR
00228 if (is_64bit) {
00229 ehdr64 = elf64_getehdr(elf);
00230 if (ehdr64 == NULL) {
00231 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_GETEHDR_ERROR,
00232 DW_DLV_ERROR);
00233 }
00234 section_count = ehdr64->e_shnum;
00235 machine = ehdr64->e_machine;
00236 } else
00237 #endif
00238 {
00239 ehdr32 = elf32_getehdr(elf);
00240 if (ehdr32 == NULL) {
00241 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_GETEHDR_ERROR,
00242 DW_DLV_ERROR);
00243 }
00244 section_count = ehdr32->e_shnum;
00245 machine = ehdr32->e_machine;
00246 }
00247 #endif
00248
00249 if (is_64bit && machine != EM_MIPS) {
00250
00251
00252
00253
00254 dbg->de_length_size = 4;
00255 }
00256
00257
00258 for (section_index = 1; section_index < section_count; ++section_index) {
00259
00260 #ifdef __SGI_FAST_LIBELF
00261 sres = elf_sgi_shdr(elf, section_index, &shdr);
00262 if (sres != ELF_SGI_ERROR_OK) {
00263 DWARF_DBG_ERROR(dbg, _dwarf_error_code_from_elf_sgi_error_code(sres),
00264 DW_DLV_ERROR);
00265 }
00266
00267 section_size = shdr.sh_size;
00268
00269 sres = elf_sgi_string(elf, ehdr.e_shstrndx, shdr.sh_name, (char const** )&scn_name);
00270 if (sres != ELF_SGI_ERROR_OK) {
00271 DWARF_DBG_ERROR(dbg, _dwarf_error_code_from_elf_sgi_error_code(sres),
00272 DW_DLV_ERROR);
00273 }
00274 #else
00275 scn = elf_getscn(elf, section_index);
00276 if (scn == NULL) {
00277 DWARF_DBG_ERROR(dbg, DW_DLE_MDE,
00278 DW_DLV_ERROR);
00279 }
00280
00281 #ifdef HAVE_ELF64_GETSHDR
00282 if (is_64bit) {
00283 shdr64 = elf64_getshdr(scn);
00284 if (shdr64 == NULL) {
00285 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_GETSHDR_ERROR,
00286 DW_DLV_ERROR);
00287 }
00288
00289 section_size = shdr64->sh_size;
00290
00291 if ((scn_name = elf_strptr(elf, ehdr64->e_shstrndx,
00292 shdr64->sh_name))
00293 == NULL) {
00294 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_STRPTR_ERROR,
00295 DW_DLV_ERROR);
00296 }
00297 } else
00298 #endif
00299 {
00300 if ((shdr32 = elf32_getshdr(scn)) == NULL) {
00301 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_GETSHDR_ERROR, 0);
00302 }
00303
00304 section_size = shdr32->sh_size;
00305
00306 if ((scn_name = elf_strptr(elf, ehdr32->e_shstrndx,
00307 shdr32->sh_name)) == NULL) {
00308 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_STRPTR_ERROR,
00309 DW_DLV_ERROR);
00310 }
00311 }
00312 #endif
00313
00314 if (strncmp(scn_name, ".debug_", 7)
00315 && strcmp(scn_name, ".eh_frame")
00316 )
00317 continue;
00318
00319 else if (strcmp(scn_name, ".debug_info") == 0) {
00320 if (dbg->de_debug_info != NULL) {
00321 DWARF_DBG_ERROR(dbg, DW_DLE_DEBUG_INFO_DUPLICATE,
00322 DW_DLV_ERROR);
00323 }
00324 if (section_size == 0) {
00325
00326 DWARF_DBG_ERROR(dbg, DW_DLE_DEBUG_INFO_NULL,
00327 DW_DLV_ERROR);
00328 }
00329 foundDwarf = TRUE;
00330 dbg->de_debug_info_index = section_index;
00331 dbg->de_debug_info_size = section_size;
00332 }
00333
00334 else if (strcmp(scn_name, ".debug_abbrev") == 0) {
00335 if (dbg->de_debug_abbrev != NULL) {
00336 DWARF_DBG_ERROR(dbg, DW_DLE_DEBUG_ABBREV_DUPLICATE,
00337 DW_DLV_ERROR);
00338 }
00339 if (section_size == 0) {
00340
00341 DWARF_DBG_ERROR(dbg, DW_DLE_DEBUG_ABBREV_NULL,
00342 DW_DLV_ERROR);
00343 }
00344 dbg->de_debug_abbrev_index = section_index;
00345 dbg->de_debug_abbrev_size = section_size;
00346 }
00347
00348 else if (strcmp(scn_name, ".debug_aranges") == 0) {
00349 if (dbg->de_debug_aranges_index != 0) {
00350 DWARF_DBG_ERROR(dbg,
00351 DW_DLE_DEBUG_ARANGES_DUPLICATE,
00352 DW_DLV_ERROR);
00353 }
00354 if (section_size == 0) {
00355
00356 continue;
00357 }
00358 dbg->de_debug_aranges_index = section_index;
00359 dbg->de_debug_aranges_size = section_size;
00360 }
00361
00362 else if (strcmp(scn_name, ".debug_line") == 0) {
00363 if (dbg->de_debug_line_index != 0) {
00364 DWARF_DBG_ERROR(dbg,
00365 DW_DLE_DEBUG_LINE_DUPLICATE,
00366 DW_DLV_ERROR);
00367 }
00368 if (section_size == 0) {
00369
00370 continue;
00371 }
00372 dbg->de_debug_line_index = section_index;
00373 dbg->de_debug_line_size = section_size;
00374 }
00375
00376 else if (strcmp(scn_name, ".debug_frame") == 0) {
00377 if (dbg->de_debug_frame_index != 0) {
00378 DWARF_DBG_ERROR(dbg,
00379 DW_DLE_DEBUG_FRAME_DUPLICATE,
00380 DW_DLV_ERROR);
00381 }
00382 if (section_size == 0) {
00383
00384 continue;
00385 }
00386 dbg->de_debug_frame_index = section_index;
00387 dbg->de_debug_frame_size = section_size;
00388 foundDwarf = TRUE;
00389 } else if (strcmp(scn_name, ".eh_frame") == 0) {
00390
00391 if (dbg->de_debug_frame_eh_gnu_index != 0) {
00392 DWARF_DBG_ERROR(dbg,
00393 DW_DLE_DEBUG_FRAME_DUPLICATE,
00394 DW_DLV_ERROR);
00395 }
00396 if (section_size == 0) {
00397
00398 continue;
00399 }
00400 dbg->de_debug_frame_eh_gnu_index = section_index;
00401 dbg->de_debug_frame_size_eh_gnu = section_size;
00402 foundDwarf = TRUE;
00403 }
00404
00405 else if (strcmp(scn_name, ".debug_loc") == 0) {
00406 if (dbg->de_debug_loc_index != 0) {
00407 DWARF_DBG_ERROR(dbg, DW_DLE_DEBUG_LOC_DUPLICATE,
00408 DW_DLV_ERROR);
00409 }
00410 if (section_size == 0) {
00411
00412 continue;
00413 }
00414 dbg->de_debug_loc_index = section_index;
00415 dbg->de_debug_loc_size = section_size;
00416 }
00417
00418
00419 else if (strcmp(scn_name, ".debug_pubnames") == 0) {
00420 if (dbg->de_debug_pubnames_index != 0) {
00421 DWARF_DBG_ERROR(dbg, DW_DLE_DEBUG_PUBNAMES_DUPLICATE,
00422 DW_DLV_ERROR);
00423 }
00424 if (section_size == 0) {
00425
00426 continue;
00427 }
00428 dbg->de_debug_pubnames_index = section_index;
00429 dbg->de_debug_pubnames_size = section_size;
00430 }
00431
00432 else if (strcmp(scn_name, ".debug_str") == 0) {
00433 if (dbg->de_debug_str_index != 0) {
00434 DWARF_DBG_ERROR(dbg,
00435 DW_DLE_DEBUG_STR_DUPLICATE,
00436 DW_DLV_ERROR);
00437 }
00438 if (section_size == 0) {
00439
00440 continue;
00441 }
00442 dbg->de_debug_str_index = section_index;
00443 dbg->de_debug_str_size = section_size;
00444 }
00445
00446 else if (strcmp(scn_name, ".debug_funcnames") == 0) {
00447 if (dbg->de_debug_funcnames_index != 0) {
00448 DWARF_DBG_ERROR(dbg,
00449 DW_DLE_DEBUG_FUNCNAMES_DUPLICATE,
00450 DW_DLV_ERROR);
00451 }
00452 if (section_size == 0) {
00453
00454 continue;
00455 }
00456 dbg->de_debug_funcnames_index = section_index;
00457 dbg->de_debug_funcnames_size = section_size;
00458 }
00459
00460 else if (strcmp(scn_name, ".debug_typenames") == 0) {
00461 if (dbg->de_debug_typenames_index != 0) {
00462 DWARF_DBG_ERROR(dbg,
00463 DW_DLE_DEBUG_TYPENAMES_DUPLICATE,
00464 DW_DLV_ERROR);
00465 }
00466 if (section_size == 0) {
00467
00468 continue;
00469 }
00470 dbg->de_debug_typenames_index = section_index;
00471 dbg->de_debug_typenames_size = section_size;
00472 }
00473
00474 else if (strcmp(scn_name, ".debug_varnames") == 0) {
00475 if (dbg->de_debug_varnames_index != 0) {
00476 DWARF_DBG_ERROR(dbg,
00477 DW_DLE_DEBUG_VARNAMES_DUPLICATE,
00478 DW_DLV_ERROR);
00479 }
00480 if (section_size == 0) {
00481
00482 continue;
00483 }
00484 dbg->de_debug_varnames_index = section_index;
00485 dbg->de_debug_varnames_size = section_size;
00486 }
00487
00488 else if (strcmp(scn_name, ".debug_weaknames") == 0) {
00489 if (dbg->de_debug_weaknames_index != 0) {
00490 DWARF_DBG_ERROR(dbg,
00491 DW_DLE_DEBUG_WEAKNAMES_DUPLICATE,
00492 DW_DLV_ERROR);
00493 }
00494 if (section_size == 0) {
00495
00496 continue;
00497 }
00498 dbg->de_debug_weaknames_index = section_index;
00499 dbg->de_debug_weaknames_size = section_size;
00500 } else if (strcmp(scn_name, ".debug_macinfo") == 0) {
00501 if (dbg->de_debug_macinfo_index != 0) {
00502 DWARF_DBG_ERROR(dbg,
00503 DW_DLE_DEBUG_MACINFO_DUPLICATE,
00504 DW_DLV_ERROR);
00505 }
00506 if (section_size == 0) {
00507
00508 continue;
00509 }
00510 dbg->de_debug_macinfo_index = section_index;
00511 dbg->de_debug_macinfo_size = section_size;
00512 }
00513 }
00514 if (foundDwarf) {
00515 return DW_DLV_OK;
00516 }
00517
00518 return (DW_DLV_NO_ENTRY);
00519 }
00520
00521
00522
00523
00524
00525
00526 int
00527 dwarf_init(int fd,
00528 Dwarf_Unsigned access,
00529 Dwarf_Handler errhand,
00530 Dwarf_Ptr errarg, Dwarf_Debug * ret_dbg, Dwarf_Error * error)
00531 {
00532 Dwarf_Debug dbg;
00533 struct stat fstat_buf;
00534 dwarf_elf_handle elf;
00535 int res;
00536 #ifdef __SGI_FAST_LIBELF
00537 enum elf_sgi_error_type sres;
00538 #else
00539 Elf_Cmd what_kind_of_elf_read;
00540 #endif
00541
00542 dbg = _dwarf_get_debug();
00543 if (dbg == NULL) {
00544 DWARF_DBG_ERROR(dbg, DW_DLE_DBG_ALLOC, DW_DLV_ERROR);
00545 }
00546 dbg->de_errhand = errhand;
00547 dbg->de_errarg = errarg;
00548
00549 if (fstat(fd, &fstat_buf) != 0) {
00550 DWARF_DBG_ERROR(dbg, DW_DLE_FSTAT_ERROR, DW_DLV_ERROR);
00551 }
00552 if (!S_ISREG(fstat_buf.st_mode)) {
00553 DWARF_DBG_ERROR(dbg, DW_DLE_FSTAT_MODE_ERROR, DW_DLV_ERROR);
00554 }
00555
00556 if (access != DW_DLC_READ) {
00557 DWARF_DBG_ERROR(dbg, DW_DLE_INIT_ACCESS_WRONG, DW_DLV_ERROR);
00558 }
00559 dbg->de_access = access;
00560
00561 #ifdef __SGI_FAST_LIBELF
00562 elf = elf_sgi_new();
00563 if (elf == NULL) {
00564 DWARF_DBG_ERROR(dbg, DW_DLE_MAF, DW_DLV_ERROR);
00565 }
00566
00567 sres = elf_sgi_begin_fd(elf, fd, 0);
00568 if (sres != ELF_SGI_ERROR_OK) {
00569 DWARF_DBG_ERROR(dbg, _dwarf_error_code_from_elf_sgi_error_code(sres),
00570 DW_DLV_ERROR);
00571 }
00572 #else
00573 elf_version(EV_CURRENT);
00574
00575 #ifdef HAVE_ELF_C_READ_MMAP
00576
00577
00578 what_kind_of_elf_read = ELF_C_READ_MMAP;
00579 #else
00580
00581 what_kind_of_elf_read = ELF_C_READ;
00582 #endif
00583
00584 if ((elf = elf_begin(fd, what_kind_of_elf_read, 0)) == NULL) {
00585 DWARF_DBG_ERROR(dbg, DW_DLE_ELF_BEGIN_ERROR, DW_DLV_ERROR);
00586 }
00587 #endif
00588
00589 dbg->de_elf_must_close = 1;
00590 if ((res = _dwarf_setup(dbg, elf, error)) != DW_DLV_OK) {
00591 free(dbg);
00592 return (res);
00593 }
00594
00595
00596 _dwarf_setup_debug(dbg);
00597
00598 *ret_dbg = dbg;
00599 return (DW_DLV_OK);
00600 }
00601
00602
00603
00604
00605
00606 int
00607 dwarf_elf_init(dwarf_elf_handle elf_file_pointer,
00608 Dwarf_Unsigned access,
00609 Dwarf_Handler errhand,
00610 Dwarf_Ptr errarg,
00611 Dwarf_Debug * ret_dbg, Dwarf_Error * error)
00612 {
00613 Dwarf_Debug dbg;
00614 int res;
00615
00616 dbg = _dwarf_get_debug();
00617 if (dbg == NULL) {
00618 DWARF_DBG_ERROR(dbg, DW_DLE_DBG_ALLOC, DW_DLV_ERROR);
00619 }
00620 dbg->de_errhand = errhand;
00621 dbg->de_errarg = errarg;
00622
00623 if (access != DW_DLC_READ) {
00624 DWARF_DBG_ERROR(dbg, DW_DLE_INIT_ACCESS_WRONG, DW_DLV_ERROR);
00625 }
00626 dbg->de_access = access;
00627
00628 dbg->de_elf_must_close = 0;
00629 if ((res = _dwarf_setup(dbg, elf_file_pointer, error)) != DW_DLV_OK) {
00630 free(dbg);
00631 return (res);
00632 }
00633
00634
00635 _dwarf_setup_debug(dbg);
00636
00637 *ret_dbg = dbg;
00638 return (DW_DLV_OK);
00639 }
00640
00641
00642
00643
00644
00645
00646
00647 int
00648 dwarf_finish(Dwarf_Debug dbg, Dwarf_Error * error)
00649 {
00650 int res = DW_DLV_OK;
00651 if(dbg->de_elf_must_close) {
00652
00653
00654
00655 #ifdef __SGI_FAST_LIBELF
00656 elf_sgi_free(dbg->de_elf);
00657 #else
00658 elf_end(dbg->de_elf);
00659 #endif
00660 }
00661
00662 res = _dwarf_free_all_of_one_debug(dbg);
00663 if (res == DW_DLV_ERROR) {
00664 DWARF_DBG_ERROR(dbg, DW_DLE_DBG_ALLOC, DW_DLV_ERROR);
00665 }
00666
00667 return res;
00668
00669
00670 }
00671
00672
00673
00674
00675
00676
00677 int
00678 dwarf_get_elf(Dwarf_Debug dbg, dwarf_elf_handle* elf, Dwarf_Error * error)
00679 {
00680 if (dbg == NULL) {
00681 _dwarf_error(NULL, error, DW_DLE_DBG_NULL);
00682 return (DW_DLV_ERROR);
00683 }
00684
00685 *elf = dbg->de_elf;
00686 return (DW_DLV_OK);
00687 }
00688
00689
00690
00691
00692
00693
00694
00695 int
00696 _dwarf_load_section(Dwarf_Debug dbg,
00697 Dwarf_Half section_index,
00698 Dwarf_Small ** section_data,
00699 Dwarf_Error * error)
00700 {
00701 if (section_index == 0) {
00702 return DW_DLV_NO_ENTRY;
00703 }
00704
00705
00706 if (*section_data != NULL) {
00707 return DW_DLV_OK;
00708 }
00709
00710 {
00711 #ifdef __SGI_FAST_LIBELF
00712 enum elf_sgi_error_type sres;
00713
00714 sres = elf_sgi_section(dbg->de_elf,
00715 section_index,
00716 (void**) section_data);
00717 if (sres != ELF_SGI_ERROR_OK) {
00718 DWARF_DBG_ERROR(dbg, _dwarf_error_code_from_elf_sgi_error_code(sres),
00719 DW_DLV_ERROR);
00720 }
00721 #else
00722 Elf_Scn* scn;
00723 Elf_Data* data;
00724
00725 scn = elf_getscn(dbg->de_elf, section_index);
00726 if (scn == NULL) {
00727 _dwarf_error(dbg, error, DW_DLE_MDE);
00728 return DW_DLV_ERROR;
00729 }
00730
00731
00732
00733
00734
00735
00736
00737
00738 data = elf_getdata(scn, NULL);
00739 if (data == NULL) {
00740 _dwarf_error(dbg, error, DW_DLE_MDE);
00741 return DW_DLV_ERROR;
00742 }
00743
00744 *section_data = data->d_buf;
00745 #endif
00746 }
00747
00748 return DW_DLV_OK;
00749 }