Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8014326

[OSX] All libjvm symbols are exported

    Details

    • Subcomponent:
    • Resolved In Build:
      b39
    • OS:
      os_x
    • Verification:
      Not verified

      Backports

        Description

        The OSX/BSD port was a modified copy of the linux port. On linux we use mapfiles and linker-scripts to control which symbols get exported from libjvm (the JNI_* and JVM_* primary interfaces plus some jio_ functions.) On OSX the linker does not support linker-scripts so the in the makefile we simple set LDNOMAP=true and this disables the use of the mapfiles. Combined with the fact that the default visibility for symbols is visible the consequence of this is that every symbol in the VM is exported!

        The implications of this can be quite significant as the linker will bind symbols to functions based on the order it finds them in the various shared libraries. We discovered during some changes in the VM that some of the JDK native code is actually calling the VM's global operator new! It is even possible that a library might use mismatched functions from different shared objects - eg malloc from liba and free from libb.

        There are a number of strange OSX crashes that are currently being investigated, and it is possible that the could be caused due to this linkage problem

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dcubed Daniel Daugherty
                  Reporter:
                  dholmes David Holmes
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: