diff options
author | norly <ny-git@enpas.org> | 2013-06-27 00:46:07 +0100 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2013-06-27 00:46:07 +0100 |
commit | bac3bc42ef0133a7dda0870c4e1f37e5651feb99 (patch) | |
tree | 95c6e8f30e7efd421aa430a0aff465de9b2e6c82 | |
parent | 95516f950cf67ee154f362425c1472637d9f3e22 (diff) |
Only use -fPIC when compiling the shared object.
We can only use position-dependent global variables (R_*_COPY) in
injected code, not the position-independent R_*_GLOB_DAT as used in
shared objects.
And being able to modify the tool itself turns out to be a cool thing to
be able to.
-rw-r--r-- | Makefile | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -35,7 +35,7 @@ endif INCLUDES := $(patsubst %, -I%, $(INCLUDEDIR) $(SRCDIR)) $(LIBELF_INCLUDES) -CFLAGS := -g -Wall -std=gnu99 -pedantic -fPIC $(LIBELF_CFLAGS) +CFLAGS := -g -Wall -std=gnu99 -pedantic $(LIBELF_CFLAGS) LDFLAGS := $(LIBELF_LDFLAGS) @@ -58,8 +58,8 @@ debug: $(EXE) $(EXE): $(EXEOBJS) $(STATICLIB) gcc -o $@ $^ $(LDFLAGS) -$(SHAREDLIB): $(LIBOBJS) - gcc -shared -Wl,-soname,lib$(LIBNAME).so.$(SHARED_VERMAJ) -o $@ $^ $(LDFLAGS) +$(SHAREDLIB): $(LIBSRCS) + gcc $(INCLUDES) $(CFLAGS) -shared -fPIC -Wl,-soname,lib$(LIBNAME).so.$(SHARED_VERMAJ) -o $@ $^ $(LDFLAGS) $(STATICLIB): $(LIBOBJS) ar rcs $@ $^ |