Skip to content

Instantly share code, notes, and snippets.

@jasonbking
Created April 4, 2020 03:51
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 jasonbking/862ec40b73bf119c2c02f95f8b8e4661 to your computer and use it in GitHub Desktop.
Save jasonbking/862ec40b73bf119c2c02f95f8b8e4661 to your computer and use it in GitHub Desktop.
CFI-ed _start
diff --git a/usr/src/lib/crt/amd64/mach-crt1.s b/usr/src/lib/crt/amd64/mach-crt1.s
index 9a334f84e4..c17e352b96 100644
--- a/usr/src/lib/crt/amd64/mach-crt1.s
+++ b/usr/src/lib/crt/amd64/mach-crt1.s
@@ -60,6 +60,10 @@
*/
ENTRY_NP(_start)
+ .cfi_startproc
+ .cfi_undefined %rip
+ .cfi_undefined %rbp
+
/*
* Allocate a NULL return address and a NULL previous %rbp as if
* there was a genuine call to _start.
@@ -86,6 +90,7 @@ ENTRY_NP(_start)
/* NB: rt_do_exit, if applicable, is already in %rdx */
call _start_crt
hlt
+ .cfi_endproc
SET_SIZE(_start)
/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment