Jeremy White wrote:
>
> Question:
> If I declare a variable as, say struct PE pe __attribute((section("hackpe"))) =
>{};
> that causes the variable 'pe' to be placed into the object section called 'hackpe'.
> If I then modify the stock ldscript for elf/i386, and place a section handler
> for hackpe prior to the handler for .text, I can then cause a .so file to be
> created that has my variable 'pe' placed _prior_ to the text section of
> the .so file.
There may be another option: according to the GNU ld documentation,
unless the
SORT command is used in the ldscript (it is not, at least not to sort
the text
section), sections are built up in the order in which they are seen
during the
link. Therefore if you can put your variable into the .text section of a
separate .o and arrange for it to be first on the linker command line,
this
should work. (Like all advice in usenet, the giver has never tried it :)
Good luck.
Andrew Lewycky
[EMAIL PROTECTED]
--
The address in the headers is not the poster's real email address. Do not send
private mail to the poster using your mailer's "reply" feature. CC's of mail
to mailing lists are OK. Problem reports to "[EMAIL PROTECTED]".
The poster's email address is "[EMAIL PROTECTED]".