dyld

Faulty TensorFlow C install on MacOS?: dyld errors “Library not loaded: @rpath/libtensorflow.1.dylib” and “Symbol not found: __cg_DGifCloseFile”

筅森魡賤 提交于 2021-02-19 09:01:27
问题 Question How should I install the TensorFlow C library on MacOS or otherwise address the errors: dyld: Library not loaded: @rpath/libtensorflow.1.dylib Referenced from: /Users/Me/./hello_tf Reason: image not found Abort trap: 6 and dyld: Symbol not found: __cg_DGifCloseFile Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /usr/local/lib/libGIF.dylib in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO Abort trap: 6 Context I followed

Why does LC_SYMTAB have invalid stroff/strsize but only for some loaded images?

筅森魡賤 提交于 2021-02-19 03:10:23
问题 I wrote the below program to iterate over all images in memory and dump their string tables. #include <mach-o/dyld.h> #include <stdio.h> #include <string.h> int main(int argc, char** argv) { uint32_t count = _dyld_image_count(); for (uint32_t i = 0 ; i < count ; i++) { const char* imageName = _dyld_get_image_name(i); printf("IMAGE[%u]=%s\n", i, imageName); const struct mach_header* header = _dyld_get_image_header(i); if (header->magic != MH_MAGIC_64) continue; struct mach_header_64* header64

What path does @loader_path resolve to?

半腔热情 提交于 2021-02-18 20:11:34
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

What path does @loader_path resolve to?

好久不见. 提交于 2021-02-18 20:05:23
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

What path does @loader_path resolve to?

随声附和 提交于 2021-02-18 20:05:21
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

What path does @loader_path resolve to?

我是研究僧i 提交于 2021-02-18 20:04:08
问题 I'm having a hard time understanding the absolute path that a @loader_path within a file refers to. user@local:~$ otool -L zlib.so zlib.so: @loader_path/../../libz.1.dylib (compatibility version 1.0.0, current version 1.2.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) I want to know where the system looks to find libz.1.dylib. From some Mac documentation: @loader_path/ This

Why is __LINKEDIT sometimes 0x1000 off?

£可爱£侵袭症+ 提交于 2021-02-07 19:17:05
问题 Parsing an already-loaded Mach-O binary in memory... Sometimes the string table, symbol table, etc, are where they should be, and sometimes they're 0x1000 off. For example, I might run my program and baseOffset + cmd->symoff is accurate. Then I'll unit test and baseOffset + cmd->symoff + 0x1000 is accurate. baseOffset is always valid and pointing to a valid Mach header. 回答1: I figured it out by looking at dyld source code... It's not guarenteed to be 0x1000 off, however, the link edit offset

Why is __LINKEDIT sometimes 0x1000 off?

一世执手 提交于 2021-02-07 19:17:00
问题 Parsing an already-loaded Mach-O binary in memory... Sometimes the string table, symbol table, etc, are where they should be, and sometimes they're 0x1000 off. For example, I might run my program and baseOffset + cmd->symoff is accurate. Then I'll unit test and baseOffset + cmd->symoff + 0x1000 is accurate. baseOffset is always valid and pointing to a valid Mach header. 回答1: I figured it out by looking at dyld source code... It's not guarenteed to be 0x1000 off, however, the link edit offset

What does “expected in: flat namespace” mean?

与世无争的帅哥 提交于 2021-02-05 20:32:44
问题 The OS X dynamic loader often gives errors like Symbol not found: <some symbol name> Referenced from: <lib location> Expected in: flat namespace If you search for the error you'll find a ton of errors that have it. I understand roughly that the problem is an incorrect linking, but none of the answers explain what "flat namespace" means here, exactly. 回答1: Disclaimer: This answer only applies to macOS 10.4 and higher. E.g. In previous versions of 'OSX' flat-namespaces were the default. And on

What does “expected in: flat namespace” mean?

醉酒当歌 提交于 2021-02-05 20:32:15
问题 The OS X dynamic loader often gives errors like Symbol not found: <some symbol name> Referenced from: <lib location> Expected in: flat namespace If you search for the error you'll find a ton of errors that have it. I understand roughly that the problem is an incorrect linking, but none of the answers explain what "flat namespace" means here, exactly. 回答1: Disclaimer: This answer only applies to macOS 10.4 and higher. E.g. In previous versions of 'OSX' flat-namespaces were the default. And on