Hi Ramana, > -Generate code for the large code model. This makes no assumptions about > -addresses and sizes of sections. Programs can be statically linked only. > The > +Generate code for the large code model. This allows large .bss and .data > +sections, however .text and .rodata must still be < 2GiB in total. Position > +independent code or statically linked libraries are not supported. The > @option{-mcmodel=large} option is incompatible with @option{-mabi=ilp32}, > -@option{-fpic} and @option{-fPIC}. > +@option{-fpie}, @option{-fPIE}, @option{-fpic}, @option{-fPIC}, > +@option{-static}, @option{-moutline-atomics}.
> What's the issue with -static ? Basically the small and large model are fundamentally incompatible. The infamous "dumb linker" approach means it doesn't try to sort sections, so an ADRP relocation will be out of reach if its data is placed after a huge array. Static linking with GLIBC or enabling outline atomics are in fact the same issue. As I proposed for the medium model, the solution is to place large arrays into specially named sections so that they are ordered last. That means all "small" data referenced via ADRP will be in range, and thus using outline atomics or mixing small/medium model just work. The large model will have to do the same. Cheers, Wilco