  Copyright ( c ) 2021   <  > 
  * 
  * Permission to use , copy , modify , and distribute this software for any 
  * purpose with or without fee is hereby granted , provided that the above 
  * copyright notice and this permission notice appear in all copies . 
  * 
  * THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES 
  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 
  * MERCHANTABILITY AND FITNESS . IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 
  * ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
  * WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN 
  * ACTION OF CONTRACT , NEGLIGENCE OR OTHER TORTIOUS ACTION , ARISING OUT OF 
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE . 
  * 
 
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 *)

open Import

val all_text :
  symbols:Symbols.t ->
  got:Bin_table.filled Jit_got.t addressed ->
  plt:Bin_table.filled Jit_plt.t addressed ->
  X86_emitter.buffer addressed ->
  (unit, string list) result
* Apply all relocations to the given .text binary section as patches . 
     Symbols ' absolute addresses are looked up using the provided tables for PLT and GOT based 
     relocations or the symbol map for other relocations . 
     It will return an error before applying any relocation if one or more of them ca n't properly be parsed 
     It will also return an error if a GOT or PLT relocation is marked as absolute but will still apply 
     other relocations . 
     Errors for either of the above mentioned cases are aggregated into a list .
    Symbols' absolute addresses are looked up using the provided tables for PLT and GOT based
    relocations or the symbol map for other relocations.
    It will return an error before applying any relocation if one or more of them can't properly be parsed
    It will also return an error if a GOT or PLT relocation is marked as absolute but will still apply
    other relocations.
    Errors for either of the above mentioned cases are aggregated into a list. *)

val all :
  symbols:Symbols.t ->
  section_name:string ->
  X86_emitter.buffer addressed ->
  (unit, string list) result
* Same as [ apply_all_text ] but for any other section . 
     The section is expected to contain no GOT nor PLT based relocations . If any such relocation is found 
     the function will return an error but still apply other relocations .
    The section is expected to contain no GOT nor PLT based relocations. If any such relocation is found
    the function will return an error but still apply other relocations. *)

  Copyright ( c ) 2021   <  > 
  * 
  * Permission to use , copy , modify , and distribute this software for any 
  * purpose with or without fee is hereby granted , provided that the above 
  * copyright notice and this permission notice appear in all copies . 
  * 
  * THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES 
  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 
  * MERCHANTABILITY AND FITNESS . IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 
  * ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
  * WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN 
  * ACTION OF CONTRACT , NEGLIGENCE OR OTHER TORTIOUS ACTION , ARISING OUT OF 
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE . 
  * 
 
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 *)

open Import

val all_text :
  symbols:Symbols.t ->
  got:Bin_table.filled Jit_got.t addressed ->
  plt:Bin_table.filled Jit_plt.t addressed ->
  X86_emitter.buffer addressed ->
  (unit, string list) result
* Apply all relocations to the given .text binary section as patches . 
     Symbols ' absolute addresses are looked up using the provided tables for PLT and GOT based 
     relocations or the symbol map for other relocations . 
     It will return an error before applying any relocation if one or more of them ca n't properly be parsed 
     It will also return an error if a GOT or PLT relocation is marked as absolute but will still apply 
     other relocations . 
     Errors for either of the above mentioned cases are aggregated into a list .
    Symbols' absolute addresses are looked up using the provided tables for PLT and GOT based
    relocations or the symbol map for other relocations.
    It will return an error before applying any relocation if one or more of them can't properly be parsed
    It will also return an error if a GOT or PLT relocation is marked as absolute but will still apply
    other relocations.
    Errors for either of the above mentioned cases are aggregated into a list. *)

val all :
  symbols:Symbols.t ->
  section_name:string ->
  X86_emitter.buffer addressed ->
  (unit, string list) result
* Same as [ apply_all_text ] but for any other section . 
     The section is expected to contain no GOT nor PLT based relocations . If any such relocation is found 
     the function will return an error but still apply other relocations .
    The section is expected to contain no GOT nor PLT based relocations. If any such relocation is found
    the function will return an error but still apply other relocations. *)
