Closed
Bug 894829
Opened 11 years ago
Closed 11 years ago
Avoid symbol resolution for relocations for the same symbol
Categories
(Core :: mozglue, defect)
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: glandium, Assigned: glandium)
Details
Attachments
(1 file, 1 obsolete file)
2.25 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
The static linker usefully lays out relocations ordered by symbol, which means relocations for the same symbol are following each other. Instead of resolving the same symbol over and over, just resolve it once and reuse the resolved value subsequently.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #777001 -
Flags: review?(nfroyd)
Assignee | ||
Comment 2•11 years ago
|
||
This cuts startup by about 40 to 50ms on my nexus S, but this is without elfhack, so it might be less in reality. But it's an easy win.
Assignee | ||
Comment 3•11 years ago
|
||
With a brown-paper bag fix.
Attachment #777603 -
Flags: review?(nfroyd)
Assignee | ||
Updated•11 years ago
|
Attachment #777001 -
Attachment is obsolete: true
Attachment #777001 -
Flags: review?(nfroyd)
Comment 4•11 years ago
|
||
Comment on attachment 777603 [details] [diff] [review]
Avoid symbol resolution for relocations for the same symbol in faulty.lib
Review of attachment 777603 [details] [diff] [review]:
-----------------------------------------------------------------
::: mozglue/linker/CustomElf.cpp
@@ +652,5 @@
> /* Other relocation types need a symbol resolution */
> + /* Avoid symbol resolution when it's the same symbol as last iteration */
> + if (symtab_index != ELF_R_SYM(rel->r_info)) {
> + symtab_index = ELF_R_SYM(rel->r_info);
> + const Sym sym = symtab[ELF_R_SYM(rel->r_info)];
Nit: might as well use symtab_index here?
Attachment #777603 -
Flags: review?(nfroyd) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in
before you can comment on or make changes to this bug.
Description
•