Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Enumerations | Functions
bfdlink.h File Reference

Go to the source code of this file.

Classes

struct  bfd_link_hash_entry
struct  bfd_sym_chain
struct  bfd_link_callbacks
struct  bfd_elf_version_expr
struct  bfd_elf_version_expr_head
struct  bfd_elf_version_deps
struct  bfd_elf_version_tree
struct  bfd_elf_dynamic_list
union  bfd_link_hash_entry.u
struct  bfd_link_hash_entry.u.undef
struct  bfd_link_hash_entry.u.def
struct  bfd_link_hash_entry.u.i
struct  bfd_link_hash_entry.u.c
struct  bfd_link_hash_common_entry.u.c.p

Defines

#define BFD_ELF_VERSION_C_TYPE   1
#define BFD_ELF_VERSION_CXX_TYPE   2
#define BFD_ELF_VERSION_JAVA_TYPE   4

Enumerations

enum  bfd_link_strip { strip_none, strip_debugger, strip_some, strip_all }
enum  bfd_link_discard { discard_sec_merge, discard_none, discard_l, discard_all }
enum  bfd_link_hash_table_type { bfd_link_generic_hash_table, bfd_link_elf_hash_table }
enum  bfd_link_hash_type {
  bfd_link_hash_new, bfd_link_hash_undefined, bfd_link_hash_undefweak, bfd_link_hash_defined,
  bfd_link_hash_defweak, bfd_link_hash_common, bfd_link_hash_indirect, bfd_link_hash_warning
}
enum  bfd_link_common_skip_ar_aymbols { bfd_link_common_skip_none, bfd_link_common_skip_text, bfd_link_common_skip_data, bfd_link_common_skip_all }
enum  report_method { RM_NOT_YET_SET = 0, RM_IGNORE, RM_GENERATE_WARNING, RM_GENERATE_ERROR }
enum  bfd_link_order_type {
  bfd_undefined_link_order, bfd_indirect_link_order, bfd_data_link_order, bfd_section_reloc_link_order,
  bfd_symbol_reloc_link_order
}

Functions

struct bfd_link_hash_entrybfd_link_hash_lookup (struct bfd_link_hash_table *, const char *, bfd_boolean create, bfd_boolean copy, bfd_boolean follow)
struct bfd_link_hash_entrybfd_wrapped_link_hash_lookup (bfd *, struct bfd_link_info *, const char *, bfd_boolean, bfd_boolean, bfd_boolean)
void bfd_link_hash_traverse (struct bfd_link_hash_table *, bfd_boolean(*)(struct bfd_link_hash_entry *, void *), void *)
void bfd_link_add_undef (struct bfd_link_hash_table *, struct bfd_link_hash_entry *)
void bfd_link_repair_undef_list (struct bfd_link_hash_table *table)
struct bfd_link_orderbfd_new_link_order (bfd *, asection *)

Class Documentation

struct bfd_link_hash_entry

Definition at line 80 of file bfdlink.h.

Class Members
enum bfd_link_hash_type union
bfd_link_hash_entry
u
struct bfd_link_hash_table

Definition at line 158 of file bfdlink.h.

Collaboration diagram for bfd_link_hash_table:
Class Members
const bfd_target * creator
struct bfd_link_hash_entry * undefs
struct bfd_link_hash_entry * undefs_tail
struct bfd_sym_chain

Definition at line 205 of file bfdlink.h.

Collaboration diagram for bfd_sym_chain:
Class Members
const char * name
struct bfd_sym_chain * next
struct bfd_link_info

Definition at line 229 of file bfdlink.h.

