diff options
| author | phil <phil@NetBSD.org> | 1996-07-31 06:22:41 +0000 |
|---|---|---|
| committer | phil <phil@NetBSD.org> | 1996-07-31 06:22:41 +0000 |
| commit | cc13fe98cb400f339a309432d9e83070905fdecc (patch) | |
| tree | ad8a7e5811b5c0e9a7ef2f1a2a35e41f7e65e6de /libexec | |
| parent | 5b0728f9a22302567ecf9e78133726a582c885f5 (diff) | |
Fix for dynamically linked functions returning structs. PR#2586/Pfaller
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/ld.aout_so/arch/ns32k/mdprologue.S | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libexec/ld.aout_so/arch/ns32k/mdprologue.S b/libexec/ld.aout_so/arch/ns32k/mdprologue.S index 4b4a4a4aeaa..3af63242c14 100644 --- a/libexec/ld.aout_so/arch/ns32k/mdprologue.S +++ b/libexec/ld.aout_so/arch/ns32k/mdprologue.S @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: mdprologue.S,v 1.3 1995/05/29 18:11:35 phil Exp $ + * $Id: mdprologue.S,v 1.4 1996/07/31 06:22:41 phil Exp $ */ /* @@ -64,11 +64,13 @@ _rtl_entry: */ _binder_entry: - movd tos,r1 /* grab return address (within PLT) */ - movd r0,tos /* save r0 (for cerror) */ - movzwd 0(r1),tos /* get function index */ - addr -6(r1),tos /* point to PLT slot */ + save [r0,r1,r2] /* preserve scratch registers */ + /* save r0 (for cerror) */ + /* save r1 (maybe static chain) */ + /* save r2 (maybe struct addr) */ + addr -6(12(sp)),tos /* push address of PLT slot */ bsr _binder /* relocate function address */ - movd r0,tos /* prepare for jump */ - movd 12(sp),r0 /* restore r0 */ - ret 12 /* jump into function */ + cmpqd 0,tos + movd r0,12(sp) /* prepare for jump */ + restore [r0,r1,r2] /* restore scratch registers */ + ret 0 /* jump into function */ |
