1 /*
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
191 /**
192 * Elf64_Rel structure defines
193 */
194 enum Elf64_Rel {
195 r_offset( 0, 8),
196 r_info( 8, 8);
197
198 final int off;
199 final int sz;
200
201 Elf64_Rel(int offset, int size) {
202 this.off = offset;
203 this.sz = size;
204 }
205
206 static int totalsize = 16;
207
208 /**
209 * Relocation types
210 */
211 static final int R_X86_64_NONE = 0x0;
212 static final int R_X86_64_64 = 0x1;
213 static final int R_X86_64_PC32 = 0x2;
214 static final int R_X86_64_PLT32 = 0x4;
215 static final int R_X86_64_GOTPCREL = 0x9;
216
217 }
218
219 /**
220 * Elf64_Rela structure defines
221 */
222 enum Elf64_Rela {
223 r_offset( 0, 8),
224 r_info( 8, 8),
225 r_addend(16, 8);
226
227 final int off;
228 final int sz;
229
230 Elf64_Rela(int offset, int size) {
231 this.off = offset;
232 this.sz = size;
233 }
234
235 static int totalsize = 24;
236
237 static final int R_X86_64_NONE = 0x0;
238 static final int R_X86_64_64 = 0x1;
239 static final int R_X86_64_PC32 = 0x2;
240 static final int R_X86_64_PLT32 = 0x4;
241 static final int R_X86_64_GOTPCREL = 0x9;
242
243 static long ELF64_R_INFO(int symidx, int type) {
244 return (((long)symidx << 32) + type);
245 }
246
247 }
248 //@formatter:on
249 }
|
1 /*
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2018, Red Hat Inc. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
192 /**
193 * Elf64_Rel structure defines
194 */
195 enum Elf64_Rel {
196 r_offset( 0, 8),
197 r_info( 8, 8);
198
199 final int off;
200 final int sz;
201
202 Elf64_Rel(int offset, int size) {
203 this.off = offset;
204 this.sz = size;
205 }
206
207 static int totalsize = 16;
208
209 /**
210 * Relocation types
211 */
212
213 static final int R_X86_64_NONE = 0x0;
214 static final int R_X86_64_64 = 0x1;
215 static final int R_X86_64_PC32 = 0x2;
216 static final int R_X86_64_PLT32 = 0x4;
217 static final int R_X86_64_GOTPCREL = 0x9;
218
219 static final int R_AARCH64_NONE = 256;
220 static final int R_AARCH64_ABS64 = 257;
221 static final int R_AARCH64_CALL26 = 283;
222 static final int R_AARCH64_ADR_GOT_PAGE = 311;
223 static final int R_AARCH64_LD64_GOT_LO12_NC = 312;
224
225 static final int R_AARCH64_MOVW_UABS_G0_NC = 264;
226 static final int R_AARCH64_MOVW_UABS_G1_NC = 266;
227 static final int R_AARCH64_MOVW_UABS_G2_NC = 268;
228
229 static final int R_AARCH64_ADR_PREL_PG_HI21 = 275;
230 static final int R_AARCH64_ADD_ABS_LO12_NC = 277;
231 static final int R_AARCH64_LDST64_ABS_LO12_NC = 286;
232 }
233
234 /**
235 * Elf64_Rela structure defines
236 */
237 enum Elf64_Rela {
238 r_offset( 0, 8),
239 r_info( 8, 8),
240 r_addend(16, 8);
241
242 final int off;
243 final int sz;
244
245 Elf64_Rela(int offset, int size) {
246 this.off = offset;
247 this.sz = size;
248 }
249
250 static int totalsize = 24;
251
252 static final int R_X86_64_NONE = 0x0;
253 static final int R_X86_64_64 = 0x1;
254 static final int R_X86_64_PC32 = 0x2;
255 static final int R_X86_64_PLT32 = 0x4;
256 static final int R_X86_64_GOTPCREL = 0x9;
257
258 static final int R_AARCH64_NONE = 256;
259 static final int R_AARCH64_ABS64 = 257;
260 static final int R_AARCH64_CALL26 = 283;
261 static final int R_AARCH64_ADR_GOT_PAGE = 311;
262 static final int R_AARCH64_LD64_GOT_LO12_NC = 312;
263
264 static final int R_AARCH64_MOVW_UABS_G0_NC = 264;
265 static final int R_AARCH64_MOVW_UABS_G1_NC = 266;
266 static final int R_AARCH64_MOVW_UABS_G2_NC = 268;
267
268 static final int R_AARCH64_ADR_PREL_PG_HI21 = 275;
269 static final int R_AARCH64_ADD_ABS_LO12_NC = 277;
270 static final int R_AARCH64_LDST64_ABS_LO12_NC = 286;
271
272 static long ELF64_R_INFO(int symidx, int type) {
273 return (((long)symidx << 32) + type);
274 }
275
276 }
277 //@formatter:on
278 }
|