Class Members
unsigned int allow_multiple_definition: 1
unsigned int allow_undefined_version: 1
unsigned int combreloc: 1
unsigned int create_default_symver: 1
unsigned int default_imported_symver: 1
unsigned int dynamic: 1
unsigned int dynamic_data: 1
unsigned int eh_frame_hdr: 1
unsigned int emit_gnu_hash: 1
unsigned int emit_hash: 1
unsigned int emitrelocations: 1
unsigned int execstack: 1
unsigned int executable: 1
unsigned int export_dynamic: 1
unsigned int gc_sections: 1
unsigned int keep_memory: 1
unsigned int new_dtags: 1
unsigned int nocopyreloc: 1
unsigned int noexecstack: 1
unsigned int notice_all: 1
unsigned int optimize: 1
unsigned int pie: 1
unsigned int print_gc_sections: 1
unsigned int reduce_memory_overheads: 1
unsigned int relocatable: 1
unsigned int relro: 1
unsigned int shared: 1
unsigned int static_link: 1
unsigned int strip_discarded: 1
unsigned int symbolic: 1
unsigned int task_link: 1
unsigned int traditional_format: 1
unsigned int warn_shared_textrel: 1
struct bfd_link_order

Definition at line 595 of file bfdlink.h.

Collaboration diagram for bfd_link_order:
Class Members
struct bfd_link_order * next
enum bfd_link_order_type
bfd_vma offset bfd_size_type
size union bfd_link_order
u
struct bfd_link_order_reloc

Definition at line 650 of file bfdlink.h.

Class Members
bfd_vma addend
bfd_reloc_code_real_type reloc
union bfd_link_order_reloc u
struct bfd_elf_version_expr

Definition at line 684 of file bfdlink.h.

Collaboration diagram for bfd_elf_version_expr:
Class Members
unsigned int mask: 3
struct bfd_elf_version_expr * next
const char * pattern
unsigned int script: 1
const char * symbol
unsigned int symver: 1
struct bfd_elf_version_expr_head

Definition at line 703 of file bfdlink.h.

Collaboration diagram for bfd_elf_version_expr_head:
Class Members
void * htab
struct bfd_elf_version_expr * list
unsigned int mask
struct bfd_elf_version_expr * remaining
struct bfd_elf_version_deps

Definition at line 717 of file bfdlink.h.

Collaboration diagram for bfd_elf_version_deps:
Class Members
struct bfd_elf_version_deps * next
struct bfd_elf_version_tree * version_needed
union bfd_link_hash_entry.u

Definition at line 89 of file bfdlink.h.

Class Members
u c
u def
u i
u undef
struct bfd_link_hash_entry.u.undef

Definition at line 93 of file bfdlink.h.

Class Members
bfd * abfd
struct bfd_link_hash_entry * next
bfd * weak
struct bfd_link_hash_entry.u.def

Definition at line 119 of file bfdlink.h.

Class Members
struct bfd_link_hash_entry * next
asection * section
bfd_vma value
struct bfd_link_hash_entry.u.i

Definition at line 126 of file bfdlink.h.

Class Members
struct bfd_link_hash_entry * link
struct bfd_link_hash_entry * next
const char * warning
struct bfd_link_hash_entry.u.c

Definition at line 133 of file bfdlink.h.

Class Members
struct bfd_link_hash_entry * next
c p
bfd_size_type size
struct bfd_link_hash_entry::bfd_link_hash_common_entry.u.c.p

Definition at line 145 of file bfdlink.h.

Class Members
unsigned int alignment_power
asection * section
union bfd_link_order.u

Definition at line 606 of file bfdlink.h.

Class Members
u data
u indirect
u reloc
struct bfd_link_order.u.indirect

Definition at line 608 of file bfdlink.h.

Class Members
asection * section
struct bfd_link_order.u.data

Definition at line 618 of file bfdlink.h.

Class Members
bfd_byte * contents
unsigned int size
struct bfd_link_order.u.reloc

Definition at line 628 of file bfdlink.h.

Class Members
struct bfd_link_order_reloc * p
union bfd_link_order_reloc.u

Definition at line 655 of file bfdlink.h.

Class Members
const char * name
asection * section

Define Documentation

#define BFD_ELF_VERSION_C_TYPE   1

