relocate.c revision d2ef9fe9425bdaf63cdf808ce90a1ef90c4d9ce8
/*
* 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 <sys/elf_SPARC.h>
#include <debug.h>
#include <libld.h>
#include <conv.h>
#include "_debug.h"
#include "msg.h"
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
/*
* Print the actual relocation being applied to the specified output
* section, the offset represents the actual relocation address, and the
* value is the new data being written to that address.
*/
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
/*
* Print the actual relocation being applied to the specified output
* section, the offset represents the actual relocation address, and the
* value is the new data being written to that address.
*/
}
void
const char *sname)
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (dtype == DBG_REL_FINISH) {
if (info)
else
} else {
if (info)
else
}
if (dtype == DBG_REL_START) {
if (DBG_NOTDETAIL())
return;
} else {
if (dtype == DBG_REL_NONE) {
} else
str);
}
}
void
{
const char *str;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
if (zero)
else
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
else
else
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
const char *secname;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
if (osp) {
} else
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
/*
* Used by ld when '-z relaxreloc' is in use and a relocation
* is redirected to a kept section.
*
* entry:
* lml - Link map control list
* sdp - The replacement symbol to be used with the relocation,
* which references the kept section.
*/
void
{
const char *nfname;
return;
}
/*
* Print a output relocation structure (Rel_desc).
*/
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
else if (orsp->rel_osdesc)
else
/*
* Register symbols can be relocated/initialized to a constant, which
* is a special case where the symbol index is 0.
*/
else
}
/*
* Print a Active relocation structure (Rel_desc).
*/
void
{
const char *secname;
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
else
}
void
{
/*
* Register relocations can use a constant initializer, in which case
* the associated symbol is 0.
*/
}
#if defined(_ELF64)
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
void
{
if (DBG_NOTCLASS(DBG_C_RELOC))
return;
if (DBG_NOTDETAIL())
return;
}
#endif
/*
* Relocation output can differ depending on the caller and the type of
* relocation record. However, the final diagnostic is maintained here so
* that the various message strings remain consistent.
*
* elfdump:
* type offset addend section symbol
* X X X X X (Rela)
*
* type offset section symbol
* X X X X (Rel)
*
* Note, it could be argued that the section name output with elfdump(1) is
* unnecessary, as the table itself is identified with a title that reveals
* the section name. However, the output does provide for grep(1)'ing for
* individual entries and obtaining the section name with this type of input.
*
* ld.so.1:
* (prestr) type offset addend symbol
* value
* in X X X X (Rela)
* apply X X
*
* (prestr) type offset value symbol
* in X X X (Rel)
* apply X X
*
* ld:
* (prestr) type offset addend section symbol
* in X X X X X (Rela)
* act X X X X
* out X X X X
*
* (prestr) type offset section symbol
* in X X X X (Rel)
* act X X X X
* out X X X X
*
* Both Rela and Rel active relocations are printed as:
*
* type offset value section symbol
* X X X X X
*/
void
{
if (caller == ELF_DBG_ELFDUMP) {
if (DBG_NOTLONG())
else
} else {
if (DBG_NOTLONG())
else
}
return;
}
if (caller == ELF_DBG_RTLD) {
} else
return;
}
if (caller == ELF_DBG_LD) {
if (type == 0) {
if (DBG_NOTLONG())
else
return;
}
if (DBG_NOTLONG())
else
} else {
if (DBG_NOTLONG())
else
}
}
}
void
{
if (symname)
else
if (caller == ELF_DBG_ELFDUMP) {
if (DBG_NOTLONG())
else
} else {
if (DBG_NOTLONG())
else
}
return;
}
if (caller == ELF_DBG_RTLD) {
poststr);
else
return;
}
if (caller == ELF_DBG_LD) {
if (DBG_NOTLONG())
else
} else {
if (DBG_NOTLONG())
else
}
}
}
void
const char *poststr)
{
const char *str;
} else {
add = 0;
}
}
/*
* Display any applied relocations. Presently, these are only called from
* ld.so.1, but the interfaces are maintained here to insure consistency with
* other relocation diagnostics.
*/
void
{
if (caller == ELF_DBG_RTLD)
}
void
{
if (caller == ELF_DBG_RTLD)
}