Commit graph

15 commits

Author SHA1 Message Date
Dmitriy Ivanov
f4cb631364 Add IFUNC support for arm64 and IRELATIVE reloc
There are number of changes in the way IFUNC related relocations are done:
 1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
 2. IFUNC relocations are now relying on static linker to generate
    them in correct order - this removes necessety of additional
    relocation pass for ifuncs.
 3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
 4. Ifunc are resolved on symbol lookup this approach allowed to avoid
    mprotect(PROT_WRITE) call on r-x program segments.

Bug: 17399706
Bug: 17177284

(cherry picked from commit 9aea164457)

Change-Id: Ie19d900fc203beb93faf8943b0d06d534a6de4ad
2014-10-01 16:04:31 -07:00
Dmitriy Ivanov
ae69a9584b Load libraries in breadth-first order
This patch fixes the problem with symbol search order
  for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
  and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Attempt: 2

(cherry picked from commit 14669a939d)

Change-Id: Id87540c96a2242220967b6fa5d84ddcd829e2b97
2014-10-01 16:01:28 -07:00
Dmitriy Ivanov
c0133a73b6 Revert "Load libraries in breadth-first order"
This reverts commit a3ad450a2e.

(cherry picked from commit 498eb18b82)

Change-Id: Iec7eab83d0c0ed1604e1e8ea3f9e9d0ce1d29680
2014-10-01 16:00:52 -07:00
Dmitriy Ivanov
8de1ddece0 Fix order of soinfo links (repairs libcxx tests).
(cherry picked from commit b2a30ee8d2)

Change-Id: I59c5333bc050cbbea14051cea9220be2f64ee383
2014-10-01 16:00:41 -07:00
Dmitriy Ivanov
59c12a6527 Load libraries in breadth-first order
This patch fixes the problem with symbol search order
  for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
  and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255

(cherry picked from commit a3ad450a2e)

Change-Id: I1125de10272c84e4f075cbc72859c1f6b3e89943
2014-10-01 16:00:29 -07:00
Dmitriy Ivanov
bd321c1106 Run constructors before resolving ifunc functions
Bug: 17177284

(cherry picked from commit 9598b8c415)

Change-Id: I2c9631ee1cd77f8cf95ec0216a35b605c8786454
2014-10-01 15:51:47 -07:00
Brigid Smith
31b88da843 Added test for ifunc support in dynamic linker.
ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.

Bug:6657325
(cherry picked from commit c5a13efa9b)

Change-Id: I321d780bc2f9bd1baa749e1acacd2683aefe827b
2014-10-01 15:50:38 -07:00
Dmitriy Ivanov
9419420919 Revert "Add support for protected local symbol lookup."
This reverts commit d97e9f546e.

Bug: 17107521
Change-Id: I2b81ce2b5a4a2d166133a2626e49d81b6aef3672
2014-08-18 15:11:50 -07:00
Dmitriy Ivanov
db7a17d4ff Revert "Revert "Fix dlsym(3) to do breadth first search.""
This reverts commit 1b1966d944.

Change-Id: I05d6d3481aaf8f3e260d2e5e950248519a1d347f
2014-08-04 23:39:22 +00:00
Dmitriy Ivanov
1b1966d944 Revert "Fix dlsym(3) to do breadth first search."
This reverts commit 422106a24d.

Change-Id: I9e26a6933d10eb30438b521450f2010997ca5aee
2014-08-04 16:38:57 +00:00
Dmitriy Ivanov
422106a24d Fix dlsym(3) to do breadth first search.
dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs
  breadth first search through the dependency tree.

Bug: 16653281

(cherry picked from commit aa0f2bdbc2)

Change-Id: I0ba8c2034ab341f8a279cdb4e2e7e47f1aef7897
2014-07-29 15:02:15 -07:00
Dmitriy Ivanov
04dc91ae76 Load library using file handle.
* This patch enables dlopen by file descriptor
   instead of path/name.

Bug: 15984217
Change-Id: Ib39051e00567fb97070bf96d8ce63993877c0a01
2014-07-02 13:20:47 -07:00
Dmitriy Ivanov
d97e9f546e Add support for protected local symbol lookup.
Bug: http://code.google.com/p/android/issues/detail?id=66048
Change-Id: Ib334223df27adad9477fb241ab099c5e26df4a7d
2014-07-01 10:25:54 -07:00
Dmitriy Ivanov
ce44166c73 Fix weak function lookups
* Linker now correctly resolves function defined
   with __attribute__((weak)).

Bug: https://code.google.com/p/android/issues/detail?id=70206
Change-Id: I82efb905676c25fefb1b11a13f5fecb0f1384657
2014-06-17 16:18:18 -07:00
Dmitriy Ivanov
1f5e1a3cbc Move libraries for unit-tests to separate folder
Change-Id: I1653f3f2fd63ba25525369bc725c8f7438ecf021
2014-06-17 15:08:53 -07:00