1c510faceSchristos /*- 2c510faceSchristos * Copyright (c) 2021 The NetBSD Foundation, Inc. 3c510faceSchristos * All rights reserved. 4c510faceSchristos * 5c510faceSchristos * Redistribution and use in source and binary forms, with or without 6c510faceSchristos * modification, are permitted provided that the following conditions 7c510faceSchristos * are met: 8c510faceSchristos * 1. Redistributions of source code must retain the above copyright 9c510faceSchristos * notice, this list of conditions and the following disclaimer. 10c510faceSchristos * 2. Redistributions in binary form must reproduce the above copyright 11c510faceSchristos * notice, this list of conditions and the following disclaimer in the 12c510faceSchristos * documentation and/or other materials provided with the distribution. 13c510faceSchristos * 14c510faceSchristos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 15c510faceSchristos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 16c510faceSchristos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17c510faceSchristos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 18c510faceSchristos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19c510faceSchristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20c510faceSchristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21c510faceSchristos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22c510faceSchristos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23c510faceSchristos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24c510faceSchristos * POSSIBILITY OF SUCH DAMAGE. 25c510faceSchristos */ 26c510faceSchristos 27c510faceSchristos /* 28c510faceSchristos * For historical reasons the following symbols are defined both in libc 29c510faceSchristos * and csu and need to be common 30c510faceSchristos */ 31c510faceSchristos #if __has_attribute(__common__) 32c510faceSchristos #define __common __attribute((__common__)) 33c510faceSchristos #else 34c510faceSchristos #define __common 35c510faceSchristos #endif 36c510faceSchristos extern char *__progname __common; 37c510faceSchristos extern char **environ __common; 38c510faceSchristos extern struct ps_strings *__ps_strings __common; 39*a88bd0daSchristos 40*a88bd0daSchristos void _libc_init(void) __attribute__((__constructor__, __used__)); 41