2015-01-09 08:30:15 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 The Android Open Source Project
|
2017-02-16 00:31:13 +01:00
|
|
|
* All rights reserved.
|
2015-01-09 08:30:15 +01:00
|
|
|
*
|
2017-02-16 00:31:13 +01:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
2015-01-09 08:30:15 +01:00
|
|
|
*
|
2017-02-16 00:31:13 +01:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
|
|
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
2015-01-09 08:30:15 +01:00
|
|
|
*/
|
|
|
|
|
2018-02-13 23:26:29 +01:00
|
|
|
#pragma once
|
2015-01-09 08:30:15 +01:00
|
|
|
|
|
|
|
#include <elf.h>
|
|
|
|
|
|
|
|
#define R_GENERIC_NONE 0 // R_*_NONE is always 0
|
|
|
|
|
|
|
|
#if defined (__aarch64__)
|
|
|
|
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_JUMP_SLOT R_AARCH64_JUMP_SLOT
|
2019-10-17 01:28:05 +02:00
|
|
|
// R_AARCH64_ABS64 is classified as a static relocation but it is common in DSOs.
|
|
|
|
#define R_GENERIC_ABSOLUTE R_AARCH64_ABS64
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_GLOB_DAT R_AARCH64_GLOB_DAT
|
|
|
|
#define R_GENERIC_RELATIVE R_AARCH64_RELATIVE
|
|
|
|
#define R_GENERIC_IRELATIVE R_AARCH64_IRELATIVE
|
2019-10-17 02:27:36 +02:00
|
|
|
#define R_GENERIC_COPY R_AARCH64_COPY
|
2019-07-31 01:30:46 +02:00
|
|
|
#define R_GENERIC_TLS_DTPMOD R_AARCH64_TLS_DTPMOD
|
|
|
|
#define R_GENERIC_TLS_DTPREL R_AARCH64_TLS_DTPREL
|
|
|
|
#define R_GENERIC_TLS_TPREL R_AARCH64_TLS_TPREL
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_TLSDESC R_AARCH64_TLSDESC
|
2015-01-09 08:30:15 +01:00
|
|
|
|
|
|
|
#elif defined (__arm__)
|
|
|
|
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_JUMP_SLOT R_ARM_JUMP_SLOT
|
2019-10-17 01:28:05 +02:00
|
|
|
// R_ARM_ABS32 is classified as a static relocation but it is common in DSOs.
|
|
|
|
#define R_GENERIC_ABSOLUTE R_ARM_ABS32
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_GLOB_DAT R_ARM_GLOB_DAT
|
|
|
|
#define R_GENERIC_RELATIVE R_ARM_RELATIVE
|
|
|
|
#define R_GENERIC_IRELATIVE R_ARM_IRELATIVE
|
2019-10-17 02:27:36 +02:00
|
|
|
#define R_GENERIC_COPY R_ARM_COPY
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_TLS_DTPMOD R_ARM_TLS_DTPMOD32
|
|
|
|
#define R_GENERIC_TLS_DTPREL R_ARM_TLS_DTPOFF32
|
|
|
|
#define R_GENERIC_TLS_TPREL R_ARM_TLS_TPOFF32
|
|
|
|
#define R_GENERIC_TLSDESC R_ARM_TLS_DESC
|
2015-01-09 08:30:15 +01:00
|
|
|
|
|
|
|
#elif defined (__i386__)
|
|
|
|
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_JUMP_SLOT R_386_JMP_SLOT
|
2019-10-17 01:28:05 +02:00
|
|
|
#define R_GENERIC_ABSOLUTE R_386_32
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_GLOB_DAT R_386_GLOB_DAT
|
|
|
|
#define R_GENERIC_RELATIVE R_386_RELATIVE
|
|
|
|
#define R_GENERIC_IRELATIVE R_386_IRELATIVE
|
2019-10-17 02:27:36 +02:00
|
|
|
#define R_GENERIC_COPY R_386_COPY
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_TLS_DTPMOD R_386_TLS_DTPMOD32
|
|
|
|
#define R_GENERIC_TLS_DTPREL R_386_TLS_DTPOFF32
|
|
|
|
#define R_GENERIC_TLS_TPREL R_386_TLS_TPOFF
|
|
|
|
#define R_GENERIC_TLSDESC R_386_TLS_DESC
|
2015-01-09 08:30:15 +01:00
|
|
|
|
2022-10-10 21:21:44 +02:00
|
|
|
#elif defined (__riscv)
|
|
|
|
|
|
|
|
#define R_GENERIC_JUMP_SLOT R_RISCV_JUMP_SLOT
|
|
|
|
#define R_GENERIC_ABSOLUTE R_RISCV_64
|
|
|
|
#define R_GENERIC_GLOB_DAT R_RISCV_64
|
|
|
|
#define R_GENERIC_RELATIVE R_RISCV_RELATIVE
|
|
|
|
#define R_GENERIC_IRELATIVE R_RISCV_IRELATIVE
|
|
|
|
#define R_GENERIC_COPY R_RISCV_COPY
|
|
|
|
#define R_GENERIC_TLS_DTPMOD R_RISCV_TLS_DTPMOD64
|
|
|
|
#define R_GENERIC_TLS_DTPREL R_RISCV_TLS_DTPREL64
|
|
|
|
#define R_GENERIC_TLS_TPREL R_RISCV_TLS_TPREL64
|
|
|
|
// TODO: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/94
|
|
|
|
// #define R_GENERIC_TLSDESC R_RISCV_TLS_DESC
|
|
|
|
|
2015-01-09 08:30:15 +01:00
|
|
|
#elif defined (__x86_64__)
|
|
|
|
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_JUMP_SLOT R_X86_64_JUMP_SLOT
|
2019-10-17 01:28:05 +02:00
|
|
|
#define R_GENERIC_ABSOLUTE R_X86_64_64
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_GLOB_DAT R_X86_64_GLOB_DAT
|
|
|
|
#define R_GENERIC_RELATIVE R_X86_64_RELATIVE
|
|
|
|
#define R_GENERIC_IRELATIVE R_X86_64_IRELATIVE
|
2019-10-17 02:27:36 +02:00
|
|
|
#define R_GENERIC_COPY R_X86_64_COPY
|
2019-01-01 10:49:41 +01:00
|
|
|
#define R_GENERIC_TLS_DTPMOD R_X86_64_DTPMOD64
|
|
|
|
#define R_GENERIC_TLS_DTPREL R_X86_64_DTPOFF64
|
|
|
|
#define R_GENERIC_TLS_TPREL R_X86_64_TPOFF64
|
|
|
|
#define R_GENERIC_TLSDESC R_X86_64_TLSDESC
|
2015-01-09 08:30:15 +01:00
|
|
|
|
|
|
|
#endif
|