]> sigrok.org Git - sigrok-androidutils.git/commitdiff
CopyLibsTask: Handle DT_RUNPATH as well as DT_RPATH
authorMarcus Comstedt <redacted>
Tue, 21 Oct 2014 10:05:46 +0000 (12:05 +0200)
committerMarcus Comstedt <redacted>
Tue, 21 Oct 2014 10:05:46 +0000 (12:05 +0200)
gold in binutils 2.24 (NDK r10c) sets DT_RUNPATH instead of DT_RPATH
as default, so handle both.

ant/src/org/sigrok/androidutils/ant/CopyLibsTask.java

index 44af50db2c047fcb396e8aa6973e8c8bee26e739..58cfe25d482b911a066c42dbc15911a98909e944 100644 (file)
@@ -142,7 +142,8 @@ public class CopyLibsTask extends Task
                        String name = new String(s, offs, nul-offs, "US-ASCII");
                        offs += base;
 
-                       if (d.d_tag == ElfFile.DT_RPATH) {
+                       if (d.d_tag == ElfFile.DT_RPATH ||
+                           d.d_tag == ElfFile.DT_RUNPATH) {
                                // Zap rpath,
                                fixups.add(new Range(offs, offs + name.length()));
                        } else {
@@ -169,7 +170,8 @@ public class CopyLibsTask extends Task
                                        soname = getDynstr(d, strs, strsh.sh_offset);
                                else if (d.d_tag == ElfFile.DT_NEEDED)
                                        addNeeded(getDynstr(d, strs, strsh.sh_offset));
-                               else if (d.d_tag == ElfFile.DT_RPATH)
+                               else if (d.d_tag == ElfFile.DT_RPATH ||
+                                        d.d_tag == ElfFile.DT_RUNPATH)
                                        addRpath(getDynstr(d, strs, strsh.sh_offset));
                        }
                }