GCC Middle and Back End API Reference
collect2-aix.c File Reference


static bfd_vma read_value ()
static bool string_within_bounds_p ()
static bool within_object_p ()
static bool read_xcoff_object (LDFILE *ldfile, size_t offset, size_t object_size, off_t next_member)
static bool read_archive_member ()
static bool read_big_archive ()
static bool open_file ()
static void free_object ()
static void free_ldfile ()
LDFILEldopen ()
int ldtbread ()
char * ldgetname ()
int ldclose ()

Function Documentation

static void free_ldfile ( )
   Free LDFILE and all resources associated with it.  

Referenced by free_object(), and ldgetname().

static void free_object ( )
   Release the memory associated with the current object, if one has
   been mapped.  

References free_ldfile(), and open_file().

Referenced by ldgetname().

int ldclose ( )
   Implement the API-defined ldclose function.  
char* ldgetname ( )
   Implement the API-defined ldgetname function.  
     If the zeroes field is nonzero, the name is in the symbol table
     entry itself.  
     Otherwise, the symbol table entry contains an offset into the
     string table, which starts after the end of the symbol table.  
     Make sure that the name is entirely contained within the object.  

References free_ldfile(), free_object(), internal_ldfile::next_member, and read_archive_member().

LDFILE* ldopen ( )
   Implement the API-defined ldopen function.  
int ldtbread ( )
   Implement the API-defined ldtbread function.  
     Make sure that the symbol index is valid.  
     Work out the offset of the symbol table entry.  
     Read all the fields.  The format differs between 32-bit and
     64-bit files.  
         Copy the n_zeroes/n_offset interpretation.  
         Copy the n_name interpretation.  The internal version has room
         for a null terminator.  
static bool open_file ( )
   LDFILE is a zero-initialized structure.  Try to open FILENAME,
   returning true on success.  

References internal_ldfile::object, internal_ldfile::object_size, and internal_ldfile::page_offset.

Referenced by free_object().

static bool read_archive_member ( )
   Try to read an archive member at OFFSET bytes into LDFILE.
   Return true on success, recording the member and object
   information in LDFILE.  
         Stop once we reach the member table entry, which has a name
         of length 0.  
         The archive is followed by an even-padded name, then by
         a magic string of length SXCOFFARFMAG.  The object itself
         starts after that. 

References read_xcoff_object().

Referenced by ldgetname().

static bool read_big_archive ( )
   Try to treat LDFILE as a non-empty big archive.  Return true
   on success, storing the member and object information for
   the first member in LDFILE.  
static bfd_vma read_value ( )

AIX cross support for collect2. Copyright (C) 2009-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.

   Read SIZE bytes starting at DATA as a big-endian value.  
static bool read_xcoff_object ( LDFILE ldfile,
size_t  offset,
size_t  object_size,
off_t  next_member 
   Try to read the file header for an XCOFF object at OFFSET bytes into
   LDFILE.  The object is expected to be OBJECT_SIZE bytes in size.
   If the object is a member of an archive, NEXT_MEMBER is the offset
   of the next member, otherwise it is -1.

   Return true on success, recording the object information in LDFILE.  
     First try to map the file into memory.  
     Record the success.  
     Read the magic value to determine the type of file.  

Referenced by read_archive_member().

static bool string_within_bounds_p ( )
   Return true if STRING is less than SIZE bytes long.  EXTRA_TERMINATOR
   is another character (besides '\0') that acts as a terminator,
   or '\0' if none.  
static bool within_object_p ( )
   Check that LDFILE's current object has SIZE bytes starting at OFFSET.  

References getpagesize(), map, and internal_ldfile::page_offset.