[Galaxy S II Android Development] p3dboard:
Not sure if this will help you, but these were the code changes in Android 5.1.1, cm 12.1, Slimlp that enabled non-pie blob support

My code compile notes from SlimLp builds i made for the Galaxy tab 7.7

https://www.androidfilehost.com/?w=files&flid=38253

FILE: /bionic/linker/Android.mk
# **************************************
# * modify file and add these contents *
# **************************************
# Add NON PIE SUPPORT - Add to line 39

ifeq ($(TARGET_NEEDS_BIONIC_PRELINK_SUPPORT),true)
LOCAL_CFLAGS += -DENABLE_PRELINK_SUPPORT
endif

ifeq ($(TARGET_ENABLE_NON_PIE_SUPPORT),true)
LOCAL_CFLAGS += -DENABLE_NON_PIE_SUPPORT
endif

# ***********************************************************
# * Bionic Library Changes - See bionic.diff.zip *
# https://review.slimroms.eu/#/c/2720/ - Same code changes *
# ***********************************************************

FILE: /bionic/linker/linker.cpp
# **************************************
# * modify file and add these contents *
# **************************************
# Add NON PIE SUPPORT

if (sym != 0) {

# Line 1106
#ifndef ENABLE_NON_PIE_SUPPORT
return -1;
#endif
}

# Line 1386
if (sym != 0) {

#ifndef ENABLE_NON_PIE_SUPPORT
return -1;
#endif
}

# Line 1472
#ifndef ENABLE_NON_PIE_SUPPORT
/*
* ET_EXEC is not supported so this should not happen.
*
* http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf
*
* Section 4.7.1.10 "Dynamic relocations"
* R_ARM_COPY may only appear in executable objects where e_type is
* set to ET_EXEC.
*/
DL_ERR("%s R_ARM_COPY relocations are not supported", name);
return -1;
#else
if ((flags & FLAG_EXE) == 0) {
/*
* http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044d/IHI0044D_aaelf.pdf
*
* Section 4.7.1.10 "Dynamic relocations"
* R_ARM_COPY may only appear in executable objects where e_type is
* set to ET_EXEC.
*
* TODO: FLAG_EXE is set for both ET_DYN and ET_EXEC executables.
* We should explicitly disallow ET_DYN executables from having
* R_ARM_COPY relocations.
*/
DL_ERR("%s R_ARM_COPY relocations only supported for ET_EXEC", name);
return -1;
}
count_relocation(kRelocCopy);
MARK(rel->r_offset);
TRACE_TYPE(RELO, "RELO %08x <- %d @ %08x %s", reloc, s->st_size, sym_addr, sym_name);
if (reloc == sym_addr) {
ElfW(Sym)* src = soinfo_do_lookup(NULL, sym_name, &lsi);

if (src == NULL) {
DL_ERR("%s R_ARM_COPY relocation source cannot be resolved", name);
return -1;
}
if (lsi->has_DT_SYMBOLIC) {
DL_ERR("%s invalid R_ARM_COPY relocation against DT_SYMBOLIC shared "
"library %s (built with -Bsymbolic?)", name, lsi->name);
return -1;
}
if (s->st_size < src->st_size) {
DL_ERR("%s R_ARM_COPY relocation size mismatch (%d < %d)",
name, s->st_size, src->st_size);
return -1;
}
memcpy(reinterpret_cast<void*>(reloc),
reinterpret_cast<void*>(src->st_value + lsi->load_bias), src->st_size);
} else {
DL_ERR("%s R_ARM_COPY relocation target cannot be resolved", name);
return -1;
}
break;
#endif

# Line 2453
#ifndef ENABLE_NON_PIE_SUPPORT
ElfW(Ehdr)* elf_hdr = reinterpret_cast<ElfW(Ehdr)*>(si->base);
if (elf_hdr->e_type != ET_DYN) {
__libc_format_fd(2, "error: only position independent executables (PIE) are supported.\n");
exit(EXIT_FAILURE);
}
#endif