Skip to content

Instantly share code, notes, and snippets.

@petabyt
Last active February 4, 2022 16:39
Show Gist options
  • Save petabyt/85fc216da426ce0272ef351d8d23ece2 to your computer and use it in GitHub Desktop.
Save petabyt/85fc216da426ce0272ef351d8d23ece2 to your computer and use it in GitHub Desktop.
Stub File Spec

Stubs File

Feb 5 2022

gcc main.S -DSTUBS -include "../model/$(model).h"

xf1.h:

#define MODEL_NAME "Fujifilm XF1"

#define BASE_ADDR 0xa0000000

#ifdef STUBS
	#include "stub.h"
	
	NSTUB(sprintf, 0x12345)
#endif

stub.h:

// Define a symbol
#define NSTUB(name, addr) \
	.global name; \
	.extern name; \
	name = (addr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment