From 1b28d19f8fca4b73cb59c906e25558a777ca6d3f Mon Sep 17 00:00:00 2001 From: David Inglis Date: Thu, 24 Mar 2005 16:57:47 +0000 Subject: [PATCH] fixed bug # 88992 --- core/org.eclipse.cdt.core/ChangeLog | 7 +++++++ .../utils/org/eclipse/cdt/utils/elf/Elf.java | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index 7215f089c02..8022610c4ad 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,10 @@ +2005-03-24 Eric ter Haar + Added some e_machine types and made section reading seek to each section + before reading encase section records are extended. + + * util/org/eclipse/cdt/utils/elf/Elf.java + + 2005-03-24 Vladimir Hirsl New DOM AST based indexer. Indexer infrastructure and CPP/C AST visitors. diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java index 71e901f3a01..407e8efa8a6 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java @@ -100,6 +100,7 @@ public class Elf { public final static int EM_ARM = 40; public final static int EM_SH = 42; public final static int EM_SPARCV9 = 43; + public final static int EM_TRICORE = 44; public final static int EM_H8_300 = 46; public final static int EM_H8_300H = 47; public final static int EM_IA_64 = 50; @@ -114,6 +115,8 @@ public class Elf { public final static int EM_MSP430 = 105; public final static int EM_EXCESS = 111; public final static int EM_NIOSII = 113; + public final static int EM_C166 = 116; + public final static int EM_M16C = 117; public final static int EM_NIOS = 0xFEBB; public final static int EM_CYGNUS_POWERPC = 0x9025; public final static int EM_CYGNUS_M32R = 0x9041; @@ -813,6 +816,15 @@ public class Elf { case Elf.ELFhdr.EM_XILINX_MICROBLAZE: attrib.cpu = "microblaze"; //$NON-NLS-1$ break; + case Elf.ELFhdr.EM_C166: + attrib.cpu = "c166"; //$NON-NLS-1$ + break; + case Elf.ELFhdr.EM_TRICORE: + attrib.cpu = "TriCore"; //$NON-NLS-1$ + break; + case Elf.ELFhdr.EM_M16C: + attrib.cpu = "M16C"; //$NON-NLS-1$ + break; case Elf.ELFhdr.EM_NONE : default : attrib.cpu = "none"; //$NON-NLS-1$ @@ -928,9 +940,9 @@ public class Elf { sections = new Section[0]; return sections; } - efile.seek(ehdr.e_shoff); sections = new Section[ehdr.e_shnum]; for (int i = 0; i < ehdr.e_shnum; i++) { + efile.seek(ehdr.e_shoff + i * ehdr.e_shentsize); sections[i] = new Section(); sections[i].sh_name = efile.readIntE(); sections[i].sh_type = efile.readIntE();