groups.c revision 4a8d0ea71c9a4e51c6a916a083ced6b499eb207f
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <string.h>
#include <link.h>
#include <debug.h>
#include "msg.h"
#include "_libld.h"
/*
* Determine whether a (COMDAT) group has already been encountered. If so,
* indicate that the group descriptor has an overriding group (gd_oisc). This
* indication triggers the ld_place_section() to discard this group, while the
* gd_oisc information provides for complete diagnostics of the override.
* Otherwise, this is the first occurrence of this group, therefore the group
* descriptor is saved for future comparisons.
*/
static uintptr_t
{
/*
* Create a groups avl tree if required.
*/
return (S_ERROR);
}
return (1);
}
/*
* This is a new group - so keep it.
*/
return (S_ERROR);
return (0);
}
{
/*
* Scan the GROUP sections associated with this file to find the
* matching group section.
*/
return (gdp);
continue;
}
return (gdp);
}
}
return (NULL);
}
{
const char *str;
/*
* Confirm that the sh_link points to a valid section.
*/
return (0);
}
if (gshdr->sh_entsize == 0) {
return (0);
}
/*
* Get the associated symbol table. Sanity check the sh_info field
* (which points to the signature symbol table entry) against the size
* of the symbol table.
*/
return (0);
}
/*
* Get the symbol name from the associated string table.
*/
/*
* Generate a group descriptor.
*/
/*
* If this group is a COMDAT group, validate the signature symbol.
*/
/* If section symbol, construct a printable name for it */
const char *stt_sym_name =
if (stt_sym_name != NULL)
str = stt_sym_name;
}
return (0);
}
/*
* Validate the section indices within the group. If this is a COMDAT
* group, mark each section as COMDAT.
*/
return (0);
}
}
/*
* If this is a COMDAT group, determine whether this group has already
* been encountered, or whether this is the first instance of the group.
*/
return (S_ERROR);
/*
* Associate the group descriptor with this input file.
*/
AL_CNT_IFL_GROUPS) == NULL)
return (S_ERROR);
return (1);
}