pro_init.c revision 49d3bc91e27cd871b950d56c01398fa2f2e12ab4
/*
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., 59 Temple Place - Suite 330, Boston MA 02111-1307,
USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
For further information regarding this notice, see:
*/
#include "config.h"
#include "libdwarfdefs.h"
#include <stdio.h>
#include <string.h>
#include "pro_incl.h"
#include "pro_section.h" /* for MAGIC_SECT_NO */
#include "pro_reloc_symbolic.h"
#include "pro_reloc_stream.h"
/*--------------------------------------------------------------------
This function sets up a new dwarf producing region.
flags: Indicates type of access method, one of DW_DLC* macros
func(): Used to create a new object file, a call back function
errhand(): Error Handler provided by user
errarg: Argument to errhand()
error: returned error value
--------------------------------------------------------------------*/
/* We want the following to have an elf section number that matches
'nothing' */
static struct Dwarf_P_Section_Data_s init_sect = {
MAGIC_SECT_NO, 0, 0, 0, 0
};
{
sizeof(struct
}
/* For the time being */
}
return dbg;
}
{
sizeof(struct
}
/* For the time being */
}
return dbg;
}
static void
{
unsigned int k;
dbg->de_n_debug_sect = 0;
/* Now, with flags set, can use 64bit tests */
#if defined(HAVE_DWARF2_99_EXTENSION)
/* Revised 64 bit output, using distingushed values. Per 1999
dwarf2 revision This produces 64bit extension with ia64 objects.
Some might want library run time selection of offset size. Not
provided here at present. */
dbg->de_ptr_reloc =
/* Non-MIPS, dwarf lengths and offsets are 32 bits even for 64bit
pointer environments. */
/* Get_REL??_isa here supports 64bit-offset dwarf. For 64bit, we
emit the extension bytes. */
: Get_REL32_isa(dbg);
#elif defined(HAVE_OLD_DWARF2_32BIT_OFFSET)
/* This is cygnus 32bit offset, as specified in pure dwarf2 v2.0.0 */
dbg->de_64bit_extension = 0;
dbg->de_ptr_reloc =
/* non-MIPS, dwarf lengths and offsets are 32 bits even for 64bit
pointer environments. */
/* Get_REL32_isa here supports 64-bit-pointer dwarf with pure
dwarf2 v2.0.0 32bit offsets, as emitted by cygnus tools. And
pure 32 bit offset dwarf for 32bit pointer apps. */
#else
/* MIPS-SGI 32 or 64, where offsets and lengths are both 64 bit for
64bit pointer objects and both 32 bit for 32bit pointer
objects. And a dwarf-reader must check elf info to tell which
applies. */
dbg->de_64bit_extension = 0;
dbg->de_ptr_reloc =
#endif
if (flags & DW_DLC_SYMBOLIC_RELOCATIONS) {
sizeof(struct Dwarf_Relocation_Data_s);
} else {
#else
#endif
}
} else {
}
if (flags & DW_DLC_SYMBOLIC_RELOCATIONS) {
} else {
} else {
}
dbg->de_reloc_pair = 0;
}
for (k = 0; k < NUM_DEBUG_SECTIONS; ++k) {
}
/* First assume host, target same endianness */
#ifdef WORDS_BIGENDIAN
/* host is big endian, so what endian is target? */
if (flags & DW_DLC_TARGET_LITTLEENDIAN) {
dbg->de_same_endian = 0;
}
#else /* little endian */
/* host is little endian, so what endian is target? */
if (flags & DW_DLC_TARGET_BIGENDIAN) {
dbg->de_same_endian = 0;
}
#endif /* !WORDS_BIGENDIAN */
return;
}