Skip to content

Commit c62feac

Browse files
authored
Merge pull request #1 from jim-lake/main
handle re-export too
2 parents 086e07e + ad4eb61 commit c62feac

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

macher.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,13 @@ static int print_command(Slice slice, mach_o_command *command, char **args)
436436
(char *) command->data + dl->dylib.name.offset);
437437
}
438438
break;
439+
case LC_REEXPORT_DYLIB & ~LC_REQ_DYLD:
440+
{
441+
struct dylib_command *dl = (struct dylib_command *)command->data;
442+
printf(" LC_REEXPORT_DYLIB: %s\n",
443+
(char *) command->data + dl->dylib.name.offset);
444+
}
445+
break;
439446
case LC_UUID:
440447
{
441448
struct uuid_command *uu = (struct uuid_command *)command->data;
@@ -629,9 +636,9 @@ static int edit_libpath(Slice slice, mach_o_command *command, char **args)
629636
char *newpath = args[0], *oldpath = args[1];
630637
struct dylib_command *dc = (struct dylib_command *) command->data;
631638
char *current_libpath = (char *) dc + dc->dylib.name.offset;
632-
if (command->lc.cmd != LC_LOAD_DYLIB) {
639+
if (command->lc.cmd != LC_LOAD_DYLIB && command->lc.cmd != LC_REEXPORT_DYLIB) {
633640
if (command - slice->commands == slice->num_commands - 1) {
634-
printf("No LC_LOAD_DYLIB command matches %s.\n",
641+
printf("No LC_LOAD_DYLIB or LC_REEXPORT_DYLIB command matches %s.\n",
635642
oldpath == NULL ? basename(newpath) : oldpath);
636643
}
637644
return 0;

0 commit comments

Comments
 (0)