Ignore:
Timestamp:
Oct 30, 2017, 1:16:44 AM (8 years ago)
Author:
[email protected]
Message:

[ARM64][Linux] Re-enable Gigacage
https://bugs.webkit.org/show_bug.cgi?id=178130

Reviewed by Michael Catanzaro.

Source/bmalloc:

  • bmalloc/Gigacage.h: Re-enable Gigacage on ARM64 Linux.

Source/JavaScriptCore:

Guard the current globaladdr opcode implementation for ARM64 with
OS(DARWIN) as it's only usable for Mach-O.

For OS(LINUX), ELF-supported :got: and :got_lo12: relocation specifiers
have to be used. The .loh directive can't be used as it's not supported
in GCC or the ld linker.

On every other OS target, a compilation error is thrown.

  • offlineasm/arm64.rb:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/arm64.rb

    r223239 r224171  
    933933        when "globaladdr"
    934934            uid = $asm.newUID
     935
     936            # On Darwin, use Macho-O GOT relocation specifiers, along with
     937            # the labels required for the .loh directive.
     938            $asm.putStr("#if OS(DARWIN)")
    935939            $asm.puts "L_offlineasm_loh_adrp_#{uid}:"
    936940            $asm.puts "adrp #{operands[1].arm64Operand(:ptr)}, #{operands[0].asmLabel}@GOTPAGE"
    937941            $asm.puts "L_offlineasm_loh_ldr_#{uid}:"
    938942            $asm.puts "ldr #{operands[1].arm64Operand(:ptr)}, [#{operands[1].arm64Operand(:ptr)}, #{operands[0].asmLabel}@GOTPAGEOFF]"
     943
     944            # On Linux, use ELF GOT relocation specifiers.
     945            $asm.putStr("#elif OS(LINUX)")
     946            $asm.puts "adrp #{operands[1].arm64Operand(:ptr)}, :got:#{operands[0].asmLabel}"
     947            $asm.puts "ldr #{operands[1].arm64Operand(:ptr)}, [#{operands[1].arm64Operand(:ptr)}, :got_lo12:#{operands[0].asmLabel}]"
     948
     949            # Throw a compiler error everywhere else.
     950            $asm.putStr("#else")
     951            $asm.putStr("#error Missing globaladdr implementation")
     952            $asm.putStr("#endif")
     953
    939954            $asm.deferAction {
     955                # On Darwin, also include the .loh directive using the generated labels.
     956                $asm.putStr("#if OS(DARWIN)")
    940957                $asm.puts ".loh AdrpLdrGot L_offlineasm_loh_adrp_#{uid}, L_offlineasm_loh_ldr_#{uid}"
     958                $asm.putStr("#endif")
    941959            }
    942960        else
Note: See TracChangeset for help on using the changeset viewer.