Displaying 2 results from an estimated 2 matches for "__end_my_ptr_section".
2014 Dec 08
3
[LLVMdev] Incorrect loop optimization when building the Linux kernel
...uld either
adopt the GNU binutils convention of special __start_* / __end_* symbols,
or invent a new representation that is compelling.
Joerg suggested adding 'weak' as a workaround, but it doesn't seem
particularly compelling to me:
extern void *__start_my_ptr_section[];
extern void *__end_my_ptr_section[] __attribute__((weak)); // I'm assuming
Joerg implied the attribute goes here...
void iterate_my_section() {
for (void **i = __start_my_ptr_section; i != __end_my_ptr_section; i++) {
use_ptr(*i);
}
}
LLVM has had the concept of "appending" globals for a very long time, but
i...
2014 Dec 08
4
[LLVMdev] Incorrect loop optimization when building the Linux kernel
> It's difficult to say without a full example, but I'm very suspicious
> of those global declarations. I think the compiler would be entirely
> justified in assuming you could *never* get from __start_builtin_fw to
> __end_builtin_fw, let alone on the first iteration: they're distinct
> array objects and by definition (within C99) can't overlap.
I think this should