OSDN Git Service

Reference __dso_handle in PIC way
authorKenny Root <kroot@google.com>
Fri, 2 Mar 2012 21:05:25 +0000 (13:05 -0800)
committerKenny Root <kroot@google.com>
Fri, 2 Mar 2012 21:09:36 +0000 (13:09 -0800)
Use the same pattern in atexit.S to reference __dso_handle in a way that
doesn't require a TEXTREL flag to be set.

Change-Id: Id69d20863ee203d2b2f7ef0db230f9b548657741

libc/arch-arm/bionic/crtbegin_so.S

index 9275b1e..8123254 100644 (file)
 # standard.
 #
 __on_dlclose:
-        adr     r0, 0f
+        ldr     r0, .L1
+.LPIC0:
+        add     r0, pc
         ldr     r0, [r0]
         b       __cxa_finalize
+.L1:
+        .word   __dso_handle-(.LPIC0+4)
 
-0:
-        .long   __dso_handle
-
-       .section .init_array, "aw"
-       .globl __INIT_ARRAY__
+        .section .init_array, "aw"
+        .globl __INIT_ARRAY__
 __INIT_ARRAY__:
-       .long -1
+        .long -1
 
         .section .fini_array, "aw"
         .globl __FINI_ARRAY__