知识卡片

普通读书笔记卡 · 6074.h.1.a.1.b

符号匹配不等于类型匹配

理解等级:中级

链接器主要按符号把引用连接到定义,C风格名通常不含完整参数信息,因此错误签名也可能链接成功。C++与Rust修饰名包含额外区分信息,但也不是完整类型安全证明。nm与反修饰工具可观察符号,接口正确仍需由两侧声明与ABI契约保证。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Chapter 6. Beyond Standard Rust Name mangling · 查看原书依据

      Name mangling Compiled languages generally support separate compilation, where different parts of the program are converted into machine code as separate chunks (object files), which can then be combined into a complete program by the linker. This means that if only one small part of the program’s source code changes, only the corresponding object file needs

    参考来源

    - 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第6章《Name mangling》(spine10;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch06.html;u177-ch06-010)。 - 结论依据:原文在“Name mangling”附近的定义、例子或代码支撑本卡核心说明:链接器主要按符号把引用连接到定义,C风格名通常不含完整参数信息,因此错误签名也可能链接成功。边界按已读前提解释;示例未执行。 - 原始内容:Name mangling Compiled languages generally support separate compilation, where different parts of the program are converted into machine code as separate chunks (object files), which can then be combined into a complete program by the linker. This means that if only one small part of the program’s source code changes, only the corresponding object file needs