1*e544ea57SArd Biesheuvel /* SPDX-License-Identifier: GPL-2.0 */ 2*e544ea57SArd Biesheuvel /* 3*e544ea57SArd Biesheuvel * When building position independent code with GCC using the -fPIC option, 4*e544ea57SArd Biesheuvel * (or even the -fPIE one on older versions), it will assume that we are 5*e544ea57SArd Biesheuvel * building a dynamic object (either a shared library or an executable) that 6*e544ea57SArd Biesheuvel * may have symbol references that can only be resolved at load time. For a 7*e544ea57SArd Biesheuvel * variety of reasons (ELF symbol preemption, the CoW footprint of the section 8*e544ea57SArd Biesheuvel * that is modified by the loader), this results in all references to symbols 9*e544ea57SArd Biesheuvel * with external linkage to go via entries in the Global Offset Table (GOT), 10*e544ea57SArd Biesheuvel * which carries absolute addresses which need to be fixed up when the 11*e544ea57SArd Biesheuvel * executable image is loaded at an offset which is different from its link 12*e544ea57SArd Biesheuvel * time offset. 13*e544ea57SArd Biesheuvel * 14*e544ea57SArd Biesheuvel * Fortunately, there is a way to inform the compiler that such symbol 15*e544ea57SArd Biesheuvel * references will be satisfied at link time rather than at load time, by 16*e544ea57SArd Biesheuvel * giving them 'hidden' visibility. 17*e544ea57SArd Biesheuvel */ 18*e544ea57SArd Biesheuvel 19*e544ea57SArd Biesheuvel #pragma GCC visibility push(hidden) 20