git: f44df7959ae2 - main - libc: ssp: remove some GCC 4.2 remnants
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Feb 2023 04:14:26 UTC
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f44df7959ae251e64939a03b92989592d7d6ac31 commit f44df7959ae251e64939a03b92989592d7d6ac31 Author: Kyle Evans <kevans@FreeBSD.org> AuthorDate: 2023-02-10 04:08:07 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2023-02-10 04:11:54 +0000 libc: ssp: remove some GCC 4.2 remnants With GCC 4.2 out of the tree for a while now and no sign of it returning, we don't really need to support older versions that don't allow us to specify a ctor priority anymore. Noticed by: mjg --- lib/libc/secure/stack_protector.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/libc/secure/stack_protector.c b/lib/libc/secure/stack_protector.c index 7ddd6338ec55..909debecf26e 100644 --- a/lib/libc/secure/stack_protector.c +++ b/lib/libc/secure/stack_protector.c @@ -47,23 +47,15 @@ __FBSDID("$FreeBSD$"); * they're either not usually statically linked or they simply don't do things * in constructors that would be adversely affected by their positioning with * respect to this initialization. - * - * This conditional should be removed when GCC 4.2 is removed. */ -#if __has_attribute(__constructor__) || __GNUC_PREREQ__(4, 3) -#define _GUARD_SETUP_CTOR_ATTR \ +static void __guard_setup(void) __attribute__((__constructor__ (200), __used__)); -#else -#define _GUARD_SETUP_CTOR_ATTR \ - __attribute__((__constructor__, __used__)); -#endif extern long __stack_chk_guard[8]; extern int __sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; -static void __guard_setup(void) _GUARD_SETUP_CTOR_ATTR; static void __fail(const char *) __dead2; void __stack_chk_fail(void) __dead2; void __chk_fail(void) __dead2;