diff options
| author | ruki <[email protected]> | 2025-12-09 00:33:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-09 00:33:18 +0800 |
| commit | 333af0b66dfe73fabb2c900bce00ba2d50bfe622 (patch) | |
| tree | b8e348021f5a4fff963d8d5de320e109339102ae /core/src | |
| parent | acd4bfbcf3b73349f6b56197f3c0f27f204cc135 (diff) | |
fix readsyms for macho
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/binutils/macho/prefix.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/xmake/binutils/macho/prefix.h b/core/src/xmake/binutils/macho/prefix.h index c11fbebb6..39ac857f1 100644 --- a/core/src/xmake/binutils/macho/prefix.h +++ b/core/src/xmake/binutils/macho/prefix.h @@ -326,7 +326,7 @@ static __tb_inline__ tb_uint32_t xm_binutils_macho_parse_version(tb_char_t const * * @param istream the input stream * @param strtab_offset the string table offset - * @param offset the string offset (relative to string table content, after size field) + * @param offset the string offset (nlist.strx, relative to string table start, including 4-byte size field) * @param name the buffer to store the string * @param name_size the size of the buffer * @return tb_true on success, tb_false on failure @@ -335,8 +335,8 @@ static __tb_inline__ tb_bool_t xm_binutils_macho_read_string(tb_stream_ref_t ist tb_assert_and_check_return_val(istream && name && name_size > 0, tb_false); tb_hize_t saved_pos = tb_stream_offset(istream); - // string table starts with 4-byte size field, so offset is from after that - if (!tb_stream_seek(istream, strtab_offset + 4 + offset)) { + // nlist.strx is offset from string table start (including 4-byte size field) + if (!tb_stream_seek(istream, strtab_offset + offset)) { return tb_false; } |
