mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* elf/dl-load.c: Fix typo in comment. Add a few more __builtin_expect.
This commit is contained in:
@ -1,5 +1,7 @@
|
|||||||
2002-08-25 Ulrich Drepper <drepper@redhat.com>
|
2002-08-25 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* elf/dl-load.c: Fix typo in comment. Add a few more __builtin_expect.
|
||||||
|
|
||||||
* sysdeps/generic/dl-cache.h (_dl_cache_libcmp): Define as static
|
* sysdeps/generic/dl-cache.h (_dl_cache_libcmp): Define as static
|
||||||
inline to avoid defining it in every file which includes this header.
|
inline to avoid defining it in every file which includes this header.
|
||||||
|
|
||||||
|
@ -902,12 +902,14 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
case PT_LOAD:
|
case PT_LOAD:
|
||||||
/* A load command tells us to map in part of the file.
|
/* A load command tells us to map in part of the file.
|
||||||
We record the load commands and process them all later. */
|
We record the load commands and process them all later. */
|
||||||
if ((ph->p_align & (GL(dl_pagesize) - 1)) != 0)
|
if (__builtin_expect ((ph->p_align & (GL(dl_pagesize) - 1)) != 0,
|
||||||
|
0))
|
||||||
{
|
{
|
||||||
errstring = N_("ELF load command alignment not page-aligned");
|
errstring = N_("ELF load command alignment not page-aligned");
|
||||||
goto call_lose;
|
goto call_lose;
|
||||||
}
|
}
|
||||||
if (((ph->p_vaddr - ph->p_offset) & (ph->p_align - 1)) != 0)
|
if (__builtin_expect (((ph->p_vaddr - ph->p_offset)
|
||||||
|
& (ph->p_align - 1)) != 0, 0))
|
||||||
{
|
{
|
||||||
errstring
|
errstring
|
||||||
= N_("ELF load command address/offset not properly aligned");
|
= N_("ELF load command address/offset not properly aligned");
|
||||||
@ -988,7 +990,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
l->l_map_start = (ElfW(Addr)) __mmap ((void *) mappref, maplength,
|
l->l_map_start = (ElfW(Addr)) __mmap ((void *) mappref, maplength,
|
||||||
c->prot, MAP_COPY | MAP_FILE,
|
c->prot, MAP_COPY | MAP_FILE,
|
||||||
fd, c->mapoff);
|
fd, c->mapoff);
|
||||||
if ((void *) l->l_map_start == MAP_FAILED)
|
if (__builtin_expect ((void *) l->l_map_start == MAP_FAILED, 0))
|
||||||
{
|
{
|
||||||
map_error:
|
map_error:
|
||||||
errstring = N_("failed to map segment from shared object");
|
errstring = N_("failed to map segment from shared object");
|
||||||
@ -1068,8 +1070,13 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
if ((c->prot & PROT_WRITE) == 0)
|
if ((c->prot & PROT_WRITE) == 0)
|
||||||
{
|
{
|
||||||
/* Dag nab it. */
|
/* Dag nab it. */
|
||||||
if (__mprotect ((caddr_t) (zero & ~(GL(dl_pagesize) - 1)),
|
if (__builtin_expect (__mprotect ((caddr_t)
|
||||||
GL(dl_pagesize), c->prot|PROT_WRITE) < 0)
|
(zero
|
||||||
|
& ~(GL(dl_pagesize)
|
||||||
|
- 1)),
|
||||||
|
GL(dl_pagesize),
|
||||||
|
c->prot|PROT_WRITE) < 0,
|
||||||
|
0))
|
||||||
{
|
{
|
||||||
errstring = N_("cannot change memory protections");
|
errstring = N_("cannot change memory protections");
|
||||||
goto call_lose_errno;
|
goto call_lose_errno;
|
||||||
@ -1088,7 +1095,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
mapat = __mmap ((caddr_t) zeropage, zeroend - zeropage,
|
mapat = __mmap ((caddr_t) zeropage, zeroend - zeropage,
|
||||||
c->prot, MAP_ANON|MAP_PRIVATE|MAP_FIXED,
|
c->prot, MAP_ANON|MAP_PRIVATE|MAP_FIXED,
|
||||||
ANONFD, 0);
|
ANONFD, 0);
|
||||||
if (mapat == MAP_FAILED)
|
if (__builtin_expect (mapat == MAP_FAILED, 0))
|
||||||
{
|
{
|
||||||
errstring = N_("cannot map zero-fill pages");
|
errstring = N_("cannot map zero-fill pages");
|
||||||
goto call_lose_errno;
|
goto call_lose_errno;
|
||||||
@ -1137,7 +1144,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
|
|
||||||
if (l->l_ld == 0)
|
if (l->l_ld == 0)
|
||||||
{
|
{
|
||||||
if (type == ET_DYN)
|
if (__builtin_expect (type == ET_DYN, 0))
|
||||||
{
|
{
|
||||||
errstring = N_("object file has no dynamic section");
|
errstring = N_("object file has no dynamic section");
|
||||||
goto call_lose;
|
goto call_lose;
|
||||||
@ -1811,7 +1818,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
|
|||||||
fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
|
fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
|
||||||
&realname, &fb);
|
&realname, &fb);
|
||||||
|
|
||||||
/* Add another newline when we a tracing the library loading. */
|
/* Add another newline when we are tracing the library loading. */
|
||||||
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
|
||||||
INTUSE(_dl_debug_printf) ("\n");
|
INTUSE(_dl_debug_printf) ("\n");
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
2002-08-25 Ulrich Drepper <drepper@redhat.com>
|
2002-08-25 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/pthread/timer_routines.c (thread_func): Make the
|
||||||
|
compiler happy by adding a return statement which will never be
|
||||||
|
reached.
|
||||||
|
|
||||||
* tst-context.c (main): Cast to long before casting to pointer.
|
* tst-context.c (main): Cast to long before casting to pointer.
|
||||||
|
|
||||||
* Examples/ex17.c (main): Use correct format string.
|
* Examples/ex17.c (main): Use correct format string.
|
||||||
|
@ -450,6 +450,8 @@ thread_func (void *arg)
|
|||||||
forever - but we have to add it for proper nesting. */
|
forever - but we have to add it for proper nesting. */
|
||||||
pthread_cleanup_pop (1);
|
pthread_cleanup_pop (1);
|
||||||
|
|
||||||
|
/* NOTREACHED */
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ The @code{assert_perror} macro makes this easy.
|
|||||||
@deftypefn Macro void assert_perror (int @var{errnum})
|
@deftypefn Macro void assert_perror (int @var{errnum})
|
||||||
Similar to @code{assert}, but verifies that @var{errnum} is zero.
|
Similar to @code{assert}, but verifies that @var{errnum} is zero.
|
||||||
|
|
||||||
If @code{NDEBUG} is defined, @code{assert_perror} tests the value of
|
If @code{NDEBUG} is not defined, @code{assert_perror} tests the value of
|
||||||
@var{errnum}. If it is nonzero, @code{assert_perror} aborts the program
|
@var{errnum}. If it is nonzero, @code{assert_perror} aborts the program
|
||||||
after printing a message of the form:
|
after printing a message of the form:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user