Skip to content

Instantly share code, notes, and snippets.



Created Jun 15, 2016
What would you like to do?
what's the story with AS_CFI_PSEUDO_OP tests
#include <stdio.h>
// run: clang -S hi2.c
int main(){
.file "hi2.c"
.globl main
.align 16, 0x90
.type main,@function
main: # @main
# BB#0: # %entry
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset %rbp, -16
movq %rsp, %rbp
.cfi_def_cfa_register %rbp
subq $16, %rsp
movabsq $.L.str, %rdi
movb $0, %al
callq printf
xorl %ecx, %ecx
movl %eax, -4(%rbp) # 4-byte Spill
movl %ecx, %eax
addq $16, %rsp
popq %rbp
.size main, .Lfunc_end0-main
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.asciz "HI"
.size .L.str, 3
.ident "clang version 3.8.0 (tags/RELEASE_380/final)"
.section ".note.GNU-stack","",@progbits
// run: clang --target=armv8a--linux-gnueabi -c test_cfi_pseudo_op.c
// (assuming your llvm supports to the target, works!)
// run: clang -c test_cfi_pseudo_opt.c
// on most desktop, that won't compile, despite clang -S hi2.c producing cfi_startproc
// in the same architecture. confusing
int main() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment