sunwmove.c revision 1007fd6fd24227460e77ce89f5ca85641a85a576
/*
* 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
*/
/*
*/
#include <string.h>
#include <debug.h>
#include "msg.h"
#include "_libld.h"
/*
* Scan all partially initialized symbols to determine what output Move sections
* or partially expanded data section, must be created.
*/
static uintptr_t
{
/*
* Compute the size of the output move section
*/
else
align_val = 8;
/*
* This global symbol is redirected to the special
* partial initialization .data section.
*/
if (align_val > align_parexpn)
} else {
}
}
/*
* Generate a new Move section.
*/
return (S_ERROR);
/*
* Add empty area for partially initialized symbols.
*
* A special .data section is created when the '-z nopartial'
* option is in effect in order to receive the expanded data.
*/
if (size_parexpn) {
/* LINTED */
align_parexpn) == S_ERROR)
return (S_ERROR);
}
return (1);
}
/*
* Assign move descriptors with the associated target symbol.
*/
static uintptr_t
{
for (i = 0; i < cnt; i++) {
/* LINTED */
/*
* Verify that this move descriptor doesn't overlap any existing
* move descriptors.
*/
} else {
}
/*
* If this move entry is exactly the same as that of
* a symbol that has overridden this symbol (for example
* should two identical COMMON definitions be associated
* with the same move data), simply ignore this move
* element.
*/
continue;
continue;
/*
* Indicate that an error has occurred, so that
* processing can be terminated once all move errors
* are flushed out.
*/
return (1);
}
AL_CNT_SDP_MOVE) == NULL)
return (S_ERROR);
}
return (1);
}
/*
* Validate a SHT_SUNW_move section. These are only processed from input
* relocatable objects. The move section entries are validated and any data
* structures required for later processing are created.
*/
{
int errcnt = 0;
return (S_ERROR);
}
for (i = 0; i < num; i++) {
(ndx == 0)) {
return (S_ERROR);
}
return (S_ERROR);
}
/*
* Validate that this entry has a valid size.
*/
/* LINTED */
case 1: case 2: case 4: case 8:
break;
default:
return (S_ERROR);
}
/*
* If this is a global symbol, adjust the visibility.
*/
/*
* If this is the first move entry associated
* with this symbol, save the symbol on the
* partial symbol list, and initialize various
* state regarding this symbol.
*/
AL_CNT_OFL_PARSYMS) == NULL)
return (S_ERROR);
/*
* Even if -zredlocsym is in effect, the local
* symbol used for partial initialization is
* kept.
*/
ofl->ofl_locscnt++;
return (S_ERROR);
}
/*
* Mark the input section associated with this
* partially initialized symbol.
* This is needed when the symbol
* the relocation entry uses symbol information
* not from the symbol entry.
*
* For executable, the following is
* needed only for expanded symbol. However,
* for shared object any partially non
* expanded symbols are moved from
* needed.
*/
libld_calloc(sizeof (Sym),
1)) == NULL)
return (S_ERROR);
}
}
}
return (S_ERROR);
errcnt++;
/*
* If this symbol is marked to be expanded, go to the
* next move entry.
*/
mvp++;
continue;
}
/*
* Decide whether this partial symbol is to be expanded
* or not.
*
* The symbol will be expanded if:
* a) '-z nopartial' is specified
* b) move entries covered entire symbol
*
* To expand an move entry, size of the symbol to be
* expanded need to be known to generate a file space.
* (see make_movesections().)
*
* Therefore the move entry can not be expanded
* if the partial symbol is a section symbol.
* (The size of the symbol may be unknown.)
* This may happen, for example, when a local symbol is
* reduced by the -zredlocsym.
*
* The following two if statements checks the
* if the move entry can be expanded or not.
*/
if (OFL_IS_STATIC_EXEC(ofl)) {
errcnt++;
} else {
}
} else {
}
}
/*
* If a move entry exists that references a local
* symbol, and this symbol reference will eventually
* be assigned to the associated section, make sure the
* section symbol is available for relocating against
* at runtime.
*/
if (osp &&
ofl->ofl_dynshdrcnt++;
FLG_SY_PAREXPN) == 0)
}
mvp++;
}
}
if (errcnt != 0)
return (S_ERROR);
return (S_ERROR);
return (1);
}