1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56: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;
private Symbol[] symbols;
private Symbol[] symtab_symbols;
private Section symtab_sym;
private Symbol[] dynsym_symbols;
private Section dynsym_sym;
private boolean sections_mapped; // Have sections been mapped? Used to clean up properly in Elf.Dispose.
/** .symtab section */
private Symbol[] symbolsTable;
private Section symbolsTableSection;
/** .dynSym section */
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$
@ -331,7 +333,7 @@ public class Elf {
*/
public ByteBuffer mapSectionData() throws IOException {
makeSureNotCompressed();
sections_mapped = true;
areSectionsMapped = true;
return efile.getChannel().map(MapMode.READ_ONLY, sh_offset, sh_size).load().asReadOnlyBuffer();
}
@ -973,7 +975,7 @@ public class Elf {
efile = null;
// ensure the mappings get cleaned up
if (sections_mapped)
if (areSectionsMapped)
System.gc();
}
} catch (IOException e) {
@ -1126,28 +1128,28 @@ public class Elf {
if (symbols == null) {
Section section[] = getSections(Section.SHT_SYMTAB);
if (section.length > 0) {
symtab_sym = section[0];
symtab_symbols = loadSymbolsBySection(section[0]);
symbolsTableSection = section[0];
symbolsTable = loadSymbolsBySection(section[0]);
} else {
symtab_sym = null;
symtab_symbols = new Symbol[0];
symbolsTableSection = null;
symbolsTable = new Symbol[0];
}
section = getSections(Section.SHT_DYNSYM);
if (section.length > 0) {
dynsym_sym = section[0];
dynsym_symbols = loadSymbolsBySection(section[0]);
dynamicSymbolSection = section[0];
dynamicSymbols = loadSymbolsBySection(section[0]);
} else {
dynsym_sym = null;
dynsym_symbols = new Symbol[0];
dynamicSymbolSection = null;
dynamicSymbols = new Symbol[0];
}
if (symtab_sym != null) {
if (symbolsTableSection != null) {
// sym = symtab_sym;
symbols = symtab_symbols;
} else if (dynsym_sym != null) {
symbols = symbolsTable;
} else if (dynamicSymbolSection != null) {
// sym = dynsym_sym;
symbols = dynsym_symbols;
symbols = dynamicSymbols;
}
}
}
@ -1157,11 +1159,11 @@ public class Elf {
}
public Symbol[] getDynamicSymbols() {
return dynsym_symbols;
return dynamicSymbols;
}
public Symbol[] getSymtabSymbols() {
return symtab_symbols;
return symbolsTable;
}
/* return the address of the function that address is in */