Comment 12 for bug 810402

Revision history for this message
Michael Casadevall (mcasadevall) wrote :

So digging into this problem, I can confirm that reverting binutils resolves the build failure, so we're looking at a definate regression in binutils. Looking at gdb and the source, the problem comes during ocaml's internal initialization which is a bunch hand written ASM.

During startup, the application branches into caml_start_program, and segfaults while trying to load the address of caml_program into r12:

        .globl caml_start_program
caml_start_program:
        ldr r12, .Lcaml_program

/* Code shared with caml_callback* */
/* Address of Caml code to call is in r12 */
/* Arguments to the Caml code are in r0...r3 */

and caml_program is in the global reference table at the botton:

.Lcaml_program: .word caml_program

caml_program appears to be the "main" function of the compiled OCaml application, as its defined in every compiled ocaml binary I examined. For some reason, caml_program is pointing to an invalid address so when the process tries to load, it goes boom.