pro_arange.c revision 07dc1947c362e187fb955d283b692f8769dd5def
/*
Copyright (C) 2000,2004 Silicon Graphics, 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>
#endif
#include "pro_incl.h"
#include "pro_arange.h"
#include "pro_section.h"
#include "pro_reloc.h"
/*
This function adds another address range
to the list of address ranges for the
given Dwarf_P_Debug. It returns 0 on error,
and 1 otherwise.
*/
{
/* end_symbol_index */ 0,
/* offset_from_end_sym */ 0,
error);
}
/*
This function adds another address range
to the list of address ranges for the
given Dwarf_P_Debug. It returns 0 on error,
and 1 otherwise.
*/
{
return (0);
}
arange = (Dwarf_P_Arange)
return (0);
}
else {
}
dbg->de_arange_count++;
return (1);
}
int
{
/* Total num of bytes in .debug_aranges section. */
/*
Adjustment to align the start of the actual address ranges on a
boundary aligned with twice the address size. */
/* Total number of bytes excluding the length field. */
/* Points to first byte of .debug_aranges buffer. */
/* Fills in the .debug_aranges buffer. */
/* Scans the list of address ranges provided by user. */
/* Used to fill in 0. */
const Dwarf_Signed big_zero = 0;
int res;
/* ***** BEGIN CODE ***** */
/* Size of the .debug_aranges section header. */
of
length
field.
*/
sizeof(Dwarf_Half) + /* Size of version field. */
uword_size + /* Size of .debug_info offset. */
sizeof(Dwarf_Small) + /* Size of address size field. */
sizeof(Dwarf_Small); /* Size of segment size field. */
/*
Adjust the size so that the set of aranges begins on a boundary
that aligned with twice the address size. This is a Libdwarf
requirement. */
if (remainder != 0)
/* Add the bytes for the actual address ranges. */
arange_ptr = arange;
return (0);
}
if (extension_word_size) {
(const void *) &x,
sizeof(x), extension_word_size);
}
/* Write the total length of .debug_aranges section. */
{
arange_ptr += uword_size;
}
/* Write the version as 2 bytes. */
{
(const void *) &verstamp,
sizeof(verstamp), sizeof(Dwarf_Half));
arange_ptr += sizeof(Dwarf_Half);
}
/* Write the .debug_info offset. This is always 0. */
(const void *) &big_zero,
sizeof(big_zero), uword_size);
arange_ptr += uword_size;
{
int res;
if (dbg->de_reloc_pair) {
}
/* the following is a small optimization: not needed for
correctness */
{
return (0);
}
}
}
/* reloc for .debug_info */
uword_size + sizeof(Dwarf_Half),
/* Write the size of addresses. */
arange_ptr++;
/*
Write the size of segment addresses. This is zero for MIPS
architectures. */
*arange_ptr = 0;
arange_ptr++;
/*
Skip over the padding to align the start of the actual address
ranges to twice the address size. */
if (remainder != 0)
/* The arange address, length are pointer-size fields of the target
machine. */
/* Write relocation record for beginning of address range. */
*/
(long) given_arange->ag_symbol_index,
{
return (0);
}
}
/* Copy beginning address of range. */
(const void *) &given_arange->ag_begin_address,
sizeof(given_arange->ag_begin_address),
if (dbg->de_reloc_pair &&
given_arange->ag_end_symbol_index != 0 &&
given_arange->ag_length == 0) {
/* symbolic reloc, need reloc for length What if we really
know the length? If so, should use the other part of
'if'. */
*/
{
return (0);
}
}
/* arrange pre-calc so assem text can do .word end - begin
+ val (gets val from stream) */
(const void *) &val,
sizeof(val), upointer_size);
} else {
/* plain old length to copy, no relocation at all */
(const void *) &given_arange->ag_length,
sizeof(given_arange->ag_length),
}
}
(const void *) &big_zero,
sizeof(big_zero), upointer_size);
(const void *) &big_zero,
sizeof(big_zero), upointer_size);
return (int) dbg->de_n_debug_sect;
}