Definition at line 697 of file bfdlink.h.

#define BFD_ELF_VERSION_CXX_TYPE   2

Definition at line 698 of file bfdlink.h.

#define BFD_ELF_VERSION_JAVA_TYPE   4

Definition at line 699 of file bfdlink.h.


Enumeration Type Documentation

Enumerator:
bfd_link_common_skip_none 
bfd_link_common_skip_text 
bfd_link_common_skip_data 
bfd_link_common_skip_all 

Definition at line 69 of file bfdlink.h.

Enumerator:
discard_sec_merge 
discard_none 
discard_l 
discard_all 

Definition at line 36 of file bfdlink.h.

{
  discard_sec_merge, /* Discard local temporary symbols in SEC_MERGE
                        sections.  */
  discard_none,             /* Don't discard any locals.  */
  discard_l,         /* Discard local temporary symbols.  */
  discard_all        /* Discard all locals.  */
};
Enumerator:
bfd_link_generic_hash_table 
bfd_link_elf_hash_table 

Definition at line 48 of file bfdlink.h.

Enumerator:
bfd_link_hash_new 
bfd_link_hash_undefined 
bfd_link_hash_undefweak 
bfd_link_hash_defined 
bfd_link_hash_defweak 
bfd_link_hash_common 
bfd_link_hash_indirect 
bfd_link_hash_warning 

Definition at line 57 of file bfdlink.h.

{
  bfd_link_hash_new,        /* Symbol is new.  */
  bfd_link_hash_undefined,  /* Symbol seen before, but undefined.  */
  bfd_link_hash_undefweak,  /* Symbol is weak and undefined.  */
  bfd_link_hash_defined,    /* Symbol is defined.  */
  bfd_link_hash_defweak,    /* Symbol is weak and defined.  */
  bfd_link_hash_common,            /* Symbol is common.  */
  bfd_link_hash_indirect,   /* Symbol is an indirect link.  */
  bfd_link_hash_warning            /* Like indirect, but warn if referenced.  */
};
Enumerator:
bfd_undefined_link_order 
bfd_indirect_link_order 
bfd_data_link_order 
bfd_section_reloc_link_order 
bfd_symbol_reloc_link_order 

Definition at line 583 of file bfdlink.h.

{
  bfd_undefined_link_order, /* Undefined.  */
  bfd_indirect_link_order,  /* Built from a section.  */
  bfd_data_link_order,             /* Set to explicit data.  */
  bfd_section_reloc_link_order,    /* Relocate against a section.  */
  bfd_symbol_reloc_link_order      /* Relocate against a symbol.  */
};
Enumerator:
strip_none 
strip_debugger 
strip_some 
strip_all 

Definition at line 26 of file bfdlink.h.

{
  strip_none,        /* Don't strip any symbols.  */
  strip_debugger,    /* Strip debugging symbols.  */
  strip_some,        /* keep_hash is the list of symbols to keep.  */
  strip_all          /* Strip all symbols.  */
};
Enumerator:
RM_NOT_YET_SET 
RM_IGNORE 
RM_GENERATE_WARNING 
RM_GENERATE_ERROR 

Definition at line 213 of file bfdlink.h.

{
  /* This is the initial value when then link_info structure is created.
     It allows the various stages of the linker to determine whether they
     allowed to set the value.  */
  RM_NOT_YET_SET = 0,
  RM_IGNORE,
  RM_GENERATE_WARNING,
  RM_GENERATE_ERROR
};

Function Documentation

Definition at line 619 of file linker.c.

{
  BFD_ASSERT (h->u.undef.next == NULL);
  if (table->undefs_tail != NULL)
    table->undefs_tail->u.undef.next = h;
  if (table->undefs == NULL)
    table->undefs = h;
  table->undefs_tail = h;
}

Here is the caller graph for this function:

Definition at line 491 of file linker.c.

