150476Speter/* $NetBSD: h_onlyuse_static.c,v 1.1 2023/06/02 19:08:49 riastradh Exp $ */ 23079Sache 3124716Sru/*- 4124716Sru * Copyright (c) 2023 The NetBSD Foundation, Inc. 5124716Sru * All rights reserved. 6124716Sru * 7124716Sru * Redistribution and use in source and binary forms, with or without 8124716Sru * modification, are permitted provided that the following conditions 9124716Sru * are met: 10124716Sru * 1. Redistributions of source code must retain the above copyright 11124716Sru * notice, this list of conditions and the following disclaimer. 12124716Sru * 2. Redistributions in binary form must reproduce the above copyright 13124716Sru * notice, this list of conditions and the following disclaimer in the 14124716Sru * documentation and/or other materials provided with the distribution. 15124716Sru * 16124716Sru * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17124716Sru * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18124716Sru * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19124716Sru * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20124716Sru * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21124716Sru * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22124716Sru * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23124716Sru * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24124716Sru * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25124716Sru * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26125208Sache * POSSIBILITY OF SUCH DAMAGE. 27124716Sru */ 28124716Sru 29124716Sruextern __thread int mysym __attribute__((tls_model("initial-exec"))); 30124716Sru 31124716Sruint *fstatic(void); 32124716Sruint * 33124716Srufstatic(void) 34124716Sru{ 35124716Sru 36124716Sru return &mysym; 37124716Sru} 38124716Sru