/*
Copyright (C) 2000,2001,2004 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2002-2010 Sun Microsystems, Inc. All rights reserved.
Portions Copyright 2008-2010 David Anderson, Inc. All rights reserved.
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
For further information regarding this notice, see:
*/
#include "config.h"
#include "libdwarfdefs.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_ELFACCESS_H
#include <elfaccess.h>
#else
/* Set r_info as defined by ELF generic ABI */
#endif
#include "pro_incl.h"
#include "pro_section.h"
#include "pro_reloc.h"
#include "pro_reloc_stream.h"
/*
Return DW_DLV_ERROR on malloc error or reltarget_length error.
Return DW_DLV_OK otherwise
*/
/*ARGSUSED*/ int
int base_sec_index,
enum Dwarf_Rel_Type type,
int reltarget_length)
{
void *relrec_to_fill = 0;
int res = 0;
int rel_type = 0;
return res;
if (type == dwarf_drt_data_reloc) {
} else {
return DW_DLV_ERROR;
}
} else if (type == dwarf_drt_segment_rel) {
} else {
/* We are in trouble: improper use of stream relocations.
Someone else will diagnose */
rel_type = 0;
}
return DW_DLV_OK;
#else /* !HAVE_ELF64_GETEHDR */
return DW_DLV_ERROR;
#endif /* #if HAVE_ELF64_GETEHDR */
}
/*
Return DW_DLV_ERROR on malloc error or reltarget_length error.
Return DW_DLV_OK otherwise
a binary reloc: 32bit ABI
*/
int
enum Dwarf_Rel_Type type,
int reltarget_length)
{
void *relrec_to_fill = 0;
int res = 0;
int rel_type = 0;
return res;
if (type == dwarf_drt_data_reloc) {
} else {
return DW_DLV_ERROR;
}
} else if (type == dwarf_drt_segment_rel) {
} else {
/* We are in trouble: improper use of stream relocations.
Someone else will diagnose */
rel_type = 0;
}
return DW_DLV_OK;
/* get a slot, fill in the slot entry */
}
/*
Return DW_DLV_OK.
Never can really do anything: lengths cannot
be represented as end-start in a stream.
*/
/*ARGSUSED*/ int
int base_sec_index,
enum Dwarf_Rel_Type type,
int reltarget_length)
{
/* get a slot, fill in the slot entry */
return DW_DLV_OK;
}
/*
Ensure each stream is a single buffer and
add that single buffer to the set of stream buffers.
By creating a new buffer and copying if necessary.
Free the input set of buffers if we consolidate.
Return -1 on error (malloc failure)
Return DW_DLV_OK on success. Any other return indicates
malloc failed.
*/
int
{
unsigned long total_size = 0;
int sec_index = 0;
unsigned long i = 0;
for (i = 0; i < NUM_DEBUG_SECTIONS; ++i, ++p_reloc) {
unsigned len = 0;
if (ct == 0) {
continue;
}
++sec_count;
if (sec_index == 0) {
/* Call de_callback_func or de_callback_func_b, getting
section number of reloc section. */
int rel_section_index = 0;
int int_name = 0;
int err = 0;
if (dbg->de_callback_func_b) {
/* size */
/* type */ SHT_REL,
/* flags */ 0,
/* link to symtab, which we cannot
know */ 0,
/* info == link to sec rels apply to
*/
dbg->de_elf_sects[i],
} else {
/* size */
/* type */ SHT_REL,
/* flags */ 0,
/* link to symtab, which we cannot
know */ 0,
/* info == link to sec rels apply to */
}
if (rel_section_index == -1) {
{
return (DW_DLV_ERROR);
}
}
}
/* following loop executes at least once. Effects the
consolidation to a single block or, if already a single
block, simply copies to the output buffer. And frees the
input block. The new block is in the de_debug_sects list. */
while (p_blk) {
unsigned long len =
p_blk_last = p_blk;
}
/* ASSERT: sum of len copied == total_size */
/*
We have copied the input, now drop the pointers to it. For
debugging, leave the other data untouched. */
p_reloc->pr_first_block = 0;
p_reloc->pr_last_block = 0;
}
return DW_DLV_OK;
}