diff options
author | varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-04-12 11:31:33 +0000 |
---|---|---|
committer | varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-04-12 11:31:33 +0000 |
commit | 23b04dd211287eb1c841c129705af39afbe0ab15 (patch) | |
tree | db4bc3790673d93b5b16897c387d2c0083de871d /checklink/ELF_types.ml | |
parent | 547d8ecb50541db1e80bb23d065e55046a27452e (diff) | |
download | compcert-23b04dd211287eb1c841c129705af39afbe0ab15.tar.gz compcert-23b04dd211287eb1c841c129705af39afbe0ab15.zip |
Faster ndxes_of_sym_name
ndxes_of_sym_name used to have an O(s^2) complexity where s was the number
of symbols in the ELF file. It has now been reduced to an O(s*ln(s)) by
pre-computing the sets of symbols corresponding to each normalized symbol
name.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1875 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'checklink/ELF_types.ml')
-rw-r--r-- | checklink/ELF_types.ml | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/checklink/ELF_types.ml b/checklink/ELF_types.ml index a58b1eb0..a6568ed4 100644 --- a/checklink/ELF_types.ml +++ b/checklink/ELF_types.ml @@ -159,10 +159,11 @@ type elf32_phdr = { (** ELF *) type elf = { - e_bitstring: bitstring; - e_hdr: elf32_ehdr; - e_shdra: elf32_shdr array; - e_phdra: elf32_phdr array; - e_symtab: elf32_sym array; - e_symtab_sndx: int; (* to avoid having to find it again when needed *) + e_bitstring: bitstring; + e_hdr: elf32_ehdr; + e_shdra: elf32_shdr array; + e_phdra: elf32_phdr array; + e_symtab: elf32_sym array; + e_symtab_sndx: int; (* to avoid having to find it again when needed *) + e_syms_by_name: int list StringMap.t; (* faster lookup *) } |