Skip to content

Commit c7bc1bc

Browse files
topolarityclaude
andcommitted
arm64: use .subsections_via_symbols on Darwin
Apple's linker never removes anything from an object without this directive, so a static link with -dead_strip kept every assembly kernel it had loaded, used or not. With it, a kernel that nothing refers to is left out, as the C kernels already are. This is safe now that every label inside a kernel is L(name), local to the assembler: each kernel object defines one symbol, its entry point, and so is one block for the linker. EPILOGUE, until now empty, is added to the five kernels that did not end in it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 797634e commit c7bc1bc

6 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎common_arm64.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ static inline int blas_quickdivide(blasint x, blasint y){
168168
.endm
169169

170170

171+
#if defined(__APPLE__)
172+
#define EPILOGUE .subsections_via_symbols
173+
#else
171174
#define EPILOGUE
175+
#endif
172176

173177
#define PROFCODE
174178

‎kernel/arm64/axpy.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,5 @@ L(axpy_kernel_L999):
207207

208208
mov w0, wzr
209209
ret
210+
211+
EPILOGUE

‎kernel/arm64/daxpy_thunderx2t99.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,5 @@ L(daxpy_kernel_L999):
253253

254254
mov w0, wzr
255255
ret
256+
257+
EPILOGUE

‎kernel/arm64/rot.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,5 @@ L(rot_kernel_L999):
243243

244244
mov w0, wzr
245245
ret
246+
247+
EPILOGUE

‎kernel/arm64/zaxpy.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,5 @@ L(zaxpy_kernel_L999):
322322

323323
mov w0, wzr
324324
ret
325+
326+
EPILOGUE

‎kernel/arm64/zrot.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,5 @@ L(zrot_kernel_L999):
254254

255255
mov w0, wzr
256256
ret
257+
258+
EPILOGUE

0 commit comments

Comments
 (0)