【2025-11-16】现有代码上传

This commit is contained in:
hym816
2025-11-16 21:04:02 +08:00
parent 6e114d8735
commit d71eb4576e
28 changed files with 11524 additions and 0 deletions

18
ObjectFileGenerator.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef OBJECT_FILE_GENERATOR_H
#define OBJECT_FILE_GENERATOR_H
#include <vector>
#include <cstdint>
#include <string>
/// 把一段 32-bit ARM64 指令流写成一个 Mach-O 64-bit relocatable object (.o) 文件
class ObjectFileGenerator {
public:
/// \param filename 输出文件名,比如 "out.o"
/// \param code 每个元素是一条 32-bit 小端机器指令
/// \return true 成功false 失败
static bool writeObject(const std::string &filename,
const std::vector<uint32_t> &code);
};
#endif // OBJECT_FILE_GENERATOR_H