Commit graph

8 commits

Author SHA1 Message Date
Elliott Hughes
43462707a1 riscv64 TLS support.
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Signed-off-by: Xia Lifang <lifang_xia@linux.alibaba.com>
Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
Signed-off-by: Lu Xufan <luxufan@iscas.ac.cn>
Test: treehugger
Change-Id: I14efb4a03a3dc2ec736d7e47a3f8859c886eb9d6
2022-10-10 20:30:24 +00:00
Ryan Prichard
308af5761e Factor out R_GENERIC_COPY
Test: bionic unit tests
Bug: none
Change-Id: I2f1fc8b4b9832f892e5cf13a3c685854de07a8d3
2019-10-18 12:44:01 -07:00
Ryan Prichard
e0a53e2de3 Factor out R_GENERIC_ABSOLUTE
Combine:
 - R_AARCH64_ABS64
 - R_ARM_ABS32
 - R_X86_64_64
 - R_386_32

They do mostly the same thing as R_GENERIC_GLOB_DAT. They always have an
addend, though, and R_GENERIC_GLOB_DAT currently only has an addend on
RELA targets.

Test: bionic unit tests
Bug: none
Change-Id: Ibe964c3b28705086aecb6e7d80c90998aad3c0a4
2019-10-18 12:44:01 -07:00
Ryan Prichard
6d601458de Renumber arm64 TLS to match GNU values
The AArch64 ELF specification originally specified these relocations:

  R_AARCH64_TLS_DTPREL64          1028
  R_AARCH64_TLS_DTPMOD64          1029

However, the GNU toolchain implemented them as:

  R_AARCH64_TLS_DTPMOD64          1028
  R_AARCH64_TLS_DTPREL64          1029

The AArch64 ELF specification has been updated to replace the relocations
with R_AARCH64_TLS_IMPDEF1 and with R_AARCH64_TLS_IMPDEF2, where each
implementation can choose which interpretation it implements, but with a
suggestion to follow the GNU behavior.

Also: remove the 64 suffixes from the TLS relocations. The newest version
of the AArch64 ELF specification (version f) also omits the suffixes, as
do the glibc headers.

Bug: http://b/123385182
Bug: https://bugs.llvm.org/show_bug.cgi?id=40507
Test: build device, it boots
Change-Id: Ie98b7624752982973f0ac969d646454a86784cab
2019-07-30 16:30:46 -07:00
Ryan Prichard
2ccb2f04e0 Add generic TLS linker reloc macros
Bug: http://b/78026329
Test: build bionic
Change-Id: I7f9d3a250f27c31d0b8d9a3a306468fdf723f9c8
2019-01-02 14:36:26 -08:00
Elliott Hughes
cbc80ba9d8 Switch the rest of our internal headers to #pragma once.
We've been using #pragma once for new internal files, but let's be more bold.

Bug: N/A
Test: builds
Change-Id: I7e2ee2730043bd884f9571cdbd8b524043030c07
2018-02-13 14:27:17 -08:00
Dimitry Ivanov
bcc4da9b75 Unify linker files under one license (BSD)
Historically we had part of the linker licensed under BSD and
another part under Apache 2 license. This commit makes all the
linker code licensed under BSD license.

Test: m
Change-Id: I11b8163ae75966b5768d3fe992679de376106515
2017-02-15 15:35:33 -08:00
Dmitriy Ivanov
cefef7dab6 Refactor soinfo::relocate
Move common relocation types outside of ifdefs

Change-Id: I713800ce123a18178b5ac80c0b3c7bd6b21a02c2
2015-01-09 14:57:53 -08:00