A load command representing some aspect of shared libraries, depending on filetype. Corresponds to LC_ID_DYLIB, LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, and LC_REEXPORT_DYLIB.
@see MachOStructure::FORMAT @api private
@see MachOStructure::SIZEOF @api private
@return [Fixnum] the library's compatibility version number
@return [Fixnum] the library's current version number
@return [LCStr] the library's path
name as an LCStr
@return [Fixnum] the library's build time stamp
@api private
# File lib/macho/load_commands.rb, line 487 def initialize(view, cmd, cmdsize, name, timestamp, current_version, compatibility_version) super(view, cmd, cmdsize) @name = LCStr.new(self, name) @timestamp = timestamp @current_version = current_version @compatibility_version = compatibility_version end
@param context [SerializationContext]
the context
@return [String] the serialized fields of the load command @api private
# File lib/macho/load_commands.rb, line 500 def serialize(context) format = Utils.specialize_format(FORMAT, context.endianness) string_payload, string_offsets = Utils.pack_strings(SIZEOF, context.alignment, :name => name.to_s) cmdsize = SIZEOF + string_payload.bytesize [cmd, cmdsize, string_offsets[:name], timestamp, current_version, compatibility_version].pack(format) + string_payload end