Closed Bug 932737 Opened 9 years ago Closed 9 years ago

Change elfhack such that it doesn't require two injection objects

Categories

(Firefox Build System :: General, defect)

All
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: glandium, Assigned: glandium)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

The idea here is to have only one injection object, containing both functions, and choosing between functions when we were choosing between files. This changes how the linkage is done, more specifically, this requires choosing which of the code segments are required, which is done by following relocations to defined symbols within the injected object (I hope I'm being clear, here).

https://tbpl.mozilla.org/?tree=Try&rev=567b3ea80e0e
Attachment #824584 - Flags: review?(nfroyd)
Comment on attachment 824584 [details] [diff] [review]
Change elfhack such that it doesn't require two injection objects

Review of attachment 824584 [details] [diff] [review]:
-----------------------------------------------------------------

::: build/unix/elfhack/elfhack.cpp
@@ +134,5 @@
> +        entry_point = sym->value.getValue();
> +        code.push_back(sym->value.getSection());
> +
> +        // Get all relevant sections from the injected code object.
> +        find_code(code[0]);

Possible small refactoring:

void add_code_section(ElfSection *section)
{
  if (section) {
    code.push_back(section);
    find_code(code.back());
  }
}

then you can call that here...

@@ +226,5 @@
> +            }
> +            if (section) {
> +                code.push_back(section);
> +                find_code(code.back());
> +            }

...and here.
Attachment #824584 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/mozilla-central/rev/f9c0cb55b616
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
Depends on: 982014
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.