linker: handle R_ARM_COPY relocations in a proper way

If an executable contain copy relocations, other references
to the symbol it points to should be preempted and made to
point to the copy instead.

Also, the linker should make sure the target area has
sufficient space to contain the copy. It also checks
whether the library that supplies the symbol is built
with -Bsymbolic, and errors out if this is the case.

Change-Id: If135c83590092741cfd8f82f54816f363a4a4a3b
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@gmail.com>
This commit is contained in:
Ard Biesheuvel
2012-08-30 12:48:32 +02:00
committed by Elliott Hughes
parent 155e8d1df5
commit 5ae44f302b
3 changed files with 79 additions and 57 deletions

View File

@@ -236,5 +236,7 @@ soinfo libdl_info = {
refcount: 0,
{ l_addr: 0, l_name: 0, l_ld: 0, l_next: 0, l_prev: 0, },
constructors_called: 0, load_bias: 0, has_text_relocations: 0,
constructors_called: 0, load_bias: 0,
has_text_relocations: false,
has_DT_SYMBOLIC: true,
};