mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
std.pie: add missing clobbers on alpha and sparc
Also format all the assembly code in the file.
This commit is contained in:
parent
9ab7eec23e
commit
94538d8dd2
1 changed files with 17 additions and 13 deletions
|
|
@ -56,7 +56,8 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
|
|||
\\ .weak _DYNAMIC
|
||||
\\ .hidden _DYNAMIC
|
||||
\\ call 1f
|
||||
\\ 1: pop %[ret]
|
||||
\\1:
|
||||
\\ pop %[ret]
|
||||
\\ lea _DYNAMIC - 1b(%[ret]), %[ret]
|
||||
: [ret] "=r" (-> [*]const elf.Dyn),
|
||||
),
|
||||
|
|
@ -79,7 +80,8 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
|
|||
\\ ldr %[ret], 1f
|
||||
\\ add %[ret], pc
|
||||
\\ b 2f
|
||||
\\ 1: .word _DYNAMIC-1b
|
||||
\\1:
|
||||
\\ .word _DYNAMIC-1b
|
||||
\\2:
|
||||
: [ret] "=r" (-> [*]const elf.Dyn),
|
||||
),
|
||||
|
|
@ -99,7 +101,7 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
|
|||
\\ ldq %[ret], -0x8000($29)
|
||||
: [ret] "=r" (-> [*]const elf.Dyn),
|
||||
:
|
||||
: .{ .r26 = true }),
|
||||
: .{ .r26 = true, .r29 = true }),
|
||||
// The CSKY ABI requires the gb register to point to the GOT. Additionally, the first
|
||||
// entry in the GOT is defined to hold the address of _DYNAMIC.
|
||||
.csky => asm volatile (
|
||||
|
|
@ -229,7 +231,8 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
|
|||
\\ larl %[ret], 1f
|
||||
\\ ag %[ret], 0(%[ret])
|
||||
\\ jg 2f
|
||||
\\ 1: .quad _DYNAMIC - .
|
||||
\\1:
|
||||
\\ .quad _DYNAMIC - .
|
||||
\\2:
|
||||
: [ret] "=a" (-> [*]const elf.Dyn),
|
||||
),
|
||||
|
|
@ -256,7 +259,8 @@ inline fn getDynamicSymbol() [*]const elf.Dyn {
|
|||
\\1:
|
||||
\\ add %%l7, %%o7, %[ret]
|
||||
: [ret] "=r" (-> [*]const elf.Dyn),
|
||||
),
|
||||
:
|
||||
: .{ .l7 = true }),
|
||||
else => {
|
||||
@compileError("PIE startup is not yet supported for this target!");
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue