| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2008 The Android Open Source Project | 
|  | 3 | * All rights reserved. | 
|  | 4 | * | 
|  | 5 | * Redistribution and use in source and binary forms, with or without | 
|  | 6 | * modification, are permitted provided that the following conditions | 
|  | 7 | * are met: | 
|  | 8 | *  * Redistributions of source code must retain the above copyright | 
|  | 9 | *    notice, this list of conditions and the following disclaimer. | 
|  | 10 | *  * Redistributions in binary form must reproduce the above copyright | 
|  | 11 | *    notice, this list of conditions and the following disclaimer in | 
|  | 12 | *    the documentation and/or other materials provided with the | 
|  | 13 | *    distribution. | 
|  | 14 | * | 
|  | 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
|  | 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
|  | 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 
|  | 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 
|  | 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | 
|  | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 
|  | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | 
|  | 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 
|  | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 
|  | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | 
|  | 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 
|  | 26 | * SUCH DAMAGE. | 
|  | 27 | */ | 
| Elliott Hughes | 203e13d | 2016-07-22 14:56:18 -0700 | [diff] [blame] | 28 |  | 
| Elliott Hughes | 6663f55 | 2020-01-24 14:36:10 -0800 | [diff] [blame] | 29 | #pragma once | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 30 |  | 
| Josh Gao | 16016df | 2016-11-07 18:27:16 -0800 | [diff] [blame] | 31 | #include <sys/cdefs.h> | 
|  | 32 |  | 
| Elliott Hughes | 0266ae5 | 2014-02-10 17:46:57 -0800 | [diff] [blame] | 33 | #include <linux/elf.h> | 
|  | 34 | #include <linux/elf-em.h> | 
| Elliott Hughes | 0f19b10 | 2022-10-06 23:11:38 +0000 | [diff] [blame] | 35 | #undef EI_PAD | 
|  | 36 |  | 
|  | 37 | #include <bits/auxvec.h> | 
|  | 38 | #include <bits/elf_common.h> | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 39 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 40 | /* http://www.sco.com/developers/gabi/latest/ch4.intro.html */ | 
| Elliott Hughes | 89d8a3c | 2017-12-05 13:00:22 -0800 | [diff] [blame] | 41 | typedef __u64 Elf32_Xword; | 
| Dmitriy Ivanov | ce16a53 | 2015-05-07 22:58:00 -0700 | [diff] [blame] | 42 | typedef __s64 Elf32_Sxword; | 
|  | 43 |  | 
| Nick Kralevich | 2c5153b | 2013-01-11 14:43:05 -0800 | [diff] [blame] | 44 | typedef struct { | 
| Elliott Hughes | 0266ae5 | 2014-02-10 17:46:57 -0800 | [diff] [blame] | 45 | __u32 a_type; | 
| Nick Kralevich | 2c5153b | 2013-01-11 14:43:05 -0800 | [diff] [blame] | 46 | union { | 
| Elliott Hughes | 0266ae5 | 2014-02-10 17:46:57 -0800 | [diff] [blame] | 47 | __u32 a_val; | 
| Nick Kralevich | 2c5153b | 2013-01-11 14:43:05 -0800 | [diff] [blame] | 48 | } a_un; | 
|  | 49 | } Elf32_auxv_t; | 
|  | 50 |  | 
|  | 51 | typedef struct { | 
| Elliott Hughes | 0266ae5 | 2014-02-10 17:46:57 -0800 | [diff] [blame] | 52 | __u64 a_type; | 
| Nick Kralevich | 2c5153b | 2013-01-11 14:43:05 -0800 | [diff] [blame] | 53 | union { | 
| Elliott Hughes | 0266ae5 | 2014-02-10 17:46:57 -0800 | [diff] [blame] | 54 | __u64 a_val; | 
| Nick Kralevich | 2c5153b | 2013-01-11 14:43:05 -0800 | [diff] [blame] | 55 | } a_un; | 
|  | 56 | } Elf64_auxv_t; | 
|  | 57 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 58 | /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */ | 
|  | 59 | typedef struct { | 
|  | 60 | Elf32_Word ch_type; | 
|  | 61 | Elf32_Word ch_size; | 
|  | 62 | Elf32_Word ch_addralign; | 
|  | 63 | } Elf32_Chdr; | 
|  | 64 | typedef struct { | 
|  | 65 | Elf64_Word ch_type; | 
|  | 66 | Elf64_Word ch_reserved; | 
|  | 67 | Elf64_Xword ch_size; | 
|  | 68 | Elf64_Xword ch_addralign; | 
|  | 69 | } Elf64_Chdr; | 
|  | 70 |  | 
| Elliott Hughes | 89d8a3c | 2017-12-05 13:00:22 -0800 | [diff] [blame] | 71 | typedef struct { | 
|  | 72 | Elf32_Word l_name; | 
|  | 73 | Elf32_Word l_time_stamp; | 
|  | 74 | Elf32_Word l_checksum; | 
|  | 75 | Elf32_Word l_version; | 
|  | 76 | Elf32_Word l_flags; | 
|  | 77 | } Elf32_Lib; | 
|  | 78 | typedef struct { | 
|  | 79 | Elf64_Word l_name; | 
|  | 80 | Elf64_Word l_time_stamp; | 
|  | 81 | Elf64_Word l_checksum; | 
|  | 82 | Elf64_Word l_version; | 
|  | 83 | Elf64_Word l_flags; | 
|  | 84 | } Elf64_Lib; | 
| Elliott Hughes | 89d8a3c | 2017-12-05 13:00:22 -0800 | [diff] [blame] | 85 |  | 
|  | 86 | typedef struct { | 
|  | 87 | Elf32_Xword m_value; | 
|  | 88 | Elf32_Word m_info; | 
|  | 89 | Elf32_Word m_poffset; | 
|  | 90 | Elf32_Half m_repeat; | 
|  | 91 | Elf32_Half m_stride; | 
|  | 92 | } Elf32_Move; | 
|  | 93 | typedef struct { | 
|  | 94 | Elf64_Xword m_value; | 
|  | 95 | Elf64_Xword m_info; | 
|  | 96 | Elf64_Xword m_poffset; | 
|  | 97 | Elf64_Half m_repeat; | 
|  | 98 | Elf64_Half m_stride; | 
|  | 99 | } Elf64_Move; | 
|  | 100 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 101 | typedef __u16 Elf32_Section; | 
|  | 102 | typedef __u16 Elf64_Section; | 
|  | 103 |  | 
| Elliott Hughes | 89d8a3c | 2017-12-05 13:00:22 -0800 | [diff] [blame] | 104 | typedef struct { | 
|  | 105 | Elf32_Half si_boundto; | 
|  | 106 | Elf32_Half si_flags; | 
|  | 107 | } Elf32_Syminfo; | 
|  | 108 | typedef struct { | 
|  | 109 | Elf64_Half si_boundto; | 
|  | 110 | Elf64_Half si_flags; | 
|  | 111 | } Elf64_Syminfo; | 
| Elliott Hughes | 89d8a3c | 2017-12-05 13:00:22 -0800 | [diff] [blame] | 112 |  | 
| Dmitriy Ivanov | c0e7dbb | 2015-04-09 13:58:53 -0700 | [diff] [blame] | 113 | typedef Elf32_Half Elf32_Versym; | 
|  | 114 | typedef Elf64_Half Elf64_Versym; | 
|  | 115 |  | 
|  | 116 | typedef struct { | 
|  | 117 | Elf32_Half vd_version; | 
|  | 118 | Elf32_Half vd_flags; | 
|  | 119 | Elf32_Half vd_ndx; | 
|  | 120 | Elf32_Half vd_cnt; | 
|  | 121 | Elf32_Word vd_hash; | 
|  | 122 | Elf32_Word vd_aux; | 
|  | 123 | Elf32_Word vd_next; | 
|  | 124 | } Elf32_Verdef; | 
|  | 125 |  | 
|  | 126 | typedef struct { | 
|  | 127 | Elf32_Word vda_name; | 
|  | 128 | Elf32_Word vda_next; | 
|  | 129 | } Elf32_Verdaux; | 
|  | 130 |  | 
|  | 131 | typedef struct { | 
|  | 132 | Elf64_Half vd_version; | 
|  | 133 | Elf64_Half vd_flags; | 
|  | 134 | Elf64_Half vd_ndx; | 
|  | 135 | Elf64_Half vd_cnt; | 
|  | 136 | Elf64_Word vd_hash; | 
|  | 137 | Elf64_Word vd_aux; | 
|  | 138 | Elf64_Word vd_next; | 
|  | 139 | } Elf64_Verdef; | 
|  | 140 |  | 
|  | 141 | typedef struct { | 
|  | 142 | Elf64_Word vda_name; | 
|  | 143 | Elf64_Word vda_next; | 
|  | 144 | } Elf64_Verdaux; | 
|  | 145 |  | 
|  | 146 | typedef struct { | 
|  | 147 | Elf32_Half vn_version; | 
|  | 148 | Elf32_Half vn_cnt; | 
|  | 149 | Elf32_Word vn_file; | 
|  | 150 | Elf32_Word vn_aux; | 
|  | 151 | Elf32_Word vn_next; | 
|  | 152 | } Elf32_Verneed; | 
|  | 153 |  | 
|  | 154 | typedef struct { | 
|  | 155 | Elf32_Word vna_hash; | 
|  | 156 | Elf32_Half vna_flags; | 
|  | 157 | Elf32_Half vna_other; | 
|  | 158 | Elf32_Word vna_name; | 
|  | 159 | Elf32_Word vna_next; | 
|  | 160 | } Elf32_Vernaux; | 
|  | 161 |  | 
|  | 162 | typedef struct { | 
|  | 163 | Elf64_Half vn_version; | 
|  | 164 | Elf64_Half vn_cnt; | 
|  | 165 | Elf64_Word vn_file; | 
|  | 166 | Elf64_Word vn_aux; | 
|  | 167 | Elf64_Word vn_next; | 
|  | 168 | } Elf64_Verneed; | 
|  | 169 |  | 
|  | 170 | typedef struct { | 
|  | 171 | Elf64_Word vna_hash; | 
|  | 172 | Elf64_Half vna_flags; | 
|  | 173 | Elf64_Half vna_other; | 
|  | 174 | Elf64_Word vna_name; | 
|  | 175 | Elf64_Word vna_next; | 
|  | 176 | } Elf64_Vernaux; | 
|  | 177 |  | 
| Rahul Chaudhry | f16b659 | 2018-01-25 15:34:15 -0800 | [diff] [blame] | 178 | /* Relocation table entry for relative (in section of type SHT_RELR). */ | 
| Rahul Chaudhry | b7feec7 | 2017-12-19 15:25:23 -0800 | [diff] [blame] | 179 | typedef Elf32_Word Elf32_Relr; | 
|  | 180 | typedef Elf64_Xword Elf64_Relr; | 
| Rahul Chaudhry | b7feec7 | 2017-12-19 15:25:23 -0800 | [diff] [blame] | 181 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 182 | /* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html */ | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 183 |  | 
| Dmitriy Ivanov | a6bee4d | 2014-10-13 12:23:55 -0700 | [diff] [blame] | 184 | #define DF_1_NOW        0x00000001 /* Perform complete relocation processing. */ | 
| Dmitriy Ivanov | 6cdeb52 | 2014-09-29 19:14:45 -0700 | [diff] [blame] | 185 | #define DF_1_GROUP      0x00000004 | 
| Dmitriy Ivanov | 6cdeb52 | 2014-09-29 19:14:45 -0700 | [diff] [blame] | 186 | #define DF_1_INITFIRST  0x00000020 | 
| Dmitriy Ivanov | 6cdeb52 | 2014-09-29 19:14:45 -0700 | [diff] [blame] | 187 | #define DF_1_DIRECT     0x00000100 | 
|  | 188 | #define DF_1_TRANS      0x00000200 | 
| Dmitriy Ivanov | a6bee4d | 2014-10-13 12:23:55 -0700 | [diff] [blame] | 189 | #define DF_1_NODUMP     0x00001000 /* Object cannot be dumped with dldump(3) */ | 
| Dmitriy Ivanov | 6cdeb52 | 2014-09-29 19:14:45 -0700 | [diff] [blame] | 190 | #define DF_1_CONFALT    0x00002000 | 
|  | 191 | #define DF_1_ENDFILTEE  0x00004000 | 
|  | 192 | #define DF_1_DISPRELDNE 0x00008000 | 
|  | 193 | #define DF_1_DISPRELPND 0x00010000 | 
|  | 194 | #define DF_1_NODIRECT   0x00020000 | 
| Dmitriy Ivanov | a6bee4d | 2014-10-13 12:23:55 -0700 | [diff] [blame] | 195 | #define DF_1_IGNMULDEF  0x00040000 /* Internal use */ | 
|  | 196 | #define DF_1_NOKSYMS    0x00080000 /* Internal use */ | 
|  | 197 | #define DF_1_NOHDR      0x00100000 /* Internal use */ | 
| Dmitriy Ivanov | 6cdeb52 | 2014-09-29 19:14:45 -0700 | [diff] [blame] | 198 | #define DF_1_EDITED     0x00200000 | 
| Dmitriy Ivanov | a6bee4d | 2014-10-13 12:23:55 -0700 | [diff] [blame] | 199 | #define DF_1_NORELOC    0x00400000 /* Internal use */ | 
| Dmitriy Ivanov | 6cdeb52 | 2014-09-29 19:14:45 -0700 | [diff] [blame] | 200 | #define DF_1_SYMINTPOSE 0x00800000 | 
|  | 201 | #define DF_1_GLOBAUDIT  0x01000000 | 
|  | 202 | #define DF_1_SINGLETON  0x02000000 | 
|  | 203 | #define DF_1_STUB       0x04000000 | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 204 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 205 | /* http://www.sco.com/developers/gabi/latest/ch4.reloc.html */ | 
|  | 206 | #define ELF32_R_INFO(sym, type) ((((Elf32_Word)sym) << 8) | ((type) & 0xff)) | 
|  | 207 | #define ELF64_R_INFO(sym, type) ((((Elf64_Xword)sym) << 32) | ((type) & 0xffffffff)) | 
| Elliott Hughes | 0266ae5 | 2014-02-10 17:46:57 -0800 | [diff] [blame] | 208 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 209 | /* http://www.sco.com/developers/gabi/latest/ch4.symtab.html */ | 
| Elliott Hughes | d390df1 | 2017-04-30 22:56:10 -0700 | [diff] [blame] | 210 | #define ELF_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf)) | 
|  | 211 | #define ELF32_ST_INFO(b,t) ELF_ST_INFO(b,t) | 
|  | 212 | #define ELF64_ST_INFO(b,t) ELF_ST_INFO(b,t) | 
|  | 213 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 214 | /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */ | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 215 | #define GRP_MASKOS   0x0ff00000 | 
|  | 216 | #define GRP_MASKPROC 0xf0000000 | 
| Greg Hackmann | 8874d88 | 2017-10-31 13:25:03 -0700 | [diff] [blame] | 217 |  | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 218 | /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html */ | 
| Elliott Hughes | 0f19b10 | 2022-10-06 23:11:38 +0000 | [diff] [blame] | 219 | /* | 
|  | 220 | * Standard replacement for SHT_ANDROID_RELR. | 
|  | 221 | */ | 
| Elliott Hughes | 6663f55 | 2020-01-24 14:36:10 -0800 | [diff] [blame] | 222 | #define SHT_RELR 19 | 
| Elliott Hughes | a8a23f5 | 2017-10-31 17:22:41 -0700 | [diff] [blame] | 223 | #undef SHT_NUM | 
| Elliott Hughes | 6663f55 | 2020-01-24 14:36:10 -0800 | [diff] [blame] | 224 | #define SHT_NUM 20 | 
| Dmitriy Ivanov | 2a81536 | 2015-04-09 13:42:33 -0700 | [diff] [blame] | 225 |  | 
| Elliott Hughes | 6663f55 | 2020-01-24 14:36:10 -0800 | [diff] [blame] | 226 | /* | 
|  | 227 | * Experimental support for SHT_RELR sections. For details, see proposal | 
|  | 228 | * at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg. | 
| Elliott Hughes | b070cab | 2020-01-27 16:00:19 -0800 | [diff] [blame] | 229 | * | 
| Elliott Hughes | 6663f55 | 2020-01-24 14:36:10 -0800 | [diff] [blame] | 230 | * This was eventually replaced by SHT_RELR and DT_RELR (which are identical | 
|  | 231 | * other than their different constants), but those constants are only | 
| Elliott Hughes | b070cab | 2020-01-27 16:00:19 -0800 | [diff] [blame] | 232 | * supported by the OS in API levels >= 30. | 
| Elliott Hughes | 6663f55 | 2020-01-24 14:36:10 -0800 | [diff] [blame] | 233 | */ | 
|  | 234 | #define SHT_ANDROID_RELR 0x6fffff00 | 
|  | 235 | #define DT_ANDROID_RELR 0x6fffe000 | 
|  | 236 | #define DT_ANDROID_RELRSZ 0x6fffe001 | 
|  | 237 | #define DT_ANDROID_RELRENT 0x6fffe003 | 
|  | 238 | #define DT_ANDROID_RELRCOUNT 0x6fffe005 | 
| Elliott Hughes | b070cab | 2020-01-27 16:00:19 -0800 | [diff] [blame] | 239 |  | 
|  | 240 | /* | 
|  | 241 | * Android compressed REL/RELA sections. These were generated by the relocation | 
|  | 242 | * packer in old versions of Android, and can be generated directly by lld | 
|  | 243 | * with https://reviews.llvm.org/D39152. | 
|  | 244 | * | 
|  | 245 | * This was replaced by SHT_ANDROID_RELR in API level 28 (but is supported | 
|  | 246 | * in all API levels >= 23). | 
|  | 247 | */ | 
|  | 248 | #define SHT_ANDROID_REL 0x60000001 | 
|  | 249 | #define SHT_ANDROID_RELA 0x60000002 | 
|  | 250 | #define DT_ANDROID_REL 0x6000000f // DT_LOOS + 2 | 
|  | 251 | #define DT_ANDROID_RELSZ 0x60000010 // DT_LOOS + 3 | 
|  | 252 | #define DT_ANDROID_RELA 0x60000011 // DT_LOOS + 4 | 
|  | 253 | #define DT_ANDROID_RELASZ 0x60000012 // DT_LOOS + 5 | 
| Elliott Hughes | 0f19b10 | 2022-10-06 23:11:38 +0000 | [diff] [blame] | 254 |  | 
| Elliott Hughes | c221bec | 2024-06-11 12:59:38 +0000 | [diff] [blame] | 255 | /* arm64 psabi. */ | 
|  | 256 |  | 
| Elliott Hughes | b90d6b3 | 2024-03-26 19:15:42 +0000 | [diff] [blame] | 257 | /* TODO: upstreamed to FreeBSD as https://github.com/freebsd/freebsd-src/pull/1141/. */ | 
| Elliott Hughes | 6cd03ef | 2024-03-21 18:06:18 +0000 | [diff] [blame] | 258 | #define DT_AARCH64_MEMTAG_MODE 0x70000009 | 
|  | 259 | #define DT_AARCH64_MEMTAG_HEAP 0x7000000b | 
|  | 260 | #define DT_AARCH64_MEMTAG_STACK 0x7000000c | 
|  | 261 | #define DT_AARCH64_MEMTAG_GLOBALS 0x7000000d | 
|  | 262 | #define DT_AARCH64_MEMTAG_GLOBALSSZ 0x7000000f | 
|  | 263 |  | 
| Elliott Hughes | 0f19b10 | 2022-10-06 23:11:38 +0000 | [diff] [blame] | 264 | /* Linux traditionally doesn't have the trailing 64 that BSD has on these. */ | 
|  | 265 | #define R_AARCH64_TLS_DTPREL R_AARCH64_TLS_DTPREL64 | 
|  | 266 | #define R_AARCH64_TLS_DTPMOD R_AARCH64_TLS_DTPMOD64 | 
|  | 267 | #define R_AARCH64_TLS_TPREL R_AARCH64_TLS_TPREL64 | 
|  | 268 |  | 
|  | 269 | /* TODO: upstream these to FreeBSD? */ | 
|  | 270 | #define R_ARM_TLS_DESC 13 | 
|  | 271 | #define R_ARM_IRELATIVE 160 | 
| Elliott Hughes | dcfd870 | 2023-10-18 14:47:12 -0700 | [diff] [blame] | 272 |  | 
| Elliott Hughes | c221bec | 2024-06-11 12:59:38 +0000 | [diff] [blame] | 273 | /* riscv64 psabi. */ | 
|  | 274 |  | 
| Elliott Hughes | b90d6b3 | 2024-03-26 19:15:42 +0000 | [diff] [blame] | 275 | /* FreeBSD is missing these, found in | 
|  | 276 | * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocations | 
|  | 277 | * so I've sent https://github.com/freebsd/freebsd-src/pull/1141 upstream. | 
|  | 278 | */ | 
| Elliott Hughes | 6cd03ef | 2024-03-21 18:06:18 +0000 | [diff] [blame] | 279 | #define R_RISCV_TLSDESC 12 | 
|  | 280 | #define R_RISCV_PLT32 59 | 
|  | 281 | #define R_RISCV_SET_ULEB128 60 | 
|  | 282 | #define R_RISCV_SUB_ULEB128 61 | 
|  | 283 | #define R_RISCV_TLSDESC_HI20 62 | 
|  | 284 | #define R_RISCV_TLSDESC_LOAD_LO12 63 | 
|  | 285 | #define R_RISCV_TLSDESC_ADD_LO12 64 | 
|  | 286 | #define R_RISCV_TLSDESC_CALL 65 | 
|  | 287 |  | 
| Elliott Hughes | c221bec | 2024-06-11 12:59:38 +0000 | [diff] [blame] | 288 | /* https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#program-header-table */ | 
|  | 289 | #define PT_RISCV_ATTRIBUTES 0x70000003 | 
|  | 290 |  | 
|  | 291 | /* https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#section-types */ | 
|  | 292 | #define SHT_RISCV_ATTRIBUTES 0x70000003 | 
|  | 293 |  | 
| Elliott Hughes | b90d6b3 | 2024-03-26 19:15:42 +0000 | [diff] [blame] | 294 | /* FreeBSD spells this slightly differently to Linux. Linux is correct according to | 
|  | 295 | * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#file-header | 
|  | 296 | * so I've sent https://github.com/freebsd/freebsd-src/pull/1148 upstream. | 
|  | 297 | */ | 
|  | 298 | #define EF_RISCV_FLOAT_ABI EF_RISCV_FLOAT_ABI_MASK | 
|  | 299 |  | 
|  | 300 | /* FreeBSD spells this slightly differently to Linux. */ | 
| Elliott Hughes | dcfd870 | 2023-10-18 14:47:12 -0700 | [diff] [blame] | 301 | #define R_X86_64_JUMP_SLOT R_X86_64_JMP_SLOT |