title: How to wrap a library function with custom code?
body: <p>I have a library which implements <code>malloc</code>. I want to override this function with a custom malloc function that does something and then calls the malloc function of the library.</p>
  
  <p>How can i redefine the symbol <code>malloc</code> without losing the function from the library?</p>