summaryrefslogtreecommitdiff
path: root/lib/ocaml_rts/linksem/scratch.ml
blob: 4b57ba9d13837bc74fc08a8faa383ea37a7fe0f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(*Generated by Lem from scratch.lem.*)
open Byte_sequence
open Error
open Missing_pervasives

open Endianness
open Show

open Elf_file
open Elf_header
open Elf_note
open Elf_section_header_table

open Gnu_ext_note

let ( _:unit) =  
(let res =    
(Byte_sequence.acquire "/usr/bin/less" >>= (fun bs0 ->
    Elf_file.read_elf32_file bs0 >>= (fun ef1 ->
    let endian = (get_elf32_header_endianness ef1.elf32_file_header) in
    Elf_file.get_elf32_file_section_header_string_table ef1 >>= (fun sect_hdr ->
    return (gnu_ext_extract_elf32_earliest_compatible_kernel endian ef1.elf32_file_section_header_table sect_hdr bs0)))))
  in
    (match res with
      | Fail err  -> print_endline err
      | Success s -> print_endline (string_of_error 
  instance_Show_Show_string_dict s)
    ))