Page MenuHomeFreeBSD

Make this code position independent
ClosedPublic

Authored by emaste on Apr 30 2016, 3:09 PM.

Details

Summary

Doing a buildworld of freebsd with lld found only this case where a rw text segment would have been required.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rafael.espindola_gmail.com retitled this revision from to Make this code position independent.
rafael.espindola_gmail.com updated this object.
rafael.espindola_gmail.com edited the test plan for this revision. (Show Details)
davide edited edge metadata.Apr 30 2016, 10:39 PM

LGTM. Colin?

davide accepted this revision.Apr 30 2016, 10:39 PM
davide edited edge metadata.
This revision is now accepted and ready to land.Apr 30 2016, 10:39 PM

ping. Note that I don't have commit access.

davide added a comment.May 5 2016, 4:55 PM

@delphij , @cperciva (or anybody else from security) can you please sign-off this one before it gets in?

emaste added a subscriber: emaste.May 5 2016, 5:36 PM
emaste commandeered this revision.May 5 2016, 8:34 PM
emaste updated this revision to Diff 15948.May 5 2016, 8:36 PM
emaste edited edge metadata.
emaste added a subscriber: kib.
  • Avoid GOT for non-PIC object
  • Just use . instead of a specific label

Submitted by: @kib

This revision now requires review to proceed.May 5 2016, 8:36 PM
kib accepted this revision.May 5 2016, 8:57 PM
kib added a reviewer: kib.
This revision is now accepted and ready to land.May 5 2016, 8:57 PM
emaste added a comment.May 5 2016, 9:11 PM

(And, rename crypt586.s to crypt586.S)

emaste added a comment.May 5 2016, 9:15 PM

@kib pointed out this comes from crypto/openssl/crypto/des/asm/crypt586.pl.

As of rS109998 crypt586.pl has:

sub fcrypt_body
        {
        local($name,$do_ip)=@_;

        &function_begin($name);

        &comment("");
        &comment("Load the 2 words");
        $trans="ebp";

        &xor(   $L,     $L);
        &xor(   $R,     $R);

        # PIC-ification:-)
        &picmeup("edx","DES_SPtrans");
        #if ($cpp)      { &picmeup("edx","DES_SPtrans");   }
        #else           { &lea("edx",&DWP("DES_SPtrans")); }
        &push("edx");   # becomes &swtmp(1)
        #
        &mov($trans,&wparam(1)); # reloaded with DES_SPtrans in D_ENCRYPT      

        &push(&DWC(25)); # add a variable

but the generated version in this review was added in rS95967 prior to that change.

This revision was automatically updated to reflect the committed changes.
emaste added a comment.May 6 2016, 3:32 PM

Reverted in rS299172 as these files are actually generated output.

Proposal in D6237 to add a "Generated from" comment so that it's more clear in the future that they should not be edited directly.

We'll need to find a different way to address the .text relocation.