feat(sccf): 添加SCCF节类型查找功能并修复重复节添加问题

新增了sccf_sect_by_type函数用于按类型查找SCCF节,避免重复添加相同类型的节。

同时新增了sccfdump工具用于解析和显示SCCF文件内容,包括头部信息、节表、
符号表、重定位表以及十六进制内容转储功能,并支持中英文双语界面。

fix(builder): 注释掉未使用的缓冲区创建代码

由于emit stage为SCCF时不需要将构建器转换为缓冲区,注释掉相关代码以避免
不必要的内存分配和数据复制操作。
This commit is contained in:
zzy
2026-05-25 10:40:18 +08:00
parent 28f65f8775
commit c4467b8420
3 changed files with 358 additions and 6 deletions

View File

@@ -330,9 +330,9 @@ sstream_drop:
config.entry_point_symbol);
const sccf_t *sccf = sccf_builder_to_sccf(&sccf_builder);
if (config.emit_stage == SCC_EMIT_STAGE_SCCF) {
sccf_buffer_t buffer;
scc_vec_init(buffer);
sccf_builder_to_buffer(&sccf_builder, &buffer);
// sccf_buffer_t buffer;
// scc_vec_init(buffer);
// sccf_builder_to_buffer(&sccf_builder, &buffer);
if (fp == nullptr) {
scc_printf("output exe at %s\n", config.output_file);
} else {