1

I'm little bit confused with the linker flags available on iOS.

This question may not be a good one accoring to the faq, but I don't know anything about the linker flags, and I'm curious about it. That's why I'm asking it here.

  1. What is the use of -ObjC linker flag ?
  2. What is the use of -all_load ?
  3. What is the use of -force_load ?

What are the other frequently used linker flags available for iOS ?

Please help me to understand the linker flag usage. Thanks in advance.

4

1 回答 1

2
  • -ObjC flag 使链接器加载定义了 Objective-C 类或类别的库中的每个目标文件。虽然此选项通常会导致更大的可执行文件(由于加载到应用程序中的附加目标代码),但它将允许成功创建包含现有类的类别的有效 Objective-C 静态库。
  • -all_load flag 强制链接器从它看到的每个存档中加载所有目标文件,即使是那些没有 Objective-C 代码的文件。
  • -force_load 选项后面必须跟一个存档的路径,并且该存档中的每个目标文件都将被加载。

有关更多信息,您可以阅读此文档

编辑

您可以在以下文档的 ld ManPage 中看到 ld 支持的所有标志

于 2013-05-10T13:10:44.653 回答