On Wed, 2008-02-20 at 15:58 -0600, Andrew Hastings wrote:
> Adam Litke wrote:
> > Now that elflink.c has been updated to remove linker script dependencies we
> > can
> > add support to ld.hugetlbfs for new relinking styles. These are
> > implemented by
> > specifying two options to GNU ld (new in binutils 2.18): -z common-page-size
> > and -z max-page-size . These options simply create a gap of a desired size
> > between the text and data segments.
> ...
> > diff --git a/ld.hugetlbfs b/ld.hugetlbfs
> > index 71e54bd..9a052ed 100755
> > --- a/ld.hugetlbfs
> > +++ b/ld.hugetlbfs
> > @@ -57,7 +57,19 @@ while [ -n "$1" ]; do
> > shift
> > done
> >
> > -if [ -n "$HTLB_LINK" ]; then
> > +MB=$((1024*1024))
> > +case "$EMU" in
> > +elf32ppclinux|elf64ppc) HPAGE_SIZE=$((16*$MB)) SLICE_SIZE=$((256*$MB))
> > ;;
> > +elf_i386|elf_x86_64) HPAGE_SIZE=$((4*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
> > +esac
> > +
> > +if [ "$HTLB_LINK" == "TD" ]; then
> > + HTLBOPTS="-zcommon-page-size=$HPAGE_SIZE -zmax-page-size=$HPAGE_SIZE"
> > + HTLBOPTS="$HTLBOPTS -lhugetlbfs"
> > +elif [ "$HTLB_LINK" == "T" -o "$HTLB_LINK" == "D" ]; then
> > + HTLBOPTS="-zcommon-page-size=$SLICE_SIZE -zmax-page-size=$SLICE_SIZE"
> > + HTLBOPTS="$HTLBOPTS -lhugetlbfs"
> > +else
> > LDSCRIPT="$EMU.x$HTLB_LINK"
> > HTLBOPTS="-T${HUGETLB_LDSCRIPT_PATH}/${LDSCRIPT}"
> > fi
>
> Cray's software is based on SLES10 which has binutils 2.16. I was
> curious how it behaved with these -z options. It ignores them silently.
>
> However, it looks like you've kept the old B and BDT link options, so we
> can continue to track new libhugetlbfs releases without having to
> upgrade our binutils. (Thanks!)
>
> The silent failure of T/D/TD options seems like a trap for the unwary.
> Might this be worth a comment in the HOWTO? And perhaps ld.hugetlbfs
> could check the binutils version when these options are used?
Hmm, maybe the improper binary layout warning message should be more
important (and more verbose) so the unwary users will be reminded every
time they attempt to run the improperly-aligned binary.
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel