Simon Marlow: > On 16/09/2010 12:56, Manuel M T Chakravarty wrote: >> Simon Marlow: >>> On 16/09/2010 04:09, Ben Lippmeier wrote: >>>> The size of each section can only be 0xffffff (16 MiB). That >>>> means we'd already used 92% of the available space in the text >>>> section before the recent changes. >>> >>> Really? Surely the size of the text section can't be limited to >>> 16MB, there must be shared libraries that exceed that. If the >>> limit is really on the size of a section, then we'll run into >>> trouble with the dynamic version of the GHC library too, and >>> splitting it up would be painful (we assume that all modules of a >>> package reside in the same shared library, to avoid having to make >>> expensive dynamic references all the time). >>> >>> Isn't it just that you can't have a "scattered relocation" with an >>> offset greater than 0xffffff? >>> >>> So if it is due to a scattered relocation, why is there a scattered >>> relocation at all? I thought these were to support the PPC >>> instruction set where you have to split addresses into multiple >>> pieces, and x86 doesn't need them. >> >> Scattered relations are not used on X86_64, but they are used on i386 >> (not just PPC). They are definitely used for lazy pointers. (It >> says so in the ABI document.) I vaguely remember, I have seen them >> used in other situations, too, when I debugged Linker.c for Snow >> Leopard. For example, the GMP library uses some global variables to >> determine the routines used for memory allocation. I think the >> references to these global pointers were scattered relocations, too. > > Ok, so scattered relocs are needed on x86. But does that mean that shared > libraries will be limited by the same 16MB-per-section restriction too?
I haven't looked into shared libraries; so, I don't know whether the restriction will bite us there, too. The dylib for LLVM is bigger than 16MB: > WithinReason chak 32 (/Users/chak): ll /usr/local/lib/libLLVM-2.7.dylib > -rwxr-xr-x 1 root wheel 19694632 17 Jun 14:50 > /usr/local/lib/libLLVM-2.7.dylib If I read that correctly, it's text section is only 12MB > Section > sectname __text > segname __TEXT > addr 0xe0001500 > size 0x00ba2790 > offset 5376 > align 2^8 (256) > reloff 0 > nreloc 0 > flags 0x80000400 > reserved1 0 > reserved2 0 > but the other sections don't really seem to add up to 19MB. Maybe it has that many symbols. Ben, did you look into the .o for GHC (with 'otool')? How big is the text section (as opposed to the whole file)? Manuel _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
