|
19 | 19 |
|
20 | 20 | /*
|
21 | 21 | * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
|
22 |
| - * Portions Copyright (c) 2018-2019, Chris Fraire <cfraire@me.com>. |
| 22 | + * Portions Copyright (c) 2018-2020, Chris Fraire <cfraire@me.com>. |
23 | 23 | */
|
24 | 24 | package org.opengrok.indexer.analysis.executables;
|
25 | 25 |
|
@@ -193,23 +193,23 @@ private static class ELFHeader {
|
193 | 193 | // Word = int
|
194 | 194 | // un = unsignedBtye
|
195 | 195 |
|
196 |
| - public EI_Class ei_class; |
197 |
| - public EI_Data ei_data; |
| 196 | + EI_Class ei_class; |
| 197 | + EI_Data ei_data; |
198 | 198 | @SuppressWarnings("unused")
|
199 |
| - public int ei_version; |
200 |
| - public E_Type e_type; |
201 |
| - public E_Machine e_machine; |
202 |
| - public E_Version e_version; |
203 |
| - public int e_entry; |
204 |
| - public int e_phoff; |
205 |
| - public int e_shoff; |
206 |
| - public int e_flags; |
207 |
| - public int e_ehsize; |
208 |
| - public int e_phentsize; |
209 |
| - public int e_phnum; |
210 |
| - public int e_shentsize; |
211 |
| - public int e_shnum; |
212 |
| - public int e_shstrndx; |
| 199 | + int ei_version; |
| 200 | + E_Type e_type; |
| 201 | + E_Machine e_machine; |
| 202 | + E_Version e_version; |
| 203 | + int e_entry; |
| 204 | + int e_phoff; |
| 205 | + int e_shoff; |
| 206 | + int e_flags; |
| 207 | + int e_ehsize; |
| 208 | + int e_phentsize; |
| 209 | + int e_phnum; |
| 210 | + int e_shentsize; |
| 211 | + int e_shnum; |
| 212 | + int e_shstrndx; |
213 | 213 |
|
214 | 214 | ELFHeader(MappedByteBuffer fmap) throws IllegalArgumentException {
|
215 | 215 | if (fmap.get(ELFIdentification.EI_MAG0.value()) != 0x7f ||
|
@@ -256,46 +256,46 @@ public String toString() {
|
256 | 256 | }
|
257 | 257 |
|
258 | 258 | private static class ELFSection {
|
259 |
| - public static final int SHT_NULL = 0; /* Section header table entry unused */ |
260 |
| - public static final int SHT_PROGBITS = 1; /* Program data */ |
261 |
| - public static final int SHT_SYMTAB = 2; /* Symbol table */ |
262 |
| - public static final int SHT_STRTAB = 3; /* String table */ |
263 |
| - public static final int SHT_RELA = 4; /* Relocation entries with addends */ |
264 |
| - public static final int SHT_HASH = 5; /* Symbol hash table */ |
265 |
| - public static final int SHT_DYNAMIC = 6; /* Dynamic linking information */ |
266 |
| - public static final int SHT_NOTE = 7; /* Notes */ |
267 |
| - public static final int SHT_NOBITS = 8; /* Program space with no data (bss) */ |
268 |
| - public static final int SHT_REL = 9; /* Relocation entries, no addends */ |
269 |
| - public static final int SHT_SHLIB = 10; /* Reserved */ |
270 |
| - public static final int SHT_DYNSYM = 11; /* Dynamic linker symbol table */ |
271 |
| - public static final int SHT_INIT_ARRAY = 14; /* Array of constructors */ |
272 |
| - public static final int SHT_FINI_ARRAY = 15; /* Array of destructors */ |
273 |
| - public static final int SHT_PREINIT_ARRAY = 16; /* Array of pre-constructors */ |
274 |
| - public static final int SHT_GROUP = 17; /* Section group */ |
275 |
| - public static final int SHT_SYMTAB_SHNDX = 18; /* Extended section indices */ |
276 |
| - public static final int SHT_NUM = 19; /* Number of defined types. */ |
277 |
| - public static final int SHT_LOOS = 0x60000000; /* Start OS-specific */ |
278 |
| - public static final int SHT_GNU_LIBLIST = 0x6ffffff7; /* Prelink library list */ |
279 |
| - public static final int SHT_CHECKSUM = 0x6ffffff8; /* Checksum for DSO content. */ |
280 |
| - public static final int SHT_LOSUNW = 0x6ffffffa; /* Sun-specific low bound. */ |
281 |
| - public static final int SHT_SUNW_COMDAT = 0x6ffffffb; |
282 |
| - public static final int SHT_HISUNW = 0x6fffffff; /* Sun-specific high bound. */ |
283 |
| - public static final int SHT_HIOS = 0x6fffffff; /* End OS-specific type */ |
284 |
| - public static final int SHT_LOPROC = 0x70000000; /* Start of processor-specific */ |
285 |
| - public static final int SHT_HIPROC = 0x7fffffff; /* End of processor-specific */ |
286 |
| - public static final int SHT_LOUSER = 0x80000000; /* Start of application-specific */ |
287 |
| - public static final int SHT_HIUSER = 0x8fffffff; /* End of application-specific */ |
288 |
| - |
289 |
| - public int sh_name; |
290 |
| - public int sh_type; |
291 |
| - public int sh_flags; |
292 |
| - public int sh_addr; |
293 |
| - public int sh_offset; |
294 |
| - public int sh_size; |
295 |
| - public int sh_link; |
296 |
| - public int sh_info; |
297 |
| - public int sh_addralign; |
298 |
| - public int sh_entsize; |
| 259 | + static final int SHT_NULL = 0; /* Section header table entry unused */ |
| 260 | + static final int SHT_PROGBITS = 1; /* Program data */ |
| 261 | + static final int SHT_SYMTAB = 2; /* Symbol table */ |
| 262 | + static final int SHT_STRTAB = 3; /* String table */ |
| 263 | + static final int SHT_RELA = 4; /* Relocation entries with addends */ |
| 264 | + static final int SHT_HASH = 5; /* Symbol hash table */ |
| 265 | + static final int SHT_DYNAMIC = 6; /* Dynamic linking information */ |
| 266 | + static final int SHT_NOTE = 7; /* Notes */ |
| 267 | + static final int SHT_NOBITS = 8; /* Program space with no data (bss) */ |
| 268 | + static final int SHT_REL = 9; /* Relocation entries, no addends */ |
| 269 | + static final int SHT_SHLIB = 10; /* Reserved */ |
| 270 | + static final int SHT_DYNSYM = 11; /* Dynamic linker symbol table */ |
| 271 | + static final int SHT_INIT_ARRAY = 14; /* Array of constructors */ |
| 272 | + static final int SHT_FINI_ARRAY = 15; /* Array of destructors */ |
| 273 | + static final int SHT_PREINIT_ARRAY = 16; /* Array of pre-constructors */ |
| 274 | + static final int SHT_GROUP = 17; /* Section group */ |
| 275 | + static final int SHT_SYMTAB_SHNDX = 18; /* Extended section indices */ |
| 276 | + static final int SHT_NUM = 19; /* Number of defined types. */ |
| 277 | + static final int SHT_LOOS = 0x60000000; /* Start OS-specific */ |
| 278 | + static final int SHT_GNU_LIBLIST = 0x6ffffff7; /* Prelink library list */ |
| 279 | + static final int SHT_CHECKSUM = 0x6ffffff8; /* Checksum for DSO content. */ |
| 280 | + static final int SHT_LOSUNW = 0x6ffffffa; /* Sun-specific low bound. */ |
| 281 | + static final int SHT_SUNW_COMDAT = 0x6ffffffb; |
| 282 | + static final int SHT_HISUNW = 0x6fffffff; /* Sun-specific high bound. */ |
| 283 | + static final int SHT_HIOS = 0x6fffffff; /* End OS-specific type */ |
| 284 | + static final int SHT_LOPROC = 0x70000000; /* Start of processor-specific */ |
| 285 | + static final int SHT_HIPROC = 0x7fffffff; /* End of processor-specific */ |
| 286 | + static final int SHT_LOUSER = 0x80000000; /* Start of application-specific */ |
| 287 | + static final int SHT_HIUSER = 0x8fffffff; /* End of application-specific */ |
| 288 | + |
| 289 | + int sh_name; |
| 290 | + int sh_type; |
| 291 | + int sh_flags; |
| 292 | + int sh_addr; |
| 293 | + int sh_offset; |
| 294 | + int sh_size; |
| 295 | + int sh_link; |
| 296 | + int sh_info; |
| 297 | + int sh_addralign; |
| 298 | + int sh_entsize; |
299 | 299 |
|
300 | 300 | ELFSection(MappedByteBuffer fmap) {
|
301 | 301 | sh_name = fmap.getInt();
|
@@ -336,7 +336,7 @@ private enum ELFIdentification {
|
336 | 336 | this.value = value;
|
337 | 337 | }
|
338 | 338 |
|
339 |
| - public int value() { |
| 339 | + int value() { |
340 | 340 | return this.value;
|
341 | 341 | }
|
342 | 342 | }
|
@@ -366,7 +366,7 @@ static EI_Class valueOf(byte value) throws IllegalArgumentException {
|
366 | 366 | }
|
367 | 367 | }
|
368 | 368 |
|
369 |
| - public int value() { |
| 369 | + int value() { |
370 | 370 | return this.value;
|
371 | 371 | }
|
372 | 372 |
|
@@ -397,7 +397,7 @@ static EI_Data valueOf(byte value) throws IllegalArgumentException {
|
397 | 397 | }
|
398 | 398 | }
|
399 | 399 |
|
400 |
| - public int value() { |
| 400 | + int value() { |
401 | 401 | return this.value;
|
402 | 402 | }
|
403 | 403 | }
|
@@ -432,7 +432,7 @@ static E_Type valueOf(short value) {
|
432 | 432 | }
|
433 | 433 | }
|
434 | 434 |
|
435 |
| - public int value() { |
| 435 | + int value() { |
436 | 436 | return this.value;
|
437 | 437 | }
|
438 | 438 |
|
@@ -483,7 +483,7 @@ static E_Machine valueOf(short value) {
|
483 | 483 | }
|
484 | 484 | }
|
485 | 485 |
|
486 |
| - public int value() { |
| 486 | + int value() { |
487 | 487 | return this.value;
|
488 | 488 | }
|
489 | 489 |
|
@@ -519,7 +519,7 @@ static E_Version valueOf(int value) throws IllegalArgumentException {
|
519 | 519 | }
|
520 | 520 | }
|
521 | 521 |
|
522 |
| - public int value() { |
| 522 | + int value() { |
523 | 523 | return this.value;
|
524 | 524 | }
|
525 | 525 |
|
|
0 commit comments