Commit graph

8 commits

Author SHA1 Message Date
ensc
0e0e2afde7 fixed post-increment issue on ppc*
die when AT_PAGESZ entry is empty
2008-04-19 17:14:18 +00:00
ensc
a977bf906b moved calculation of __elfinto into start.S; user could do e.g. '*environ =
NULL' which breaks the current deferred calculation in
    __libc_getpagesize()
do not return a predefined PAGE_SIZE when __elfinfo code fails
2008-04-19 16:25:25 +00:00
ensc
585d8348ae fixed a printf() statement 2008-04-13 21:22:31 +00:00
ensc
66676e2784 define and use a custom __diet_elf_addr_t datatype instead of elf_addr_t
which disappeared in linux 2.6.25
2008-04-13 20:36:32 +00:00
ensc
667117c38e added sanity check to detect broken headers at compile time 2008-04-13 18:21:22 +00:00
ensc
0cd7732adf lib/alloc.c: return value of__ind_shift() depends on PAGE_SIZE 2008-04-13 17:09:02 +00:00
ensc
1fee7d679b - whitespace cleanups
- use gnu-style
- added __pure attribute to __get_elf_aux_value()
2008-04-13 14:14:48 +00:00
ensc
4927ab8208 This patch adds support for dynamic PAGE_SIZE values to 'dietlibc'. It is a
little bit invasive in several aspects:
it modifies the startup code. We need to know the position of the elf-info
    auxilary table which is located after 'environ'. We can not use
    'environ' directly because it might be modified by the application.
Hence, an additional __elfinfo variable is placed into .bss and filled in
    the startup code. Depending on platform, this adds 1-3 instructions and
    an additional pointer to .bss.
I tested only the i386 and x86_64 modifications; it would be nice when
    people with corresponding hardware would test the other ones. I am
    especially uncertain regarding the parisc changes.
The elf-info stuff (which might be interesting e.g. for dynamic linking or
    sysconf(_SC_CLK_TCK)) can be enabled without the dynamic pagesize too.
it removes the 'PAGE_SIZE' macro from <sys/shm.h>; this will break
    compilation of existing userspace application which are using this
    deprecated macro
I added a new internal 'dietpagesize.h' header which defines
| __DIET_PAGE_SIZE | __DIET_PAGE_SHIFT
macros. These return either builtin constants (when WANT_DYN_PAGESIZE is
    not selected), or values derived from __libc_getpagesize().
Every usage of PAGE_SIZE in dietlibc code was replaced by these macros.
due to the previous point, the internal 'struct __dirstream' was modified.
    I replaced
| getdents64(d->fd,(struct dirent64*)d->buf, sizeof (d->buf)-1);
with
| getdents64(d->fd,(struct dirent64*)d->buf, __DIRSTREAM_BUF_SIZE-1);
literally but I am not sure where the '-1' is coming from. There is one
    hunk, where this '-1' is missing so I think the '-1' should be removed
    from all calls to getdents64().
changes affect the *alloc() functions too; on x86_64 around 64 bytes where
    added to .text of alloc.o
the new testprogramm requires a 'getconf' binary which returns the correct
    values for PAGE_SIZE and CLK_TCK
2008-04-13 13:20:03 +00:00