Skip to content

Instantly share code, notes, and snippets.

@Bigcheese
Created October 5, 2015 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bigcheese/b258f5fa9a4928fcf906 to your computer and use it in GitHub Desktop.
Save Bigcheese/b258f5fa9a4928fcf906 to your computer and use it in GitHub Desktop.
llvm-mc -filetype=obj -triple x86_64-linux -o uw-0.o uw-0.s
llvm-mc -filetype=obj -triple x86_64-linux -o uw-1.o uw-1.s
llvm-mc -filetype=obj -triple x86_64-linux -o uw-2.o uw-2.s
llvm-ar cr uw1.a uw-1.o
llvm-ar cr uw2.a uw-2.o
ld -o uw uw-0.o --start-group uw1.a uw2.a --end-group
ld.lld2 -o uw uw-0.o --start-group uw1.a uw2.a --end-group
.text
.global _start
_start:
call magic
.data
.weak _nl_C_LC_COLLATE
.quad _nl_C_LC_COLLATE
.rodata
.global _nl_C_LC_COLLATE
_nl_C_LC_COLLATE:
.quad 1
.text
.global magic
magic:
nop
.data
.quad _nl_C_LC_COLLATE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment