diff options
| author | ruki <[email protected]> | 2025-12-14 23:11:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-14 23:11:44 +0800 |
| commit | e9bf831cc47fa3f4c45d1fee4b6db29dae60319b (patch) | |
| tree | 9e833ac7fa11aa625f73fe1cab46525225bacc14 /core/src | |
| parent | 3a9dd63237efbe9e49ee026bc882c03c8622d722 (diff) | |
improve macho deplibs
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/binutils/macho/deplibs.c | 11 | ||||
| -rw-r--r-- | core/src/xmake/binutils/macho/prefix.h | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/core/src/xmake/binutils/macho/deplibs.c b/core/src/xmake/binutils/macho/deplibs.c index a18cb8488..77f4fd2f2 100644 --- a/core/src/xmake/binutils/macho/deplibs.c +++ b/core/src/xmake/binutils/macho/deplibs.c @@ -104,14 +104,9 @@ tb_bool_t xm_binutils_macho_deplibs(tb_stream_ref_t istream, tb_hize_t base_offs } xm_binutils_macho_swap_load_command(&lc, swap); - /* check for LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, LC_REEXPORT_DYLIB, LC_ID_DYLIB - * LC_LOAD_DYLIB = 0xc - * LC_ID_DYLIB = 0xd - * LC_LOAD_WEAK_DYLIB = 0x18 | 0x80000000 - * LC_REEXPORT_DYLIB = 0x1f | 0x80000000 - */ - - if (lc.cmd == 0xc || lc.cmd == 0xd || lc.cmd == (0x18 | 0x80000000) || lc.cmd == (0x1f | 0x80000000)) { + /* check for LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, LC_REEXPORT_DYLIB, LC_ID_DYLIB */ + if (lc.cmd == XM_MACHO_LC_LOAD_DYLIB || lc.cmd == XM_MACHO_LC_ID_DYLIB || + lc.cmd == XM_MACHO_LC_LOAD_WEAK_DYLIB || lc.cmd == XM_MACHO_LC_REEXPORT_DYLIB) { xm_macho_dylib_command_t dc; if (tb_stream_seek(istream, current_cmd_offset)) { diff --git a/core/src/xmake/binutils/macho/prefix.h b/core/src/xmake/binutils/macho/prefix.h index d8b8fa157..4216bbdd1 100644 --- a/core/src/xmake/binutils/macho/prefix.h +++ b/core/src/xmake/binutils/macho/prefix.h @@ -50,6 +50,10 @@ #define XM_MACHO_LC_SEGMENT 0x1 #define XM_MACHO_LC_SEGMENT_64 0x19 #define XM_MACHO_LC_SYMTAB 0x2 +#define XM_MACHO_LC_LOAD_DYLIB 0xc +#define XM_MACHO_LC_ID_DYLIB 0xd +#define XM_MACHO_LC_LOAD_WEAK_DYLIB (0x18 | 0x80000000) +#define XM_MACHO_LC_REEXPORT_DYLIB (0x1f | 0x80000000) #define XM_MACHO_LC_BUILD_VERSION 0x32 #define XM_MACHO_PLATFORM_MACOS 1 |
