[Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
-[ 6] .text             PROGBITS        00000a2c 000a2c 0031fe 00  AX  0   0  4
+[ 6] .text             PROGBITS        00000a2c 000a2c 0031d2 00  AX  0   0  4

Adding ELF macros to the dl-elf.c and saving 44 bytes in the dl-hash.c object.

Signed-off-by: Jiri Olsa <[email protected]>
---
Index: ldso/ldso/dl-hash.c
===================================================================
--- ldso/ldso/dl-hash.c (revision 24745)
+++ ldso/ldso/dl-hash.c (working copy)
@@ -95,17 +95,18 @@
        struct elf_resolve *tpnt;
        int i;
 
-       if (!_dl_loaded_modules) {
-               tpnt = _dl_loaded_modules = (struct elf_resolve *) 
_dl_malloc(sizeof(struct elf_resolve));
-               _dl_memset(tpnt, 0, sizeof(struct elf_resolve));
-       } else {
-               tpnt = _dl_loaded_modules;
-               while (tpnt->next)
-                       tpnt = tpnt->next;
-               tpnt->next = (struct elf_resolve *) _dl_malloc(sizeof(struct 
elf_resolve));
-               _dl_memset(tpnt->next, 0, sizeof(struct elf_resolve));
-               tpnt->next->prev = tpnt;
-               tpnt = tpnt->next;
+       tpnt = (struct elf_resolve *) _dl_malloc(sizeof(struct elf_resolve));
+       _dl_memset(tpnt, 0, sizeof(struct elf_resolve));
+
+       if (!_dl_loaded_modules)
+               _dl_loaded_modules = tpnt;
+       else {
+               struct elf_resolve *t = _dl_loaded_modules;
+               while (t->next)
+                       t = t->next;
+               t->next = tpnt;
+               t->next->prev = t;
+               tpnt = t->next;
        }
 
        tpnt->next = NULL;
Index: ldso/ldso/dl-elf.c
===================================================================
--- ldso/ldso/dl-elf.c  (revision 24745)
+++ ldso/ldso/dl-elf.c  (working copy)
@@ -384,10 +384,10 @@
 
        _dl_read(infile, header, _dl_pagesize);
        epnt = (ElfW(Ehdr) *) (intptr_t) header;
-       if (epnt->e_ident[0] != 0x7f ||
-                       epnt->e_ident[1] != 'E' ||
-                       epnt->e_ident[2] != 'L' ||
-                       epnt->e_ident[3] != 'F')
+       if (epnt->e_ident[EI_MAG0] != ELFMAG0 ||
+           epnt->e_ident[EI_MAG1] != ELFMAG1 ||
+           epnt->e_ident[EI_MAG2] != ELFMAG2 ||
+           epnt->e_ident[EI_MAG3] != ELFMAG3)
        {
                _dl_dprintf(2, "%s: '%s' is not an ELF file\n", _dl_progname,
                                libname);
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to