/*
* 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
*/
/*
*/
#define ELF_TARGET_SPARC
#include <stdio.h>
#include <string.h>
#include <alloca.h>
#include <debug.h>
#include "msg.h"
#include "_libld.h"
#include "machsym.sparc.h"
/*
* Matrix of legal combinations of usage of a given register:
*
* Obj1 \ Obj2 Scratch Named
* Scratch OK NO
* Named NO *
*
* (*) OK if the symbols are identical, NO if they are not. Two symbols
* are identical if and only if one of the following is true:
* A. They are both global and have the same name.
* B. They are both local, have the same name, and are defined in the same
* object. (Note that a local symbol in one object is never identical to
* a local symbol in another object, even if the name is the same.)
*
* Matrix of legal combinations of st_shndx for the same register symbol:
*
* Obj1 \ Obj2 UNDEF ABS
* UNDEF OK OK
* ABS OK NO
*
*/
int
{
/*
* Scratch register definitions are compatible.
*/
return (0);
/*
* A local and a global, or another local is incompatible.
*/
return (1);
}
return (0);
}
/*
* A scratch register and a named register are incompatible.
* So are two different named registers.
*/
return (1);
}
/*
* A multiply initialized symbol is also illegal.
*/
return (1);
}
return (1);
}
return (0);
}
int
{
if ((otype == STT_SPARC_REGISTER) ||
(ntype == STT_SPARC_REGISTER)) {
return (1);
}
} else if (otype == STT_SPARC_REGISTER)
return (0);
}
static const char *registers[] = { 0,
};
const char *
{
const char *name;
/*
* Only do something if this is a register symbol.
*/
return (0);
/*
* Check for bogus register number.
*/
return ((const char *)S_ERROR);
}
/*
* A register symbol can only be undefined or defined (absolute).
*/
return ((const char *)S_ERROR);
}
/*
* Determine whether this is a scratch (unnamed) definition.
*/
/*
* Check for bogus scratch register definitions.
*/
return ((const char *)S_ERROR);
}
/*
* Fabricate a name for this register so that this definition
* can be processed through the symbol resolution engine.
*/
} else
/*
* Indicate we're dealing with a register and return its name.
*/
*flags |= FLG_SY_REGSYM;
return (name);
}
Sym_desc *
{
return (NULL);
}
int
{
return (0);
}
}
return (1);
}