[PATCH] fix add default mode

Matthias Hopf mhopf at suse.de
Fri Mar 7 06:32:32 PST 2008

On Mar 07, 08 09:27:07 -0500, Adam Jackson wrote:
> On Fri, 2008-03-07 at 12:47 +0100, Matthias Hopf wrote:
> > On Mar 07, 08 14:31:04 +0800, Hong Liu wrote:
> > > The build-in Modes don't have a name now
> > > (after Adam's commit e65e51a99b17a0510782775f010e9820ca567fcb),
> > > this may cause problem for code which uses the (name != NULL)
> > > as a condition for termination of the xf86DefaultModes array.
> Sigh.  I thought I'd fixed the users of xf86DefaultModes to invoke
> xf86DuplicateMode for this exact reason.  Apparently not.

Ok, that would be another possibility to fix this.

> > Uh-oh. IMHO it is a bug that modes w/o a name exist. So why on earth has
> > this commit been made in the first place? If it's just that the data
> > table should be able to be put into the text segment, a (const char *)
> > casting of the strings should suffice...
> That doesn't work.  The string will be emitted as a constant, yes, but
> the structure will be filled in with a pointer to that string.  You
> can't resolve that pointer until runtime, because you don't know where
> you're going to be loaded in the address space, which means the whole
> table has to be writable so ld.so can write the relocation in.

Sounds reasonable, but the commit message was misleading then. More like
'Make table page loadable w/o relocation'. Though I don't really know
whether this is worth the trouble, and I doubt even that this finally
saves anything on load time.



Matthias Hopf <mhopf at suse.de>      __        __   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__          mat at mshopf.de
Phone +49-911-74053-715           __)  |_|  __)  |__  R & D   www.mshopf.de

More information about the xorg mailing list