This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD] Relayout?
- From: =?big5?b?RG91ZyBLd2FuICjD9q62vHcp?= <dougkwan at google dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Sun, 23 Aug 2009 21:24:00 -0700
- Subject: [GOLD] Relayout?
Hi Ian,
I would like to do layout multiple times for stub generation on
ARM. Currently, many parts of gold asserts operations are done only
once. I am thinking whether I should add a method unfinalize() to
various classes so that I can redo layout again. The stub generation
will look something like:
// shared by all targets.
layout->finalize(..);
// ARM specific stub generation.
stub_set = {} // empty set.
do {
stubs_changed = false;
for all relobj obj do
for all input section s of obj do
if s is not output
continue;
for all relocs r in s do
if r needs a stub and it has not been created
create stub and add it to stub_set.
stubs_changed = true;
if (stub_changed)
{
// The section sizes are changed because we have added
// Stub, we need to run the layout again to update section
// offsets.
layout->unfinalize();
layout->finalize();
}
} while (stubs_changed)
The actually implementation is different though (for example, we have
multiple stub sets) but conceptually this is what I want to do.
Do you see any problem with adding an unfinalize method? I don't
think I will undo everything. For example, we I am not going to
delete special sections. I am not going to delete them; instead, I
will skip creation if something is created already.
-Doug