summaryrefslogtreecommitdiff
path: root/checklink/PPC_utils.ml
diff options
context:
space:
mode:
authorGravatar varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-06-01 13:57:16 +0000
committerGravatar varobert <varobert@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-06-01 13:57:16 +0000
commit20d10f71ea444e326a7a77670844214375c72514 (patch)
tree35f45c9b96afb13e884aa8f8208c3cb1ef9061e7 /checklink/PPC_utils.ml
parent53f005a11435008373bac84362cef8ddd63a4bc0 (diff)
checklink: new disassembler, error severity, ...
- Added the -disass command-line option to disassemble symbols found in the ELF ; - Field mismatch now stops the matching of two code fragments, while it used to only emit an error in the log ; - Fixed a long-lasting bug in the command-line option ; - Some error messages have been improved. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1908 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'checklink/PPC_utils.ml')
-rw-r--r--checklink/PPC_utils.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/checklink/PPC_utils.ml b/checklink/PPC_utils.ml
index 44d49d3..6c865dd 100644
--- a/checklink/PPC_utils.ml
+++ b/checklink/PPC_utils.ml
@@ -10,13 +10,15 @@ let code_at_vaddr (e: elf)(vaddr: int32)(nb_instr: int): ecode option =
| Some(code_bs, _, _) -> Some (parse_code_as_list code_bs)
end
-let code_of_sym_ndx (e: elf) (ndx: int): ecode option =
- let sym = e.e_symtab.(ndx) in
+let code_of_sym (e: elf) (sym: elf32_sym): ecode option =
begin match bitstring_at_vaddr e sym.st_value sym.st_size with
| None -> None
| Some(bs, _, _) -> Some(parse_code_as_list bs)
end
+let code_of_sym_ndx (e: elf) (ndx: int): ecode option =
+ code_of_sym e e.e_symtab.(ndx)
+
let code_of_sym_name (e: elf) (name: string): ecode option =
begin match ndx_of_sym_name e name with
| Some ndx -> code_of_sym_ndx e ndx