diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-07-07 12:58:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-07-07 12:58:12 +0000 |
commit | 6c790888b4a7c13430c7c8c241aade6a1a714c07 (patch) | |
tree | 0a7ec806ac0f691bea57988503cd28d61905a1c9 | |
parent | c9cddf51e757d8e59f0d5ead82a9d2414d61e9be (diff) | |
download | glibc-6c790888b4a7c13430c7c8c241aade6a1a714c07.tar.gz glibc-6c790888b4a7c13430c7c8c241aade6a1a714c07.tar.xz glibc-6c790888b4a7c13430c7c8c241aade6a1a714c07.zip |
Update.
* elf/dl-load.c: Use a few more __builtin_expect.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | elf/dl-load.c | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index b9216e26c3..d8364ca7ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 1999-07-07 Ulrich Drepper <drepper@cygnus.com> + * elf/dl-load.c: Use a few more __builtin_expect. + * sysdeps/posix/getcwd.c: When resizing buffer make sure new size is large enough. diff --git a/elf/dl-load.c b/elf/dl-load.c index a0448e9091..c1194ce580 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -721,7 +721,7 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname, header = (void *) readbuf; /* Check the header for basic validity. */ - if (memcmp (header->e_ident, expected, EI_PAD) != 0) + if (__builtin_expect (memcmp (header->e_ident, expected, EI_PAD), 0) != 0) { /* Something is wrong. */ if (*(Elf32_Word *) &header->e_ident != @@ -753,11 +753,12 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname, LOSE (0, "internal error"); } - if (header->e_version != EV_CURRENT) + if (__builtin_expect (header->e_version, EV_CURRENT) != EV_CURRENT) LOSE (0, "ELF file version not " STRING(EV_CURRENT)); - if (! elf_machine_matches_host (header->e_machine)) + if (! __builtin_expect (elf_machine_matches_host (header->e_machine), 1)) LOSE (0, "ELF file machine architecture not " ELF_MACHINE_NAME); - if (header->e_phentsize != sizeof (ElfW(Phdr))) + if (__builtin_expect (header->e_phentsize, sizeof (ElfW(Phdr))) + != sizeof (ElfW(Phdr))) LOSE (0, "ELF file's phentsize not the expected size"); #ifndef MAP_ANON @@ -775,7 +776,7 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname, /* Enter the new object in the list of loaded objects. */ l = _dl_new_object (realname, name, l_type, loader); - if (! l) + if (__builtin_expect (! l, 0)) LOSE (ENOMEM, "cannot create shared object descriptor"); l->l_opencount = 1; |