On Fri, 2022-08-05 at 10:38 +0800, Lulu Cheng wrote: > > > I'm working on the implementation of specifing attributes of variables > > > for other architectures. > > > If the address is obtained through the GOT table and 4 instructions, > > > there is not much difference in performance. > > In this case I still prefer a GOT table entry because for 4-instruction > > absolute addressing sequence we'll need to implement 4 new relocation > > types in the kernel module loader. > If it is accessed through the GOT table, dynamic relocation is required when > the module is loaded.
Dynamic relocation is required when the module is loaded anyway. The .ko modules are actually relocatable ELF objects (produced by ld -r) and the module loader has to perform some work of a normal linker. > And accessing the got table may have a cache miss. /* snip */ > So my idea is "model(normal)","model (large)" etc. Then should we have an option to disable GOT globally? Maybe for kernel we'll just "-mno-got -mcmodel=large" (or "extreme"? The kernel image is loaded at 0x9000000000000000 and the modules are above 0xffff000000000000 so we need to handle 64-bit offset). -- Xi Ruoyao <xry...@xry111.site> School of Aerospace Science and Technology, Xidian University