Skip to content

Instantly share code, notes, and snippets.

@jlk
Created January 27, 2016 20:52
Show Gist options
  • Save jlk/533bc83691887f298a5c to your computer and use it in GitHub Desktop.
Save jlk/533bc83691887f298a5c to your computer and use it in GitHub Desktop.
variable expansion
glibc has the following line:
#define SYS_ify(syscall_name) __NR_##syscall_name
So I'm trying to do a similar expansion with "name" below:
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.data; \
##name_jtarget_name: .string "test"; \
.text; \
ENTRY (name) \
movl $##name_jtarget_name, %esi; \
DO_CALL (syscall_name, args); \
cmpq $-4095, %rax; \
jae SYSCALL_ERROR_LABEL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment