Thanks for the great analysis.

Dave Martin <[email protected]> writes:
> If so, we can work around it my adding all the required .type directives
> for code symbols in ocaml, but we should still raise the issue as a
> possible linker bug.

I think that's more than a workaround.  I think it's required by the EABI.
4.6.2 says:

    All code symbols exported from an object file (symbols with binding
    STB_GLOBAL) shall have type STT_FUNC.

so the code is violating that.  It also says:

    All extern data objects shall have type STT_OBJECT. No STB_GLOBAL
    data symbol shall have type STT_FUNC.

    The type of an undefined symbol shall be STT_NOTYPE or the type of
    its expected definition.

    The type of any other symbol defined in an executable section can be
    STT_NOTYPE. The linker is only required to provide interworking
    support for symbols of type STT_FUNC (interworking for untyped
    symbols must be encoded directly in the object file).

Like you say, the linker only considers converting BL to BLX for
function symbols, but I think that's deliberate.

Richard

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/810402

Title:
  all native ocaml programs segfault on armel

To manage notifications about this bug go to:
https://bugs.launchpad.net/binutils-linaro/+bug/810402/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to