this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #218 from bugaevc/dyld-usage

Output usage if dyld-multilib is launched with no arguments

authored by

Luboš Doležel and committed by
GitHub
f5a4e7a9 726567c1

+37 -1
+34 -1
src/dyld/dyld-multilib.c
··· 43 43 const char* decideFat(int fd, bool swapEndian); 44 44 int registerDeregister(const char* argv0, bool reg); 45 45 int registerDeregisterRun(const char* argv0, const char* bits, bool reg); 46 + void printHelp(const char* argv0); 46 47 47 48 int main(int argc, char** argv) 48 49 { ··· 51 52 const char* target = "64"; 52 53 bool reg; 53 54 char *progfile, *pos; 54 - 55 + 56 + if (argc < 2 || strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) 57 + { 58 + printHelp(argv[0]); 59 + return 1; 60 + } 61 + 55 62 if (argc == 2 && (reg = !strcmp(argv[1], "--register") || !strcmp(argv[1], "--deregister"))) 56 63 return registerDeregister(argv[0], reg); 57 64 ··· 169 176 } 170 177 } 171 178 179 + void printHelp(const char* argv0) 180 + { 181 + fprintf(stderr, "This is Darling dyld, a dynamic loader for Mach-O executables.\n\n"); 182 + fprintf(stderr, "Copyright (C) 2012-2016 Lubos Dolezel\n\n"); 172 183 184 + fprintf(stderr, "NOTE: This program shouldn't be normally invoked directly." 185 + " Use \"darling\" command instead.\n\n"); 186 + 187 + fprintf(stderr, "Usage:\n"); 188 + fprintf(stderr, "\t%s program-path [arguments...]\n", argv0); 189 + fprintf(stderr, "\t%s --register\n", argv0); 190 + fprintf(stderr, "\t%s --deregister\n\n", argv0); 191 + 192 + fprintf(stderr, "Environment variables:\n" 193 + "\tDYLD_DEBUG=expr - enable(+) or disable(-) debugging channels (debug, trace, error), e.g. +debug,-error\n" 194 + #ifdef HAS_DEBUG_HELPERS 195 + "\tDYLD_TRAMPOLINE=file - enable debugging trampolines, with argument info in file\n" 196 + "\tDYLD_IGN_MISSING_SYMS - replace missing symbols with a stub function\n\n" 197 + #endif 198 + "\tDYLD_ROOT_PATH=<path> - set the base for library path resolution (overrides autodetection)\n" 199 + "\tDYLD_BIND_AT_LAUNCH - force dyld to bind all lazy references on startup\n" 200 + "\tDYLD_PRINT_INITIALIZERS - print initializers when they are invoked\n" 201 + "\tDYLD_PRINT_LIBRARIES - print libraries when they are loaded\n" 202 + "\tDYLD_PRINT_SEGMENTS - print segments when they are mapped into memory\n" 203 + "\tDYLD_PRINT_BINDINGS - print out when binds/ext. relocs are being resolved\n" 204 + "\tDYLD_PRINT_RPATHS - print @rpath resolution attempts\n\n"); 205 + }
+3
src/dyld/dyld.cpp
··· 175 175 std::cerr << "This is Darling dyld for " ARCH_NAME ", a dynamic loader for Mach-O executables.\n\n"; 176 176 std::cerr << "Copyright (C) 2012-2016 Lubos Dolezel\n\n"; 177 177 178 + std::cerr << "NOTE: This program shouldn't be normally invoked directly." 179 + " Use \"darling\" command instead.\n\n"; 180 + 178 181 std::cerr << "Usage: " << argv0 << " program-path [arguments...]\n\n"; 179 182 180 183 std::cerr << "Environment variables:\n"