1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00

Bug 561787 - Make Elf parser names inline with java coding style

Replace under_score with camelCase for private non-api fields

Change-Id: Ica0dece19aaaf79d979588266f4c9552ea6d1224
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
This commit is contained in:
Matthew Khouzam 2020-04-02 18:11:32 -04:00 committed by Alexander Fedorov
parent 5e57f5e2a2
commit 1561c18f49

View file

@ -51,11 +51,13 @@ public class Elf {
protected byte[] section_strtab; protected byte[] section_strtab;
private Symbol[] symbols; private Symbol[] symbols;
private Symbol[] symtab_symbols; /** .symtab section */
private Section symtab_sym; private Symbol[] symbolsTable;
private Symbol[] dynsym_symbols; private Section symbolsTableSection;
private Section dynsym_sym; /** .dynSym section */
private boolean sections_mapped; // Have sections been mapped? Used to clean up properly in Elf.Dispose. private Symbol[] dynamicSymbols;
private Section dynamicSymbolSection;
private boolean areSectionsMapped; // Have sections been mapped? Used to clean up properly in Elf.Dispose.
protected String EMPTY_STRING = ""; //$NON-NLS-1$ protected String EMPTY_STRING = ""; //$NON-NLS-1$
@ -331,7 +333,7 @@ public class Elf {
*/ */
public ByteBuffer mapSectionData() throws IOException { public ByteBuffer mapSectionData() throws IOException {
makeSureNotCompressed(); makeSureNotCompressed();
sections_mapped = true; areSectionsMapped = true;
return efile.getChannel().map(MapMode.READ_ONLY, sh_offset, sh_size).load().asReadOnlyBuffer(); return efile.getChannel().map(MapMode.READ_ONLY, sh_offset, sh_size).load().asReadOnlyBuffer();
} }
@ -973,7 +975,7 @@ public class Elf {
efile = null; efile = null;
// ensure the mappings get cleaned up // ensure the mappings get cleaned up
if (sections_mapped) if (areSectionsMapped)
System.gc(); System.gc();
} }
} catch (IOException e) { } catch (IOException e) {
@ -1126,28 +1128,28 @@ public class Elf {
if (symbols == null) { if (symbols == null) {
Section section[] = getSections(Section.SHT_SYMTAB); Section section[] = getSections(Section.SHT_SYMTAB);
if (section.length > 0) { if (section.length > 0) {
symtab_sym = section[0]; symbolsTableSection = section[0];
symtab_symbols = loadSymbolsBySection(section[0]); symbolsTable = loadSymbolsBySection(section[0]);
} else { } else {
symtab_sym = null; symbolsTableSection = null;
symtab_symbols = new Symbol[0]; symbolsTable = new Symbol[0];
} }
section = getSections(Section.SHT_DYNSYM); section = getSections(Section.SHT_DYNSYM);
if (section.length > 0) { if (section.length > 0) {
dynsym_sym = section[0]; dynamicSymbolSection = section[0];
dynsym_symbols = loadSymbolsBySection(section[0]); dynamicSymbols = loadSymbolsBySection(section[0]);
} else { } else {
dynsym_sym = null; dynamicSymbolSection = null;
dynsym_symbols = new Symbol[0]; dynamicSymbols = new Symbol[0];
} }
if (symtab_sym != null) { if (symbolsTableSection != null) {
// sym = symtab_sym; // sym = symtab_sym;
symbols = symtab_symbols; symbols = symbolsTable;
} else if (dynsym_sym != null) { } else if (dynamicSymbolSection != null) {
// sym = dynsym_sym; // sym = dynsym_sym;
symbols = dynsym_symbols; symbols = dynamicSymbols;
} }
} }
} }
@ -1157,11 +1159,11 @@ public class Elf {
} }
public Symbol[] getDynamicSymbols() { public Symbol[] getDynamicSymbols() {
return dynsym_symbols; return dynamicSymbols;
} }
public Symbol[] getSymtabSymbols() { public Symbol[] getSymtabSymbols() {
return symtab_symbols; return symbolsTable;
} }
/* return the address of the function that address is in */ /* return the address of the function that address is in */