1

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

Community
  • 1
  • 1
luveti
  • 129
  • 4
  • 15
  • Please see my answer [HERE](http://stackoverflow.com/a/41900551/1147688) for a more comprehensive answer. – not2qubit Jan 27 '17 at 18:29

1 Answers1

0

It's NDK 12b issue. Try build with NDK 11c, which have the same toolchain 4.9

scdm
  • 1