Skip to content

Instantly share code, notes, and snippets.

View jroelofs's full-sized avatar

Jon Roelofs jroelofs

View GitHub Profile
@jroelofs
jroelofs / gist:dbcdbd23f1c1e7a5f539
Created June 17, 2014 17:11
-ffreestanding memcpy for copy-ctors
$ cat copy_ctor.cpp
struct Foo {
char big[10240];
};
Foo fooCopy(const Foo * const in) {
return Foo(*in);
}
$ ./clang++ -target arm-none-eabi copy_ctor.cpp -c
@jroelofs
jroelofs / gist:3659bed8c1a7751bc5dc
Last active August 29, 2015 14:02
CLANG: objdump of libcxx/test/iterators/predef.iterators/insert.iterators/front.insert.iter.ops/front.insert.iter.op=/rv_value.pass.cpp built with -Os
rv_value.pass.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <main>:
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@jroelofs
jroelofs / gist:e0562ebf40d83ab6dd5e
Last active August 29, 2015 14:01
-fintegrated-as vs -fno-integrated-as bug
[15:00:32] ✘ jroelofs@build1-lucid-cs arm-none-eabi-lite$ cat foobar.c
#if defined(MACRO_OUTSIDE)
asm(
".macro RETURN cond=\n\t"
"bx\\cond lr\n\t"
".endm\n\t"
);
#endif
char* __attribute__((naked))