From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: hjl@lucon.org Cc: binutils@sourceware.cygnus.com Subject: Re: Variable page size for ELF Date: Sun, 11 Jul 1999 08:13:00 -0000 Message-id: <19990711151244.1933.qmail@daffy.airs.com> References: <19990711034758.0B58C57B9@ocean.lucon.org> X-SW-Source: 1999-q3/msg00130.html Date: Sat, 10 Jul 1999 20:47:58 -0700 (PDT) From: hjl@lucon.org (H.J. Lu) > I got a request to support variable page size for ELF. It turned out > not too hard to implement. Is that interesting to anyone? Should I > send in my patch which adds "--page-size SIZE" to ld? > > It's hard for me to imagine an application for that. However, if > there is some reason that it is useful, in a way that can not be > handled by simply changing the linker script, then I have no objection The problem is get_elf_backend_data (abfd)->maxpagesize in BFD and MAXPAGESIZE in linker script. I did 1. Add functions to get/set get_elf_backend_data (abfd)->maxpagesize. 2. Made MAXPAGESIZE in linker script a variable. Now the ELF linker script has MAXPAGESIZE != 0 ? MAXPAGESIZE : ${MAXPAGESIZE} in place of ${MAXPAGESIZE}. I guessed that much, but I still find it hard to imagine an application. We shouldn't provide features merely because we can; we should stick to providing features that are meaningful and useful. Merely changing the linker script is not a terribly useful feature, since people can already change it anyhow. The interesting new feature here is changing the use of maxpagesize in the backend data structure. However, the only interesting use of the backend maxpagesize is to set up the program headers, and you can already do that using PHDRS in the linker script. So I don't see any new functionality in the --page-size option. Of course, if it is a useful shorthand, we should add it anyhow. But that is where I wonder what the application is, since I don't see that either. By the way, MAXPAGESIZE should probably not be used as a symbol name in a linker script, because it is part of the user's name space. Something like __MAXPAGESIZE would be better. > to such an option. At first glance it seems like anything you can do > by changing the page size you can do by changing the linker script, > using the PHDRS option. How does PHDRS work? It's documented. Basically, it lets you set the program headers in the linker script. Ian