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]

Re: [gold] PowerPC PLT


On Thu, Nov 20, 2008 at 3:04 PM, Ian Lance Taylor <iant@google.com> wrote:

>> Are Output_data_space objects contiguous?
>
> They may be but there is no particular requirement that they be.  That
> said, if you assign two different Output_data_space objects to the
> same output section, and nothing else is assigned to that output
> section, then they will be contiguous modulo alignment.

I do not mean contiguous with respect to one another, I am asking
about data written to an Output_data_space object.  Can I think of
Output_data_space objects as contiguous chunks of linker-created
data within an output section?

>> I am trying to understand
>> the meaning of offset() and address() for various Output_data_space
>> objects attached to a single output section.
>
> offset() is the file offset of the Output_data_space object in the
> output file.  address() is the virtual address of the
> Output_data_space object as seen by the executable when it runs.  When
> writing the data to the output file, you need to look at offset().
> When setting the value of symbols, you need to look at address().
> Both numbers are only valid after layout is complete (e.g., during
> relocation processing).  Both numbers are independent of the output
> section.

My question was meant to focus on the relationship between offset
for various Output_data_space objects within an output section.
Similarly for address.

PPC32 new ABI PLT contains three sub-sections: function addresses
that are considered the PLT itself, stubs, and glink code.  As with
other implementations of do_write(), I use offset() and data_size()
to call get_output_view() for the views of the output buffers.  And,
at the end of writing, I ensure that the difference in pointers match
the size.

Currently I write the three sub-sections concurrently, assuming that
my three output views each point into separate, contiguous chunks
of the PLT output section.

set_data_size() on the Output_data_space objects sets the size
of those chunks, but set_data_size() on the PLT class presumably
sets the size of the entire output section.  I'm trying to figure out what
I need to do to allocate space for the first part of the PLT and offset
the stub and glink sub-sections.  Will Gold offset the sub-sections
implicitly?  Should I create another Output_data_space sub-section
within PLT for the function addresses and not access the PLT class
view directly, not set the PLT class size directly?

My questions are not about what the APIs mean, but how they fit
together and interact for multiple Output_data_space objects within
a subclass of Output_section_data -- Output_data_plt_powerpc.

Thanks, David


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