I'm having trouble getting an NDK PIE binary to not show linker warnings at runtime. I need the binary to only show the content printed out by my code, as it gets piped into another program.
Here is my Android.mk file:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -fPIE
LOCAL_LDFLAGS += -fPIE -pie
LOCAL_MODULE := test
LOCAL_SRC_FILES := main.c
include $(BUILD_EXECUTABLE)
And here is the source for main.c:
#include <stdio.h>
int main (int argc, char** argv) {
printf("Hello World\n");
return 0;
}
Running my program outputs this:
WARNING: linker: ./data/local/test: unused DT entry: type 0x6ffffffe arg 0x384
WARNING: linker: ./data/local/test: unused DT entry: type 0x6fffffff arg 0x1
Hello world!
This question asked something very similar to my issue, but doesn't solve my problem: unused DT entry: type 0x1d arg