{
  struct bfd_link_hash_entry *ret;

  ret = ((struct bfd_link_hash_entry *)
        bfd_hash_lookup (&table->table, string, create, copy));

  if (follow && ret != NULL)
    {
      while (ret->type == bfd_link_hash_indirect
            || ret->type == bfd_link_hash_warning)
       ret = ret->u.i.link;
    }

  return ret;
}

Here is the call graph for this function:

Definition at line 607 of file linker.c.

{
  bfd_hash_traverse (&table->table,
                   (bfd_boolean (*) (struct bfd_hash_entry *, void *)) func,
                   info);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 638 of file linker.c.

{
  struct bfd_link_hash_entry **pun;

  pun = &table->undefs;
  while (*pun != NULL)
    {
      struct bfd_link_hash_entry *h = *pun;

      if (h->type == bfd_link_hash_new
         || h->type == bfd_link_hash_undefweak)
       {
         *pun = h->u.undef.next;
         h->u.undef.next = NULL;
         if (h == table->undefs_tail)
           {
             if (pun == &table->undefs)
              table->undefs_tail = NULL;
             else
              /* pun points at an u.undef.next field.  Go back to
                 the start of the link_hash_entry.  */
              table->undefs_tail = (struct bfd_link_hash_entry *)
                ((char *) pun - ((char *) &h->u.undef.next - (char *) h));
             break;
           }
       }
      else
       pun = &h->u.undef.next;
    }
}

Here is the caller graph for this function:

Definition at line 2606 of file linker.c.

{
  bfd_size_type amt = sizeof (struct bfd_link_order);
  struct bfd_link_order *new;

  new = bfd_zalloc (abfd, amt);
  if (!new)
    return NULL;

  new->type = bfd_undefined_link_order;

  if (section->map_tail.link_order != NULL)
    section->map_tail.link_order->next = new;
  else
    section->map_head.link_order = new;
  section->map_tail.link_order = new;

  return new;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 517 of file linker.c.

{
  bfd_size_type amt;

  if (info->wrap_hash != NULL)
    {
      const char *l;
      char prefix = '\0';

      l = string;
      if (*l == bfd_get_symbol_leading_char (abfd) || *l == info->wrap_char)
       {
         prefix = *l;
         ++l;
       }

#undef WRAP
#define WRAP "__wrap_"

      if (bfd_hash_lookup (info->wrap_hash, l, FALSE, FALSE) != NULL)
       {
         char *n;
         struct bfd_link_hash_entry *h;

         /* This symbol is being wrapped.  We want to replace all
             references to SYM with references to __wrap_SYM.  */

         amt = strlen (l) + sizeof WRAP + 1;
         n = bfd_malloc (amt);
         if (n == NULL)
           return NULL;

         n[0] = prefix;
         n[1] = '\0';
         strcat (n, WRAP);
         strcat (n, l);
         h = bfd_link_hash_lookup (info->hash, n, create, TRUE, follow);
         free (n);
         return h;
       }

#undef WRAP

#undef  REAL
#define REAL "__real_"

      if (*l == '_'
         && CONST_STRNEQ (l, REAL)
         && bfd_hash_lookup (info->wrap_hash, l + sizeof REAL - 1,
                           FALSE, FALSE) != NULL)
       {
         char *n;
         struct bfd_link_hash_entry *h;

         /* This is a reference to __real_SYM, where SYM is being
             wrapped.  We want to replace all references to __real_SYM
             with references to SYM.  */

         amt = strlen (l + sizeof REAL - 1) + 2;
         n = bfd_malloc (amt);
         if (n == NULL)
           return NULL;

         n[0] = prefix;
         n[1] = '\0';
         strcat (n, l + sizeof REAL - 1);
         h = bfd_link_hash_lookup (info->hash, n, create, TRUE, follow);
         free (n);
         return h;
       }

#undef REAL
    }

  return bfd_link_hash_lookup (info->hash, string, create, copy, follow);
}

Here is the call graph for this function:

Here is the caller graph for this function: