pro_init.c revision 07dc1947c362e187fb955d283b692f8769dd5def
/*
Copyright (C) 2000,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>
#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_STRICT_DWARF2_32BIT_OFFSET)
/* This is cygnus 32bit offset, as specified in pure dwarf2 v2.0.0.
It is consistent with normal DWARF2/3 generation of always
generating 32 bit offsets. */
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. */
#elif defined(HAVE_SGI_IRIX_OFFSETS)
/* MIPS-SGI-IRIX 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 =
#else /* HAVE_DWARF2_99_EXTENSION or default. */
/* Revised 64 bit output, using distingushed values. Per 1999
dwarf3. This allows run-time selection of offset size. */
/* When it's 64 bit address, a 64bit offset is sensible.
Arguably a 32 bit address with 64 bit offset could be
sensible, but who would want that? */
} else {
dbg->de_64bit_extension = 0;
}
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);
#endif /* HAVE_DWARF2_99_EXTENSION etc. */
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;
}