move.c revision 466e2a6203d697dd110c04e84fc578f11a5601aa
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Object file dependent support for ELF objects.
*/
#include "_synonyms.h"
#include <stdio.h>
#include <dlfcn.h>
#include <debug.h>
#include <conv.h>
#include "_rtld.h"
#include "_audit.h"
#include "_elf.h"
#include "msg.h"
/*
* For backward compatibility copy relocation processing, it can be necessary to
* determine if a copy destination is also the recipient of a move record. For
* these instances, the move record addresses are retained for is_move_data().
*/
/*
* Move data
*/
int
{
int moves;
/*
* If these records are against the executable, and the executable was
* built prior to Solaris 8, keep track of the move record symbol. See
* comment in analyze.c:lookup_sym_interpose() in regards Solaris 8
* objects and DT_FLAGS.
*/
/*
* If the target address needs to be mapped in,
* map it first.
* (You have to protect the code, thread safe)
*/
long zlen;
if (zlen > 0) {
(PROT_READ | PROT_WRITE),
return (0);
}
}
continue;
case 1:
repno++;
break;
case 2:
/* LINTED */
repno++;
break;
case 4:
/* LINTED */
repno++;
break;
case 8:
/* LINTED */
repno++;
break;
default:
break;
}
}
/*
* If any move records have been applied to this symbol, retain
* the symbol address if required for backward compatibility
* copy relocation processing.
*/
return (0);
}
/*
* Binaries built in the early 1990's prior to Solaris 8, using the ild
* incremental linker are known to have zero filled move sections
* (presumably place holders for new, incoming move sections). If no
* move records have been processed, remove the move identifier to
* optimize the amount of backward compatibility copy relocation
* processing that is needed.
*/
return (1);
}
/*
* Determine whether an address is the recipient of a move record.
* Returns 1 if the address matches a move symbol, 0 otherwise.
*/
int
{
return (1);
}
return (0);
}