Linking C and assembly for denotation-based verified compositional compilation
Zhang CHENG , Jiyang WU , Qinxiang CAO
Front. Comput. Sci. ›› 2027, Vol. 21 ›› Issue (6) : 2106203
Modern software often integrates assembly code into C programs for performance-critical tasks, such as big integer computation in the GMP library and cryptographic algorithms in the OpenSSL library. Though the formal semantics of C and assembly are well-studied, linking these languages for realistic compiler verification remains challenging due to their abstraction gap. In this article, we address the problem of linking C with assembly by introducing a denotation-based framework and we apply this framework to support verified compositional compilation (VCC) for C and x86 assembly in CompCert. Specifically, we propose a novel semantic transformation operator that systematically interprets the denotational semantics of assembly into that of C. This semantic transformation bridges the interaction differences between the two languages, enabling their semantic linking to be effectively implemented under a unified language interface. Furthermore, we demonstrate the soundness of such semantic linking by applying it to the context of VCC, where two key properties are proved: 1) the transformed C semantics is faithfully preserved by the original assembly semantics, and 2) this preservation is compositional with the compilation correctness of other open modules. As a result, our approach advances the use of denotational semantics for VCC when both C and assembly are involved. All results in this article are formally verified in the Coq proof assistant.
semantic transformation / denotational semantics / verified compositional compilation
| [1] |
|
| [2] |
|
| [3] |
|
| [4] |
|
| [5] |
|
| [6] |
|
| [7] |
|
| [8] |
|
| [9] |
|
| [10] |
|
| [11] |
|
| [12] |
|
| [13] |
|
| [14] |
|
| [15] |
|
| [16] |
|
| [17] |
|
| [18] |
|
| [19] |
|
| [20] |
|
| [21] |
Ramananandro T, Shao Z, Weng S C, Koenig J, Fu Y. A compositional semantics for verified separate compilation and linking. In: Proceedings of 2015 Conference on Certified Programs and Proofs. 2015, 3−14 |
| [22] |
|
| [23] |
Gu L, Vaynberg A, Ford B, Shao Z, Costanzo D. CertiKOS: a certified kernel for secure cloud computing. In: Proceedings of the 2nd Asia-Pacific Workshop on Systems. 2011, 3 |
| [24] |
|
| [25] |
|
| [26] |
|
| [27] |
|
| [28] |
Park D. On the semantics of fair parallelism. In: Proceedings of 1979 Copenhagen Winter School on Abstract Software Specifications. 1979, 504−526 |
| [29] |
|
| [30] |
|
| [31] |
|
| [32] |
|
| [33] |
|
| [34] |
|
| [35] |
|
| [36] |
|
| [37] |
|
| [38] |
|
| [39] |
|
| [40] |
|
| [41] |
|
Higher Education Press
/
| 〈 |
|
〉 |