This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]