Libdwarf upstream changes

This commit is contained in:
Jeremy 2023-10-01 12:00:47 -04:00
parent b46ebe7f54
commit 190a8d6bbb
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
7 changed files with 84 additions and 136 deletions

View File

@ -1152,16 +1152,8 @@ _dwarf_create_fde_from_after_start(Dwarf_Debug dbg,
return res; return res;
} }
frame_ptr = fp_updated; frame_ptr = fp_updated;
} else { } /* We know cieptr was set as was augt, no else needed
_dwarf_error_string(dbg, error, converity scan CID 323429 */
DW_DLE_AUG_DATA_LENGTH_BAD,
"DW_DLE_AUG_DATA_LENGTH_BAD: The "
"gcc augmentation cannot be read, "
"as no cie pointer is available "
"to get critical data, "
"Corrupt DWARF");
return DW_DLV_ERROR;
}
{ {
Dwarf_Unsigned adlen = 0; Dwarf_Unsigned adlen = 0;

View File

@ -106,7 +106,6 @@ dump_bytes(const char *msg,Dwarf_Small * start, long len)
} }
#endif /*0*/ #endif /*0*/
/* MACH-O and dwarf section names */ /* MACH-O and dwarf section names */
static struct macho_sect_names_s { static struct macho_sect_names_s {
char const *ms_moname; char const *ms_moname;
@ -256,17 +255,12 @@ macho_load_section (void *obj, Dwarf_Unsigned section_index,
return DW_DLV_NO_ENTRY; return DW_DLV_NO_ENTRY;
} }
void static void
_dwarf_destruct_macho_access( _dwarf_destruct_macho_internals(
struct Dwarf_Obj_Access_Interface_a_s *aip) dwarf_macho_object_access_internals_t *mp)
{ {
dwarf_macho_object_access_internals_t *mp = 0;
Dwarf_Unsigned i = 0; Dwarf_Unsigned i = 0;
if (!aip) {
return;
}
mp = (dwarf_macho_object_access_internals_t *)aip->ai_object;
if (mp->mo_destruct_close_fd) { if (mp->mo_destruct_close_fd) {
close(mp->mo_fd); close(mp->mo_fd);
mp->mo_fd = -1; mp->mo_fd = -1;
@ -294,6 +288,20 @@ _dwarf_destruct_macho_access(
mp->mo_dwarf_sections = 0; mp->mo_dwarf_sections = 0;
} }
free(mp); free(mp);
return;
}
void
_dwarf_destruct_macho_access(
struct Dwarf_Obj_Access_Interface_a_s *aip)
{
dwarf_macho_object_access_internals_t *mp = 0;
if (!aip) {
return;
}
mp = (dwarf_macho_object_access_internals_t *)aip->ai_object;
_dwarf_destruct_macho_internals(mp);
aip->ai_object = 0;
free(aip); free(aip);
return; return;
} }
@ -446,15 +454,6 @@ load_segment_command_content32(
ASNAR(mfp->mo_copy_word,msp->initprot,sc.initprot); ASNAR(mfp->mo_copy_word,msp->initprot,sc.initprot);
ASNAR(mfp->mo_copy_word,msp->nsects,sc.nsects); ASNAR(mfp->mo_copy_word,msp->nsects,sc.nsects);
if (msp->nsects >= mfp->mo_filesize) { if (msp->nsects >= mfp->mo_filesize) {
#if 0
printf("Reading sections macho32 fails,"
" mmp_offset %lu,"
" number of sections %lu,"
" filesize %lu\n",
(unsigned long)segoffset,
(unsigned long)msp->nsects,
(unsigned long)mfp->mo_filesize);
#endif
*errcode = DW_DLE_MACHO_CORRUPT_COMMAND; *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
@ -464,8 +463,6 @@ load_segment_command_content32(
return DW_DLV_OK; return DW_DLV_OK;
} }
void fuck() {}
static int static int
load_segment_command_content64( load_segment_command_content64(
dwarf_macho_object_access_internals_t *mfp, dwarf_macho_object_access_internals_t *mfp,
@ -484,7 +481,6 @@ load_segment_command_content64(
mmp->cmdsize > filesize || mmp->cmdsize > filesize ||
(mmp->cmdsize + segoffset) > filesize ) { (mmp->cmdsize + segoffset) > filesize ) {
*errcode = DW_DLE_MACHO_CORRUPT_COMMAND; *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
fuck();
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
res = RRMOA(mfp->mo_fd,&sc,inner+segoffset, res = RRMOA(mfp->mo_fd,&sc,inner+segoffset,
@ -504,30 +500,18 @@ load_segment_command_content64(
msp->filesize > filesize) { msp->filesize > filesize) {
/* corrupt */ /* corrupt */
*errcode = DW_DLE_MACHO_CORRUPT_COMMAND; *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
fuck();
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
if ((msp->fileoff+msp->filesize ) > filesize) { if ((msp->fileoff+msp->filesize ) > filesize) {
/* corrupt */ /* corrupt */
*errcode = DW_DLE_MACHO_CORRUPT_COMMAND; *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
fuck();
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
ASNAR(mfp->mo_copy_word,msp->maxprot,sc.maxprot); ASNAR(mfp->mo_copy_word,msp->maxprot,sc.maxprot);
ASNAR(mfp->mo_copy_word,msp->initprot,sc.initprot); ASNAR(mfp->mo_copy_word,msp->initprot,sc.initprot);
ASNAR(mfp->mo_copy_word,msp->nsects,sc.nsects); ASNAR(mfp->mo_copy_word,msp->nsects,sc.nsects);
if (msp->nsects >= mfp->mo_filesize) { if (msp->nsects >= mfp->mo_filesize) {
#if 0
printf("Reading sections macho 64 fails,"
" mmp_offset %lu,"
" number of sections %lu,"
" filesize %lu\n",
(unsigned long)segoffset,
(unsigned long)msp->nsects,
(unsigned long)mfp->mo_filesize);
#endif
*errcode = DW_DLE_MACHO_CORRUPT_COMMAND; *errcode = DW_DLE_MACHO_CORRUPT_COMMAND;
fuck();
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
ASNAR(mfp->mo_copy_word,msp->flags,sc.flags); ASNAR(mfp->mo_copy_word,msp->flags,sc.flags);
@ -572,6 +556,8 @@ _dwarf_macho_load_segment_commands(
++msp; ++msp;
} else { /* fall through, not a command of interest */ } } else { /* fall through, not a command of interest */ }
if (res != DW_DLV_OK) { if (res != DW_DLV_OK) {
free(mfp->mo_segment_commands);
mfp->mo_segment_commands = 0;
return res; return res;
} }
} }
@ -623,19 +609,11 @@ _dwarf_macho_load_dwarf_section_details32(
endoffset = curoff + sizeof(mosec); endoffset = curoff + sizeof(mosec);
if (curoff >= mfp->mo_filesize || if (curoff >= mfp->mo_filesize ||
endoffset > mfp->mo_filesize) { endoffset > mfp->mo_filesize) {
#if 0
printf("Reading sections details32 fails,"
" fileoffset %lu,"
" end-read offset %lu,"
" filesize %lu\n",
(unsigned long)curoff,
(unsigned long)endoffset,
(unsigned long)mfp->mo_filesize);
#endif
*errcode = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS; *errcode = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
res = RRMOA(mfp->mo_fd, &mosec, (off_t)(inner+curoff), sizeof(mosec), res = RRMOA(mfp->mo_fd, &mosec,
(off_t)(inner+curoff), sizeof(mosec),
(off_t)(inner+mfp->mo_filesize), errcode); (off_t)(inner+mfp->mo_filesize), errcode);
if (res != DW_DLV_OK) { if (res != DW_DLV_OK) {
return res; return res;
@ -712,15 +690,6 @@ _dwarf_macho_load_dwarf_section_details64(
endoffset = curoff + sizeof(mosec); endoffset = curoff + sizeof(mosec);
if (curoff >= mfp->mo_filesize || if (curoff >= mfp->mo_filesize ||
endoffset > mfp->mo_filesize) { endoffset > mfp->mo_filesize) {
#if 0
printf("Reading sections details64 fails,"
" fileoffset %lu,"
" end-read offset %lu,"
" filesize %lu\n",
(unsigned long)curoff,
(unsigned long)endoffset,
(unsigned long)mfp->mo_filesize);
#endif
*errcode = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS; *errcode = DW_DLE_MACHO_CORRUPT_SECTIONDETAILS;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
@ -840,6 +809,8 @@ _dwarf_load_macho_commands(
(off_t)(inner+curoff), sizeof(mc), (off_t)(inner+curoff), sizeof(mc),
(off_t)(inner+mfp->mo_filesize), errcode); (off_t)(inner+mfp->mo_filesize), errcode);
if (res != DW_DLV_OK) { if (res != DW_DLV_OK) {
free(mfp->mo_commands);
mfp->mo_commands = 0;
return res; return res;
} }
ASNAR(mfp->mo_copy_word,mcp->cmd,mc.cmd); ASNAR(mfp->mo_copy_word,mcp->cmd,mc.cmd);
@ -849,6 +820,8 @@ _dwarf_load_macho_commands(
if (mcp->cmdsize > mfp->mo_filesize || if (mcp->cmdsize > mfp->mo_filesize ||
curoff > mfp->mo_filesize) { curoff > mfp->mo_filesize) {
/* corrupt object */ /* corrupt object */
free(mfp->mo_commands);
mfp->mo_commands = 0;
*errcode = DW_DLE_FILE_OFFSET_BAD; *errcode = DW_DLE_FILE_OFFSET_BAD;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
@ -859,9 +832,15 @@ _dwarf_load_macho_commands(
mfp->mo_segment_count = segment_command_count; mfp->mo_segment_count = segment_command_count;
res = _dwarf_macho_load_segment_commands(mfp,errcode); res = _dwarf_macho_load_segment_commands(mfp,errcode);
if (res != DW_DLV_OK) { if (res != DW_DLV_OK) {
free(mfp->mo_commands);
mfp->mo_commands = 0;
return res; return res;
} }
res = _dwarf_macho_load_dwarf_sections(mfp,errcode); res = _dwarf_macho_load_dwarf_sections(mfp,errcode);
if (res != DW_DLV_OK) {
free(mfp->mo_commands);
mfp->mo_commands = 0;
}
return res; return res;
} }
int int
@ -1008,10 +987,8 @@ _dwarf_macho_object_access_internals_init(
Dwarf_Unsigned filesize, Dwarf_Unsigned filesize,
int *errcode) int *errcode)
{ {
dwarf_macho_object_access_internals_t * intfc = internals;
Dwarf_Unsigned i = 0; Dwarf_Unsigned i = 0;
struct generic_macho_section *sp = 0; struct generic_macho_section *sp = 0;
struct Dwarf_Obj_Access_Interface_a_s *localdoas;
int res = 0; int res = 0;
unsigned int ftypei = ftype; unsigned int ftypei = ftype;
unsigned int endiani = endian; unsigned int endiani = endian;
@ -1020,15 +997,6 @@ _dwarf_macho_object_access_internals_init(
Dwarf_Unsigned fileoffseti = 0; Dwarf_Unsigned fileoffseti = 0;
unsigned int unibinarycounti = 0; unsigned int unibinarycounti = 0;
/* Must malloc as _dwarf_destruct_macho_access()
forces that due to other uses. */
localdoas = (struct Dwarf_Obj_Access_Interface_a_s *)
malloc(sizeof(struct Dwarf_Obj_Access_Interface_a_s));
if (!localdoas) {
free(internals);
*errcode = DW_DLE_ALLOC_FAIL;
return DW_DLV_ERROR;
}
if (ftype == DW_FTYPE_APPLEUNIVERSAL) { if (ftype == DW_FTYPE_APPLEUNIVERSAL) {
res = _dwarf_macho_inner_object_fd(fd, res = _dwarf_macho_inner_object_fd(fd,
uninumber, uninumber,
@ -1045,63 +1013,54 @@ _dwarf_macho_object_access_internals_init(
endian = endiani; endian = endiani;
} }
memset(localdoas,0, internals->mo_ident[0] = 'M';
sizeof(struct Dwarf_Obj_Access_Interface_a_s)); internals->mo_ident[1] = '1';
intfc->mo_ident[0] = 'M'; internals->mo_fd = fd;
intfc->mo_ident[1] = '1'; internals->mo_offsetsize = offsetsizei;
intfc->mo_fd = fd; internals->mo_pointersize = offsetsizei;
intfc->mo_offsetsize = offsetsizei; internals->mo_inner_offset = fileoffseti;
intfc->mo_pointersize = offsetsizei; internals->mo_filesize = filesizei;
intfc->mo_inner_offset = fileoffseti; internals->mo_ftype = ftypei;
intfc->mo_filesize = filesizei; internals->mo_uninumber = uninumber;
intfc->mo_ftype = ftypei; internals->mo_universal_count = unibinarycounti;
intfc->mo_uninumber = uninumber;
intfc->mo_universal_count = unibinarycounti;
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
if (endian == DW_END_little ) { if (endian == DW_END_little ) {
intfc->mo_copy_word = _dwarf_memcpy_swap_bytes; internals->mo_copy_word = _dwarf_memcpy_swap_bytes;
intfc->mo_endian = DW_END_little; internals->mo_endian = DW_END_little;
} else { } else {
intfc->mo_copy_word = _dwarf_memcpy_noswap_bytes; internals->mo_copy_word = _dwarf_memcpy_noswap_bytes;
intfc->mo_endian = DW_END_big; internals->mo_endian = DW_END_big;
} }
#else /* LITTLE ENDIAN */ #else /* LITTLE ENDIAN */
if (endian == DW_END_little ) { if (endian == DW_END_little ) {
intfc->mo_copy_word = _dwarf_memcpy_noswap_bytes; internals->mo_copy_word = _dwarf_memcpy_noswap_bytes;
intfc->mo_endian = DW_END_little; internals->mo_endian = DW_END_little;
} else { } else {
intfc->mo_copy_word = _dwarf_memcpy_swap_bytes; internals->mo_copy_word = _dwarf_memcpy_swap_bytes;
intfc->mo_endian = DW_END_big; internals->mo_endian = DW_END_big;
} }
#endif /* LITTLE- BIG-ENDIAN */ #endif /* LITTLE- BIG-ENDIAN */
res = _dwarf_load_macho_header(intfc,errcode); res = _dwarf_load_macho_header(internals,errcode);
if (res != DW_DLV_OK) { if (res != DW_DLV_OK) {
localdoas->ai_object = intfc;
localdoas->ai_methods = 0;
_dwarf_destruct_macho_access(localdoas);
return res; return res;
} }
/* Load sections */ /* Load sections */
res = _dwarf_load_macho_commands(intfc,errcode); res = _dwarf_load_macho_commands(internals,errcode);
if (res != DW_DLV_OK) { if (res != DW_DLV_OK) {
localdoas->ai_object = intfc;
localdoas->ai_methods = 0;
_dwarf_destruct_macho_access(localdoas);
return res; return res;
} }
if (intfc->mo_dwarf_sections) { if (internals->mo_dwarf_sections) {
sp = intfc->mo_dwarf_sections+1; sp = internals->mo_dwarf_sections+1;
} else { } else {
/* There are no dwarf sections, /* There are no dwarf sections,
count better be zero. */ count better be zero. */
if (intfc->mo_dwarf_sectioncount) { if (internals->mo_dwarf_sectioncount) {
_dwarf_destruct_macho_access(localdoas);
*errcode = DW_DLE_MACHO_CORRUPT_HEADER; *errcode = DW_DLE_MACHO_CORRUPT_HEADER;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
} }
for (i = 1; i < intfc->mo_dwarf_sectioncount ; ++i,++sp) { for (i = 1; i < internals->mo_dwarf_sectioncount ; ++i,++sp) {
int j = 1; int j = 1;
int lim = sizeof(SectionNames)/sizeof(SectionNames[0]); int lim = sizeof(SectionNames)/sizeof(SectionNames[0]);
sp->dwarfsectname = ""; sp->dwarfsectname = "";
@ -1112,7 +1071,6 @@ _dwarf_macho_object_access_internals_init(
} }
} }
} }
free(localdoas);
return DW_DLV_OK; return DW_DLV_OK;
} }
@ -1128,7 +1086,6 @@ _dwarf_macho_object_access_init(
Dwarf_Obj_Access_Interface_a **binary_interface, Dwarf_Obj_Access_Interface_a **binary_interface,
int *localerrnum) int *localerrnum)
{ {
int res = 0; int res = 0;
dwarf_macho_object_access_internals_t *internals = 0; dwarf_macho_object_access_internals_t *internals = 0;
Dwarf_Obj_Access_Interface_a *intfc = 0; Dwarf_Obj_Access_Interface_a *intfc = 0;
@ -1149,14 +1106,13 @@ _dwarf_macho_object_access_init(
filesize, filesize,
localerrnum); localerrnum);
if (res != DW_DLV_OK){ if (res != DW_DLV_OK){
/* *err is already set and the call freed internals. */ _dwarf_destruct_macho_internals(internals);
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
intfc = malloc(sizeof(Dwarf_Obj_Access_Interface_a)); intfc = malloc(sizeof(Dwarf_Obj_Access_Interface_a));
if (!intfc) { if (!intfc) {
/* Impossible case, we hope. Give up. */ /* Impossible case, we hope. Give up. */
free(internals); _dwarf_destruct_macho_internals(internals);
*localerrnum = DW_DLE_ALLOC_FAIL; *localerrnum = DW_DLE_ALLOC_FAIL;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
@ -1185,7 +1141,7 @@ static int
fill_in_uni_arch_32( fill_in_uni_arch_32(
struct fat_arch * fa, struct fat_arch * fa,
struct Dwarf_Universal_Head_s *duhd, struct Dwarf_Universal_Head_s *duhd,
void (*word_swap) (void *, const void *, size_t)) void (*word_swap) (void *, const void *, unsigned long))
{ {
Dwarf_Unsigned i = 0; Dwarf_Unsigned i = 0;
struct Dwarf_Universal_Arch_s * dua = 0; struct Dwarf_Universal_Arch_s * dua = 0;
@ -1206,7 +1162,7 @@ static int
fill_in_uni_arch_64( fill_in_uni_arch_64(
struct fat_arch_64 * fa, struct fat_arch_64 * fa,
struct Dwarf_Universal_Head_s *duhd, struct Dwarf_Universal_Head_s *duhd,
void (*word_swap) (void *, const void *, size_t)) void (*word_swap) (void *, const void *, unsigned long))
{ {
Dwarf_Unsigned i = 0; Dwarf_Unsigned i = 0;
struct Dwarf_Universal_Arch_s * dua = 0; struct Dwarf_Universal_Arch_s * dua = 0;
@ -1238,7 +1194,7 @@ _dwarf_object_detector_universal_head_fd(
struct Dwarf_Universal_Head_s *duhdp = 0; struct Dwarf_Universal_Head_s *duhdp = 0;
struct fat_header fh; struct fat_header fh;
int res = 0; int res = 0;
void (*word_swap) (void *, const void *, size_t); void (*word_swap) (void *, const void *, unsigned long);
int locendian = 0; int locendian = 0;
int locoffsetsize = 0; int locoffsetsize = 0;
@ -1247,8 +1203,6 @@ _dwarf_object_detector_universal_head_fd(
/* A universal head is always at offset zero. */ /* A universal head is always at offset zero. */
res = RRMOA(fd,&fh,0,sizeof(fh), dw_filesize,errcode); res = RRMOA(fd,&fh,0,sizeof(fh), dw_filesize,errcode);
if (res != DW_DLV_OK) { if (res != DW_DLV_OK) {
printf("Reading struct for universal binary "
"header failed\n");
return res; return res;
} }
duhd.au_magic = magic_copy((unsigned char *)&fh.magic[0],4); duhd.au_magic = magic_copy((unsigned char *)&fh.magic[0],4);
@ -1265,7 +1219,6 @@ _dwarf_object_detector_universal_head_fd(
locendian = DW_END_little; locendian = DW_END_little;
locoffsetsize = 64; locoffsetsize = 64;
} else { } else {
printf("Reading magic number universal compare failed " "Inconsistent\n");
*errcode = DW_DLE_FILE_WRONG_TYPE; *errcode = DW_DLE_FILE_WRONG_TYPE;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
@ -1306,6 +1259,13 @@ printf("Reading magic number universal compare failed " "Inconsistent\n");
free(fa); free(fa);
return res; return res;
} }
if (duhd.au_count*sizeof(*fa) >= dw_filesize) {
free(duhd.au_arches);
duhd.au_arches = 0;
free(fa);
*errcode = DW_DLE_FILE_OFFSET_BAD;
return DW_DLV_ERROR;
}
res = RRMOA(fd,fa,/*offset=*/sizeof(fh), res = RRMOA(fd,fa,/*offset=*/sizeof(fh),
duhd.au_count*sizeof(*fa), duhd.au_count*sizeof(*fa),
dw_filesize,errcode); dw_filesize,errcode);
@ -1334,6 +1294,13 @@ printf("Reading magic number universal compare failed " "Inconsistent\n");
duhd.au_arches = 0; duhd.au_arches = 0;
return res; return res;
} }
if (duhd.au_count*sizeof(*fa) >= dw_filesize) {
free(duhd.au_arches);
duhd.au_arches = 0;
free(fa);
*errcode = DW_DLE_FILE_OFFSET_BAD ;
return DW_DLV_ERROR;
}
res = RRMOA(fd,fa,/*offset*/sizeof(fh), res = RRMOA(fd,fa,/*offset*/sizeof(fh),
duhd.au_count*sizeof(fa), duhd.au_count*sizeof(fa),
dw_filesize,errcode); dw_filesize,errcode);
@ -1395,17 +1362,10 @@ _dwarf_object_detector_universal_instance(
struct Dwarf_Universal_Arch_s* arch = 0; struct Dwarf_Universal_Arch_s* arch = 0;
if (!dw_head) { if (!dw_head) {
printf("Missing argument to "
"dwarf_object_detector_universal_instance");
*errcode = DW_DLE_UNIVERSAL_BINARY_ERROR; *errcode = DW_DLE_UNIVERSAL_BINARY_ERROR;
return DW_DLV_ERROR; return DW_DLV_ERROR;
} }
if (dw_index_of >= dw_head->au_count){ if (dw_index_of >= dw_head->au_count){
printf("Requested index 0x%lu"
" to specific binary "
"is too larg: valid: 0 to 0x%lu\n",
(unsigned long)dw_index_of,
(unsigned long)dw_head->au_count);
return DW_DLV_NO_ENTRY; return DW_DLV_NO_ENTRY;
} }
arch = dw_head->au_arches +dw_index_of; arch = dw_head->au_arches +dw_index_of;
@ -1414,9 +1374,6 @@ printf("Requested index 0x%lu"
*dw_offset = arch->au_offset; *dw_offset = arch->au_offset;
*dw_size = arch->au_size; *dw_size = arch->au_size;
*dw_align = arch->au_align; *dw_align = arch->au_align;
#if 0
print_arch_item(dw_index_of,arch);
#endif
return DW_DLV_OK; return DW_DLV_OK;
} }

View File

@ -58,10 +58,11 @@ _dwarf_memcpy_swap_bytes(void *s1,
unsigned char *targ = (unsigned char *) s1; unsigned char *targ = (unsigned char *) s1;
const unsigned char *src = (const unsigned char *) s2; const unsigned char *src = (const unsigned char *) s2;
unsigned long i = 0; unsigned long i = 0;
unsigned long n = len-1; unsigned long n = (long)(len-1);
if (len > 8) { if (len > 8) {
/* Not writing an integer, we think, so /* Really we should not be here!
Not writing an integer, we think, so
best to not swap bytes! */ best to not swap bytes! */
memcpy(s1,s2,(size_t)len); memcpy(s1,s2,(size_t)len);
return; return;

View File

@ -1,5 +1,5 @@
/* Generated routines, do not edit. */ /* Generated routines, do not edit. */
/* Generated for source version 0.8.0 */ /* Generated for source version 0.8.1 */
/* BEGIN FILE */ /* BEGIN FILE */

View File

@ -464,7 +464,6 @@ is_mach_o_universal(struct elf_header *h,
return TRUE; return TRUE;
} }
static int static int
is_mach_o_magic(struct elf_header *h, is_mach_o_magic(struct elf_header *h,
unsigned *endian, unsigned *endian,

View File

@ -2127,4 +2127,3 @@ dwarf_get_universalbinary_count(
} }
return DW_DLV_OK; return DW_DLV_OK;
} }