plt64_resolution.c revision 5aefb6555731130ca4fd295960123d71f2d21fe8
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libelf.h>
#include <rtld_db.h>
#include "_rtld_db.h"
#include "msg.h"
/*
* On amd64, basically, a PLT entry looks like this:
*
* 0x00 ff 25 00 00 00 00 jmpq *func@got(%rip) ; jmp GOT[N]
* 0x06 68 01 00 00 00 pushq $0x1 ; push index
* 0x0b e9 00 00 00 00 jmpq .plt0 ; jmp plt[0]
* 0x10 ...
*
* The first time around GOT[N] contains address of pushq; this forces
* first time resolution to go thru PLT's first entry (which is a call)
* The nth time around, the GOT[N] actually contains the resolved
* address of the symbol(name), so the jmp is direct
*/
/* ARGSUSED 3 */
{
if (rtld_db_version >= RD_VERSION3) {
}
/*
* This is the target of the jmp instruction
*/
return (RD_ERR);
}
/*
* the offset to the GOT table entry is
* PC-relative.
*/
/*
* Find out what's pointed to by @OFFSET_INTO_GOT
*/
return (RD_ERR);
}
/*
* If GOT[ind] points to PLT+6 then this is the first
* time through this PLT.
*/
return (rerr);
}
} else {
/*
* This is the n'th time through and GOT[ind] points
* to the final destination.
*/
if (rtld_db_version >= RD_VERSION3) {
}
}
return (RD_OK);
}