From: deraadt Date: Tue, 25 Apr 2023 04:06:06 +0000 (+0000) Subject: placing .align after the function start is crazy. other things are ensuring X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ba1a662dfef04c6a41bfa010ee4cf1698774c189;p=openbsd placing .align after the function start is crazy. other things are ensuring this function is at the start of the section, there is no poing in potentially stuffing nops into the sequence if things go wrong, it is better to fail hard. ok guenther --- diff --git a/lib/csu/amd64/md_init.h b/lib/csu/amd64/md_init.h index 83365c3ea8d..329c2d35950 100644 --- a/lib/csu/amd64/md_init.h +++ b/lib/csu/amd64/md_init.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md_init.h,v 1.8 2020/10/15 16:30:23 deraadt Exp $ */ +/* $OpenBSD: md_init.h,v 1.9 2023/04/25 04:06:06 deraadt Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -38,18 +38,13 @@ " call " #func "\n" \ " .previous") -/* - * Align is after because we want the function to start at the first - * address of the section, but overall we want the section to be - * aligned by the align amount. - */ #define MD_SECTION_PROLOGUE(sect, entry_pt) \ __asm ( \ ".section "#sect",\"ax\",@progbits \n" \ " .globl " #entry_pt " \n" \ " .type " #entry_pt ",@function \n" \ - #entry_pt": \n" \ " .align 16 \n" \ + #entry_pt": \n" \ " subq $8,%rsp \n" \ " .previous") diff --git a/lib/csu/i386/md_init.h b/lib/csu/i386/md_init.h index 64d7aeb94aa..efd601d12bc 100644 --- a/lib/csu/i386/md_init.h +++ b/lib/csu/i386/md_init.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md_init.h,v 1.11 2020/10/15 16:30:23 deraadt Exp $ */ +/* $OpenBSD: md_init.h,v 1.12 2023/04/25 04:06:06 deraadt Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -38,18 +38,13 @@ " call " #func "\n" \ " .previous") -/* - * Align is after because we want the function to start at the first - * address of the section, but overall we want the section to be - * aligned by the align amount. - */ #define MD_SECTION_PROLOGUE(sect, entry_pt) \ __asm ( \ ".section "#sect",\"ax\",@progbits \n" \ " .globl " #entry_pt " \n" \ " .type " #entry_pt ",@function \n" \ - #entry_pt": \n" \ " .align 16 \n" \ + #entry_pt": \n" \ " pushl %ebp \n" \ " movl %esp,%ebp \n" \ " andl $~15,%esp \n" \