Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Feb 1999 12:53:42 -0700
From:      Wes Peters <wes@softweyr.com>
To:        John Polstra <jdp@polstra.com>
Cc:        Terry Lambert <tlambert@primenet.com>, hackers@FreeBSD.ORG
Subject:   Re: ldconfig and libraries
Message-ID:  <36BF40C6.A2CA621D@softweyr.com>
References:  <XFMail.990208103442.jdp@polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John Polstra wrote:
> 
> Terry Lambert wrote:
> 
> > I am saying that it shouldn't be read-only to a tool to manipulate
> > the section contents.
> 
> Of course it needn't be read-only to any tool.
> 
> > In that regard, the location of the section should be after the
> > executable code.
> 
> It can be after the executable code, but it can't be after the
> program's data.  FreeBSD's kernel currently supports only 3 segments
> for programs: text, data, and bss.  They are laid out contiguously in
> the address space, in that order.  The only one that's read-only is
> text, the first segment.  So all read-only items have to be somewhere
> in the text segment.  They can be before or after the program code,
> but that doesn't help.  Because in either case, they'll still precede
> the data segment.  Thus changing the size of anything that's read-only
> will force the data segment to move.  That would require relocation,
> which cannot be done for an executable.  The relocation information
> isn't present in the file any more.

So make the field ALWAYS PATH_MAX (+1 ??) characters in length, and 
stick a zero-terminated string within that buffer.  Changing the length 
of the string won't change the length of the field, and therefore won't 
require fixing up addresses in the data (or any other) segment.

-- 
             Where am I, and what am I doing in this handbasket?

Wes Peters                                                     +1.801.915.2061
Softweyr LLC                                                  wes@softweyr.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36BF40C6.A2CA621D>