Thanks for the reply, Florian! On Fri, Oct 18, 2019 at 11:15:22AM +0200, Florian Weimer wrote: > > So what would be the proper way to pass this information from the linker to the > > compiler? > > In glibc, we use this: > > [ ... ] > uintptr_t section_length = __stop___libc_IO_vtables - __start___libc_IO_vtables; #define symbol_set_declare(set) \ extern char const __start_##set[] __symbol_set_attribute; \ extern char const __stop_##set[] __symbol_set_attribute; Due to symbol_set_declare, those symbols expand to two unrelated symbols. Using unrelated symbols for pointer arithmetic again violates the standard. Thus, the issue that Martin mentioned applies here, too. To get this conforming, the linker would need to export a symbol to the start of the section and the length of the section, IMHO. -- Josef Wolf jw@xxxxxxxxxxxxx