linker.h revision b7beb6907599b36809effe1b4db76039ac649518
11dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
21dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
31dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * All rights reserved.
41dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
51dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Redistribution and use in source and binary forms, with or without
61dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * modification, are permitted provided that the following conditions
71dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * are met:
81dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *  * Redistributions of source code must retain the above copyright
91dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *  * Redistributions in binary form must reproduce the above copyright
111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    notice, this list of conditions and the following disclaimer in
121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    the documentation and/or other materials provided with the
131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *    distribution.
141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * SUCH DAMAGE.
271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef _LINKER_H_
301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define _LINKER_H_
311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include <unistd.h>
331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include <sys/types.h>
349ec0f03a0d0b17bbb94ac0b9fef6add28a133c3aNick Kralevich#include <elf.h>
359ec0f03a0d0b17bbb94ac0b9fef6add28a133c3aNick Kralevich#include <sys/exec_elf.h>
361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
374688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes#ifdef __cplusplus
384688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughesextern "C" {
394688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes#endif
40b7beb6907599b36809effe1b4db76039ac649518Pavel Chupin#include <link.h>
414688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes
421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#undef PAGE_MASK
431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#undef PAGE_SIZE
441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define PAGE_SIZE 4096
45c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner#define PAGE_MASK (PAGE_SIZE-1)
46c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner
47c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner/* Convenience macros to make page address/offset computations more explicit */
48c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner
49c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner/* Returns the address of the page starting at address 'x' */
50c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner#define PAGE_START(x)  ((x) & ~PAGE_MASK)
51c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner
52c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner/* Returns the offset of address 'x' in its memory page, i.e. this is the
53c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner * same than 'x' - PAGE_START(x) */
54c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner#define PAGE_OFFSET(x) ((x) & PAGE_MASK)
55c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner
56c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner/* Returns the address of the next page after address 'x', unless 'x' is
57c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner * itself at the start of a page. Equivalent to:
58c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner *
59c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner *  (x == PAGE_START(x)) ? x : PAGE_START(x)+PAGE_SIZE
60c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner */
61c1bd559d5b0fdcc25db2b6ae2705914103b24699David 'Digit' Turner#define PAGE_END(x)    PAGE_START((x) + (PAGE_SIZE-1))
621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectvoid debugger_init();
641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* magic shared structures that GDB knows about */
661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
671dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct link_map
681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project{
691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    uintptr_t l_addr;
701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    char * l_name;
711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    uintptr_t l_ld;
721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    struct link_map * l_next;
731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    struct link_map * l_prev;
741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project// Values for r_debug->state
771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectenum {
781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    RT_CONSISTENT,
791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    RT_ADD,
801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    RT_DELETE
811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct r_debug
841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project{
851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    int32_t r_version;
861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    struct link_map * r_map;
871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    void (*r_brk)(void);
881dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    int32_t r_state;
891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    uintptr_t r_ldbase;
901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
921dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef struct soinfo soinfo;
931dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
941dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define FLAG_LINKED     0x00000001
951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define FLAG_ERROR      0x00000002
961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define FLAG_EXE        0x00000004 // The main executable
97468319ce4f3f7383d788b76c09cda2a405311f36Nick Kralevich#define FLAG_LINKER     0x00000010 // The linker itself
981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
991dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define SOINFO_NAME_LEN 128
1001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectstruct soinfo
1021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project{
1034688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes    char name[SOINFO_NAME_LEN];
104b52e4385c403d18a68309e568ac729c787d900c4David 'Digit' Turner    const Elf32_Phdr *phdr;
1051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    int phnum;
1061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned entry;
1071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned base;
1081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned size;
1091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
11038bccb271f121fc06eaa0d8fbd3c982bc44c36b7Nick Kralevich    int unused;  // DO NOT USE, maintained for compatibility.
11138bccb271f121fc06eaa0d8fbd3c982bc44c36b7Nick Kralevich
1121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *dynamic;
1131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
114b52e4385c403d18a68309e568ac729c787d900c4David 'Digit' Turner    unsigned unused2; // DO NOT USE, maintained for compatibility
115b52e4385c403d18a68309e568ac729c787d900c4David 'Digit' Turner    unsigned unused3; // DO NOT USE, maintained for compatibility
1161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    soinfo *next;
1181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned flags;
1191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    const char *strtab;
1211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    Elf32_Sym *symtab;
1221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned nbucket;
1241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned nchain;
1251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *bucket;
1261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *chain;
1271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *plt_got;
1291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    Elf32_Rel *plt_rel;
1311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned plt_rel_count;
1321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    Elf32_Rel *rel;
1341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned rel_count;
1351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *preinit_array;
1371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned preinit_array_count;
1381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *init_array;
1401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned init_array_count;
1411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *fini_array;
1421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned fini_array_count;
1431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    void (*init_func)(void);
1451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    void (*fini_func)(void);
1461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
147d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#if defined(ANDROID_ARM_LINKER)
1481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    /* ARM EABI section used for stack unwinding. */
1491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned *ARM_exidx;
1501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned ARM_exidx_count;
151d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#elif defined(ANDROID_MIPS_LINKER)
152d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#if 0
153d7daacb46372132ae3f0121647074936c304b572Raghu Gandham     /* not yet */
154d7daacb46372132ae3f0121647074936c304b572Raghu Gandham     unsigned *mips_pltgot
1551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
156d7daacb46372132ae3f0121647074936c304b572Raghu Gandham     unsigned mips_symtabno;
157d7daacb46372132ae3f0121647074936c304b572Raghu Gandham     unsigned mips_local_gotno;
158d7daacb46372132ae3f0121647074936c304b572Raghu Gandham     unsigned mips_gotsym;
159d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#endif /* ANDROID_*_LINKER */
1601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    unsigned refcount;
1621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project    struct link_map linkmap;
163e83c56dfbb6a9a61f0f18031620322af97e80162Evgeniy Stepanov
164e83c56dfbb6a9a61f0f18031620322af97e80162Evgeniy Stepanov    int constructors_called;
1659ec0f03a0d0b17bbb94ac0b9fef6add28a133c3aNick Kralevich
166bea23e59f7145537fd4e600ae67fa92a798872cfDavid 'Digit' Turner    /* When you read a virtual address from the ELF file, add this
167bea23e59f7145537fd4e600ae67fa92a798872cfDavid 'Digit' Turner     * value to get the corresponding address in the process' address space */
168bea23e59f7145537fd4e600ae67fa92a798872cfDavid 'Digit' Turner    Elf32_Addr load_bias;
1695135b3ae6ebc460418f7917bd36b368340e48d5aNick Kralevich    int has_text_relocations;
1701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project};
1711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectextern soinfo libdl_info;
1741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
176d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#include <asm/elf.h>
177d7daacb46372132ae3f0121647074936c304b572Raghu Gandham
178d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#if defined(ANDROID_ARM_LINKER)
179d7daacb46372132ae3f0121647074936c304b572Raghu Gandham
180d7daacb46372132ae3f0121647074936c304b572Raghu Gandham// These aren't defined in <arch-arm/asm/elf.h>.
181d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#define R_ARM_REL32      3
1821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define R_ARM_COPY       20
1831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define R_ARM_GLOB_DAT   21
1841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define R_ARM_JUMP_SLOT  22
1851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define R_ARM_RELATIVE   23
1861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
187d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#elif defined(ANDROID_MIPS_LINKER)
188d7daacb46372132ae3f0121647074936c304b572Raghu Gandham
189d7daacb46372132ae3f0121647074936c304b572Raghu Gandham// These aren't defined in <arch-arm/mips/elf.h>.
190d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#define R_MIPS_JUMP_SLOT       127
191d7daacb46372132ae3f0121647074936c304b572Raghu Gandham
192d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#define DT_MIPS_PLTGOT         0x70000032
193d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#define DT_MIPS_RWPLT          0x70000034
194fe62de1ad036a1417df44b7b1a7c65cc79dc7091David 'Digit' Turner
1951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#elif defined(ANDROID_X86_LINKER)
1961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
197d7daacb46372132ae3f0121647074936c304b572Raghu Gandham// x86 has everything it needs in <arch-arm/x86/elf.h>.
1981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
199d7daacb46372132ae3f0121647074936c304b572Raghu Gandham#endif /* ANDROID_*_LINKER */
2001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef DT_INIT_ARRAY
2021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define DT_INIT_ARRAY      25
2031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2041dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef DT_FINI_ARRAY
2061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define DT_FINI_ARRAY      26
2071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef DT_INIT_ARRAYSZ
2101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define DT_INIT_ARRAYSZ    27
2111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef DT_FINI_ARRAYSZ
2141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define DT_FINI_ARRAYSZ    28
2151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef DT_PREINIT_ARRAY
2181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define DT_PREINIT_ARRAY   32
2191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef DT_PREINIT_ARRAYSZ
2221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define DT_PREINIT_ARRAYSZ 33
2231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
2241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectsoinfo *find_library(const char *name);
2261698d9ebfc7e27271852a1fdf305a2ac37b3ebe4Matt FischerElf32_Sym *lookup(const char *name, soinfo **found, soinfo *start);
227bda5da074eab4bdf374e1f4a19d480c62c72f5ffMathias Agopiansoinfo *find_containing_library(const void *addr);
2282e85579c34047c305caf15fb0ebe02bf3d001d0eDima Zavinconst char *linker_get_error(void);
22916084168111cd7d2ac8a6b92e6fa6df5696928a5David 'Digit' Turner
230bedfe38b8ba512dd6236c00e8b4a9b01c2bd1281Elliott Hughesint soinfo_unload(soinfo* si);
23116084168111cd7d2ac8a6b92e6fa6df5696928a5David 'Digit' TurnerElf32_Sym *soinfo_find_symbol(soinfo* si, const void *addr);
23216084168111cd7d2ac8a6b92e6fa6df5696928a5David 'Digit' TurnerElf32_Sym *soinfo_lookup(soinfo *si, const char *name);
23316084168111cd7d2ac8a6b92e6fa6df5696928a5David 'Digit' Turnervoid soinfo_call_constructors(soinfo *si);
2341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2354688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes#ifdef __cplusplus
2364688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes};
2374688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes#endif
2384688279db5dcc4004941e7f133c4a1c3617d842cElliott Hughes
2391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif
240