OSDN Git Service

linker: remove soinfo::entry
authorDimitry Ivanov <dimitry@google.com>
Tue, 16 Feb 2016 21:25:29 +0000 (13:25 -0800)
committerDimitry Ivanov <dimitry@google.com>
Tue, 16 Feb 2016 21:25:29 +0000 (13:25 -0800)
This field is used only once and only for main executable;
no need to carry it around in soinfo structure.

Change-Id: I7f80c64e0939e28966b6fed858891f9ce2a9e26b

linker/linker.cpp
linker/linker.h

index a032068..16bb47c 100644 (file)
@@ -4017,7 +4017,6 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(
   // Extract information passed from the kernel.
   si->phdr = reinterpret_cast<ElfW(Phdr)*>(args.getauxval(AT_PHDR));
   si->phnum = args.getauxval(AT_PHNUM);
-  si->entry = args.getauxval(AT_ENTRY);
 
   /* Compute the value of si->base. We can't rely on the fact that
    * the first entry is the PHDR because this will not be true
@@ -4146,8 +4145,9 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW(
   fflush(stdout);
 #endif
 
-  TRACE("[ Ready to execute '%s' @ %p ]", si->get_realpath(), reinterpret_cast<void*>(si->entry));
-  return si->entry;
+  ElfW(Addr) entry = args.getauxval(AT_ENTRY);
+  TRACE("[ Ready to execute '%s' @ %p ]", si->get_realpath(), reinterpret_cast<void*>(entry));
+  return entry;
 }
 
 /* Compute the load-bias of an existing executable. This shall only
index 389c5b3..c669c46 100644 (file)
@@ -173,7 +173,9 @@ struct soinfo {
  public:
   const ElfW(Phdr)* phdr;
   size_t phnum;
-  ElfW(Addr) entry;
+#if defined(__work_around_b_24465209__)
+  ElfW(Addr) unused0; // DO NOT USE, maintained for compatibility.
+#endif
   ElfW(Addr) base;
   size_t size;