- // nodes with export info: size, flags, address
- out.push_back(uleb128_size(fFlags) + uleb128_size(fAddress));
- append_uleb128(fFlags, out);
- append_uleb128(fAddress, out);
+ if ( fFlags & EXPORT_SYMBOL_FLAGS_REEXPORT ) {
+ if ( fImportedName != NULL ) {
+ // nodes with re-export info: size, flags, ordinal, string
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fOther) + strlen(fImportedName) + 1;
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fOther, out);
+ append_string(fImportedName, out);
+ }
+ else {
+ // nodes with re-export info: size, flags, ordinal, empty-string
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fOther) + 1;
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fOther, out);
+ out.push_back(0);
+ }
+ }
+ else if ( fFlags & EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER ) {
+ // nodes with export info: size, flags, address, other
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fAddress) + uleb128_size(fOther);
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fAddress, out);
+ append_uleb128(fOther, out);
+ }
+ else {
+ // nodes with export info: size, flags, address
+ uint32_t nodeSize = uleb128_size(fFlags) + uleb128_size(fAddress);
+ out.push_back(nodeSize);
+ append_uleb128(fFlags, out);
+ append_uleb128(fAddress, out);
+ }