title: Prevent linking of mallocr.o file within libc.a
body: <p>This is for my company, so I'm leery of being too specific, but I'll try.</p>
  
  <p>I am attempting to add support for some existing ANSI C code to our platform. I am using GCC 4.7.2 as well as the GNU linker. We use part of newlib, but also some other C libraries, specifically <code>libc.a</code>. The end goal of this is to get an EXE or ELF image (this is for a PowerPC architecture micro) to put into the micro's RAM. This is being done on Windows XP. I am simply using a batch file, not a build environment or toolchain.</p>
  
  <p>One of my build errors is a multiple definition problem of malloc/free functions. The cmd window spits out the error that there are definitions of these in both <code>malloc.o</code> and <code>mallocr.o</code>. Both of these are within <code>libc.a</code>. I've been told the "r" in <code>mallocr.o</code> is for reentrancy. I've also been told our platform does not support reentrancy.</p>
  
  <p>I'm trying to resolve this error by preventing the linking of <code>mallocr.o</code> from within <code>libc.a</code>. This is the part where I am lost, I don't know how to do this. Google hasn't turned up anything helpful, and I haven't found a question on this site yet that answers my problem. I don't know if this is even possible.</p>
  
  <p>There is really no specific code snippet to include in this question. Below is the error from the cmd window. I've *'d out company specific things I am not comfortable sharing.</p>
  
  <pre><code>c:\***\platform\2_2_0_r2013-2_x86-32\tools\gcc_4_7_2\ppc\bin\..\powerpc-eabi\lib\libc.a(mallocr.o): In function `free':
  mallocr.c:(.text+0x19c): multiple definition of `free'
  c:\***\platform\2_2_0_r2013-2_x86-32\tools\gcc_4_7_2\ppc\bin\..\powerpc-eabi\lib\libc.a(malloc.o):malloc.c:(.text+0x28): first defined here
  c:\***\platform\2_2_0_r2013-2_x86-32\tools\gcc_4_7_2\ppc\bin\..\powerpc-eabi\lib\libc.a(mallocr.o): In function `malloc':
  mallocr.c:(.text+0x468): multiple definition of `malloc'
  c:\***\platform\2_2_0_r2013-2_x86-32\tools\gcc_4_7_2\ppc\bin\..\powerpc-eabi\lib\libc.a(malloc.o):malloc.c:(.text+0x0): first defined here
  </code></pre>