LLVM  16.0.0git
llvm::objcopy::macho::WeakBindInfo Struct Reference

The location of the weak bind info inside the binary is described by LC_DYLD_INFO load command. More...

#include "ObjCopy/MachO/MachOObject.h"

Collaboration diagram for llvm::objcopy::macho::WeakBindInfo:
[legend]

## Public Attributes

ArrayRef< uint8_t > Opcodes

## Detailed Description

The location of the weak bind info inside the binary is described by LC_DYLD_INFO load command.

Some C++ programs require dyld to unique symbols so that all images in the process use the same copy of some code/data. This step is done after binding. The content of the weak_bind info is an opcode stream like the bind_info. But it is sorted alphabetically by symbol name. This enable dyld to walk all images with weak binding information in order and look for collisions. If there are no collisions, dyld does no updating. That means that some fixups are also encoded in the bind_info. For instance, all calls to "operator new" are first bound to libstdc++.dylib using the information in bind_info. Then if some image overrides operator new that is detected when the weak_bind information is processed and the call to operator new is then rebound.

Definition at line 244 of file MachOObject.h.

## ◆ Opcodes

 ArrayRef llvm::objcopy::macho::WeakBindInfo::Opcodes

Definition at line 247 of file MachOObject.h.

The documentation for this struct was generated from the following file: