--- gdb-6.3.orig/bfd/doc/bfd.info +++ gdb-6.3/bfd/doc/bfd.info @@ -1,4 +1,5 @@ -This is bfd.info, produced by makeinfo version 4.7 from bfd.texinfo. +This is /home/packages/u/gdb-6.3/bfd/doc/bfd.info, produced by makeinfo +version 4.7 from /home/packages/u/gdb-6.3/bfd/doc/bfd.texinfo. START-INFO-DIR-ENTRY * Bfd: (bfd). The Binary File Descriptor library. @@ -16,73 +17,9617 @@ section entitled "GNU Free Documentation License".  -Indirect: -bfd.info-1: 692 -bfd.info-2: 299207 +File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) + + This file documents the binary file descriptor library libbfd. + +* Menu: + +* Overview:: Overview of BFD +* BFD front end:: BFD front end +* BFD back ends:: BFD back ends +* GNU Free Documentation License:: GNU Free Documentation License +* Index:: Index + + +File: bfd.info, Node: Overview, Next: BFD front end, Prev: Top, Up: Top + +1 Introduction +************** + +BFD is a package which allows applications to use the same routines to +operate on object files whatever the object file format. A new object +file format can be supported simply by creating a new BFD back end and +adding it to the library. + + BFD is split into two parts: the front end, and the back ends (one +for each object file format). + * The front end of BFD provides the interface to the user. It manages + memory and various canonical data structures. The front end also + decides which back end to use and when to call back end routines. + + * The back ends provide BFD its view of the real world. Each back + end provides a set of calls which the BFD front end can use to + maintain its canonical form. The back ends also may keep around + information for their own use, for greater efficiency. + +* Menu: + +* History:: History +* How It Works:: How It Works +* What BFD Version 2 Can Do:: What BFD Version 2 Can Do + + +File: bfd.info, Node: History, Next: How It Works, Prev: Overview, Up: Overview + +1.1 History +=========== + +One spur behind BFD was the desire, on the part of the GNU 960 team at +Intel Oregon, for interoperability of applications on their COFF and +b.out file formats. Cygnus was providing GNU support for the team, and +was contracted to provide the required functionality. + + The name came from a conversation David Wallace was having with +Richard Stallman about the library: RMS said that it would be quite +hard--David said "BFD". Stallman was right, but the name stuck. + + At the same time, Ready Systems wanted much the same thing, but for +different object file formats: IEEE-695, Oasys, Srecords, a.out and 68k +coff. + + BFD was first implemented by members of Cygnus Support; Steve +Chamberlain (`sac@cygnus.com'), John Gilmore (`gnu@cygnus.com'), K. +Richard Pixley (`rich@cygnus.com') and David Henkel-Wallace +(`gumby@cygnus.com'). + + +File: bfd.info, Node: How It Works, Next: What BFD Version 2 Can Do, Prev: History, Up: Overview + +1.2 How To Use BFD +================== + +To use the library, include `bfd.h' and link with `libbfd.a'. + + BFD provides a common interface to the parts of an object file for a +calling application. + + When an application sucessfully opens a target file (object, +archive, or whatever), a pointer to an internal structure is returned. +This pointer points to a structure called `bfd', described in `bfd.h'. +Our convention is to call this pointer a BFD, and instances of it +within code `abfd'. All operations on the target object file are +applied as methods to the BFD. The mapping is defined within `bfd.h' +in a set of macros, all beginning with `bfd_' to reduce namespace +pollution. + + For example, this sequence does what you would probably expect: +return the number of sections in an object file attached to a BFD +`abfd'. + + #include "bfd.h" + + unsigned int number_of_sections (abfd) + bfd *abfd; + { + return bfd_count_sections (abfd); + } + + The abstraction used within BFD is that an object file has: + + * a header, + + * a number of sections containing raw data (*note Sections::), + + * a set of relocations (*note Relocations::), and + + * some symbol information (*note Symbols::). + Also, BFDs opened for archives have the additional attribute of an +index and contain subordinate BFDs. This approach is fine for a.out and +coff, but loses efficiency when applied to formats such as S-records and +IEEE-695. + + +File: bfd.info, Node: What BFD Version 2 Can Do, Prev: How It Works, Up: Overview + +1.3 What BFD Version 2 Can Do +============================= + +When an object file is opened, BFD subroutines automatically determine +the format of the input object file. They then build a descriptor in +memory with pointers to routines that will be used to access elements of +the object file's data structures. + + As different information from the object files is required, BFD +reads from different sections of the file and processes them. For +example, a very common operation for the linker is processing symbol +tables. Each BFD back end provides a routine for converting between +the object file's representation of symbols and an internal canonical +format. When the linker asks for the symbol table of an object file, it +calls through a memory pointer to the routine from the relevant BFD +back end which reads and converts the table into a canonical form. The +linker then operates upon the canonical form. When the link is finished +and the linker writes the output file's symbol table, another BFD back +end routine is called to take the newly created symbol table and +convert it into the chosen output format. + +* Menu: + +* BFD information loss:: Information Loss +* Canonical format:: The BFD canonical object-file format + + +File: bfd.info, Node: BFD information loss, Next: Canonical format, Up: What BFD Version 2 Can Do + +1.3.1 Information Loss +---------------------- + +_Information can be lost during output._ The output formats supported +by BFD do not provide identical facilities, and information which can +be described in one form has nowhere to go in another format. One +example of this is alignment information in `b.out'. There is nowhere +in an `a.out' format file to store alignment information on the +contained data, so when a file is linked from `b.out' and an `a.out' +image is produced, alignment information will not propagate to the +output file. (The linker will still use the alignment information +internally, so the link is performed correctly). + + Another example is COFF section names. COFF files may contain an +unlimited number of sections, each one with a textual section name. If +the target of the link is a format which does not have many sections +(e.g., `a.out') or has sections without names (e.g., the Oasys format), +the link cannot be done simply. You can circumvent this problem by +describing the desired input-to-output section mapping with the linker +command language. + + _Information can be lost during canonicalization._ The BFD internal +canonical form of the external formats is not exhaustive; there are +structures in input formats for which there is no direct representation +internally. This means that the BFD back ends cannot maintain all +possible data richness through the transformation between external to +internal and back to external formats. + + This limitation is only a problem when an application reads one +format and writes another. Each BFD back end is responsible for +maintaining as much data as possible, and the internal BFD canonical +form has structures which are opaque to the BFD core, and exported only +to the back ends. When a file is read in one format, the canonical form +is generated for BFD and the application. At the same time, the back +end saves away any information which may otherwise be lost. If the data +is then written back in the same format, the back end routine will be +able to use the canonical form provided by the BFD core as well as the +information it prepared earlier. Since there is a great deal of +commonality between back ends, there is no information lost when +linking or copying big endian COFF to little endian COFF, or `a.out' to +`b.out'. When a mixture of formats is linked, the information is only +lost from the files whose format differs from the destination. + + +File: bfd.info, Node: Canonical format, Prev: BFD information loss, Up: What BFD Version 2 Can Do + +1.3.2 The BFD canonical object-file format +------------------------------------------ + +The greatest potential for loss of information occurs when there is the +least overlap between the information provided by the source format, +that stored by the canonical format, and that needed by the destination +format. A brief description of the canonical form may help you +understand which kinds of data you can count on preserving across +conversions. + +_files_ + Information stored on a per-file basis includes target machine + architecture, particular implementation format type, a demand + pageable bit, and a write protected bit. Information like Unix + magic numbers is not stored here--only the magic numbers' meaning, + so a `ZMAGIC' file would have both the demand pageable bit and the + write protected text bit set. The byte order of the target is + stored on a per-file basis, so that big- and little-endian object + files may be used with one another. + +_sections_ + Each section in the input file contains the name of the section, + the section's original address in the object file, size and + alignment information, various flags, and pointers into other BFD + data structures. + +_symbols_ + Each symbol contains a pointer to the information for the object + file which originally defined it, its name, its value, and various + flag bits. When a BFD back end reads in a symbol table, it + relocates all symbols to make them relative to the base of the + section where they were defined. Doing this ensures that each + symbol points to its containing section. Each symbol also has a + varying amount of hidden private data for the BFD back end. Since + the symbol points to the original file, the private data format + for that symbol is accessible. `ld' can operate on a collection + of symbols of wildly different formats without problems. + + Normal global and simple local symbols are maintained on output, + so an output file (no matter its format) will retain symbols + pointing to functions and to global, static, and common variables. + Some symbol information is not worth retaining; in `a.out', type + information is stored in the symbol table as long symbol names. + This information would be useless to most COFF debuggers; the + linker has command line switches to allow users to throw it away. + + There is one word of type information within the symbol, so if the + format supports symbol type information within symbols (for + example, COFF, IEEE, Oasys) and the type is simple enough to fit + within one word (nearly everything but aggregates), the + information will be preserved. + +_relocation level_ + Each canonical BFD relocation record contains a pointer to the + symbol to relocate to, the offset of the data to relocate, the + section the data is in, and a pointer to a relocation type + descriptor. Relocation is performed by passing messages through + the relocation type descriptor and the symbol pointer. Therefore, + relocations can be performed on output data using a relocation + method that is only available in one of the input formats. For + instance, Oasys provides a byte relocation format. A relocation + record requesting this relocation type would point indirectly to a + routine to perform this, so the relocation may be performed on a + byte being written to a 68k COFF file, even though 68k COFF has no + such relocation type. + +_line numbers_ + Object formats can contain, for debugging purposes, some form of + mapping between symbols, source line numbers, and addresses in the + output file. These addresses have to be relocated along with the + symbol information. Each symbol with an associated list of line + number records points to the first record of the list. The head + of a line number list consists of a pointer to the symbol, which + allows finding out the address of the function whose line number + is being described. The rest of the list is made up of pairs: + offsets into the section and line numbers. Any format which can + simply derive this information can pass it successfully between + formats (COFF, IEEE and Oasys). + + +File: bfd.info, Node: BFD front end, Next: BFD back ends, Prev: Overview, Up: Top + +2 BFD Front End +*************** + +2.1 `typedef bfd' +================= + +A BFD has type `bfd'; objects of this type are the cornerstone of any +application using BFD. Using BFD consists of making references though +the BFD and to data in the BFD. + + Here is the structure that defines the type `bfd'. It contains the +major data about the file and pointers to the rest of the data. + + + struct bfd + { + /* A unique identifier of the BFD */ + unsigned int id; + + /* The filename the application opened the BFD with. */ + const char *filename; + + /* A pointer to the target jump table. */ + const struct bfd_target *xvec; + + /* The IOSTREAM, and corresponding IO vector that provide access + to the file backing the BFD. */ + void *iostream; + const struct bfd_iovec *iovec; + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + bfd_boolean cacheable; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + bfd_boolean target_defaulted; + + /* The caching routines use these to maintain a + least-recently-used list of BFDs. */ + struct bfd *lru_prev, *lru_next; + + /* When a file is closed by the caching routines, BFD retains + state information on the file here... */ + ufile_ptr where; + + /* ... and here: (``once'' means at least once). */ + bfd_boolean opened_once; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + bfd_boolean mtime_set; + + /* File modified time, if mtime_set is TRUE. */ + long mtime; + + /* Reserved for an unimplemented file locking extension. */ + int ifd; + + /* The format which belongs to the BFD. (object, core, etc.) */ + bfd_format format; + + /* The direction with which the BFD was opened. */ + enum bfd_direction + { + no_direction = 0, + read_direction = 1, + write_direction = 2, + both_direction = 3 + } + direction; + + /* Format_specific flags. */ + flagword flags; + + /* Currently my_archive is tested before adding origin to + anything. I believe that this can become always an add of + origin, with origin set to 0 for non archive files. */ + ufile_ptr origin; + + /* Remember when output has begun, to stop strange things + from happening. */ + bfd_boolean output_has_begun; + + /* A hash table for section names. */ + struct bfd_hash_table section_htab; + + /* Pointer to linked list of sections. */ + struct bfd_section *sections; + + /* The place where we add to the section list. */ + struct bfd_section **section_tail; + + /* The number of sections. */ + unsigned int section_count; + + /* Stuff only useful for object files: + The start address. */ + bfd_vma start_address; + + /* Used for input and output. */ + unsigned int symcount; + + /* Symbol table for output BFD (with symcount entries). */ + struct bfd_symbol **outsymbols; + + /* Used for slurped dynamic symbol tables. */ + unsigned int dynsymcount; + + /* Pointer to structure which contains architecture information. */ + const struct bfd_arch_info *arch_info; + + /* Flag set if symbols from this BFD should not be exported. */ + bfd_boolean no_export; + + /* Stuff only useful for archives. */ + void *arelt_data; + struct bfd *my_archive; /* The containing archive BFD. */ + struct bfd *next; /* The next BFD in the archive. */ + struct bfd *archive_head; /* The first BFD in the archive. */ + bfd_boolean has_armap; + + /* A chain of BFD structures involved in a link. */ + struct bfd *link_next; + + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + + /* Used by the back end to hold private data. */ + union + { + struct aout_data_struct *aout_data; + struct artdata *aout_ar_data; + struct _oasys_data *oasys_obj_data; + struct _oasys_ar_data *oasys_ar_data; + struct coff_tdata *coff_obj_data; + struct pe_tdata *pe_obj_data; + struct xcoff_tdata *xcoff_obj_data; + struct ecoff_tdata *ecoff_obj_data; + struct ieee_data_struct *ieee_data; + struct ieee_ar_data_struct *ieee_ar_data; + struct srec_data_struct *srec_data; + struct ihex_data_struct *ihex_data; + struct tekhex_data_struct *tekhex_data; + struct elf_obj_tdata *elf_obj_data; + struct nlm_obj_tdata *nlm_obj_data; + struct bout_data_struct *bout_data; + struct mmo_data_struct *mmo_data; + struct sun_core_struct *sun_core_data; + struct sco5_core_struct *sco5_core_data; + struct trad_core_struct *trad_core_data; + struct som_data_struct *som_data; + struct hpux_core_struct *hpux_core_data; + struct hppabsd_core_struct *hppabsd_core_data; + struct sgi_core_struct *sgi_core_data; + struct lynx_core_struct *lynx_core_data; + struct osf_core_struct *osf_core_data; + struct cisco_core_struct *cisco_core_data; + struct versados_data_struct *versados_data; + struct netbsd_core_struct *netbsd_core_data; + struct mach_o_data_struct *mach_o_data; + struct mach_o_fat_data_struct *mach_o_fat_data; + struct bfd_pef_data_struct *pef_data; + struct bfd_pef_xlib_data_struct *pef_xlib_data; + struct bfd_sym_data_struct *sym_data; + void *any; + } + tdata; + + /* Used by the application to hold private data. */ + void *usrdata; + + /* Where all the allocated stuff under this BFD goes. This is a + struct objalloc *, but we use void * to avoid requiring the inclusion + of objalloc.h. */ + void *memory; + }; + +2.2 Error reporting +=================== + +Most BFD functions return nonzero on success (check their individual +documentation for precise semantics). On an error, they call +`bfd_set_error' to set an error condition that callers can check by +calling `bfd_get_error'. If that returns `bfd_error_system_call', then +check `errno'. + + The easiest way to report a BFD error to the user is to use +`bfd_perror'. + +2.2.1 Type `bfd_error_type' +--------------------------- + +The values returned by `bfd_get_error' are defined by the enumerated +type `bfd_error_type'. + + + typedef enum bfd_error + { + bfd_error_no_error = 0, + bfd_error_system_call, + bfd_error_invalid_target, + bfd_error_wrong_format, + bfd_error_wrong_object_format, + bfd_error_invalid_operation, + bfd_error_no_memory, + bfd_error_no_symbols, + bfd_error_no_armap, + bfd_error_no_more_archived_files, + bfd_error_malformed_archive, + bfd_error_file_not_recognized, + bfd_error_file_ambiguously_recognized, + bfd_error_no_contents, + bfd_error_nonrepresentable_section, + bfd_error_no_debug_section, + bfd_error_bad_value, + bfd_error_file_truncated, + bfd_error_file_too_big, + bfd_error_invalid_error_code + } + bfd_error_type; + +2.2.1.1 `bfd_get_error' +....................... + +*Synopsis* + bfd_error_type bfd_get_error (void); + *Description* +Return the current BFD error condition. + +2.2.1.2 `bfd_set_error' +....................... + +*Synopsis* + void bfd_set_error (bfd_error_type error_tag); + *Description* +Set the BFD error condition to be ERROR_TAG. + +2.2.1.3 `bfd_errmsg' +.................... + +*Synopsis* + const char *bfd_errmsg (bfd_error_type error_tag); + *Description* +Return a string describing the error ERROR_TAG, or the system error if +ERROR_TAG is `bfd_error_system_call'. + +2.2.1.4 `bfd_perror' +.................... + +*Synopsis* + void bfd_perror (const char *message); + *Description* +Print to the standard error stream a string describing the last BFD +error that occurred, or the last system error if the last BFD error was +a system call failure. If MESSAGE is non-NULL and non-empty, the error +string printed is preceded by MESSAGE, a colon, and a space. It is +followed by a newline. + +2.2.2 BFD error handler +----------------------- + +Some BFD functions want to print messages describing the problem. They +call a BFD error handler function. This function may be overridden by +the program. + + The BFD error handler acts like printf. + + + typedef void (*bfd_error_handler_type) (const char *, ...); + +2.2.2.1 `bfd_set_error_handler' +............................... + +*Synopsis* + bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); + *Description* +Set the BFD error handler function. Returns the previous function. + +2.2.2.2 `bfd_set_error_program_name' +.................................... + +*Synopsis* + void bfd_set_error_program_name (const char *); + *Description* +Set the program name to use when printing a BFD error. This is printed +before the error message followed by a colon and space. The string +must not be changed after it is passed to this function. + +2.2.2.3 `bfd_get_error_handler' +............................... + +*Synopsis* + bfd_error_handler_type bfd_get_error_handler (void); + *Description* +Return the BFD error handler function. + +2.3 Symbols +=========== + +2.3.0.1 `bfd_get_reloc_upper_bound' +................................... + +*Synopsis* + long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); + *Description* +Return the number of bytes required to store the relocation information +associated with section SECT attached to bfd ABFD. If an error occurs, +return -1. + +2.3.0.2 `bfd_canonicalize_reloc' +................................ + +*Synopsis* + long bfd_canonicalize_reloc + (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); + *Description* +Call the back end associated with the open BFD ABFD and translate the +external form of the relocation information attached to SEC into the +internal canonical form. Place the table into memory at LOC, which has +been preallocated, usually by a call to `bfd_get_reloc_upper_bound'. +Returns the number of relocs, or -1 on error. + + The SYMS table is also needed for horrible internal magic reasons. + +2.3.0.3 `bfd_set_reloc' +....................... + +*Synopsis* + void bfd_set_reloc + (bfd *abfd, asection *sec, arelent **rel, unsigned int count); + *Description* +Set the relocation pointer and count within section SEC to the values +REL and COUNT. The argument ABFD is ignored. + +2.3.0.4 `bfd_set_file_flags' +............................ + +*Synopsis* + bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); + *Description* +Set the flag word in the BFD ABFD to the value FLAGS. + + Possible errors are: + * `bfd_error_wrong_format' - The target bfd was not of object format. + + * `bfd_error_invalid_operation' - The target bfd was open for + reading. + + * `bfd_error_invalid_operation' - The flag word contained a bit + which was not applicable to the type of file. E.g., an attempt + was made to set the `D_PAGED' bit on a BFD format which does not + support demand paging. + +2.3.0.5 `bfd_get_arch_size' +........................... + +*Synopsis* + int bfd_get_arch_size (bfd *abfd); + *Description* +Returns the architecture address size, in bits, as determined by the +object file's format. For ELF, this information is included in the +header. + + *Returns* +Returns the arch size in bits if known, `-1' otherwise. + +2.3.0.6 `bfd_get_sign_extend_vma' +................................. + +*Synopsis* + int bfd_get_sign_extend_vma (bfd *abfd); + *Description* +Indicates if the target architecture "naturally" sign extends an +address. Some architectures implicitly sign extend address values when +they are converted to types larger than the size of an address. For +instance, bfd_get_start_address() will return an address sign extended +to fill a bfd_vma when this is the case. + + *Returns* +Returns `1' if the target architecture is known to sign extend +addresses, `0' if the target architecture is known to not sign extend +addresses, and `-1' otherwise. + +2.3.0.7 `bfd_set_start_address' +............................... + +*Synopsis* + bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); + *Description* +Make VMA the entry point of output BFD ABFD. + + *Returns* +Returns `TRUE' on success, `FALSE' otherwise. + +2.3.0.8 `bfd_get_gp_size' +......................... + +*Synopsis* + unsigned int bfd_get_gp_size (bfd *abfd); + *Description* +Return the maximum size of objects to be optimized using the GP +register under MIPS ECOFF. This is typically set by the `-G' argument +to the compiler, assembler or linker. + +2.3.0.9 `bfd_set_gp_size' +......................... + +*Synopsis* + void bfd_set_gp_size (bfd *abfd, unsigned int i); + *Description* +Set the maximum size of objects to be optimized using the GP register +under ECOFF or MIPS ELF. This is typically set by the `-G' argument to +the compiler, assembler or linker. + +2.3.0.10 `bfd_scan_vma' +....................... + +*Synopsis* + bfd_vma bfd_scan_vma (const char *string, const char **end, int base); + *Description* +Convert, like `strtoul', a numerical expression STRING into a `bfd_vma' +integer, and return that integer. (Though without as many bells and +whistles as `strtoul'.) The expression is assumed to be unsigned +(i.e., positive). If given a BASE, it is used as the base for +conversion. A base of 0 causes the function to interpret the string in +hex if a leading "0x" or "0X" is found, otherwise in octal if a leading +zero is found, otherwise in decimal. + + If the value would overflow, the maximum `bfd_vma' value is returned. + +2.3.0.11 `bfd_copy_private_header_data' +....................................... + +*Synopsis* + bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); + *Description* +Copy private BFD header information from the BFD IBFD to the the BFD +OBFD. This copies information that may require sections to exist, but +does not require symbol tables. Return `true' on success, `false' on +error. Possible error returns are: + + * `bfd_error_no_memory' - Not enough memory exists to create private + data for OBFD. + + #define bfd_copy_private_header_data(ibfd, obfd) \ + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) + +2.3.0.12 `bfd_copy_private_bfd_data' +.................................... + +*Synopsis* + bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); + *Description* +Copy private BFD information from the BFD IBFD to the the BFD OBFD. +Return `TRUE' on success, `FALSE' on error. Possible error returns are: + + * `bfd_error_no_memory' - Not enough memory exists to create private + data for OBFD. + + #define bfd_copy_private_bfd_data(ibfd, obfd) \ + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) + +2.3.0.13 `bfd_merge_private_bfd_data' +..................................... + +*Synopsis* + bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); + *Description* +Merge private BFD information from the BFD IBFD to the the output file +BFD OBFD when linking. Return `TRUE' on success, `FALSE' on error. +Possible error returns are: + + * `bfd_error_no_memory' - Not enough memory exists to create private + data for OBFD. + + #define bfd_merge_private_bfd_data(ibfd, obfd) \ + BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ + (ibfd, obfd)) + +2.3.0.14 `bfd_set_private_flags' +................................ + +*Synopsis* + bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); + *Description* +Set private BFD flag information in the BFD ABFD. Return `TRUE' on +success, `FALSE' on error. Possible error returns are: + + * `bfd_error_no_memory' - Not enough memory exists to create private + data for OBFD. + + #define bfd_set_private_flags(abfd, flags) \ + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + +2.3.0.15 `Other functions' +.......................... + +*Description* +The following functions exist but have not yet been documented. + #define bfd_sizeof_headers(abfd, reloc) \ + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) + + #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, sec, syms, off, file, func, line)) + + #define bfd_debug_info_start(abfd) \ + BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) + + #define bfd_debug_info_end(abfd) \ + BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) + + #define bfd_debug_info_accumulate(abfd, section) \ + BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) + + #define bfd_stat_arch_elt(abfd, stat) \ + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) + + #define bfd_update_armap_timestamp(abfd) \ + BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) + + #define bfd_set_arch_mach(abfd, arch, mach)\ + BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) + + #define bfd_relax_section(abfd, section, link_info, again) \ + BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) + + #define bfd_gc_sections(abfd, link_info) \ + BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) + + #define bfd_merge_sections(abfd, link_info) \ + BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) + + #define bfd_is_group_section(abfd, sec) \ + BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) + + #define bfd_discard_group(abfd, sec) \ + BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) + + #define bfd_link_hash_table_create(abfd) \ + BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) + + #define bfd_link_hash_table_free(abfd, hash) \ + BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) + + #define bfd_link_add_symbols(abfd, info) \ + BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) + + #define bfd_link_just_syms(sec, info) \ + BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) + + #define bfd_final_link(abfd, info) \ + BFD_SEND (abfd, _bfd_final_link, (abfd, info)) + + #define bfd_free_cached_info(abfd) \ + BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) + + #define bfd_get_dynamic_symtab_upper_bound(abfd) \ + BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) + + #define bfd_print_private_bfd_data(abfd, file)\ + BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) + + #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ + BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) + + #define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ + BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ + dyncount, dynsyms, ret)) + + #define bfd_get_dynamic_reloc_upper_bound(abfd) \ + BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) + + #define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ + BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) + + extern bfd_byte *bfd_get_relocated_section_contents + (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, + bfd_boolean, asymbol **); + +2.3.0.16 `bfd_alt_mach_code' +............................ + +*Synopsis* + bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); + *Description* +When more than one machine code number is available for the same +machine type, this function can be used to switch between the preferred +one (alternative == 0) and any others. Currently, only ELF supports +this feature, with up to two alternate machine codes. + + struct bfd_preserve + { + void *marker; + void *tdata; + flagword flags; + const struct bfd_arch_info *arch_info; + struct bfd_section *sections; + struct bfd_section **section_tail; + unsigned int section_count; + struct bfd_hash_table section_htab; + }; + +2.3.0.17 `bfd_preserve_save' +............................ + +*Synopsis* + bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); + *Description* +When testing an object for compatibility with a particular target +back-end, the back-end object_p function needs to set up certain fields +in the bfd on successfully recognizing the object. This typically +happens in a piecemeal fashion, with failures possible at many points. +On failure, the bfd is supposed to be restored to its initial state, +which is virtually impossible. However, restoring a subset of the bfd +state works in practice. This function stores the subset and +reinitializes the bfd. + +2.3.0.18 `bfd_preserve_restore' +............................... + +*Synopsis* + void bfd_preserve_restore (bfd *, struct bfd_preserve *); + *Description* +This function restores bfd state saved by bfd_preserve_save. If MARKER +is non-NULL in struct bfd_preserve then that block and all subsequently +bfd_alloc'd memory is freed. + +2.3.0.19 `bfd_preserve_finish' +.............................. + +*Synopsis* + void bfd_preserve_finish (bfd *, struct bfd_preserve *); + *Description* +This function should be called when the bfd state saved by +bfd_preserve_save is no longer needed. ie. when the back-end object_p +function returns with success. + +2.3.0.20 `struct bfd_iovec' +........................... + +*Description* +The `struct bfd_iovec' contains the internal file I/O class. Each +`BFD' has an instance of this class and all file I/O is routed through +it (it is assumed that the instance implements all methods listed +below). + struct bfd_iovec + { + /* To avoid problems with macros, a "b" rather than "f" + prefix is prepended to each method name. */ + /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching + bytes starting at PTR. Return the number of bytes actually + transfered (a read past end-of-file returns less than NBYTES), + or -1 (setting `bfd_error') if an error occurs. */ + file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes); + file_ptr (*bwrite) (struct bfd *abfd, const void *ptr, + file_ptr nbytes); + /* Return the current IOSTREAM file offset, or -1 (setting `bfd_error' + if an error occurs. */ + file_ptr (*btell) (struct bfd *abfd); + /* For the following, on successful completion a value of 0 is returned. + Otherwise, a value of -1 is returned (and `bfd_error' is set). */ + int (*bseek) (struct bfd *abfd, file_ptr offset, int whence); + int (*bclose) (struct bfd *abfd); + int (*bflush) (struct bfd *abfd); + int (*bstat) (struct bfd *abfd, struct stat *sb); + }; + +2.3.0.21 `bfd_get_mtime' +........................ + +*Synopsis* + long bfd_get_mtime (bfd *abfd); + *Description* +Return the file modification time (as read from the file system, or +from the archive header for archive members). + +2.3.0.22 `bfd_get_size' +....................... + +*Synopsis* + long bfd_get_size (bfd *abfd); + *Description* +Return the file size (as read from file system) for the file associated +with BFD ABFD. + + The initial motivation for, and use of, this routine is not so we +can get the exact size of the object the BFD applies to, since that +might not be generally possible (archive members for example). It +would be ideal if someone could eventually modify it so that such +results were guaranteed. + + Instead, we want to ask questions like "is this NNN byte sized +object I'm about to try read from file offset YYY reasonable?" As as +example of where we might do this, some object formats use string +tables for which the first `sizeof (long)' bytes of the table contain +the size of the table itself, including the size bytes. If an +application tries to read what it thinks is one of these string tables, +without some way to validate the size, and for some reason the size is +wrong (byte swapping error, wrong location for the string table, etc.), +the only clue is likely to be a read error when it tries to read the +table, or a "virtual memory exhausted" error when it tries to allocate +15 bazillon bytes of space for the 15 bazillon byte table it is about +to read. This function at least allows us to answer the question, "is +the size reasonable?". + +* Menu: + +* Memory Usage:: +* Initialization:: +* Sections:: +* Symbols:: +* Archives:: +* Formats:: +* Relocations:: +* Core Files:: +* Targets:: +* Architectures:: +* Opening and Closing:: +* Internal:: +* File Caching:: +* Linker Functions:: +* Hash Tables:: + + +File: bfd.info, Node: Memory Usage, Next: Initialization, Prev: BFD front end, Up: BFD front end + +2.4 Memory Usage +================ + +BFD keeps all of its internal structures in obstacks. There is one +obstack per open BFD file, into which the current state is stored. When +a BFD is closed, the obstack is deleted, and so everything which has +been allocated by BFD for the closing file is thrown away. + + BFD does not free anything created by an application, but pointers +into `bfd' structures become invalid on a `bfd_close'; for example, +after a `bfd_close' the vector passed to `bfd_canonicalize_symtab' is +still around, since it has been allocated by the application, but the +data that it pointed to are lost. + + The general rule is to not close a BFD until all operations dependent +upon data from the BFD have been completed, or all the data from within +the file has been copied. To help with the management of memory, there +is a function (`bfd_alloc_size') which returns the number of bytes in +obstacks associated with the supplied BFD. This could be used to select +the greediest open BFD, close it to reclaim the memory, perform some +operation and reopen the BFD again, to get a fresh copy of the data +structures. + + +File: bfd.info, Node: Initialization, Next: Sections, Prev: Memory Usage, Up: BFD front end + +2.5 Initialization +================== + +These are the functions that handle initializing a BFD. + +2.5.0.1 `bfd_init' +.................. + +*Synopsis* + void bfd_init (void); + *Description* +This routine must be called before any other BFD function to initialize +magical internal data structures. + + +File: bfd.info, Node: Sections, Next: Symbols, Prev: Initialization, Up: BFD front end + +2.6 Sections +============ + +The raw data contained within a BFD is maintained through the section +abstraction. A single BFD may have any number of sections. It keeps +hold of them by pointing to the first; each one points to the next in +the list. + + Sections are supported in BFD in `section.c'. + +* Menu: + +* Section Input:: +* Section Output:: +* typedef asection:: +* section prototypes:: + + +File: bfd.info, Node: Section Input, Next: Section Output, Prev: Sections, Up: Sections + +2.6.1 Section input +------------------- + +When a BFD is opened for reading, the section structures are created +and attached to the BFD. + + Each section has a name which describes the section in the outside +world--for example, `a.out' would contain at least three sections, +called `.text', `.data' and `.bss'. + + Names need not be unique; for example a COFF file may have several +sections named `.data'. + + Sometimes a BFD will contain more than the "natural" number of +sections. A back end may attach other sections containing constructor +data, or an application may add a section (using `bfd_make_section') to +the sections attached to an already open BFD. For example, the linker +creates an extra section `COMMON' for each input file's BFD to hold +information about common storage. + + The raw data is not necessarily read in when the section descriptor +is created. Some targets may leave the data in place until a +`bfd_get_section_contents' call is made. Other back ends may read in +all the data at once. For example, an S-record file has to be read +once to determine the size of the data. An IEEE-695 file doesn't +contain raw data in sections, but data and relocation expressions +intermixed, so the data area has to be parsed to get out the data and +relocations. + + +File: bfd.info, Node: Section Output, Next: typedef asection, Prev: Section Input, Up: Sections + +2.6.2 Section output +-------------------- + +To write a new object style BFD, the various sections to be written +have to be created. They are attached to the BFD in the same way as +input sections; data is written to the sections using +`bfd_set_section_contents'. + + Any program that creates or combines sections (e.g., the assembler +and linker) must use the `asection' fields `output_section' and +`output_offset' to indicate the file sections to which each section +must be written. (If the section is being created from scratch, +`output_section' should probably point to the section itself and +`output_offset' should probably be zero.) + + The data to be written comes from input sections attached (via +`output_section' pointers) to the output sections. The output section +structure can be considered a filter for the input section: the output +section determines the vma of the output data and the name, but the +input section determines the offset into the output section of the data +to be written. + + E.g., to create a section "O", starting at 0x100, 0x123 long, +containing two subsections, "A" at offset 0x0 (i.e., at vma 0x100) and +"B" at offset 0x20 (i.e., at vma 0x120) the `asection' structures would +look like: + + section name "A" + output_offset 0x00 + size 0x20 + output_section -----------> section name "O" + | vma 0x100 + section name "B" | size 0x123 + output_offset 0x20 | + size 0x103 | + output_section --------| + +2.6.3 Link orders +----------------- + +The data within a section is stored in a "link_order". These are much +like the fixups in `gas'. The link_order abstraction allows a section +to grow and shrink within itself. + + A link_order knows how big it is, and which is the next link_order +and where the raw data for it is; it also points to a list of +relocations which apply to it. + + The link_order is used by the linker to perform relaxing on final +code. The compiler creates code which is as big as necessary to make +it work without relaxing, and the user can select whether to relax. +Sometimes relaxing takes a lot of time. The linker runs around the +relocations to see if any are attached to data which can be shrunk, if +so it does it on a link_order by link_order basis. + + +File: bfd.info, Node: typedef asection, Next: section prototypes, Prev: Section Output, Up: Sections + +2.6.4 typedef asection +---------------------- + +Here is the section structure: + + + typedef struct bfd_section + { + /* The name of the section; the name isn't a copy, the pointer is + the same as that passed to bfd_make_section. */ + const char *name; + + /* A unique sequence number. */ + int id; + + /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ + int index; + + /* The next section in the list belonging to the BFD, or NULL. */ + struct bfd_section *next; + + /* The field flags contains attributes of the section. Some + flags are read in from the object file, and some are + synthesized from other information. */ + flagword flags; + + #define SEC_NO_FLAGS 0x000 + + /* Tells the OS to allocate space for this section when loading. + This is clear for a section containing debug information only. */ + #define SEC_ALLOC 0x001 + + /* Tells the OS to load the section from the file when loading. + This is clear for a .bss section. */ + #define SEC_LOAD 0x002 + + /* The section contains data still to be relocated, so there is + some relocation information too. */ + #define SEC_RELOC 0x004 + + /* ELF reserves 4 processor specific bits and 8 operating system + specific bits in sh_flags; at present we can get away with just + one in communicating between the assembler and BFD, but this + isn't a good long-term solution. */ + #define SEC_ARCH_BIT_0 0x008 + + /* A signal to the OS that the section contains read only data. */ + #define SEC_READONLY 0x010 + + /* The section contains code only. */ + #define SEC_CODE 0x020 + + /* The section contains data only. */ + #define SEC_DATA 0x040 + + /* The section will reside in ROM. */ + #define SEC_ROM 0x080 + + /* The section contains constructor information. This section + type is used by the linker to create lists of constructors and + destructors used by `g++'. When a back end sees a symbol + which should be used in a constructor list, it creates a new + section for the type of name (e.g., `__CTOR_LIST__'), attaches + the symbol to it, and builds a relocation. To build the lists + of constructors, all the linker has to do is catenate all the + sections called `__CTOR_LIST__' and relocate the data + contained within - exactly the operations it would peform on + standard data. */ + #define SEC_CONSTRUCTOR 0x100 + + /* The section has contents - a data section could be + `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be + `SEC_HAS_CONTENTS' */ + #define SEC_HAS_CONTENTS 0x200 + + /* An instruction to the linker to not output the section + even if it has information which would normally be written. */ + #define SEC_NEVER_LOAD 0x400 + + /* The section is a COFF shared library section. This flag is + only for the linker. If this type of section appears in + the input file, the linker must copy it to the output file + without changing the vma or size. FIXME: Although this + was originally intended to be general, it really is COFF + specific (and the flag was renamed to indicate this). It + might be cleaner to have some more general mechanism to + allow the back end to control what the linker does with + sections. */ + #define SEC_COFF_SHARED_LIBRARY 0x800 + + /* The section contains thread local data. */ + #define SEC_THREAD_LOCAL 0x1000 + + /* The section has GOT references. This flag is only for the + linker, and is currently only used by the elf32-hppa back end. + It will be set if global offset table references were detected + in this section, which indicate to the linker that the section + contains PIC code, and must be handled specially when doing a + static link. */ + #define SEC_HAS_GOT_REF 0x4000 + + /* The section contains common symbols (symbols may be defined + multiple times, the value of a symbol is the amount of + space it requires, and the largest symbol value is the one + used). Most targets have exactly one of these (which we + translate to bfd_com_section_ptr), but ECOFF has two. */ + #define SEC_IS_COMMON 0x8000 + + /* The section contains only debugging information. For + example, this is set for ELF .debug and .stab sections. + strip tests this flag to see if a section can be + discarded. */ + #define SEC_DEBUGGING 0x10000 + + /* The contents of this section are held in memory pointed to + by the contents field. This is checked by bfd_get_section_contents, + and the data is retrieved from memory if appropriate. */ + #define SEC_IN_MEMORY 0x20000 + + /* The contents of this section are to be excluded by the + linker for executable and shared objects unless those + objects are to be further relocated. */ + #define SEC_EXCLUDE 0x40000 + + /* The contents of this section are to be sorted based on the sum of + the symbol and addend values specified by the associated relocation + entries. Entries without associated relocation entries will be + appended to the end of the section in an unspecified order. */ + #define SEC_SORT_ENTRIES 0x80000 + + /* When linking, duplicate sections of the same name should be + discarded, rather than being combined into a single section as + is usually done. This is similar to how common symbols are + handled. See SEC_LINK_DUPLICATES below. */ + #define SEC_LINK_ONCE 0x100000 + + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker + should handle duplicate sections. */ + #define SEC_LINK_DUPLICATES 0x600000 + + /* This value for SEC_LINK_DUPLICATES means that duplicate + sections with the same name should simply be discarded. */ + #define SEC_LINK_DUPLICATES_DISCARD 0x0 + + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if there are any duplicate sections, although + it should still only link one copy. */ + #define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 + + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections are a different size. */ + #define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 + + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections contain different + contents. */ + #define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 + + /* This section was created by the linker as part of dynamic + relocation or other arcane processing. It is skipped when + going through the first-pass output, trusting that someone + else up the line will take care of it later. */ + #define SEC_LINKER_CREATED 0x800000 + + /* This section should not be subject to garbage collection. */ + #define SEC_KEEP 0x1000000 + + /* This section contains "short" data, and should be placed + "near" the GP. */ + #define SEC_SMALL_DATA 0x2000000 + + /* This section contains data which may be shared with other + executables or shared objects. */ + #define SEC_SHARED 0x4000000 + + /* When a section with this flag is being linked, then if the size of + the input section is less than a page, it should not cross a page + boundary. If the size of the input section is one page or more, it + should be aligned on a page boundary. */ + #define SEC_BLOCK 0x8000000 + + /* Conditionally link this section; do not link if there are no + references found to any symbol in the section. */ + #define SEC_CLINK 0x10000000 + + /* Attempt to merge identical entities in the section. + Entity size is given in the entsize field. */ + #define SEC_MERGE 0x20000000 + + /* If given with SEC_MERGE, entities to merge are zero terminated + strings where entsize specifies character size instead of fixed + size entries. */ + #define SEC_STRINGS 0x40000000 + + /* This section contains data about section groups. */ + #define SEC_GROUP 0x80000000 + + /* End of section flags. */ + + /* Some internal packed boolean fields. */ + + /* See the vma field. */ + unsigned int user_set_vma : 1; + + /* A mark flag used by some of the linker backends. */ + unsigned int linker_mark : 1; + + /* Another mark flag used by some of the linker backends. Set for + output sections that have an input section. */ + unsigned int linker_has_input : 1; + + /* A mark flag used by some linker backends for garbage collection. */ + unsigned int gc_mark : 1; + + /* The following flags are used by the ELF linker. */ + + /* Mark sections which have been allocated to segments. */ + unsigned int segment_mark : 1; + + /* Type of sec_info information. */ + unsigned int sec_info_type:3; + #define ELF_INFO_TYPE_NONE 0 + #define ELF_INFO_TYPE_STABS 1 + #define ELF_INFO_TYPE_MERGE 2 + #define ELF_INFO_TYPE_EH_FRAME 3 + #define ELF_INFO_TYPE_JUST_SYMS 4 + + /* Nonzero if this section uses RELA relocations, rather than REL. */ + unsigned int use_rela_p:1; + + /* Bits used by various backends. */ + + /* Nonzero if this section has TLS related relocations. */ + unsigned int has_tls_reloc:1; + + /* Nonzero if this section has a gp reloc. */ + unsigned int has_gp_reloc:1; + + /* Nonzero if this section needs the relax finalize pass. */ + unsigned int need_finalize_relax:1; + + /* Whether relocations have been processed. */ + unsigned int reloc_done : 1; + + /* End of internal packed boolean fields. */ + + /* The virtual memory address of the section - where it will be + at run time. The symbols are relocated against this. The + user_set_vma flag is maintained by bfd; if it's not set, the + backend can assign addresses (for example, in `a.out', where + the default address for `.data' is dependent on the specific + target and various flags). */ + bfd_vma vma; + + /* The load address of the section - where it would be in a + rom image; really only used for writing section header + information. */ + bfd_vma lma; + + /* The size of the section in octets, as it will be output. + Contains a value even if the section has no contents (e.g., the + size of `.bss'). */ + bfd_size_type size; + + /* For input sections, the original size on disk of the section, in + octets. This field is used by the linker relaxation code. It is + currently only set for sections where the linker relaxation scheme + doesn't cache altered section and reloc contents (stabs, eh_frame, + SEC_MERGE, some coff relaxing targets), and thus the original size + needs to be kept to read the section multiple times. + For output sections, rawsize holds the section size calculated on + a previous linker relaxation pass. */ + bfd_size_type rawsize; + + /* If this section is going to be output, then this value is the + offset in *bytes* into the output section of the first byte in the + input section (byte ==> smallest addressable unit on the + target). In most cases, if this was going to start at the + 100th octet (8-bit quantity) in the output section, this value + would be 100. However, if the target byte size is 16 bits + (bfd_octets_per_byte is "2"), this value would be 50. */ + bfd_vma output_offset; + + /* The output section through which to map on output. */ + struct bfd_section *output_section; + + /* The alignment requirement of the section, as an exponent of 2 - + e.g., 3 aligns to 2^3 (or 8). */ + unsigned int alignment_power; + + /* If an input section, a pointer to a vector of relocation + records for the data in this section. */ + struct reloc_cache_entry *relocation; + + /* If an output section, a pointer to a vector of pointers to + relocation records for the data in this section. */ + struct reloc_cache_entry **orelocation; + + /* The number of relocation records in one of the above. */ + unsigned reloc_count; + + /* Information below is back end specific - and not always used + or updated. */ + + /* File position of section data. */ + file_ptr filepos; + + /* File position of relocation info. */ + file_ptr rel_filepos; + + /* File position of line data. */ + file_ptr line_filepos; + + /* Pointer to data for applications. */ + void *userdata; + + /* If the SEC_IN_MEMORY flag is set, this points to the actual + contents. */ + unsigned char *contents; + + /* Attached line number information. */ + alent *lineno; + + /* Number of line number records. */ + unsigned int lineno_count; + + /* Entity size for merging purposes. */ + unsigned int entsize; + + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct bfd_section *kept_section; + + /* When a section is being output, this value changes as more + linenumbers are written out. */ + file_ptr moving_line_filepos; + + /* What the section number is in the target world. */ + int target_index; + + void *used_by_bfd; + + /* If this is a constructor section then here is a list of the + relocations created to relocate items within it. */ + struct relent_chain *constructor_chain; + + /* The BFD which owns the section. */ + bfd *owner; + + /* A symbol which points at this section only. */ + struct bfd_symbol *symbol; + struct bfd_symbol **symbol_ptr_ptr; + + struct bfd_link_order *link_order_head; + struct bfd_link_order *link_order_tail; + } asection; + + /* These sections are global, and are managed by BFD. The application + and target back end are not permitted to change the values in + these sections. New code should use the section_ptr macros rather + than referring directly to the const sections. The const sections + may eventually vanish. */ + #define BFD_ABS_SECTION_NAME "*ABS*" + #define BFD_UND_SECTION_NAME "*UND*" + #define BFD_COM_SECTION_NAME "*COM*" + #define BFD_IND_SECTION_NAME "*IND*" + + /* The absolute section. */ + extern asection bfd_abs_section; + #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) + #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) + /* Pointer to the undefined section. */ + extern asection bfd_und_section; + #define bfd_und_section_ptr ((asection *) &bfd_und_section) + #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) + /* Pointer to the common section. */ + extern asection bfd_com_section; + #define bfd_com_section_ptr ((asection *) &bfd_com_section) + /* Pointer to the indirect section. */ + extern asection bfd_ind_section; + #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) + #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) + + #define bfd_is_const_section(SEC) \ + ( ((SEC) == bfd_abs_section_ptr) \ + || ((SEC) == bfd_und_section_ptr) \ + || ((SEC) == bfd_com_section_ptr) \ + || ((SEC) == bfd_ind_section_ptr)) + + extern const struct bfd_symbol * const bfd_abs_symbol; + extern const struct bfd_symbol * const bfd_com_symbol; + extern const struct bfd_symbol * const bfd_und_symbol; + extern const struct bfd_symbol * const bfd_ind_symbol; + + /* Macros to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ + #define bfd_section_list_remove(ABFD, PS) \ + do \ + { \ + asection **_ps = PS; \ + asection *_s = *_ps; \ + *_ps = _s->next; \ + if (_s->next == NULL) \ + (ABFD)->section_tail = _ps; \ + } \ + while (0) + #define bfd_section_list_insert(ABFD, PS, S) \ + do \ + { \ + asection **_ps = PS; \ + asection *_s = S; \ + _s->next = *_ps; \ + *_ps = _s; \ + if (_s->next == NULL) \ + (ABFD)->section_tail = &_s->next; \ + } \ + while (0) + + +File: bfd.info, Node: section prototypes, Prev: typedef asection, Up: Sections + +2.6.5 Section prototypes +------------------------ + +These are the functions exported by the section handling part of BFD. + +2.6.5.1 `bfd_section_list_clear' +................................ + +*Synopsis* + void bfd_section_list_clear (bfd *); + *Description* +Clears the section list, and also resets the section count and hash +table entries. + +2.6.5.2 `bfd_get_section_by_name' +................................. + +*Synopsis* + asection *bfd_get_section_by_name (bfd *abfd, const char *name); + *Description* +Run through ABFD and return the one of the `asection's whose name +matches NAME, otherwise `NULL'. *Note Sections::, for more information. + + This should only be used in special cases; the normal way to process +all sections of a given name is to use `bfd_map_over_sections' and +`strcmp' on the name (or better yet, base it on the section flags or +something else) for each section. + +2.6.5.3 `bfd_get_section_by_name_if' +.................................... + +*Synopsis* + asection *bfd_get_section_by_name_if + (bfd *abfd, + const char *name, + bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); + *Description* +Call the provided function FUNC for each section attached to the BFD +ABFD whose name matches NAME, passing OBJ as an argument. The function +will be called as if by + + func (abfd, the_section, obj); + + It returns the first section for which FUNC returns true, otherwise +`NULL'. + +2.6.5.4 `bfd_get_unique_section_name' +..................................... + +*Synopsis* + char *bfd_get_unique_section_name + (bfd *abfd, const char *templat, int *count); + *Description* +Invent a section name that is unique in ABFD by tacking a dot and a +digit suffix onto the original TEMPLAT. If COUNT is non-NULL, then it +specifies the first number tried as a suffix to generate a unique name. +The value pointed to by COUNT will be incremented in this case. + +2.6.5.5 `bfd_make_section_old_way' +.................................. + +*Synopsis* + asection *bfd_make_section_old_way (bfd *abfd, const char *name); + *Description* +Create a new empty section called NAME and attach it to the end of the +chain of sections for the BFD ABFD. An attempt to create a section with +a name which is already in use returns its pointer without changing the +section chain. + + It has the funny name since this is the way it used to be before it +was rewritten.... + + Possible errors are: + * `bfd_error_invalid_operation' - If output has already started for + this BFD. + + * `bfd_error_no_memory' - If memory allocation fails. + +2.6.5.6 `bfd_make_section_anyway' +................................. + +*Synopsis* + asection *bfd_make_section_anyway (bfd *abfd, const char *name); + *Description* +Create a new empty section called NAME and attach it to the end of the +chain of sections for ABFD. Create a new section even if there is +already a section with that name. + + Return `NULL' and set `bfd_error' on error; possible errors are: + * `bfd_error_invalid_operation' - If output has already started for + ABFD. + + * `bfd_error_no_memory' - If memory allocation fails. + +2.6.5.7 `bfd_make_section' +.......................... + +*Synopsis* + asection *bfd_make_section (bfd *, const char *name); + *Description* +Like `bfd_make_section_anyway', but return `NULL' (without calling +bfd_set_error ()) without changing the section chain if there is +already a section named NAME. If there is an error, return `NULL' and +set `bfd_error'. + +2.6.5.8 `bfd_set_section_flags' +............................... + +*Synopsis* + bfd_boolean bfd_set_section_flags + (bfd *abfd, asection *sec, flagword flags); + *Description* +Set the attributes of the section SEC in the BFD ABFD to the value +FLAGS. Return `TRUE' on success, `FALSE' on error. Possible error +returns are: + + * `bfd_error_invalid_operation' - The section cannot have one or + more of the attributes requested. For example, a .bss section in + `a.out' may not have the `SEC_HAS_CONTENTS' field set. + +2.6.5.9 `bfd_map_over_sections' +............................... + +*Synopsis* + void bfd_map_over_sections + (bfd *abfd, + void (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); + *Description* +Call the provided function FUNC for each section attached to the BFD +ABFD, passing OBJ as an argument. The function will be called as if by + + func (abfd, the_section, obj); + + This is the preferred method for iterating over sections; an +alternative would be to use a loop: + + section *p; + for (p = abfd->sections; p != NULL; p = p->next) + func (abfd, p, ...) + +2.6.5.10 `bfd_sections_find_if' +............................... + +*Synopsis* + asection *bfd_sections_find_if + (bfd *abfd, + bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), + void *obj); + *Description* +Call the provided function OPERATION for each section attached to the +BFD ABFD, passing OBJ as an argument. The function will be called as if +by + + operation (abfd, the_section, obj); + + It returns the first section for which OPERATION returns true. + +2.6.5.11 `bfd_set_section_size' +............................... + +*Synopsis* + bfd_boolean bfd_set_section_size + (bfd *abfd, asection *sec, bfd_size_type val); + *Description* +Set SEC to the size VAL. If the operation is ok, then `TRUE' is +returned, else `FALSE'. + + Possible error returns: + * `bfd_error_invalid_operation' - Writing has started to the BFD, so + setting the size is invalid. + +2.6.5.12 `bfd_set_section_contents' +................................... + +*Synopsis* + bfd_boolean bfd_set_section_contents + (bfd *abfd, asection *section, const void *data, + file_ptr offset, bfd_size_type count); + *Description* +Sets the contents of the section SECTION in BFD ABFD to the data +starting in memory at DATA. The data is written to the output section +starting at offset OFFSET for COUNT octets. + + Normally `TRUE' is returned, else `FALSE'. Possible error returns +are: + * `bfd_error_no_contents' - The output section does not have the + `SEC_HAS_CONTENTS' attribute, so nothing can be written to it. + + * and some more too + This routine is front end to the back end function +`_bfd_set_section_contents'. + +2.6.5.13 `bfd_get_section_contents' +................................... + +*Synopsis* + bfd_boolean bfd_get_section_contents + (bfd *abfd, asection *section, void *location, file_ptr offset, + bfd_size_type count); + *Description* +Read data from SECTION in BFD ABFD into memory starting at LOCATION. +The data is read at an offset of OFFSET from the start of the input +section, and is read for COUNT bytes. + + If the contents of a constructor with the `SEC_CONSTRUCTOR' flag set +are requested or if the section does not have the `SEC_HAS_CONTENTS' +flag set, then the LOCATION is filled with zeroes. If no errors occur, +`TRUE' is returned, else `FALSE'. + +2.6.5.14 `bfd_malloc_and_get_section' +..................................... + +*Synopsis* + bfd_boolean bfd_malloc_and_get_section + (bfd *abfd, asection *section, bfd_byte **buf); + *Description* +Read all data from SECTION in BFD ABFD into a buffer, *BUF, malloc'd by +this function. + +2.6.5.15 `bfd_copy_private_section_data' +........................................ + +*Synopsis* + bfd_boolean bfd_copy_private_section_data + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); + *Description* +Copy private section information from ISEC in the BFD IBFD to the +section OSEC in the BFD OBFD. Return `TRUE' on success, `FALSE' on +error. Possible error returns are: + + * `bfd_error_no_memory' - Not enough memory exists to create private + data for OSEC. + + #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) + +2.6.5.16 `_bfd_strip_section_from_output' +......................................... + +*Synopsis* + void _bfd_strip_section_from_output + (struct bfd_link_info *info, asection *section); + *Description* +Remove SECTION from the output. If the output section becomes empty, +remove it from the output bfd. + + This function won't actually do anything except twiddle flags if +called too late in the linking process, when it's not safe to remove +sections. + +2.6.5.17 `bfd_generic_is_group_section' +....................................... + +*Synopsis* + bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); + *Description* +Returns TRUE if SEC is a member of a group. + +2.6.5.18 `bfd_generic_discard_group' +.................................... + +*Synopsis* + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); + *Description* +Remove all members of GROUP from the output. + + +File: bfd.info, Node: Symbols, Next: Archives, Prev: Sections, Up: BFD front end + +2.7 Symbols +=========== + +BFD tries to maintain as much symbol information as it can when it +moves information from file to file. BFD passes information to +applications though the `asymbol' structure. When the application +requests the symbol table, BFD reads the table in the native form and +translates parts of it into the internal format. To maintain more than +the information passed to applications, some targets keep some +information "behind the scenes" in a structure only the particular back +end knows about. For example, the coff back end keeps the original +symbol table structure as well as the canonical structure when a BFD is +read in. On output, the coff back end can reconstruct the output symbol +table so that no information is lost, even information unique to coff +which BFD doesn't know or understand. If a coff symbol table were read, +but were written through an a.out back end, all the coff specific +information would be lost. The symbol table of a BFD is not necessarily +read in until a canonicalize request is made. Then the BFD back end +fills in a table provided by the application with pointers to the +canonical information. To output symbols, the application provides BFD +with a table of pointers to pointers to `asymbol's. This allows +applications like the linker to output a symbol as it was read, since +the "behind the scenes" information will be still available. + +* Menu: + +* Reading Symbols:: +* Writing Symbols:: +* Mini Symbols:: +* typedef asymbol:: +* symbol handling functions:: + + +File: bfd.info, Node: Reading Symbols, Next: Writing Symbols, Prev: Symbols, Up: Symbols + +2.7.1 Reading symbols +--------------------- + +There are two stages to reading a symbol table from a BFD: allocating +storage, and the actual reading process. This is an excerpt from an +application which reads the symbol table: + + long storage_needed; + asymbol **symbol_table; + long number_of_symbols; + long i; + + storage_needed = bfd_get_symtab_upper_bound (abfd); + + if (storage_needed < 0) + FAIL + + if (storage_needed == 0) + return; + + symbol_table = xmalloc (storage_needed); + ... + number_of_symbols = + bfd_canonicalize_symtab (abfd, symbol_table); + + if (number_of_symbols < 0) + FAIL + + for (i = 0; i < number_of_symbols; i++) + process_symbol (symbol_table[i]); + + All storage for the symbols themselves is in an objalloc connected +to the BFD; it is freed when the BFD is closed. + + +File: bfd.info, Node: Writing Symbols, Next: Mini Symbols, Prev: Reading Symbols, Up: Symbols + +2.7.2 Writing symbols +--------------------- + +Writing of a symbol table is automatic when a BFD open for writing is +closed. The application attaches a vector of pointers to pointers to +symbols to the BFD being written, and fills in the symbol count. The +close and cleanup code reads through the table provided and performs +all the necessary operations. The BFD output code must always be +provided with an "owned" symbol: one which has come from another BFD, +or one which has been created using `bfd_make_empty_symbol'. Here is an +example showing the creation of a symbol table with only one element: + + #include "bfd.h" + int main (void) + { + bfd *abfd; + asymbol *ptrs[2]; + asymbol *new; + + abfd = bfd_openw ("foo","a.out-sunos-big"); + bfd_set_format (abfd, bfd_object); + new = bfd_make_empty_symbol (abfd); + new->name = "dummy_symbol"; + new->section = bfd_make_section_old_way (abfd, ".text"); + new->flags = BSF_GLOBAL; + new->value = 0x12345; + + ptrs[0] = new; + ptrs[1] = 0; + + bfd_set_symtab (abfd, ptrs, 1); + bfd_close (abfd); + return 0; + } + + ./makesym + nm foo + 00012345 A dummy_symbol + + Many formats cannot represent arbitrary symbol information; for +instance, the `a.out' object format does not allow an arbitrary number +of sections. A symbol pointing to a section which is not one of +`.text', `.data' or `.bss' cannot be described. + + +File: bfd.info, Node: Mini Symbols, Next: typedef asymbol, Prev: Writing Symbols, Up: Symbols + +2.7.3 Mini Symbols +------------------ + +Mini symbols provide read-only access to the symbol table. They use +less memory space, but require more time to access. They can be useful +for tools like nm or objdump, which may have to handle symbol tables of +extremely large executables. + + The `bfd_read_minisymbols' function will read the symbols into +memory in an internal form. It will return a `void *' pointer to a +block of memory, a symbol count, and the size of each symbol. The +pointer is allocated using `malloc', and should be freed by the caller +when it is no longer needed. + + The function `bfd_minisymbol_to_symbol' will take a pointer to a +minisymbol, and a pointer to a structure returned by +`bfd_make_empty_symbol', and return a `asymbol' structure. The return +value may or may not be the same as the value from +`bfd_make_empty_symbol' which was passed in. + + +File: bfd.info, Node: typedef asymbol, Next: symbol handling functions, Prev: Mini Symbols, Up: Symbols + +2.7.4 typedef asymbol +--------------------- + +An `asymbol' has the form: + + + typedef struct bfd_symbol + { + /* A pointer to the BFD which owns the symbol. This information + is necessary so that a back end can work out what additional + information (invisible to the application writer) is carried + with the symbol. + + This field is *almost* redundant, since you can use section->owner + instead, except that some symbols point to the global sections + bfd_{abs,com,und}_section. This could be fixed by making + these globals be per-bfd (or per-target-flavor). FIXME. */ + struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ + + /* The text of the symbol. The name is left alone, and not copied; the + application may not alter it. */ + const char *name; + + /* The value of the symbol. This really should be a union of a + numeric value with a pointer, since some flags indicate that + a pointer to another symbol is stored here. */ + symvalue value; + + /* Attributes of a symbol. */ + #define BSF_NO_FLAGS 0x00 + + /* The symbol has local scope; `static' in `C'. The value + is the offset into the section of the data. */ + #define BSF_LOCAL 0x01 + + /* The symbol has global scope; initialized data in `C'. The + value is the offset into the section of the data. */ + #define BSF_GLOBAL 0x02 + + /* The symbol has global scope and is exported. The value is + the offset into the section of the data. */ + #define BSF_EXPORT BSF_GLOBAL /* No real difference. */ + + /* A normal C symbol would be one of: + `BSF_LOCAL', `BSF_FORT_COMM', `BSF_UNDEFINED' or + `BSF_GLOBAL'. */ + + /* The symbol is a debugging record. The value has an arbitrary + meaning, unless BSF_DEBUGGING_RELOC is also set. */ + #define BSF_DEBUGGING 0x08 + + /* The symbol denotes a function entry point. Used in ELF, + perhaps others someday. */ + #define BSF_FUNCTION 0x10 + + /* Used by the linker. */ + #define BSF_KEEP 0x20 + #define BSF_KEEP_G 0x40 + + /* A weak global symbol, overridable without warnings by + a regular global symbol of the same name. */ + #define BSF_WEAK 0x80 + + /* This symbol was created to point to a section, e.g. ELF's + STT_SECTION symbols. */ + #define BSF_SECTION_SYM 0x100 + + /* The symbol used to be a common symbol, but now it is + allocated. */ + #define BSF_OLD_COMMON 0x200 + + /* The default value for common data. */ + #define BFD_FORT_COMM_DEFAULT_VALUE 0 + + /* In some files the type of a symbol sometimes alters its + location in an output file - ie in coff a `ISFCN' symbol + which is also `C_EXT' symbol appears where it was + declared and not at the end of a section. This bit is set + by the target BFD part to convey this information. */ + #define BSF_NOT_AT_END 0x400 + + /* Signal that the symbol is the label of constructor section. */ + #define BSF_CONSTRUCTOR 0x800 + + /* Signal that the symbol is a warning symbol. The name is a + warning. The name of the next symbol is the one to warn about; + if a reference is made to a symbol with the same name as the next + symbol, a warning is issued by the linker. */ + #define BSF_WARNING 0x1000 + + /* Signal that the symbol is indirect. This symbol is an indirect + pointer to the symbol with the same name as the next symbol. */ + #define BSF_INDIRECT 0x2000 + + /* BSF_FILE marks symbols that contain a file name. This is used + for ELF STT_FILE symbols. */ + #define BSF_FILE 0x4000 + + /* Symbol is from dynamic linking information. */ + #define BSF_DYNAMIC 0x8000 + + /* The symbol denotes a data object. Used in ELF, and perhaps + others someday. */ + #define BSF_OBJECT 0x10000 + + /* This symbol is a debugging symbol. The value is the offset + into the section of the data. BSF_DEBUGGING should be set + as well. */ + #define BSF_DEBUGGING_RELOC 0x20000 + + /* This symbol is thread local. Used in ELF. */ + #define BSF_THREAD_LOCAL 0x40000 + + flagword flags; + + /* A pointer to the section to which this symbol is + relative. This will always be non NULL, there are special + sections for undefined and absolute symbols. */ + struct bfd_section *section; + + /* Back end special data. */ + union + { + void *p; + bfd_vma i; + } + udata; + } + asymbol; + + +File: bfd.info, Node: symbol handling functions, Prev: typedef asymbol, Up: Symbols + +2.7.5 Symbol handling functions +------------------------------- + +2.7.5.1 `bfd_get_symtab_upper_bound' +.................................... + +*Description* +Return the number of bytes required to store a vector of pointers to +`asymbols' for all the symbols in the BFD ABFD, including a terminal +NULL pointer. If there are no symbols in the BFD, then return 0. If an +error occurs, return -1. + #define bfd_get_symtab_upper_bound(abfd) \ + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + +2.7.5.2 `bfd_is_local_label' +............................ + +*Synopsis* + bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); + *Description* +Return TRUE if the given symbol SYM in the BFD ABFD is a compiler +generated local label, else return FALSE. + +2.7.5.3 `bfd_is_local_label_name' +................................. + +*Synopsis* + bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); + *Description* +Return TRUE if a symbol with the name NAME in the BFD ABFD is a +compiler generated local label, else return FALSE. This just checks +whether the name has the form of a local label. + #define bfd_is_local_label_name(abfd, name) \ + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + +2.7.5.4 `bfd_is_target_special_symbol' +...................................... + +*Synopsis* + bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); + *Description* +Return TRUE iff a symbol SYM in the BFD ABFD is something special to +the particular target represented by the BFD. Such symbols should +normally not be mentioned to the user. + #define bfd_is_target_special_symbol(abfd, sym) \ + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + +2.7.5.5 `bfd_canonicalize_symtab' +................................. + +*Description* +Read the symbols from the BFD ABFD, and fills in the vector LOCATION +with pointers to the symbols and a trailing NULL. Return the actual +number of symbol pointers, not including the NULL. + #define bfd_canonicalize_symtab(abfd, location) \ + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + +2.7.5.6 `bfd_set_symtab' +........................ + +*Synopsis* + bfd_boolean bfd_set_symtab + (bfd *abfd, asymbol **location, unsigned int count); + *Description* +Arrange that when the output BFD ABFD is closed, the table LOCATION of +COUNT pointers to symbols will be written. + +2.7.5.7 `bfd_print_symbol_vandf' +................................ + +*Synopsis* + void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); + *Description* +Print the value and flags of the SYMBOL supplied to the stream FILE. + +2.7.5.8 `bfd_make_empty_symbol' +............................... + +*Description* +Create a new `asymbol' structure for the BFD ABFD and return a pointer +to it. + + This routine is necessary because each back end has private +information surrounding the `asymbol'. Building your own `asymbol' and +pointing to it will not create the private information, and will cause +problems later on. + #define bfd_make_empty_symbol(abfd) \ + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + +2.7.5.9 `_bfd_generic_make_empty_symbol' +........................................ + +*Synopsis* + asymbol *_bfd_generic_make_empty_symbol (bfd *); + *Description* +Create a new `asymbol' structure for the BFD ABFD and return a pointer +to it. Used by core file routines, binary back-end and anywhere else +where no private info is needed. + +2.7.5.10 `bfd_make_debug_symbol' +................................ + +*Description* +Create a new `asymbol' structure for the BFD ABFD, to be used as a +debugging symbol. Further details of its use have yet to be worked out. + #define bfd_make_debug_symbol(abfd,ptr,size) \ + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + +2.7.5.11 `bfd_decode_symclass' +.............................. + +*Description* +Return a character corresponding to the symbol class of SYMBOL, or '?' +for an unknown class. + + *Synopsis* + int bfd_decode_symclass (asymbol *symbol); + +2.7.5.12 `bfd_is_undefined_symclass' +.................................... + +*Description* +Returns non-zero if the class symbol returned by bfd_decode_symclass +represents an undefined symbol. Returns zero otherwise. + + *Synopsis* + bfd_boolean bfd_is_undefined_symclass (int symclass); + +2.7.5.13 `bfd_symbol_info' +.......................... + +*Description* +Fill in the basic info about symbol that nm needs. Additional info may +be added by the back-ends after calling this function. + + *Synopsis* + void bfd_symbol_info (asymbol *symbol, symbol_info *ret); + +2.7.5.14 `bfd_copy_private_symbol_data' +....................................... + +*Synopsis* + bfd_boolean bfd_copy_private_symbol_data + (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); + *Description* +Copy private symbol information from ISYM in the BFD IBFD to the symbol +OSYM in the BFD OBFD. Return `TRUE' on success, `FALSE' on error. +Possible error returns are: + + * `bfd_error_no_memory' - Not enough memory exists to create private + data for OSEC. + + #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) + + +File: bfd.info, Node: Archives, Next: Formats, Prev: Symbols, Up: BFD front end + +2.8 Archives +============ + +*Description* +An archive (or library) is just another BFD. It has a symbol table, +although there's not much a user program will do with it. + + The big difference between an archive BFD and an ordinary BFD is +that the archive doesn't have sections. Instead it has a chain of BFDs +that are considered its contents. These BFDs can be manipulated like +any other. The BFDs contained in an archive opened for reading will +all be opened for reading. You may put either input or output BFDs +into an archive opened for output; they will be handled correctly when +the archive is closed. + + Use `bfd_openr_next_archived_file' to step through the contents of +an archive opened for input. You don't have to read the entire archive +if you don't want to! Read it until you find what you want. + + Archive contents of output BFDs are chained through the `next' +pointer in a BFD. The first one is findable through the `archive_head' +slot of the archive. Set it with `bfd_set_archive_head' (q.v.). A +given BFD may be in only one open output archive at a time. + + As expected, the BFD archive code is more general than the archive +code of any given environment. BFD archives may contain files of +different formats (e.g., a.out and coff) and even different +architectures. You may even place archives recursively into archives! + + This can cause unexpected confusion, since some archive formats are +more expressive than others. For instance, Intel COFF archives can +preserve long filenames; SunOS a.out archives cannot. If you move a +file from the first to the second format and back again, the filename +may be truncated. Likewise, different a.out environments have different +conventions as to how they truncate filenames, whether they preserve +directory names in filenames, etc. When interoperating with native +tools, be sure your files are homogeneous. + + Beware: most of these formats do not react well to the presence of +spaces in filenames. We do the best we can, but can't always handle +this case due to restrictions in the format of archives. Many Unix +utilities are braindead in regards to spaces and such in filenames +anyway, so this shouldn't be much of a restriction. + + Archives are supported in BFD in `archive.c'. + +2.8.0.1 `bfd_get_next_mapent' +............................. + +*Synopsis* + symindex bfd_get_next_mapent + (bfd *abfd, symindex previous, carsym **sym); + *Description* +Step through archive ABFD's symbol table (if it has one). Successively +update SYM with the next symbol's information, returning that symbol's +(internal) index into the symbol table. + + Supply `BFD_NO_MORE_SYMBOLS' as the PREVIOUS entry to get the first +one; returns `BFD_NO_MORE_SYMBOLS' when you've already got the last one. + + A `carsym' is a canonical archive symbol. The only user-visible +element is its name, a null-terminated string. + +2.8.0.2 `bfd_set_archive_head' +.............................. + +*Synopsis* + bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); + *Description* +Set the head of the chain of BFDs contained in the archive OUTPUT to +NEW_HEAD. + +2.8.0.3 `bfd_openr_next_archived_file' +...................................... + +*Synopsis* + bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); + *Description* +Provided a BFD, ARCHIVE, containing an archive and NULL, open an input +BFD on the first contained element and returns that. Subsequent calls +should pass the archive and the previous return value to return a +created BFD to the next contained element. NULL is returned when there +are no more. + + +File: bfd.info, Node: Formats, Next: Relocations, Prev: Archives, Up: BFD front end + +2.9 File formats +================ + +A format is a BFD concept of high level file contents type. The formats +supported by BFD are: + + * `bfd_object' + The BFD may contain data, symbols, relocations and debug info. + + * `bfd_archive' + The BFD contains other BFDs and an optional index. + + * `bfd_core' + The BFD contains the result of an executable core dump. + +2.9.0.1 `bfd_check_format' +.......................... + +*Synopsis* + bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); + *Description* +Verify if the file attached to the BFD ABFD is compatible with the +format FORMAT (i.e., one of `bfd_object', `bfd_archive' or `bfd_core'). + + If the BFD has been set to a specific target before the call, only +the named target and format combination is checked. If the target has +not been set, or has been set to `default', then all the known target +backends is interrogated to determine a match. If the default target +matches, it is used. If not, exactly one target must recognize the +file, or an error results. + + The function returns `TRUE' on success, otherwise `FALSE' with one +of the following error codes: + + * `bfd_error_invalid_operation' - if `format' is not one of + `bfd_object', `bfd_archive' or `bfd_core'. + + * `bfd_error_system_call' - if an error occured during a read - even + some file mismatches can cause bfd_error_system_calls. + + * `file_not_recognised' - none of the backends recognised the file + format. + + * `bfd_error_file_ambiguously_recognized' - more than one backend + recognised the file format. + +2.9.0.2 `bfd_check_format_matches' +.................................. + +*Synopsis* + bfd_boolean bfd_check_format_matches + (bfd *abfd, bfd_format format, char ***matching); + *Description* +Like `bfd_check_format', except when it returns FALSE with `bfd_errno' +set to `bfd_error_file_ambiguously_recognized'. In that case, if +MATCHING is not NULL, it will be filled in with a NULL-terminated list +of the names of the formats that matched, allocated with `malloc'. +Then the user may choose a format and try again. + + When done with the list that MATCHING points to, the caller should +free it. + +2.9.0.3 `bfd_set_format' +........................ + +*Synopsis* + bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); + *Description* +This function sets the file format of the BFD ABFD to the format +FORMAT. If the target set in the BFD does not support the format +requested, the format is invalid, or the BFD is not open for writing, +then an error occurs. + +2.9.0.4 `bfd_format_string' +........................... + +*Synopsis* + const char *bfd_format_string (bfd_format format); + *Description* +Return a pointer to a const string `invalid', `object', `archive', +`core', or `unknown', depending upon the value of FORMAT. + + +File: bfd.info, Node: Relocations, Next: Core Files, Prev: Formats, Up: BFD front end + +2.10 Relocations +================ + +BFD maintains relocations in much the same way it maintains symbols: +they are left alone until required, then read in en-masse and +translated into an internal form. A common routine +`bfd_perform_relocation' acts upon the canonical form to do the fixup. + + Relocations are maintained on a per section basis, while symbols are +maintained on a per BFD basis. + + All that a back end has to do to fit the BFD interface is to create +a `struct reloc_cache_entry' for each relocation in a particular +section, and fill in the right bits of the structures. + +* Menu: + +* typedef arelent:: +* howto manager:: + + +File: bfd.info, Node: typedef arelent, Next: howto manager, Prev: Relocations, Up: Relocations + +2.10.1 typedef arelent +---------------------- + +This is the structure of a relocation entry: + + + typedef enum bfd_reloc_status + { + /* No errors detected. */ + bfd_reloc_ok, + + /* The relocation was performed, but there was an overflow. */ + bfd_reloc_overflow, + + /* The address to relocate was not within the section supplied. */ + bfd_reloc_outofrange, + + /* Used by special functions. */ + bfd_reloc_continue, + + /* Unsupported relocation size requested. */ + bfd_reloc_notsupported, + + /* Unused. */ + bfd_reloc_other, + + /* The symbol to relocate against was undefined. */ + bfd_reloc_undefined, + + /* The relocation was performed, but may not be ok - presently + generated only when linking i960 coff files with i960 b.out + symbols. If this type is returned, the error_message argument + to bfd_perform_relocation will be set. */ + bfd_reloc_dangerous + } + bfd_reloc_status_type; + + + typedef struct reloc_cache_entry + { + /* A pointer into the canonical table of pointers. */ + struct bfd_symbol **sym_ptr_ptr; + + /* offset in section. */ + bfd_size_type address; + + /* addend for relocation value. */ + bfd_vma addend; + + /* Pointer to how to perform the required relocation. */ + reloc_howto_type *howto; + + } + arelent; + *Description* +Here is a description of each of the fields within an `arelent': + + * `sym_ptr_ptr' + The symbol table pointer points to a pointer to the symbol +associated with the relocation request. It is the pointer into the +table returned by the back end's `canonicalize_symtab' action. *Note +Symbols::. The symbol is referenced through a pointer to a pointer so +that tools like the linker can fix up all the symbols of the same name +by modifying only one pointer. The relocation routine looks in the +symbol and uses the base of the section the symbol is attached to and +the value of the symbol as the initial relocation offset. If the symbol +pointer is zero, then the section provided is looked up. + + * `address' + The `address' field gives the offset in bytes from the base of the +section data which owns the relocation record to the first byte of +relocatable information. The actual data relocated will be relative to +this point; for example, a relocation type which modifies the bottom +two bytes of a four byte word would not touch the first byte pointed to +in a big endian world. + + * `addend' + The `addend' is a value provided by the back end to be added (!) to +the relocation offset. Its interpretation is dependent upon the howto. +For example, on the 68k the code: + + char foo[]; + main() + { + return foo[0x12345678]; + } + + Could be compiled into: + + linkw fp,#-4 + moveb @#12345678,d0 + extbl d0 + unlk fp + rts + + This could create a reloc pointing to `foo', but leave the offset in +the data, something like: + + RELOCATION RECORDS FOR [.text]: + offset type value + 00000006 32 _foo + + 00000000 4e56 fffc ; linkw fp,#-4 + 00000004 1039 1234 5678 ; moveb @#12345678,d0 + 0000000a 49c0 ; extbl d0 + 0000000c 4e5e ; unlk fp + 0000000e 4e75 ; rts + + Using coff and an 88k, some instructions don't have enough space in +them to represent the full address range, and pointers have to be +loaded in two parts. So you'd get something like: + + or.u r13,r0,hi16(_foo+0x12345678) + ld.b r2,r13,lo16(_foo+0x12345678) + jmp r1 + + This should create two relocs, both pointing to `_foo', and with +0x12340000 in their addend field. The data would consist of: + + RELOCATION RECORDS FOR [.text]: + offset type value + 00000002 HVRT16 _foo+0x12340000 + 00000006 LVRT16 _foo+0x12340000 + + 00000000 5da05678 ; or.u r13,r0,0x5678 + 00000004 1c4d5678 ; ld.b r2,r13,0x5678 + 00000008 f400c001 ; jmp r1 + + The relocation routine digs out the value from the data, adds it to +the addend to get the original offset, and then adds the value of +`_foo'. Note that all 32 bits have to be kept around somewhere, to cope +with carry from bit 15 to bit 16. + + One further example is the sparc and the a.out format. The sparc has +a similar problem to the 88k, in that some instructions don't have room +for an entire offset, but on the sparc the parts are created in odd +sized lumps. The designers of the a.out format chose to not use the +data within the section for storing part of the offset; all the offset +is kept within the reloc. Anything in the data should be ignored. + + save %sp,-112,%sp + sethi %hi(_foo+0x12345678),%g2 + ldsb [%g2+%lo(_foo+0x12345678)],%i0 + ret + restore + + Both relocs contain a pointer to `foo', and the offsets contain junk. + + RELOCATION RECORDS FOR [.text]: + offset type value + 00000004 HI22 _foo+0x12345678 + 00000008 LO10 _foo+0x12345678 + + 00000000 9de3bf90 ; save %sp,-112,%sp + 00000004 05000000 ; sethi %hi(_foo+0),%g2 + 00000008 f048a000 ; ldsb [%g2+%lo(_foo+0)],%i0 + 0000000c 81c7e008 ; ret + 00000010 81e80000 ; restore + + * `howto' + The `howto' field can be imagined as a relocation instruction. It is +a pointer to a structure which contains information on what to do with +all of the other information in the reloc record and data section. A +back end would normally have a relocation instruction set and turn +relocations into pointers to the correct structure on input - but it +would be possible to create each howto field on demand. + +2.10.1.1 `enum complain_overflow' +................................. + +Indicates what sort of overflow checking should be done when performing +a relocation. + + + enum complain_overflow + { + /* Do not complain on overflow. */ + complain_overflow_dont, + + /* Complain if the bitfield overflows, whether it is considered + as signed or unsigned. */ + complain_overflow_bitfield, + + /* Complain if the value overflows when considered as signed + number. */ + complain_overflow_signed, + + /* Complain if the value overflows when considered as an + unsigned number. */ + complain_overflow_unsigned + }; + +2.10.1.2 `reloc_howto_type' +........................... + +The `reloc_howto_type' is a structure which contains all the +information that libbfd needs to know to tie up a back end's data. + + struct bfd_symbol; /* Forward declaration. */ + + struct reloc_howto_struct + { + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's + external idea of what a reloc number is stored + in this field. For example, a PC relative word relocation + in a coff environment has the type 023 - because that's + what the outside world calls a R_PCRWORD reloc. */ + unsigned int type; + + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift; + + /* The size of the item to be relocated. This is *not* a + power-of-two measure. To get the number of bytes operated + on by a type of relocation, use bfd_get_reloc_size. */ + int size; + + /* The number of bits in the item to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize; + + /* Notes that the relocation is relative to the location in the + data section of the addend. The relocation function will + subtract from the relocation value the address of the location + being relocated. */ + bfd_boolean pc_relative; + + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos; + + /* What type of overflow error should be checked for when + relocating. */ + enum complain_overflow complain_on_overflow; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated (e.g., i960 callj + instructions). */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + char *name; + + /* Some formats record a relocation addend in the section contents + rather than with the relocation. For ELF formats this is the + distinction between USE_REL and USE_RELA (though the code checks + for USE_REL == 1/0). The value of this field is TRUE if the + addend is recorded with the section contents; when performing a + partial link (ld -r) the section contents (the data) will be + modified. The value of this field is FALSE if addends are + recorded with the relocation (in arelent.addend); when performing + a partial link the relocation will be modified. + All relocations for all ELF USE_RELA targets should set this field + to FALSE (values of TRUE should be looked on with suspicion). + However, the converse is not true: not all relocations of all ELF + USE_REL targets set this field to TRUE. Why this is so is peculiar + to each particular target. For relocs that aren't used in partial + links (e.g. GOT stuff) it doesn't matter what this is set to. */ + bfd_boolean partial_inplace; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should be zero. Non-zero values for ELF USE_RELA targets are + bogus as in those cases the value in the dst_mask part of the + section contents should be treated as garbage. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* When some formats create PC relative instructions, they leave + the value of the pc of the place being relocated in the offset + slot of the instruction, so that a PC relative relocation can + be made just by adding in an ordinary offset (e.g., sun3 a.out). + Some formats leave the displacement part of an instruction + empty (e.g., m88k bcs); this flag signals the fact. */ + bfd_boolean pcrel_offset; + }; + +2.10.1.3 `The HOWTO Macro' +.......................... + +*Description* +The HOWTO define is horrible and will go away. + #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ + { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } + + *Description* +And will be replaced with the totally magic way. But for the moment, we +are compatible, so do it this way. + #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ + HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ + NAME, FALSE, 0, 0, IN) + + *Description* +This is used to fill in an empty howto entry in an array. + #define EMPTY_HOWTO(C) \ + HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ + NULL, FALSE, 0, 0, FALSE) + + *Description* +Helper routine to turn a symbol into a relocation value. + #define HOWTO_PREPARE(relocation, symbol) \ + { \ + if (symbol != NULL) \ + { \ + if (bfd_is_com_section (symbol->section)) \ + { \ + relocation = 0; \ + } \ + else \ + { \ + relocation = symbol->value; \ + } \ + } \ + } + +2.10.1.4 `bfd_get_reloc_size' +............................. + +*Synopsis* + unsigned int bfd_get_reloc_size (reloc_howto_type *); + *Description* +For a reloc_howto_type that operates on a fixed number of bytes, this +returns the number of bytes operated on. + +2.10.1.5 `arelent_chain' +........................ + +*Description* +How relocs are tied together in an `asection': + typedef struct relent_chain + { + arelent relent; + struct relent_chain *next; + } + arelent_chain; + +2.10.1.6 `bfd_check_overflow' +............................. + +*Synopsis* + bfd_reloc_status_type bfd_check_overflow + (enum complain_overflow how, + unsigned int bitsize, + unsigned int rightshift, + unsigned int addrsize, + bfd_vma relocation); + *Description* +Perform overflow checking on RELOCATION which has BITSIZE significant +bits and will be shifted right by RIGHTSHIFT bits, on a machine with +addresses containing ADDRSIZE significant bits. The result is either of +`bfd_reloc_ok' or `bfd_reloc_overflow'. + +2.10.1.7 `bfd_perform_relocation' +................................. + +*Synopsis* + bfd_reloc_status_type bfd_perform_relocation + (bfd *abfd, + arelent *reloc_entry, + void *data, + asection *input_section, + bfd *output_bfd, + char **error_message); + *Description* +If OUTPUT_BFD is supplied to this function, the generated image will be +relocatable; the relocations are copied to the output file after they +have been changed to reflect the new state of the world. There are two +ways of reflecting the results of partial linkage in an output file: by +modifying the output data in place, and by modifying the relocation +record. Some native formats (e.g., basic a.out and basic coff) have no +way of specifying an addend in the relocation type, so the addend has +to go in the output data. This is no big deal since in these formats +the output data slot will always be big enough for the addend. Complex +reloc types with addends were invented to solve just this problem. The +ERROR_MESSAGE argument is set to an error message if this return +`bfd_reloc_dangerous'. + +2.10.1.8 `bfd_install_relocation' +................................. + +*Synopsis* + bfd_reloc_status_type bfd_install_relocation + (bfd *abfd, + arelent *reloc_entry, + void *data, bfd_vma data_start, + asection *input_section, + char **error_message); + *Description* +This looks remarkably like `bfd_perform_relocation', except it does not +expect that the section contents have been filled in. I.e., it's +suitable for use when creating, rather than applying a relocation. + + For now, this function should be considered reserved for the +assembler. + + +File: bfd.info, Node: howto manager, Prev: typedef arelent, Up: Relocations + +2.11 The howto manager +====================== + +When an application wants to create a relocation, but doesn't know what +the target machine might call it, it can find out by using this bit of +code. + +2.11.0.1 `bfd_reloc_code_type' +.............................. + +*Description* +The insides of a reloc code. The idea is that, eventually, there will +be one enumerator for every type of relocation we ever do. Pass one of +these values to `bfd_reloc_type_lookup', and it'll return a howto +pointer. + + This does mean that the application must determine the correct +enumerator value; you can't get a howto pointer from a random set of +attributes. + + Here are the possible values for `enum bfd_reloc_code_real': + + -- : BFD_RELOC_64 + -- : BFD_RELOC_32 + -- : BFD_RELOC_26 + -- : BFD_RELOC_24 + -- : BFD_RELOC_16 + -- : BFD_RELOC_14 + -- : BFD_RELOC_8 + Basic absolute relocations of N bits. + + -- : BFD_RELOC_64_PCREL + -- : BFD_RELOC_32_PCREL + -- : BFD_RELOC_24_PCREL + -- : BFD_RELOC_16_PCREL + -- : BFD_RELOC_12_PCREL + -- : BFD_RELOC_8_PCREL + PC-relative relocations. Sometimes these are relative to the + address of the relocation itself; sometimes they are relative to + the start of the section containing the relocation. It depends on + the specific target. + + The 24-bit relocation is used in some Intel 960 configurations. + + -- : BFD_RELOC_32_SECREL + Section relative relocations. Some targets need this for DWARF2. + + -- : BFD_RELOC_32_GOT_PCREL + -- : BFD_RELOC_16_GOT_PCREL + -- : BFD_RELOC_8_GOT_PCREL + -- : BFD_RELOC_32_GOTOFF + -- : BFD_RELOC_16_GOTOFF + -- : BFD_RELOC_LO16_GOTOFF + -- : BFD_RELOC_HI16_GOTOFF + -- : BFD_RELOC_HI16_S_GOTOFF + -- : BFD_RELOC_8_GOTOFF + -- : BFD_RELOC_64_PLT_PCREL + -- : BFD_RELOC_32_PLT_PCREL + -- : BFD_RELOC_24_PLT_PCREL + -- : BFD_RELOC_16_PLT_PCREL + -- : BFD_RELOC_8_PLT_PCREL + -- : BFD_RELOC_64_PLTOFF + -- : BFD_RELOC_32_PLTOFF + -- : BFD_RELOC_16_PLTOFF + -- : BFD_RELOC_LO16_PLTOFF + -- : BFD_RELOC_HI16_PLTOFF + -- : BFD_RELOC_HI16_S_PLTOFF + -- : BFD_RELOC_8_PLTOFF + For ELF. + + -- : BFD_RELOC_68K_GLOB_DAT + -- : BFD_RELOC_68K_JMP_SLOT + -- : BFD_RELOC_68K_RELATIVE + Relocations used by 68K ELF. + + -- : BFD_RELOC_32_BASEREL + -- : BFD_RELOC_16_BASEREL + -- : BFD_RELOC_LO16_BASEREL + -- : BFD_RELOC_HI16_BASEREL + -- : BFD_RELOC_HI16_S_BASEREL + -- : BFD_RELOC_8_BASEREL + -- : BFD_RELOC_RVA + Linkage-table relative. + + -- : BFD_RELOC_8_FFnn + Absolute 8-bit relocation, but used to form an address like 0xFFnn. + + -- : BFD_RELOC_32_PCREL_S2 + -- : BFD_RELOC_16_PCREL_S2 + -- : BFD_RELOC_23_PCREL_S2 + These PC-relative relocations are stored as word displacements - + i.e., byte displacements shifted right two bits. The 30-bit word + displacement (<<32_PCREL_S2>> - 32 bits, shifted 2) is used on the + SPARC. (SPARC tools generally refer to this as <>.) The + signed 16-bit displacement is used on the MIPS, and the 23-bit + displacement is used on the Alpha. + + -- : BFD_RELOC_HI22 + -- : BFD_RELOC_LO10 + High 22 bits and low 10 bits of 32-bit value, placed into lower + bits of the target word. These are used on the SPARC. + + -- : BFD_RELOC_GPREL16 + -- : BFD_RELOC_GPREL32 + For systems that allocate a Global Pointer register, these are + displacements off that register. These relocation types are + handled specially, because the value the register will have is + decided relatively late. + + -- : BFD_RELOC_I960_CALLJ + Reloc types used for i960/b.out. + + -- : BFD_RELOC_NONE + -- : BFD_RELOC_SPARC_WDISP22 + -- : BFD_RELOC_SPARC22 + -- : BFD_RELOC_SPARC13 + -- : BFD_RELOC_SPARC_GOT10 + -- : BFD_RELOC_SPARC_GOT13 + -- : BFD_RELOC_SPARC_GOT22 + -- : BFD_RELOC_SPARC_PC10 + -- : BFD_RELOC_SPARC_PC22 + -- : BFD_RELOC_SPARC_WPLT30 + -- : BFD_RELOC_SPARC_COPY + -- : BFD_RELOC_SPARC_GLOB_DAT + -- : BFD_RELOC_SPARC_JMP_SLOT + -- : BFD_RELOC_SPARC_RELATIVE + -- : BFD_RELOC_SPARC_UA16 + -- : BFD_RELOC_SPARC_UA32 + -- : BFD_RELOC_SPARC_UA64 + SPARC ELF relocations. There is probably some overlap with other + relocation types already defined. + + -- : BFD_RELOC_SPARC_BASE13 + -- : BFD_RELOC_SPARC_BASE22 + I think these are specific to SPARC a.out (e.g., Sun 4). + + -- : BFD_RELOC_SPARC_64 + -- : BFD_RELOC_SPARC_10 + -- : BFD_RELOC_SPARC_11 + -- : BFD_RELOC_SPARC_OLO10 + -- : BFD_RELOC_SPARC_HH22 + -- : BFD_RELOC_SPARC_HM10 + -- : BFD_RELOC_SPARC_LM22 + -- : BFD_RELOC_SPARC_PC_HH22 + -- : BFD_RELOC_SPARC_PC_HM10 + -- : BFD_RELOC_SPARC_PC_LM22 + -- : BFD_RELOC_SPARC_WDISP16 + -- : BFD_RELOC_SPARC_WDISP19 + -- : BFD_RELOC_SPARC_7 + -- : BFD_RELOC_SPARC_6 + -- : BFD_RELOC_SPARC_5 + -- : BFD_RELOC_SPARC_DISP64 + -- : BFD_RELOC_SPARC_PLT32 + -- : BFD_RELOC_SPARC_PLT64 + -- : BFD_RELOC_SPARC_HIX22 + -- : BFD_RELOC_SPARC_LOX10 + -- : BFD_RELOC_SPARC_H44 + -- : BFD_RELOC_SPARC_M44 + -- : BFD_RELOC_SPARC_L44 + -- : BFD_RELOC_SPARC_REGISTER + SPARC64 relocations + + -- : BFD_RELOC_SPARC_REV32 + SPARC little endian relocation + + -- : BFD_RELOC_SPARC_TLS_GD_HI22 + -- : BFD_RELOC_SPARC_TLS_GD_LO10 + -- : BFD_RELOC_SPARC_TLS_GD_ADD + -- : BFD_RELOC_SPARC_TLS_GD_CALL + -- : BFD_RELOC_SPARC_TLS_LDM_HI22 + -- : BFD_RELOC_SPARC_TLS_LDM_LO10 + -- : BFD_RELOC_SPARC_TLS_LDM_ADD + -- : BFD_RELOC_SPARC_TLS_LDM_CALL + -- : BFD_RELOC_SPARC_TLS_LDO_HIX22 + -- : BFD_RELOC_SPARC_TLS_LDO_LOX10 + -- : BFD_RELOC_SPARC_TLS_LDO_ADD + -- : BFD_RELOC_SPARC_TLS_IE_HI22 + -- : BFD_RELOC_SPARC_TLS_IE_LO10 + -- : BFD_RELOC_SPARC_TLS_IE_LD + -- : BFD_RELOC_SPARC_TLS_IE_LDX + -- : BFD_RELOC_SPARC_TLS_IE_ADD + -- : BFD_RELOC_SPARC_TLS_LE_HIX22 + -- : BFD_RELOC_SPARC_TLS_LE_LOX10 + -- : BFD_RELOC_SPARC_TLS_DTPMOD32 + -- : BFD_RELOC_SPARC_TLS_DTPMOD64 + -- : BFD_RELOC_SPARC_TLS_DTPOFF32 + -- : BFD_RELOC_SPARC_TLS_DTPOFF64 + -- : BFD_RELOC_SPARC_TLS_TPOFF32 + -- : BFD_RELOC_SPARC_TLS_TPOFF64 + SPARC TLS relocations + + -- : BFD_RELOC_ALPHA_GPDISP_HI16 + Alpha ECOFF and ELF relocations. Some of these treat the symbol or + "addend" in some special way. For GPDISP_HI16 ("gpdisp") + relocations, the symbol is ignored when writing; when reading, it + will be the absolute section symbol. The addend is the + displacement in bytes of the "lda" instruction from the "ldah" + instruction (which is at the address of this reloc). + + -- : BFD_RELOC_ALPHA_GPDISP_LO16 + For GPDISP_LO16 ("ignore") relocations, the symbol is handled as + with GPDISP_HI16 relocs. The addend is ignored when writing the + relocations out, and is filled in with the file's GP value on + reading, for convenience. + + -- : BFD_RELOC_ALPHA_GPDISP + The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 + relocation except that there is no accompanying GPDISP_LO16 + relocation. + + -- : BFD_RELOC_ALPHA_LITERAL + -- : BFD_RELOC_ALPHA_ELF_LITERAL + -- : BFD_RELOC_ALPHA_LITUSE + The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; + the assembler turns it into a LDQ instruction to load the address + of the symbol, and then fills in a register in the real + instruction. + + The LITERAL reloc, at the LDQ instruction, refers to the .lita + section symbol. The addend is ignored when writing, but is filled + in with the file's GP value on reading, for convenience, as with + the GPDISP_LO16 reloc. + + The ELF_LITERAL reloc is somewhere between 16_GOTOFF and + GPDISP_LO16. It should refer to the symbol to be referenced, as + with 16_GOTOFF, but it generates output not based on the position + within the .got section, but relative to the GP value chosen for + the file during the final link stage. + + The LITUSE reloc, on the instruction using the loaded address, + gives information to the linker that it might be able to use to + optimize away some literal section references. The symbol is + ignored (read as the absolute section symbol), and the "addend" + indicates the type of instruction using the register: 1 - "memory" + fmt insn 2 - byte-manipulation (byte offset reg) 3 - jsr (target + of branch) + + -- : BFD_RELOC_ALPHA_HINT + The HINT relocation indicates a value that should be filled into + the "hint" field of a jmp/jsr/ret instruction, for possible branch- + prediction logic which may be provided on some processors. + + -- : BFD_RELOC_ALPHA_LINKAGE + The LINKAGE relocation outputs a linkage pair in the object file, + which is filled by the linker. + + -- : BFD_RELOC_ALPHA_CODEADDR + The CODEADDR relocation outputs a STO_CA in the object file, which + is filled by the linker. + + -- : BFD_RELOC_ALPHA_GPREL_HI16 + -- : BFD_RELOC_ALPHA_GPREL_LO16 + The GPREL_HI/LO relocations together form a 32-bit offset from the + GP register. + + -- : BFD_RELOC_ALPHA_BRSGP + Like BFD_RELOC_23_PCREL_S2, except that the source and target must + share a common GP, and the target address is adjusted for + STO_ALPHA_STD_GPLOAD. + + -- : BFD_RELOC_ALPHA_TLSGD + -- : BFD_RELOC_ALPHA_TLSLDM + -- : BFD_RELOC_ALPHA_DTPMOD64 + -- : BFD_RELOC_ALPHA_GOTDTPREL16 + -- : BFD_RELOC_ALPHA_DTPREL64 + -- : BFD_RELOC_ALPHA_DTPREL_HI16 + -- : BFD_RELOC_ALPHA_DTPREL_LO16 + -- : BFD_RELOC_ALPHA_DTPREL16 + -- : BFD_RELOC_ALPHA_GOTTPREL16 + -- : BFD_RELOC_ALPHA_TPREL64 + -- : BFD_RELOC_ALPHA_TPREL_HI16 + -- : BFD_RELOC_ALPHA_TPREL_LO16 + -- : BFD_RELOC_ALPHA_TPREL16 + Alpha thread-local storage relocations. + + -- : BFD_RELOC_MIPS_JMP + Bits 27..2 of the relocation address shifted right 2 bits; simple + reloc otherwise. + + -- : BFD_RELOC_MIPS16_JMP + The MIPS16 jump instruction. + + -- : BFD_RELOC_MIPS16_GPREL + MIPS16 GP relative reloc. + + -- : BFD_RELOC_HI16 + High 16 bits of 32-bit value; simple reloc. + + -- : BFD_RELOC_HI16_S + High 16 bits of 32-bit value but the low 16 bits will be sign + extended and added to form the final result. If the low 16 bits + form a negative number, we need to add one to the high value to + compensate for the borrow when the low bits are added. + + -- : BFD_RELOC_LO16 + Low 16 bits. + + -- : BFD_RELOC_MIPS_LITERAL + Relocation against a MIPS literal section. + + -- : BFD_RELOC_MIPS_GOT16 + -- : BFD_RELOC_MIPS_CALL16 + -- : BFD_RELOC_MIPS_GOT_HI16 + -- : BFD_RELOC_MIPS_GOT_LO16 + -- : BFD_RELOC_MIPS_CALL_HI16 + -- : BFD_RELOC_MIPS_CALL_LO16 + -- : BFD_RELOC_MIPS_SUB + -- : BFD_RELOC_MIPS_GOT_PAGE + -- : BFD_RELOC_MIPS_GOT_OFST + -- : BFD_RELOC_MIPS_GOT_DISP + -- : BFD_RELOC_MIPS_SHIFT5 + -- : BFD_RELOC_MIPS_SHIFT6 + -- : BFD_RELOC_MIPS_INSERT_A + -- : BFD_RELOC_MIPS_INSERT_B + -- : BFD_RELOC_MIPS_DELETE + -- : BFD_RELOC_MIPS_HIGHEST + -- : BFD_RELOC_MIPS_HIGHER + -- : BFD_RELOC_MIPS_SCN_DISP + -- : BFD_RELOC_MIPS_REL16 + -- : BFD_RELOC_MIPS_RELGOT + -- : BFD_RELOC_MIPS_JALR + MIPS ELF relocations. + + -- : BFD_RELOC_FRV_LABEL16 + -- : BFD_RELOC_FRV_LABEL24 + -- : BFD_RELOC_FRV_LO16 + -- : BFD_RELOC_FRV_HI16 + -- : BFD_RELOC_FRV_GPREL12 + -- : BFD_RELOC_FRV_GPRELU12 + -- : BFD_RELOC_FRV_GPREL32 + -- : BFD_RELOC_FRV_GPRELHI + -- : BFD_RELOC_FRV_GPRELLO + -- : BFD_RELOC_FRV_GOT12 + -- : BFD_RELOC_FRV_GOTHI + -- : BFD_RELOC_FRV_GOTLO + -- : BFD_RELOC_FRV_FUNCDESC + -- : BFD_RELOC_FRV_FUNCDESC_GOT12 + -- : BFD_RELOC_FRV_FUNCDESC_GOTHI + -- : BFD_RELOC_FRV_FUNCDESC_GOTLO + -- : BFD_RELOC_FRV_FUNCDESC_VALUE + -- : BFD_RELOC_FRV_FUNCDESC_GOTOFF12 + -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFHI + -- : BFD_RELOC_FRV_FUNCDESC_GOTOFFLO + -- : BFD_RELOC_FRV_GOTOFF12 + -- : BFD_RELOC_FRV_GOTOFFHI + -- : BFD_RELOC_FRV_GOTOFFLO + Fujitsu Frv Relocations. + + -- : BFD_RELOC_MN10300_GOTOFF24 + This is a 24bit GOT-relative reloc for the mn10300. + + -- : BFD_RELOC_MN10300_GOT32 + This is a 32bit GOT-relative reloc for the mn10300, offset by two + bytes in the instruction. + + -- : BFD_RELOC_MN10300_GOT24 + This is a 24bit GOT-relative reloc for the mn10300, offset by two + bytes in the instruction. + + -- : BFD_RELOC_MN10300_GOT16 + This is a 16bit GOT-relative reloc for the mn10300, offset by two + bytes in the instruction. + + -- : BFD_RELOC_MN10300_COPY + Copy symbol at runtime. + + -- : BFD_RELOC_MN10300_GLOB_DAT + Create GOT entry. + + -- : BFD_RELOC_MN10300_JMP_SLOT + Create PLT entry. + + -- : BFD_RELOC_MN10300_RELATIVE + Adjust by program base. + + -- : BFD_RELOC_386_GOT32 + -- : BFD_RELOC_386_PLT32 + -- : BFD_RELOC_386_COPY + -- : BFD_RELOC_386_GLOB_DAT + -- : BFD_RELOC_386_JUMP_SLOT + -- : BFD_RELOC_386_RELATIVE + -- : BFD_RELOC_386_GOTOFF + -- : BFD_RELOC_386_GOTPC + -- : BFD_RELOC_386_TLS_TPOFF + -- : BFD_RELOC_386_TLS_IE + -- : BFD_RELOC_386_TLS_GOTIE + -- : BFD_RELOC_386_TLS_LE + -- : BFD_RELOC_386_TLS_GD + -- : BFD_RELOC_386_TLS_LDM + -- : BFD_RELOC_386_TLS_LDO_32 + -- : BFD_RELOC_386_TLS_IE_32 + -- : BFD_RELOC_386_TLS_LE_32 + -- : BFD_RELOC_386_TLS_DTPMOD32 + -- : BFD_RELOC_386_TLS_DTPOFF32 + -- : BFD_RELOC_386_TLS_TPOFF32 + i386/elf relocations + + -- : BFD_RELOC_X86_64_GOT32 + -- : BFD_RELOC_X86_64_PLT32 + -- : BFD_RELOC_X86_64_COPY + -- : BFD_RELOC_X86_64_GLOB_DAT + -- : BFD_RELOC_X86_64_JUMP_SLOT + -- : BFD_RELOC_X86_64_RELATIVE + -- : BFD_RELOC_X86_64_GOTPCREL + -- : BFD_RELOC_X86_64_32S + -- : BFD_RELOC_X86_64_DTPMOD64 + -- : BFD_RELOC_X86_64_DTPOFF64 + -- : BFD_RELOC_X86_64_TPOFF64 + -- : BFD_RELOC_X86_64_TLSGD + -- : BFD_RELOC_X86_64_TLSLD + -- : BFD_RELOC_X86_64_DTPOFF32 + -- : BFD_RELOC_X86_64_GOTTPOFF + -- : BFD_RELOC_X86_64_TPOFF32 + x86-64/elf relocations + + -- : BFD_RELOC_NS32K_IMM_8 + -- : BFD_RELOC_NS32K_IMM_16 + -- : BFD_RELOC_NS32K_IMM_32 + -- : BFD_RELOC_NS32K_IMM_8_PCREL + -- : BFD_RELOC_NS32K_IMM_16_PCREL + -- : BFD_RELOC_NS32K_IMM_32_PCREL + -- : BFD_RELOC_NS32K_DISP_8 + -- : BFD_RELOC_NS32K_DISP_16 + -- : BFD_RELOC_NS32K_DISP_32 + -- : BFD_RELOC_NS32K_DISP_8_PCREL + -- : BFD_RELOC_NS32K_DISP_16_PCREL + -- : BFD_RELOC_NS32K_DISP_32_PCREL + ns32k relocations + + -- : BFD_RELOC_PDP11_DISP_8_PCREL + -- : BFD_RELOC_PDP11_DISP_6_PCREL + PDP11 relocations + + -- : BFD_RELOC_PJ_CODE_HI16 + -- : BFD_RELOC_PJ_CODE_LO16 + -- : BFD_RELOC_PJ_CODE_DIR16 + -- : BFD_RELOC_PJ_CODE_DIR32 + -- : BFD_RELOC_PJ_CODE_REL16 + -- : BFD_RELOC_PJ_CODE_REL32 + Picojava relocs. Not all of these appear in object files. + + -- : BFD_RELOC_PPC_B26 + -- : BFD_RELOC_PPC_BA26 + -- : BFD_RELOC_PPC_TOC16 + -- : BFD_RELOC_PPC_B16 + -- : BFD_RELOC_PPC_B16_BRTAKEN + -- : BFD_RELOC_PPC_B16_BRNTAKEN + -- : BFD_RELOC_PPC_BA16 + -- : BFD_RELOC_PPC_BA16_BRTAKEN + -- : BFD_RELOC_PPC_BA16_BRNTAKEN + -- : BFD_RELOC_PPC_COPY + -- : BFD_RELOC_PPC_GLOB_DAT + -- : BFD_RELOC_PPC_JMP_SLOT + -- : BFD_RELOC_PPC_RELATIVE + -- : BFD_RELOC_PPC_LOCAL24PC + -- : BFD_RELOC_PPC_EMB_NADDR32 + -- : BFD_RELOC_PPC_EMB_NADDR16 + -- : BFD_RELOC_PPC_EMB_NADDR16_LO + -- : BFD_RELOC_PPC_EMB_NADDR16_HI + -- : BFD_RELOC_PPC_EMB_NADDR16_HA + -- : BFD_RELOC_PPC_EMB_SDAI16 + -- : BFD_RELOC_PPC_EMB_SDA2I16 + -- : BFD_RELOC_PPC_EMB_SDA2REL + -- : BFD_RELOC_PPC_EMB_SDA21 + -- : BFD_RELOC_PPC_EMB_MRKREF + -- : BFD_RELOC_PPC_EMB_RELSEC16 + -- : BFD_RELOC_PPC_EMB_RELST_LO + -- : BFD_RELOC_PPC_EMB_RELST_HI + -- : BFD_RELOC_PPC_EMB_RELST_HA + -- : BFD_RELOC_PPC_EMB_BIT_FLD + -- : BFD_RELOC_PPC_EMB_RELSDA + -- : BFD_RELOC_PPC64_HIGHER + -- : BFD_RELOC_PPC64_HIGHER_S + -- : BFD_RELOC_PPC64_HIGHEST + -- : BFD_RELOC_PPC64_HIGHEST_S + -- : BFD_RELOC_PPC64_TOC16_LO + -- : BFD_RELOC_PPC64_TOC16_HI + -- : BFD_RELOC_PPC64_TOC16_HA + -- : BFD_RELOC_PPC64_TOC + -- : BFD_RELOC_PPC64_PLTGOT16 + -- : BFD_RELOC_PPC64_PLTGOT16_LO + -- : BFD_RELOC_PPC64_PLTGOT16_HI + -- : BFD_RELOC_PPC64_PLTGOT16_HA + -- : BFD_RELOC_PPC64_ADDR16_DS + -- : BFD_RELOC_PPC64_ADDR16_LO_DS + -- : BFD_RELOC_PPC64_GOT16_DS + -- : BFD_RELOC_PPC64_GOT16_LO_DS + -- : BFD_RELOC_PPC64_PLT16_LO_DS + -- : BFD_RELOC_PPC64_SECTOFF_DS + -- : BFD_RELOC_PPC64_SECTOFF_LO_DS + -- : BFD_RELOC_PPC64_TOC16_DS + -- : BFD_RELOC_PPC64_TOC16_LO_DS + -- : BFD_RELOC_PPC64_PLTGOT16_DS + -- : BFD_RELOC_PPC64_PLTGOT16_LO_DS + Power(rs6000) and PowerPC relocations. + + -- : BFD_RELOC_PPC_TLS + -- : BFD_RELOC_PPC_DTPMOD + -- : BFD_RELOC_PPC_TPREL16 + -- : BFD_RELOC_PPC_TPREL16_LO + -- : BFD_RELOC_PPC_TPREL16_HI + -- : BFD_RELOC_PPC_TPREL16_HA + -- : BFD_RELOC_PPC_TPREL + -- : BFD_RELOC_PPC_DTPREL16 + -- : BFD_RELOC_PPC_DTPREL16_LO + -- : BFD_RELOC_PPC_DTPREL16_HI + -- : BFD_RELOC_PPC_DTPREL16_HA + -- : BFD_RELOC_PPC_DTPREL + -- : BFD_RELOC_PPC_GOT_TLSGD16 + -- : BFD_RELOC_PPC_GOT_TLSGD16_LO + -- : BFD_RELOC_PPC_GOT_TLSGD16_HI + -- : BFD_RELOC_PPC_GOT_TLSGD16_HA + -- : BFD_RELOC_PPC_GOT_TLSLD16 + -- : BFD_RELOC_PPC_GOT_TLSLD16_LO + -- : BFD_RELOC_PPC_GOT_TLSLD16_HI + -- : BFD_RELOC_PPC_GOT_TLSLD16_HA + -- : BFD_RELOC_PPC_GOT_TPREL16 + -- : BFD_RELOC_PPC_GOT_TPREL16_LO + -- : BFD_RELOC_PPC_GOT_TPREL16_HI + -- : BFD_RELOC_PPC_GOT_TPREL16_HA + -- : BFD_RELOC_PPC_GOT_DTPREL16 + -- : BFD_RELOC_PPC_GOT_DTPREL16_LO + -- : BFD_RELOC_PPC_GOT_DTPREL16_HI + -- : BFD_RELOC_PPC_GOT_DTPREL16_HA + -- : BFD_RELOC_PPC64_TPREL16_DS + -- : BFD_RELOC_PPC64_TPREL16_LO_DS + -- : BFD_RELOC_PPC64_TPREL16_HIGHER + -- : BFD_RELOC_PPC64_TPREL16_HIGHERA + -- : BFD_RELOC_PPC64_TPREL16_HIGHEST + -- : BFD_RELOC_PPC64_TPREL16_HIGHESTA + -- : BFD_RELOC_PPC64_DTPREL16_DS + -- : BFD_RELOC_PPC64_DTPREL16_LO_DS + -- : BFD_RELOC_PPC64_DTPREL16_HIGHER + -- : BFD_RELOC_PPC64_DTPREL16_HIGHERA + -- : BFD_RELOC_PPC64_DTPREL16_HIGHEST + -- : BFD_RELOC_PPC64_DTPREL16_HIGHESTA + PowerPC and PowerPC64 thread-local storage relocations. + + -- : BFD_RELOC_I370_D12 + IBM 370/390 relocations + + -- : BFD_RELOC_CTOR + The type of reloc used to build a constructor table - at the moment + probably a 32 bit wide absolute relocation, but the target can + choose. It generally does map to one of the other relocation + types. + + -- : BFD_RELOC_ARM_PCREL_BRANCH + ARM 26 bit pc-relative branch. The lowest two bits must be zero + and are not stored in the instruction. + + -- : BFD_RELOC_ARM_PCREL_BLX + ARM 26 bit pc-relative branch. The lowest bit must be zero and is + not stored in the instruction. The 2nd lowest bit comes from a 1 + bit field in the instruction. + + -- : BFD_RELOC_THUMB_PCREL_BLX + Thumb 22 bit pc-relative branch. The lowest bit must be zero and + is not stored in the instruction. The 2nd lowest bit comes from a + 1 bit field in the instruction. + + -- : BFD_RELOC_ARM_IMMEDIATE + -- : BFD_RELOC_ARM_ADRL_IMMEDIATE + -- : BFD_RELOC_ARM_OFFSET_IMM + -- : BFD_RELOC_ARM_SHIFT_IMM + -- : BFD_RELOC_ARM_SMI + -- : BFD_RELOC_ARM_SWI + -- : BFD_RELOC_ARM_MULTI + -- : BFD_RELOC_ARM_CP_OFF_IMM + -- : BFD_RELOC_ARM_CP_OFF_IMM_S2 + -- : BFD_RELOC_ARM_ADR_IMM + -- : BFD_RELOC_ARM_LDR_IMM + -- : BFD_RELOC_ARM_LITERAL + -- : BFD_RELOC_ARM_IN_POOL + -- : BFD_RELOC_ARM_OFFSET_IMM8 + -- : BFD_RELOC_ARM_HWLITERAL + -- : BFD_RELOC_ARM_THUMB_ADD + -- : BFD_RELOC_ARM_THUMB_IMM + -- : BFD_RELOC_ARM_THUMB_SHIFT + -- : BFD_RELOC_ARM_THUMB_OFFSET + -- : BFD_RELOC_ARM_GOT12 + -- : BFD_RELOC_ARM_GOT32 + -- : BFD_RELOC_ARM_JUMP_SLOT + -- : BFD_RELOC_ARM_COPY + -- : BFD_RELOC_ARM_GLOB_DAT + -- : BFD_RELOC_ARM_PLT32 + -- : BFD_RELOC_ARM_RELATIVE + -- : BFD_RELOC_ARM_GOTOFF + -- : BFD_RELOC_ARM_GOTPC + These relocs are only used within the ARM assembler. They are not + (at present) written to any object files. + + -- : BFD_RELOC_ARM_TARGET1 + Pc-relative or absolute relocation depending on target. Used for + entries in .init_array sections. + + -- : BFD_RELOC_ARM_ROSEGREL32 + Read-only segment base relative address. + + -- : BFD_RELOC_ARM_SBREL32 + Data segment base relative address. + + -- : BFD_RELOC_ARM_TARGET2 + This reloc is used for References to RTTI dta from exception + handling tables. The actual definition depends on the target. It + may be a pc-relative or some form of GOT-indirect relocation. + + -- : BFD_RELOC_ARM_PREL31 + 31-bit PC relative address. + + -- : BFD_RELOC_SH_PCDISP8BY2 + -- : BFD_RELOC_SH_PCDISP12BY2 + -- : BFD_RELOC_SH_IMM3 + -- : BFD_RELOC_SH_IMM3U + -- : BFD_RELOC_SH_DISP12 + -- : BFD_RELOC_SH_DISP12BY2 + -- : BFD_RELOC_SH_DISP12BY4 + -- : BFD_RELOC_SH_DISP12BY8 + -- : BFD_RELOC_SH_DISP20 + -- : BFD_RELOC_SH_DISP20BY8 + -- : BFD_RELOC_SH_IMM4 + -- : BFD_RELOC_SH_IMM4BY2 + -- : BFD_RELOC_SH_IMM4BY4 + -- : BFD_RELOC_SH_IMM8 + -- : BFD_RELOC_SH_IMM8BY2 + -- : BFD_RELOC_SH_IMM8BY4 + -- : BFD_RELOC_SH_PCRELIMM8BY2 + -- : BFD_RELOC_SH_PCRELIMM8BY4 + -- : BFD_RELOC_SH_SWITCH16 + -- : BFD_RELOC_SH_SWITCH32 + -- : BFD_RELOC_SH_USES + -- : BFD_RELOC_SH_COUNT + -- : BFD_RELOC_SH_ALIGN + -- : BFD_RELOC_SH_CODE + -- : BFD_RELOC_SH_DATA + -- : BFD_RELOC_SH_LABEL + -- : BFD_RELOC_SH_LOOP_START + -- : BFD_RELOC_SH_LOOP_END + -- : BFD_RELOC_SH_COPY + -- : BFD_RELOC_SH_GLOB_DAT + -- : BFD_RELOC_SH_JMP_SLOT + -- : BFD_RELOC_SH_RELATIVE + -- : BFD_RELOC_SH_GOTPC + -- : BFD_RELOC_SH_GOT_LOW16 + -- : BFD_RELOC_SH_GOT_MEDLOW16 + -- : BFD_RELOC_SH_GOT_MEDHI16 + -- : BFD_RELOC_SH_GOT_HI16 + -- : BFD_RELOC_SH_GOTPLT_LOW16 + -- : BFD_RELOC_SH_GOTPLT_MEDLOW16 + -- : BFD_RELOC_SH_GOTPLT_MEDHI16 + -- : BFD_RELOC_SH_GOTPLT_HI16 + -- : BFD_RELOC_SH_PLT_LOW16 + -- : BFD_RELOC_SH_PLT_MEDLOW16 + -- : BFD_RELOC_SH_PLT_MEDHI16 + -- : BFD_RELOC_SH_PLT_HI16 + -- : BFD_RELOC_SH_GOTOFF_LOW16 + -- : BFD_RELOC_SH_GOTOFF_MEDLOW16 + -- : BFD_RELOC_SH_GOTOFF_MEDHI16 + -- : BFD_RELOC_SH_GOTOFF_HI16 + -- : BFD_RELOC_SH_GOTPC_LOW16 + -- : BFD_RELOC_SH_GOTPC_MEDLOW16 + -- : BFD_RELOC_SH_GOTPC_MEDHI16 + -- : BFD_RELOC_SH_GOTPC_HI16 + -- : BFD_RELOC_SH_COPY64 + -- : BFD_RELOC_SH_GLOB_DAT64 + -- : BFD_RELOC_SH_JMP_SLOT64 + -- : BFD_RELOC_SH_RELATIVE64 + -- : BFD_RELOC_SH_GOT10BY4 + -- : BFD_RELOC_SH_GOT10BY8 + -- : BFD_RELOC_SH_GOTPLT10BY4 + -- : BFD_RELOC_SH_GOTPLT10BY8 + -- : BFD_RELOC_SH_GOTPLT32 + -- : BFD_RELOC_SH_SHMEDIA_CODE + -- : BFD_RELOC_SH_IMMU5 + -- : BFD_RELOC_SH_IMMS6 + -- : BFD_RELOC_SH_IMMS6BY32 + -- : BFD_RELOC_SH_IMMU6 + -- : BFD_RELOC_SH_IMMS10 + -- : BFD_RELOC_SH_IMMS10BY2 + -- : BFD_RELOC_SH_IMMS10BY4 + -- : BFD_RELOC_SH_IMMS10BY8 + -- : BFD_RELOC_SH_IMMS16 + -- : BFD_RELOC_SH_IMMU16 + -- : BFD_RELOC_SH_IMM_LOW16 + -- : BFD_RELOC_SH_IMM_LOW16_PCREL + -- : BFD_RELOC_SH_IMM_MEDLOW16 + -- : BFD_RELOC_SH_IMM_MEDLOW16_PCREL + -- : BFD_RELOC_SH_IMM_MEDHI16 + -- : BFD_RELOC_SH_IMM_MEDHI16_PCREL + -- : BFD_RELOC_SH_IMM_HI16 + -- : BFD_RELOC_SH_IMM_HI16_PCREL + -- : BFD_RELOC_SH_PT_16 + -- : BFD_RELOC_SH_TLS_GD_32 + -- : BFD_RELOC_SH_TLS_LD_32 + -- : BFD_RELOC_SH_TLS_LDO_32 + -- : BFD_RELOC_SH_TLS_IE_32 + -- : BFD_RELOC_SH_TLS_LE_32 + -- : BFD_RELOC_SH_TLS_DTPMOD32 + -- : BFD_RELOC_SH_TLS_DTPOFF32 + -- : BFD_RELOC_SH_TLS_TPOFF32 + Renesas / SuperH SH relocs. Not all of these appear in object + files. + + -- : BFD_RELOC_THUMB_PCREL_BRANCH9 + -- : BFD_RELOC_THUMB_PCREL_BRANCH12 + -- : BFD_RELOC_THUMB_PCREL_BRANCH23 + Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must + be zero and is not stored in the instruction. + + -- : BFD_RELOC_ARC_B22_PCREL + ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two + bits must be zero and are not stored in the instruction. The high + 20 bits are installed in bits 26 through 7 of the instruction. + + -- : BFD_RELOC_ARC_B26 + ARC 26 bit absolute branch. The lowest two bits must be zero and + are not stored in the instruction. The high 24 bits are installed + in bits 23 through 0. + + -- : BFD_RELOC_D10V_10_PCREL_R + Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 + bits assumed to be 0. + + -- : BFD_RELOC_D10V_10_PCREL_L + Mitsubishi D10V relocs. This is a 10-bit reloc with the right 2 + bits assumed to be 0. This is the same as the previous reloc + except it is in the left container, i.e., shifted left 15 bits. + + -- : BFD_RELOC_D10V_18 + This is an 18-bit reloc with the right 2 bits assumed to be 0. + + -- : BFD_RELOC_D10V_18_PCREL + This is an 18-bit reloc with the right 2 bits assumed to be 0. + + -- : BFD_RELOC_D30V_6 + Mitsubishi D30V relocs. This is a 6-bit absolute reloc. + + -- : BFD_RELOC_D30V_9_PCREL + This is a 6-bit pc-relative reloc with the right 3 bits assumed to + be 0. + + -- : BFD_RELOC_D30V_9_PCREL_R + This is a 6-bit pc-relative reloc with the right 3 bits assumed to + be 0. Same as the previous reloc but on the right side of the + container. + + -- : BFD_RELOC_D30V_15 + This is a 12-bit absolute reloc with the right 3 bitsassumed to be + 0. + + -- : BFD_RELOC_D30V_15_PCREL + This is a 12-bit pc-relative reloc with the right 3 bits assumed + to be 0. + + -- : BFD_RELOC_D30V_15_PCREL_R + This is a 12-bit pc-relative reloc with the right 3 bits assumed + to be 0. Same as the previous reloc but on the right side of the + container. + + -- : BFD_RELOC_D30V_21 + This is an 18-bit absolute reloc with the right 3 bits assumed to + be 0. + + -- : BFD_RELOC_D30V_21_PCREL + This is an 18-bit pc-relative reloc with the right 3 bits assumed + to be 0. + + -- : BFD_RELOC_D30V_21_PCREL_R + This is an 18-bit pc-relative reloc with the right 3 bits assumed + to be 0. Same as the previous reloc but on the right side of the + container. + + -- : BFD_RELOC_D30V_32 + This is a 32-bit absolute reloc. + + -- : BFD_RELOC_D30V_32_PCREL + This is a 32-bit pc-relative reloc. + + -- : BFD_RELOC_DLX_HI16_S + DLX relocs + + -- : BFD_RELOC_DLX_LO16 + DLX relocs + + -- : BFD_RELOC_DLX_JMP26 + DLX relocs + + -- : BFD_RELOC_M32R_24 + Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit + absolute address. + + -- : BFD_RELOC_M32R_10_PCREL + This is a 10-bit pc-relative reloc with the right 2 bits assumed + to be 0. + + -- : BFD_RELOC_M32R_18_PCREL + This is an 18-bit reloc with the right 2 bits assumed to be 0. + + -- : BFD_RELOC_M32R_26_PCREL + This is a 26-bit reloc with the right 2 bits assumed to be 0. + + -- : BFD_RELOC_M32R_HI16_ULO + This is a 16-bit reloc containing the high 16 bits of an address + used when the lower 16 bits are treated as unsigned. + + -- : BFD_RELOC_M32R_HI16_SLO + This is a 16-bit reloc containing the high 16 bits of an address + used when the lower 16 bits are treated as signed. + + -- : BFD_RELOC_M32R_LO16 + This is a 16-bit reloc containing the lower 16 bits of an address. + + -- : BFD_RELOC_M32R_SDA16 + This is a 16-bit reloc containing the small data area offset for + use in add3, load, and store instructions. + + -- : BFD_RELOC_M32R_GOT24 + -- : BFD_RELOC_M32R_26_PLTREL + -- : BFD_RELOC_M32R_COPY + -- : BFD_RELOC_M32R_GLOB_DAT + -- : BFD_RELOC_M32R_JMP_SLOT + -- : BFD_RELOC_M32R_RELATIVE + -- : BFD_RELOC_M32R_GOTOFF + -- : BFD_RELOC_M32R_GOTOFF_HI_ULO + -- : BFD_RELOC_M32R_GOTOFF_HI_SLO + -- : BFD_RELOC_M32R_GOTOFF_LO + -- : BFD_RELOC_M32R_GOTPC24 + -- : BFD_RELOC_M32R_GOT16_HI_ULO + -- : BFD_RELOC_M32R_GOT16_HI_SLO + -- : BFD_RELOC_M32R_GOT16_LO + -- : BFD_RELOC_M32R_GOTPC_HI_ULO + -- : BFD_RELOC_M32R_GOTPC_HI_SLO + -- : BFD_RELOC_M32R_GOTPC_LO + For PIC. + + -- : BFD_RELOC_V850_9_PCREL + This is a 9-bit reloc + + -- : BFD_RELOC_V850_22_PCREL + This is a 22-bit reloc + + -- : BFD_RELOC_V850_SDA_16_16_OFFSET + This is a 16 bit offset from the short data area pointer. + + -- : BFD_RELOC_V850_SDA_15_16_OFFSET + This is a 16 bit offset (of which only 15 bits are used) from the + short data area pointer. + + -- : BFD_RELOC_V850_ZDA_16_16_OFFSET + This is a 16 bit offset from the zero data area pointer. + + -- : BFD_RELOC_V850_ZDA_15_16_OFFSET + This is a 16 bit offset (of which only 15 bits are used) from the + zero data area pointer. + + -- : BFD_RELOC_V850_TDA_6_8_OFFSET + This is an 8 bit offset (of which only 6 bits are used) from the + tiny data area pointer. + + -- : BFD_RELOC_V850_TDA_7_8_OFFSET + This is an 8bit offset (of which only 7 bits are used) from the + tiny data area pointer. + + -- : BFD_RELOC_V850_TDA_7_7_OFFSET + This is a 7 bit offset from the tiny data area pointer. + + -- : BFD_RELOC_V850_TDA_16_16_OFFSET + This is a 16 bit offset from the tiny data area pointer. + + -- : BFD_RELOC_V850_TDA_4_5_OFFSET + This is a 5 bit offset (of which only 4 bits are used) from the + tiny data area pointer. + + -- : BFD_RELOC_V850_TDA_4_4_OFFSET + This is a 4 bit offset from the tiny data area pointer. + + -- : BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET + This is a 16 bit offset from the short data area pointer, with the + bits placed non-contiguously in the instruction. + + -- : BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET + This is a 16 bit offset from the zero data area pointer, with the + bits placed non-contiguously in the instruction. + + -- : BFD_RELOC_V850_CALLT_6_7_OFFSET + This is a 6 bit offset from the call table base pointer. + + -- : BFD_RELOC_V850_CALLT_16_16_OFFSET + This is a 16 bit offset from the call table base pointer. + + -- : BFD_RELOC_V850_LONGCALL + Used for relaxing indirect function calls. + + -- : BFD_RELOC_V850_LONGJUMP + Used for relaxing indirect jumps. + + -- : BFD_RELOC_V850_ALIGN + Used to maintain alignment whilst relaxing. + + -- : BFD_RELOC_MN10300_32_PCREL + This is a 32bit pcrel reloc for the mn10300, offset by two bytes + in the instruction. + + -- : BFD_RELOC_MN10300_16_PCREL + This is a 16bit pcrel reloc for the mn10300, offset by two bytes + in the instruction. + + -- : BFD_RELOC_TIC30_LDP + This is a 8bit DP reloc for the tms320c30, where the most + significant 8 bits of a 24 bit word are placed into the least + significant 8 bits of the opcode. + + -- : BFD_RELOC_TIC54X_PARTLS7 + This is a 7bit reloc for the tms320c54x, where the least + significant 7 bits of a 16 bit word are placed into the least + significant 7 bits of the opcode. + + -- : BFD_RELOC_TIC54X_PARTMS9 + This is a 9bit DP reloc for the tms320c54x, where the most + significant 9 bits of a 16 bit word are placed into the least + significant 9 bits of the opcode. + + -- : BFD_RELOC_TIC54X_23 + This is an extended address 23-bit reloc for the tms320c54x. + + -- : BFD_RELOC_TIC54X_16_OF_23 + This is a 16-bit reloc for the tms320c54x, where the least + significant 16 bits of a 23-bit extended address are placed into + the opcode. + + -- : BFD_RELOC_TIC54X_MS7_OF_23 + This is a reloc for the tms320c54x, where the most significant 7 + bits of a 23-bit extended address are placed into the opcode. + + -- : BFD_RELOC_FR30_48 + This is a 48 bit reloc for the FR30 that stores 32 bits. + + -- : BFD_RELOC_FR30_20 + This is a 32 bit reloc for the FR30 that stores 20 bits split up + into two sections. + + -- : BFD_RELOC_FR30_6_IN_4 + This is a 16 bit reloc for the FR30 that stores a 6 bit word + offset in 4 bits. + + -- : BFD_RELOC_FR30_8_IN_8 + This is a 16 bit reloc for the FR30 that stores an 8 bit byte + offset into 8 bits. + + -- : BFD_RELOC_FR30_9_IN_8 + This is a 16 bit reloc for the FR30 that stores a 9 bit short + offset into 8 bits. + + -- : BFD_RELOC_FR30_10_IN_8 + This is a 16 bit reloc for the FR30 that stores a 10 bit word + offset into 8 bits. + + -- : BFD_RELOC_FR30_9_PCREL + This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative + short offset into 8 bits. + + -- : BFD_RELOC_FR30_12_PCREL + This is a 16 bit reloc for the FR30 that stores a 12 bit pc + relative short offset into 11 bits. + + -- : BFD_RELOC_MCORE_PCREL_IMM8BY4 + -- : BFD_RELOC_MCORE_PCREL_IMM11BY2 + -- : BFD_RELOC_MCORE_PCREL_IMM4BY2 + -- : BFD_RELOC_MCORE_PCREL_32 + -- : BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2 + -- : BFD_RELOC_MCORE_RVA + Motorola Mcore relocations. + + -- : BFD_RELOC_MMIX_GETA + -- : BFD_RELOC_MMIX_GETA_1 + -- : BFD_RELOC_MMIX_GETA_2 + -- : BFD_RELOC_MMIX_GETA_3 + These are relocations for the GETA instruction. + + -- : BFD_RELOC_MMIX_CBRANCH + -- : BFD_RELOC_MMIX_CBRANCH_J + -- : BFD_RELOC_MMIX_CBRANCH_1 + -- : BFD_RELOC_MMIX_CBRANCH_2 + -- : BFD_RELOC_MMIX_CBRANCH_3 + These are relocations for a conditional branch instruction. + + -- : BFD_RELOC_MMIX_PUSHJ + -- : BFD_RELOC_MMIX_PUSHJ_1 + -- : BFD_RELOC_MMIX_PUSHJ_2 + -- : BFD_RELOC_MMIX_PUSHJ_3 + -- : BFD_RELOC_MMIX_PUSHJ_STUBBABLE + These are relocations for the PUSHJ instruction. + + -- : BFD_RELOC_MMIX_JMP + -- : BFD_RELOC_MMIX_JMP_1 + -- : BFD_RELOC_MMIX_JMP_2 + -- : BFD_RELOC_MMIX_JMP_3 + These are relocations for the JMP instruction. + + -- : BFD_RELOC_MMIX_ADDR19 + This is a relocation for a relative address as in a GETA + instruction or a branch. + + -- : BFD_RELOC_MMIX_ADDR27 + This is a relocation for a relative address as in a JMP + instruction. + + -- : BFD_RELOC_MMIX_REG_OR_BYTE + This is a relocation for an instruction field that may be a general + register or a value 0..255. + + -- : BFD_RELOC_MMIX_REG + This is a relocation for an instruction field that may be a general + register. + + -- : BFD_RELOC_MMIX_BASE_PLUS_OFFSET + This is a relocation for two instruction fields holding a register + and an offset, the equivalent of the relocation. + + -- : BFD_RELOC_MMIX_LOCAL + This relocation is an assertion that the expression is not + allocated as a global register. It does not modify contents. + + -- : BFD_RELOC_AVR_7_PCREL + This is a 16 bit reloc for the AVR that stores 8 bit pc relative + short offset into 7 bits. + + -- : BFD_RELOC_AVR_13_PCREL + This is a 16 bit reloc for the AVR that stores 13 bit pc relative + short offset into 12 bits. + + -- : BFD_RELOC_AVR_16_PM + This is a 16 bit reloc for the AVR that stores 17 bit value + (usually program memory address) into 16 bits. + + -- : BFD_RELOC_AVR_LO8_LDI + This is a 16 bit reloc for the AVR that stores 8 bit value (usually + data memory address) into 8 bit immediate value of LDI insn. + + -- : BFD_RELOC_AVR_HI8_LDI + This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 + bit of data memory address) into 8 bit immediate value of LDI insn. + + -- : BFD_RELOC_AVR_HH8_LDI + This is a 16 bit reloc for the AVR that stores 8 bit value (most + high 8 bit of program memory address) into 8 bit immediate value + of LDI insn. + + -- : BFD_RELOC_AVR_LO8_LDI_NEG + This is a 16 bit reloc for the AVR that stores negated 8 bit value + (usually data memory address) into 8 bit immediate value of SUBI + insn. + + -- : BFD_RELOC_AVR_HI8_LDI_NEG + This is a 16 bit reloc for the AVR that stores negated 8 bit value + (high 8 bit of data memory address) into 8 bit immediate value of + SUBI insn. + + -- : BFD_RELOC_AVR_HH8_LDI_NEG + This is a 16 bit reloc for the AVR that stores negated 8 bit value + (most high 8 bit of program memory address) into 8 bit immediate + value of LDI or SUBI insn. + + -- : BFD_RELOC_AVR_LO8_LDI_PM + This is a 16 bit reloc for the AVR that stores 8 bit value (usually + command address) into 8 bit immediate value of LDI insn. + + -- : BFD_RELOC_AVR_HI8_LDI_PM + This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 + bit of command address) into 8 bit immediate value of LDI insn. + + -- : BFD_RELOC_AVR_HH8_LDI_PM + This is a 16 bit reloc for the AVR that stores 8 bit value (most + high 8 bit of command address) into 8 bit immediate value of LDI + insn. + + -- : BFD_RELOC_AVR_LO8_LDI_PM_NEG + This is a 16 bit reloc for the AVR that stores negated 8 bit value + (usually command address) into 8 bit immediate value of SUBI insn. + + -- : BFD_RELOC_AVR_HI8_LDI_PM_NEG + This is a 16 bit reloc for the AVR that stores negated 8 bit value + (high 8 bit of 16 bit command address) into 8 bit immediate value + of SUBI insn. + + -- : BFD_RELOC_AVR_HH8_LDI_PM_NEG + This is a 16 bit reloc for the AVR that stores negated 8 bit value + (high 6 bit of 22 bit command address) into 8 bit immediate value + of SUBI insn. + + -- : BFD_RELOC_AVR_CALL + This is a 32 bit reloc for the AVR that stores 23 bit value into + 22 bits. + + -- : BFD_RELOC_390_12 + Direct 12 bit. + + -- : BFD_RELOC_390_GOT12 + 12 bit GOT offset. + + -- : BFD_RELOC_390_PLT32 + 32 bit PC relative PLT address. + + -- : BFD_RELOC_390_COPY + Copy symbol at runtime. + + -- : BFD_RELOC_390_GLOB_DAT + Create GOT entry. + + -- : BFD_RELOC_390_JMP_SLOT + Create PLT entry. + + -- : BFD_RELOC_390_RELATIVE + Adjust by program base. + + -- : BFD_RELOC_390_GOTPC + 32 bit PC relative offset to GOT. + + -- : BFD_RELOC_390_GOT16 + 16 bit GOT offset. + + -- : BFD_RELOC_390_PC16DBL + PC relative 16 bit shifted by 1. + + -- : BFD_RELOC_390_PLT16DBL + 16 bit PC rel. PLT shifted by 1. + + -- : BFD_RELOC_390_PC32DBL + PC relative 32 bit shifted by 1. + + -- : BFD_RELOC_390_PLT32DBL + 32 bit PC rel. PLT shifted by 1. + + -- : BFD_RELOC_390_GOTPCDBL + 32 bit PC rel. GOT shifted by 1. + + -- : BFD_RELOC_390_GOT64 + 64 bit GOT offset. + + -- : BFD_RELOC_390_PLT64 + 64 bit PC relative PLT address. + + -- : BFD_RELOC_390_GOTENT + 32 bit rel. offset to GOT entry. + + -- : BFD_RELOC_390_GOTOFF64 + 64 bit offset to GOT. + + -- : BFD_RELOC_390_GOTPLT12 + 12-bit offset to symbol-entry within GOT, with PLT handling. + + -- : BFD_RELOC_390_GOTPLT16 + 16-bit offset to symbol-entry within GOT, with PLT handling. + + -- : BFD_RELOC_390_GOTPLT32 + 32-bit offset to symbol-entry within GOT, with PLT handling. + + -- : BFD_RELOC_390_GOTPLT64 + 64-bit offset to symbol-entry within GOT, with PLT handling. + + -- : BFD_RELOC_390_GOTPLTENT + 32-bit rel. offset to symbol-entry within GOT, with PLT handling. + + -- : BFD_RELOC_390_PLTOFF16 + 16-bit rel. offset from the GOT to a PLT entry. + + -- : BFD_RELOC_390_PLTOFF32 + 32-bit rel. offset from the GOT to a PLT entry. + + -- : BFD_RELOC_390_PLTOFF64 + 64-bit rel. offset from the GOT to a PLT entry. + + -- : BFD_RELOC_390_TLS_LOAD + -- : BFD_RELOC_390_TLS_GDCALL + -- : BFD_RELOC_390_TLS_LDCALL + -- : BFD_RELOC_390_TLS_GD32 + -- : BFD_RELOC_390_TLS_GD64 + -- : BFD_RELOC_390_TLS_GOTIE12 + -- : BFD_RELOC_390_TLS_GOTIE32 + -- : BFD_RELOC_390_TLS_GOTIE64 + -- : BFD_RELOC_390_TLS_LDM32 + -- : BFD_RELOC_390_TLS_LDM64 + -- : BFD_RELOC_390_TLS_IE32 + -- : BFD_RELOC_390_TLS_IE64 + -- : BFD_RELOC_390_TLS_IEENT + -- : BFD_RELOC_390_TLS_LE32 + -- : BFD_RELOC_390_TLS_LE64 + -- : BFD_RELOC_390_TLS_LDO32 + -- : BFD_RELOC_390_TLS_LDO64 + -- : BFD_RELOC_390_TLS_DTPMOD + -- : BFD_RELOC_390_TLS_DTPOFF + -- : BFD_RELOC_390_TLS_TPOFF + s390 tls relocations. + + -- : BFD_RELOC_390_20 + -- : BFD_RELOC_390_GOT20 + -- : BFD_RELOC_390_GOTPLT20 + -- : BFD_RELOC_390_TLS_GOTIE20 + Long displacement extension. + + -- : BFD_RELOC_IP2K_FR9 + Scenix IP2K - 9-bit register number / data address + + -- : BFD_RELOC_IP2K_BANK + Scenix IP2K - 4-bit register/data bank number + + -- : BFD_RELOC_IP2K_ADDR16CJP + Scenix IP2K - low 13 bits of instruction word address + + -- : BFD_RELOC_IP2K_PAGE3 + Scenix IP2K - high 3 bits of instruction word address + + -- : BFD_RELOC_IP2K_LO8DATA + -- : BFD_RELOC_IP2K_HI8DATA + -- : BFD_RELOC_IP2K_EX8DATA + Scenix IP2K - ext/low/high 8 bits of data address + + -- : BFD_RELOC_IP2K_LO8INSN + -- : BFD_RELOC_IP2K_HI8INSN + Scenix IP2K - low/high 8 bits of instruction word address + + -- : BFD_RELOC_IP2K_PC_SKIP + Scenix IP2K - even/odd PC modifier to modify snb pcl.0 + + -- : BFD_RELOC_IP2K_TEXT + Scenix IP2K - 16 bit word address in text section. + + -- : BFD_RELOC_IP2K_FR_OFFSET + Scenix IP2K - 7-bit sp or dp offset + + -- : BFD_RELOC_VPE4KMATH_DATA + -- : BFD_RELOC_VPE4KMATH_INSN + Scenix VPE4K coprocessor - data/insn-space addressing + + -- : BFD_RELOC_VTABLE_INHERIT + -- : BFD_RELOC_VTABLE_ENTRY + These two relocations are used by the linker to determine which of + the entries in a C++ virtual function table are actually used. + When the -gc-sections option is given, the linker will zero out + the entries that are not used, so that the code for those + functions need not be included in the output. + + VTABLE_INHERIT is a zero-space relocation used to describe to the + linker the inheritance tree of a C++ virtual function table. The + relocation's symbol should be the parent class' vtable, and the + relocation should be located at the child vtable. + + VTABLE_ENTRY is a zero-space relocation that describes the use of a + virtual function table entry. The reloc's symbol should refer to + the table of the class mentioned in the code. Off of that base, + an offset describes the entry that is being used. For Rela hosts, + this offset is stored in the reloc's addend. For Rel hosts, we + are forced to put this offset in the reloc's section offset. + + -- : BFD_RELOC_IA64_IMM14 + -- : BFD_RELOC_IA64_IMM22 + -- : BFD_RELOC_IA64_IMM64 + -- : BFD_RELOC_IA64_DIR32MSB + -- : BFD_RELOC_IA64_DIR32LSB + -- : BFD_RELOC_IA64_DIR64MSB + -- : BFD_RELOC_IA64_DIR64LSB + -- : BFD_RELOC_IA64_GPREL22 + -- : BFD_RELOC_IA64_GPREL64I + -- : BFD_RELOC_IA64_GPREL32MSB + -- : BFD_RELOC_IA64_GPREL32LSB + -- : BFD_RELOC_IA64_GPREL64MSB + -- : BFD_RELOC_IA64_GPREL64LSB + -- : BFD_RELOC_IA64_LTOFF22 + -- : BFD_RELOC_IA64_LTOFF64I + -- : BFD_RELOC_IA64_PLTOFF22 + -- : BFD_RELOC_IA64_PLTOFF64I + -- : BFD_RELOC_IA64_PLTOFF64MSB + -- : BFD_RELOC_IA64_PLTOFF64LSB + -- : BFD_RELOC_IA64_FPTR64I + -- : BFD_RELOC_IA64_FPTR32MSB + -- : BFD_RELOC_IA64_FPTR32LSB + -- : BFD_RELOC_IA64_FPTR64MSB + -- : BFD_RELOC_IA64_FPTR64LSB + -- : BFD_RELOC_IA64_PCREL21B + -- : BFD_RELOC_IA64_PCREL21BI + -- : BFD_RELOC_IA64_PCREL21M + -- : BFD_RELOC_IA64_PCREL21F + -- : BFD_RELOC_IA64_PCREL22 + -- : BFD_RELOC_IA64_PCREL60B + -- : BFD_RELOC_IA64_PCREL64I + -- : BFD_RELOC_IA64_PCREL32MSB + -- : BFD_RELOC_IA64_PCREL32LSB + -- : BFD_RELOC_IA64_PCREL64MSB + -- : BFD_RELOC_IA64_PCREL64LSB + -- : BFD_RELOC_IA64_LTOFF_FPTR22 + -- : BFD_RELOC_IA64_LTOFF_FPTR64I + -- : BFD_RELOC_IA64_LTOFF_FPTR32MSB + -- : BFD_RELOC_IA64_LTOFF_FPTR32LSB + -- : BFD_RELOC_IA64_LTOFF_FPTR64MSB + -- : BFD_RELOC_IA64_LTOFF_FPTR64LSB + -- : BFD_RELOC_IA64_SEGREL32MSB + -- : BFD_RELOC_IA64_SEGREL32LSB + -- : BFD_RELOC_IA64_SEGREL64MSB + -- : BFD_RELOC_IA64_SEGREL64LSB + -- : BFD_RELOC_IA64_SECREL32MSB + -- : BFD_RELOC_IA64_SECREL32LSB + -- : BFD_RELOC_IA64_SECREL64MSB + -- : BFD_RELOC_IA64_SECREL64LSB + -- : BFD_RELOC_IA64_REL32MSB + -- : BFD_RELOC_IA64_REL32LSB + -- : BFD_RELOC_IA64_REL64MSB + -- : BFD_RELOC_IA64_REL64LSB + -- : BFD_RELOC_IA64_LTV32MSB + -- : BFD_RELOC_IA64_LTV32LSB + -- : BFD_RELOC_IA64_LTV64MSB + -- : BFD_RELOC_IA64_LTV64LSB + -- : BFD_RELOC_IA64_IPLTMSB + -- : BFD_RELOC_IA64_IPLTLSB + -- : BFD_RELOC_IA64_COPY + -- : BFD_RELOC_IA64_LTOFF22X + -- : BFD_RELOC_IA64_LDXMOV + -- : BFD_RELOC_IA64_TPREL14 + -- : BFD_RELOC_IA64_TPREL22 + -- : BFD_RELOC_IA64_TPREL64I + -- : BFD_RELOC_IA64_TPREL64MSB + -- : BFD_RELOC_IA64_TPREL64LSB + -- : BFD_RELOC_IA64_LTOFF_TPREL22 + -- : BFD_RELOC_IA64_DTPMOD64MSB + -- : BFD_RELOC_IA64_DTPMOD64LSB + -- : BFD_RELOC_IA64_LTOFF_DTPMOD22 + -- : BFD_RELOC_IA64_DTPREL14 + -- : BFD_RELOC_IA64_DTPREL22 + -- : BFD_RELOC_IA64_DTPREL64I + -- : BFD_RELOC_IA64_DTPREL32MSB + -- : BFD_RELOC_IA64_DTPREL32LSB + -- : BFD_RELOC_IA64_DTPREL64MSB + -- : BFD_RELOC_IA64_DTPREL64LSB + -- : BFD_RELOC_IA64_LTOFF_DTPREL22 + Intel IA64 Relocations. + + -- : BFD_RELOC_M68HC11_HI8 + Motorola 68HC11 reloc. This is the 8 bit high part of an absolute + address. + + -- : BFD_RELOC_M68HC11_LO8 + Motorola 68HC11 reloc. This is the 8 bit low part of an absolute + address. + + -- : BFD_RELOC_M68HC11_3B + Motorola 68HC11 reloc. This is the 3 bit of a value. + + -- : BFD_RELOC_M68HC11_RL_JUMP + Motorola 68HC11 reloc. This reloc marks the beginning of a + jump/call instruction. It is used for linker relaxation to + correctly identify beginning of instruction and change some + branches to use PC-relative addressing mode. + + -- : BFD_RELOC_M68HC11_RL_GROUP + Motorola 68HC11 reloc. This reloc marks a group of several + instructions that gcc generates and for which the linker + relaxation pass can modify and/or remove some of them. + + -- : BFD_RELOC_M68HC11_LO16 + Motorola 68HC11 reloc. This is the 16-bit lower part of an + address. It is used for 'call' instruction to specify the symbol + address without any special transformation (due to memory bank + window). + + -- : BFD_RELOC_M68HC11_PAGE + Motorola 68HC11 reloc. This is a 8-bit reloc that specifies the + page number of an address. It is used by 'call' instruction to + specify the page number of the symbol. + + -- : BFD_RELOC_M68HC11_24 + Motorola 68HC11 reloc. This is a 24-bit reloc that represents the + address with a 16-bit value and a 8-bit page number. The symbol + address is transformed to follow the 16K memory bank of 68HC12 + (seen as mapped in the window). + + -- : BFD_RELOC_M68HC12_5B + Motorola 68HC12 reloc. This is the 5 bits of a value. + + -- : BFD_RELOC_16C_NUM08 + -- : BFD_RELOC_16C_NUM08_C + -- : BFD_RELOC_16C_NUM16 + -- : BFD_RELOC_16C_NUM16_C + -- : BFD_RELOC_16C_NUM32 + -- : BFD_RELOC_16C_NUM32_C + -- : BFD_RELOC_16C_DISP04 + -- : BFD_RELOC_16C_DISP04_C + -- : BFD_RELOC_16C_DISP08 + -- : BFD_RELOC_16C_DISP08_C + -- : BFD_RELOC_16C_DISP16 + -- : BFD_RELOC_16C_DISP16_C + -- : BFD_RELOC_16C_DISP24 + -- : BFD_RELOC_16C_DISP24_C + -- : BFD_RELOC_16C_DISP24a + -- : BFD_RELOC_16C_DISP24a_C + -- : BFD_RELOC_16C_REG04 + -- : BFD_RELOC_16C_REG04_C + -- : BFD_RELOC_16C_REG04a + -- : BFD_RELOC_16C_REG04a_C + -- : BFD_RELOC_16C_REG14 + -- : BFD_RELOC_16C_REG14_C + -- : BFD_RELOC_16C_REG16 + -- : BFD_RELOC_16C_REG16_C + -- : BFD_RELOC_16C_REG20 + -- : BFD_RELOC_16C_REG20_C + -- : BFD_RELOC_16C_ABS20 + -- : BFD_RELOC_16C_ABS20_C + -- : BFD_RELOC_16C_ABS24 + -- : BFD_RELOC_16C_ABS24_C + -- : BFD_RELOC_16C_IMM04 + -- : BFD_RELOC_16C_IMM04_C + -- : BFD_RELOC_16C_IMM16 + -- : BFD_RELOC_16C_IMM16_C + -- : BFD_RELOC_16C_IMM20 + -- : BFD_RELOC_16C_IMM20_C + -- : BFD_RELOC_16C_IMM24 + -- : BFD_RELOC_16C_IMM24_C + -- : BFD_RELOC_16C_IMM32 + -- : BFD_RELOC_16C_IMM32_C + NS CR16C Relocations. + + -- : BFD_RELOC_CRX_REL4 + -- : BFD_RELOC_CRX_REL8 + -- : BFD_RELOC_CRX_REL8_CMP + -- : BFD_RELOC_CRX_REL16 + -- : BFD_RELOC_CRX_REL24 + -- : BFD_RELOC_CRX_REL32 + -- : BFD_RELOC_CRX_REGREL12 + -- : BFD_RELOC_CRX_REGREL22 + -- : BFD_RELOC_CRX_REGREL28 + -- : BFD_RELOC_CRX_REGREL32 + -- : BFD_RELOC_CRX_ABS16 + -- : BFD_RELOC_CRX_ABS32 + -- : BFD_RELOC_CRX_NUM8 + -- : BFD_RELOC_CRX_NUM16 + -- : BFD_RELOC_CRX_NUM32 + -- : BFD_RELOC_CRX_IMM16 + -- : BFD_RELOC_CRX_IMM32 + -- : BFD_RELOC_CRX_SWITCH8 + -- : BFD_RELOC_CRX_SWITCH16 + -- : BFD_RELOC_CRX_SWITCH32 + NS CRX Relocations. + + -- : BFD_RELOC_CRIS_BDISP8 + -- : BFD_RELOC_CRIS_UNSIGNED_5 + -- : BFD_RELOC_CRIS_SIGNED_6 + -- : BFD_RELOC_CRIS_UNSIGNED_6 + -- : BFD_RELOC_CRIS_UNSIGNED_4 + These relocs are only used within the CRIS assembler. They are not + (at present) written to any object files. + + -- : BFD_RELOC_CRIS_COPY + -- : BFD_RELOC_CRIS_GLOB_DAT + -- : BFD_RELOC_CRIS_JUMP_SLOT + -- : BFD_RELOC_CRIS_RELATIVE + Relocs used in ELF shared libraries for CRIS. + + -- : BFD_RELOC_CRIS_32_GOT + 32-bit offset to symbol-entry within GOT. + + -- : BFD_RELOC_CRIS_16_GOT + 16-bit offset to symbol-entry within GOT. + + -- : BFD_RELOC_CRIS_32_GOTPLT + 32-bit offset to symbol-entry within GOT, with PLT handling. + + -- : BFD_RELOC_CRIS_16_GOTPLT + 16-bit offset to symbol-entry within GOT, with PLT handling. + + -- : BFD_RELOC_CRIS_32_GOTREL + 32-bit offset to symbol, relative to GOT. + + -- : BFD_RELOC_CRIS_32_PLT_GOTREL + 32-bit offset to symbol with PLT entry, relative to GOT. + + -- : BFD_RELOC_CRIS_32_PLT_PCREL + 32-bit offset to symbol with PLT entry, relative to this + relocation. + + -- : BFD_RELOC_860_COPY + -- : BFD_RELOC_860_GLOB_DAT + -- : BFD_RELOC_860_JUMP_SLOT + -- : BFD_RELOC_860_RELATIVE + -- : BFD_RELOC_860_PC26 + -- : BFD_RELOC_860_PLT26 + -- : BFD_RELOC_860_PC16 + -- : BFD_RELOC_860_LOW0 + -- : BFD_RELOC_860_SPLIT0 + -- : BFD_RELOC_860_LOW1 + -- : BFD_RELOC_860_SPLIT1 + -- : BFD_RELOC_860_LOW2 + -- : BFD_RELOC_860_SPLIT2 + -- : BFD_RELOC_860_LOW3 + -- : BFD_RELOC_860_LOGOT0 + -- : BFD_RELOC_860_SPGOT0 + -- : BFD_RELOC_860_LOGOT1 + -- : BFD_RELOC_860_SPGOT1 + -- : BFD_RELOC_860_LOGOTOFF0 + -- : BFD_RELOC_860_SPGOTOFF0 + -- : BFD_RELOC_860_LOGOTOFF1 + -- : BFD_RELOC_860_SPGOTOFF1 + -- : BFD_RELOC_860_LOGOTOFF2 + -- : BFD_RELOC_860_LOGOTOFF3 + -- : BFD_RELOC_860_LOPC + -- : BFD_RELOC_860_HIGHADJ + -- : BFD_RELOC_860_HAGOT + -- : BFD_RELOC_860_HAGOTOFF + -- : BFD_RELOC_860_HAPC + -- : BFD_RELOC_860_HIGH + -- : BFD_RELOC_860_HIGOT + -- : BFD_RELOC_860_HIGOTOFF + Intel i860 Relocations. + + -- : BFD_RELOC_OPENRISC_ABS_26 + -- : BFD_RELOC_OPENRISC_REL_26 + OpenRISC Relocations. + + -- : BFD_RELOC_H8_DIR16A8 + -- : BFD_RELOC_H8_DIR16R8 + -- : BFD_RELOC_H8_DIR24A8 + -- : BFD_RELOC_H8_DIR24R8 + -- : BFD_RELOC_H8_DIR32A16 + H8 elf Relocations. + + -- : BFD_RELOC_XSTORMY16_REL_12 + -- : BFD_RELOC_XSTORMY16_12 + -- : BFD_RELOC_XSTORMY16_24 + -- : BFD_RELOC_XSTORMY16_FPTR16 + Sony Xstormy16 Relocations. + + -- : BFD_RELOC_VAX_GLOB_DAT + -- : BFD_RELOC_VAX_JMP_SLOT + -- : BFD_RELOC_VAX_RELATIVE + Relocations used by VAX ELF. + + -- : BFD_RELOC_MSP430_10_PCREL + -- : BFD_RELOC_MSP430_16_PCREL + -- : BFD_RELOC_MSP430_16 + -- : BFD_RELOC_MSP430_16_PCREL_BYTE + -- : BFD_RELOC_MSP430_16_BYTE + -- : BFD_RELOC_MSP430_2X_PCREL + -- : BFD_RELOC_MSP430_RL_PCREL + msp430 specific relocation codes + + -- : BFD_RELOC_IQ2000_OFFSET_16 + -- : BFD_RELOC_IQ2000_OFFSET_21 + -- : BFD_RELOC_IQ2000_UHI16 + IQ2000 Relocations. + + -- : BFD_RELOC_XTENSA_RTLD + Special Xtensa relocation used only by PLT entries in ELF shared + objects to indicate that the runtime linker should set the value + to one of its own internal functions or data structures. + + -- : BFD_RELOC_XTENSA_GLOB_DAT + -- : BFD_RELOC_XTENSA_JMP_SLOT + -- : BFD_RELOC_XTENSA_RELATIVE + Xtensa relocations for ELF shared objects. + + -- : BFD_RELOC_XTENSA_PLT + Xtensa relocation used in ELF object files for symbols that may + require PLT entries. Otherwise, this is just a generic 32-bit + relocation. + + -- : BFD_RELOC_XTENSA_DIFF8 + -- : BFD_RELOC_XTENSA_DIFF16 + -- : BFD_RELOC_XTENSA_DIFF32 + Xtensa relocations to mark the difference of two local symbols. + These are only needed to support linker relaxation and can be + ignored when not relaxing. The field is set to the value of the + difference assuming no relaxation. The relocation encodes the + position of the first symbol so the linker can determine whether + to adjust the field value. + + -- : BFD_RELOC_XTENSA_SLOT0_OP + -- : BFD_RELOC_XTENSA_SLOT1_OP + -- : BFD_RELOC_XTENSA_SLOT2_OP + -- : BFD_RELOC_XTENSA_SLOT3_OP + -- : BFD_RELOC_XTENSA_SLOT4_OP + -- : BFD_RELOC_XTENSA_SLOT5_OP + -- : BFD_RELOC_XTENSA_SLOT6_OP + -- : BFD_RELOC_XTENSA_SLOT7_OP + -- : BFD_RELOC_XTENSA_SLOT8_OP + -- : BFD_RELOC_XTENSA_SLOT9_OP + -- : BFD_RELOC_XTENSA_SLOT10_OP + -- : BFD_RELOC_XTENSA_SLOT11_OP + -- : BFD_RELOC_XTENSA_SLOT12_OP + -- : BFD_RELOC_XTENSA_SLOT13_OP + -- : BFD_RELOC_XTENSA_SLOT14_OP + Generic Xtensa relocations for instruction operands. Only the slot + number is encoded in the relocation. The relocation applies to the + last PC-relative immediate operand, or if there are no PC-relative + immediates, to the last immediate operand. + + -- : BFD_RELOC_XTENSA_SLOT0_ALT + -- : BFD_RELOC_XTENSA_SLOT1_ALT + -- : BFD_RELOC_XTENSA_SLOT2_ALT + -- : BFD_RELOC_XTENSA_SLOT3_ALT + -- : BFD_RELOC_XTENSA_SLOT4_ALT + -- : BFD_RELOC_XTENSA_SLOT5_ALT + -- : BFD_RELOC_XTENSA_SLOT6_ALT + -- : BFD_RELOC_XTENSA_SLOT7_ALT + -- : BFD_RELOC_XTENSA_SLOT8_ALT + -- : BFD_RELOC_XTENSA_SLOT9_ALT + -- : BFD_RELOC_XTENSA_SLOT10_ALT + -- : BFD_RELOC_XTENSA_SLOT11_ALT + -- : BFD_RELOC_XTENSA_SLOT12_ALT + -- : BFD_RELOC_XTENSA_SLOT13_ALT + -- : BFD_RELOC_XTENSA_SLOT14_ALT + Alternate Xtensa relocations. Only the slot is encoded in the + relocation. The meaning of these relocations is opcode-specific. + + -- : BFD_RELOC_XTENSA_OP0 + -- : BFD_RELOC_XTENSA_OP1 + -- : BFD_RELOC_XTENSA_OP2 + Xtensa relocations for backward compatibility. These have all been + replaced by BFD_RELOC_XTENSA_SLOT0_OP. + + -- : BFD_RELOC_XTENSA_ASM_EXPAND + Xtensa relocation to mark that the assembler expanded the + instructions from an original target. The expansion size is + encoded in the reloc size. + + -- : BFD_RELOC_XTENSA_ASM_SIMPLIFY + Xtensa relocation to mark that the linker should simplify + assembler-expanded instructions. This is commonly used internally + by the linker after analysis of a BFD_RELOC_XTENSA_ASM_EXPAND. + + + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; + +2.11.0.2 `bfd_reloc_type_lookup' +................................ + +*Synopsis* + reloc_howto_type *bfd_reloc_type_lookup + (bfd *abfd, bfd_reloc_code_real_type code); + *Description* +Return a pointer to a howto structure which, when invoked, will perform +the relocation CODE on data from the architecture noted. + +2.11.0.3 `bfd_default_reloc_type_lookup' +........................................ + +*Synopsis* + reloc_howto_type *bfd_default_reloc_type_lookup + (bfd *abfd, bfd_reloc_code_real_type code); + *Description* +Provides a default relocation lookup routine for any architecture. + +2.11.0.4 `bfd_get_reloc_code_name' +.................................. + +*Synopsis* + const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); + *Description* +Provides a printable name for the supplied relocation code. Useful +mainly for printing error messages. + +2.11.0.5 `bfd_generic_relax_section' +.................................... + +*Synopsis* + bfd_boolean bfd_generic_relax_section + (bfd *abfd, + asection *section, + struct bfd_link_info *, + bfd_boolean *); + *Description* +Provides default handling for relaxing for back ends which don't do +relaxing. + +2.11.0.6 `bfd_generic_gc_sections' +.................................. + +*Synopsis* + bfd_boolean bfd_generic_gc_sections + (bfd *, struct bfd_link_info *); + *Description* +Provides default handling for relaxing for back ends which don't do +section gc - i.e., does nothing. + +2.11.0.7 `bfd_generic_merge_sections' +..................................... + +*Synopsis* + bfd_boolean bfd_generic_merge_sections + (bfd *, struct bfd_link_info *); + *Description* +Provides default handling for SEC_MERGE section merging for back ends +which don't have SEC_MERGE support - i.e., does nothing. + +2.11.0.8 `bfd_generic_get_relocated_section_contents' +..................................................... + +*Synopsis* + bfd_byte *bfd_generic_get_relocated_section_contents + (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols); + *Description* +Provides default handling of relocation effort for back ends which +can't be bothered to do it efficiently. + + +File: bfd.info, Node: Core Files, Next: Targets, Prev: Relocations, Up: BFD front end + +2.12 Core files +=============== + +*Description* +These are functions pertaining to core files. + +2.12.0.1 `bfd_core_file_failing_command' +........................................ + +*Synopsis* + const char *bfd_core_file_failing_command (bfd *abfd); + *Description* +Return a read-only string explaining which program was running when it +failed and produced the core file ABFD. + +2.12.0.2 `bfd_core_file_failing_signal' +....................................... + +*Synopsis* + int bfd_core_file_failing_signal (bfd *abfd); + *Description* +Returns the signal number which caused the core dump which generated +the file the BFD ABFD is attached to. + +2.12.0.3 `core_file_matches_executable_p' +......................................... + +*Synopsis* + bfd_boolean core_file_matches_executable_p + (bfd *core_bfd, bfd *exec_bfd); + *Description* +Return `TRUE' if the core file attached to CORE_BFD was generated by a +run of the executable file attached to EXEC_BFD, `FALSE' otherwise. + + +File: bfd.info, Node: Targets, Next: Architectures, Prev: Core Files, Up: BFD front end + +2.13 Targets +============ + +*Description* +Each port of BFD to a different machine requires the creation of a +target back end. All the back end provides to the root part of BFD is a +structure containing pointers to functions which perform certain low +level operations on files. BFD translates the applications's requests +through a pointer into calls to the back end routines. + + When a file is opened with `bfd_openr', its format and target are +unknown. BFD uses various mechanisms to determine how to interpret the +file. The operations performed are: + + * Create a BFD by calling the internal routine `_bfd_new_bfd', then + call `bfd_find_target' with the target string supplied to + `bfd_openr' and the new BFD pointer. + + * If a null target string was provided to `bfd_find_target', look up + the environment variable `GNUTARGET' and use that as the target + string. + + * If the target string is still `NULL', or the target string is + `default', then use the first item in the target vector as the + target type, and set `target_defaulted' in the BFD to cause + `bfd_check_format' to loop through all the targets. *Note + bfd_target::. *Note Formats::. + + * Otherwise, inspect the elements in the target vector one by one, + until a match on target name is found. When found, use it. + + * Otherwise return the error `bfd_error_invalid_target' to + `bfd_openr'. + + * `bfd_openr' attempts to open the file using `bfd_open_file', and + returns the BFD. + Once the BFD has been opened and the target selected, the file +format may be determined. This is done by calling `bfd_check_format' on +the BFD with a suggested format. If `target_defaulted' has been set, +each possible target type is tried to see if it recognizes the +specified format. `bfd_check_format' returns `TRUE' when the caller +guesses right. + +* Menu: + +* bfd_target:: + + +File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets + +2.13.1 bfd_target +----------------- + +*Description* +This structure contains everything that BFD knows about a target. It +includes things like its byte order, name, and which routines to call +to do various operations. + + Every BFD points to a target structure with its `xvec' member. + + The macros below are used to dispatch to functions through the +`bfd_target' vector. They are used in a number of macros further down +in `bfd.h', and are also used when calling various routines by hand +inside the BFD implementation. The ARGLIST argument must be +parenthesized; it contains all the arguments to the called function. + + They make the documentation (more) unpleasant to read, so if someone +wants to fix this and not break the above, please do. + #define BFD_SEND(bfd, message, arglist) \ + ((*((bfd)->xvec->message)) arglist) + + #ifdef DEBUG_BFD_SEND + #undef BFD_SEND + #define BFD_SEND(bfd, message, arglist) \ + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ + ((*((bfd)->xvec->message)) arglist) : \ + (bfd_assert (__FILE__,__LINE__), NULL)) + #endif + For operations which index on the BFD format: + #define BFD_SEND_FMT(bfd, message, arglist) \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) + + #ifdef DEBUG_BFD_SEND + #undef BFD_SEND_FMT + #define BFD_SEND_FMT(bfd, message, arglist) \ + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ + (bfd_assert (__FILE__,__LINE__), NULL)) + #endif + This is the structure which defines the type of BFD this is. The +`xvec' member of the struct `bfd' itself points here. Each module that +implements access to a different target under BFD, defines one of these. + + FIXME, these names should be rationalised with the names of the +entry points which call them. Too bad we can't have one macro to define +them both! + enum bfd_flavour + { + bfd_target_unknown_flavour, + bfd_target_aout_flavour, + bfd_target_coff_flavour, + bfd_target_ecoff_flavour, + bfd_target_xcoff_flavour, + bfd_target_elf_flavour, + bfd_target_ieee_flavour, + bfd_target_nlm_flavour, + bfd_target_oasys_flavour, + bfd_target_tekhex_flavour, + bfd_target_srec_flavour, + bfd_target_ihex_flavour, + bfd_target_som_flavour, + bfd_target_os9k_flavour, + bfd_target_versados_flavour, + bfd_target_msdos_flavour, + bfd_target_ovax_flavour, + bfd_target_evax_flavour, + bfd_target_mmo_flavour, + bfd_target_mach_o_flavour, + bfd_target_pef_flavour, + bfd_target_pef_xlib_flavour, + bfd_target_sym_flavour + }; + + enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; + + /* Forward declaration. */ + typedef struct bfd_link_info _bfd_link_info; + + typedef struct bfd_target + { + /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ + char *name; + + /* The "flavour" of a back end is a general indication about + the contents of a file. */ + enum bfd_flavour flavour; + + /* The order of bytes within the data area of a file. */ + enum bfd_endian byteorder; + + /* The order of bytes within the header parts of a file. */ + enum bfd_endian header_byteorder; + + /* A mask of all the flags which an executable may have set - + from the set `BFD_NO_FLAGS', `HAS_RELOC', ...`D_PAGED'. */ + flagword object_flags; + + /* A mask of all the flags which a section may have set - from + the set `SEC_NO_FLAGS', `SEC_ALLOC', ...`SET_NEVER_LOAD'. */ + flagword section_flags; + + /* The character normally found at the front of a symbol. + (if any), perhaps `_'. */ + char symbol_leading_char; + + /* The pad character for file names within an archive header. */ + char ar_pad_char; + + /* The maximum number of characters in an archive header. */ + unsigned short ar_max_namelen; + + /* Entries for byte swapping for data. These are different from the + other entry points, since they don't take a BFD asthe first argument. + Certain other handlers could do the same. */ + bfd_uint64_t (*bfd_getx64) (const void *); + bfd_int64_t (*bfd_getx_signed_64) (const void *); + void (*bfd_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_getx32) (const void *); + bfd_signed_vma (*bfd_getx_signed_32) (const void *); + void (*bfd_putx32) (bfd_vma, void *); + bfd_vma (*bfd_getx16) (const void *); + bfd_signed_vma (*bfd_getx_signed_16) (const void *); + void (*bfd_putx16) (bfd_vma, void *); + + /* Byte swapping for the headers. */ + bfd_uint64_t (*bfd_h_getx64) (const void *); + bfd_int64_t (*bfd_h_getx_signed_64) (const void *); + void (*bfd_h_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_h_getx32) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); + void (*bfd_h_putx32) (bfd_vma, void *); + bfd_vma (*bfd_h_getx16) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); + void (*bfd_h_putx16) (bfd_vma, void *); + + /* Format dependent routines: these are vectors of entry points + within the target vector structure, one for each format to check. */ + + /* Check the format of a file being read. Return a `bfd_target *' or zero. */ + const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + + /* Set the format of a file being written. */ + bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); + + /* Write cached information into a file being written, at `bfd_close'. */ + bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); + The general target vector. These vectors are initialized using the +BFD_JUMP_TABLE macros. + + /* Generic entry points. */ + #define BFD_JUMP_TABLE_GENERIC(NAME) \ + NAME##_close_and_cleanup, \ + NAME##_bfd_free_cached_info, \ + NAME##_new_section_hook, \ + NAME##_get_section_contents, \ + NAME##_get_section_contents_in_window + + /* Called when the BFD is being closed to do any necessary cleanup. */ + bfd_boolean (*_close_and_cleanup) (bfd *); + /* Ask the BFD to free all cached information. */ + bfd_boolean (*_bfd_free_cached_info) (bfd *); + /* Called when a new section is created. */ + bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); + /* Read the contents of a section. */ + bfd_boolean (*_bfd_get_section_contents) + (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) + (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + + /* Entry points to copy private data. */ + #define BFD_JUMP_TABLE_COPY(NAME) \ + NAME##_bfd_copy_private_bfd_data, \ + NAME##_bfd_merge_private_bfd_data, \ + NAME##_bfd_copy_private_section_data, \ + NAME##_bfd_copy_private_symbol_data, \ + NAME##_bfd_copy_private_header_data, \ + NAME##_bfd_set_private_flags, \ + NAME##_bfd_print_private_bfd_data + + /* Called to copy BFD general private data from one object file + to another. */ + bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); + /* Called to merge BFD general private data from one object file + to a common output file when linking. */ + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + /* Called to copy BFD private section data from one object file + to another. */ + bfd_boolean (*_bfd_copy_private_section_data) + (bfd *, sec_ptr, bfd *, sec_ptr); + /* Called to copy BFD private symbol data from one symbol + to another. */ + bfd_boolean (*_bfd_copy_private_symbol_data) + (bfd *, asymbol *, bfd *, asymbol *); + /* Called to copy BFD private header data from one object file + to another. */ + bfd_boolean (*_bfd_copy_private_header_data) + (bfd *, bfd *); + /* Called to set private backend flags. */ + bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); + + /* Called to print private BFD data. */ + bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); + + /* Core file entry points. */ + #define BFD_JUMP_TABLE_CORE(NAME) \ + NAME##_core_file_failing_command, \ + NAME##_core_file_failing_signal, \ + NAME##_core_file_matches_executable_p + + char * (*_core_file_failing_command) (bfd *); + int (*_core_file_failing_signal) (bfd *); + bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); + + /* Archive entry points. */ + #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ + NAME##_slurp_armap, \ + NAME##_slurp_extended_name_table, \ + NAME##_construct_extended_name_table, \ + NAME##_truncate_arname, \ + NAME##_write_armap, \ + NAME##_read_ar_hdr, \ + NAME##_openr_next_archived_file, \ + NAME##_get_elt_at_index, \ + NAME##_generic_stat_arch_elt, \ + NAME##_update_armap_timestamp + + bfd_boolean (*_bfd_slurp_armap) (bfd *); + bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); + bfd_boolean (*_bfd_construct_extended_name_table) + (bfd *, char **, bfd_size_type *, const char **); + void (*_bfd_truncate_arname) (bfd *, const char *, char *); + bfd_boolean (*write_armap) + (bfd *, unsigned int, struct orl *, unsigned int, int); + void * (*_bfd_read_ar_hdr_fn) (bfd *); + bfd * (*openr_next_archived_file) (bfd *, bfd *); + #define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) + bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); + int (*_bfd_stat_arch_elt) (bfd *, struct stat *); + bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); + + /* Entry points used for symbols. */ + #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ + NAME##_get_symtab_upper_bound, \ + NAME##_canonicalize_symtab, \ + NAME##_make_empty_symbol, \ + NAME##_print_symbol, \ + NAME##_get_symbol_info, \ + NAME##_bfd_is_local_label_name, \ + NAME##_bfd_is_target_special_symbol, \ + NAME##_get_lineno, \ + NAME##_find_nearest_line, \ + NAME##_bfd_make_debug_symbol, \ + NAME##_read_minisymbols, \ + NAME##_minisymbol_to_symbol + + long (*_bfd_get_symtab_upper_bound) (bfd *); + long (*_bfd_canonicalize_symtab) + (bfd *, struct bfd_symbol **); + struct bfd_symbol * + (*_bfd_make_empty_symbol) (bfd *); + void (*_bfd_print_symbol) + (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); + #define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) + (bfd *, struct bfd_symbol *, symbol_info *); + #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); + bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); + alent * (*_get_lineno) (bfd *, struct bfd_symbol *); + bfd_boolean (*_bfd_find_nearest_line) + (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + const char **, const char **, unsigned int *); + /* Back-door to allow format-aware applications to create debug symbols + while using BFD for everything else. Currently used by the assembler + when creating COFF files. */ + asymbol * (*_bfd_make_debug_symbol) + (bfd *, void *, unsigned long size); + #define bfd_read_minisymbols(b, d, m, s) \ + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) + (bfd *, bfd_boolean, void **, unsigned int *); + #define bfd_minisymbol_to_symbol(b, d, m, f) \ + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) + (bfd *, bfd_boolean, const void *, asymbol *); + + /* Routines for relocs. */ + #define BFD_JUMP_TABLE_RELOCS(NAME) \ + NAME##_get_reloc_upper_bound, \ + NAME##_canonicalize_reloc, \ + NAME##_bfd_reloc_type_lookup + + long (*_get_reloc_upper_bound) (bfd *, sec_ptr); + long (*_bfd_canonicalize_reloc) + (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + /* See documentation on reloc types. */ + reloc_howto_type * + (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); + + /* Routines used when writing an object file. */ + #define BFD_JUMP_TABLE_WRITE(NAME) \ + NAME##_set_arch_mach, \ + NAME##_set_section_contents + + bfd_boolean (*_bfd_set_arch_mach) + (bfd *, enum bfd_architecture, unsigned long); + bfd_boolean (*_bfd_set_section_contents) + (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + + /* Routines used by the linker. */ + #define BFD_JUMP_TABLE_LINK(NAME) \ + NAME##_sizeof_headers, \ + NAME##_bfd_get_relocated_section_contents, \ + NAME##_bfd_relax_section, \ + NAME##_bfd_link_hash_table_create, \ + NAME##_bfd_link_hash_table_free, \ + NAME##_bfd_link_add_symbols, \ + NAME##_bfd_link_just_syms, \ + NAME##_bfd_final_link, \ + NAME##_bfd_link_split_section, \ + NAME##_bfd_gc_sections, \ + NAME##_bfd_merge_sections, \ + NAME##_bfd_is_group_section, \ + NAME##_bfd_discard_group, \ + NAME##_section_already_linked \ + + int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); + bfd_byte * (*_bfd_get_relocated_section_contents) + (bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, bfd_boolean, struct bfd_symbol **); + + bfd_boolean (*_bfd_relax_section) + (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + + /* Create a hash table for the linker. Different backends store + different information in this table. */ + struct bfd_link_hash_table * + (*_bfd_link_hash_table_create) (bfd *); + + /* Release the memory associated with the linker hash table. */ + void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); + + /* Add symbols from this object file into the hash table. */ + bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); + + /* Indicate that we are only retrieving symbol values from this section. */ + void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); + + /* Do a link based on the link_order structures attached to each + section of the BFD. */ + bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); + + /* Should this section be split up into smaller pieces during linking. */ + bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + + /* Remove sections that are not referenced from the output. */ + bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); + + /* Attempt to merge SEC_MERGE sections. */ + bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); + + /* Is this section a member of a group? */ + bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + + /* Discard members of a group. */ + bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); + + /* Check if SEC has been already linked during a reloceatable or + final link. */ + void (*_section_already_linked) (bfd *, struct bfd_section *); + + /* Routines to handle dynamic symbols and relocs. */ + #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ + NAME##_get_dynamic_symtab_upper_bound, \ + NAME##_canonicalize_dynamic_symtab, \ + NAME##_get_synthetic_symtab, \ + NAME##_get_dynamic_reloc_upper_bound, \ + NAME##_canonicalize_dynamic_reloc + + /* Get the amount of memory required to hold the dynamic symbols. */ + long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); + /* Read in the dynamic symbols. */ + long (*_bfd_canonicalize_dynamic_symtab) + (bfd *, struct bfd_symbol **); + /* Create synthetized symbols. */ + long (*_bfd_get_synthetic_symtab) + (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, + struct bfd_symbol **); + /* Get the amount of memory required to hold the dynamic relocs. */ + long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); + /* Read in the dynamic relocs. */ + long (*_bfd_canonicalize_dynamic_reloc) + (bfd *, arelent **, struct bfd_symbol **); + A pointer to an alternative bfd_target in case the current one is not +satisfactory. This can happen when the target cpu supports both big +and little endian code, and target chosen by the linker has the wrong +endianness. The function open_output() in ld/ldlang.c uses this field +to find an alternative output format that is suitable. + /* Opposite endian version of this target. */ + const struct bfd_target * alternative_target; + + /* Data for use by back-end routines, which isn't + generic enough to belong in this structure. */ + const void *backend_data; + + } bfd_target; + +2.13.1.1 `bfd_set_default_target' +................................. + +*Synopsis* + bfd_boolean bfd_set_default_target (const char *name); + *Description* +Set the default target vector to use when recognizing a BFD. This +takes the name of the target, which may be a BFD target name or a +configuration triplet. + +2.13.1.2 `bfd_find_target' +.......................... + +*Synopsis* + const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); + *Description* +Return a pointer to the transfer vector for the object target named +TARGET_NAME. If TARGET_NAME is `NULL', choose the one in the +environment variable `GNUTARGET'; if that is null or not defined, then +choose the first entry in the target list. Passing in the string +"default" or setting the environment variable to "default" will cause +the first entry in the target list to be returned, and +"target_defaulted" will be set in the BFD. This causes +`bfd_check_format' to loop over all the targets to find the one that +matches the file being read. + +2.13.1.3 `bfd_target_list' +.......................... + +*Synopsis* + const char ** bfd_target_list (void); + *Description* +Return a freshly malloced NULL-terminated vector of the names of all +the valid BFD targets. Do not modify the names. + +2.13.1.4 `bfd_seach_for_target' +............................... + +*Synopsis* + const bfd_target *bfd_search_for_target + (int (*search_func) (const bfd_target *, void *), + void *); + *Description* +Return a pointer to the first transfer vector in the list of transfer +vectors maintained by BFD that produces a non-zero result when passed +to the function SEARCH_FUNC. The parameter DATA is passed, unexamined, +to the search function. + + +File: bfd.info, Node: Architectures, Next: Opening and Closing, Prev: Targets, Up: BFD front end + +2.14 Architectures +================== + +BFD keeps one atom in a BFD describing the architecture of the data +attached to the BFD: a pointer to a `bfd_arch_info_type'. + + Pointers to structures can be requested independently of a BFD so +that an architecture's information can be interrogated without access +to an open BFD. + + The architecture information is provided by each architecture +package. The set of default architectures is selected by the macro +`SELECT_ARCHITECTURES'. This is normally set up in the +`config/TARGET.mt' file of your choice. If the name is not defined, +then all the architectures supported are included. + + When BFD starts up, all the architectures are called with an +initialize method. It is up to the architecture back end to insert as +many items into the list of architectures as it wants to; generally +this would be one for each machine and one for the default case (an +item with a machine field of 0). + + BFD's idea of an architecture is implemented in `archures.c'. + +2.14.1 bfd_architecture +----------------------- + +*Description* +This enum gives the object file's CPU architecture, in a global +sense--i.e., what processor family does it belong to? Another field +indicates which processor within the family is in use. The machine +gives a number which distinguishes different versions of the +architecture, containing, for example, 2 and 3 for Intel i960 KA and +i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. + enum bfd_architecture + { + bfd_arch_unknown, /* File arch not known. */ + bfd_arch_obscure, /* Arch known, not one of these. */ + bfd_arch_m68k, /* Motorola 68xxx */ + #define bfd_mach_m68000 1 + #define bfd_mach_m68008 2 + #define bfd_mach_m68010 3 + #define bfd_mach_m68020 4 + #define bfd_mach_m68030 5 + #define bfd_mach_m68040 6 + #define bfd_mach_m68060 7 + #define bfd_mach_cpu32 8 + #define bfd_mach_mcf5200 9 + #define bfd_mach_mcf5206e 10 + #define bfd_mach_mcf5307 11 + #define bfd_mach_mcf5407 12 + #define bfd_mach_mcf528x 13 + #define bfd_mach_mcfv4e 14 + #define bfd_mach_mcf521x 15 + #define bfd_mach_mcf5249 16 + #define bfd_mach_mcf547x 17 + #define bfd_mach_mcf548x 18 + bfd_arch_vax, /* DEC Vax */ + bfd_arch_i960, /* Intel 960 */ + /* The order of the following is important. + lower number indicates a machine type that + only accepts a subset of the instructions + available to machines with higher numbers. + The exception is the "ca", which is + incompatible with all other machines except + "core". */ + + #define bfd_mach_i960_core 1 + #define bfd_mach_i960_ka_sa 2 + #define bfd_mach_i960_kb_sb 3 + #define bfd_mach_i960_mc 4 + #define bfd_mach_i960_xa 5 + #define bfd_mach_i960_ca 6 + #define bfd_mach_i960_jx 7 + #define bfd_mach_i960_hx 8 + + bfd_arch_or32, /* OpenRISC 32 */ + + bfd_arch_a29k, /* AMD 29000 */ + bfd_arch_sparc, /* SPARC */ + #define bfd_mach_sparc 1 + /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ + #define bfd_mach_sparc_sparclet 2 + #define bfd_mach_sparc_sparclite 3 + #define bfd_mach_sparc_v8plus 4 + #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ + #define bfd_mach_sparc_sparclite_le 6 + #define bfd_mach_sparc_v9 7 + #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ + #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ + #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ + /* Nonzero if MACH has the v9 instruction set. */ + #define bfd_mach_sparc_v9_p(mach) \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + && (mach) != bfd_mach_sparc_sparclite_le) + /* Nonzero if MACH is a 64 bit sparc architecture. */ + #define bfd_mach_sparc_64bit_p(mach) \ + ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) + bfd_arch_mips, /* MIPS Rxxxx */ + #define bfd_mach_mips3000 3000 + #define bfd_mach_mips3900 3900 + #define bfd_mach_mips4000 4000 + #define bfd_mach_mips4010 4010 + #define bfd_mach_mips4100 4100 + #define bfd_mach_mips4111 4111 + #define bfd_mach_mips4120 4120 + #define bfd_mach_mips4300 4300 + #define bfd_mach_mips4400 4400 + #define bfd_mach_mips4600 4600 + #define bfd_mach_mips4650 4650 + #define bfd_mach_mips5000 5000 + #define bfd_mach_mips5400 5400 + #define bfd_mach_mips5500 5500 + #define bfd_mach_mips6000 6000 + #define bfd_mach_mips7000 7000 + #define bfd_mach_mips8000 8000 + #define bfd_mach_mips10000 10000 + #define bfd_mach_mips12000 12000 + #define bfd_mach_mips16 16 + #define bfd_mach_mips5 5 + #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ + #define bfd_mach_mipsisa32 32 + #define bfd_mach_mipsisa32r2 33 + #define bfd_mach_mipsisa64 64 + #define bfd_mach_mipsisa64r2 65 + bfd_arch_i386, /* Intel 386 */ + #define bfd_mach_i386_i386 1 + #define bfd_mach_i386_i8086 2 + #define bfd_mach_i386_i386_intel_syntax 3 + #define bfd_mach_x86_64 64 + #define bfd_mach_x86_64_intel_syntax 65 + bfd_arch_we32k, /* AT&T WE32xxx */ + bfd_arch_tahoe, /* CCI/Harris Tahoe */ + bfd_arch_i860, /* Intel 860 */ + bfd_arch_i370, /* IBM 360/370 Mainframes */ + bfd_arch_romp, /* IBM ROMP PC/RT */ + bfd_arch_alliant, /* Alliant */ + bfd_arch_convex, /* Convex */ + bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_m98k, /* Motorola 98xxx */ + bfd_arch_pyramid, /* Pyramid Technology */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ + #define bfd_mach_h8300 1 + #define bfd_mach_h8300h 2 + #define bfd_mach_h8300s 3 + #define bfd_mach_h8300hn 4 + #define bfd_mach_h8300sn 5 + #define bfd_mach_h8300sx 6 + #define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11 */ + bfd_arch_powerpc, /* PowerPC */ + #define bfd_mach_ppc 32 + #define bfd_mach_ppc64 64 + #define bfd_mach_ppc_403 403 + #define bfd_mach_ppc_403gc 4030 + #define bfd_mach_ppc_505 505 + #define bfd_mach_ppc_601 601 + #define bfd_mach_ppc_602 602 + #define bfd_mach_ppc_603 603 + #define bfd_mach_ppc_ec603e 6031 + #define bfd_mach_ppc_604 604 + #define bfd_mach_ppc_620 620 + #define bfd_mach_ppc_630 630 + #define bfd_mach_ppc_750 750 + #define bfd_mach_ppc_860 860 + #define bfd_mach_ppc_a35 35 + #define bfd_mach_ppc_rs64ii 642 + #define bfd_mach_ppc_rs64iii 643 + #define bfd_mach_ppc_7400 7400 + #define bfd_mach_ppc_e500 500 + bfd_arch_rs6000, /* IBM RS/6000 */ + #define bfd_mach_rs6k 6000 + #define bfd_mach_rs6k_rs1 6001 + #define bfd_mach_rs6k_rsc 6003 + #define bfd_mach_rs6k_rs2 6002 + bfd_arch_hppa, /* HP PA RISC */ + #define bfd_mach_hppa10 10 + #define bfd_mach_hppa11 11 + #define bfd_mach_hppa20 20 + #define bfd_mach_hppa20w 25 + bfd_arch_d10v, /* Mitsubishi D10V */ + #define bfd_mach_d10v 1 + #define bfd_mach_d10v_ts2 2 + #define bfd_mach_d10v_ts3 3 + bfd_arch_d30v, /* Mitsubishi D30V */ + bfd_arch_dlx, /* DLX */ + bfd_arch_m68hc11, /* Motorola 68HC11 */ + bfd_arch_m68hc12, /* Motorola 68HC12 */ + #define bfd_mach_m6812_default 0 + #define bfd_mach_m6812 1 + #define bfd_mach_m6812s 2 + bfd_arch_z8k, /* Zilog Z8000 */ + #define bfd_mach_z8001 1 + #define bfd_mach_z8002 2 + bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ + #define bfd_mach_sh 1 + #define bfd_mach_sh2 0x20 + #define bfd_mach_sh_dsp 0x2d + #define bfd_mach_sh2a 0x2a + #define bfd_mach_sh2a_nofpu 0x2b + #define bfd_mach_sh2e 0x2e + #define bfd_mach_sh3 0x30 + #define bfd_mach_sh3_nommu 0x31 + #define bfd_mach_sh3_dsp 0x3d + #define bfd_mach_sh3e 0x3e + #define bfd_mach_sh4 0x40 + #define bfd_mach_sh4_nofpu 0x41 + #define bfd_mach_sh4_nommu_nofpu 0x42 + #define bfd_mach_sh4a 0x4a + #define bfd_mach_sh4a_nofpu 0x4b + #define bfd_mach_sh4al_dsp 0x4d + #define bfd_mach_sh5 0x50 + bfd_arch_alpha, /* Dec Alpha */ + #define bfd_mach_alpha_ev4 0x10 + #define bfd_mach_alpha_ev5 0x20 + #define bfd_mach_alpha_ev6 0x30 + bfd_arch_arm, /* Advanced Risc Machines ARM. */ + #define bfd_mach_arm_unknown 0 + #define bfd_mach_arm_2 1 + #define bfd_mach_arm_2a 2 + #define bfd_mach_arm_3 3 + #define bfd_mach_arm_3M 4 + #define bfd_mach_arm_4 5 + #define bfd_mach_arm_4T 6 + #define bfd_mach_arm_5 7 + #define bfd_mach_arm_5T 8 + #define bfd_mach_arm_5TE 9 + #define bfd_mach_arm_XScale 10 + #define bfd_mach_arm_ep9312 11 + #define bfd_mach_arm_iWMMXt 12 + bfd_arch_ns32k, /* National Semiconductors ns32000 */ + bfd_arch_w65, /* WDC 65816 */ + bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ + #define bfd_mach_tic3x 30 + #define bfd_mach_tic4x 40 + bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ + bfd_arch_tic80, /* TI TMS320c80 (MVP) */ + bfd_arch_v850, /* NEC V850 */ + #define bfd_mach_v850 1 + #define bfd_mach_v850e 'E' + #define bfd_mach_v850e1 '1' + bfd_arch_arc, /* ARC Cores */ + #define bfd_mach_arc_5 5 + #define bfd_mach_arc_6 6 + #define bfd_mach_arc_7 7 + #define bfd_mach_arc_8 8 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ + #define bfd_mach_m32r 1 /* For backwards compatibility. */ + #define bfd_mach_m32rx 'x' + #define bfd_mach_m32r2 '2' + bfd_arch_mn10200, /* Matsushita MN10200 */ + bfd_arch_mn10300, /* Matsushita MN10300 */ + #define bfd_mach_mn10300 300 + #define bfd_mach_am33 330 + #define bfd_mach_am33_2 332 + bfd_arch_fr30, + #define bfd_mach_fr30 0x46523330 + bfd_arch_frv, + #define bfd_mach_frv 1 + #define bfd_mach_frvsimple 2 + #define bfd_mach_fr300 300 + #define bfd_mach_fr400 400 + #define bfd_mach_fr450 450 + #define bfd_mach_frvtomcat 499 /* fr500 prototype */ + #define bfd_mach_fr500 500 + #define bfd_mach_fr550 550 + bfd_arch_mcore, + bfd_arch_ia64, /* HP/Intel ia64 */ + #define bfd_mach_ia64_elf64 64 + #define bfd_mach_ia64_elf32 32 + bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ + #define bfd_mach_ip2022 1 + #define bfd_mach_ip2022ext 2 + bfd_arch_iq2000, /* Vitesse IQ2000. */ + #define bfd_mach_iq2000 1 + #define bfd_mach_iq10 2 + bfd_arch_pj, + bfd_arch_avr, /* Atmel AVR microcontrollers. */ + #define bfd_mach_avr1 1 + #define bfd_mach_avr2 2 + #define bfd_mach_avr3 3 + #define bfd_mach_avr4 4 + #define bfd_mach_avr5 5 + bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ + #define bfd_mach_cr16c 1 + bfd_arch_crx, /* National Semiconductor CRX. */ + #define bfd_mach_crx 1 + bfd_arch_cris, /* Axis CRIS */ + bfd_arch_s390, /* IBM s390 */ + #define bfd_mach_s390_31 31 + #define bfd_mach_s390_64 64 + bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_mmix, /* Donald Knuth's educational processor. */ + bfd_arch_xstormy16, + #define bfd_mach_xstormy16 1 + bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ + #define bfd_mach_msp11 11 + #define bfd_mach_msp110 110 + #define bfd_mach_msp12 12 + #define bfd_mach_msp13 13 + #define bfd_mach_msp14 14 + #define bfd_mach_msp15 15 + #define bfd_mach_msp16 16 + #define bfd_mach_msp31 31 + #define bfd_mach_msp32 32 + #define bfd_mach_msp33 33 + #define bfd_mach_msp41 41 + #define bfd_mach_msp42 42 + #define bfd_mach_msp43 43 + #define bfd_mach_msp44 44 + bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ + #define bfd_mach_xtensa 1 + bfd_arch_last + }; + +2.14.2 bfd_arch_info +-------------------- + +*Description* +This structure contains information on architectures for use within BFD. + + typedef struct bfd_arch_info + { + int bits_per_word; + int bits_per_address; + int bits_per_byte; + enum bfd_architecture arch; + unsigned long mach; + const char *arch_name; + const char *printable_name; + unsigned int section_align_power; + /* TRUE if this is the default machine for the architecture. + The default arch should be the first entry for an arch so that + all the entries for that arch can be accessed via `next'. */ + bfd_boolean the_default; + const struct bfd_arch_info * (*compatible) + (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + + bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); + + const struct bfd_arch_info *next; + } + bfd_arch_info_type; + +2.14.2.1 `bfd_printable_name' +............................. + +*Synopsis* + const char *bfd_printable_name (bfd *abfd); + *Description* +Return a printable string representing the architecture and machine +from the pointer to the architecture info structure. + +2.14.2.2 `bfd_scan_arch' +........................ + +*Synopsis* + const bfd_arch_info_type *bfd_scan_arch (const char *string); + *Description* +Figure out if BFD supports any cpu which could be described with the +name STRING. Return a pointer to an `arch_info' structure if a machine +is found, otherwise NULL. + +2.14.2.3 `bfd_arch_list' +........................ + +*Synopsis* + const char **bfd_arch_list (void); + *Description* +Return a freshly malloced NULL-terminated vector of the names of all +the valid BFD architectures. Do not modify the names. + +2.14.2.4 `bfd_arch_get_compatible' +.................................. + +*Synopsis* + const bfd_arch_info_type *bfd_arch_get_compatible + (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); + *Description* +Determine whether two BFDs' architectures and machine types are +compatible. Calculates the lowest common denominator between the two +architectures and machine types implied by the BFDs and returns a +pointer to an `arch_info' structure describing the compatible machine. + +2.14.2.5 `bfd_default_arch_struct' +.................................. + +*Description* +The `bfd_default_arch_struct' is an item of `bfd_arch_info_type' which +has been initialized to a fairly generic state. A BFD starts life by +pointing to this structure, until the correct back end has determined +the real architecture of the file. + extern const bfd_arch_info_type bfd_default_arch_struct; + +2.14.2.6 `bfd_set_arch_info' +............................ + +*Synopsis* + void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); + *Description* +Set the architecture info of ABFD to ARG. + +2.14.2.7 `bfd_default_set_arch_mach' +.................................... + +*Synopsis* + bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); + *Description* +Set the architecture and machine type in BFD ABFD to ARCH and MACH. +Find the correct pointer to a structure and insert it into the +`arch_info' pointer. + +2.14.2.8 `bfd_get_arch' +....................... + +*Synopsis* + enum bfd_architecture bfd_get_arch (bfd *abfd); + *Description* +Return the enumerated type which describes the BFD ABFD's architecture. + +2.14.2.9 `bfd_get_mach' +....................... + +*Synopsis* + unsigned long bfd_get_mach (bfd *abfd); + *Description* +Return the long type which describes the BFD ABFD's machine. + +2.14.2.10 `bfd_arch_bits_per_byte' +.................................. + +*Synopsis* + unsigned int bfd_arch_bits_per_byte (bfd *abfd); + *Description* +Return the number of bits in one of the BFD ABFD's architecture's bytes. + +2.14.2.11 `bfd_arch_bits_per_address' +..................................... + +*Synopsis* + unsigned int bfd_arch_bits_per_address (bfd *abfd); + *Description* +Return the number of bits in one of the BFD ABFD's architecture's +addresses. + +2.14.2.12 `bfd_default_compatible' +.................................. + +*Synopsis* + const bfd_arch_info_type *bfd_default_compatible + (const bfd_arch_info_type *a, const bfd_arch_info_type *b); + *Description* +The default function for testing for compatibility. + +2.14.2.13 `bfd_default_scan' +............................ + +*Synopsis* + bfd_boolean bfd_default_scan + (const struct bfd_arch_info *info, const char *string); + *Description* +The default function for working out whether this is an architecture +hit and a machine hit. + +2.14.2.14 `bfd_get_arch_info' +............................. + +*Synopsis* + const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); + *Description* +Return the architecture info struct in ABFD. + +2.14.2.15 `bfd_lookup_arch' +........................... + +*Synopsis* + const bfd_arch_info_type *bfd_lookup_arch + (enum bfd_architecture arch, unsigned long machine); + *Description* +Look for the architecture info structure which matches the arguments +ARCH and MACHINE. A machine of 0 matches the machine/architecture +structure which marks itself as the default. + +2.14.2.16 `bfd_printable_arch_mach' +................................... + +*Synopsis* + const char *bfd_printable_arch_mach + (enum bfd_architecture arch, unsigned long machine); + *Description* +Return a printable string representing the architecture and machine +type. + + This routine is depreciated. + +2.14.2.17 `bfd_octets_per_byte' +............................... + +*Synopsis* + unsigned int bfd_octets_per_byte (bfd *abfd); + *Description* +Return the number of octets (8-bit quantities) per target byte (minimum +addressable unit). In most cases, this will be one, but some DSP +targets have 16, 32, or even 48 bits per byte. + +2.14.2.18 `bfd_arch_mach_octets_per_byte' +......................................... + +*Synopsis* + unsigned int bfd_arch_mach_octets_per_byte + (enum bfd_architecture arch, unsigned long machine); + *Description* +See bfd_octets_per_byte. + + This routine is provided for those cases where a bfd * is not +available + + +File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end + +2.15 Opening and closing BFDs +============================= + +2.15.0.1 `bfd_openr' +.................... + +*Synopsis* + bfd *bfd_openr (const char *filename, const char *target); + *Description* +Open the file FILENAME (using `fopen') with the target TARGET. Return +a pointer to the created BFD. + + Calls `bfd_find_target', so TARGET is interpreted as by that +function. + + If `NULL' is returned then an error has occured. Possible errors +are `bfd_error_no_memory', `bfd_error_invalid_target' or `system_call' +error. + +2.15.0.2 `bfd_fdopenr' +...................... + +*Synopsis* + bfd *bfd_fdopenr (const char *filename, const char *target, int fd); + *Description* +`bfd_fdopenr' is to `bfd_fopenr' much like `fdopen' is to `fopen'. It +opens a BFD on a file already described by the FD supplied. + + When the file is later `bfd_close'd, the file descriptor will be +closed. If the caller desires that this file descriptor be cached by +BFD (opened as needed, closed as needed to free descriptors for other +opens), with the supplied FD used as an initial file descriptor (but +subject to closure at any time), call bfd_set_cacheable(bfd, 1) on the +returned BFD. The default is to assume no caching; the file descriptor +will remain open until `bfd_close', and will not be affected by BFD +operations on other files. + + Possible errors are `bfd_error_no_memory', +`bfd_error_invalid_target' and `bfd_error_system_call'. + +2.15.0.3 `bfd_openstreamr' +.......................... + +*Synopsis* + bfd *bfd_openstreamr (const char *, const char *, void *); + *Description* +Open a BFD for read access on an existing stdio stream. When the BFD +is passed to `bfd_close', the stream will be closed. + +2.15.0.4 `bfd_openr_iovec' +.......................... + +*Synopsis* + bfd *bfd_openr_iovec (const char *filename, const char *target, + void *(*open) (struct bfd *nbfd, + void *open_closure), + void *open_closure, + file_ptr (*pread) (struct bfd *nbfd, + void *stream, + void *buf, + file_ptr nbytes, + file_ptr offset), + int (*close) (struct bfd *nbfd, + void *stream)); + *Description* +Create and return a BFD backed by a read-only STREAM. The STREAM is +created using OPEN, accessed using PREAD and destroyed using CLOSE. + + Calls `bfd_find_target', so TARGET is interpreted as by that +function. + + Calls OPEN (which can call `bfd_zalloc' and `bfd_get_filename') to +obtain the read-only stream backing the BFD. OPEN either succeeds +returning the non-`NULL' STREAM, or fails returning `NULL' (setting +`bfd_error'). + + Calls PREAD to request NBYTES of data from STREAM starting at OFFSET +(e.g., via a call to `bfd_read'). PREAD either succeeds returning the +number of bytes read (which can be less than NBYTES when end-of-file), +or fails returning -1 (setting `bfd_error'). + + Calls CLOSE when the BFD is later closed using `bfd_close'. CLOSE +either succeeds returning 0, or fails returning -1 (setting +`bfd_error'). + + If `bfd_openr_iovec' returns `NULL' then an error has occurred. +Possible errors are `bfd_error_no_memory', `bfd_error_invalid_target' +and `bfd_error_system_call'. + +2.15.0.5 `bfd_openw' +.................... + +*Synopsis* + bfd *bfd_openw (const char *filename, const char *target); + *Description* +Create a BFD, associated with file FILENAME, using the file format +TARGET, and return a pointer to it. + + Possible errors are `bfd_error_system_call', `bfd_error_no_memory', +`bfd_error_invalid_target'. + +2.15.0.6 `bfd_close' +.................... + +*Synopsis* + bfd_boolean bfd_close (bfd *abfd); + *Description* +Close a BFD. If the BFD was open for writing, then pending operations +are completed and the file written out and closed. If the created file +is executable, then `chmod' is called to mark it as such. + + All memory attached to the BFD is released. + + The file descriptor associated with the BFD is closed (even if it +was passed in to BFD by `bfd_fdopenr'). + + *Returns* +`TRUE' is returned if all is ok, otherwise `FALSE'. + +2.15.0.7 `bfd_close_all_done' +............................. + +*Synopsis* + bfd_boolean bfd_close_all_done (bfd *); + *Description* +Close a BFD. Differs from `bfd_close' since it does not complete any +pending operations. This routine would be used if the application had +just used BFD for swapping and didn't want to use any of the writing +code. + + If the created file is executable, then `chmod' is called to mark it +as such. + + All memory attached to the BFD is released. + + *Returns* +`TRUE' is returned if all is ok, otherwise `FALSE'. + +2.15.0.8 `bfd_create' +..................... + +*Synopsis* + bfd *bfd_create (const char *filename, bfd *templ); + *Description* +Create a new BFD in the manner of `bfd_openw', but without opening a +file. The new BFD takes the target from the target used by TEMPLATE. +The format is always set to `bfd_object'. + +2.15.0.9 `bfd_make_writable' +............................ + +*Synopsis* + bfd_boolean bfd_make_writable (bfd *abfd); + *Description* +Takes a BFD as created by `bfd_create' and converts it into one like as +returned by `bfd_openw'. It does this by converting the BFD to +BFD_IN_MEMORY. It's assumed that you will call `bfd_make_readable' on +this bfd later. + + *Returns* +`TRUE' is returned if all is ok, otherwise `FALSE'. + +2.15.0.10 `bfd_make_readable' +............................. + +*Synopsis* + bfd_boolean bfd_make_readable (bfd *abfd); + *Description* +Takes a BFD as created by `bfd_create' and `bfd_make_writable' and +converts it into one like as returned by `bfd_openr'. It does this by +writing the contents out to the memory buffer, then reversing the +direction. + + *Returns* +`TRUE' is returned if all is ok, otherwise `FALSE'. + +2.15.0.11 `bfd_alloc' +..................... + +*Synopsis* + void *bfd_alloc (bfd *abfd, bfd_size_type wanted); + *Description* +Allocate a block of WANTED bytes of memory attached to `abfd' and +return a pointer to it. + +2.15.0.12 `bfd_calc_gnu_debuglink_crc32' +........................................ + +*Synopsis* + unsigned long bfd_calc_gnu_debuglink_crc32 + (unsigned long crc, const unsigned char *buf, bfd_size_type len); + *Description* +Computes a CRC value as used in the .gnu_debuglink section. Advances +the previously computed CRC value by computing and adding in the crc32 +for LEN bytes of BUF. + + *Returns* +Return the updated CRC32 value. + +2.15.0.13 `get_debug_link_info' +............................... + +*Synopsis* + char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + *Description* +fetch the filename and CRC32 value for any separate debuginfo +associated with ABFD. Return NULL if no such info found, otherwise +return filename and update CRC32_OUT. + +2.15.0.14 `separate_debug_file_exists' +...................................... + +*Synopsis* + bfd_boolean separate_debug_file_exists + (char *name, unsigned long crc32); + *Description* +Checks to see if NAME is a file and if its contents match CRC32. + +2.15.0.15 `find_separate_debug_file' +.................................... + +*Synopsis* + char *find_separate_debug_file (bfd *abfd); + *Description* +Searches ABFD for a reference to separate debugging information, scans +various locations in the filesystem, including the file tree rooted at +DEBUG_FILE_DIRECTORY, and returns a filename of such debugging +information if the file is found and has matching CRC32. Returns NULL +if no reference to debugging file exists, or file cannot be found. + +2.15.0.16 `bfd_follow_gnu_debuglink' +.................................... + +*Synopsis* + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); + *Description* +Takes a BFD and searches it for a .gnu_debuglink section. If this +section is found, it examines the section for the name and checksum of +a '.debug' file containing auxiliary debugging information. It then +searches the filesystem for this .debug file in some standard +locations, including the directory tree rooted at DIR, and if found +returns the full filename. + + If DIR is NULL, it will search a default path configured into libbfd +at build time. [XXX this feature is not currently implemented]. + + *Returns* +`NULL' on any errors or failure to locate the .debug file, otherwise a +pointer to a heap-allocated string containing the filename. The caller +is responsible for freeing this string. + +2.15.0.17 `bfd_create_gnu_debuglink_section' +............................................ + +*Synopsis* + struct bfd_section *bfd_create_gnu_debuglink_section + (bfd *abfd, const char *filename); + *Description* +Takes a BFD and adds a .gnu_debuglink section to it. The section is +sized to be big enough to contain a link to the specified FILENAME. + + *Returns* +A pointer to the new section is returned if all is ok. Otherwise +`NULL' is returned and bfd_error is set. + +2.15.0.18 `bfd_fill_in_gnu_debuglink_section' +............................................. + +*Synopsis* + bfd_boolean bfd_fill_in_gnu_debuglink_section + (bfd *abfd, struct bfd_section *sect, const char *filename); + *Description* +Takes a BFD and containing a .gnu_debuglink section SECT and fills in +the contents of the section to contain a link to the specified +FILENAME. The filename should be relative to the current directory. + + *Returns* +`TRUE' is returned if all is ok. Otherwise `FALSE' is returned and +bfd_error is set. + + +File: bfd.info, Node: Internal, Next: File Caching, Prev: Opening and Closing, Up: BFD front end + +2.16 Internal functions +======================= + +*Description* +These routines are used within BFD. They are not intended for export, +but are documented here for completeness. + +2.16.0.1 `bfd_write_bigendian_4byte_int' +........................................ + +*Synopsis* + bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); + *Description* +Write a 4 byte integer I to the output BFD ABFD, in big endian order +regardless of what else is going on. This is useful in archives. + +2.16.0.2 `bfd_put_size' +....................... + +2.16.0.3 `bfd_get_size' +....................... + +*Description* +These macros as used for reading and writing raw data in sections; each +access (except for bytes) is vectored through the target format of the +BFD and mangled accordingly. The mangling performs any necessary endian +translations and removes alignment restrictions. Note that types +accepted and returned by these macros are identical so they can be +swapped around in macros--for example, `libaout.h' defines `GET_WORD' +to either `bfd_get_32' or `bfd_get_64'. + + In the put routines, VAL must be a `bfd_vma'. If we are on a system +without prototypes, the caller is responsible for making sure that is +true, with a cast if necessary. We don't cast them in the macro +definitions because that would prevent `lint' or `gcc -Wall' from +detecting sins such as passing a pointer. To detect calling these with +less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit +`bfd_vma''s. + + /* Byte swapping macros for user section data. */ + + #define bfd_put_8(abfd, val, ptr) \ + ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) + #define bfd_put_signed_8 \ + bfd_put_8 + #define bfd_get_8(abfd, ptr) \ + (*(unsigned char *) (ptr) & 0xff) + #define bfd_get_signed_8(abfd, ptr) \ + (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + + #define bfd_put_16(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) + #define bfd_put_signed_16 \ + bfd_put_16 + #define bfd_get_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx16, (ptr)) + #define bfd_get_signed_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) + + #define bfd_put_32(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) + #define bfd_put_signed_32 \ + bfd_put_32 + #define bfd_get_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx32, (ptr)) + #define bfd_get_signed_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) + + #define bfd_put_64(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) + #define bfd_put_signed_64 \ + bfd_put_64 + #define bfd_get_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx64, (ptr)) + #define bfd_get_signed_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) + + #define bfd_get(bits, abfd, ptr) \ + ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ + : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ + : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ + : (abort (), (bfd_vma) - 1)) + + #define bfd_put(bits, abfd, val, ptr) \ + ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ + : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ + : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ + : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ + : (abort (), (void) 0)) + +2.16.0.4 `bfd_h_put_size' +......................... + +*Description* +These macros have the same function as their `bfd_get_x' brethren, +except that they are used for removing information for the header +records of object files. Believe it or not, some object files keep +their header records in big endian order and their data in little +endian order. + + /* Byte swapping macros for file header data. */ + + #define bfd_h_put_8(abfd, val, ptr) \ + bfd_put_8 (abfd, val, ptr) + #define bfd_h_put_signed_8(abfd, val, ptr) \ + bfd_put_8 (abfd, val, ptr) + #define bfd_h_get_8(abfd, ptr) \ + bfd_get_8 (abfd, ptr) + #define bfd_h_get_signed_8(abfd, ptr) \ + bfd_get_signed_8 (abfd, ptr) + + #define bfd_h_put_16(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) + #define bfd_h_put_signed_16 \ + bfd_h_put_16 + #define bfd_h_get_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx16, (ptr)) + #define bfd_h_get_signed_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) + + #define bfd_h_put_32(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) + #define bfd_h_put_signed_32 \ + bfd_h_put_32 + #define bfd_h_get_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx32, (ptr)) + #define bfd_h_get_signed_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) + + #define bfd_h_put_64(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) + #define bfd_h_put_signed_64 \ + bfd_h_put_64 + #define bfd_h_get_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx64, (ptr)) + #define bfd_h_get_signed_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) + + /* Aliases for the above, which should eventually go away. */ + + #define H_PUT_64 bfd_h_put_64 + #define H_PUT_32 bfd_h_put_32 + #define H_PUT_16 bfd_h_put_16 + #define H_PUT_8 bfd_h_put_8 + #define H_PUT_S64 bfd_h_put_signed_64 + #define H_PUT_S32 bfd_h_put_signed_32 + #define H_PUT_S16 bfd_h_put_signed_16 + #define H_PUT_S8 bfd_h_put_signed_8 + #define H_GET_64 bfd_h_get_64 + #define H_GET_32 bfd_h_get_32 + #define H_GET_16 bfd_h_get_16 + #define H_GET_8 bfd_h_get_8 + #define H_GET_S64 bfd_h_get_signed_64 + #define H_GET_S32 bfd_h_get_signed_32 + #define H_GET_S16 bfd_h_get_signed_16 + #define H_GET_S8 bfd_h_get_signed_8 + +2.16.0.5 `bfd_log2' +................... + +*Synopsis* + unsigned int bfd_log2 (bfd_vma x); + *Description* +Return the log base 2 of the value supplied, rounded up. E.g., an X of +1025 returns 11. A X of 0 returns 0. + + +File: bfd.info, Node: File Caching, Next: Linker Functions, Prev: Internal, Up: BFD front end + +2.17 File caching +================= + +The file caching mechanism is embedded within BFD and allows the +application to open as many BFDs as it wants without regard to the +underlying operating system's file descriptor limit (often as low as 20 +open files). The module in `cache.c' maintains a least recently used +list of `BFD_CACHE_MAX_OPEN' files, and exports the name +`bfd_cache_lookup', which runs around and makes sure that the required +BFD is open. If not, then it chooses a file to close, closes it and +opens the one wanted, returning its file handle. + +2.17.0.1 `BFD_CACHE_MAX_OPEN macro' +................................... + +*Description* +The maximum number of files which the cache will keep open at one time. + #define BFD_CACHE_MAX_OPEN 10 + +2.17.0.2 `bfd_last_cache' +......................... + +*Synopsis* + extern bfd *bfd_last_cache; + *Description* +Zero, or a pointer to the topmost BFD on the chain. This is used by +the `bfd_cache_lookup' macro in `libbfd.h' to determine when it can +avoid a function call. + +2.17.0.3 `bfd_cache_lookup' +........................... + +*Description* +Check to see if the required BFD is the same as the last one looked up. +If so, then it can use the stream in the BFD with impunity, since it +can't have changed since the last lookup; otherwise, it has to perform +the complicated lookup function. + #define bfd_cache_lookup(x) \ + ((x) == bfd_last_cache ? \ + (FILE *) (bfd_last_cache->iostream): \ + bfd_cache_lookup_worker (x)) + +2.17.0.4 `bfd_cache_init' +......................... + +*Synopsis* + bfd_boolean bfd_cache_init (bfd *abfd); + *Description* +Add a newly opened BFD to the cache. + +2.17.0.5 `bfd_cache_close' +.......................... + +*Synopsis* + bfd_boolean bfd_cache_close (bfd *abfd); + *Description* +Remove the BFD ABFD from the cache. If the attached file is open, then +close it too. + + *Returns* +`FALSE' is returned if closing the file fails, `TRUE' is returned if +all is well. + +2.17.0.6 `bfd_cache_close_all' +.............................. + +*Synopsis* + bfd_boolean bfd_cache_close_all (void); + *Description* +Remove all BFDs from the cache. If the attached file is open, then +close it too. + + *Returns* +`FALSE' is returned if closing one of the file fails, `TRUE' is +returned if all is well. + +2.17.0.7 `bfd_open_file' +........................ + +*Synopsis* + FILE* bfd_open_file (bfd *abfd); + *Description* +Call the OS to open a file for ABFD. Return the `FILE *' (possibly +`NULL') that results from this operation. Set up the BFD so that +future accesses know the file is open. If the `FILE *' returned is +`NULL', then it won't have been put in the cache, so it won't have to +be removed from it. + +2.17.0.8 `bfd_cache_lookup_worker' +.................................. + +*Synopsis* + FILE *bfd_cache_lookup_worker (bfd *abfd); + *Description* +Called when the macro `bfd_cache_lookup' fails to find a quick answer. +Find a file descriptor for ABFD. If necessary, it open it. If there +are already more than `BFD_CACHE_MAX_OPEN' files open, it tries to +close one first, to avoid running out of file descriptors. It will +abort rather than returning NULL if it is unable to (re)open the ABFD. + + +File: bfd.info, Node: Linker Functions, Next: Hash Tables, Prev: File Caching, Up: BFD front end + +2.18 Linker Functions +===================== + +The linker uses three special entry points in the BFD target vector. +It is not necessary to write special routines for these entry points +when creating a new BFD back end, since generic versions are provided. +However, writing them can speed up linking and make it use +significantly less runtime memory. + + The first routine creates a hash table used by the other routines. +The second routine adds the symbols from an object file to the hash +table. The third routine takes all the object files and links them +together to create the output file. These routines are designed so +that the linker proper does not need to know anything about the symbols +in the object files that it is linking. The linker merely arranges the +sections as directed by the linker script and lets BFD handle the +details of symbols and relocs. + + The second routine and third routines are passed a pointer to a +`struct bfd_link_info' structure (defined in `bfdlink.h') which holds +information relevant to the link, including the linker hash table +(which was created by the first routine) and a set of callback +functions to the linker proper. + + The generic linker routines are in `linker.c', and use the header +file `genlink.h'. As of this writing, the only back ends which have +implemented versions of these routines are a.out (in `aoutx.h') and +ECOFF (in `ecoff.c'). The a.out routines are used as examples +throughout this section. + +* Menu: + +* Creating a Linker Hash Table:: +* Adding Symbols to the Hash Table:: +* Performing the Final Link:: + + +File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions + +2.18.1 Creating a linker hash table +----------------------------------- + +The linker routines must create a hash table, which must be derived +from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash +Tables::, for information on how to create a derived hash table. This +entry point is called using the target vector of the linker output file. + + The `_bfd_link_hash_table_create' entry point must allocate and +initialize an instance of the desired hash table. If the back end does +not require any additional information to be stored with the entries in +the hash table, the entry point may simply create a `struct +bfd_link_hash_table'. Most likely, however, some additional +information will be needed. + + For example, with each entry in the hash table the a.out linker +keeps the index the symbol has in the final output file (this index +number is used so that when doing a relocatable link the symbol index +used in the output file can be quickly filled in when copying over a +reloc). The a.out linker code defines the required structures and +functions for a hash table derived from `struct bfd_link_hash_table'. +The a.out linker hash table is created by the function +`NAME(aout,link_hash_table_create)'; it simply allocates space for the +hash table, initializes it, and returns a pointer to it. + + When writing the linker routines for a new back end, you will +generally not know exactly which fields will be required until you have +finished. You should simply create a new hash table which defines no +additional fields, and then simply add fields as they become necessary. + + +File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions + +2.18.2 Adding symbols to the hash table +--------------------------------------- + +The linker proper will call the `_bfd_link_add_symbols' entry point for +each object file or archive which is to be linked (typically these are +the files named on the command line, but some may also come from the +linker script). The entry point is responsible for examining the file. +For an object file, BFD must add any relevant symbol information to +the hash table. For an archive, BFD must determine which elements of +the archive should be used and adding them to the link. + + The a.out version of this entry point is +`NAME(aout,link_add_symbols)'. + +* Menu: + +* Differing file formats:: +* Adding symbols from an object file:: +* Adding symbols from an archive:: + + +File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table + +2.18.2.1 Differing file formats +............................... + +Normally all the files involved in a link will be of the same format, +but it is also possible to link together different format object files, +and the back end must support that. The `_bfd_link_add_symbols' entry +point is called via the target vector of the file to be added. This +has an important consequence: the function may not assume that the hash +table is the type created by the corresponding +`_bfd_link_hash_table_create' vector. All the `_bfd_link_add_symbols' +function can assume about the hash table is that it is derived from +`struct bfd_link_hash_table'. + + Sometimes the `_bfd_link_add_symbols' function must store some +information in the hash table entry to be used by the `_bfd_final_link' +function. In such a case the `creator' field of the hash table must be +checked to make sure that the hash table was created by an object file +of the same format. + + The `_bfd_final_link' routine must be prepared to handle a hash +entry without any extra information added by the +`_bfd_link_add_symbols' function. A hash entry without extra +information will also occur when the linker script directs the linker +to create a symbol. Note that, regardless of how a hash table entry is +added, all the fields will be initialized to some sort of null value by +the hash table entry initialization function. + + See `ecoff_link_add_externals' for an example of how to check the +`creator' field before saving information (in this case, the ECOFF +external symbol debugging information) in a hash table entry. + + +File: bfd.info, Node: Adding symbols from an object file, Next: Adding symbols from an archive, Prev: Differing file formats, Up: Adding Symbols to the Hash Table + +2.18.2.2 Adding symbols from an object file +........................................... + +When the `_bfd_link_add_symbols' routine is passed an object file, it +must add all externally visible symbols in that object file to the hash +table. The actual work of adding the symbol to the hash table is +normally handled by the function `_bfd_generic_link_add_one_symbol'. +The `_bfd_link_add_symbols' routine is responsible for reading all the +symbols from the object file and passing the correct information to +`_bfd_generic_link_add_one_symbol'. + + The `_bfd_link_add_symbols' routine should not use +`bfd_canonicalize_symtab' to read the symbols. The point of providing +this routine is to avoid the overhead of converting the symbols into +generic `asymbol' structures. + + `_bfd_generic_link_add_one_symbol' handles the details of combining +common symbols, warning about multiple definitions, and so forth. It +takes arguments which describe the symbol to add, notably symbol flags, +a section, and an offset. The symbol flags include such things as +`BSF_WEAK' or `BSF_INDIRECT'. The section is a section in the object +file, or something like `bfd_und_section_ptr' for an undefined symbol +or `bfd_com_section_ptr' for a common symbol. + + If the `_bfd_final_link' routine is also going to need to read the +symbol information, the `_bfd_link_add_symbols' routine should save it +somewhere attached to the object file BFD. However, the information +should only be saved if the `keep_memory' field of the `info' argument +is TRUE, so that the `-no-keep-memory' linker switch is effective. + + The a.out function which adds symbols from an object file is +`aout_link_add_object_symbols', and most of the interesting work is in +`aout_link_add_symbols'. The latter saves pointers to the hash tables +entries created by `_bfd_generic_link_add_one_symbol' indexed by symbol +number, so that the `_bfd_final_link' routine does not have to call the +hash table lookup routine to locate the entry. + + +File: bfd.info, Node: Adding symbols from an archive, Prev: Adding symbols from an object file, Up: Adding Symbols to the Hash Table + +2.18.2.3 Adding symbols from an archive +....................................... + +When the `_bfd_link_add_symbols' routine is passed an archive, it must +look through the symbols defined by the archive and decide which +elements of the archive should be included in the link. For each such +element it must call the `add_archive_element' linker callback, and it +must add the symbols from the object file to the linker hash table. + + In most cases the work of looking through the symbols in the archive +should be done by the `_bfd_generic_link_add_archive_symbols' function. +This function builds a hash table from the archive symbol table and +looks through the list of undefined symbols to see which elements +should be included. `_bfd_generic_link_add_archive_symbols' is passed +a function to call to make the final decision about adding an archive +element to the link and to do the actual work of adding the symbols to +the linker hash table. + + The function passed to `_bfd_generic_link_add_archive_symbols' must +read the symbols of the archive element and decide whether the archive +element should be included in the link. If the element is to be +included, the `add_archive_element' linker callback routine must be +called with the element as an argument, and the elements symbols must +be added to the linker hash table just as though the element had itself +been passed to the `_bfd_link_add_symbols' function. + + When the a.out `_bfd_link_add_symbols' function receives an archive, +it calls `_bfd_generic_link_add_archive_symbols' passing +`aout_link_check_archive_element' as the function argument. +`aout_link_check_archive_element' calls `aout_link_check_ar_symbols'. +If the latter decides to add the element (an element is only added if +it provides a real, non-common, definition for a previously undefined +or common symbol) it calls the `add_archive_element' callback and then +`aout_link_check_archive_element' calls `aout_link_add_symbols' to +actually add the symbols to the linker hash table. + + The ECOFF back end is unusual in that it does not normally call +`_bfd_generic_link_add_archive_symbols', because ECOFF archives already +contain a hash table of symbols. The ECOFF back end searches the +archive itself to avoid the overhead of creating a new hash table. + + +File: bfd.info, Node: Performing the Final Link, Prev: Adding Symbols to the Hash Table, Up: Linker Functions + +2.18.3 Performing the final link +-------------------------------- + +When all the input files have been processed, the linker calls the +`_bfd_final_link' entry point of the output BFD. This routine is +responsible for producing the final output file, which has several +aspects. It must relocate the contents of the input sections and copy +the data into the output sections. It must build an output symbol +table including any local symbols from the input files and the global +symbols from the hash table. When producing relocatable output, it must +modify the input relocs and write them into the output file. There may +also be object format dependent work to be done. + + The linker will also call the `write_object_contents' entry point +when the BFD is closed. The two entry points must work together in +order to produce the correct output file. + + The details of how this works are inevitably dependent upon the +specific object file format. The a.out `_bfd_final_link' routine is +`NAME(aout,final_link)'. + +* Menu: + +* Information provided by the linker:: +* Relocating the section contents:: +* Writing the symbol table:: + + +File: bfd.info, Node: Information provided by the linker, Next: Relocating the section contents, Prev: Performing the Final Link, Up: Performing the Final Link + +2.18.3.1 Information provided by the linker +........................................... + +Before the linker calls the `_bfd_final_link' entry point, it sets up +some data structures for the function to use. + + The `input_bfds' field of the `bfd_link_info' structure will point +to a list of all the input files included in the link. These files are +linked through the `link_next' field of the `bfd' structure. + + Each section in the output file will have a list of `link_order' +structures attached to the `link_order_head' field (the `link_order' +structure is defined in `bfdlink.h'). These structures describe how to +create the contents of the output section in terms of the contents of +various input sections, fill constants, and, eventually, other types of +information. They also describe relocs that must be created by the BFD +backend, but do not correspond to any input file; this is used to +support -Ur, which builds constructors while generating a relocatable +object file. + + +File: bfd.info, Node: Relocating the section contents, Next: Writing the symbol table, Prev: Information provided by the linker, Up: Performing the Final Link + +2.18.3.2 Relocating the section contents +........................................ + +The `_bfd_final_link' function should look through the `link_order' +structures attached to each section of the output file. Each +`link_order' structure should either be handled specially, or it should +be passed to the function `_bfd_default_link_order' which will do the +right thing (`_bfd_default_link_order' is defined in `linker.c'). + + For efficiency, a `link_order' of type `bfd_indirect_link_order' +whose associated section belongs to a BFD of the same format as the +output BFD must be handled specially. This type of `link_order' +describes part of an output section in terms of a section belonging to +one of the input files. The `_bfd_final_link' function should read the +contents of the section and any associated relocs, apply the relocs to +the section contents, and write out the modified section contents. If +performing a relocatable link, the relocs themselves must also be +modified and written out. + + The functions `_bfd_relocate_contents' and +`_bfd_final_link_relocate' provide some general support for performing +the actual relocations, notably overflow checking. Their arguments +include information about the symbol the relocation is against and a +`reloc_howto_type' argument which describes the relocation to perform. +These functions are defined in `reloc.c'. + + The a.out function which handles reading, relocating, and writing +section contents is `aout_link_input_section'. The actual relocation +is done in `aout_link_input_section_std' and +`aout_link_input_section_ext'. + + +File: bfd.info, Node: Writing the symbol table, Prev: Relocating the section contents, Up: Performing the Final Link + +2.18.3.3 Writing the symbol table +................................. + +The `_bfd_final_link' function must gather all the symbols in the input +files and write them out. It must also write out all the symbols in +the global hash table. This must be controlled by the `strip' and +`discard' fields of the `bfd_link_info' structure. + + The local symbols of the input files will not have been entered into +the linker hash table. The `_bfd_final_link' routine must consider +each input file and include the symbols in the output file. It may be +convenient to do this when looking through the `link_order' structures, +or it may be done by stepping through the `input_bfds' list. + + The `_bfd_final_link' routine must also traverse the global hash +table to gather all the externally visible symbols. It is possible +that most of the externally visible symbols may be written out when +considering the symbols of each input file, but it is still necessary +to traverse the hash table since the linker script may have defined +some symbols that are not in any of the input files. + + The `strip' field of the `bfd_link_info' structure controls which +symbols are written out. The possible values are listed in +`bfdlink.h'. If the value is `strip_some', then the `keep_hash' field +of the `bfd_link_info' structure is a hash table of symbols to keep; +each symbol should be looked up in this hash table, and only symbols +which are present should be included in the output file. + + If the `strip' field of the `bfd_link_info' structure permits local +symbols to be written out, the `discard' field is used to further +controls which local symbols are included in the output file. If the +value is `discard_l', then all local symbols which begin with a certain +prefix are discarded; this is controlled by the +`bfd_is_local_label_name' entry point. + + The a.out backend handles symbols by calling +`aout_link_write_symbols' on each input BFD and then traversing the +global hash table with the function `aout_link_write_other_symbol'. It +builds a string table while writing out the symbols, which is written +to the output file at the end of `NAME(aout,final_link)'. + +2.18.3.4 `bfd_link_split_section' +................................. + +*Synopsis* + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); + *Description* +Return nonzero if SEC should be split during a reloceatable or final +link. + #define bfd_link_split_section(abfd, sec) \ + BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) + +2.18.3.5 `bfd_section_already_linked' +..................................... + +*Synopsis* + void bfd_section_already_linked (bfd *abfd, asection *sec); + *Description* +Check if SEC has been already linked during a reloceatable or final +link. + #define bfd_section_already_linked(abfd, sec) \ + BFD_SEND (abfd, _section_already_linked, (abfd, sec)) + + +File: bfd.info, Node: Hash Tables, Prev: Linker Functions, Up: BFD front end + +2.19 Hash Tables +================ + +BFD provides a simple set of hash table functions. Routines are +provided to initialize a hash table, to free a hash table, to look up a +string in a hash table and optionally create an entry for it, and to +traverse a hash table. There is currently no routine to delete an +string from a hash table. + + The basic hash table does not permit any data to be stored with a +string. However, a hash table is designed to present a base class from +which other types of hash tables may be derived. These derived types +may store additional information with the string. Hash tables were +implemented in this way, rather than simply providing a data pointer in +a hash table entry, because they were designed for use by the linker +back ends. The linker may create thousands of hash table entries, and +the overhead of allocating private data and storing and following +pointers becomes noticeable. + + The basic hash table code is in `hash.c'. + +* Menu: + +* Creating and Freeing a Hash Table:: +* Looking Up or Entering a String:: +* Traversing a Hash Table:: +* Deriving a New Hash Table Type:: + + +File: bfd.info, Node: Creating and Freeing a Hash Table, Next: Looking Up or Entering a String, Prev: Hash Tables, Up: Hash Tables + +2.19.1 Creating and freeing a hash table +---------------------------------------- + +To create a hash table, create an instance of a `struct bfd_hash_table' +(defined in `bfd.h') and call `bfd_hash_table_init' (if you know +approximately how many entries you will need, the function +`bfd_hash_table_init_n', which takes a SIZE argument, may be used). +`bfd_hash_table_init' returns `FALSE' if some sort of error occurs. + + The function `bfd_hash_table_init' take as an argument a function to +use to create new entries. For a basic hash table, use the function +`bfd_hash_newfunc'. *Note Deriving a New Hash Table Type::, for why +you would want to use a different value for this argument. + + `bfd_hash_table_init' will create an objalloc which will be used to +allocate new entries. You may allocate memory on this objalloc using +`bfd_hash_allocate'. + + Use `bfd_hash_table_free' to free up all the memory that has been +allocated for a hash table. This will not free up the `struct +bfd_hash_table' itself, which you must provide. + + Use `bfd_hash_set_default_size' to set the default size of hash +table to use. + + +File: bfd.info, Node: Looking Up or Entering a String, Next: Traversing a Hash Table, Prev: Creating and Freeing a Hash Table, Up: Hash Tables + +2.19.2 Looking up or entering a string +-------------------------------------- + +The function `bfd_hash_lookup' is used both to look up a string in the +hash table and to create a new entry. + + If the CREATE argument is `FALSE', `bfd_hash_lookup' will look up a +string. If the string is found, it will returns a pointer to a `struct +bfd_hash_entry'. If the string is not found in the table +`bfd_hash_lookup' will return `NULL'. You should not modify any of the +fields in the returns `struct bfd_hash_entry'. + + If the CREATE argument is `TRUE', the string will be entered into +the hash table if it is not already there. Either way a pointer to a +`struct bfd_hash_entry' will be returned, either to the existing +structure or to a newly created one. In this case, a `NULL' return +means that an error occurred. + + If the CREATE argument is `TRUE', and a new entry is created, the +COPY argument is used to decide whether to copy the string onto the +hash table objalloc or not. If COPY is passed as `FALSE', you must be +careful not to deallocate or modify the string as long as the hash table +exists. + + +File: bfd.info, Node: Traversing a Hash Table, Next: Deriving a New Hash Table Type, Prev: Looking Up or Entering a String, Up: Hash Tables + +2.19.3 Traversing a hash table +------------------------------ + +The function `bfd_hash_traverse' may be used to traverse a hash table, +calling a function on each element. The traversal is done in a random +order. + + `bfd_hash_traverse' takes as arguments a function and a generic +`void *' pointer. The function is called with a hash table entry (a +`struct bfd_hash_entry *') and the generic pointer passed to +`bfd_hash_traverse'. The function must return a `boolean' value, which +indicates whether to continue traversing the hash table. If the +function returns `FALSE', `bfd_hash_traverse' will stop the traversal +and return immediately. + + +File: bfd.info, Node: Deriving a New Hash Table Type, Prev: Traversing a Hash Table, Up: Hash Tables + +2.19.4 Deriving a new hash table type +------------------------------------- + +Many uses of hash tables want to store additional information which +each entry in the hash table. Some also find it convenient to store +additional information with the hash table itself. This may be done +using a derived hash table. + + Since C is not an object oriented language, creating a derived hash +table requires sticking together some boilerplate routines with a few +differences specific to the type of hash table you want to create. + + An example of a derived hash table is the linker hash table. The +structures for this are defined in `bfdlink.h'. The functions are in +`linker.c'. + + You may also derive a hash table from an already derived hash table. +For example, the a.out linker backend code uses a hash table derived +from the linker hash table. + +* Menu: + +* Define the Derived Structures:: +* Write the Derived Creation Routine:: +* Write Other Derived Routines:: + + +File: bfd.info, Node: Define the Derived Structures, Next: Write the Derived Creation Routine, Prev: Deriving a New Hash Table Type, Up: Deriving a New Hash Table Type + +2.19.4.1 Define the derived structures +...................................... + +You must define a structure for an entry in the hash table, and a +structure for the hash table itself. + + The first field in the structure for an entry in the hash table must +be of the type used for an entry in the hash table you are deriving +from. If you are deriving from a basic hash table this is `struct +bfd_hash_entry', which is defined in `bfd.h'. The first field in the +structure for the hash table itself must be of the type of the hash +table you are deriving from itself. If you are deriving from a basic +hash table, this is `struct bfd_hash_table'. + + For example, the linker hash table defines `struct +bfd_link_hash_entry' (in `bfdlink.h'). The first field, `root', is of +type `struct bfd_hash_entry'. Similarly, the first field in `struct +bfd_link_hash_table', `table', is of type `struct bfd_hash_table'. + + +File: bfd.info, Node: Write the Derived Creation Routine, Next: Write Other Derived Routines, Prev: Define the Derived Structures, Up: Deriving a New Hash Table Type + +2.19.4.2 Write the derived creation routine +........................................... + +You must write a routine which will create and initialize an entry in +the hash table. This routine is passed as the function argument to +`bfd_hash_table_init'. + + In order to permit other hash tables to be derived from the hash +table you are creating, this routine must be written in a standard way. + + The first argument to the creation routine is a pointer to a hash +table entry. This may be `NULL', in which case the routine should +allocate the right amount of space. Otherwise the space has already +been allocated by a hash table type derived from this one. + + After allocating space, the creation routine must call the creation +routine of the hash table type it is derived from, passing in a pointer +to the space it just allocated. This will initialize any fields used +by the base hash table. + + Finally the creation routine must initialize any local fields for +the new hash table type. + + Here is a boilerplate example of a creation routine. FUNCTION_NAME +is the name of the routine. ENTRY_TYPE is the type of an entry in the +hash table you are creating. BASE_NEWFUNC is the name of the creation +routine of the hash table type your hash table is derived from. + + struct bfd_hash_entry * + FUNCTION_NAME (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; + { + struct ENTRY_TYPE *ret = (ENTRY_TYPE *) entry; + + /* Allocate the structure if it has not already been allocated by a + derived class. */ + if (ret == (ENTRY_TYPE *) NULL) + { + ret = ((ENTRY_TYPE *) + bfd_hash_allocate (table, sizeof (ENTRY_TYPE))); + if (ret == (ENTRY_TYPE *) NULL) + return NULL; + } + + /* Call the allocation method of the base class. */ + ret = ((ENTRY_TYPE *) + BASE_NEWFUNC ((struct bfd_hash_entry *) ret, table, string)); + + /* Initialize the local fields here. */ + + return (struct bfd_hash_entry *) ret; + } + *Description* +The creation routine for the linker hash table, which is in `linker.c', +looks just like this example. FUNCTION_NAME is +`_bfd_link_hash_newfunc'. ENTRY_TYPE is `struct bfd_link_hash_entry'. +BASE_NEWFUNC is `bfd_hash_newfunc', the creation routine for a basic +hash table. + + `_bfd_link_hash_newfunc' also initializes the local fields in a +linker hash table entry: `type', `written' and `next'. + + +File: bfd.info, Node: Write Other Derived Routines, Prev: Write the Derived Creation Routine, Up: Deriving a New Hash Table Type + +2.19.4.3 Write other derived routines +..................................... + +You will want to write other routines for your new hash table, as well. + + You will want an initialization routine which calls the +initialization routine of the hash table you are deriving from and +initializes any other local fields. For the linker hash table, this is +`_bfd_link_hash_table_init' in `linker.c'. + + You will want a lookup routine which calls the lookup routine of the +hash table you are deriving from and casts the result. The linker hash +table uses `bfd_link_hash_lookup' in `linker.c' (this actually takes an +additional argument which it uses to decide how to return the looked up +value). + + You may want a traversal routine. This should just call the +traversal routine of the hash table you are deriving from with +appropriate casts. The linker hash table uses `bfd_link_hash_traverse' +in `linker.c'. + + These routines may simply be defined as macros. For example, the +a.out backend linker hash table, which is derived from the linker hash +table, uses macros for the lookup and traversal routines. These are +`aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h. + + +File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top + +3 BFD back ends +*************** + +* Menu: + +* What to Put Where:: +* aout :: a.out backends +* coff :: coff backends +* elf :: elf backends +* mmo :: mmo backend + + +File: bfd.info, Node: What to Put Where, Next: aout, Prev: BFD back ends, Up: BFD back ends + + All of BFD lives in one directory. + + +File: bfd.info, Node: aout, Next: coff, Prev: What to Put Where, Up: BFD back ends + +3.1 a.out backends +================== + +*Description* +BFD supports a number of different flavours of a.out format, though the +major differences are only the sizes of the structures on disk, and the +shape of the relocation information. + + The support is split into a basic support file `aoutx.h' and other +files which derive functions from the base. One derivation file is +`aoutf1.h' (for a.out flavour 1), and adds to the basic a.out functions +support for sun3, sun4, 386 and 29k a.out files, to create a target +jump vector for a specific target. + + This information is further split out into more specific files for +each machine, including `sunos.c' for sun3 and sun4, `newsos3.c' for +the Sony NEWS, and `demo64.c' for a demonstration of a 64 bit a.out +format. + + The base file `aoutx.h' defines general mechanisms for reading and +writing records to and from disk and various other methods which BFD +requires. It is included by `aout32.c' and `aout64.c' to form the names +`aout_32_swap_exec_header_in', `aout_64_swap_exec_header_in', etc. + + As an example, this is what goes on to make the back end for a sun4, +from `aout32.c': + + #define ARCH_SIZE 32 + #include "aoutx.h" + + Which exports names: + + ... + aout_32_canonicalize_reloc + aout_32_find_nearest_line + aout_32_get_lineno + aout_32_get_reloc_upper_bound + ... + + from `sunos.c': + + #define TARGET_NAME "a.out-sunos-big" + #define VECNAME sunos_big_vec + #include "aoutf1.h" + + requires all the names from `aout32.c', and produces the jump vector + + sunos_big_vec + + The file `host-aout.c' is a special case. It is for a large set of +hosts that use "more or less standard" a.out files, and for which +cross-debugging is not interesting. It uses the standard 32-bit a.out +support routines, but determines the file offsets and addresses of the +text, data, and BSS sections, the machine architecture and machine +type, and the entry point address, in a host-dependent manner. Once +these values have been determined, generic code is used to handle the +object file. + + When porting it to run on a new system, you must supply: + + HOST_PAGE_SIZE + HOST_SEGMENT_SIZE + HOST_MACHINE_ARCH (optional) + HOST_MACHINE_MACHINE (optional) + HOST_TEXT_START_ADDR + HOST_STACK_END_ADDR + + in the file `../include/sys/h-XXX.h' (for your host). These values, +plus the structures and macros defined in `a.out.h' on your host +system, will produce a BFD target that will access ordinary a.out files +on your host. To configure a new machine to use `host-aout.c', specify: + + TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec + TDEPFILES= host-aout.o trad-core.o + + in the `config/XXX.mt' file, and modify `configure.in' to use the +`XXX.mt' file (by setting "`bfd_target=XXX'") when your configuration +is selected. + +3.1.1 Relocations +----------------- + +*Description* +The file `aoutx.h' provides for both the _standard_ and _extended_ +forms of a.out relocation records. + + The standard records contain only an address, a symbol index, and a +type field. The extended records (used on 29ks and sparcs) also have a +full integer for an addend. + +3.1.2 Internal entry points +--------------------------- + +*Description* +`aoutx.h' exports several routines for accessing the contents of an +a.out file, which are gathered and exported in turn by various format +specific files (eg sunos.c). + +3.1.2.1 `aout_SIZE_swap_exec_header_in' +....................................... + +*Synopsis* + void aout_SIZE_swap_exec_header_in, + (bfd *abfd, + struct external_exec *raw_bytes, + struct internal_exec *execp); + *Description* +Swap the information in an executable header RAW_BYTES taken from a raw +byte stream memory image into the internal exec header structure EXECP. + +3.1.2.2 `aout_SIZE_swap_exec_header_out' +........................................ + +*Synopsis* + void aout_SIZE_swap_exec_header_out + (bfd *abfd, + struct internal_exec *execp, + struct external_exec *raw_bytes); + *Description* +Swap the information in an internal exec header structure EXECP into +the buffer RAW_BYTES ready for writing to disk. + +3.1.2.3 `aout_SIZE_some_aout_object_p' +...................................... + +*Synopsis* + const bfd_target *aout_SIZE_some_aout_object_p + (bfd *abfd, + const bfd_target *(*callback_to_real_object_p) ()); + *Description* +Some a.out variant thinks that the file open in ABFD checking is an +a.out file. Do some more checking, and set up for access if it really +is. Call back to the calling environment's "finish up" function just +before returning, to handle any last-minute setup. + +3.1.2.4 `aout_SIZE_mkobject' +............................ + +*Synopsis* + bfd_boolean aout_SIZE_mkobject, (bfd *abfd); + *Description* +Initialize BFD ABFD for use with a.out files. + +3.1.2.5 `aout_SIZE_machine_type' +................................ + +*Synopsis* + enum machine_type aout_SIZE_machine_type + (enum bfd_architecture arch, + unsigned long machine)); + *Description* +Keep track of machine architecture and machine type for a.out's. Return +the `machine_type' for a particular architecture and machine, or +`M_UNKNOWN' if that exact architecture and machine can't be represented +in a.out format. + + If the architecture is understood, machine type 0 (default) is +always understood. + +3.1.2.6 `aout_SIZE_set_arch_mach' +................................. + +*Synopsis* + bfd_boolean aout_SIZE_set_arch_mach, + (bfd *, + enum bfd_architecture arch, + unsigned long machine)); + *Description* +Set the architecture and the machine of the BFD ABFD to the values ARCH +and MACHINE. Verify that ABFD's format can support the architecture +required. + +3.1.2.7 `aout_SIZE_new_section_hook' +.................................... + +*Synopsis* + bfd_boolean aout_SIZE_new_section_hook, + (bfd *abfd, + asection *newsect)); + *Description* +Called by the BFD in response to a `bfd_make_section' request. + + +File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends + +3.2 coff backends +================= + +BFD supports a number of different flavours of coff format. The major +differences between formats are the sizes and alignments of fields in +structures on disk, and the occasional extra field. + + Coff in all its varieties is implemented with a few common files and +a number of implementation specific files. For example, The 88k bcs +coff format is implemented in the file `coff-m88k.c'. This file +`#include's `coff/m88k.h' which defines the external structure of the +coff format for the 88k, and `coff/internal.h' which defines the +internal structure. `coff-m88k.c' also defines the relocations used by +the 88k format *Note Relocations::. + + The Intel i960 processor version of coff is implemented in +`coff-i960.c'. This file has the same structure as `coff-m88k.c', +except that it includes `coff/i960.h' rather than `coff-m88k.h'. + +3.2.1 Porting to a new version of coff +-------------------------------------- + +The recommended method is to select from the existing implementations +the version of coff which is most like the one you want to use. For +example, we'll say that i386 coff is the one you select, and that your +coff flavour is called foo. Copy `i386coff.c' to `foocoff.c', copy +`../include/coff/i386.h' to `../include/coff/foo.h', and add the lines +to `targets.c' and `Makefile.in' so that your new back end is used. +Alter the shapes of the structures in `../include/coff/foo.h' so that +they match what you need. You will probably also have to add `#ifdef's +to the code in `coff/internal.h' and `coffcode.h' if your version of +coff is too wild. + + You can verify that your new BFD backend works quite simply by +building `objdump' from the `binutils' directory, and making sure that +its version of what's going on and your host system's idea (assuming it +has the pretty standard coff dump utility, usually called `att-dump' or +just `dump') are the same. Then clean up your code, and send what +you've done to Cygnus. Then your stuff will be in the next release, and +you won't have to keep integrating it. + +3.2.2 How the coff backend works +-------------------------------- + +3.2.2.1 File layout +................... + +The Coff backend is split into generic routines that are applicable to +any Coff target and routines that are specific to a particular target. +The target-specific routines are further split into ones which are +basically the same for all Coff targets except that they use the +external symbol format or use different values for certain constants. + + The generic routines are in `coffgen.c'. These routines work for +any Coff target. They use some hooks into the target specific code; +the hooks are in a `bfd_coff_backend_data' structure, one of which +exists for each target. + + The essentially similar target-specific routines are in +`coffcode.h'. This header file includes executable C code. The +various Coff targets first include the appropriate Coff header file, +make any special defines that are needed, and then include `coffcode.h'. + + Some of the Coff targets then also have additional routines in the +target source file itself. + + For example, `coff-i960.c' includes `coff/internal.h' and +`coff/i960.h'. It then defines a few constants, such as `I960', and +includes `coffcode.h'. Since the i960 has complex relocation types, +`coff-i960.c' also includes some code to manipulate the i960 relocs. +This code is not in `coffcode.h' because it would not be used by any +other target. + +3.2.2.2 Bit twiddling +..................... + +Each flavour of coff supported in BFD has its own header file +describing the external layout of the structures. There is also an +internal description of the coff layout, in `coff/internal.h'. A major +function of the coff backend is swapping the bytes and twiddling the +bits to translate the external form of the structures into the normal +internal form. This is all performed in the `bfd_swap'_thing_direction +routines. Some elements are different sizes between different versions +of coff; it is the duty of the coff version specific include file to +override the definitions of various packing routines in `coffcode.h'. +E.g., the size of line number entry in coff is sometimes 16 bits, and +sometimes 32 bits. `#define'ing `PUT_LNSZ_LNNO' and `GET_LNSZ_LNNO' +will select the correct one. No doubt, some day someone will find a +version of coff which has a varying field size not catered to at the +moment. To port BFD, that person will have to add more `#defines'. +Three of the bit twiddling routines are exported to `gdb'; +`coff_swap_aux_in', `coff_swap_sym_in' and `coff_swap_lineno_in'. `GDB' +reads the symbol table on its own, but uses BFD to fix things up. More +of the bit twiddlers are exported for `gas'; `coff_swap_aux_out', +`coff_swap_sym_out', `coff_swap_lineno_out', `coff_swap_reloc_out', +`coff_swap_filehdr_out', `coff_swap_aouthdr_out', +`coff_swap_scnhdr_out'. `Gas' currently keeps track of all the symbol +table and reloc drudgery itself, thereby saving the internal BFD +overhead, but uses BFD to swap things on the way out, making cross +ports much safer. Doing so also allows BFD (and thus the linker) to +use the same header files as `gas', which makes one avenue to disaster +disappear. + +3.2.2.3 Symbol reading +...................... + +The simple canonical form for symbols used by BFD is not rich enough to +keep all the information available in a coff symbol table. The back end +gets around this problem by keeping the original symbol table around, +"behind the scenes". + + When a symbol table is requested (through a call to +`bfd_canonicalize_symtab'), a request gets through to +`coff_get_normalized_symtab'. This reads the symbol table from the coff +file and swaps all the structures inside into the internal form. It +also fixes up all the pointers in the table (represented in the file by +offsets from the first symbol in the table) into physical pointers to +elements in the new internal table. This involves some work since the +meanings of fields change depending upon context: a field that is a +pointer to another structure in the symbol table at one moment may be +the size in bytes of a structure at the next. Another pass is made +over the table. All symbols which mark file names (`C_FILE' symbols) +are modified so that the internal string points to the value in the +auxent (the real filename) rather than the normal text associated with +the symbol (`".file"'). + + At this time the symbol names are moved around. Coff stores all +symbols less than nine characters long physically within the symbol +table; longer strings are kept at the end of the file in the string +table. This pass moves all strings into memory and replaces them with +pointers to the strings. + + The symbol table is massaged once again, this time to create the +canonical table used by the BFD application. Each symbol is inspected +in turn, and a decision made (using the `sclass' field) about the +various flags to set in the `asymbol'. *Note Symbols::. The generated +canonical table shares strings with the hidden internal symbol table. + + Any linenumbers are read from the coff file too, and attached to the +symbols which own the functions the linenumbers belong to. + +3.2.2.4 Symbol writing +...................... + +Writing a symbol to a coff file which didn't come from a coff file will +lose any debugging information. The `asymbol' structure remembers the +BFD from which the symbol was taken, and on output the back end makes +sure that the same destination target as source target is present. + + When the symbols have come from a coff file then all the debugging +information is preserved. + + Symbol tables are provided for writing to the back end in a vector +of pointers to pointers. This allows applications like the linker to +accumulate and output large symbol tables without having to do too much +byte copying. + + This function runs through the provided symbol table and patches +each symbol marked as a file place holder (`C_FILE') to point to the +next file place holder in the list. It also marks each `offset' field +in the list with the offset from the first symbol of the current symbol. + + Another function of this procedure is to turn the canonical value +form of BFD into the form used by coff. Internally, BFD expects symbol +values to be offsets from a section base; so a symbol physically at +0x120, but in a section starting at 0x100, would have the value 0x20. +Coff expects symbols to contain their final value, so symbols have +their values changed at this point to reflect their sum with their +owning section. This transformation uses the `output_section' field of +the `asymbol''s `asection' *Note Sections::. + + * `coff_mangle_symbols' + This routine runs though the provided symbol table and uses the +offsets generated by the previous pass and the pointers generated when +the symbol table was read in to create the structured hierarchy +required by coff. It changes each pointer to a symbol into the index +into the symbol table of the asymbol. + + * `coff_write_symbols' + This routine runs through the symbol table and patches up the +symbols from their internal form into the coff way, calls the bit +twiddlers, and writes out the table to the file. + +3.2.2.5 `coff_symbol_type' +.......................... + +*Description* +The hidden information for an `asymbol' is described in a +`combined_entry_type': + + + typedef struct coff_ptr_struct + { + /* Remembers the offset from the first symbol in the file for + this symbol. Generated by coff_renumber_symbols. */ + unsigned int offset; + + /* Should the value of this symbol be renumbered. Used for + XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */ + unsigned int fix_value : 1; + + /* Should the tag field of this symbol be renumbered. + Created by coff_pointerize_aux. */ + unsigned int fix_tag : 1; + + /* Should the endidx field of this symbol be renumbered. + Created by coff_pointerize_aux. */ + unsigned int fix_end : 1; + + /* Should the x_csect.x_scnlen field be renumbered. + Created by coff_pointerize_aux. */ + unsigned int fix_scnlen : 1; + + /* Fix up an XCOFF C_BINCL/C_EINCL symbol. The value is the + index into the line number entries. Set by coff_slurp_symbol_table. */ + unsigned int fix_line : 1; + + /* The container for the symbol structure as read and translated + from the file. */ + union + { + union internal_auxent auxent; + struct internal_syment syment; + } u; + } combined_entry_type; + + + /* Each canonical asymbol really looks like this: */ + + typedef struct coff_symbol_struct + { + /* The actual symbol which the rest of BFD works with */ + asymbol symbol; + + /* A pointer to the hidden information for this symbol */ + combined_entry_type *native; + + /* A pointer to the linenumber information for this symbol */ + struct lineno_cache_entry *lineno; + + /* Have the line numbers been relocated yet ? */ + bfd_boolean done_lineno; + } coff_symbol_type; + +3.2.2.6 `bfd_coff_backend_data' +............................... + + /* COFF symbol classifications. */ + + enum coff_symbol_classification + { + /* Global symbol. */ + COFF_SYMBOL_GLOBAL, + /* Common symbol. */ + COFF_SYMBOL_COMMON, + /* Undefined symbol. */ + COFF_SYMBOL_UNDEFINED, + /* Local symbol. */ + COFF_SYMBOL_LOCAL, + /* PE section symbol. */ + COFF_SYMBOL_PE_SECTION + }; +Special entry points for gdb to swap in coff symbol table parts: + typedef struct + { + void (*_bfd_coff_swap_aux_in) + PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + + void (*_bfd_coff_swap_sym_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_lineno_in) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_aux_out) + PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + + unsigned int (*_bfd_coff_swap_sym_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_lineno_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_reloc_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_filehdr_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_aouthdr_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int (*_bfd_coff_swap_scnhdr_out) + PARAMS ((bfd *, PTR, PTR)); + + unsigned int _bfd_filhsz; + unsigned int _bfd_aoutsz; + unsigned int _bfd_scnhsz; + unsigned int _bfd_symesz; + unsigned int _bfd_auxesz; + unsigned int _bfd_relsz; + unsigned int _bfd_linesz; + unsigned int _bfd_filnmlen; + bfd_boolean _bfd_coff_long_filenames; + bfd_boolean _bfd_coff_long_section_names; + unsigned int _bfd_coff_default_section_alignment_power; + bfd_boolean _bfd_coff_force_symnames_in_strings; + unsigned int _bfd_coff_debug_string_prefix_length; + + void (*_bfd_coff_swap_filehdr_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_aouthdr_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_scnhdr_in) + PARAMS ((bfd *, PTR, PTR)); + + void (*_bfd_coff_swap_reloc_in) + PARAMS ((bfd *abfd, PTR, PTR)); + + bfd_boolean (*_bfd_coff_bad_format_hook) + PARAMS ((bfd *, PTR)); + + bfd_boolean (*_bfd_coff_set_arch_mach_hook) + PARAMS ((bfd *, PTR)); + + PTR (*_bfd_coff_mkobject_hook) + PARAMS ((bfd *, PTR, PTR)); + + bfd_boolean (*_bfd_styp_to_sec_flags_hook) + PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); + + void (*_bfd_set_alignment_hook) + PARAMS ((bfd *, asection *, PTR)); + + bfd_boolean (*_bfd_coff_slurp_symbol_table) + PARAMS ((bfd *)); + + bfd_boolean (*_bfd_coff_symname_in_debug) + PARAMS ((bfd *, struct internal_syment *)); + + bfd_boolean (*_bfd_coff_pointerize_aux_hook) + PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, + unsigned int, combined_entry_type *)); + + bfd_boolean (*_bfd_coff_print_aux) + PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, + combined_entry_type *, unsigned int)); + + void (*_bfd_coff_reloc16_extra_cases) + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *, + bfd_byte *, unsigned int *, unsigned int *)); + + int (*_bfd_coff_reloc16_estimate) + PARAMS ((bfd *, asection *, arelent *, unsigned int, + struct bfd_link_info *)); + + enum coff_symbol_classification (*_bfd_coff_classify_symbol) + PARAMS ((bfd *, struct internal_syment *)); + + bfd_boolean (*_bfd_coff_compute_section_file_positions) + PARAMS ((bfd *)); + + bfd_boolean (*_bfd_coff_start_final_link) + PARAMS ((bfd *, struct bfd_link_info *)); + + bfd_boolean (*_bfd_coff_relocate_section) + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + struct internal_reloc *, struct internal_syment *, asection **)); + + reloc_howto_type *(*_bfd_coff_rtype_to_howto) + PARAMS ((bfd *, asection *, struct internal_reloc *, + struct coff_link_hash_entry *, struct internal_syment *, + bfd_vma *)); + + bfd_boolean (*_bfd_coff_adjust_symndx) + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, + struct internal_reloc *, bfd_boolean *)); + + bfd_boolean (*_bfd_coff_link_add_one_symbol) + PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, + asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, + struct bfd_link_hash_entry **)); + + bfd_boolean (*_bfd_coff_link_output_has_begun) + PARAMS ((bfd *, struct coff_final_link_info *)); + + bfd_boolean (*_bfd_coff_final_link_postscript) + PARAMS ((bfd *, struct coff_final_link_info *)); + + } bfd_coff_backend_data; + + #define coff_backend_info(abfd) \ + ((bfd_coff_backend_data *) (abfd)->xvec->backend_data) + + #define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \ + ((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i)) + + #define bfd_coff_swap_sym_in(a,e,i) \ + ((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i)) + + #define bfd_coff_swap_lineno_in(a,e,i) \ + ((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i)) + + #define bfd_coff_swap_reloc_out(abfd, i, o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o)) + + #define bfd_coff_swap_lineno_out(abfd, i, o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o)) + + #define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \ + ((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o)) + + #define bfd_coff_swap_sym_out(abfd, i,o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o)) + + #define bfd_coff_swap_scnhdr_out(abfd, i,o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o)) + + #define bfd_coff_swap_filehdr_out(abfd, i,o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o)) + + #define bfd_coff_swap_aouthdr_out(abfd, i,o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o)) + + #define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz) + #define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz) + #define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz) + #define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz) + #define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz) + #define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz) + #define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz) + #define bfd_coff_filnmlen(abfd) (coff_backend_info (abfd)->_bfd_filnmlen) + #define bfd_coff_long_filenames(abfd) \ + (coff_backend_info (abfd)->_bfd_coff_long_filenames) + #define bfd_coff_long_section_names(abfd) \ + (coff_backend_info (abfd)->_bfd_coff_long_section_names) + #define bfd_coff_default_section_alignment_power(abfd) \ + (coff_backend_info (abfd)->_bfd_coff_default_section_alignment_power) + #define bfd_coff_swap_filehdr_in(abfd, i,o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o)) + + #define bfd_coff_swap_aouthdr_in(abfd, i,o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o)) + + #define bfd_coff_swap_scnhdr_in(abfd, i,o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o)) + + #define bfd_coff_swap_reloc_in(abfd, i, o) \ + ((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o)) + + #define bfd_coff_bad_format_hook(abfd, filehdr) \ + ((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr)) + + #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ + ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) + #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ + ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ + (abfd, filehdr, aouthdr)) + + #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ + ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ + (abfd, scnhdr, name, section, flags_ptr)) + + #define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\ + ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr)) + + #define bfd_coff_slurp_symbol_table(abfd)\ + ((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd)) + + #define bfd_coff_symname_in_debug(abfd, sym)\ + ((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym)) + + #define bfd_coff_force_symnames_in_strings(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_force_symnames_in_strings) + + #define bfd_coff_debug_string_prefix_length(abfd)\ + (coff_backend_info (abfd)->_bfd_coff_debug_string_prefix_length) + + #define bfd_coff_print_aux(abfd, file, base, symbol, aux, indaux)\ + ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ + (abfd, file, base, symbol, aux, indaux)) + + #define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ + reloc, data, src_ptr, dst_ptr)\ + ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ + (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) + + #define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\ + ((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\ + (abfd, section, reloc, shrink, link_info)) + + #define bfd_coff_classify_symbol(abfd, sym)\ + ((coff_backend_info (abfd)->_bfd_coff_classify_symbol)\ + (abfd, sym)) + + #define bfd_coff_compute_section_file_positions(abfd)\ + ((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\ + (abfd)) + + #define bfd_coff_start_final_link(obfd, info)\ + ((coff_backend_info (obfd)->_bfd_coff_start_final_link)\ + (obfd, info)) + #define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\ + ((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\ + (obfd, info, ibfd, o, con, rel, isyms, secs)) + #define bfd_coff_rtype_to_howto(abfd, sec, rel, h, sym, addendp)\ + ((coff_backend_info (abfd)->_bfd_coff_rtype_to_howto)\ + (abfd, sec, rel, h, sym, addendp)) + #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ + ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ + (obfd, info, ibfd, sec, rel, adjustedp)) + #define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ + value, string, cp, coll, hashp)\ + ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ + (info, abfd, name, flags, section, value, string, cp, coll, hashp)) + + #define bfd_coff_link_output_has_begun(a,p) \ + ((coff_backend_info (a)->_bfd_coff_link_output_has_begun) (a,p)) + #define bfd_coff_final_link_postscript(a,p) \ + ((coff_backend_info (a)->_bfd_coff_final_link_postscript) (a,p)) + +3.2.2.7 Writing relocations +........................... + +To write relocations, the back end steps though the canonical +relocation table and create an `internal_reloc'. The symbol index to +use is removed from the `offset' field in the symbol table supplied. +The address comes directly from the sum of the section base address and +the relocation offset; the type is dug directly from the howto field. +Then the `internal_reloc' is swapped into the shape of an +`external_reloc' and written out to disk. + +3.2.2.8 Reading linenumbers +........................... + +Creating the linenumber table is done by reading in the entire coff +linenumber table, and creating another table for internal use. + + A coff linenumber table is structured so that each function is +marked as having a line number of 0. Each line within the function is +an offset from the first line in the function. The base of the line +number information for the table is stored in the symbol associated +with the function. + + Note: The PE format uses line number 0 for a flag indicating a new +source file. + + The information is copied from the external to the internal table, +and each symbol which marks a function is marked by pointing its... + + How does this work ? + +3.2.2.9 Reading relocations +........................... + +Coff relocations are easily transformed into the internal BFD form +(`arelent'). + + Reading a coff relocation table is done in the following stages: + + * Read the entire coff relocation table into memory. + + * Process each relocation in turn; first swap it from the external + to the internal form. + + * Turn the symbol referenced in the relocation's symbol index into a + pointer into the canonical symbol table. This table is the same + as the one returned by a call to `bfd_canonicalize_symtab'. The + back end will call that routine and save the result if a + canonicalization hasn't been done. + + * The reloc index is turned into a pointer to a howto structure, in + a back end specific way. For instance, the 386 and 960 use the + `r_type' to directly produce an index into a howto table vector; + the 88k subtracts a number from the `r_type' field and creates an + addend field. + + +File: bfd.info, Node: elf, Next: mmo, Prev: coff, Up: BFD back ends + +3.3 +=== + +ELF backends + + BFD support for ELF formats is being worked on. Currently, the best +supported back ends are for sparc and i386 (running svr4 or Solaris 2). + + Documentation of the internals of the support code still needs to be +written. The code is changing quickly enough that we haven't bothered +yet. + +3.3.0.1 `bfd_elf_find_section' +.............................. + +*Synopsis* + struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); + *Description* +Helper functions for GDB to locate the string tables. Since BFD hides +string tables from callers, GDB needs to use an internal hook to find +them. Sun's .stabstr, in particular, isn't even pointed to by the +.stab section, so ordinary mechanisms wouldn't work to find it, even if +we had some. + + +File: bfd.info, Node: mmo, Prev: elf, Up: BFD back ends + +3.4 mmo backend +=============== + +The mmo object format is used exclusively together with Professor +Donald E. Knuth's educational 64-bit processor MMIX. The simulator +`mmix' which is available at +`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz' +understands this format. That package also includes a combined +assembler and linker called `mmixal'. The mmo format has no advantages +feature-wise compared to e.g. ELF. It is a simple non-relocatable +object format with no support for archives or debugging information, +except for symbol value information and line numbers (which is not yet +implemented in BFD). See +`http://www-cs-faculty.stanford.edu/~knuth/mmix.html' for more +information about MMIX. The ELF format is used for intermediate object +files in the BFD implementation. + +* Menu: + +* File layout:: +* Symbol-table:: +* mmo section mapping:: + + +File: bfd.info, Node: File layout, Next: Symbol-table, Prev: mmo, Up: mmo + +3.4.1 File layout +----------------- + +The mmo file contents is not partitioned into named sections as with +e.g. ELF. Memory areas is formed by specifying the location of the +data that follows. Only the memory area `0x0000...00' to `0x01ff...ff' +is executable, so it is used for code (and constants) and the area +`0x2000...00' to `0x20ff...ff' is used for writable data. *Note mmo +section mapping::. + + Contents is entered as 32-bit words, xor:ed over previous contents, +always zero-initialized. A word that starts with the byte `0x98' forms +a command called a `lopcode', where the next byte distinguished between +the thirteen lopcodes. The two remaining bytes, called the `Y' and `Z' +fields, or the `YZ' field (a 16-bit big-endian number), are used for +various purposes different for each lopcode. As documented in +`http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz', the +lopcodes are: + + There is provision for specifying "special data" of 65536 different +types. We use type 80 (decimal), arbitrarily chosen the same as the +ELF `e_machine' number for MMIX, filling it with section information +normally found in ELF objects. *Note mmo section mapping::. + +`lop_quote' + 0x98000001. The next word is contents, regardless of whether it + starts with 0x98 or not. + +`lop_loc' + 0x9801YYZZ, where `Z' is 1 or 2. This is a location directive, + setting the location for the next data to the next 32-bit word + (for Z = 1) or 64-bit word (for Z = 2), plus Y * 2^56. Normally + `Y' is 0 for the text segment and 2 for the data segment. + +`lop_skip' + 0x9802YYZZ. Increase the current location by `YZ' bytes. + +`lop_fixo' + 0x9803YYZZ, where `Z' is 1 or 2. Store the current location as 64 + bits into the location pointed to by the next 32-bit (Z = 1) or + 64-bit (Z = 2) word, plus Y * 2^56. + +`lop_fixr' + 0x9804YYZZ. `YZ' is stored into the current location plus 2 - 4 * + YZ. + +`lop_fixrx' + 0x980500ZZ. `Z' is 16 or 24. A value `L' derived from the + following 32-bit word are used in a manner similar to `YZ' in + lop_fixr: it is xor:ed into the current location minus 4 * L. The + first byte of the word is 0 or 1. If it is 1, then L = (LOWEST 24 + BITS OF WORD) - 2^Z, if 0, then L = (LOWEST 24 BITS OF WORD). + +`lop_file' + 0x9806YYZZ. `Y' is the file number, `Z' is count of 32-bit words. + Set the file number to `Y' and the line counter to 0. The next Z + * 4 bytes contain the file name, padded with zeros if the count is + not a multiple of four. The same `Y' may occur multiple times, + but `Z' must be 0 for all but the first occurrence. + +`lop_line' + 0x9807YYZZ. `YZ' is the line number. Together with lop_file, it + forms the source location for the next 32-bit word. Note that for + each non-lopcode 32-bit word, line numbers are assumed incremented + by one. + +`lop_spec' + 0x9808YYZZ. `YZ' is the type number. Data until the next lopcode + other than lop_quote forms special data of type `YZ'. *Note mmo + section mapping::. + + Other types than 80, (or type 80 with a content that does not + parse) is stored in sections named `.MMIX.spec_data.N' where N is + the `YZ'-type. The flags for such a sections say not to allocate + or load the data. The vma is 0. Contents of multiple occurrences + of special data N is concatenated to the data of the previous + lop_spec Ns. The location in data or code at which the lop_spec + occurred is lost. + +`lop_pre' + 0x980901ZZ. The first lopcode in a file. The `Z' field forms the + length of header information in 32-bit words, where the first word + tells the time in seconds since `00:00:00 GMT Jan 1 1970'. + +`lop_post' + 0x980a00ZZ. Z > 32. This lopcode follows after all + content-generating lopcodes in a program. The `Z' field denotes + the value of `rG' at the beginning of the program. The following + 256 - Z big-endian 64-bit words are loaded into global registers + `$G' ... `$255'. + +`lop_stab' + 0x980b0000. The next-to-last lopcode in a program. Must follow + immediately after the lop_post lopcode and its data. After this + lopcode follows all symbols in a compressed format (*note + Symbol-table::). + +`lop_end' + 0x980cYYZZ. The last lopcode in a program. It must follow the + lop_stab lopcode and its data. The `YZ' field contains the number + of 32-bit words of symbol table information after the preceding + lop_stab lopcode. + + Note that the lopcode "fixups"; `lop_fixr', `lop_fixrx' and +`lop_fixo' are not generated by BFD, but are handled. They are +generated by `mmixal'. + + This trivial one-label, one-instruction file: + + :Main TRAP 1,2,3 + + can be represented this way in mmo: + + 0x98090101 - lop_pre, one 32-bit word with timestamp. + + 0x98010002 - lop_loc, text segment, using a 64-bit address. + Note that mmixal does not emit this for the file above. + 0x00000000 - Address, high 32 bits. + 0x00000000 - Address, low 32 bits. + 0x98060002 - lop_file, 2 32-bit words for file-name. + 0x74657374 - "test" + 0x2e730000 - ".s\0\0" + 0x98070001 - lop_line, line 1. + 0x00010203 - TRAP 1,2,3 + 0x980a00ff - lop_post, setting $255 to 0. + 0x00000000 + 0x00000000 + 0x980b0000 - lop_stab for ":Main" = 0, serial 1. + 0x203a4040 *Note Symbol-table::. + 0x10404020 + 0x4d206120 + 0x69016e00 + 0x81000000 + 0x980c0005 - lop_end; symbol table contained five 32-bit words. + + +File: bfd.info, Node: Symbol-table, Next: mmo section mapping, Prev: File layout, Up: mmo + +3.4.2 Symbol table format +------------------------- + +From mmixal.w (or really, the generated mmixal.tex) in +`http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz'): +"Symbols are stored and retrieved by means of a `ternary search trie', +following ideas of Bentley and Sedgewick. (See ACM-SIAM Symp. on +Discrete Algorithms `8' (1997), 360-369; R.Sedgewick, `Algorithms in C' +(Reading, Mass. Addison-Wesley, 1998), `15.4'.) Each trie node stores +a character, and there are branches to subtries for the cases where a +given character is less than, equal to, or greater than the character +in the trie. There also is a pointer to a symbol table entry if a +symbol ends at the current node." + + So it's a tree encoded as a stream of bytes. The stream of bytes +acts on a single virtual global symbol, adding and removing characters +and signalling complete symbol points. Here, we read the stream and +create symbols at the completion points. + + First, there's a control byte `m'. If any of the listed bits in `m' +is nonzero, we execute what stands at the right, in the listed order: + + (MMO3_LEFT) + 0x40 - Traverse left trie. + (Read a new command byte and recurse.) + + (MMO3_SYMBITS) + 0x2f - Read the next byte as a character and store it in the + current character position; increment character position. + Test the bits of `m': + + (MMO3_WCHAR) + 0x80 - The character is 16-bit (so read another byte, + merge into current character. + + (MMO3_TYPEBITS) + 0xf - We have a complete symbol; parse the type, value + and serial number and do what should be done + with a symbol. The type and length information + is in j = (m & 0xf). + + (MMO3_REGQUAL_BITS) + j == 0xf: A register variable. The following + byte tells which register. + j <= 8: An absolute symbol. Read j bytes as the + big-endian number the symbol equals. + A j = 2 with two zero bytes denotes an + unknown symbol. + j > 8: As with j <= 8, but add (0x20 << 56) + to the value in the following j - 8 + bytes. + + Then comes the serial number, as a variant of + uleb128, but better named ubeb128: + Read bytes and shift the previous value left 7 + (multiply by 128). Add in the new byte, repeat + until a byte has bit 7 set. The serial number + is the computed value minus 128. + + (MMO3_MIDDLE) + 0x20 - Traverse middle trie. (Read a new command byte + and recurse.) Decrement character position. + + (MMO3_RIGHT) + 0x10 - Traverse right trie. (Read a new command byte and + recurse.) + + Let's look again at the `lop_stab' for the trivial file (*note File +layout::). + + 0x980b0000 - lop_stab for ":Main" = 0, serial 1. + 0x203a4040 + 0x10404020 + 0x4d206120 + 0x69016e00 + 0x81000000 + + This forms the trivial trie (note that the path between ":" and "M" +is redundant): + + 203a ":" + 40 / + 40 / + 10 \ + 40 / + 40 / + 204d "M" + 2061 "a" + 2069 "i" + 016e "n" is the last character in a full symbol, and + with a value represented in one byte. + 00 The value is 0. + 81 The serial number is 1. + + +File: bfd.info, Node: mmo section mapping, Prev: Symbol-table, Up: mmo + +3.4.3 mmo section mapping +------------------------- + +The implementation in BFD uses special data type 80 (decimal) to +encapsulate and describe named sections, containing e.g. debug +information. If needed, any datum in the encapsulation will be quoted +using lop_quote. First comes a 32-bit word holding the number of +32-bit words containing the zero-terminated zero-padded segment name. +After the name there's a 32-bit word holding flags describing the +section type. Then comes a 64-bit big-endian word with the section +length (in bytes), then another with the section start address. +Depending on the type of section, the contents might follow, +zero-padded to 32-bit boundary. For a loadable section (such as data +or code), the contents might follow at some later point, not +necessarily immediately, as a lop_loc with the same start address as in +the section description, followed by the contents. This in effect +forms a descriptor that must be emitted before the actual contents. +Sections described this way must not overlap. + + For areas that don't have such descriptors, synthetic sections are +formed by BFD. Consecutive contents in the two memory areas +`0x0000...00' to `0x01ff...ff' and `0x2000...00' to `0x20ff...ff' are +entered in sections named `.text' and `.data' respectively. If an area +is not otherwise described, but would together with a neighboring lower +area be less than `0x40000000' bytes long, it is joined with the lower +area and the gap is zero-filled. For other cases, a new section is +formed, named `.MMIX.sec.N'. Here, N is a number, a running count +through the mmo file, starting at 0. + + A loadable section specified as: + + .section secname,"ax" + TETRA 1,2,3,4,-1,-2009 + BYTE 80 + + and linked to address `0x4', is represented by the sequence: + + 0x98080050 - lop_spec 80 + 0x00000002 - two 32-bit words for the section name + 0x7365636e - "secn" + 0x616d6500 - "ame\0" + 0x00000033 - flags CODE, READONLY, LOAD, ALLOC + 0x00000000 - high 32 bits of section length + 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits + 0x00000000 - high 32 bits of section address + 0x00000004 - section address is 4 + 0x98010002 - 64 bits with address of following data + 0x00000000 - high 32 bits of address + 0x00000004 - low 32 bits: data starts at address 4 + 0x00000001 - 1 + 0x00000002 - 2 + 0x00000003 - 3 + 0x00000004 - 4 + 0xffffffff - -1 + 0xfffff827 - -2009 + 0x50000000 - 80 as a byte, padded with zeros. + + Note that the lop_spec wrapping does not include the section +contents. Compare this to a non-loaded section specified as: + + .section thirdsec + TETRA 200001,100002 + BYTE 38,40 + + This, when linked to address `0x200000000000001c', is represented by: + + 0x98080050 - lop_spec 80 + 0x00000002 - two 32-bit words for the section name + 0x7365636e - "thir" + 0x616d6500 - "dsec" + 0x00000010 - flag READONLY + 0x00000000 - high 32 bits of section length + 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits + 0x20000000 - high 32 bits of address + 0x0000001c - low 32 bits of address 0x200000000000001c + 0x00030d41 - 200001 + 0x000186a2 - 100002 + 0x26280000 - 38, 40 as bytes, padded with zeros + + For the latter example, the section contents must not be loaded in +memory, and is therefore specified as part of the special data. The +address is usually unimportant but might provide information for e.g. +the DWARF 2 debugging format. + + +File: bfd.info, Node: GNU Free Documentation License, Next: Index, Prev: BFD back ends, Up: Top + +Appendix A GNU Free Documentation License +***************************************** + + Version 1.1, March 2000 + + Copyright (C) 2000, Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + written document "free" in the sense of freedom: to assure everyone + the effective freedom to copy and redistribute it, with or without + modifying it, either commercially or noncommercially. Secondarily, + this License preserves for the author and publisher a way to get + credit for their work, while not being considered responsible for + modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work that contains a + notice placed by the copyright holder saying it can be distributed + under the terms of this License. The "Document", below, refers to + any such manual or work. Any member of the public is a licensee, + and is addressed as "you." + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter + section of the Document that deals exclusively with the + relationship of the publishers or authors of the Document to the + Document's overall subject (or to related matters) and contains + nothing that could fall directly within that overall subject. + (For example, if the Document is in part a textbook of + mathematics, a Secondary Section may not explain any mathematics.) + The relationship could be a matter of historical connection with + the subject or with related matters, or of legal, commercial, + philosophical, ethical or political position regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, whose contents can be viewed and edited directly + and straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup has been designed + to thwart or discourage subsequent modification by readers is not + Transparent. A copy that is not "Transparent" is called "Opaque." + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML designed for human modification. + Opaque formats include PostScript, PDF, proprietary formats that + can be read and edited only by proprietary word processors, SGML + or XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies of the Document numbering more than + 100, and the Document's license notice requires Cover Texts, you + must enclose the copies in covers that carry, clearly and legibly, + all these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a publicly-accessible + computer-network location containing a complete Transparent copy + of the Document, free of added material, which the general + network-using public has access to download anonymously at no + charge using public-standard network protocols. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that version + gives permission. + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in the + Modified Version, together with at least five of the principal + authors of the Document (all of its principal authors, if it + has less than five). + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + D. Preserve all the copyright notices of the Document. + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified Version + under the terms of this License, in the form shown in the + Addendum below. + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + H. Include an unaltered copy of this License. + I. Preserve the section entitled "History", and its title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. + If there is no section entitled "History" in the Document, + create one stating the title, year, authors, and publisher of + the Document as given on its Title Page, then add an item + describing the Modified Version as stated in the previous + sentence. + J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. + M. Delete any section entitled "Endorsements." Such a section + may not be included in the Modified Version. + N. Do not retitle any existing section as "Endorsements" or to + conflict in title with any Invariant Section. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties-for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition + of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections entitled + "History" in the various original documents, forming one section + entitled "History"; likewise combine any sections entitled + "Acknowledgements", and any sections entitled "Dedications." You + must delete all sections entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, does not as a whole count as a + Modified Version of the Document, provided no compilation + copyright is claimed for the compilation. Such a compilation is + called an "aggregate", and this License does not apply to the + other self-contained works thus compiled with the Document, on + account of their being thus compiled, if they are not themselves + derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one + quarter of the entire aggregate, the Document's Cover Texts may be + placed on covers that surround only the Document within the + aggregate. Otherwise they must appear on covers around the whole + aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License provided that you also include the + original English version of this License. In case of a + disagreement between the translation and the original English + version of this License, the original English version will prevail. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + http://www.gnu.org/copyleft/. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License." + + If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no Front-Cover +Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being +LIST"; likewise for Back-Cover Texts. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. + + +File: bfd.info, Node: Index, Prev: GNU Free Documentation License, Up: Top + +Index +***** + +[index] +* Menu: + +* _bfd_final_link_relocate: Relocating the section contents. + (line 22) +* _bfd_generic_link_add_archive_symbols: Adding symbols from an archive. + (line 12) +* _bfd_generic_link_add_one_symbol: Adding symbols from an object file. + (line 19) +* _bfd_generic_make_empty_symbol: symbol handling functions. + (line 92) +* _bfd_link_add_symbols in target vector: Adding Symbols to the Hash Table. + (line 6) +* _bfd_link_final_link in target vector: Performing the Final Link. + (line 6) +* _bfd_link_hash_table_create in target vector: Creating a Linker Hash Table. + (line 6) +* _bfd_relocate_contents: Relocating the section contents. + (line 22) +* _bfd_strip_section_from_output: section prototypes. (line 242) +* aout_SIZE_machine_type: aout. (line 146) +* aout_SIZE_mkobject: aout. (line 138) +* aout_SIZE_new_section_hook: aout. (line 175) +* aout_SIZE_set_arch_mach: aout. (line 162) +* aout_SIZE_some_aout_object_p: aout. (line 125) +* aout_SIZE_swap_exec_header_in: aout. (line 101) +* aout_SIZE_swap_exec_header_out: aout. (line 113) +* arelent_chain: typedef arelent. (line 338) +* BFD: Overview. (line 6) +* BFD canonical format: Canonical format. (line 11) +* bfd_alloc: Opening and Closing. + (line 179) +* bfd_alt_mach_code: BFD front end. (line 588) +* bfd_arch_bits_per_address: Architectures. (line 442) +* bfd_arch_bits_per_byte: Architectures. (line 434) +* bfd_arch_get_compatible: Architectures. (line 377) +* bfd_arch_list: Architectures. (line 368) +* bfd_arch_mach_octets_per_byte: Architectures. (line 511) +* bfd_cache_close: File Caching. (line 53) +* bfd_cache_close_all: File Caching. (line 66) +* bfd_cache_init: File Caching. (line 45) +* bfd_cache_lookup: File Caching. (line 32) +* bfd_cache_lookup_worker: File Caching. (line 91) +* BFD_CACHE_MAX_OPEN macro: File Caching. (line 15) +* bfd_calc_gnu_debuglink_crc32: Opening and Closing. + (line 188) +* bfd_canonicalize_reloc: BFD front end. (line 315) +* bfd_canonicalize_symtab: symbol handling functions. + (line 50) +* bfd_check_format: Formats. (line 18) +* bfd_check_format_matches: Formats. (line 49) +* bfd_check_overflow: typedef arelent. (line 350) +* bfd_close: Opening and Closing. + (line 104) +* bfd_close_all_done: Opening and Closing. + (line 122) +* bfd_coff_backend_data: coff. (line 246) +* bfd_copy_private_bfd_data: BFD front end. (line 454) +* bfd_copy_private_header_data: BFD front end. (line 436) +* bfd_copy_private_section_data: section prototypes. (line 224) +* bfd_copy_private_symbol_data: symbol handling functions. + (line 140) +* bfd_core_file_failing_command: Core Files. (line 9) +* bfd_core_file_failing_signal: Core Files. (line 18) +* bfd_create: Opening and Closing. + (line 141) +* bfd_create_gnu_debuglink_section: Opening and Closing. + (line 254) +* bfd_decode_symclass: symbol handling functions. + (line 111) +* bfd_default_arch_struct: Architectures. (line 389) +* bfd_default_compatible: Architectures. (line 451) +* bfd_default_reloc_type_lookup: howto manager. (line 1642) +* bfd_default_scan: Architectures. (line 460) +* bfd_default_set_arch_mach: Architectures. (line 407) +* bfd_elf_find_section: elf. (line 15) +* bfd_errmsg: BFD front end. (line 243) +* bfd_fdopenr: Opening and Closing. + (line 22) +* bfd_fill_in_gnu_debuglink_section: Opening and Closing. + (line 268) +* bfd_find_target: bfd_target. (line 420) +* bfd_follow_gnu_debuglink: Opening and Closing. + (line 233) +* bfd_format_string: Formats. (line 76) +* bfd_generic_discard_group: section prototypes. (line 264) +* bfd_generic_gc_sections: howto manager. (line 1673) +* bfd_generic_get_relocated_section_contents: howto manager. (line 1693) +* bfd_generic_is_group_section: section prototypes. (line 256) +* bfd_generic_merge_sections: howto manager. (line 1683) +* bfd_generic_relax_section: howto manager. (line 1660) +* bfd_get_arch: Architectures. (line 418) +* bfd_get_arch_info: Architectures. (line 470) +* bfd_get_arch_size: BFD front end. (line 359) +* bfd_get_error: BFD front end. (line 226) +* bfd_get_error_handler: BFD front end. (line 294) +* bfd_get_gp_size: BFD front end. (line 400) +* bfd_get_mach: Architectures. (line 426) +* bfd_get_mtime: BFD front end. (line 676) +* bfd_get_next_mapent: Archives. (line 49) +* bfd_get_reloc_code_name: howto manager. (line 1651) +* bfd_get_reloc_size: typedef arelent. (line 329) +* bfd_get_reloc_upper_bound: BFD front end. (line 305) +* bfd_get_section_by_name: section prototypes. (line 17) +* bfd_get_section_by_name_if: section prototypes. (line 31) +* bfd_get_section_contents: section prototypes. (line 197) +* bfd_get_sign_extend_vma: BFD front end. (line 372) +* bfd_get_size <1>: Internal. (line 22) +* bfd_get_size: BFD front end. (line 685) +* bfd_get_symtab_upper_bound: symbol handling functions. + (line 6) +* bfd_get_unique_section_name: section prototypes. (line 50) +* bfd_h_put_size: Internal. (line 94) +* bfd_hash_allocate: Creating and Freeing a Hash Table. + (line 17) +* bfd_hash_lookup: Looking Up or Entering a String. + (line 6) +* bfd_hash_newfunc: Creating and Freeing a Hash Table. + (line 12) +* bfd_hash_set_default_size: Creating and Freeing a Hash Table. + (line 25) +* bfd_hash_table_free: Creating and Freeing a Hash Table. + (line 21) +* bfd_hash_table_init: Creating and Freeing a Hash Table. + (line 6) +* bfd_hash_table_init_n: Creating and Freeing a Hash Table. + (line 6) +* bfd_hash_traverse: Traversing a Hash Table. + (line 6) +* bfd_init: Initialization. (line 8) +* bfd_install_relocation: typedef arelent. (line 391) +* bfd_is_local_label: symbol handling functions. + (line 17) +* bfd_is_local_label_name: symbol handling functions. + (line 26) +* bfd_is_target_special_symbol: symbol handling functions. + (line 38) +* bfd_is_undefined_symclass: symbol handling functions. + (line 120) +* bfd_last_cache: File Caching. (line 22) +* bfd_link_split_section: Writing the symbol table. + (line 44) +* bfd_log2: Internal. (line 161) +* bfd_lookup_arch: Architectures. (line 478) +* bfd_make_debug_symbol: symbol handling functions. + (line 102) +* bfd_make_empty_symbol: symbol handling functions. + (line 78) +* bfd_make_readable: Opening and Closing. + (line 165) +* bfd_make_section: section prototypes. (line 98) +* bfd_make_section_anyway: section prototypes. (line 82) +* bfd_make_section_old_way: section prototypes. (line 62) +* bfd_make_writable: Opening and Closing. + (line 151) +* bfd_malloc_and_get_section: section prototypes. (line 214) +* bfd_map_over_sections: section prototypes. (line 124) +* bfd_merge_private_bfd_data: BFD front end. (line 470) +* bfd_octets_per_byte: Architectures. (line 501) +* bfd_open_file: File Caching. (line 79) +* bfd_openr: Opening and Closing. + (line 6) +* bfd_openr_iovec: Opening and Closing. + (line 52) +* bfd_openr_next_archived_file: Archives. (line 75) +* bfd_openstreamr: Opening and Closing. + (line 43) +* bfd_openw: Opening and Closing. + (line 92) +* bfd_perform_relocation: typedef arelent. (line 366) +* bfd_perror: BFD front end. (line 252) +* bfd_preserve_finish: BFD front end. (line 636) +* bfd_preserve_restore: BFD front end. (line 626) +* bfd_preserve_save: BFD front end. (line 610) +* bfd_print_symbol_vandf: symbol handling functions. + (line 70) +* bfd_printable_arch_mach: Architectures. (line 489) +* bfd_printable_name: Architectures. (line 349) +* bfd_put_size: Internal. (line 19) +* BFD_RELOC_12_PCREL: howto manager. (line 39) +* BFD_RELOC_14: howto manager. (line 31) +* BFD_RELOC_16: howto manager. (line 30) +* BFD_RELOC_16_BASEREL: howto manager. (line 80) +* BFD_RELOC_16_GOT_PCREL: howto manager. (line 52) +* BFD_RELOC_16_GOTOFF: howto manager. (line 55) +* BFD_RELOC_16_PCREL: howto manager. (line 38) +* BFD_RELOC_16_PCREL_S2: howto manager. (line 92) +* BFD_RELOC_16_PLT_PCREL: howto manager. (line 63) +* BFD_RELOC_16_PLTOFF: howto manager. (line 67) +* BFD_RELOC_16C_ABS20: howto manager. (line 1407) +* BFD_RELOC_16C_ABS20_C: howto manager. (line 1408) +* BFD_RELOC_16C_ABS24: howto manager. (line 1409) +* BFD_RELOC_16C_ABS24_C: howto manager. (line 1410) +* BFD_RELOC_16C_DISP04: howto manager. (line 1387) +* BFD_RELOC_16C_DISP04_C: howto manager. (line 1388) +* BFD_RELOC_16C_DISP08: howto manager. (line 1389) +* BFD_RELOC_16C_DISP08_C: howto manager. (line 1390) +* BFD_RELOC_16C_DISP16: howto manager. (line 1391) +* BFD_RELOC_16C_DISP16_C: howto manager. (line 1392) +* BFD_RELOC_16C_DISP24: howto manager. (line 1393) +* BFD_RELOC_16C_DISP24_C: howto manager. (line 1394) +* BFD_RELOC_16C_DISP24a: howto manager. (line 1395) +* BFD_RELOC_16C_DISP24a_C: howto manager. (line 1396) +* BFD_RELOC_16C_IMM04: howto manager. (line 1411) +* BFD_RELOC_16C_IMM04_C: howto manager. (line 1412) +* BFD_RELOC_16C_IMM16: howto manager. (line 1413) +* BFD_RELOC_16C_IMM16_C: howto manager. (line 1414) +* BFD_RELOC_16C_IMM20: howto manager. (line 1415) +* BFD_RELOC_16C_IMM20_C: howto manager. (line 1416) +* BFD_RELOC_16C_IMM24: howto manager. (line 1417) +* BFD_RELOC_16C_IMM24_C: howto manager. (line 1418) +* BFD_RELOC_16C_IMM32: howto manager. (line 1419) +* BFD_RELOC_16C_IMM32_C: howto manager. (line 1420) +* BFD_RELOC_16C_NUM08: howto manager. (line 1381) +* BFD_RELOC_16C_NUM08_C: howto manager. (line 1382) +* BFD_RELOC_16C_NUM16: howto manager. (line 1383) +* BFD_RELOC_16C_NUM16_C: howto manager. (line 1384) +* BFD_RELOC_16C_NUM32: howto manager. (line 1385) +* BFD_RELOC_16C_NUM32_C: howto manager. (line 1386) +* BFD_RELOC_16C_REG04: howto manager. (line 1397) +* BFD_RELOC_16C_REG04_C: howto manager. (line 1398) +* BFD_RELOC_16C_REG04a: howto manager. (line 1399) +* BFD_RELOC_16C_REG04a_C: howto manager. (line 1400) +* BFD_RELOC_16C_REG14: howto manager. (line 1401) +* BFD_RELOC_16C_REG14_C: howto manager. (line 1402) +* BFD_RELOC_16C_REG16: howto manager. (line 1403) +* BFD_RELOC_16C_REG16_C: howto manager. (line 1404) +* BFD_RELOC_16C_REG20: howto manager. (line 1405) +* BFD_RELOC_16C_REG20_C: howto manager. (line 1406) +* BFD_RELOC_23_PCREL_S2: howto manager. (line 93) +* BFD_RELOC_24: howto manager. (line 29) +* BFD_RELOC_24_PCREL: howto manager. (line 37) +* BFD_RELOC_24_PLT_PCREL: howto manager. (line 62) +* BFD_RELOC_26: howto manager. (line 28) +* BFD_RELOC_32: howto manager. (line 27) +* BFD_RELOC_32_BASEREL: howto manager. (line 79) +* BFD_RELOC_32_GOT_PCREL: howto manager. (line 51) +* BFD_RELOC_32_GOTOFF: howto manager. (line 54) +* BFD_RELOC_32_PCREL: howto manager. (line 36) +* BFD_RELOC_32_PCREL_S2: howto manager. (line 91) +* BFD_RELOC_32_PLT_PCREL: howto manager. (line 61) +* BFD_RELOC_32_PLTOFF: howto manager. (line 66) +* BFD_RELOC_32_SECREL: howto manager. (line 48) +* BFD_RELOC_386_COPY: howto manager. (line 381) +* BFD_RELOC_386_GLOB_DAT: howto manager. (line 382) +* BFD_RELOC_386_GOT32: howto manager. (line 379) +* BFD_RELOC_386_GOTOFF: howto manager. (line 385) +* BFD_RELOC_386_GOTPC: howto manager. (line 386) +* BFD_RELOC_386_JUMP_SLOT: howto manager. (line 383) +* BFD_RELOC_386_PLT32: howto manager. (line 380) +* BFD_RELOC_386_RELATIVE: howto manager. (line 384) +* BFD_RELOC_386_TLS_DTPMOD32: howto manager. (line 396) +* BFD_RELOC_386_TLS_DTPOFF32: howto manager. (line 397) +* BFD_RELOC_386_TLS_GD: howto manager. (line 391) +* BFD_RELOC_386_TLS_GOTIE: howto manager. (line 389) +* BFD_RELOC_386_TLS_IE: howto manager. (line 388) +* BFD_RELOC_386_TLS_IE_32: howto manager. (line 394) +* BFD_RELOC_386_TLS_LDM: howto manager. (line 392) +* BFD_RELOC_386_TLS_LDO_32: howto manager. (line 393) +* BFD_RELOC_386_TLS_LE: howto manager. (line 390) +* BFD_RELOC_386_TLS_LE_32: howto manager. (line 395) +* BFD_RELOC_386_TLS_TPOFF: howto manager. (line 387) +* BFD_RELOC_386_TLS_TPOFF32: howto manager. (line 398) +* BFD_RELOC_390_12: howto manager. (line 1098) +* BFD_RELOC_390_20: howto manager. (line 1198) +* BFD_RELOC_390_COPY: howto manager. (line 1107) +* BFD_RELOC_390_GLOB_DAT: howto manager. (line 1110) +* BFD_RELOC_390_GOT12: howto manager. (line 1101) +* BFD_RELOC_390_GOT16: howto manager. (line 1122) +* BFD_RELOC_390_GOT20: howto manager. (line 1199) +* BFD_RELOC_390_GOT64: howto manager. (line 1140) +* BFD_RELOC_390_GOTENT: howto manager. (line 1146) +* BFD_RELOC_390_GOTOFF64: howto manager. (line 1149) +* BFD_RELOC_390_GOTPC: howto manager. (line 1119) +* BFD_RELOC_390_GOTPCDBL: howto manager. (line 1137) +* BFD_RELOC_390_GOTPLT12: howto manager. (line 1152) +* BFD_RELOC_390_GOTPLT16: howto manager. (line 1155) +* BFD_RELOC_390_GOTPLT20: howto manager. (line 1200) +* BFD_RELOC_390_GOTPLT32: howto manager. (line 1158) +* BFD_RELOC_390_GOTPLT64: howto manager. (line 1161) +* BFD_RELOC_390_GOTPLTENT: howto manager. (line 1164) +* BFD_RELOC_390_JMP_SLOT: howto manager. (line 1113) +* BFD_RELOC_390_PC16DBL: howto manager. (line 1125) +* BFD_RELOC_390_PC32DBL: howto manager. (line 1131) +* BFD_RELOC_390_PLT16DBL: howto manager. (line 1128) +* BFD_RELOC_390_PLT32: howto manager. (line 1104) +* BFD_RELOC_390_PLT32DBL: howto manager. (line 1134) +* BFD_RELOC_390_PLT64: howto manager. (line 1143) +* BFD_RELOC_390_PLTOFF16: howto manager. (line 1167) +* BFD_RELOC_390_PLTOFF32: howto manager. (line 1170) +* BFD_RELOC_390_PLTOFF64: howto manager. (line 1173) +* BFD_RELOC_390_RELATIVE: howto manager. (line 1116) +* BFD_RELOC_390_TLS_DTPMOD: howto manager. (line 1193) +* BFD_RELOC_390_TLS_DTPOFF: howto manager. (line 1194) +* BFD_RELOC_390_TLS_GD32: howto manager. (line 1179) +* BFD_RELOC_390_TLS_GD64: howto manager. (line 1180) +* BFD_RELOC_390_TLS_GDCALL: howto manager. (line 1177) +* BFD_RELOC_390_TLS_GOTIE12: howto manager. (line 1181) +* BFD_RELOC_390_TLS_GOTIE20: howto manager. (line 1201) +* BFD_RELOC_390_TLS_GOTIE32: howto manager. (line 1182) +* BFD_RELOC_390_TLS_GOTIE64: howto manager. (line 1183) +* BFD_RELOC_390_TLS_IE32: howto manager. (line 1186) +* BFD_RELOC_390_TLS_IE64: howto manager. (line 1187) +* BFD_RELOC_390_TLS_IEENT: howto manager. (line 1188) +* BFD_RELOC_390_TLS_LDCALL: howto manager. (line 1178) +* BFD_RELOC_390_TLS_LDM32: howto manager. (line 1184) +* BFD_RELOC_390_TLS_LDM64: howto manager. (line 1185) +* BFD_RELOC_390_TLS_LDO32: howto manager. (line 1191) +* BFD_RELOC_390_TLS_LDO64: howto manager. (line 1192) +* BFD_RELOC_390_TLS_LE32: howto manager. (line 1189) +* BFD_RELOC_390_TLS_LE64: howto manager. (line 1190) +* BFD_RELOC_390_TLS_LOAD: howto manager. (line 1176) +* BFD_RELOC_390_TLS_TPOFF: howto manager. (line 1195) +* BFD_RELOC_64: howto manager. (line 26) +* BFD_RELOC_64_PCREL: howto manager. (line 35) +* BFD_RELOC_64_PLT_PCREL: howto manager. (line 60) +* BFD_RELOC_64_PLTOFF: howto manager. (line 65) +* BFD_RELOC_68K_GLOB_DAT: howto manager. (line 74) +* BFD_RELOC_68K_JMP_SLOT: howto manager. (line 75) +* BFD_RELOC_68K_RELATIVE: howto manager. (line 76) +* BFD_RELOC_8: howto manager. (line 32) +* BFD_RELOC_860_COPY: howto manager. (line 1481) +* BFD_RELOC_860_GLOB_DAT: howto manager. (line 1482) +* BFD_RELOC_860_HAGOT: howto manager. (line 1507) +* BFD_RELOC_860_HAGOTOFF: howto manager. (line 1508) +* BFD_RELOC_860_HAPC: howto manager. (line 1509) +* BFD_RELOC_860_HIGH: howto manager. (line 1510) +* BFD_RELOC_860_HIGHADJ: howto manager. (line 1506) +* BFD_RELOC_860_HIGOT: howto manager. (line 1511) +* BFD_RELOC_860_HIGOTOFF: howto manager. (line 1512) +* BFD_RELOC_860_JUMP_SLOT: howto manager. (line 1483) +* BFD_RELOC_860_LOGOT0: howto manager. (line 1495) +* BFD_RELOC_860_LOGOT1: howto manager. (line 1497) +* BFD_RELOC_860_LOGOTOFF0: howto manager. (line 1499) +* BFD_RELOC_860_LOGOTOFF1: howto manager. (line 1501) +* BFD_RELOC_860_LOGOTOFF2: howto manager. (line 1503) +* BFD_RELOC_860_LOGOTOFF3: howto manager. (line 1504) +* BFD_RELOC_860_LOPC: howto manager. (line 1505) +* BFD_RELOC_860_LOW0: howto manager. (line 1488) +* BFD_RELOC_860_LOW1: howto manager. (line 1490) +* BFD_RELOC_860_LOW2: howto manager. (line 1492) +* BFD_RELOC_860_LOW3: howto manager. (line 1494) +* BFD_RELOC_860_PC16: howto manager. (line 1487) +* BFD_RELOC_860_PC26: howto manager. (line 1485) +* BFD_RELOC_860_PLT26: howto manager. (line 1486) +* BFD_RELOC_860_RELATIVE: howto manager. (line 1484) +* BFD_RELOC_860_SPGOT0: howto manager. (line 1496) +* BFD_RELOC_860_SPGOT1: howto manager. (line 1498) +* BFD_RELOC_860_SPGOTOFF0: howto manager. (line 1500) +* BFD_RELOC_860_SPGOTOFF1: howto manager. (line 1502) +* BFD_RELOC_860_SPLIT0: howto manager. (line 1489) +* BFD_RELOC_860_SPLIT1: howto manager. (line 1491) +* BFD_RELOC_860_SPLIT2: howto manager. (line 1493) +* BFD_RELOC_8_BASEREL: howto manager. (line 84) +* BFD_RELOC_8_FFnn: howto manager. (line 88) +* BFD_RELOC_8_GOT_PCREL: howto manager. (line 53) +* BFD_RELOC_8_GOTOFF: howto manager. (line 59) +* BFD_RELOC_8_PCREL: howto manager. (line 40) +* BFD_RELOC_8_PLT_PCREL: howto manager. (line 64) +* BFD_RELOC_8_PLTOFF: howto manager. (line 71) +* BFD_RELOC_ALPHA_BRSGP: howto manager. (line 259) +* BFD_RELOC_ALPHA_CODEADDR: howto manager. (line 250) +* BFD_RELOC_ALPHA_DTPMOD64: howto manager. (line 266) +* BFD_RELOC_ALPHA_DTPREL16: howto manager. (line 271) +* BFD_RELOC_ALPHA_DTPREL64: howto manager. (line 268) +* BFD_RELOC_ALPHA_DTPREL_HI16: howto manager. (line 269) +* BFD_RELOC_ALPHA_DTPREL_LO16: howto manager. (line 270) +* BFD_RELOC_ALPHA_ELF_LITERAL: howto manager. (line 215) +* BFD_RELOC_ALPHA_GOTDTPREL16: howto manager. (line 267) +* BFD_RELOC_ALPHA_GOTTPREL16: howto manager. (line 272) +* BFD_RELOC_ALPHA_GPDISP: howto manager. (line 209) +* BFD_RELOC_ALPHA_GPDISP_HI16: howto manager. (line 195) +* BFD_RELOC_ALPHA_GPDISP_LO16: howto manager. (line 203) +* BFD_RELOC_ALPHA_GPREL_HI16: howto manager. (line 254) +* BFD_RELOC_ALPHA_GPREL_LO16: howto manager. (line 255) +* BFD_RELOC_ALPHA_HINT: howto manager. (line 241) +* BFD_RELOC_ALPHA_LINKAGE: howto manager. (line 246) +* BFD_RELOC_ALPHA_LITERAL: howto manager. (line 214) +* BFD_RELOC_ALPHA_LITUSE: howto manager. (line 216) +* BFD_RELOC_ALPHA_TLSGD: howto manager. (line 264) +* BFD_RELOC_ALPHA_TLSLDM: howto manager. (line 265) +* BFD_RELOC_ALPHA_TPREL16: howto manager. (line 276) +* BFD_RELOC_ALPHA_TPREL64: howto manager. (line 273) +* BFD_RELOC_ALPHA_TPREL_HI16: howto manager. (line 274) +* BFD_RELOC_ALPHA_TPREL_LO16: howto manager. (line 275) +* BFD_RELOC_ARC_B22_PCREL: howto manager. (line 713) +* BFD_RELOC_ARC_B26: howto manager. (line 718) +* BFD_RELOC_ARM_ADR_IMM: howto manager. (line 574) +* BFD_RELOC_ARM_ADRL_IMMEDIATE: howto manager. (line 566) +* BFD_RELOC_ARM_COPY: howto manager. (line 587) +* BFD_RELOC_ARM_CP_OFF_IMM: howto manager. (line 572) +* BFD_RELOC_ARM_CP_OFF_IMM_S2: howto manager. (line 573) +* BFD_RELOC_ARM_GLOB_DAT: howto manager. (line 588) +* BFD_RELOC_ARM_GOT12: howto manager. (line 584) +* BFD_RELOC_ARM_GOT32: howto manager. (line 585) +* BFD_RELOC_ARM_GOTOFF: howto manager. (line 591) +* BFD_RELOC_ARM_GOTPC: howto manager. (line 592) +* BFD_RELOC_ARM_HWLITERAL: howto manager. (line 579) +* BFD_RELOC_ARM_IMMEDIATE: howto manager. (line 565) +* BFD_RELOC_ARM_IN_POOL: howto manager. (line 577) +* BFD_RELOC_ARM_JUMP_SLOT: howto manager. (line 586) +* BFD_RELOC_ARM_LDR_IMM: howto manager. (line 575) +* BFD_RELOC_ARM_LITERAL: howto manager. (line 576) +* BFD_RELOC_ARM_MULTI: howto manager. (line 571) +* BFD_RELOC_ARM_OFFSET_IMM: howto manager. (line 567) +* BFD_RELOC_ARM_OFFSET_IMM8: howto manager. (line 578) +* BFD_RELOC_ARM_PCREL_BLX: howto manager. (line 555) +* BFD_RELOC_ARM_PCREL_BRANCH: howto manager. (line 551) +* BFD_RELOC_ARM_PLT32: howto manager. (line 589) +* BFD_RELOC_ARM_PREL31: howto manager. (line 611) +* BFD_RELOC_ARM_RELATIVE: howto manager. (line 590) +* BFD_RELOC_ARM_ROSEGREL32: howto manager. (line 600) +* BFD_RELOC_ARM_SBREL32: howto manager. (line 603) +* BFD_RELOC_ARM_SHIFT_IMM: howto manager. (line 568) +* BFD_RELOC_ARM_SMI: howto manager. (line 569) +* BFD_RELOC_ARM_SWI: howto manager. (line 570) +* BFD_RELOC_ARM_TARGET1: howto manager. (line 596) +* BFD_RELOC_ARM_TARGET2: howto manager. (line 606) +* BFD_RELOC_ARM_THUMB_ADD: howto manager. (line 580) +* BFD_RELOC_ARM_THUMB_IMM: howto manager. (line 581) +* BFD_RELOC_ARM_THUMB_OFFSET: howto manager. (line 583) +* BFD_RELOC_ARM_THUMB_SHIFT: howto manager. (line 582) +* BFD_RELOC_AVR_13_PCREL: howto manager. (line 1031) +* BFD_RELOC_AVR_16_PM: howto manager. (line 1035) +* BFD_RELOC_AVR_7_PCREL: howto manager. (line 1027) +* BFD_RELOC_AVR_CALL: howto manager. (line 1094) +* BFD_RELOC_AVR_HH8_LDI: howto manager. (line 1047) +* BFD_RELOC_AVR_HH8_LDI_NEG: howto manager. (line 1062) +* BFD_RELOC_AVR_HH8_LDI_PM: howto manager. (line 1075) +* BFD_RELOC_AVR_HH8_LDI_PM_NEG: howto manager. (line 1089) +* BFD_RELOC_AVR_HI8_LDI: howto manager. (line 1043) +* BFD_RELOC_AVR_HI8_LDI_NEG: howto manager. (line 1057) +* BFD_RELOC_AVR_HI8_LDI_PM: howto manager. (line 1071) +* BFD_RELOC_AVR_HI8_LDI_PM_NEG: howto manager. (line 1084) +* BFD_RELOC_AVR_LO8_LDI: howto manager. (line 1039) +* BFD_RELOC_AVR_LO8_LDI_NEG: howto manager. (line 1052) +* BFD_RELOC_AVR_LO8_LDI_PM: howto manager. (line 1067) +* BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. (line 1080) +* bfd_reloc_code_type: howto manager. (line 10) +* BFD_RELOC_CRIS_16_GOT: howto manager. (line 1462) +* BFD_RELOC_CRIS_16_GOTPLT: howto manager. (line 1468) +* BFD_RELOC_CRIS_32_GOT: howto manager. (line 1459) +* BFD_RELOC_CRIS_32_GOTPLT: howto manager. (line 1465) +* BFD_RELOC_CRIS_32_GOTREL: howto manager. (line 1471) +* BFD_RELOC_CRIS_32_PLT_GOTREL: howto manager. (line 1474) +* BFD_RELOC_CRIS_32_PLT_PCREL: howto manager. (line 1477) +* BFD_RELOC_CRIS_BDISP8: howto manager. (line 1445) +* BFD_RELOC_CRIS_COPY: howto manager. (line 1453) +* BFD_RELOC_CRIS_GLOB_DAT: howto manager. (line 1454) +* BFD_RELOC_CRIS_JUMP_SLOT: howto manager. (line 1455) +* BFD_RELOC_CRIS_RELATIVE: howto manager. (line 1456) +* BFD_RELOC_CRIS_SIGNED_6: howto manager. (line 1447) +* BFD_RELOC_CRIS_UNSIGNED_4: howto manager. (line 1449) +* BFD_RELOC_CRIS_UNSIGNED_5: howto manager. (line 1446) +* BFD_RELOC_CRIS_UNSIGNED_6: howto manager. (line 1448) +* BFD_RELOC_CRX_ABS16: howto manager. (line 1433) +* BFD_RELOC_CRX_ABS32: howto manager. (line 1434) +* BFD_RELOC_CRX_IMM16: howto manager. (line 1438) +* BFD_RELOC_CRX_IMM32: howto manager. (line 1439) +* BFD_RELOC_CRX_NUM16: howto manager. (line 1436) +* BFD_RELOC_CRX_NUM32: howto manager. (line 1437) +* BFD_RELOC_CRX_NUM8: howto manager. (line 1435) +* BFD_RELOC_CRX_REGREL12: howto manager. (line 1429) +* BFD_RELOC_CRX_REGREL22: howto manager. (line 1430) +* BFD_RELOC_CRX_REGREL28: howto manager. (line 1431) +* BFD_RELOC_CRX_REGREL32: howto manager. (line 1432) +* BFD_RELOC_CRX_REL16: howto manager. (line 1426) +* BFD_RELOC_CRX_REL24: howto manager. (line 1427) +* BFD_RELOC_CRX_REL32: howto manager. (line 1428) +* BFD_RELOC_CRX_REL4: howto manager. (line 1423) +* BFD_RELOC_CRX_REL8: howto manager. (line 1424) +* BFD_RELOC_CRX_REL8_CMP: howto manager. (line 1425) +* BFD_RELOC_CRX_SWITCH16: howto manager. (line 1441) +* BFD_RELOC_CRX_SWITCH32: howto manager. (line 1442) +* BFD_RELOC_CRX_SWITCH8: howto manager. (line 1440) +* BFD_RELOC_CTOR: howto manager. (line 545) +* BFD_RELOC_D10V_10_PCREL_L: howto manager. (line 727) +* BFD_RELOC_D10V_10_PCREL_R: howto manager. (line 723) +* BFD_RELOC_D10V_18: howto manager. (line 732) +* BFD_RELOC_D10V_18_PCREL: howto manager. (line 735) +* BFD_RELOC_D30V_15: howto manager. (line 750) +* BFD_RELOC_D30V_15_PCREL: howto manager. (line 754) +* BFD_RELOC_D30V_15_PCREL_R: howto manager. (line 758) +* BFD_RELOC_D30V_21: howto manager. (line 763) +* BFD_RELOC_D30V_21_PCREL: howto manager. (line 767) +* BFD_RELOC_D30V_21_PCREL_R: howto manager. (line 771) +* BFD_RELOC_D30V_32: howto manager. (line 776) +* BFD_RELOC_D30V_32_PCREL: howto manager. (line 779) +* BFD_RELOC_D30V_6: howto manager. (line 738) +* BFD_RELOC_D30V_9_PCREL: howto manager. (line 741) +* BFD_RELOC_D30V_9_PCREL_R: howto manager. (line 745) +* BFD_RELOC_DLX_HI16_S: howto manager. (line 782) +* BFD_RELOC_DLX_JMP26: howto manager. (line 788) +* BFD_RELOC_DLX_LO16: howto manager. (line 785) +* BFD_RELOC_FR30_10_IN_8: howto manager. (line 957) +* BFD_RELOC_FR30_12_PCREL: howto manager. (line 965) +* BFD_RELOC_FR30_20: howto manager. (line 941) +* BFD_RELOC_FR30_48: howto manager. (line 938) +* BFD_RELOC_FR30_6_IN_4: howto manager. (line 945) +* BFD_RELOC_FR30_8_IN_8: howto manager. (line 949) +* BFD_RELOC_FR30_9_IN_8: howto manager. (line 953) +* BFD_RELOC_FR30_9_PCREL: howto manager. (line 961) +* BFD_RELOC_FRV_FUNCDESC: howto manager. (line 339) +* BFD_RELOC_FRV_FUNCDESC_GOT12: howto manager. (line 340) +* BFD_RELOC_FRV_FUNCDESC_GOTHI: howto manager. (line 341) +* BFD_RELOC_FRV_FUNCDESC_GOTLO: howto manager. (line 342) +* BFD_RELOC_FRV_FUNCDESC_GOTOFF12: howto manager. (line 344) +* BFD_RELOC_FRV_FUNCDESC_GOTOFFHI: howto manager. (line 345) +* BFD_RELOC_FRV_FUNCDESC_GOTOFFLO: howto manager. (line 346) +* BFD_RELOC_FRV_FUNCDESC_VALUE: howto manager. (line 343) +* BFD_RELOC_FRV_GOT12: howto manager. (line 336) +* BFD_RELOC_FRV_GOTHI: howto manager. (line 337) +* BFD_RELOC_FRV_GOTLO: howto manager. (line 338) +* BFD_RELOC_FRV_GOTOFF12: howto manager. (line 347) +* BFD_RELOC_FRV_GOTOFFHI: howto manager. (line 348) +* BFD_RELOC_FRV_GOTOFFLO: howto manager. (line 349) +* BFD_RELOC_FRV_GPREL12: howto manager. (line 331) +* BFD_RELOC_FRV_GPREL32: howto manager. (line 333) +* BFD_RELOC_FRV_GPRELHI: howto manager. (line 334) +* BFD_RELOC_FRV_GPRELLO: howto manager. (line 335) +* BFD_RELOC_FRV_GPRELU12: howto manager. (line 332) +* BFD_RELOC_FRV_HI16: howto manager. (line 330) +* BFD_RELOC_FRV_LABEL16: howto manager. (line 327) +* BFD_RELOC_FRV_LABEL24: howto manager. (line 328) +* BFD_RELOC_FRV_LO16: howto manager. (line 329) +* BFD_RELOC_GPREL16: howto manager. (line 106) +* BFD_RELOC_GPREL32: howto manager. (line 107) +* BFD_RELOC_H8_DIR16A8: howto manager. (line 1519) +* BFD_RELOC_H8_DIR16R8: howto manager. (line 1520) +* BFD_RELOC_H8_DIR24A8: howto manager. (line 1521) +* BFD_RELOC_H8_DIR24R8: howto manager. (line 1522) +* BFD_RELOC_H8_DIR32A16: howto manager. (line 1523) +* BFD_RELOC_HI16: howto manager. (line 289) +* BFD_RELOC_HI16_BASEREL: howto manager. (line 82) +* BFD_RELOC_HI16_GOTOFF: howto manager. (line 57) +* BFD_RELOC_HI16_PLTOFF: howto manager. (line 69) +* BFD_RELOC_HI16_S: howto manager. (line 292) +* BFD_RELOC_HI16_S_BASEREL: howto manager. (line 83) +* BFD_RELOC_HI16_S_GOTOFF: howto manager. (line 58) +* BFD_RELOC_HI16_S_PLTOFF: howto manager. (line 70) +* BFD_RELOC_HI22: howto manager. (line 101) +* BFD_RELOC_I370_D12: howto manager. (line 542) +* BFD_RELOC_I960_CALLJ: howto manager. (line 113) +* BFD_RELOC_IA64_COPY: howto manager. (line 1317) +* BFD_RELOC_IA64_DIR32LSB: howto manager. (line 1262) +* BFD_RELOC_IA64_DIR32MSB: howto manager. (line 1261) +* BFD_RELOC_IA64_DIR64LSB: howto manager. (line 1264) +* BFD_RELOC_IA64_DIR64MSB: howto manager. (line 1263) +* BFD_RELOC_IA64_DTPMOD64LSB: howto manager. (line 1327) +* BFD_RELOC_IA64_DTPMOD64MSB: howto manager. (line 1326) +* BFD_RELOC_IA64_DTPREL14: howto manager. (line 1329) +* BFD_RELOC_IA64_DTPREL22: howto manager. (line 1330) +* BFD_RELOC_IA64_DTPREL32LSB: howto manager. (line 1333) +* BFD_RELOC_IA64_DTPREL32MSB: howto manager. (line 1332) +* BFD_RELOC_IA64_DTPREL64I: howto manager. (line 1331) +* BFD_RELOC_IA64_DTPREL64LSB: howto manager. (line 1335) +* BFD_RELOC_IA64_DTPREL64MSB: howto manager. (line 1334) +* BFD_RELOC_IA64_FPTR32LSB: howto manager. (line 1279) +* BFD_RELOC_IA64_FPTR32MSB: howto manager. (line 1278) +* BFD_RELOC_IA64_FPTR64I: howto manager. (line 1277) +* BFD_RELOC_IA64_FPTR64LSB: howto manager. (line 1281) +* BFD_RELOC_IA64_FPTR64MSB: howto manager. (line 1280) +* BFD_RELOC_IA64_GPREL22: howto manager. (line 1265) +* BFD_RELOC_IA64_GPREL32LSB: howto manager. (line 1268) +* BFD_RELOC_IA64_GPREL32MSB: howto manager. (line 1267) +* BFD_RELOC_IA64_GPREL64I: howto manager. (line 1266) +* BFD_RELOC_IA64_GPREL64LSB: howto manager. (line 1270) +* BFD_RELOC_IA64_GPREL64MSB: howto manager. (line 1269) +* BFD_RELOC_IA64_IMM14: howto manager. (line 1258) +* BFD_RELOC_IA64_IMM22: howto manager. (line 1259) +* BFD_RELOC_IA64_IMM64: howto manager. (line 1260) +* BFD_RELOC_IA64_IPLTLSB: howto manager. (line 1316) +* BFD_RELOC_IA64_IPLTMSB: howto manager. (line 1315) +* BFD_RELOC_IA64_LDXMOV: howto manager. (line 1319) +* BFD_RELOC_IA64_LTOFF22: howto manager. (line 1271) +* BFD_RELOC_IA64_LTOFF22X: howto manager. (line 1318) +* BFD_RELOC_IA64_LTOFF64I: howto manager. (line 1272) +* BFD_RELOC_IA64_LTOFF_DTPMOD22: howto manager. (line 1328) +* BFD_RELOC_IA64_LTOFF_DTPREL22: howto manager. (line 1336) +* BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. (line 1293) +* BFD_RELOC_IA64_LTOFF_FPTR32LSB: howto manager. (line 1296) +* BFD_RELOC_IA64_LTOFF_FPTR32MSB: howto manager. (line 1295) +* BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. (line 1294) +* BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. (line 1298) +* BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. (line 1297) +* BFD_RELOC_IA64_LTOFF_TPREL22: howto manager. (line 1325) +* BFD_RELOC_IA64_LTV32LSB: howto manager. (line 1312) +* BFD_RELOC_IA64_LTV32MSB: howto manager. (line 1311) +* BFD_RELOC_IA64_LTV64LSB: howto manager. (line 1314) +* BFD_RELOC_IA64_LTV64MSB: howto manager. (line 1313) +* BFD_RELOC_IA64_PCREL21B: howto manager. (line 1282) +* BFD_RELOC_IA64_PCREL21BI: howto manager. (line 1283) +* BFD_RELOC_IA64_PCREL21F: howto manager. (line 1285) +* BFD_RELOC_IA64_PCREL21M: howto manager. (line 1284) +* BFD_RELOC_IA64_PCREL22: howto manager. (line 1286) +* BFD_RELOC_IA64_PCREL32LSB: howto manager. (line 1290) +* BFD_RELOC_IA64_PCREL32MSB: howto manager. (line 1289) +* BFD_RELOC_IA64_PCREL60B: howto manager. (line 1287) +* BFD_RELOC_IA64_PCREL64I: howto manager. (line 1288) +* BFD_RELOC_IA64_PCREL64LSB: howto manager. (line 1292) +* BFD_RELOC_IA64_PCREL64MSB: howto manager. (line 1291) +* BFD_RELOC_IA64_PLTOFF22: howto manager. (line 1273) +* BFD_RELOC_IA64_PLTOFF64I: howto manager. (line 1274) +* BFD_RELOC_IA64_PLTOFF64LSB: howto manager. (line 1276) +* BFD_RELOC_IA64_PLTOFF64MSB: howto manager. (line 1275) +* BFD_RELOC_IA64_REL32LSB: howto manager. (line 1308) +* BFD_RELOC_IA64_REL32MSB: howto manager. (line 1307) +* BFD_RELOC_IA64_REL64LSB: howto manager. (line 1310) +* BFD_RELOC_IA64_REL64MSB: howto manager. (line 1309) +* BFD_RELOC_IA64_SECREL32LSB: howto manager. (line 1304) +* BFD_RELOC_IA64_SECREL32MSB: howto manager. (line 1303) +* BFD_RELOC_IA64_SECREL64LSB: howto manager. (line 1306) +* BFD_RELOC_IA64_SECREL64MSB: howto manager. (line 1305) +* BFD_RELOC_IA64_SEGREL32LSB: howto manager. (line 1300) +* BFD_RELOC_IA64_SEGREL32MSB: howto manager. (line 1299) +* BFD_RELOC_IA64_SEGREL64LSB: howto manager. (line 1302) +* BFD_RELOC_IA64_SEGREL64MSB: howto manager. (line 1301) +* BFD_RELOC_IA64_TPREL14: howto manager. (line 1320) +* BFD_RELOC_IA64_TPREL22: howto manager. (line 1321) +* BFD_RELOC_IA64_TPREL64I: howto manager. (line 1322) +* BFD_RELOC_IA64_TPREL64LSB: howto manager. (line 1324) +* BFD_RELOC_IA64_TPREL64MSB: howto manager. (line 1323) +* BFD_RELOC_IP2K_ADDR16CJP: howto manager. (line 1210) +* BFD_RELOC_IP2K_BANK: howto manager. (line 1207) +* BFD_RELOC_IP2K_EX8DATA: howto manager. (line 1218) +* BFD_RELOC_IP2K_FR9: howto manager. (line 1204) +* BFD_RELOC_IP2K_FR_OFFSET: howto manager. (line 1231) +* BFD_RELOC_IP2K_HI8DATA: howto manager. (line 1217) +* BFD_RELOC_IP2K_HI8INSN: howto manager. (line 1222) +* BFD_RELOC_IP2K_LO8DATA: howto manager. (line 1216) +* BFD_RELOC_IP2K_LO8INSN: howto manager. (line 1221) +* BFD_RELOC_IP2K_PAGE3: howto manager. (line 1213) +* BFD_RELOC_IP2K_PC_SKIP: howto manager. (line 1225) +* BFD_RELOC_IP2K_TEXT: howto manager. (line 1228) +* BFD_RELOC_IQ2000_OFFSET_16: howto manager. (line 1546) +* BFD_RELOC_IQ2000_OFFSET_21: howto manager. (line 1547) +* BFD_RELOC_IQ2000_UHI16: howto manager. (line 1548) +* BFD_RELOC_LO10: howto manager. (line 102) +* BFD_RELOC_LO16: howto manager. (line 298) +* BFD_RELOC_LO16_BASEREL: howto manager. (line 81) +* BFD_RELOC_LO16_GOTOFF: howto manager. (line 56) +* BFD_RELOC_LO16_PLTOFF: howto manager. (line 68) +* BFD_RELOC_M32R_10_PCREL: howto manager. (line 795) +* BFD_RELOC_M32R_18_PCREL: howto manager. (line 799) +* BFD_RELOC_M32R_24: howto manager. (line 791) +* BFD_RELOC_M32R_26_PCREL: howto manager. (line 802) +* BFD_RELOC_M32R_26_PLTREL: howto manager. (line 821) +* BFD_RELOC_M32R_COPY: howto manager. (line 822) +* BFD_RELOC_M32R_GLOB_DAT: howto manager. (line 823) +* BFD_RELOC_M32R_GOT16_HI_SLO: howto manager. (line 832) +* BFD_RELOC_M32R_GOT16_HI_ULO: howto manager. (line 831) +* BFD_RELOC_M32R_GOT16_LO: howto manager. (line 833) +* BFD_RELOC_M32R_GOT24: howto manager. (line 820) +* BFD_RELOC_M32R_GOTOFF: howto manager. (line 826) +* BFD_RELOC_M32R_GOTOFF_HI_SLO: howto manager. (line 828) +* BFD_RELOC_M32R_GOTOFF_HI_ULO: howto manager. (line 827) +* BFD_RELOC_M32R_GOTOFF_LO: howto manager. (line 829) +* BFD_RELOC_M32R_GOTPC24: howto manager. (line 830) +* BFD_RELOC_M32R_GOTPC_HI_SLO: howto manager. (line 835) +* BFD_RELOC_M32R_GOTPC_HI_ULO: howto manager. (line 834) +* BFD_RELOC_M32R_GOTPC_LO: howto manager. (line 836) +* BFD_RELOC_M32R_HI16_SLO: howto manager. (line 809) +* BFD_RELOC_M32R_HI16_ULO: howto manager. (line 805) +* BFD_RELOC_M32R_JMP_SLOT: howto manager. (line 824) +* BFD_RELOC_M32R_LO16: howto manager. (line 813) +* BFD_RELOC_M32R_RELATIVE: howto manager. (line 825) +* BFD_RELOC_M32R_SDA16: howto manager. (line 816) +* BFD_RELOC_M68HC11_24: howto manager. (line 1372) +* BFD_RELOC_M68HC11_3B: howto manager. (line 1347) +* BFD_RELOC_M68HC11_HI8: howto manager. (line 1339) +* BFD_RELOC_M68HC11_LO16: howto manager. (line 1361) +* BFD_RELOC_M68HC11_LO8: howto manager. (line 1343) +* BFD_RELOC_M68HC11_PAGE: howto manager. (line 1367) +* BFD_RELOC_M68HC11_RL_GROUP: howto manager. (line 1356) +* BFD_RELOC_M68HC11_RL_JUMP: howto manager. (line 1350) +* BFD_RELOC_M68HC12_5B: howto manager. (line 1378) +* BFD_RELOC_MCORE_PCREL_32: howto manager. (line 972) +* BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. (line 970) +* BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. (line 971) +* BFD_RELOC_MCORE_PCREL_IMM8BY4: howto manager. (line 969) +* BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: howto manager. (line 973) +* BFD_RELOC_MCORE_RVA: howto manager. (line 974) +* BFD_RELOC_MIPS16_GPREL: howto manager. (line 286) +* BFD_RELOC_MIPS16_JMP: howto manager. (line 283) +* BFD_RELOC_MIPS_CALL16: howto manager. (line 305) +* BFD_RELOC_MIPS_CALL_HI16: howto manager. (line 308) +* BFD_RELOC_MIPS_CALL_LO16: howto manager. (line 309) +* BFD_RELOC_MIPS_DELETE: howto manager. (line 318) +* BFD_RELOC_MIPS_GOT16: howto manager. (line 304) +* BFD_RELOC_MIPS_GOT_DISP: howto manager. (line 313) +* BFD_RELOC_MIPS_GOT_HI16: howto manager. (line 306) +* BFD_RELOC_MIPS_GOT_LO16: howto manager. (line 307) +* BFD_RELOC_MIPS_GOT_OFST: howto manager. (line 312) +* BFD_RELOC_MIPS_GOT_PAGE: howto manager. (line 311) +* BFD_RELOC_MIPS_HIGHER: howto manager. (line 320) +* BFD_RELOC_MIPS_HIGHEST: howto manager. (line 319) +* BFD_RELOC_MIPS_INSERT_A: howto manager. (line 316) +* BFD_RELOC_MIPS_INSERT_B: howto manager. (line 317) +* BFD_RELOC_MIPS_JALR: howto manager. (line 324) +* BFD_RELOC_MIPS_JMP: howto manager. (line 279) +* BFD_RELOC_MIPS_LITERAL: howto manager. (line 301) +* BFD_RELOC_MIPS_REL16: howto manager. (line 322) +* BFD_RELOC_MIPS_RELGOT: howto manager. (line 323) +* BFD_RELOC_MIPS_SCN_DISP: howto manager. (line 321) +* BFD_RELOC_MIPS_SHIFT5: howto manager. (line 314) +* BFD_RELOC_MIPS_SHIFT6: howto manager. (line 315) +* BFD_RELOC_MIPS_SUB: howto manager. (line 310) +* BFD_RELOC_MMIX_ADDR19: howto manager. (line 1003) +* BFD_RELOC_MMIX_ADDR27: howto manager. (line 1007) +* BFD_RELOC_MMIX_BASE_PLUS_OFFSET: howto manager. (line 1019) +* BFD_RELOC_MMIX_CBRANCH: howto manager. (line 983) +* BFD_RELOC_MMIX_CBRANCH_1: howto manager. (line 985) +* BFD_RELOC_MMIX_CBRANCH_2: howto manager. (line 986) +* BFD_RELOC_MMIX_CBRANCH_3: howto manager. (line 987) +* BFD_RELOC_MMIX_CBRANCH_J: howto manager. (line 984) +* BFD_RELOC_MMIX_GETA: howto manager. (line 977) +* BFD_RELOC_MMIX_GETA_1: howto manager. (line 978) +* BFD_RELOC_MMIX_GETA_2: howto manager. (line 979) +* BFD_RELOC_MMIX_GETA_3: howto manager. (line 980) +* BFD_RELOC_MMIX_JMP: howto manager. (line 997) +* BFD_RELOC_MMIX_JMP_1: howto manager. (line 998) +* BFD_RELOC_MMIX_JMP_2: howto manager. (line 999) +* BFD_RELOC_MMIX_JMP_3: howto manager. (line 1000) +* BFD_RELOC_MMIX_LOCAL: howto manager. (line 1023) +* BFD_RELOC_MMIX_PUSHJ: howto manager. (line 990) +* BFD_RELOC_MMIX_PUSHJ_1: howto manager. (line 991) +* BFD_RELOC_MMIX_PUSHJ_2: howto manager. (line 992) +* BFD_RELOC_MMIX_PUSHJ_3: howto manager. (line 993) +* BFD_RELOC_MMIX_PUSHJ_STUBBABLE: howto manager. (line 994) +* BFD_RELOC_MMIX_REG: howto manager. (line 1015) +* BFD_RELOC_MMIX_REG_OR_BYTE: howto manager. (line 1011) +* BFD_RELOC_MN10300_16_PCREL: howto manager. (line 907) +* BFD_RELOC_MN10300_32_PCREL: howto manager. (line 903) +* BFD_RELOC_MN10300_COPY: howto manager. (line 367) +* BFD_RELOC_MN10300_GLOB_DAT: howto manager. (line 370) +* BFD_RELOC_MN10300_GOT16: howto manager. (line 363) +* BFD_RELOC_MN10300_GOT24: howto manager. (line 359) +* BFD_RELOC_MN10300_GOT32: howto manager. (line 355) +* BFD_RELOC_MN10300_GOTOFF24: howto manager. (line 352) +* BFD_RELOC_MN10300_JMP_SLOT: howto manager. (line 373) +* BFD_RELOC_MN10300_RELATIVE: howto manager. (line 376) +* BFD_RELOC_MSP430_10_PCREL: howto manager. (line 1537) +* BFD_RELOC_MSP430_16: howto manager. (line 1539) +* BFD_RELOC_MSP430_16_BYTE: howto manager. (line 1541) +* BFD_RELOC_MSP430_16_PCREL: howto manager. (line 1538) +* BFD_RELOC_MSP430_16_PCREL_BYTE: howto manager. (line 1540) +* BFD_RELOC_MSP430_2X_PCREL: howto manager. (line 1542) +* BFD_RELOC_MSP430_RL_PCREL: howto manager. (line 1543) +* BFD_RELOC_NONE: howto manager. (line 116) +* BFD_RELOC_NS32K_DISP_16: howto manager. (line 426) +* BFD_RELOC_NS32K_DISP_16_PCREL: howto manager. (line 429) +* BFD_RELOC_NS32K_DISP_32: howto manager. (line 427) +* BFD_RELOC_NS32K_DISP_32_PCREL: howto manager. (line 430) +* BFD_RELOC_NS32K_DISP_8: howto manager. (line 425) +* BFD_RELOC_NS32K_DISP_8_PCREL: howto manager. (line 428) +* BFD_RELOC_NS32K_IMM_16: howto manager. (line 420) +* BFD_RELOC_NS32K_IMM_16_PCREL: howto manager. (line 423) +* BFD_RELOC_NS32K_IMM_32: howto manager. (line 421) +* BFD_RELOC_NS32K_IMM_32_PCREL: howto manager. (line 424) +* BFD_RELOC_NS32K_IMM_8: howto manager. (line 419) +* BFD_RELOC_NS32K_IMM_8_PCREL: howto manager. (line 422) +* BFD_RELOC_OPENRISC_ABS_26: howto manager. (line 1515) +* BFD_RELOC_OPENRISC_REL_26: howto manager. (line 1516) +* BFD_RELOC_PDP11_DISP_6_PCREL: howto manager. (line 434) +* BFD_RELOC_PDP11_DISP_8_PCREL: howto manager. (line 433) +* BFD_RELOC_PJ_CODE_DIR16: howto manager. (line 439) +* BFD_RELOC_PJ_CODE_DIR32: howto manager. (line 440) +* BFD_RELOC_PJ_CODE_HI16: howto manager. (line 437) +* BFD_RELOC_PJ_CODE_LO16: howto manager. (line 438) +* BFD_RELOC_PJ_CODE_REL16: howto manager. (line 441) +* BFD_RELOC_PJ_CODE_REL32: howto manager. (line 442) +* BFD_RELOC_PPC64_ADDR16_DS: howto manager. (line 487) +* BFD_RELOC_PPC64_ADDR16_LO_DS: howto manager. (line 488) +* BFD_RELOC_PPC64_DTPREL16_DS: howto manager. (line 534) +* BFD_RELOC_PPC64_DTPREL16_HIGHER: howto manager. (line 536) +* BFD_RELOC_PPC64_DTPREL16_HIGHERA: howto manager. (line 537) +* BFD_RELOC_PPC64_DTPREL16_HIGHEST: howto manager. (line 538) +* BFD_RELOC_PPC64_DTPREL16_HIGHESTA: howto manager. (line 539) +* BFD_RELOC_PPC64_DTPREL16_LO_DS: howto manager. (line 535) +* BFD_RELOC_PPC64_GOT16_DS: howto manager. (line 489) +* BFD_RELOC_PPC64_GOT16_LO_DS: howto manager. (line 490) +* BFD_RELOC_PPC64_HIGHER: howto manager. (line 475) +* BFD_RELOC_PPC64_HIGHER_S: howto manager. (line 476) +* BFD_RELOC_PPC64_HIGHEST: howto manager. (line 477) +* BFD_RELOC_PPC64_HIGHEST_S: howto manager. (line 478) +* BFD_RELOC_PPC64_PLT16_LO_DS: howto manager. (line 491) +* BFD_RELOC_PPC64_PLTGOT16: howto manager. (line 483) +* BFD_RELOC_PPC64_PLTGOT16_DS: howto manager. (line 496) +* BFD_RELOC_PPC64_PLTGOT16_HA: howto manager. (line 486) +* BFD_RELOC_PPC64_PLTGOT16_HI: howto manager. (line 485) +* BFD_RELOC_PPC64_PLTGOT16_LO: howto manager. (line 484) +* BFD_RELOC_PPC64_PLTGOT16_LO_DS: howto manager. (line 497) +* BFD_RELOC_PPC64_SECTOFF_DS: howto manager. (line 492) +* BFD_RELOC_PPC64_SECTOFF_LO_DS: howto manager. (line 493) +* BFD_RELOC_PPC64_TOC: howto manager. (line 482) +* BFD_RELOC_PPC64_TOC16_DS: howto manager. (line 494) +* BFD_RELOC_PPC64_TOC16_HA: howto manager. (line 481) +* BFD_RELOC_PPC64_TOC16_HI: howto manager. (line 480) +* BFD_RELOC_PPC64_TOC16_LO: howto manager. (line 479) +* BFD_RELOC_PPC64_TOC16_LO_DS: howto manager. (line 495) +* BFD_RELOC_PPC64_TPREL16_DS: howto manager. (line 528) +* BFD_RELOC_PPC64_TPREL16_HIGHER: howto manager. (line 530) +* BFD_RELOC_PPC64_TPREL16_HIGHERA: howto manager. (line 531) +* BFD_RELOC_PPC64_TPREL16_HIGHEST: howto manager. (line 532) +* BFD_RELOC_PPC64_TPREL16_HIGHESTA: howto manager. (line 533) +* BFD_RELOC_PPC64_TPREL16_LO_DS: howto manager. (line 529) +* BFD_RELOC_PPC_B16: howto manager. (line 448) +* BFD_RELOC_PPC_B16_BRNTAKEN: howto manager. (line 450) +* BFD_RELOC_PPC_B16_BRTAKEN: howto manager. (line 449) +* BFD_RELOC_PPC_B26: howto manager. (line 445) +* BFD_RELOC_PPC_BA16: howto manager. (line 451) +* BFD_RELOC_PPC_BA16_BRNTAKEN: howto manager. (line 453) +* BFD_RELOC_PPC_BA16_BRTAKEN: howto manager. (line 452) +* BFD_RELOC_PPC_BA26: howto manager. (line 446) +* BFD_RELOC_PPC_COPY: howto manager. (line 454) +* BFD_RELOC_PPC_DTPMOD: howto manager. (line 501) +* BFD_RELOC_PPC_DTPREL: howto manager. (line 511) +* BFD_RELOC_PPC_DTPREL16: howto manager. (line 507) +* BFD_RELOC_PPC_DTPREL16_HA: howto manager. (line 510) +* BFD_RELOC_PPC_DTPREL16_HI: howto manager. (line 509) +* BFD_RELOC_PPC_DTPREL16_LO: howto manager. (line 508) +* BFD_RELOC_PPC_EMB_BIT_FLD: howto manager. (line 473) +* BFD_RELOC_PPC_EMB_MRKREF: howto manager. (line 468) +* BFD_RELOC_PPC_EMB_NADDR16: howto manager. (line 460) +* BFD_RELOC_PPC_EMB_NADDR16_HA: howto manager. (line 463) +* BFD_RELOC_PPC_EMB_NADDR16_HI: howto manager. (line 462) +* BFD_RELOC_PPC_EMB_NADDR16_LO: howto manager. (line 461) +* BFD_RELOC_PPC_EMB_NADDR32: howto manager. (line 459) +* BFD_RELOC_PPC_EMB_RELSDA: howto manager. (line 474) +* BFD_RELOC_PPC_EMB_RELSEC16: howto manager. (line 469) +* BFD_RELOC_PPC_EMB_RELST_HA: howto manager. (line 472) +* BFD_RELOC_PPC_EMB_RELST_HI: howto manager. (line 471) +* BFD_RELOC_PPC_EMB_RELST_LO: howto manager. (line 470) +* BFD_RELOC_PPC_EMB_SDA21: howto manager. (line 467) +* BFD_RELOC_PPC_EMB_SDA2I16: howto manager. (line 465) +* BFD_RELOC_PPC_EMB_SDA2REL: howto manager. (line 466) +* BFD_RELOC_PPC_EMB_SDAI16: howto manager. (line 464) +* BFD_RELOC_PPC_GLOB_DAT: howto manager. (line 455) +* BFD_RELOC_PPC_GOT_DTPREL16: howto manager. (line 524) +* BFD_RELOC_PPC_GOT_DTPREL16_HA: howto manager. (line 527) +* BFD_RELOC_PPC_GOT_DTPREL16_HI: howto manager. (line 526) +* BFD_RELOC_PPC_GOT_DTPREL16_LO: howto manager. (line 525) +* BFD_RELOC_PPC_GOT_TLSGD16: howto manager. (line 512) +* BFD_RELOC_PPC_GOT_TLSGD16_HA: howto manager. (line 515) +* BFD_RELOC_PPC_GOT_TLSGD16_HI: howto manager. (line 514) +* BFD_RELOC_PPC_GOT_TLSGD16_LO: howto manager. (line 513) +* BFD_RELOC_PPC_GOT_TLSLD16: howto manager. (line 516) +* BFD_RELOC_PPC_GOT_TLSLD16_HA: howto manager. (line 519) +* BFD_RELOC_PPC_GOT_TLSLD16_HI: howto manager. (line 518) +* BFD_RELOC_PPC_GOT_TLSLD16_LO: howto manager. (line 517) +* BFD_RELOC_PPC_GOT_TPREL16: howto manager. (line 520) +* BFD_RELOC_PPC_GOT_TPREL16_HA: howto manager. (line 523) +* BFD_RELOC_PPC_GOT_TPREL16_HI: howto manager. (line 522) +* BFD_RELOC_PPC_GOT_TPREL16_LO: howto manager. (line 521) +* BFD_RELOC_PPC_JMP_SLOT: howto manager. (line 456) +* BFD_RELOC_PPC_LOCAL24PC: howto manager. (line 458) +* BFD_RELOC_PPC_RELATIVE: howto manager. (line 457) +* BFD_RELOC_PPC_TLS: howto manager. (line 500) +* BFD_RELOC_PPC_TOC16: howto manager. (line 447) +* BFD_RELOC_PPC_TPREL: howto manager. (line 506) +* BFD_RELOC_PPC_TPREL16: howto manager. (line 502) +* BFD_RELOC_PPC_TPREL16_HA: howto manager. (line 505) +* BFD_RELOC_PPC_TPREL16_HI: howto manager. (line 504) +* BFD_RELOC_PPC_TPREL16_LO: howto manager. (line 503) +* BFD_RELOC_RVA: howto manager. (line 85) +* BFD_RELOC_SH_ALIGN: howto manager. (line 636) +* BFD_RELOC_SH_CODE: howto manager. (line 637) +* BFD_RELOC_SH_COPY: howto manager. (line 642) +* BFD_RELOC_SH_COPY64: howto manager. (line 667) +* BFD_RELOC_SH_COUNT: howto manager. (line 635) +* BFD_RELOC_SH_DATA: howto manager. (line 638) +* BFD_RELOC_SH_DISP12: howto manager. (line 618) +* BFD_RELOC_SH_DISP12BY2: howto manager. (line 619) +* BFD_RELOC_SH_DISP12BY4: howto manager. (line 620) +* BFD_RELOC_SH_DISP12BY8: howto manager. (line 621) +* BFD_RELOC_SH_DISP20: howto manager. (line 622) +* BFD_RELOC_SH_DISP20BY8: howto manager. (line 623) +* BFD_RELOC_SH_GLOB_DAT: howto manager. (line 643) +* BFD_RELOC_SH_GLOB_DAT64: howto manager. (line 668) +* BFD_RELOC_SH_GOT10BY4: howto manager. (line 671) +* BFD_RELOC_SH_GOT10BY8: howto manager. (line 672) +* BFD_RELOC_SH_GOT_HI16: howto manager. (line 650) +* BFD_RELOC_SH_GOT_LOW16: howto manager. (line 647) +* BFD_RELOC_SH_GOT_MEDHI16: howto manager. (line 649) +* BFD_RELOC_SH_GOT_MEDLOW16: howto manager. (line 648) +* BFD_RELOC_SH_GOTOFF_HI16: howto manager. (line 662) +* BFD_RELOC_SH_GOTOFF_LOW16: howto manager. (line 659) +* BFD_RELOC_SH_GOTOFF_MEDHI16: howto manager. (line 661) +* BFD_RELOC_SH_GOTOFF_MEDLOW16: howto manager. (line 660) +* BFD_RELOC_SH_GOTPC: howto manager. (line 646) +* BFD_RELOC_SH_GOTPC_HI16: howto manager. (line 666) +* BFD_RELOC_SH_GOTPC_LOW16: howto manager. (line 663) +* BFD_RELOC_SH_GOTPC_MEDHI16: howto manager. (line 665) +* BFD_RELOC_SH_GOTPC_MEDLOW16: howto manager. (line 664) +* BFD_RELOC_SH_GOTPLT10BY4: howto manager. (line 673) +* BFD_RELOC_SH_GOTPLT10BY8: howto manager. (line 674) +* BFD_RELOC_SH_GOTPLT32: howto manager. (line 675) +* BFD_RELOC_SH_GOTPLT_HI16: howto manager. (line 654) +* BFD_RELOC_SH_GOTPLT_LOW16: howto manager. (line 651) +* BFD_RELOC_SH_GOTPLT_MEDHI16: howto manager. (line 653) +* BFD_RELOC_SH_GOTPLT_MEDLOW16: howto manager. (line 652) +* BFD_RELOC_SH_IMM3: howto manager. (line 616) +* BFD_RELOC_SH_IMM3U: howto manager. (line 617) +* BFD_RELOC_SH_IMM4: howto manager. (line 624) +* BFD_RELOC_SH_IMM4BY2: howto manager. (line 625) +* BFD_RELOC_SH_IMM4BY4: howto manager. (line 626) +* BFD_RELOC_SH_IMM8: howto manager. (line 627) +* BFD_RELOC_SH_IMM8BY2: howto manager. (line 628) +* BFD_RELOC_SH_IMM8BY4: howto manager. (line 629) +* BFD_RELOC_SH_IMM_HI16: howto manager. (line 693) +* BFD_RELOC_SH_IMM_HI16_PCREL: howto manager. (line 694) +* BFD_RELOC_SH_IMM_LOW16: howto manager. (line 687) +* BFD_RELOC_SH_IMM_LOW16_PCREL: howto manager. (line 688) +* BFD_RELOC_SH_IMM_MEDHI16: howto manager. (line 691) +* BFD_RELOC_SH_IMM_MEDHI16_PCREL: howto manager. (line 692) +* BFD_RELOC_SH_IMM_MEDLOW16: howto manager. (line 689) +* BFD_RELOC_SH_IMM_MEDLOW16_PCREL: howto manager. (line 690) +* BFD_RELOC_SH_IMMS10: howto manager. (line 681) +* BFD_RELOC_SH_IMMS10BY2: howto manager. (line 682) +* BFD_RELOC_SH_IMMS10BY4: howto manager. (line 683) +* BFD_RELOC_SH_IMMS10BY8: howto manager. (line 684) +* BFD_RELOC_SH_IMMS16: howto manager. (line 685) +* BFD_RELOC_SH_IMMS6: howto manager. (line 678) +* BFD_RELOC_SH_IMMS6BY32: howto manager. (line 679) +* BFD_RELOC_SH_IMMU16: howto manager. (line 686) +* BFD_RELOC_SH_IMMU5: howto manager. (line 677) +* BFD_RELOC_SH_IMMU6: howto manager. (line 680) +* BFD_RELOC_SH_JMP_SLOT: howto manager. (line 644) +* BFD_RELOC_SH_JMP_SLOT64: howto manager. (line 669) +* BFD_RELOC_SH_LABEL: howto manager. (line 639) +* BFD_RELOC_SH_LOOP_END: howto manager. (line 641) +* BFD_RELOC_SH_LOOP_START: howto manager. (line 640) +* BFD_RELOC_SH_PCDISP12BY2: howto manager. (line 615) +* BFD_RELOC_SH_PCDISP8BY2: howto manager. (line 614) +* BFD_RELOC_SH_PCRELIMM8BY2: howto manager. (line 630) +* BFD_RELOC_SH_PCRELIMM8BY4: howto manager. (line 631) +* BFD_RELOC_SH_PLT_HI16: howto manager. (line 658) +* BFD_RELOC_SH_PLT_LOW16: howto manager. (line 655) +* BFD_RELOC_SH_PLT_MEDHI16: howto manager. (line 657) +* BFD_RELOC_SH_PLT_MEDLOW16: howto manager. (line 656) +* BFD_RELOC_SH_PT_16: howto manager. (line 695) +* BFD_RELOC_SH_RELATIVE: howto manager. (line 645) +* BFD_RELOC_SH_RELATIVE64: howto manager. (line 670) +* BFD_RELOC_SH_SHMEDIA_CODE: howto manager. (line 676) +* BFD_RELOC_SH_SWITCH16: howto manager. (line 632) +* BFD_RELOC_SH_SWITCH32: howto manager. (line 633) +* BFD_RELOC_SH_TLS_DTPMOD32: howto manager. (line 701) +* BFD_RELOC_SH_TLS_DTPOFF32: howto manager. (line 702) +* BFD_RELOC_SH_TLS_GD_32: howto manager. (line 696) +* BFD_RELOC_SH_TLS_IE_32: howto manager. (line 699) +* BFD_RELOC_SH_TLS_LD_32: howto manager. (line 697) +* BFD_RELOC_SH_TLS_LDO_32: howto manager. (line 698) +* BFD_RELOC_SH_TLS_LE_32: howto manager. (line 700) +* BFD_RELOC_SH_TLS_TPOFF32: howto manager. (line 703) +* BFD_RELOC_SH_USES: howto manager. (line 634) +* BFD_RELOC_SPARC13: howto manager. (line 119) +* BFD_RELOC_SPARC22: howto manager. (line 118) +* BFD_RELOC_SPARC_10: howto manager. (line 141) +* BFD_RELOC_SPARC_11: howto manager. (line 142) +* BFD_RELOC_SPARC_5: howto manager. (line 154) +* BFD_RELOC_SPARC_6: howto manager. (line 153) +* BFD_RELOC_SPARC_64: howto manager. (line 140) +* BFD_RELOC_SPARC_7: howto manager. (line 152) +* BFD_RELOC_SPARC_BASE13: howto manager. (line 136) +* BFD_RELOC_SPARC_BASE22: howto manager. (line 137) +* BFD_RELOC_SPARC_COPY: howto manager. (line 126) +* BFD_RELOC_SPARC_DISP64: howto manager. (line 155) +* BFD_RELOC_SPARC_GLOB_DAT: howto manager. (line 127) +* BFD_RELOC_SPARC_GOT10: howto manager. (line 120) +* BFD_RELOC_SPARC_GOT13: howto manager. (line 121) +* BFD_RELOC_SPARC_GOT22: howto manager. (line 122) +* BFD_RELOC_SPARC_H44: howto manager. (line 160) +* BFD_RELOC_SPARC_HH22: howto manager. (line 144) +* BFD_RELOC_SPARC_HIX22: howto manager. (line 158) +* BFD_RELOC_SPARC_HM10: howto manager. (line 145) +* BFD_RELOC_SPARC_JMP_SLOT: howto manager. (line 128) +* BFD_RELOC_SPARC_L44: howto manager. (line 162) +* BFD_RELOC_SPARC_LM22: howto manager. (line 146) +* BFD_RELOC_SPARC_LOX10: howto manager. (line 159) +* BFD_RELOC_SPARC_M44: howto manager. (line 161) +* BFD_RELOC_SPARC_OLO10: howto manager. (line 143) +* BFD_RELOC_SPARC_PC10: howto manager. (line 123) +* BFD_RELOC_SPARC_PC22: howto manager. (line 124) +* BFD_RELOC_SPARC_PC_HH22: howto manager. (line 147) +* BFD_RELOC_SPARC_PC_HM10: howto manager. (line 148) +* BFD_RELOC_SPARC_PC_LM22: howto manager. (line 149) +* BFD_RELOC_SPARC_PLT32: howto manager. (line 156) +* BFD_RELOC_SPARC_PLT64: howto manager. (line 157) +* BFD_RELOC_SPARC_REGISTER: howto manager. (line 163) +* BFD_RELOC_SPARC_RELATIVE: howto manager. (line 129) +* BFD_RELOC_SPARC_REV32: howto manager. (line 166) +* BFD_RELOC_SPARC_TLS_DTPMOD32: howto manager. (line 187) +* BFD_RELOC_SPARC_TLS_DTPMOD64: howto manager. (line 188) +* BFD_RELOC_SPARC_TLS_DTPOFF32: howto manager. (line 189) +* BFD_RELOC_SPARC_TLS_DTPOFF64: howto manager. (line 190) +* BFD_RELOC_SPARC_TLS_GD_ADD: howto manager. (line 171) +* BFD_RELOC_SPARC_TLS_GD_CALL: howto manager. (line 172) +* BFD_RELOC_SPARC_TLS_GD_HI22: howto manager. (line 169) +* BFD_RELOC_SPARC_TLS_GD_LO10: howto manager. (line 170) +* BFD_RELOC_SPARC_TLS_IE_ADD: howto manager. (line 184) +* BFD_RELOC_SPARC_TLS_IE_HI22: howto manager. (line 180) +* BFD_RELOC_SPARC_TLS_IE_LD: howto manager. (line 182) +* BFD_RELOC_SPARC_TLS_IE_LDX: howto manager. (line 183) +* BFD_RELOC_SPARC_TLS_IE_LO10: howto manager. (line 181) +* BFD_RELOC_SPARC_TLS_LDM_ADD: howto manager. (line 175) +* BFD_RELOC_SPARC_TLS_LDM_CALL: howto manager. (line 176) +* BFD_RELOC_SPARC_TLS_LDM_HI22: howto manager. (line 173) +* BFD_RELOC_SPARC_TLS_LDM_LO10: howto manager. (line 174) +* BFD_RELOC_SPARC_TLS_LDO_ADD: howto manager. (line 179) +* BFD_RELOC_SPARC_TLS_LDO_HIX22: howto manager. (line 177) +* BFD_RELOC_SPARC_TLS_LDO_LOX10: howto manager. (line 178) +* BFD_RELOC_SPARC_TLS_LE_HIX22: howto manager. (line 185) +* BFD_RELOC_SPARC_TLS_LE_LOX10: howto manager. (line 186) +* BFD_RELOC_SPARC_TLS_TPOFF32: howto manager. (line 191) +* BFD_RELOC_SPARC_TLS_TPOFF64: howto manager. (line 192) +* BFD_RELOC_SPARC_UA16: howto manager. (line 130) +* BFD_RELOC_SPARC_UA32: howto manager. (line 131) +* BFD_RELOC_SPARC_UA64: howto manager. (line 132) +* BFD_RELOC_SPARC_WDISP16: howto manager. (line 150) +* BFD_RELOC_SPARC_WDISP19: howto manager. (line 151) +* BFD_RELOC_SPARC_WDISP22: howto manager. (line 117) +* BFD_RELOC_SPARC_WPLT30: howto manager. (line 125) +* BFD_RELOC_THUMB_PCREL_BLX: howto manager. (line 560) +* BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. (line 708) +* BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. (line 709) +* BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. (line 707) +* BFD_RELOC_TIC30_LDP: howto manager. (line 911) +* BFD_RELOC_TIC54X_16_OF_23: howto manager. (line 929) +* BFD_RELOC_TIC54X_23: howto manager. (line 926) +* BFD_RELOC_TIC54X_MS7_OF_23: howto manager. (line 934) +* BFD_RELOC_TIC54X_PARTLS7: howto manager. (line 916) +* BFD_RELOC_TIC54X_PARTMS9: howto manager. (line 921) +* bfd_reloc_type_lookup: howto manager. (line 1631) +* BFD_RELOC_V850_22_PCREL: howto manager. (line 842) +* BFD_RELOC_V850_9_PCREL: howto manager. (line 839) +* BFD_RELOC_V850_ALIGN: howto manager. (line 900) +* BFD_RELOC_V850_CALLT_16_16_OFFSET: howto manager. (line 891) +* BFD_RELOC_V850_CALLT_6_7_OFFSET: howto manager. (line 888) +* BFD_RELOC_V850_LONGCALL: howto manager. (line 894) +* BFD_RELOC_V850_LONGJUMP: howto manager. (line 897) +* BFD_RELOC_V850_SDA_15_16_OFFSET: howto manager. (line 848) +* BFD_RELOC_V850_SDA_16_16_OFFSET: howto manager. (line 845) +* BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET: howto manager. (line 880) +* BFD_RELOC_V850_TDA_16_16_OFFSET: howto manager. (line 870) +* BFD_RELOC_V850_TDA_4_4_OFFSET: howto manager. (line 877) +* BFD_RELOC_V850_TDA_4_5_OFFSET: howto manager. (line 873) +* BFD_RELOC_V850_TDA_6_8_OFFSET: howto manager. (line 859) +* BFD_RELOC_V850_TDA_7_7_OFFSET: howto manager. (line 867) +* BFD_RELOC_V850_TDA_7_8_OFFSET: howto manager. (line 863) +* BFD_RELOC_V850_ZDA_15_16_OFFSET: howto manager. (line 855) +* BFD_RELOC_V850_ZDA_16_16_OFFSET: howto manager. (line 852) +* BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. (line 884) +* BFD_RELOC_VAX_GLOB_DAT: howto manager. (line 1532) +* BFD_RELOC_VAX_JMP_SLOT: howto manager. (line 1533) +* BFD_RELOC_VAX_RELATIVE: howto manager. (line 1534) +* BFD_RELOC_VPE4KMATH_DATA: howto manager. (line 1234) +* BFD_RELOC_VPE4KMATH_INSN: howto manager. (line 1235) +* BFD_RELOC_VTABLE_ENTRY: howto manager. (line 1239) +* BFD_RELOC_VTABLE_INHERIT: howto manager. (line 1238) +* BFD_RELOC_X86_64_32S: howto manager. (line 408) +* BFD_RELOC_X86_64_COPY: howto manager. (line 403) +* BFD_RELOC_X86_64_DTPMOD64: howto manager. (line 409) +* BFD_RELOC_X86_64_DTPOFF32: howto manager. (line 414) +* BFD_RELOC_X86_64_DTPOFF64: howto manager. (line 410) +* BFD_RELOC_X86_64_GLOB_DAT: howto manager. (line 404) +* BFD_RELOC_X86_64_GOT32: howto manager. (line 401) +* BFD_RELOC_X86_64_GOTPCREL: howto manager. (line 407) +* BFD_RELOC_X86_64_GOTTPOFF: howto manager. (line 415) +* BFD_RELOC_X86_64_JUMP_SLOT: howto manager. (line 405) +* BFD_RELOC_X86_64_PLT32: howto manager. (line 402) +* BFD_RELOC_X86_64_RELATIVE: howto manager. (line 406) +* BFD_RELOC_X86_64_TLSGD: howto manager. (line 412) +* BFD_RELOC_X86_64_TLSLD: howto manager. (line 413) +* BFD_RELOC_X86_64_TPOFF32: howto manager. (line 416) +* BFD_RELOC_X86_64_TPOFF64: howto manager. (line 411) +* BFD_RELOC_XSTORMY16_12: howto manager. (line 1527) +* BFD_RELOC_XSTORMY16_24: howto manager. (line 1528) +* BFD_RELOC_XSTORMY16_FPTR16: howto manager. (line 1529) +* BFD_RELOC_XSTORMY16_REL_12: howto manager. (line 1526) +* BFD_RELOC_XTENSA_ASM_EXPAND: howto manager. (line 1620) +* BFD_RELOC_XTENSA_ASM_SIMPLIFY: howto manager. (line 1625) +* BFD_RELOC_XTENSA_DIFF16: howto manager. (line 1567) +* BFD_RELOC_XTENSA_DIFF32: howto manager. (line 1568) +* BFD_RELOC_XTENSA_DIFF8: howto manager. (line 1566) +* BFD_RELOC_XTENSA_GLOB_DAT: howto manager. (line 1556) +* BFD_RELOC_XTENSA_JMP_SLOT: howto manager. (line 1557) +* BFD_RELOC_XTENSA_OP0: howto manager. (line 1614) +* BFD_RELOC_XTENSA_OP1: howto manager. (line 1615) +* BFD_RELOC_XTENSA_OP2: howto manager. (line 1616) +* BFD_RELOC_XTENSA_PLT: howto manager. (line 1561) +* BFD_RELOC_XTENSA_RELATIVE: howto manager. (line 1558) +* BFD_RELOC_XTENSA_RTLD: howto manager. (line 1551) +* BFD_RELOC_XTENSA_SLOT0_ALT: howto manager. (line 1596) +* BFD_RELOC_XTENSA_SLOT0_OP: howto manager. (line 1576) +* BFD_RELOC_XTENSA_SLOT10_ALT: howto manager. (line 1606) +* BFD_RELOC_XTENSA_SLOT10_OP: howto manager. (line 1586) +* BFD_RELOC_XTENSA_SLOT11_ALT: howto manager. (line 1607) +* BFD_RELOC_XTENSA_SLOT11_OP: howto manager. (line 1587) +* BFD_RELOC_XTENSA_SLOT12_ALT: howto manager. (line 1608) +* BFD_RELOC_XTENSA_SLOT12_OP: howto manager. (line 1588) +* BFD_RELOC_XTENSA_SLOT13_ALT: howto manager. (line 1609) +* BFD_RELOC_XTENSA_SLOT13_OP: howto manager. (line 1589) +* BFD_RELOC_XTENSA_SLOT14_ALT: howto manager. (line 1610) +* BFD_RELOC_XTENSA_SLOT14_OP: howto manager. (line 1590) +* BFD_RELOC_XTENSA_SLOT1_ALT: howto manager. (line 1597) +* BFD_RELOC_XTENSA_SLOT1_OP: howto manager. (line 1577) +* BFD_RELOC_XTENSA_SLOT2_ALT: howto manager. (line 1598) +* BFD_RELOC_XTENSA_SLOT2_OP: howto manager. (line 1578) +* BFD_RELOC_XTENSA_SLOT3_ALT: howto manager. (line 1599) +* BFD_RELOC_XTENSA_SLOT3_OP: howto manager. (line 1579) +* BFD_RELOC_XTENSA_SLOT4_ALT: howto manager. (line 1600) +* BFD_RELOC_XTENSA_SLOT4_OP: howto manager. (line 1580) +* BFD_RELOC_XTENSA_SLOT5_ALT: howto manager. (line 1601) +* BFD_RELOC_XTENSA_SLOT5_OP: howto manager. (line 1581) +* BFD_RELOC_XTENSA_SLOT6_ALT: howto manager. (line 1602) +* BFD_RELOC_XTENSA_SLOT6_OP: howto manager. (line 1582) +* BFD_RELOC_XTENSA_SLOT7_ALT: howto manager. (line 1603) +* BFD_RELOC_XTENSA_SLOT7_OP: howto manager. (line 1583) +* BFD_RELOC_XTENSA_SLOT8_ALT: howto manager. (line 1604) +* BFD_RELOC_XTENSA_SLOT8_OP: howto manager. (line 1584) +* BFD_RELOC_XTENSA_SLOT9_ALT: howto manager. (line 1605) +* BFD_RELOC_XTENSA_SLOT9_OP: howto manager. (line 1585) +* bfd_scan_arch: Architectures. (line 358) +* bfd_scan_vma: BFD front end. (line 420) +* bfd_seach_for_target: bfd_target. (line 445) +* bfd_section_already_linked: Writing the symbol table. + (line 55) +* bfd_section_list_clear: section prototypes. (line 8) +* bfd_sections_find_if: section prototypes. (line 145) +* bfd_set_arch_info: Architectures. (line 399) +* bfd_set_archive_head: Archives. (line 66) +* bfd_set_default_target: bfd_target. (line 410) +* bfd_set_error: BFD front end. (line 235) +* bfd_set_error_handler: BFD front end. (line 275) +* bfd_set_error_program_name: BFD front end. (line 284) +* bfd_set_file_flags: BFD front end. (line 340) +* bfd_set_format: Formats. (line 65) +* bfd_set_gp_size: BFD front end. (line 410) +* bfd_set_private_flags: BFD front end. (line 487) +* bfd_set_reloc: BFD front end. (line 330) +* bfd_set_section_contents: section prototypes. (line 176) +* bfd_set_section_flags: section prototypes. (line 109) +* bfd_set_section_size: section prototypes. (line 162) +* bfd_set_start_address: BFD front end. (line 389) +* bfd_set_symtab: symbol handling functions. + (line 60) +* bfd_symbol_info: symbol handling functions. + (line 130) +* bfd_target_list: bfd_target. (line 436) +* bfd_write_bigendian_4byte_int: Internal. (line 10) +* coff_symbol_type: coff. (line 186) +* core_file_matches_executable_p: Core Files. (line 27) +* find_separate_debug_file: Opening and Closing. + (line 221) +* get_debug_link_info: Opening and Closing. + (line 202) +* Hash tables: Hash Tables. (line 6) +* internal object-file format: Canonical format. (line 11) +* Linker: Linker Functions. (line 6) +* Other functions: BFD front end. (line 502) +* separate_debug_file_exists: Opening and Closing. + (line 212) +* struct bfd_iovec: BFD front end. (line 646) +* target vector (_bfd_final_link): Performing the Final Link. + (line 6) +* target vector (_bfd_link_add_symbols): Adding Symbols to the Hash Table. + (line 6) +* target vector (_bfd_link_hash_table_create): Creating a Linker Hash Table. + (line 6) +* The HOWTO Macro: typedef arelent. (line 290) +* what is it?: Overview. (line 6) + +  Tag Table: -(Indirect) -Node: Top692 -Node: Overview1024 -Node: History2075 -Node: How It Works3021 -Node: What BFD Version 2 Can Do4563 -Node: BFD information loss5878 -Node: Canonical format8410 -Node: BFD front end12782 -Node: Memory Usage38003 -Node: Initialization39231 -Node: Sections39627 -Node: Section Input40110 -Node: Section Output41475 -Node: typedef asection43961 -Node: section prototypes61618 -Node: Symbols70601 -Node: Reading Symbols72196 -Node: Writing Symbols73303 -Node: Mini Symbols75012 -Node: typedef asymbol75986 -Node: symbol handling functions80904 -Node: Archives86246 -Node: Formats89923 -Node: Relocations92814 -Node: typedef arelent93541 -Node: howto manager109259 -Node: Core Files163371 -Node: Targets164450 -Node: bfd_target166420 -Node: Architectures185739 -Node: Opening and Closing205554 -Node: Internal215037 -Node: File Caching221309 -Node: Linker Functions224616 -Node: Creating a Linker Hash Table226289 -Node: Adding Symbols to the Hash Table228027 -Node: Differing file formats228927 -Node: Adding symbols from an object file230675 -Node: Adding symbols from an archive232826 -Node: Performing the Final Link235240 -Node: Information provided by the linker236482 -Node: Relocating the section contents237632 -Node: Writing the symbol table239383 -Node: Hash Tables242376 -Node: Creating and Freeing a Hash Table243574 -Node: Looking Up or Entering a String244824 -Node: Traversing a Hash Table246077 -Node: Deriving a New Hash Table Type246866 -Node: Define the Derived Structures247932 -Node: Write the Derived Creation Routine249013 -Node: Write Other Derived Routines251707 -Node: BFD back ends253022 -Node: What to Put Where253292 -Node: aout253430 -Node: coff259681 -Node: elf284357 -Node: mmo285211 -Node: File layout286139 -Node: Symbol-table291786 -Node: mmo section mapping295555 -Node: GNU Free Documentation License299207 -Node: Index318922 +Node: Top758 +Node: Overview1090 +Node: History2141 +Node: How It Works3087 +Node: What BFD Version 2 Can Do4629 +Node: BFD information loss5944 +Node: Canonical format8476 +Node: BFD front end12848 +Node: Memory Usage38069 +Node: Initialization39297 +Node: Sections39693 +Node: Section Input40176 +Node: Section Output41541 +Node: typedef asection44027 +Node: section prototypes61684 +Node: Symbols70667 +Node: Reading Symbols72262 +Node: Writing Symbols73369 +Node: Mini Symbols75078 +Node: typedef asymbol76052 +Node: symbol handling functions80970 +Node: Archives86312 +Node: Formats89989 +Node: Relocations92880 +Node: typedef arelent93607 +Node: howto manager109325 +Node: Core Files163437 +Node: Targets164516 +Node: bfd_target166486 +Node: Architectures185805 +Node: Opening and Closing205620 +Node: Internal215103 +Node: File Caching221375 +Node: Linker Functions224682 +Node: Creating a Linker Hash Table226355 +Node: Adding Symbols to the Hash Table228093 +Node: Differing file formats228993 +Node: Adding symbols from an object file230741 +Node: Adding symbols from an archive232892 +Node: Performing the Final Link235306 +Node: Information provided by the linker236548 +Node: Relocating the section contents237698 +Node: Writing the symbol table239449 +Node: Hash Tables242442 +Node: Creating and Freeing a Hash Table243640 +Node: Looking Up or Entering a String244890 +Node: Traversing a Hash Table246143 +Node: Deriving a New Hash Table Type246932 +Node: Define the Derived Structures247998 +Node: Write the Derived Creation Routine249079 +Node: Write Other Derived Routines251773 +Node: BFD back ends253088 +Node: What to Put Where253358 +Node: aout253496 +Node: coff259747 +Node: elf284423 +Node: mmo285277 +Node: File layout286205 +Node: Symbol-table291852 +Node: mmo section mapping295621 +Node: GNU Free Documentation License299273 +Node: Index318988  End Tag Table --- gdb-6.3.orig/debian/patches/sim-destdir.patch +++ gdb-6.3/debian/patches/sim-destdir.patch @@ -0,0 +1,53 @@ +Fix some missing uses of DESTDIR in the sim/ directories. The Debian +packages use DESTDIR to build. + +%patch +Index: gdb-6.3/sim/Makefile.in +=================================================================== +--- gdb-6.3.orig/sim/Makefile.in 2003-09-03 14:46:52.000000000 -0400 ++++ gdb-6.3/sim/Makefile.in 2004-11-10 00:39:25.381315738 -0500 +@@ -93,6 +93,7 @@ FLAGS_TO_PASS = \ + "CC=$(CC)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ ++ "DESTDIR=$(DESTDIR)" \ + "RANLIB=$(RANLIB)" \ + "MAKEINFO=$(MAKEINFO)" \ + "INSTALL=$(INSTALL)" \ +Index: gdb-6.3/sim/common/Make-common.in +=================================================================== +--- gdb-6.3.orig/sim/common/Make-common.in 2003-09-08 13:24:59.000000000 -0400 ++++ gdb-6.3/sim/common/Make-common.in 2004-11-10 00:39:25.383315347 -0500 +@@ -581,14 +581,14 @@ install: install-common $(SIM_EXTRA_INST + + install-common: installdirs + n=`echo run | sed '$(program_transform_name)'`; \ +- $(INSTALL_PROGRAM) run$(EXEEXT) $(bindir)/$$n$(EXEEXT) ++ $(INSTALL_PROGRAM) run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) + n=`echo libsim.a | sed s/libsim.a/lib$(target_alias)-sim.a/`; \ +- $(INSTALL_DATA) libsim.a $(libdir)/$$n ; \ +- ( cd $(libdir) ; $(RANLIB) $$n ) ++ $(INSTALL_DATA) libsim.a $(DESTDIR)$(libdir)/$$n ; \ ++ ( cd $(DESTDIR)$(libdir) ; $(RANLIB) $$n ) + + installdirs: +- $(SHELL) $(srcdir)/../../mkinstalldirs $(bindir) +- $(SHELL) $(srcdir)/../../mkinstalldirs $(libdir) ++ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir) ++ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir) + + check: + cd ../testsuite && $(MAKE) check RUNTESTFLAGS="$(RUNTESTFLAGS)" +Index: gdb-6.3/sim/erc32/Makefile.in +=================================================================== +--- gdb-6.3.orig/sim/erc32/Makefile.in 2000-03-07 10:32:49.000000000 -0500 ++++ gdb-6.3/sim/erc32/Makefile.in 2004-11-10 00:39:25.385314957 -0500 +@@ -53,7 +53,7 @@ end.h: end + # Copy the files into directories where they will be run. + install-sis: installdirs + n=`echo sis | sed '$(program_transform_name)'`; \ +- $(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT) ++ $(INSTALL_PROGRAM) sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) + + clean-sis: + rm -f sis end end.h --- gdb-6.3.orig/debian/patches/thread-db-multiple-libraries.patch +++ gdb-6.3/debian/patches/thread-db-multiple-libraries.patch @@ -0,0 +1,593 @@ +Support loading two libthread_db DSOs. In this case, the LinuxThreads +and NPTL ones. + +Index: gdb-6.3/gdb/thread-db.c +=================================================================== +--- gdb-6.3.orig/gdb/thread-db.c 2004-11-10 10:46:24.000000000 -0500 ++++ gdb-6.3/gdb/thread-db.c 2004-11-10 11:22:34.858812426 -0500 +@@ -79,53 +79,63 @@ static td_thragent_t *thread_agent; + + /* Pointers to the libthread_db functions. */ + +-static td_err_e (*td_init_p) (void); ++struct thread_db_pointers ++{ ++ const char *filename; ++ ++ td_err_e (*td_init_p) (void); + +-static td_err_e (*td_ta_new_p) (struct ps_prochandle * ps, +- td_thragent_t **ta); +-static td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt, +- td_thrhandle_t *__th); +-static td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, +- lwpid_t lwpid, td_thrhandle_t *th); +-static td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta, +- td_thr_iter_f *callback, void *cbdata_p, +- td_thr_state_e state, int ti_pri, +- sigset_t *ti_sigmask_p, +- unsigned int ti_user_flags); +-static td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta, +- td_event_e event, td_notify_t *ptr); +-static td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta, +- td_thr_events_t *event); +-static td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta, +- td_event_msg_t *msg); +- +-static td_err_e (*td_thr_validate_p) (const td_thrhandle_t *th); +-static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th, +- td_thrinfo_t *infop); +-static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th, +- gdb_prfpregset_t *regset); +-static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th, +- prgregset_t gregs); +-static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th, +- const gdb_prfpregset_t *fpregs); +-static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th, +- prgregset_t gregs); +-static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, +- int event); +- +-static td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th, +- void *map_address, +- size_t offset, void **address); ++ td_err_e (*td_ta_new_p) (struct ps_prochandle * ps, ++ td_thragent_t **ta); ++ td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt, ++ td_thrhandle_t *__th); ++ td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, ++ lwpid_t lwpid, td_thrhandle_t *th); ++ ++ td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta, ++ td_thr_iter_f *callback, void *cbdata_p, ++ td_thr_state_e state, int ti_pri, ++ sigset_t *ti_sigmask_p, ++ unsigned int ti_user_flags); ++ td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta, ++ td_event_e event, td_notify_t *ptr); ++ td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta, ++ td_thr_events_t *event); ++ td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta, ++ td_event_msg_t *msg); ++ ++ td_err_e (*td_thr_validate_p) (const td_thrhandle_t *th); ++ td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th, ++ td_thrinfo_t *infop); ++ td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th, ++ gdb_prfpregset_t *regset); ++ td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th, ++ prgregset_t gregs); ++ td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th, ++ const gdb_prfpregset_t *fpregs); ++ td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th, ++ prgregset_t gregs); ++ td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, ++ int event); ++ ++ td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th, ++ void *map_address, ++ size_t offset, void **address); ++ ++ struct thread_db_pointers *next; ++}; + + /* Location of the thread creation event breakpoint. The code at this + location in the child process will be called by the pthread library + whenever a new thread is created. By setting a special breakpoint + at this location, GDB can detect when a new thread is created. We + obtain this location via the td_ta_event_addr call. */ +-static CORE_ADDR td_create_bp_addr; ++CORE_ADDR td_create_bp_addr; + + /* Location of the thread death event breakpoint. */ +-static CORE_ADDR td_death_bp_addr; ++CORE_ADDR td_death_bp_addr; ++ ++static struct thread_db_pointers *current_pointers, *all_pointers; + + /* Prototypes for local functions. */ + static void thread_db_find_new_threads (void); +@@ -262,7 +272,7 @@ thread_get_info_callback (const td_thrha + struct thread_info *thread_info; + ptid_t thread_ptid; + +- err = td_thr_get_info_p (thp, &ti); ++ err = current_pointers->td_thr_get_info_p (thp, &ti); + if (err != TD_OK) + error ("thread_get_info_callback: cannot get thread info: %s", + thread_db_err_str (err)); +@@ -316,8 +326,9 @@ thread_db_map_id2thr (struct thread_info + if (thread_info->private->th_valid) + return; + +- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (thread_info->ptid), +- &thread_info->private->th); ++ err = current_pointers->td_ta_map_id2thr_p (thread_agent, ++ GET_THREAD (thread_info->ptid), ++ &thread_info->private->th); + if (err != TD_OK) + { + if (fatal) +@@ -340,8 +351,8 @@ thread_db_get_info (struct thread_info * + if (!thread_info->private->th_valid) + thread_db_map_id2thr (thread_info, 1); + +- err = +- td_thr_get_info_p (&thread_info->private->th, &thread_info->private->ti); ++ err = current_pointers->td_thr_get_info_p (&thread_info->private->th, ++ &thread_info->private->ti); + if (err != TD_OK) + error ("thread_db_get_info: cannot get thread info: %s", + thread_db_err_str (err)); +@@ -365,7 +376,8 @@ thread_from_lwp (ptid_t ptid) + + gdb_assert (is_lwp (ptid)); + +- err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th); ++ err = current_pointers->td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), ++ &th); + if (err != TD_OK) + error ("Cannot find user-level thread for LWP %ld: %s", + GET_LWP (ptid), thread_db_err_str (err)); +@@ -420,85 +432,102 @@ verbose_dlsym (void *handle, const char + return sym; + } + +-static int +-thread_db_load (void) ++static struct thread_db_pointers * ++thread_db_load (const char *name) + { ++ struct thread_db_pointers *ptrs; ++ Dl_info info; + void *handle; + td_err_e err; + +- handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW); ++ ptrs = xcalloc (1, sizeof (struct thread_db_pointers)); ++ ++ handle = dlopen (name, RTLD_NOW); + if (handle == NULL) + { +- fprintf_filtered (gdb_stderr, "\n\ndlopen failed on '%s' - %s\n", +- LIBTHREAD_DB_SO, dlerror ()); +- fprintf_filtered (gdb_stderr, +- "GDB will not be able to debug pthreads.\n\n"); ++ if (all_pointers == NULL) ++ { ++ fprintf_filtered (gdb_stderr, "\n\ndlopen failed on '%s' - %s\n", ++ name, dlerror ()); ++ fprintf_filtered (gdb_stderr, ++ "GDB will not be able to debug pthreads.\n\n"); ++ } + return 0; + } + + /* Initialize pointers to the dynamic library functions we will use. + Essential functions first. */ + +- td_init_p = verbose_dlsym (handle, "td_init"); +- if (td_init_p == NULL) ++ ptrs->td_init_p = verbose_dlsym (handle, "td_init"); ++ if (ptrs->td_init_p == NULL) + return 0; + +- td_ta_new_p = verbose_dlsym (handle, "td_ta_new"); +- if (td_ta_new_p == NULL) ++ ptrs->td_ta_new_p = verbose_dlsym (handle, "td_ta_new"); ++ if (ptrs->td_ta_new_p == NULL) + return 0; + +- td_ta_map_id2thr_p = verbose_dlsym (handle, "td_ta_map_id2thr"); +- if (td_ta_map_id2thr_p == NULL) ++ ptrs->td_ta_map_id2thr_p = verbose_dlsym (handle, "td_ta_map_id2thr"); ++ if (ptrs->td_ta_map_id2thr_p == NULL) + return 0; + +- td_ta_map_lwp2thr_p = verbose_dlsym (handle, "td_ta_map_lwp2thr"); +- if (td_ta_map_lwp2thr_p == NULL) ++ ptrs->td_ta_map_lwp2thr_p = verbose_dlsym (handle, "td_ta_map_lwp2thr"); ++ if (ptrs->td_ta_map_lwp2thr_p == NULL) + return 0; + +- td_ta_thr_iter_p = verbose_dlsym (handle, "td_ta_thr_iter"); +- if (td_ta_thr_iter_p == NULL) ++ ptrs->td_ta_thr_iter_p = verbose_dlsym (handle, "td_ta_thr_iter"); ++ if (ptrs->td_ta_thr_iter_p == NULL) + return 0; + +- td_thr_validate_p = verbose_dlsym (handle, "td_thr_validate"); +- if (td_thr_validate_p == NULL) ++ ptrs->td_thr_validate_p = verbose_dlsym (handle, "td_thr_validate"); ++ if (ptrs->td_thr_validate_p == NULL) + return 0; + +- td_thr_get_info_p = verbose_dlsym (handle, "td_thr_get_info"); +- if (td_thr_get_info_p == NULL) ++ ptrs->td_thr_get_info_p = verbose_dlsym (handle, "td_thr_get_info"); ++ if (ptrs->td_thr_get_info_p == NULL) + return 0; + +- td_thr_getfpregs_p = verbose_dlsym (handle, "td_thr_getfpregs"); +- if (td_thr_getfpregs_p == NULL) ++ ptrs->td_thr_getfpregs_p = verbose_dlsym (handle, "td_thr_getfpregs"); ++ if (ptrs->td_thr_getfpregs_p == NULL) + return 0; + +- td_thr_getgregs_p = verbose_dlsym (handle, "td_thr_getgregs"); +- if (td_thr_getgregs_p == NULL) ++ ptrs->td_thr_getgregs_p = verbose_dlsym (handle, "td_thr_getgregs"); ++ if (ptrs->td_thr_getgregs_p == NULL) + return 0; + +- td_thr_setfpregs_p = verbose_dlsym (handle, "td_thr_setfpregs"); +- if (td_thr_setfpregs_p == NULL) ++ ptrs->td_thr_setfpregs_p = verbose_dlsym (handle, "td_thr_setfpregs"); ++ if (ptrs->td_thr_setfpregs_p == NULL) + return 0; + +- td_thr_setgregs_p = verbose_dlsym (handle, "td_thr_setgregs"); +- if (td_thr_setgregs_p == NULL) ++ ptrs->td_thr_setgregs_p = verbose_dlsym (handle, "td_thr_setgregs"); ++ if (ptrs->td_thr_setgregs_p == NULL) + return 0; + + /* Initialize the library. */ +- err = td_init_p (); ++ err = ptrs->td_init_p (); + if (err != TD_OK) + { + warning ("Cannot initialize libthread_db: %s", thread_db_err_str (err)); ++ xfree (ptrs); + return 0; + } + + /* These are not essential. */ +- td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr"); +- td_ta_set_event_p = dlsym (handle, "td_ta_set_event"); +- td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg"); +- td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable"); +- td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr"); ++ ptrs->td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr"); ++ ptrs->td_ta_set_event_p = dlsym (handle, "td_ta_set_event"); ++ ptrs->td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg"); ++ ptrs->td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable"); ++ ptrs->td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr"); ++ ++ if (dladdr (ptrs->td_ta_new_p, &info) != 0) ++ ptrs->filename = info.dli_fname; ++ ++ /* Try dlinfo? */ ++ ++ if (ptrs->filename == NULL) ++ /* Paranoid - don't let a NULL path slip through. */ ++ ptrs->filename = name; + +- return 1; ++ return ptrs; + } + + static td_err_e +@@ -508,7 +537,7 @@ enable_thread_event (td_thragent_t *thre + td_err_e err; + + /* Get the breakpoint address for thread EVENT. */ +- err = td_ta_event_addr_p (thread_agent, event, ¬ify); ++ err = current_pointers->td_ta_event_addr_p (thread_agent, event, ¬ify); + if (err != TD_OK) + return err; + +@@ -534,8 +563,10 @@ enable_thread_event_reporting (void) + + /* We cannot use the thread event reporting facility if these + functions aren't available. */ +- if (td_ta_event_addr_p == NULL || td_ta_set_event_p == NULL +- || td_ta_event_getmsg_p == NULL || td_thr_event_enable_p == NULL) ++ if (current_pointers->td_ta_event_addr_p == NULL ++ || current_pointers->td_ta_set_event_p == NULL ++ || current_pointers->td_ta_event_getmsg_p == NULL ++ || current_pointers->td_thr_event_enable_p == NULL) + return; + + /* Set the process wide mask saying which events we're interested in. */ +@@ -552,7 +583,7 @@ enable_thread_event_reporting (void) + #endif + td_event_addset (&events, TD_DEATH); + +- err = td_ta_set_event_p (thread_agent, &events); ++ err = current_pointers->td_ta_set_event_p (thread_agent, &events); + if (err != TD_OK) + { + warning ("Unable to set global thread event mask: %s", +@@ -592,7 +623,7 @@ disable_thread_event_reporting (void) + /* Set the process wide mask saying we aren't interested in any + events anymore. */ + td_event_emptyset (&events); +- td_ta_set_event_p (thread_agent, &events); ++ current_pointers->td_ta_set_event_p (thread_agent, &events); + + /* Delete thread event breakpoints, if any. */ + remove_thread_event_breakpoints (); +@@ -635,7 +666,6 @@ check_thread_signals (void) + static void + check_for_thread_db (void) + { +- td_err_e err; + static int already_loaded; + + /* First time through, report that libthread_db was successfuly +@@ -644,19 +674,8 @@ check_for_thread_db (void) + + if (!already_loaded) + { +- Dl_info info; +- const char *library = NULL; +- if (dladdr ((*td_ta_new_p), &info) != 0) +- library = info.dli_fname; +- +- /* Try dlinfo? */ +- +- if (library == NULL) +- /* Paranoid - don't let a NULL path slip through. */ +- library = LIBTHREAD_DB_SO; +- + printf_unfiltered ("Using host libthread_db library \"%s\".\n", +- library); ++ all_pointers->filename); + already_loaded = 1; + } + +@@ -674,28 +693,34 @@ check_for_thread_db (void) + proc_handle.pid = GET_PID (inferior_ptid); + + /* Now attempt to open a connection to the thread library. */ +- err = td_ta_new_p (&proc_handle, &thread_agent); +- switch (err) ++ for (current_pointers = all_pointers; ++ current_pointers != NULL; ++ current_pointers = current_pointers->next) + { +- case TD_NOLIBTHREAD: +- /* No thread library was detected. */ +- break; +- +- case TD_OK: +- printf_unfiltered ("[Thread debugging using libthread_db enabled]\n"); ++ td_err_e err; ++ err = current_pointers->td_ta_new_p (&proc_handle, &thread_agent); ++ switch (err) ++ { ++ case TD_NOLIBTHREAD: ++ /* No thread library was detected. */ ++ break; + +- /* The thread library was detected. Activate the thread_db target. */ +- push_target (&thread_db_ops); +- using_thread_db = 1; ++ case TD_OK: ++ printf_unfiltered ("[Thread debugging using libthread_db enabled]\n"); + +- enable_thread_event_reporting (); +- thread_db_find_new_threads (); +- break; ++ /* The thread library was detected. Activate the thread_db target. */ ++ push_target (&thread_db_ops); ++ using_thread_db = 1; ++ ++ enable_thread_event_reporting (); ++ thread_db_find_new_threads (); ++ return; + +- default: +- warning ("Cannot initialize thread debugging library: %s", +- thread_db_err_str (err)); +- break; ++ default: ++ warning ("Cannot initialize thread debugging library: %s", ++ thread_db_err_str (err)); ++ break; ++ } + } + } + +@@ -766,7 +791,7 @@ attach_thread (ptid_t ptid, const td_thr + #endif + + /* Enable thread event reporting for this thread. */ +- err = td_thr_event_enable_p (th_p, 1); ++ err = current_pointers->td_thr_event_enable_p (th_p, 1); + if (err != TD_OK) + error ("Cannot enable thread event reporting for %s: %s", + target_pid_to_str (ptid), thread_db_err_str (err)); +@@ -892,7 +917,7 @@ check_event (ptid_t ptid) + + do + { +- err = td_ta_event_getmsg_p (thread_agent, &msg); ++ err = current_pointers->td_ta_event_getmsg_p (thread_agent, &msg); + if (err != TD_OK) + { + if (err == TD_NOMSG) +@@ -902,7 +927,7 @@ check_event (ptid_t ptid) + thread_db_err_str (err)); + } + +- err = td_thr_get_info_p (msg.th_p, &ti); ++ err = current_pointers->td_thr_get_info_p (msg.th_p, &ti); + if (err != TD_OK) + error ("Cannot get thread info: %s", thread_db_err_str (err)); + +@@ -1015,12 +1040,14 @@ thread_db_fetch_registers (int regno) + thread_info = find_thread_pid (inferior_ptid); + thread_db_map_id2thr (thread_info, 1); + +- err = td_thr_getgregs_p (&thread_info->private->th, gregset); ++ err = current_pointers->td_thr_getgregs_p (&thread_info->private->th, ++ gregset); + if (err != TD_OK) + error ("Cannot fetch general-purpose registers for thread %ld: %s", + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); + +- err = td_thr_getfpregs_p (&thread_info->private->th, &fpregset); ++ err = current_pointers->td_thr_getfpregs_p (&thread_info->private->th, ++ &fpregset); + if (err != TD_OK) + error ("Cannot get floating-point registers for thread %ld: %s", + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); +@@ -1062,11 +1089,13 @@ thread_db_store_registers (int regno) + fill_gregset ((gdb_gregset_t *) gregset, -1); + fill_fpregset (&fpregset, -1); + +- err = td_thr_setgregs_p (&thread_info->private->th, gregset); ++ err = current_pointers->td_thr_setgregs_p (&thread_info->private->th, ++ gregset); + if (err != TD_OK) + error ("Cannot store general-purpose registers for thread %ld: %s", + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); +- err = td_thr_setfpregs_p (&thread_info->private->th, &fpregset); ++ err = current_pointers->td_thr_setfpregs_p (&thread_info->private->th, ++ &fpregset); + if (err != TD_OK) + error ("Cannot store floating-point registers for thread %ld: %s", + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); +@@ -1136,15 +1165,14 @@ thread_db_thread_alive (ptid_t ptid) + if (!thread_info->private->th_valid) + return 0; + +- err = td_thr_validate_p (&thread_info->private->th); ++ err = current_pointers->td_thr_validate_p (&thread_info->private->th); + if (err != TD_OK) + return 0; + + if (!thread_info->private->ti_valid) + { +- err = +- td_thr_get_info_p (&thread_info->private->th, +- &thread_info->private->ti); ++ err = current_pointers->td_thr_get_info_p ++ (&thread_info->private->th, &thread_info->private->ti); + if (err != TD_OK) + return 0; + thread_info->private->ti_valid = 1; +@@ -1170,7 +1198,7 @@ find_new_threads_callback (const td_thrh + td_err_e err; + ptid_t ptid; + +- err = td_thr_get_info_p (th_p, &ti); ++ err = current_pointers->td_thr_get_info_p (th_p, &ti); + if (err != TD_OK) + error ("find_new_threads_callback: cannot get thread info: %s", + thread_db_err_str (err)); +@@ -1192,9 +1220,10 @@ thread_db_find_new_threads (void) + td_err_e err; + + /* Iterate over all user-space threads to discover new threads. */ +- err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL, +- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, +- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); ++ err = current_pointers->td_ta_thr_iter_p ++ (thread_agent, find_new_threads_callback, NULL, ++ TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, ++ TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); + if (err != TD_OK) + error ("Cannot find new threads: %s", thread_db_err_str (err)); + } +@@ -1257,7 +1286,7 @@ thread_db_get_thread_local_address (ptid + struct thread_info *thread_info; + + /* glibc doesn't provide the needed interface. */ +- if (!td_thr_tls_get_addr_p) ++ if (!current_pointers->td_thr_tls_get_addr_p) + error ("Cannot find thread-local variables in this thread library."); + + /* Get the address of the link map for this objfile. */ +@@ -1279,8 +1308,8 @@ thread_db_get_thread_local_address (ptid + thread_db_map_id2thr (thread_info, 1); + + /* Finally, get the address of the variable. */ +- err = td_thr_tls_get_addr_p (&thread_info->private->th, (void *) lm, +- offset, &address); ++ err = current_pointers->td_thr_tls_get_addr_p ++ (&thread_info->private->th, (void *) lm, offset, &address); + + #ifdef THREAD_DB_HAS_TD_NOTALLOC + /* The memory hasn't been allocated, yet. */ +@@ -1360,17 +1389,49 @@ init_thread_db_ops (void) + void + _initialize_thread_db (void) + { ++ struct thread_db_pointers *ptrs; ++ const char *p; ++ + /* Only initialize the module if we can load libthread_db. */ +- if (thread_db_load ()) +- { +- init_thread_db_ops (); +- add_target (&thread_db_ops); ++ ptrs = thread_db_load (LIBTHREAD_DB_SO); ++ if (ptrs == NULL) ++ return; ++ ++ all_pointers = ptrs; + +- /* Add ourselves to objfile event chain. */ +- target_new_objfile_chain = deprecated_target_new_objfile_hook; +- deprecated_target_new_objfile_hook = thread_db_new_objfile; ++ /* Some GNU/Linux systems have more than one binary-compatible copy ++ of libthread_db. If we can find a second one, load that too. ++ The inferior may force the use of a different threading package ++ than we expect. Our guess for the location is somewhat hokey: ++ strip out anything between /lib (or /lib64) and LIBTHREAD_DB_SO. ++ If we loaded the NPTL libthread_db by default, this may find us ++ the LinuxThreads copy. */ ++ p = strrchr (ptrs->filename, '/'); ++ while (p != NULL && p > ptrs->filename) ++ { ++ const char *component; + +- /* Register ourselves for the new inferior observer. */ +- observer_attach_inferior_created (check_for_thread_db_observer); ++ component = memrchr (ptrs->filename, '/', p - ptrs->filename); ++ if (component != NULL && strncmp (component, "/lib", 4) == 0) ++ { ++ char *new_name = xmalloc (p - ptrs->filename + 2 ++ + strlen (LIBTHREAD_DB_SO)); ++ memcpy (new_name, ptrs->filename, p - ptrs->filename + 1); ++ strcpy (new_name + (p - ptrs->filename) + 1, LIBTHREAD_DB_SO); ++ ptrs->next = thread_db_load (new_name); ++ xfree (new_name); ++ break; ++ } ++ p = component; + } ++ ++ init_thread_db_ops (); ++ add_target (&thread_db_ops); ++ ++ /* Add ourselves to objfile event chain. */ ++ target_new_objfile_chain = deprecated_target_new_objfile_hook; ++ deprecated_target_new_objfile_hook = thread_db_new_objfile; ++ ++ /* Register ourselves for the new inferior observer. */ ++ observer_attach_inferior_created (check_for_thread_db_observer); + } --- gdb-6.3.orig/debian/patches/13.use-dynamic-readline.patch +++ gdb-6.3/debian/patches/13.use-dynamic-readline.patch @@ -0,0 +1,29 @@ +Debian local - Use system readline to build. + +It would be nice to add a configure argument for this upstream. + +Index: gdb-6.3/gdb/Makefile.in +=================================================================== +--- gdb-6.3.orig/gdb/Makefile.in 2004-11-03 21:18:49.000000000 -0500 ++++ gdb-6.3/gdb/Makefile.in 2004-11-09 23:04:57.204160812 -0500 +@@ -121,10 +121,16 @@ BFD_SRC = $(srcdir)/$(BFD_DIR) + BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) + + # Where is the READLINE library? Typically in ../readline. +-READLINE_DIR = ../readline +-READLINE = $(READLINE_DIR)/libreadline.a +-READLINE_SRC = $(srcdir)/$(READLINE_DIR) +-READLINE_CFLAGS = -I$(READLINE_SRC)/.. ++#READLINE_DIR = ../readline ++#READLINE = $(READLINE_DIR)/libreadline.a ++#READLINE_SRC = $(srcdir)/$(READLINE_DIR) ++#READLINE_CFLAGS = -I$(READLINE_SRC)/.. ++# ++# Debian has a perfectly fine readline - use it. ++READLINE_SRC=/usr/include/readline ++READLINE=-lreadline ++READLINE_CFLAGS= ++READLINE_DIR= + + WARN_CFLAGS = @WARN_CFLAGS@ + WERROR_CFLAGS = @WERROR_CFLAGS@ --- gdb-6.3.orig/debian/patches/10.selected-frame.patch +++ gdb-6.3/debian/patches/10.selected-frame.patch @@ -0,0 +1,552 @@ +2004-10-11 + +This patch is not submitted. Many of these functions should be passing +a frame around rather than calling get_selected_frame, but at least it +is an improvement over deprecated_selected_frame. + +Index: gdb-6.3/gdb/breakpoint.c +=================================================================== +--- gdb-6.3.orig/gdb/breakpoint.c 2004-10-08 13:30:46.000000000 -0400 ++++ gdb-6.3/gdb/breakpoint.c 2004-11-09 22:55:11.231620957 -0500 +@@ -922,7 +922,7 @@ insert_bp_location (struct bp_location * + /* FIXME drow/2003-09-09: It would be nice if evaluate_expression + took a frame parameter, so that we didn't have to change the + selected frame. */ +- saved_frame_id = get_frame_id (deprecated_selected_frame); ++ saved_frame_id = get_frame_id (get_selected_frame ()); + + /* Determine if the watchpoint is within scope. */ + if (bpt->owner->exp_valid_block == NULL) +@@ -5464,14 +5464,9 @@ break_at_finish_at_depth_command_1 (char + + if (default_breakpoint_valid) + { +- if (deprecated_selected_frame) +- { +- selected_pc = get_frame_pc (deprecated_selected_frame); +- if (arg) +- if_arg = 1; +- } +- else +- error ("No selected frame."); ++ selected_pc = get_frame_pc (get_selected_frame ()); ++ if (arg) ++ if_arg = 1; + } + else + error ("No default breakpoint address now."); +@@ -5542,15 +5537,10 @@ break_at_finish_command_1 (char *arg, in + { + if (default_breakpoint_valid) + { +- if (deprecated_selected_frame) +- { +- addr_string = xstrprintf ("*0x%s", +- paddr_nz (get_frame_pc (deprecated_selected_frame))); +- if (arg) +- if_arg = 1; +- } +- else +- error ("No selected frame."); ++ addr_string = xstrprintf ("*0x%s", ++ paddr_nz (get_frame_pc (get_selected_frame ()))); ++ if (arg) ++ if_arg = 1; + } + else + error ("No default breakpoint address now."); +@@ -6082,7 +6072,7 @@ until_break_command (char *arg, int from + { + struct symtabs_and_lines sals; + struct symtab_and_line sal; +- struct frame_info *prev_frame = get_prev_frame (deprecated_selected_frame); ++ struct frame_info *prev_frame = get_prev_frame (get_selected_frame ()); + struct breakpoint *breakpoint; + struct cleanup *old_chain; + struct continuation_arg *arg1; +@@ -6119,7 +6109,7 @@ until_break_command (char *arg, int from + /* Otherwise, specify the current frame, because we want to stop only + at the very same frame. */ + breakpoint = set_momentary_breakpoint (sal, +- get_frame_id (deprecated_selected_frame), ++ get_frame_id (get_selected_frame ()), + bp_until); + + if (!target_can_async_p ()) +Index: gdb-6.3/gdb/cli/cli-cmds.c +=================================================================== +--- gdb-6.3.orig/gdb/cli/cli-cmds.c 2004-09-11 06:24:53.000000000 -0400 ++++ gdb-6.3/gdb/cli/cli-cmds.c 2004-11-09 22:51:07.323246218 -0500 +@@ -845,10 +845,7 @@ disassemble_command (char *arg, int from + name = NULL; + if (!arg) + { +- if (!deprecated_selected_frame) +- error ("No frame selected.\n"); +- +- pc = get_frame_pc (deprecated_selected_frame); ++ pc = get_frame_pc (get_selected_frame ()); + if (find_pc_partial_function (pc, &name, &low, &high) == 0) + error ("No function contains program counter for selected frame.\n"); + #if defined(TUI) +Index: gdb-6.3/gdb/f-valprint.c +=================================================================== +--- gdb-6.3.orig/gdb/f-valprint.c 2003-10-14 02:51:14.000000000 -0400 ++++ gdb-6.3/gdb/f-valprint.c 2004-11-09 22:51:07.326245632 -0500 +@@ -76,7 +76,7 @@ f77_get_dynamic_lowerbound (struct type + switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type)) + { + case BOUND_BY_VALUE_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame ()); + if (current_frame_addr > 0) + { + *lower_bound = +@@ -100,7 +100,7 @@ f77_get_dynamic_lowerbound (struct type + break; + + case BOUND_BY_REF_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame ()); + if (current_frame_addr > 0) + { + ptr_to_lower_bound = +@@ -134,7 +134,7 @@ f77_get_dynamic_upperbound (struct type + switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type)) + { + case BOUND_BY_VALUE_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame ()); + if (current_frame_addr > 0) + { + *upper_bound = +@@ -163,7 +163,7 @@ f77_get_dynamic_upperbound (struct type + break; + + case BOUND_BY_REF_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame ()); + if (current_frame_addr > 0) + { + ptr_to_upper_bound = +@@ -630,10 +630,7 @@ info_common_command (char *comname, int + first make sure that it is visible and if so, let + us display its contents */ + +- fi = deprecated_selected_frame; +- +- if (fi == NULL) +- error ("No frame selected"); ++ fi = get_selected_frame (); + + /* The following is generally ripped off from stack.c's routine + print_frame_info() */ +@@ -722,10 +719,7 @@ there_is_a_visible_common_named (char *c + if (comname == NULL) + error ("Cannot deal with NULL common name!"); + +- fi = deprecated_selected_frame; +- +- if (fi == NULL) +- error ("No frame selected"); ++ fi = get_selected_frame (); + + /* The following is generally ripped off from stack.c's routine + print_frame_info() */ +Index: gdb-6.3/gdb/infcmd.c +=================================================================== +--- gdb-6.3.orig/gdb/infcmd.c 2004-09-13 14:26:28.000000000 -0400 ++++ gdb-6.3/gdb/infcmd.c 2004-11-09 22:57:37.274099559 -0500 +@@ -1214,10 +1214,8 @@ finish_command (char *arg, int from_tty) + error ("The \"finish\" command does not take any arguments."); + if (!target_has_execution) + error ("The program is not running."); +- if (deprecated_selected_frame == NULL) +- error ("No selected frame."); + +- frame = get_prev_frame (deprecated_selected_frame); ++ frame = get_prev_frame (get_selected_frame ()); + if (frame == 0) + error ("\"finish\" not meaningful in the outermost frame."); + +@@ -1235,7 +1233,7 @@ finish_command (char *arg, int from_tty) + + /* Find the function we will return from. */ + +- function = find_pc_function (get_frame_pc (deprecated_selected_frame)); ++ function = find_pc_function (get_frame_pc (get_selected_frame ())); + + /* Print info on the selected frame, including level number but not + source. */ +@@ -1600,13 +1598,11 @@ registers_info (char *addr_exp, int fpre + + if (!target_has_registers) + error ("The program has no registers now."); +- if (deprecated_selected_frame == NULL) +- error ("No selected frame."); + + if (!addr_exp) + { + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, +- deprecated_selected_frame, -1, fpregs); ++ get_selected_frame (), -1, fpregs); + return; + } + +@@ -1644,7 +1640,7 @@ registers_info (char *addr_exp, int fpre + if (regnum >= 0) + { + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, +- deprecated_selected_frame, regnum, fpregs); ++ get_selected_frame (), regnum, fpregs); + continue; + } + } +@@ -1658,7 +1654,7 @@ registers_info (char *addr_exp, int fpre + && regnum < NUM_REGS + NUM_PSEUDO_REGS) + { + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, +- deprecated_selected_frame, regnum, fpregs); ++ get_selected_frame (), regnum, fpregs); + continue; + } + } +@@ -1684,7 +1680,7 @@ registers_info (char *addr_exp, int fpre + if (gdbarch_register_reggroup_p (current_gdbarch, regnum, + group)) + gdbarch_print_registers_info (current_gdbarch, +- gdb_stdout, deprecated_selected_frame, ++ gdb_stdout, get_selected_frame (), + regnum, fpregs); + } + continue; +@@ -1714,8 +1710,6 @@ print_vector_info (struct gdbarch *gdbar + { + if (!target_has_registers) + error ("The program has no registers now."); +- if (deprecated_selected_frame == NULL) +- error ("No selected frame."); + + if (gdbarch_print_vector_info_p (gdbarch)) + gdbarch_print_vector_info (gdbarch, file, frame, args); +@@ -1740,7 +1734,7 @@ print_vector_info (struct gdbarch *gdbar + static void + vector_info (char *args, int from_tty) + { +- print_vector_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args); ++ print_vector_info (current_gdbarch, gdb_stdout, get_selected_frame (), args); + } + + +@@ -1910,8 +1904,6 @@ print_float_info (struct gdbarch *gdbarc + { + if (!target_has_registers) + error ("The program has no registers now."); +- if (deprecated_selected_frame == NULL) +- error ("No selected frame."); + + if (gdbarch_print_float_info_p (gdbarch)) + gdbarch_print_float_info (gdbarch, file, frame, args); +@@ -1937,7 +1929,7 @@ No floating-point info available for thi + static void + float_info (char *args, int from_tty) + { +- print_float_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args); ++ print_float_info (current_gdbarch, gdb_stdout, get_selected_frame (), args); + } + + static void +Index: gdb-6.3/gdb/inflow.c +=================================================================== +--- gdb-6.3.orig/gdb/inflow.c 2004-08-11 05:00:57.000000000 -0400 ++++ gdb-6.3/gdb/inflow.c 2004-11-09 22:58:37.488338883 -0500 +@@ -591,10 +591,7 @@ kill_command (char *arg, int from_tty) + if (target_has_stack) + { + printf_filtered ("In %s,\n", target_longname); +- if (deprecated_selected_frame == NULL) +- fputs_filtered ("No selected stack frame.\n", gdb_stdout); +- else +- print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); ++ print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC); + } + bfd_cache_close_all (); + } +Index: gdb-6.3/gdb/infrun.c +=================================================================== +--- gdb-6.3.orig/gdb/infrun.c 2004-09-27 13:58:08.000000000 -0400 ++++ gdb-6.3/gdb/infrun.c 2004-11-09 22:51:07.351240752 -0500 +@@ -3485,7 +3485,7 @@ save_inferior_status (int restore_stack_ + + inf_status->registers = regcache_dup (current_regcache); + +- inf_status->selected_frame_id = get_frame_id (deprecated_selected_frame); ++ inf_status->selected_frame_id = get_frame_id (get_selected_frame ()); + return inf_status; + } + +Index: gdb-6.3/gdb/mi/mi-main.c +=================================================================== +--- gdb-6.3.orig/gdb/mi/mi-main.c 2004-09-12 11:00:42.000000000 -0400 ++++ gdb-6.3/gdb/mi/mi-main.c 2004-11-09 22:53:29.998389013 -0500 +@@ -388,7 +388,7 @@ register_changed_p (int regnum) + { + char raw_buffer[MAX_REGISTER_SIZE]; + +- if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) ++ if (! frame_register_read (get_selected_frame (), regnum, raw_buffer)) + return -1; + + if (memcmp (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer, +@@ -509,7 +509,7 @@ get_register (int regnum, int format) + if (format == 'N') + format = 0; + +- frame_register (deprecated_selected_frame, regnum, &optim, &lval, &addr, ++ frame_register (get_selected_frame (), regnum, &optim, &lval, &addr, + &realnum, buffer); + + if (optim) +Index: gdb-6.3/gdb/mn10300-tdep.c +=================================================================== +--- gdb-6.3.orig/gdb/mn10300-tdep.c 2004-08-02 22:02:22.000000000 -0400 ++++ gdb-6.3/gdb/mn10300-tdep.c 2004-11-09 22:51:07.356239776 -0500 +@@ -1154,7 +1154,7 @@ mn10300_print_register (const char *name + printf_filtered ("%s: ", name); + + /* Get the data */ +- if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer)) ++ if (!frame_register_read (get_selected_frame (), regnum, raw_buffer)) + { + printf_filtered ("[invalid]"); + return; +Index: gdb-6.3/gdb/stack.c +=================================================================== +--- gdb-6.3.orig/gdb/stack.c 2004-08-02 20:57:26.000000000 -0400 ++++ gdb-6.3/gdb/stack.c 2004-11-09 22:51:07.361238800 -0500 +@@ -758,9 +758,7 @@ parse_frame_specification (char *frame_e + switch (numargs) + { + case 0: +- if (deprecated_selected_frame == NULL) +- error ("No selected frame."); +- return deprecated_selected_frame; ++ return get_selected_frame (); + /* NOTREACHED */ + case 1: + { +@@ -902,10 +900,10 @@ frame_info (char *addr_exp, int from_tty + } + calling_frame_info = get_prev_frame (fi); + +- if (!addr_exp && frame_relative_level (deprecated_selected_frame) >= 0) ++ if (!addr_exp && frame_relative_level (get_selected_frame ()) >= 0) + { + printf_filtered ("Stack level %d, frame at ", +- frame_relative_level (deprecated_selected_frame)); ++ frame_relative_level (get_selected_frame ())); + print_address_numeric (get_frame_base (fi), 1, gdb_stdout); + printf_filtered (":\n"); + } +@@ -1445,9 +1443,7 @@ print_frame_label_vars (struct frame_inf + void + locals_info (char *args, int from_tty) + { +- if (!deprecated_selected_frame) +- error ("No frame selected."); +- print_frame_local_vars (deprecated_selected_frame, 0, gdb_stdout); ++ print_frame_local_vars (get_selected_frame (), 0, gdb_stdout); + } + + static void +@@ -1470,7 +1466,7 @@ catch_info (char *ignore, int from_tty) + if (!deprecated_selected_frame) + error ("No frame selected."); + +- print_frame_label_vars (deprecated_selected_frame, 0, gdb_stdout); ++ print_frame_label_vars (get_selected_frame (), 0, gdb_stdout); + } + } + +@@ -1537,9 +1533,7 @@ print_frame_arg_vars (struct frame_info + void + args_info (char *ignore, int from_tty) + { +- if (!deprecated_selected_frame) +- error ("No frame selected."); +- print_frame_arg_vars (deprecated_selected_frame, gdb_stdout); ++ print_frame_arg_vars (get_selected_frame (), gdb_stdout); + } + + +@@ -1724,7 +1718,7 @@ down_silently_base (char *count_exp) + if (target_has_stack == 0 || deprecated_selected_frame == 0) + error ("No stack."); + +- frame = find_relative_frame (deprecated_selected_frame, &count1); ++ frame = find_relative_frame (get_selected_frame (), &count1); + if (count1 != 0 && count_exp == 0) + { + +@@ -1944,7 +1938,7 @@ func_command (char *arg, int from_tty) + + if (!found) + printf_filtered ("'%s' not within current stack frame.\n", arg); +- else if (fp != deprecated_selected_frame) ++ else if (fp != get_selected_frame ()) + select_and_print_frame (fp); + } + +@@ -1965,7 +1959,7 @@ get_frame_language (void) + instruction of another function. So we rely on + get_frame_address_in_block(), it provides us with a PC which is + guaranteed to be inside the frame's code block. */ +- s = find_pc_symtab (get_frame_address_in_block (deprecated_selected_frame)); ++ s = find_pc_symtab (get_frame_address_in_block (get_selected_frame ())); + if (s) + flang = s->language; + else +Index: gdb-6.3/gdb/tui/tui-disasm.c +=================================================================== +--- gdb-6.3.orig/gdb/tui/tui-disasm.c 2004-02-24 20:10:01.000000000 -0500 ++++ gdb-6.3/gdb/tui/tui-disasm.c 2004-11-09 22:51:07.370237044 -0500 +@@ -382,7 +382,7 @@ tui_vertical_disassem_scroll (enum tui_s + + content = (tui_win_content) TUI_DISASM_WIN->generic.content; + if (cursal.symtab == (struct symtab *) NULL) +- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); ++ s = find_pc_symtab (get_frame_pc (get_selected_frame ())); + else + s = cursal.symtab; + +Index: gdb-6.3/gdb/tui/tui-source.c +=================================================================== +--- gdb-6.3.orig/gdb/tui/tui-source.c 2004-02-16 16:05:09.000000000 -0500 ++++ gdb-6.3/gdb/tui/tui-source.c 2004-11-09 22:51:07.370237044 -0500 +@@ -326,7 +326,7 @@ tui_vertical_source_scroll (enum tui_scr + struct symtab_and_line cursal = get_current_source_symtab_and_line (); + + if (cursal.symtab == (struct symtab *) NULL) +- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); ++ s = find_pc_symtab (get_frame_pc (get_selected_frame ())); + else + s = cursal.symtab; + +Index: gdb-6.3/gdb/tui/tui-winsource.c +=================================================================== +--- gdb-6.3.orig/gdb/tui/tui-winsource.c 2004-02-16 16:05:09.000000000 -0500 ++++ gdb-6.3/gdb/tui/tui-winsource.c 2004-11-09 22:51:07.371236848 -0500 +@@ -311,7 +311,7 @@ tui_horizontal_source_scroll (struct tui + struct symtab_and_line cursal = get_current_source_symtab_and_line (); + + if (cursal.symtab == (struct symtab *) NULL) +- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); ++ s = find_pc_symtab (get_frame_pc (get_selected_frame ())); + else + s = cursal.symtab; + +Index: gdb-6.3/gdb/valops.c +=================================================================== +--- gdb-6.3.orig/gdb/valops.c 2004-09-13 23:01:48.000000000 -0400 ++++ gdb-6.3/gdb/valops.c 2004-11-09 22:51:07.374236263 -0500 +@@ -2663,15 +2663,10 @@ value_of_local (const char *name, int co + struct block *b; + struct value * ret; + +- if (deprecated_selected_frame == 0) +- { +- if (complain) +- error ("no frame selected"); +- else +- return 0; +- } ++ if (!complain && deprecated_selected_frame == 0) ++ return 0; + +- func = get_frame_function (deprecated_selected_frame); ++ func = get_frame_function (get_selected_frame ()); + if (!func) + { + if (complain) +@@ -2700,7 +2695,7 @@ value_of_local (const char *name, int co + return NULL; + } + +- ret = read_var_value (sym, deprecated_selected_frame); ++ ret = read_var_value (sym, get_selected_frame ()); + if (ret == 0 && complain) + error ("`%s' argument unreadable", name); + return ret; +Index: gdb-6.3/gdb/varobj.c +=================================================================== +--- gdb-6.3.orig/gdb/varobj.c 2004-07-26 10:53:06.000000000 -0400 ++++ gdb-6.3/gdb/varobj.c 2004-11-09 22:51:07.377235677 -0500 +@@ -488,7 +488,7 @@ varobj_create (char *objname, + if (fi != NULL) + { + var->root->frame = get_frame_id (fi); +- old_fi = deprecated_selected_frame; ++ old_fi = get_selected_frame (); + select_frame (fi); + } + +Index: gdb-6.3/gdb/testsuite/gdb.base/default.exp +=================================================================== +--- gdb-6.3.orig/gdb/testsuite/gdb.base/default.exp 2003-03-20 09:45:50.000000000 -0500 ++++ gdb-6.3/gdb/testsuite/gdb.base/default.exp 2004-11-09 22:51:07.379235287 -0500 +@@ -167,7 +167,7 @@ gdb_test "disable breakpoints" "" "disab + #test disable display + gdb_test "disable display" "" "disable display" + #test disassemble +-gdb_test "disassemble" "No frame selected." "disassemble" ++gdb_test "disassemble" "No (frame selected|registers)." "disassemble" + #test display + gdb_test "display" "" "display" + #test do +@@ -229,9 +229,9 @@ gdb_expect { + } + + #test frame "f" abbreviation +-gdb_test "f" "No stack." "frame \"f\" abbreviation" ++gdb_test "f" "No (stack|registers)." "frame \"f\" abbreviation" + #test frame +-gdb_test "frame" "No stack." "frame" ++gdb_test "frame" "No (stack|registers)." "frame" + #test fg + gdb_test "fg" "The program is not being run." "fg" + # FIXME: fg kills the udi connection +@@ -294,9 +294,9 @@ gdb_test "ignore" "Argument required .a + #test info address + gdb_test "info address" "Argument required." "info address" + #test info all-registers +-gdb_test "info all-registers" "The program has no registers now." "info all-registers" ++gdb_test "info all-registers" "(The program has no registers now|No registers)." "info all-registers" + #test info args +-gdb_test "info args" "No frame selected." "info args" ++gdb_test "info args" "No (frame selected|registers)." "info args" + #test info bogus-gdb-command + gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\".*" "info bogus-gdb-command" + #test info breakpoints +@@ -320,11 +320,11 @@ gdb_test "info frame" "No stack.|No sele + #test info files + gdb_test "info files" "" "info files" + #test info float +-gdb_test "info float" "The program has no registers now." "info float" ++gdb_test "info float" "(The program has no registers now|No registers)." "info float" + #test info functions + gdb_test "info functions" "All defined functions:" "info functions" + #test info locals +-gdb_test "info locals" "No frame selected." "info locals" ++gdb_test "info locals" "(No frame selected|No registers)." "info locals" + #test info program + gdb_test "info program" "The program being debugged is not being run." "info program" + #test info registers +@@ -352,7 +352,7 @@ gdb_test "info types" "All defined types + #test info variables + gdb_test "info variables" "All defined variables:" "info variables" + #test info vector +-gdb_test "info vector" "The program has no registers now." "info vector" ++gdb_test "info vector" "(The program has no registers now|No registers)." "info vector" + #test info warranty + gdb_test "info warranty" "NO WARRANTY(\[^\r\n\]*\[\r\n\])+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY(\[^\r\n\]*\[\r\n\])+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN(\[^\r\n\]*\[\r\n\])+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES(\[^\r\n\]*\[\r\n\])+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED(\[^\r\n\]*\[\r\n\])+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF(\[^\r\n\]*\[\r\n\])+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS(\[^\r\n\]*\[\r\n\])+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE(\[^\r\n\]*\[\r\n\])+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,(\[^\r\n\]*\[\r\n\])+REPAIR OR CORRECTION.(\[^\r\n\]*\[\r\n\])+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING(\[^\r\n\]*\[\r\n\])+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR(\[^\r\n\]*\[\r\n\])+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,(\[^\r\n\]*\[\r\n\])+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING(\[^\r\n\]*\[\r\n\])+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED(\[^\r\n\]*\[\r\n\])+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY(\[^\r\n\]*\[\r\n\])+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER(\[^\r\n\]*\[\r\n\])+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE(\[^\r\n\]*\[\r\n\])+POSSIBILITY OF SUCH DAMAGES.*" "info warranty" + #test info watchpoints --- gdb-6.3.orig/debian/patches/static-threads-test.patch +++ gdb-6.3/debian/patches/static-threads-test.patch @@ -0,0 +1,36 @@ +Update staticthreads.exp to handle debugging info in libpthread.a. + +Index: gdb-6.3/gdb/testsuite/gdb.threads/staticthreads.exp +=================================================================== +--- gdb-6.3.orig/gdb/testsuite/gdb.threads/staticthreads.exp 2004-11-10 10:35:15.000000000 -0500 ++++ gdb-6.3/gdb/testsuite/gdb.threads/staticthreads.exp 2004-11-10 11:22:48.671121466 -0500 +@@ -53,6 +53,10 @@ gdb_test_multiple "continue" "$test" { + -re " sem_post .*$gdb_prompt " { + pass "$test" + } ++ -re " (.*_)sem_post .*$gdb_prompt " { ++ # Glibc uses aliases for internal symbols; match __new_sem_post. ++ pass "$test" ++ } + -re "Program received signal .*$gdb_prompt " { + kfail gdb/1328 "$test" + } +@@ -64,8 +68,16 @@ gdb_test_multiple "continue" "$test" { + + rerun_to_main + gdb_test "handle SIG32 nostop noprint pass" +-set test "Handle SIG32 helps" +-gdb_test "continue" " sem_post .*" "handle SIG32 helps" ++set test "handle SIG32 helps" ++gdb_test_multiple "continue" "$test" { ++ -re " sem_post .*$gdb_prompt $" { ++ pass "$test" ++ } ++ -re " (.*_)sem_post .*$gdb_prompt $" { ++ # Glibc uses aliases for internal symbols; match __new_sem_post. ++ pass "$test" ++ } ++} + + + # See if info threads produces anything approaching a thread list. --- gdb-6.3.orig/debian/patches/dwarf-cfa-restore.patch +++ gdb-6.3/debian/patches/dwarf-cfa-restore.patch @@ -0,0 +1,23 @@ +Status: Checked in to HEAD after 6.3. + +2004-11-09 Daniel Jacobowitz + + * dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Correct allocated + size. + +Index: src/gdb/dwarf2-frame.c +=================================================================== +RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v +retrieving revision 1.45 +diff -u -p -r1.45 dwarf2-frame.c +--- src/gdb/dwarf2-frame.c 7 Nov 2004 21:16:11 -0000 1.45 ++++ src/gdb/dwarf2-frame.c 9 Nov 2004 14:42:52 -0000 +@@ -162,7 +162,7 @@ dwarf2_frame_state_alloc_regs (struct dw + static struct dwarf2_frame_state_reg * + dwarf2_frame_state_copy_regs (struct dwarf2_frame_state_reg_info *rs) + { +- size_t size = rs->num_regs * sizeof (struct dwarf2_frame_state_reg_info); ++ size_t size = rs->num_regs * sizeof (struct dwarf2_frame_state_reg); + struct dwarf2_frame_state_reg *reg; + + reg = (struct dwarf2_frame_state_reg *) xmalloc (size); --- gdb-6.3.orig/debian/patches/24.tracepoint-segv.patch +++ gdb-6.3/debian/patches/24.tracepoint-segv.patch @@ -0,0 +1,15 @@ +Trivial. Still need to submit this. + +Index: gdb-6.1/gdb/tracepoint.c +=================================================================== +--- gdb-6.1.orig/gdb/tracepoint.c 2004-04-05 13:26:43.000000000 -0400 ++++ gdb-6.1/gdb/tracepoint.c 2004-04-05 13:26:45.000000000 -0400 +@@ -853,6 +853,8 @@ read_actions (struct tracepoint *t) + else + line = gdb_readline (0); + ++ if (line == NULL || *line == EOF) ++ break; + linetype = validate_actionline (&line, t); + if (linetype == BADLINE) + continue; /* already warned -- collect another line */ --- gdb-6.3.orig/debian/patches/gdb-fix-tracefork-check.patch +++ gdb-6.3/debian/patches/gdb-fix-tracefork-check.patch @@ -0,0 +1,225 @@ +Status: submitted for comments + +2004-11-12 Daniel Jacobowitz + + * linux-nat.c (my_waitpid): New function. + (linux_test_for_tracefork): Make more robust and verbose. Take + an ORIGINAL_PID argument and test for PTRACE_SETOPTIONS first. + (linux_supports_tracefork, linux_supports_tracevforkdone): Take a PID + argument. Update calls to linux_test_for_tracefork. + (linux_enable_event_reporting, child_follow_fork) + (child_insert_fork_catchpoint, child_insert_vfork_catchpoint) + (child_insert_exec_catchpoint): Update calls to + linux_supports_tracefork and linux_supports_tracevforkdone. + +Index: gdb-6.3/gdb/linux-nat.c +=================================================================== +--- gdb-6.3.orig/gdb/linux-nat.c 2004-10-08 16:29:47.000000000 -0400 ++++ gdb-6.3/gdb/linux-nat.c 2004-11-13 16:41:51.368720845 -0500 +@@ -150,18 +150,47 @@ linux_tracefork_child (void) + exit (0); + } + +-/* Determine if PTRACE_O_TRACEFORK can be used to follow fork events. We ++/* Wrapper function for waitpid which handles EINTR. */ ++ ++static int ++my_waitpid (int pid, int *status, int flags) ++{ ++ int ret; ++ do ++ { ++ ret = waitpid (pid, status, flags); ++ } ++ while (ret == -1 && errno == EINTR); ++ ++ return ret; ++} ++ ++/* Determine if PTRACE_O_TRACEFORK can be used to follow fork events. ++ ++ First, we try to enable fork tracing on ORIGINAL_PID. If this fails, ++ we know that the feature is not available. This may change the tracing ++ options for ORIGINAL_PID, but we'll be setting them shortly anyway. ++ ++ However, if it succeeds, we don't know for sure that the feature is ++ available; old versions of PTRACE_SETOPTIONS ignored unknown options. We + create a child process, attach to it, use PTRACE_SETOPTIONS to enable +- fork tracing, and let it fork. If the process exits, we assume that +- we can't use TRACEFORK; if we get the fork notification, and we can +- extract the new child's PID, then we assume that we can. */ ++ fork tracing, and let it fork. If the process exits, we assume that we ++ can't use TRACEFORK; if we get the fork notification, and we can extract ++ the new child's PID, then we assume that we can. */ + + static void +-linux_test_for_tracefork (void) ++linux_test_for_tracefork (int original_pid) + { + int child_pid, ret, status; + long second_pid; + ++ linux_supports_tracefork_flag = 0; ++ linux_supports_tracevforkdone_flag = 0; ++ ++ ret = ptrace (PTRACE_SETOPTIONS, original_pid, 0, PTRACE_O_TRACEFORK); ++ if (ret != 0) ++ return; ++ + child_pid = fork (); + if (child_pid == -1) + perror_with_name ("linux_test_for_tracefork: fork"); +@@ -169,7 +198,7 @@ linux_test_for_tracefork (void) + if (child_pid == 0) + linux_tracefork_child (); + +- ret = waitpid (child_pid, &status, 0); ++ ret = my_waitpid (child_pid, &status, 0); + if (ret == -1) + perror_with_name ("linux_test_for_tracefork: waitpid"); + else if (ret != child_pid) +@@ -177,13 +206,23 @@ linux_test_for_tracefork (void) + if (! WIFSTOPPED (status)) + error ("linux_test_for_tracefork: waitpid: unexpected status %d.", status); + +- linux_supports_tracefork_flag = 0; +- + ret = ptrace (PTRACE_SETOPTIONS, child_pid, 0, PTRACE_O_TRACEFORK); + if (ret != 0) + { +- ptrace (PTRACE_KILL, child_pid, 0, 0); +- waitpid (child_pid, &status, 0); ++ ret = ptrace (PTRACE_KILL, child_pid, 0, 0); ++ if (ret != 0) ++ { ++ warning ("linux_test_for_tracefork: failed to kill child"); ++ return; ++ } ++ ++ ret = my_waitpid (child_pid, &status, 0); ++ if (ret != child_pid) ++ warning ("linux_test_for_tracefork: failed to wait for killed child"); ++ else if (!WIFSIGNALED (status)) ++ warning ("linux_test_for_tracefork: unexpected wait status 0x%x from " ++ "killed child", status); ++ + return; + } + +@@ -192,8 +231,12 @@ linux_test_for_tracefork (void) + PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORKDONE); + linux_supports_tracevforkdone_flag = (ret == 0); + +- ptrace (PTRACE_CONT, child_pid, 0, 0); +- ret = waitpid (child_pid, &status, 0); ++ ret = ptrace (PTRACE_CONT, child_pid, 0, 0); ++ if (ret != 0) ++ warning ("linux_test_for_tracefork: failed to resume child"); ++ ++ ret = my_waitpid (child_pid, &status, 0); ++ + if (ret == child_pid && WIFSTOPPED (status) + && status >> 16 == PTRACE_EVENT_FORK) + { +@@ -204,34 +247,38 @@ linux_test_for_tracefork (void) + int second_status; + + linux_supports_tracefork_flag = 1; +- waitpid (second_pid, &second_status, 0); +- ptrace (PTRACE_DETACH, second_pid, 0, 0); ++ my_waitpid (second_pid, &second_status, 0); ++ ret = ptrace (PTRACE_KILL, second_pid, 0, 0); ++ if (ret != 0) ++ warning ("linux_test_for_tracefork: failed to kill second child"); + } + } ++ else ++ warning ("linux_test_for_tracefork: unexpected result from waitpid " ++ "(%d, status 0x%x)", ret, status); + +- if (WIFSTOPPED (status)) +- { +- ptrace (PTRACE_DETACH, child_pid, 0, 0); +- waitpid (child_pid, &status, 0); +- } ++ ret = ptrace (PTRACE_KILL, child_pid, 0, 0); ++ if (ret != 0) ++ warning ("linux_test_for_tracefork: failed to kill child"); ++ my_waitpid (child_pid, &status, 0); + } + + /* Return non-zero iff we have tracefork functionality available. + This function also sets linux_supports_tracefork_flag. */ + + static int +-linux_supports_tracefork (void) ++linux_supports_tracefork (int pid) + { + if (linux_supports_tracefork_flag == -1) +- linux_test_for_tracefork (); ++ linux_test_for_tracefork (pid); + return linux_supports_tracefork_flag; + } + + static int +-linux_supports_tracevforkdone (void) ++linux_supports_tracevforkdone (int pid) + { + if (linux_supports_tracefork_flag == -1) +- linux_test_for_tracefork (); ++ linux_test_for_tracefork (pid); + return linux_supports_tracevforkdone_flag; + } + +@@ -242,12 +289,12 @@ linux_enable_event_reporting (ptid_t pti + int pid = ptid_get_pid (ptid); + int options; + +- if (! linux_supports_tracefork ()) ++ if (! linux_supports_tracefork (pid)) + return; + + options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXEC + | PTRACE_O_TRACECLONE; +- if (linux_supports_tracevforkdone ()) ++ if (linux_supports_tracevforkdone (pid)) + options |= PTRACE_O_TRACEVFORKDONE; + + /* Do not enable PTRACE_O_TRACEEXIT until GDB is more prepared to support +@@ -308,7 +355,8 @@ child_follow_fork (int follow_child) + + if (has_vforked) + { +- if (linux_supports_tracevforkdone ()) ++ gdb_assert (linux_supports_tracefork_flag >= 0); ++ if (linux_supports_tracevforkdone (0)) + { + int status; + +@@ -476,7 +524,7 @@ linux_handle_extended_wait (int pid, int + int + child_insert_fork_catchpoint (int pid) + { +- if (! linux_supports_tracefork ()) ++ if (! linux_supports_tracefork (pid)) + error ("Your system does not support fork catchpoints."); + + return 0; +@@ -485,7 +533,7 @@ child_insert_fork_catchpoint (int pid) + int + child_insert_vfork_catchpoint (int pid) + { +- if (!linux_supports_tracefork ()) ++ if (!linux_supports_tracefork (pid)) + error ("Your system does not support vfork catchpoints."); + + return 0; +@@ -494,7 +542,7 @@ child_insert_vfork_catchpoint (int pid) + int + child_insert_exec_catchpoint (int pid) + { +- if (!linux_supports_tracefork ()) ++ if (!linux_supports_tracefork (pid)) + error ("Your system does not support exec catchpoints."); + + return 0; --- gdb-6.3.orig/debian/patches/make-cv-type-crash.patch +++ gdb-6.3/debian/patches/make-cv-type-crash.patch @@ -0,0 +1,132 @@ +2004-11-04 Jim Blandy + + * gdbtypes.c (make_qualified_type): Doc fix. Add assertion to + prevent cross-objfile references. + (make_cv_type): Doc fix. Don't create cross-objfile references, + even for stub types. + (replace_type): Add assertion to prevent cross-objfile references. + (check_typedef): Never resolve a stub type by copying over a type + from another file. + +Index: src/gdb/gdbtypes.c +=================================================================== +RCS file: /big/fsf/rsync/src-cvs/src/gdb/gdbtypes.c,v +retrieving revision 1.92 +retrieving revision 1.93 +diff -u -p -r1.92 -r1.93 +--- src/gdb/gdbtypes.c 8 Aug 2004 17:18:16 -0000 1.92 ++++ src/gdb/gdbtypes.c 4 Nov 2004 17:50:16 -0000 1.93 +@@ -433,7 +433,9 @@ address_space_int_to_name (int space_fla + } + + /* Create a new type with instance flags NEW_FLAGS, based on TYPE. +- If STORAGE is non-NULL, create the new type instance there. */ ++ ++ If STORAGE is non-NULL, create the new type instance there. ++ STORAGE must be in the same obstack as TYPE. */ + + static struct type * + make_qualified_type (struct type *type, int new_flags, +@@ -453,6 +455,12 @@ make_qualified_type (struct type *type, + ntype = alloc_type_instance (type); + else + { ++ /* If STORAGE was provided, it had better be in the same objfile as ++ TYPE. Otherwise, we can't link it into TYPE's cv chain: if one ++ objfile is freed and the other kept, we'd have dangling ++ pointers. */ ++ gdb_assert (TYPE_OBJFILE (type) == TYPE_OBJFILE (storage)); ++ + ntype = storage; + TYPE_MAIN_TYPE (ntype) = TYPE_MAIN_TYPE (type); + TYPE_CHAIN (ntype) = ntype; +@@ -501,11 +509,12 @@ make_type_with_address_space (struct typ + CNST is a flag for setting the const attribute + VOLTL is a flag for setting the volatile attribute + TYPE is the base type whose variant we are creating. +- TYPEPTR, if nonzero, points +- to a pointer to memory where the reference type should be stored. +- If *TYPEPTR is zero, update it to point to the reference type we return. +- We allocate new memory if needed. */ + ++ If TYPEPTR and *TYPEPTR are non-zero, then *TYPEPTR points to ++ storage to hold the new qualified type; *TYPEPTR and TYPE must be ++ in the same objfile. Otherwise, allocate fresh memory for the new ++ type whereever TYPE lives. If TYPEPTR is non-zero, set it to the ++ new type we construct. */ + struct type * + make_cv_type (int cnst, int voltl, struct type *type, struct type **typeptr) + { +@@ -524,20 +533,19 @@ make_cv_type (int cnst, int voltl, struc + + if (typeptr && *typeptr != NULL) + { +- /* Objfile is per-core-type. This const-qualified type had best +- belong to the same objfile as the type it is qualifying, unless +- we are overwriting a stub type, in which case the safest thing +- to do is to copy the core type into the new objfile. */ +- +- gdb_assert (TYPE_OBJFILE (*typeptr) == TYPE_OBJFILE (type) +- || TYPE_STUB (*typeptr)); +- if (TYPE_OBJFILE (*typeptr) != TYPE_OBJFILE (type)) +- { +- TYPE_MAIN_TYPE (*typeptr) +- = TYPE_ALLOC (*typeptr, sizeof (struct main_type)); +- *TYPE_MAIN_TYPE (*typeptr) +- = *TYPE_MAIN_TYPE (type); +- } ++ /* TYPE and *TYPEPTR must be in the same objfile. We can't have ++ a C-V variant chain that threads across objfiles: if one ++ objfile gets freed, then the other has a broken C-V chain. ++ ++ This code used to try to copy over the main type from TYPE to ++ *TYPEPTR if they were in different objfiles, but that's ++ wrong, too: TYPE may have a field list or member function ++ lists, which refer to types of their own, etc. etc. The ++ whole shebang would need to be copied over recursively; you ++ can't have inter-objfile pointers. The only thing to do is ++ to leave stub types as stub types, and look them up afresh by ++ name each time you encounter them. */ ++ gdb_assert (TYPE_OBJFILE (*typeptr) == TYPE_OBJFILE (type)); + } + + ntype = make_qualified_type (type, new_flags, typeptr ? *typeptr : NULL); +@@ -562,6 +570,12 @@ replace_type (struct type *ntype, struct + { + struct type *chain; + ++ /* These two types had better be in the same objfile. Otherwise, ++ the assignment of one type's main type structure to the other ++ will produce a type with references to objects (names; field ++ lists; etc.) allocated on an objfile other than its own. */ ++ gdb_assert (TYPE_OBJFILE (ntype) == TYPE_OBJFILE (ntype)); ++ + *TYPE_MAIN_TYPE (ntype) = *TYPE_MAIN_TYPE (type); + + /* The type length is not a part of the main type. Update it for each +@@ -1416,8 +1430,24 @@ check_typedef (struct type *type) + return type; + } + newtype = lookup_transparent_type (name); ++ + if (newtype) +- make_cv_type (is_const, is_volatile, newtype, &type); ++ { ++ /* If the resolved type and the stub are in the same objfile, ++ then replace the stub type with the real deal. But if ++ they're in separate objfiles, leave the stub alone; we'll ++ just look up the transparent type every time we call ++ check_typedef. We can't create pointers between types ++ allocated to different objfiles, since they may have ++ different lifetimes. Trying to copy NEWTYPE over to TYPE's ++ objfile is pointless, too, since you'll have to move over any ++ other types NEWTYPE refers to, which could be an unbounded ++ amount of stuff. */ ++ if (TYPE_OBJFILE (newtype) == TYPE_OBJFILE (type)) ++ make_cv_type (is_const, is_volatile, newtype, &type); ++ else ++ type = newtype; ++ } + } + /* Otherwise, rely on the stub flag being set for opaque/stubbed types */ + else if (TYPE_STUB (type) && !currently_reading_symtab) --- gdb-6.3.orig/debian/patches/sparc-singlestep.patch +++ gdb-6.3/debian/patches/sparc-singlestep.patch @@ -0,0 +1,37 @@ +Status: submitted for comments + +2004-11-13 Daniel Jacobowitz + + * sparc-tdep.c (sparc_software_single_step): Handle stepping to NULL. + +Index: gdb-6.3/gdb/sparc-tdep.c +=================================================================== +--- gdb-6.3.orig/gdb/sparc-tdep.c 2004-06-06 22:02:55.000000000 -0400 ++++ gdb-6.3/gdb/sparc-tdep.c 2004-11-13 17:06:05.000000000 -0500 +@@ -1026,10 +1026,10 @@ + + if (insert_breakpoints_p) + { +- CORE_ADDR pc; ++ CORE_ADDR pc, orig_npc; + + pc = sparc_address_from_register (tdep->pc_regnum); +- npc = sparc_address_from_register (tdep->npc_regnum); ++ orig_npc = npc = sparc_address_from_register (tdep->npc_regnum); + + /* Analyze the instruction at PC. */ + nnpc = sparc_analyze_control_transfer (pc, &npc); +@@ -1039,9 +1039,10 @@ + target_insert_breakpoint (nnpc, nnpc_save); + + /* Assert that we have set at least one breakpoint, and that +- they're not set at the same spot. */ +- gdb_assert (npc != 0 || nnpc != 0); +- gdb_assert (nnpc != npc); ++ they're not set at the same spot - unless we're going ++ from here straight to NULL, i.e. a call or jump to 0. */ ++ gdb_assert (npc != 0 || nnpc != 0 || orig_npc == 0); ++ gdb_assert (nnpc != npc || orig_npc == 0); + } + else + { --- gdb-6.3.orig/debian/patches/member-field-symtab.patch +++ gdb-6.3/debian/patches/member-field-symtab.patch @@ -0,0 +1,35 @@ +Status: unsubmitted + +This patch was for Debian bug #239535. It needs to be tested, and +submitted. + +Index: gdb-6.3/gdb/valops.c +=================================================================== +--- gdb-6.3.orig/gdb/valops.c 2004-11-09 22:51:07.000000000 -0500 ++++ gdb-6.3/gdb/valops.c 2004-11-10 00:43:54.036837699 -0500 +@@ -2314,8 +2314,10 @@ check_field_in (struct type *type, const + return 1; + } + ++ /* Check each baseclass. Call check_typedef, which will follow typedefs ++ and do opaque/stub type resolution. */ + for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) +- if (check_field_in (TYPE_BASECLASS (type, i), name)) ++ if (check_field_in (check_typedef (TYPE_BASECLASS (type, i)), name)) + return 1; + + return 0; +Index: gdb-6.3/gdb/dwarf2read.c +=================================================================== +--- gdb-6.3.orig/gdb/dwarf2read.c 2004-10-15 20:41:00.000000000 -0400 ++++ gdb-6.3/gdb/dwarf2read.c 2004-11-10 00:46:21.970935829 -0500 +@@ -2099,8 +2099,8 @@ guess_structure_name (struct partial_die + strlen (actual_class_name), + &cu->comp_unit_obstack); + xfree (actual_class_name); ++ break; + } +- break; + } + + child_pdi = child_pdi->die_sibling; --- gdb-6.3.orig/debian/patches/34.info-section.patch +++ gdb-6.3/debian/patches/34.info-section.patch @@ -0,0 +1,42 @@ +Debian-local: + Use the Development section, for consistency with other Debian packages. + +Index: gdb-6.3/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-6.3.orig/gdb/doc/gdb.texinfo 2004-10-08 15:19:03.000000000 -0400 ++++ gdb-6.3/gdb/doc/gdb.texinfo 2004-11-10 00:38:00.343924014 -0500 +@@ -38,7 +38,7 @@ + + @c This is a dir.info fragment to support semi-automated addition of + @c manuals to an info tree. +-@dircategory Software development ++@dircategory Development + @direntry + * Gdb: (gdb). The GNU debugger. + @end direntry +Index: gdb-6.3/gdb/doc/gdbint.texinfo +=================================================================== +--- gdb-6.3.orig/gdb/doc/gdbint.texinfo 2004-10-12 15:14:31.000000000 -0400 ++++ gdb-6.3/gdb/doc/gdbint.texinfo 2004-11-10 00:37:59.165154226 -0500 +@@ -1,7 +1,7 @@ + \input texinfo @c -*- texinfo -*- + @setfilename gdbint.info + @include gdb-cfg.texi +-@dircategory Software development ++@dircategory Development + @direntry + * Gdb-Internals: (gdbint). The GNU debugger's internals. + @end direntry +Index: gdb-6.3/gdb/doc/stabs.texinfo +=================================================================== +--- gdb-6.3.orig/gdb/doc/stabs.texinfo 2004-09-21 17:06:37.000000000 -0400 ++++ gdb-6.3/gdb/doc/stabs.texinfo 2004-11-10 00:37:59.874015787 -0500 +@@ -5,7 +5,7 @@ + + @c This is a dir.info fragment to support semi-automated addition of + @c manuals to an info tree. +-@dircategory Software development ++@dircategory Development + @direntry + * Stabs: (stabs). The "stabs" debugging information format. + @end direntry --- gdb-6.3.orig/debian/patches/series +++ gdb-6.3/debian/patches/series @@ -0,0 +1,25 @@ +10.selected-frame.patch +13.use-dynamic-readline.patch +static-thread-db.patch +24.tracepoint-segv.patch +dwarf2-frame-signal-unwinder.patch +vsyscall-gdb-support.patch +dwarf-cfa-restore.patch +34.info-section.patch +sim-destdir.patch +member-field-symtab.patch +cp-pass-by-reference.patch +thread-db-multiple-libraries.patch +static-threads-test.patch +gdb-fix-tracefork-check.patch +make-cv-type-crash.patch +sparc-singlestep.patch +vsyscall-bfd-close-result.patch +vfork-done-spelling.patch +gdbserver-rdynamic.patch +dwarf2-cfi-warning.patch +linux-use-underscore-exit.patch +bfd-no-kylix-crash.patch +disable-linux-fork-messages.patch +bfd-security-fixes.patch +gdbinit-ownership.patch --- gdb-6.3.orig/debian/patches/cp-pass-by-reference.patch +++ gdb-6.3/debian/patches/cp-pass-by-reference.patch @@ -0,0 +1,464 @@ +This patch needs to be submitted for the FSF. Also, there may be testcases +already in the GDB testsuite (currently disabled) that it would probably fix. + +Index: gdb-6.3/gdb/infcall.c +=================================================================== +--- gdb-6.3.orig/gdb/infcall.c 2004-10-08 04:15:56.000000000 -0400 ++++ gdb-6.3/gdb/infcall.c 2004-11-10 12:30:07.000000000 -0500 +@@ -36,6 +36,7 @@ + #include "gdb_string.h" + #include "infcall.h" + #include "dummy-frame.h" ++#include "cp-abi.h" + + /* NOTE: cagney/2003-04-16: What's the future of this code? + +@@ -297,8 +298,8 @@ call_function_by_hand (struct value *fun + { + CORE_ADDR sp; + CORE_ADDR dummy_addr; +- struct type *value_type; +- unsigned char struct_return; ++ struct type *value_type, *target_value_type; ++ unsigned char struct_return = 0, cp_struct_return = 0; + CORE_ADDR struct_addr = 0; + struct regcache *retbuf; + struct cleanup *retbuf_cleanup; +@@ -312,6 +313,7 @@ call_function_by_hand (struct value *fun + struct regcache *caller_regcache; + struct cleanup *caller_regcache_cleanup; + struct frame_id dummy_id; ++ struct cleanup *args_cleanup; + + if (!target_has_execution) + noprocess (); +@@ -410,10 +412,31 @@ call_function_by_hand (struct value *fun + using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b)); + } + +- /* Are we returning a value using a structure return or a normal +- value return? */ ++ /* Are we returning a value using a structure return (passing a ++ hidden argument pointing to storage) or a normal value return? ++ There are two cases: C++ ABI mandated structure return and ++ target ABI structure return. The variable STRUCT_RETURN only ++ describes the latter. The C++ version is handled by passing ++ the return location as the first parameter to the function, ++ even preceding "this". This is different from the target ++ ABI version, which is target-specific; for instance, on ia64 ++ the first argument is passed in out0 but the hidden structure ++ return pointer would normally be passed in r8. */ + +- struct_return = using_struct_return (value_type, using_gcc); ++ if (current_language->la_language == language_cplus ++ && cp_pass_by_reference (value_type)) ++ { ++ cp_struct_return = 1; ++ ++ /* Tell the target specific argument pushing routine not to ++ expect a value. */ ++ target_value_type = builtin_type_void; ++ } ++ else ++ { ++ struct_return = using_struct_return (value_type, using_gcc); ++ target_value_type = value_type; ++ } + + /* Determine the location of the breakpoint (and possibly other + stuff) that the called function will return to. The SPARC, for a +@@ -432,7 +455,7 @@ call_function_by_hand (struct value *fun + if (INNER_THAN (1, 2)) + { + sp = push_dummy_code (current_gdbarch, sp, funaddr, +- using_gcc, args, nargs, value_type, ++ using_gcc, args, nargs, target_value_type, + &real_pc, &bp_addr); + dummy_addr = sp; + } +@@ -440,7 +463,7 @@ call_function_by_hand (struct value *fun + { + dummy_addr = sp; + sp = push_dummy_code (current_gdbarch, sp, funaddr, +- using_gcc, args, nargs, value_type, ++ using_gcc, args, nargs, target_value_type, + &real_pc, &bp_addr); + } + break; +@@ -507,9 +530,15 @@ call_function_by_hand (struct value *fun + param_type = TYPE_FIELD_TYPE (ftype, i); + else + param_type = NULL; +- ++ + args[i] = value_arg_coerce (args[i], param_type, prototyped); + ++ /* FIXME: Is current_language the right language? */ ++ if (current_language->la_language == language_cplus ++ && param_type != NULL ++ && cp_pass_by_reference (param_type)) ++ args[i] = value_addr (args[i]); ++ + /* elz: this code is to handle the case in which the function + to be called has a pointer to function as parameter and the + corresponding actual argument is the address of a function +@@ -607,7 +636,7 @@ You must use a pointer to function type + stack, if necessary. Make certain that the value is correctly + aligned. */ + +- if (struct_return) ++ if (struct_return || cp_struct_return) + { + int len = TYPE_LENGTH (value_type); + if (INNER_THAN (1, 2)) +@@ -632,6 +661,22 @@ You must use a pointer to function type + } + } + ++ if (cp_struct_return) ++ { ++ struct value **new_args; ++ ++ /* Add the new argument to the front of the argument list. */ ++ new_args = xmalloc (sizeof (struct value *) * (nargs + 1)); ++ new_args[0] = value_from_pointer (lookup_pointer_type (value_type), ++ struct_addr); ++ memcpy (&new_args[1], &args[0], sizeof (struct value *) * nargs); ++ args = new_args; ++ nargs++; ++ args_cleanup = make_cleanup (xfree, args); ++ } ++ else ++ args_cleanup = make_cleanup (null_cleanup, NULL); ++ + /* Create the dummy stack frame. Pass in the call dummy address as, + presumably, the ABI code knows where, in the call dummy, the + return address should be pointed. */ +@@ -649,6 +694,8 @@ You must use a pointer to function type + else + error ("This target does not support function calls"); + ++ do_cleanups (args_cleanup); ++ + /* Set up a frame ID for the dummy frame so we can pass it to + set_momentary_breakpoint. We need to give the breakpoint a frame + ID so that the breakpoint code can correctly re-identify the +@@ -839,11 +886,7 @@ the function call).", name); + /* Figure out the value returned by the function, return that. */ + { + struct value *retval; +- if (TYPE_CODE (value_type) == TYPE_CODE_VOID) +- /* If the function returns void, don't bother fetching the +- return value. */ +- retval = allocate_value (value_type); +- else if (struct_return) ++ if (struct_return || cp_struct_return) + /* NOTE: cagney/2003-09-27: This assumes that PUSH_DUMMY_CALL + has correctly stored STRUCT_ADDR in the target. In the past + that hasn't been the case, the old MIPS PUSH_ARGUMENTS +@@ -853,6 +896,10 @@ the function call).", name); + "struct return convention", check that PUSH_DUMMY_CALL isn't + playing tricks. */ + retval = value_at (value_type, struct_addr, NULL); ++ else if (TYPE_CODE (value_type) == TYPE_CODE_VOID) ++ /* If the function returns void, don't bother fetching the ++ return value. */ ++ retval = allocate_value (value_type); + else + { + /* This code only handles "register convention". */ +Index: gdb-6.3/gdb/cp-abi.h +=================================================================== +--- gdb-6.3.orig/gdb/cp-abi.h 2003-04-12 13:41:25.000000000 -0400 ++++ gdb-6.3/gdb/cp-abi.h 2004-11-10 12:30:07.000000000 -0500 +@@ -1,7 +1,7 @@ + /* Abstraction of various C++ ABI's we support, and the info we need + to get from them. + Contributed by Daniel Berlin +- Copyright 2001 Free Software Foundation, Inc. ++ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This file is part of GDB. + +@@ -145,6 +145,10 @@ extern struct type *value_rtti_type (str + extern int baseclass_offset (struct type *type, int index, char *valaddr, + CORE_ADDR address); + ++/* Return non-zero if an argument of type TYPE should be passed by reference ++ instead of value. */ ++extern int cp_pass_by_reference (struct type *type); ++ + struct cp_abi_ops + { + const char *shortname; +@@ -162,6 +166,7 @@ struct cp_abi_ops + int *using_enc); + int (*baseclass_offset) (struct type *type, int index, char *valaddr, + CORE_ADDR address); ++ int (*pass_by_reference) (struct type *type); + }; + + +Index: gdb-6.3/gdb/cp-abi.c +=================================================================== +--- gdb-6.3.orig/gdb/cp-abi.c 2003-11-26 17:04:00.000000000 -0500 ++++ gdb-6.3/gdb/cp-abi.c 2004-11-10 12:30:07.000000000 -0500 +@@ -1,5 +1,5 @@ + /* Generic code for supporting multiple C++ ABI's +- Copyright 2001, 2002, 2003 Free Software Foundation, Inc. ++ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This file is part of GDB. + +@@ -94,6 +94,14 @@ value_rtti_type (struct value *v, int *f + return (*current_cp_abi.rtti_type) (v, full, top, using_enc); + } + ++int ++cp_pass_by_reference (struct type *type) ++{ ++ if ((current_cp_abi.pass_by_reference) == NULL) ++ return 0; ++ return (*current_cp_abi.pass_by_reference) (type); ++} ++ + /* Set the current C++ ABI to SHORT_NAME. */ + + static int +Index: gdb-6.3/gdb/gnu-v3-abi.c +=================================================================== +--- gdb-6.3.orig/gdb/gnu-v3-abi.c 2004-03-15 15:38:08.000000000 -0500 ++++ gdb-6.3/gdb/gnu-v3-abi.c 2004-11-10 12:30:07.000000000 -0500 +@@ -1,7 +1,7 @@ + /* Abstraction of GNU v3 abi. + Contributed by Jim Blandy + +- Copyright 2001, 2002, 2003 Free Software Foundation, Inc. ++ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This file is part of GDB. + +@@ -419,6 +419,84 @@ gnuv3_baseclass_offset (struct type *typ + return base_offset; + } + ++/* Return nonzero if a type should be passed by reference. ++ ++ The rule in the v3 ABI document comes from section 3.1.1. If the ++ type has a non-trivial copy constructor or destructor, then the ++ caller must make a copy (by calling the copy constructor if there ++ is one or perform the copy itself otherwise), pass the address of ++ the copy, and then destroy the temporary (if necessary). ++ ++ For return values with non-trivial copy constructors or ++ destructors, space will be allocated in the caller, and a pointer ++ will be passed as the first argument (preceding "this"). ++ ++ We don't have a bulletproof mechanism for determining whether a ++ constructor or destructor is trivial. For GCC and DWARF2 debug ++ information, we can check the artificial flag. ++ ++ We don't do anything with the constructors or destructors yet, ++ but we have to get the argument passing right anyway. */ ++static int ++gnuv3_pass_by_reference (struct type *type) ++{ ++ int fieldnum, fieldelem, basenum; ++ ++ CHECK_TYPEDEF (type); ++ ++ /* We're only interested in things that can have methods. */ ++ if (TYPE_CODE (type) != TYPE_CODE_STRUCT ++ && TYPE_CODE (type) != TYPE_CODE_CLASS ++ && TYPE_CODE (type) != TYPE_CODE_UNION) ++ return 0; ++ ++ for (fieldnum = 0; fieldnum < TYPE_NFN_FIELDS (type); fieldnum++) ++ for (fieldelem = 0; fieldelem < TYPE_FN_FIELDLIST_LENGTH (type, fieldnum); ++ fieldelem++) ++ { ++ struct fn_field *fn = TYPE_FN_FIELDLIST1 (type, fieldnum); ++ char *name = TYPE_FN_FIELDLIST_NAME (type, fieldnum); ++ struct type *fieldtype = TYPE_FN_FIELD_TYPE (fn, fieldelem); ++ ++ /* If this function is marked as artificial, it is compiler-generated, ++ and we assume it is trivial. */ ++ if (TYPE_FN_FIELD_ARTIFICIAL (fn, fieldelem)) ++ continue; ++ ++ /* If we've found a destructor, we must pass this by reference. */ ++ if (name[0] == '~') ++ return 1; ++ ++ /* If the mangled name of this method doesn't indicate that it ++ is a constructor, we're not interested. ++ ++ FIXME drow/2004-05-27: We could do this using the name of ++ the method and the name of the class instead of dealing ++ with the mangled name. We don't have a convenient function ++ to strip off both leading scope qualifiers and trailing ++ template arguments yet. */ ++ if (!is_constructor_name (TYPE_FN_FIELD_PHYSNAME (fn, fieldelem))) ++ continue; ++ ++ /* If this method takes two arguments, and the second argument is ++ a reference to this class, then it is a copy constructor. */ ++ if (TYPE_NFIELDS (fieldtype) == 2 ++ && TYPE_CODE (TYPE_FIELD_TYPE (fieldtype, 1)) == TYPE_CODE_REF ++ && check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (fieldtype, 1))) == type) ++ return 1; ++ } ++ ++ /* Even if all the constructors and destructors were artificial, one ++ of them may have invoked a non-artificial constructor or ++ destructor in a base class. If any base class needs to be passed ++ by reference, so does this class. */ ++ for (basenum = 0; basenum < TYPE_N_BASECLASSES (type); basenum++) ++ if (gnuv3_pass_by_reference (TYPE_BASECLASS (type, basenum))) ++ return 1; ++ ++ return 0; ++} ++ + static void + init_gnuv3_ops (void) + { +@@ -434,6 +512,7 @@ init_gnuv3_ops (void) + gnu_v3_abi_ops.rtti_type = gnuv3_rtti_type; + gnu_v3_abi_ops.virtual_fn_field = gnuv3_virtual_fn_field; + gnu_v3_abi_ops.baseclass_offset = gnuv3_baseclass_offset; ++ gnu_v3_abi_ops.pass_by_reference = gnuv3_pass_by_reference; + } + + extern initialize_file_ftype _initialize_gnu_v3_abi; /* -Wmissing-prototypes */ +Index: gdb-6.3/gdb/hpacc-abi.c +=================================================================== +--- gdb-6.3.orig/gdb/hpacc-abi.c 2003-06-08 14:27:13.000000000 -0400 ++++ gdb-6.3/gdb/hpacc-abi.c 2004-11-10 12:30:07.000000000 -0500 +@@ -3,7 +3,7 @@ + Most of the real code is from HP, i've just fiddled it to fit in + the C++ ABI abstraction framework. + +- Copyright 2001 Free Software Foundation, Inc. ++ Copyright 2001, 2002, 2003 Free Software Foundation, Inc. + + This file is part of GDB. + +Index: gdb-6.3/gdb/Makefile.in +=================================================================== +--- gdb-6.3.orig/gdb/Makefile.in 2004-11-10 12:30:06.000000000 -0500 ++++ gdb-6.3/gdb/Makefile.in 2004-11-10 12:30:07.000000000 -0500 +@@ -2073,7 +2073,7 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inf + infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \ + $(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \ + $(objfiles_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h) \ +- $(dummy_frame_h) ++ $(dummy_frame_h) $(cp_abi_h) + inf-child.o: inf-child.c $(defs_h) $(regcache_h) $(memattr_h) $(symtab_h) \ + $(target_h) $(inferior_h) $(gdb_string_h) + infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ +Index: gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.exp 2004-11-11 09:48:00.498518899 -0500 +@@ -0,0 +1,38 @@ ++# This testcase is part of GDB, the GNU debugger. ++ ++# Copyright 2004 Free Software Foundation, Inc. ++ ++# This program 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 2 of the License, or ++# (at your option) any later version. ++# ++# This program 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 this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# Check that GDB can call C++ functions whose parameters have ++# object type, but are passed by reference. ++ ++set testfile "pass-by-ref" ++set srcfile ${testfile}.cc ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] then { ++ return -1 ++} ++ ++gdb_test "print foo (global_obj)" " = 3" "call function" +Index: gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.3/gdb/testsuite/gdb.cp/pass-by-ref.cc 2004-11-11 09:44:17.815014667 -0500 +@@ -0,0 +1,57 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2004 Free Software Foundation, Inc. ++ ++ This program 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 2 of the License, or ++ (at your option) any later version. ++ ++ This program 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 this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++ USA. */ ++ ++class Obj { ++public: ++ Obj (); ++ Obj (const Obj &); ++ ~Obj (); ++ int var[2]; ++}; ++ ++int foo (Obj arg) ++{ ++ return arg.var[0] + arg.var[1]; ++} ++ ++Obj::Obj () ++{ ++ var[0] = 1; ++ var[1] = 2; ++} ++ ++Obj::Obj (const Obj &obj) ++{ ++ var[0] = obj.var[0]; ++ var[1] = obj.var[1]; ++} ++ ++Obj::~Obj () ++{ ++ ++} ++ ++Obj global_obj; ++ ++int ++main () ++{ ++ int bar = foo (global_obj); ++ return bar; ++} --- gdb-6.3.orig/debian/patches/static-thread-db.patch +++ gdb-6.3/debian/patches/static-thread-db.patch @@ -0,0 +1,156 @@ +Status: submitted similar patch 2004-12-08 + +This patch cleans up the initialization of thread_db. It works for static +binaries now. The vsyscall patches hide this problem, since new static +binaries will load the vsyscall DSO and then trigger thread_db; but +this is still a good cleanup. + +Index: gdb-6.3/gdb/thread-db.c +=================================================================== +--- gdb-6.3.orig/gdb/thread-db.c 2004-10-08 16:29:56.000000000 -0400 ++++ gdb-6.3/gdb/thread-db.c 2004-11-10 00:19:30.626530413 -0500 +@@ -34,6 +34,7 @@ + #include "target.h" + #include "regcache.h" + #include "solib-svr4.h" ++#include "observer.h" + + #ifdef HAVE_GNU_LIBC_VERSION_H + #include +@@ -627,59 +628,49 @@ check_thread_signals (void) + #endif + } + ++/* Check whether thread_db is usable. This function is called when ++ an inferior is created (or otherwise acquired, e.g. attached to) ++ and when new shared libraries are loaded into a running process. */ ++ + static void +-thread_db_new_objfile (struct objfile *objfile) ++check_for_thread_db (void) + { + td_err_e err; ++ static int already_loaded; + + /* First time through, report that libthread_db was successfuly + loaded. Can't print this in in thread_db_load as, at that stage, +- the interpreter and it's console haven't started. The real +- problem here is that libthread_db is loaded too early - it should +- only be loaded when there is a program to debug. */ +- { +- static int dejavu; +- if (!dejavu) +- { +- Dl_info info; +- const char *library = NULL; +- /* Try dladdr. */ +- if (dladdr ((*td_ta_new_p), &info) != 0) +- library = info.dli_fname; +- /* Try dlinfo? */ +- if (library == NULL) +- /* Paranoid - don't let a NULL path slip through. */ +- library = LIBTHREAD_DB_SO; +- printf_unfiltered ("Using host libthread_db library \"%s\".\n", +- library); +- dejavu = 1; +- } +- } ++ the interpreter and it's console haven't started. */ + +- /* Don't attempt to use thread_db on targets which can not run +- (core files). */ +- if (objfile == NULL || !target_has_execution) ++ if (!already_loaded) + { +- /* All symbols have been discarded. If the thread_db target is +- active, deactivate it now. */ +- if (using_thread_db) +- { +- gdb_assert (proc_handle.pid == 0); +- unpush_target (&thread_db_ops); +- using_thread_db = 0; +- } ++ Dl_info info; ++ const char *library = NULL; ++ if (dladdr ((*td_ta_new_p), &info) != 0) ++ library = info.dli_fname; ++ ++ /* Try dlinfo? */ + +- goto quit; ++ if (library == NULL) ++ /* Paranoid - don't let a NULL path slip through. */ ++ library = LIBTHREAD_DB_SO; ++ ++ printf_unfiltered ("Using host libthread_db library \"%s\".\n", ++ library); ++ already_loaded = 1; + } + + if (using_thread_db) + /* Nothing to do. The thread library was already detected and the + target vector was already activated. */ +- goto quit; ++ return; ++ ++ /* Don't attempt to use thread_db on targets which can not run ++ (executables not running yet, core files) for now. */ ++ if (!target_has_execution) ++ return; + +- /* Initialize the structure that identifies the child process. Note +- that at this point there is no guarantee that we actually have a +- child process. */ ++ /* Initialize the structure that identifies the child process. */ + proc_handle.pid = GET_PID (inferior_ptid); + + /* Now attempt to open a connection to the thread library. */ +@@ -706,12 +697,24 @@ thread_db_new_objfile (struct objfile *o + thread_db_err_str (err)); + break; + } ++} ++ ++static void ++thread_db_new_objfile (struct objfile *objfile) ++{ ++ if (objfile != NULL) ++ check_for_thread_db (); + +-quit: + if (target_new_objfile_chain) + target_new_objfile_chain (objfile); + } + ++static void ++check_for_thread_db_observer (struct target_ops *target, int from_tty) ++{ ++ check_for_thread_db (); ++} ++ + /* Attach to a new thread. This function is called when we receive a + TD_CREATE event or when we iterate over all threads and find one + that wasn't already in our list. */ +@@ -1366,5 +1369,8 @@ _initialize_thread_db (void) + /* Add ourselves to objfile event chain. */ + target_new_objfile_chain = deprecated_target_new_objfile_hook; + deprecated_target_new_objfile_hook = thread_db_new_objfile; ++ ++ /* Register ourselves for the new inferior observer. */ ++ observer_attach_inferior_created (check_for_thread_db_observer); + } + } +Index: gdb-6.3/gdb/Makefile.in +=================================================================== +--- gdb-6.3.orig/gdb/Makefile.in 2004-11-09 23:04:57.000000000 -0500 ++++ gdb-6.3/gdb/Makefile.in 2004-11-10 00:19:26.440347022 -0500 +@@ -2626,7 +2626,8 @@ thread.o: thread.c $(defs_h) $(symtab_h) + $(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) $(ui_out_h) + thread-db.o: thread-db.c $(defs_h) $(gdb_assert_h) $(gdb_proc_service_h) \ + $(gdb_thread_db_h) $(bfd_h) $(gdbthread_h) $(inferior_h) \ +- $(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) $(solib_svr4_h) ++ $(symfile_h) $(objfiles_h) $(target_h) $(regcache_h) $(solib_svr4_h) \ ++ $(observer_h) + top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \ + $(cli_script_h) $(cli_setshow_h) $(cli_decode_h) $(symtab_h) \ + $(inferior_h) $(target_h) $(breakpoint_h) $(gdbtypes_h) \ --- gdb-6.3.orig/debian/patches/dwarf2-frame-signal-unwinder.patch +++ gdb-6.3/debian/patches/dwarf2-frame-signal-unwinder.patch @@ -0,0 +1,120 @@ +Status: Checked in to HEAD after 6.3. + +2004-11-07 Daniel Jacobowitz + + * dwarf2-frame.c (struct dwarf2_frame_ops): Add signal_frame_p. + (dwarf2_frame_set_signal_frame_p, dwarf2_frame_signal_frame_p) + (dwarf2_signal_frame_unwind): New. + (dwarf2_frame_sniffer): Use dwarf2_frame_signal_frame_p. + * dwarf2-frame.h (dwarf2_frame_set_signal_frame_p): New prototype. + +Index: src/gdb/dwarf2-frame.c +=================================================================== +RCS file: /big/fsf/rsync/src-cvs/src/gdb/dwarf2-frame.c,v +retrieving revision 1.41 +diff -u -p -r1.41 dwarf2-frame.c +--- src/gdb/dwarf2-frame.c 4 Nov 2004 21:15:15 -0000 1.41 ++++ src/gdb/dwarf2-frame.c 7 Nov 2004 17:41:58 -0000 +@@ -471,6 +471,10 @@ struct dwarf2_frame_ops + { + /* Pre-initialize the register state REG for register REGNUM. */ + void (*init_reg) (struct gdbarch *, int, struct dwarf2_frame_state_reg *); ++ ++ /* Check whether the frame preceding NEXT_FRAME will be a signal ++ trampoline. */ ++ int (*signal_frame_p) (struct gdbarch *, struct frame_info *); + }; + + /* Default architecture-specific register state initialization +@@ -547,6 +551,33 @@ dwarf2_frame_init_reg (struct gdbarch *g + + ops->init_reg (gdbarch, regnum, reg); + } ++ ++/* Set the architecture-specific signal trampoline recognition ++ function for GDBARCH to SIGNAL_FRAME_P. */ ++ ++void ++dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch, ++ int (*signal_frame_p) (struct gdbarch *, ++ struct frame_info *)) ++{ ++ struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data); ++ ++ ops->signal_frame_p = signal_frame_p; ++} ++ ++/* Query the architecture-specific signal frame recognizer for ++ NEXT_FRAME. */ ++ ++static int ++dwarf2_frame_signal_frame_p (struct gdbarch *gdbarch, ++ struct frame_info *next_frame) ++{ ++ struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data); ++ ++ if (ops->signal_frame_p == NULL) ++ return 0; ++ return ops->signal_frame_p (gdbarch, next_frame); ++} + + + struct dwarf2_frame_cache +@@ -841,6 +872,13 @@ static const struct frame_unwind dwarf2_ + dwarf2_frame_prev_register + }; + ++static const struct frame_unwind dwarf2_signal_frame_unwind = ++{ ++ SIGTRAMP_FRAME, ++ dwarf2_frame_this_id, ++ dwarf2_frame_prev_register ++}; ++ + const struct frame_unwind * + dwarf2_frame_sniffer (struct frame_info *next_frame) + { +@@ -848,10 +886,18 @@ dwarf2_frame_sniffer (struct frame_info + function. frame_pc_unwind(), for a no-return next function, can + end up returning something past the end of this function's body. */ + CORE_ADDR block_addr = frame_unwind_address_in_block (next_frame); +- if (dwarf2_frame_find_fde (&block_addr)) +- return &dwarf2_frame_unwind; ++ if (!dwarf2_frame_find_fde (&block_addr)) ++ return NULL; + +- return NULL; ++ /* On some targets, signal trampolines may have unwind information. ++ We need to recognize them so that we set the frame type ++ correctly. */ ++ ++ if (dwarf2_frame_signal_frame_p (get_frame_arch (next_frame), ++ next_frame)) ++ return &dwarf2_signal_frame_unwind; ++ ++ return &dwarf2_frame_unwind; + } + + +Index: src/gdb/dwarf2-frame.h +=================================================================== +RCS file: /big/fsf/rsync/src-cvs/src/gdb/dwarf2-frame.h,v +retrieving revision 1.6 +diff -u -p -r1.6 dwarf2-frame.h +--- src/gdb/dwarf2-frame.h 28 Feb 2004 16:59:32 -0000 1.6 ++++ src/gdb/dwarf2-frame.h 7 Nov 2004 17:40:41 -0000 +@@ -79,6 +79,14 @@ extern void dwarf2_frame_set_init_reg (s + void (*init_reg) (struct gdbarch *, int, + struct dwarf2_frame_state_reg *)); + ++/* Set the architecture-specific signal trampoline recognition ++ function for GDBARCH to SIGNAL_FRAME_P. */ ++ ++extern void ++ dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch, ++ int (*signal_frame_p) (struct gdbarch *, ++ struct frame_info *)); ++ + /* Return the frame unwind methods for the function that contains PC, + or NULL if it can't be handled by DWARF CFI frame unwinder. */ + --- gdb-6.3.orig/debian/patches/vsyscall-gdb-support.patch +++ gdb-6.3/debian/patches/vsyscall-gdb-support.patch @@ -0,0 +1,245 @@ +Status: Checked in to HEAD after 6.3. + +2004-11-07 Andrew Cagney + Daniel Jacobowitz + Roland McGrath + + * Makefile.in (symfile-mem.o): Update dependencies. + * i386-linux-tdep.c (i386_linux_dwarf_signal_frame_p): New. + (i386_linux_init_abi): Call dwarf2_frame_set_signal_frame_p. + * inf-ptrace.c (inf_ptrace_attach): Call + observer_notify_inferior_created. + * inftarg.c (child_attach): Likewise. + * symfile-mem.c: Include "observer.h", "auxv.h", and "elf/common.h". + (symbol_file_add_from_memory): Take NAME argument. Use it for + the new BFD's filename. + (add_symbol_file_from_memory_command): Update call to + symbol_file_add_from_memory. + (struct symbol_file_add_from_memory_args, add_vsyscall_page) + (symbol_file_add_from_memory_wrapper): New. + (_initialize_symfile_mem): Register add_vsyscall_page as an + inferior_created observer. + +Index: gdb-6.3/gdb/i386-linux-tdep.c +=================================================================== +--- gdb-6.3.orig/gdb/i386-linux-tdep.c 2004-08-06 16:58:28.000000000 -0400 ++++ gdb-6.3/gdb/i386-linux-tdep.c 2004-11-10 00:55:06.669398770 -0500 +@@ -27,6 +27,7 @@ + #include "inferior.h" + #include "osabi.h" + #include "reggroups.h" ++#include "dwarf2-frame.h" + + #include "gdb_string.h" + +@@ -244,6 +245,27 @@ i386_linux_sigtramp_p (struct frame_info + || strcmp ("__restore_rt", name) == 0); + } + ++/* Return one if the unwound PC from NEXT_FRAME is in a signal trampoline ++ which may have DWARF-2 CFI. */ ++ ++static int ++i386_linux_dwarf_signal_frame_p (struct gdbarch *gdbarch, ++ struct frame_info *next_frame) ++{ ++ CORE_ADDR pc = frame_pc_unwind (next_frame); ++ char *name; ++ ++ find_pc_partial_function (pc, &name, NULL, NULL); ++ ++ /* If a vsyscall DSO is in use, the signal trampolines may have these ++ names. */ ++ if (name && (strcmp (name, "__kernel_sigreturn") == 0 ++ || strcmp (name, "__kernel_rt_sigreturn") == 0)) ++ return 1; ++ ++ return 0; ++} ++ + /* Offset to struct sigcontext in ucontext, from . */ + #define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20 + +@@ -414,6 +436,8 @@ i386_linux_init_abi (struct gdbarch_info + + /* GNU/Linux uses the dynamic linker included in the GNU C Library. */ + set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver); ++ ++ dwarf2_frame_set_signal_frame_p (gdbarch, i386_linux_dwarf_signal_frame_p); + } + + /* Provide a prototype to silence -Wmissing-prototypes. */ +Index: gdb-6.3/gdb/inf-ptrace.c +=================================================================== +--- gdb-6.3.orig/gdb/inf-ptrace.c 2004-10-15 09:29:33.000000000 -0400 ++++ gdb-6.3/gdb/inf-ptrace.c 2004-11-10 00:53:43.697615843 -0500 +@@ -220,6 +220,10 @@ inf_ptrace_attach (char *args, int from_ + + inferior_ptid = pid_to_ptid (pid); + push_target (ptrace_ops_hack); ++ ++ /* Do this first, before anything has had a chance to query the ++ inferior's symbol table or similar. */ ++ observer_notify_inferior_created (¤t_target, from_tty); + } + + static void +Index: gdb-6.3/gdb/inftarg.c +=================================================================== +--- gdb-6.3.orig/gdb/inftarg.c 2004-10-08 16:29:47.000000000 -0400 ++++ gdb-6.3/gdb/inftarg.c 2004-11-10 00:53:43.711613107 -0500 +@@ -211,6 +211,10 @@ child_attach (char *args, int from_tty) + + inferior_ptid = pid_to_ptid (pid); + push_target (&deprecated_child_ops); ++ ++ /* Do this first, before anything has had a chance to query the ++ inferior's symbol table or similar. */ ++ observer_notify_inferior_created (¤t_target, from_tty); + } + + #if !defined(CHILD_POST_ATTACH) +Index: gdb-6.3/gdb/symfile-mem.c +=================================================================== +--- gdb-6.3.orig/gdb/symfile-mem.c 2004-07-17 10:24:07.000000000 -0400 ++++ gdb-6.3/gdb/symfile-mem.c 2004-11-10 00:53:43.722610958 -0500 +@@ -52,13 +52,19 @@ + #include "target.h" + #include "value.h" + #include "symfile.h" ++#include "observer.h" ++#include "auxv.h" ++#include "elf/common.h" + + + /* Read inferior memory at ADDR to find the header of a loaded object file + and read its in-core symbols out of inferior memory. TEMPL is a bfd +- representing the target's format. */ ++ representing the target's format. NAME is the name to use for this ++ symbol file in messages; it can be NULL or a malloc-allocated string ++ which will be attached to the BFD. */ + static struct objfile * +-symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, int from_tty) ++symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name, ++ int from_tty) + { + struct objfile *objf; + struct bfd *nbfd; +@@ -75,7 +81,10 @@ symbol_file_add_from_memory (struct bfd + if (nbfd == NULL) + error ("Failed to read a valid object file image from memory."); + +- nbfd->filename = xstrdup ("shared object read from target memory"); ++ if (name == NULL) ++ nbfd->filename = xstrdup ("shared object read from target memory"); ++ else ++ nbfd->filename = name; + + if (!bfd_check_format (nbfd, bfd_object)) + { +@@ -129,7 +138,73 @@ add_symbol_file_from_memory_command (cha + error ("\ + Must use symbol-file or exec-file before add-symbol-file-from-memory."); + +- symbol_file_add_from_memory (templ, addr, from_tty); ++ symbol_file_add_from_memory (templ, addr, NULL, from_tty); ++} ++ ++/* Arguments for symbol_file_add_from_memory_wrapper. */ ++ ++struct symbol_file_add_from_memory_args ++{ ++ struct bfd *bfd; ++ CORE_ADDR sysinfo_ehdr; ++ char *name; ++ int from_tty; ++}; ++ ++/* Wrapper function for symbol_file_add_from_memory, for ++ catch_exceptions. */ ++ ++static int ++symbol_file_add_from_memory_wrapper (struct ui_out *uiout, void *data) ++{ ++ struct symbol_file_add_from_memory_args *args = data; ++ ++ symbol_file_add_from_memory (args->bfd, args->sysinfo_ehdr, args->name, ++ args->from_tty); ++ return 0; ++} ++ ++/* Try to add the symbols for the vsyscall page, if there is one. This function ++ is called via the inferior_created observer. */ ++ ++static void ++add_vsyscall_page (struct target_ops *target, int from_tty) ++{ ++ CORE_ADDR sysinfo_ehdr; ++ ++ if (target_auxv_search (target, AT_SYSINFO_EHDR, &sysinfo_ehdr) > 0 ++ && sysinfo_ehdr != (CORE_ADDR) 0) ++ { ++ struct bfd *bfd; ++ struct symbol_file_add_from_memory_args args; ++ ++ if (core_bfd != NULL) ++ bfd = core_bfd; ++ else if (exec_bfd != NULL) ++ bfd = exec_bfd; ++ else ++ /* FIXME: cagney/2004-05-06: Should not require an existing ++ BFD when trying to create a run-time BFD of the VSYSCALL ++ page in the inferior. Unfortunately that's the current ++ interface so for the moment bail. Introducing a ++ ``bfd_runtime'' (a BFD created using the loaded image) file ++ format should fix this. */ ++ { ++ warning ("could not load vsyscall page because no executable was specified"); ++ warning ("try using the \"file\" command first"); ++ return; ++ } ++ args.bfd = bfd; ++ args.sysinfo_ehdr = sysinfo_ehdr; ++ xasprintf (&args.name, "system-supplied DSO at 0x%s", ++ paddr_nz (sysinfo_ehdr)); ++ /* Pass zero for FROM_TTY, because the action of loading the ++ vsyscall DSO was not triggered by the user, even if the user ++ typed "run" at the TTY. */ ++ args.from_tty = 0; ++ catch_exceptions (uiout, symbol_file_add_from_memory_wrapper, ++ &args, NULL, RETURN_MASK_ALL); ++ } + } + + +@@ -143,4 +218,7 @@ Load the symbols out of memory from a dy + Give an expression for the address of the file's shared object file header.", + &cmdlist); + ++ /* Want to know of each new inferior so that its vsyscall info can ++ be extracted. */ ++ observer_attach_inferior_created (add_vsyscall_page); + } +Index: gdb-6.3/gdb/Makefile.in +=================================================================== +--- gdb-6.3.orig/gdb/Makefile.in 2004-11-10 00:29:00.000000000 -0500 ++++ gdb-6.3/gdb/Makefile.in 2004-11-10 00:54:47.728100986 -0500 +@@ -2020,7 +2020,7 @@ i386-linux-nat.o: i386-linux-nat.c $(def + i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ + $(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \ + $(gdb_string_h) $(i386_tdep_h) $(i386_linux_tdep_h) $(glibc_tdep_h) \ +- $(solib_svr4_h) ++ $(solib_svr4_h) $(dwarf2_frame_h) + i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \ + $(regcache_h) $(target_h) $(osabi_h) $(i386_tdep_h) + i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h) +@@ -2606,7 +2606,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink + $(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \ + $(gdb_string_h) $(gdb_stat_h) + symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \ +- $(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h) ++ $(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h) \ ++ $(observer_h) $(auxv_h) $(elf_common_h) + symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \ + $(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \ + $(gdb_obstack_h) $(language_h) $(bcache_h) $(block_h) $(gdb_regex_h) \ --- gdb-6.3.orig/debian/patches/vsyscall-bfd-close-result.patch +++ gdb-6.3/debian/patches/vsyscall-bfd-close-result.patch @@ -0,0 +1,20 @@ +2004-10-24 Daniel Jacobowitz + + * opncls.c (bfd_close): Return TRUE for BFD_IN_MEMORY. + +Index: src/bfd/opncls.c +=================================================================== +RCS file: /big/fsf/rsync/src-cvs/src/bfd/opncls.c,v +retrieving revision 1.25 +diff -u -p -r1.25 opncls.c +--- src/bfd/opncls.c 10 Oct 2004 13:58:05 -0000 1.25 ++++ src/bfd/opncls.c 24 Oct 2004 17:52:53 -0000 +@@ -598,7 +598,7 @@ bfd_close (bfd *abfd) + if (!(abfd->flags & BFD_IN_MEMORY)) + ret = abfd->iovec->bclose (abfd); + else +- ret = 0; ++ ret = TRUE; + + /* If the file was open for writing and is now executable, + make it so. */ --- gdb-6.3.orig/debian/patches/vfork-done-spelling.patch +++ gdb-6.3/debian/patches/vfork-done-spelling.patch @@ -0,0 +1,31 @@ +Index: gdb-6.3/gdb/linux-nat.c +=================================================================== +--- gdb-6.3.orig/gdb/linux-nat.c 2004-11-14 00:36:41.000000000 -0500 ++++ gdb-6.3/gdb/linux-nat.c 2004-11-15 11:51:43.954161476 -0500 +@@ -69,7 +69,7 @@ + #define PTRACE_EVENT_VFORK 2 + #define PTRACE_EVENT_CLONE 3 + #define PTRACE_EVENT_EXEC 4 +-#define PTRACE_EVENT_VFORKDONE 5 ++#define PTRACE_EVENT_VFORK_DONE 5 + #define PTRACE_EVENT_EXIT 6 + + #endif /* PTRACE_EVENT_FORK */ +@@ -362,7 +362,7 @@ child_follow_fork (int follow_child) + + ptrace (PTRACE_CONT, parent_pid, 0, 0); + waitpid (parent_pid, &status, __WALL); +- if ((status >> 16) != PTRACE_EVENT_VFORKDONE) ++ if ((status >> 16) != PTRACE_EVENT_VFORK_DONE) + warning ("Unexpected waitpid result %06x when waiting for " + "vfork-done", status); + } +@@ -434,7 +434,7 @@ child_follow_fork (int follow_child) + generally not encounter vfork (vfork is defined to fork + in libpthread.so). + +- The holding part is very easy if we have VFORKDONE events; ++ The holding part is very easy if we have VFORK_DONE events; + but keeping track of both processes is beyond GDB at the + moment. So we don't expose the parent to the rest of GDB. + Instead we quietly hold onto it until such time as we can --- gdb-6.3.orig/debian/patches/gdbserver-rdynamic.patch +++ gdb-6.3/debian/patches/gdbserver-rdynamic.patch @@ -0,0 +1,675 @@ +Status: Commited to GDB after 6.3. + +Index: gdb-6.3/gdb/gdbserver/acinclude.m4 +=================================================================== +--- gdb-6.3.orig/gdb/gdbserver/acinclude.m4 2002-06-11 13:32:39.000000000 -0400 ++++ gdb-6.3/gdb/gdbserver/acinclude.m4 2004-12-07 17:19:31.115089905 -0500 +@@ -13,6 +13,7 @@ AC_DEFUN([SRV_CHECK_THREAD_DB], + void ps_lsetregs() {} + void ps_lgetfpregs() {} + void ps_lsetfpregs() {} ++ void ps_get_thread_area() {} + void ps_getpid() {}], + [td_ta_new();], + [srv_cv_thread_db="-lthread_db"], +@@ -32,10 +33,11 @@ AC_DEFUN([SRV_CHECK_THREAD_DB], + void ps_lsetregs() {} + void ps_lgetfpregs() {} + void ps_lsetfpregs() {} ++ void ps_get_thread_area() {} + void ps_getpid() {}], + [td_ta_new();], + [srv_cv_thread_db="$thread_db"], + [srv_cv_thread_db=no]) ++ ]]) + LIBS="$old_LIBS" +- ]]) + )]) +Index: gdb-6.3/gdb/gdbserver/configure +=================================================================== +--- gdb-6.3.orig/gdb/gdbserver/configure 2004-10-16 12:18:54.000000000 -0400 ++++ gdb-6.3/gdb/gdbserver/configure 2004-12-07 17:22:17.343129771 -0500 +@@ -28,6 +28,7 @@ program_suffix=NONE + program_transform_name=s,x,x, + silent= + site= ++sitefile= + srcdir= + target=NONE + verbose= +@@ -142,6 +143,7 @@ Configuration: + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages ++ --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure + Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX +@@ -312,6 +314,11 @@ EOF + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + ++ -site-file | --site-file | --site-fil | --site-fi | --site-f) ++ ac_prev=sitefile ;; ++ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) ++ sitefile="$ac_optarg" ;; ++ + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) +@@ -477,12 +484,16 @@ fi + srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + + # Prefer explicitly selected file to automatically selected ones. +-if test -z "$CONFIG_SITE"; then +- if test "x$prefix" != xNONE; then +- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" +- else +- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" ++if test -z "$sitefile"; then ++ if test -z "$CONFIG_SITE"; then ++ if test "x$prefix" != xNONE; then ++ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" ++ else ++ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" ++ fi + fi ++else ++ CONFIG_SITE="$sitefile" + fi + for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then +@@ -526,7 +537,7 @@ fi + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:530: checking for $ac_word" >&5 ++echo "configure:541: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -556,7 +567,7 @@ if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:560: checking for $ac_word" >&5 ++echo "configure:571: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -607,7 +618,7 @@ fi + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:611: checking for $ac_word" >&5 ++echo "configure:622: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -639,7 +650,7 @@ fi + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:643: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++echo "configure:654: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -650,12 +661,12 @@ cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext << EOF + +-#line 654 "configure" ++#line 665 "configure" + #include "confdefs.h" + + main(){return(0);} + EOF +-if { (eval echo configure:659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +@@ -681,12 +692,12 @@ if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:685: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:696: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +-echo "configure:690: checking whether we are using GNU C" >&5 ++echo "configure:701: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -695,7 +706,7 @@ else + yes; + #endif + EOF +-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no +@@ -714,7 +725,7 @@ ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +-echo "configure:718: checking whether ${CC-cc} accepts -g" >&5 ++echo "configure:729: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -793,7 +804,7 @@ else { echo "configure: error: can not r + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 +-echo "configure:797: checking host system type" >&5 ++echo "configure:808: checking host system type" >&5 + + host_alias=$host + case "$host_alias" in +@@ -814,7 +825,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- + echo "$ac_t""$host" 1>&6 + + echo $ac_n "checking target system type""... $ac_c" 1>&6 +-echo "configure:818: checking target system type" >&5 ++echo "configure:829: checking target system type" >&5 + + target_alias=$target + case "$target_alias" in +@@ -832,7 +843,7 @@ target_os=`echo $target | sed 's/^\([^-] + echo "$ac_t""$target" 1>&6 + + echo $ac_n "checking build system type""... $ac_c" 1>&6 +-echo "configure:836: checking build system type" >&5 ++echo "configure:847: checking build system type" >&5 + + build_alias=$build + case "$build_alias" in +@@ -867,7 +878,7 @@ test "$host_alias" != "$target_alias" && + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +-echo "configure:871: checking for a BSD compatible install" >&5 ++echo "configure:882: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -921,7 +932,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA= + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:925: checking how to run the C preprocessor" >&5 ++echo "configure:936: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +@@ -936,13 +947,13 @@ else + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -953,13 +964,13 @@ else + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -970,13 +981,13 @@ else + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -1001,12 +1012,12 @@ fi + echo "$ac_t""$CPP" 1>&6 + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:1005: checking for ANSI C header files" >&5 ++echo "configure:1016: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -1014,7 +1025,7 @@ else + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1031,7 +1042,7 @@ rm -f conftest* + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -1049,7 +1060,7 @@ fi + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -1070,7 +1081,7 @@ if test "$cross_compiling" = yes; then + : + else + cat > conftest.$ac_ext < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +@@ -1081,7 +1092,7 @@ if (XOR (islower (i), ISLOWER (i)) || to + exit (0); } + + EOF +-if { (eval echo configure:1085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:1096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -1109,17 +1120,17 @@ for ac_hdr in sgtty.h termio.h termios.h + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +-echo "configure:1113: checking for $ac_hdr" >&5 ++echo "configure:1124: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:1123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:1134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -1147,12 +1158,12 @@ done + + + echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 +-echo "configure:1151: checking whether strerror must be declared" >&5 ++echo "configure:1162: checking whether strerror must be declared" >&5 + if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +@@ -1173,7 +1184,7 @@ int main() { + char *(*pfn) = (char *(*)) strerror + ; return 0; } + EOF +-if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_decl_needed_strerror=no + else +@@ -1205,19 +1216,19 @@ fi + + if test "${srv_linux_regsets}" = "yes"; then + echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 +-echo "configure:1209: checking for PTRACE_GETREGS" >&5 ++echo "configure:1220: checking for PTRACE_GETREGS" >&5 + if eval "test \"`echo '$''{'gdbsrv_cv_have_ptrace_getregs'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + PTRACE_GETREGS; + ; return 0; } + EOF +-if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdbsrv_cv_have_ptrace_getregs=yes + else +@@ -1238,19 +1249,19 @@ EOF + fi + + echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 +-echo "configure:1242: checking for PTRACE_GETFPXREGS" >&5 ++echo "configure:1253: checking for PTRACE_GETFPXREGS" >&5 + if eval "test \"`echo '$''{'gdbsrv_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + PTRACE_GETFPXREGS; + ; return 0; } + EOF +-if { (eval echo configure:1254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdbsrv_cv_have_ptrace_getfpxregs=yes + else +@@ -1273,12 +1284,12 @@ fi + + if test "$ac_cv_header_sys_procfs_h" = yes; then + echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 +-echo "configure:1277: checking for lwpid_t in sys/procfs.h" >&5 ++echo "configure:1288: checking for lwpid_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_lwpid_t=yes + else +@@ -1309,12 +1320,12 @@ EOF + echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 + + echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 +-echo "configure:1313: checking for psaddr_t in sys/procfs.h" >&5 ++echo "configure:1324: checking for psaddr_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_psaddr_t=yes + else +@@ -1345,12 +1356,12 @@ EOF + echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6 + + echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 +-echo "configure:1349: checking for prgregset_t in sys/procfs.h" >&5 ++echo "configure:1360: checking for prgregset_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prgregset_t=yes + else +@@ -1381,12 +1392,12 @@ EOF + echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 + + echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 +-echo "configure:1385: checking for prfpregset_t in sys/procfs.h" >&5 ++echo "configure:1396: checking for prfpregset_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_prfpregset_t=yes + else +@@ -1421,7 +1432,7 @@ EOF + + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then + echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 +-echo "configure:1425: checking whether prfpregset_t type is broken" >&5 ++echo "configure:1436: checking whether prfpregset_t type is broken" >&5 + if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1429,7 +1440,7 @@ else + gdb_cv_prfpregset_t_broken=yes + else + cat > conftest.$ac_ext < + int main () +@@ -1439,7 +1450,7 @@ else + return 0; + } + EOF +-if { (eval echo configure:1443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + gdb_cv_prfpregset_t_broken=no + else +@@ -1463,12 +1474,12 @@ EOF + fi + + echo $ac_n "checking for elf_fpregset_t in sys/procfs.h""... $ac_c" 1>&6 +-echo "configure:1467: checking for elf_fpregset_t in sys/procfs.h" >&5 ++echo "configure:1478: checking for elf_fpregset_t in sys/procfs.h" >&5 + if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_elf_fpregset_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes + else +@@ -1506,14 +1517,14 @@ USE_THREAD_DB= + + if test "$srv_linux_thread_db" = "yes"; then + echo $ac_n "checking for libthread_db""... $ac_c" 1>&6 +-echo "configure:1510: checking for libthread_db" >&5 ++echo "configure:1521: checking for libthread_db" >&5 + if eval "test \"`echo '$''{'srv_cv_thread_db'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + old_LIBS="$LIBS" + LIBS="$LIBS -lthread_db" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + srv_cv_thread_db="-lthread_db" + else +@@ -1543,7 +1555,7 @@ else + fi + LIBS="$old_LIBS `eval echo "$thread_db"`" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + srv_cv_thread_db="$thread_db" + else +@@ -1567,11 +1580,11 @@ else + srv_cv_thread_db=no + fi + rm -f conftest* +- LIBS="$old_LIBS" +- ++ + fi + + echo "$ac_t""$srv_cv_thread_db" 1>&6 ++ LIBS="$old_LIBS" + + fi + rm -f conftest* +@@ -1585,14 +1598,14 @@ rm -f conftest* + old_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -rdynamic" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + RDYNAMIC=-rdynamic + else +Index: gdb-6.3/gdb/gdbserver/aclocal.m4 +=================================================================== +--- gdb-6.3.orig/gdb/gdbserver/aclocal.m4 2002-06-11 13:32:39.000000000 -0400 ++++ gdb-6.3/gdb/gdbserver/aclocal.m4 2004-12-07 17:22:00.382495519 -0500 +@@ -1,4 +1,4 @@ +-dnl aclocal.m4 generated automatically by aclocal 1.4-p4 ++dnl aclocal.m4 generated automatically by aclocal 1.4 + + dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + dnl This file is free software; the Free Software Foundation +@@ -25,6 +25,7 @@ AC_DEFUN([SRV_CHECK_THREAD_DB], + void ps_lsetregs() {} + void ps_lgetfpregs() {} + void ps_lsetfpregs() {} ++ void ps_get_thread_area() {} + void ps_getpid() {}], + [td_ta_new();], + [srv_cv_thread_db="-lthread_db"], +@@ -44,11 +45,12 @@ AC_DEFUN([SRV_CHECK_THREAD_DB], + void ps_lsetregs() {} + void ps_lgetfpregs() {} + void ps_lsetfpregs() {} ++ void ps_get_thread_area() {} + void ps_getpid() {}], + [td_ta_new();], + [srv_cv_thread_db="$thread_db"], + [srv_cv_thread_db=no]) ++ ]]) + LIBS="$old_LIBS" +- ]]) + )]) + --- gdb-6.3.orig/debian/patches/dwarf2-cfi-warning.patch +++ gdb-6.3/debian/patches/dwarf2-cfi-warning.patch @@ -0,0 +1,39 @@ +Status: Unsuitable for upstream (at least, without a lot of arguing). + +GCC does not specify the state of every last register in the CIE. Since +GCC's focus is on correctness of runtime unwinding, any registers which +have to be unwound will be specified; but unmodified registers will not +be explicitly marked. (How about modified, call-clobbered registers? +I'm not sure if they are marked as unavailable.) + +GDB issues a noisy warning about this. The warning is generally not useful, +and we can get it extremely frequently (any time we load a new CIE). + +This patch disables the warning. Alternately we could set the complaints +threshold to zero, or implement a default frame init-register method for +every architecture. But someday the compiler will support using different +calling conventions for internal functions, so that's not much of a stopgap. +ARM has a complex algorithm for handling this, involving scanning all CIEs - +benefit not completely clear outside of the ARM context of flexible register +sets. + +Index: gdb-6.3/gdb/dwarf2-frame.c +=================================================================== +--- gdb-6.3.orig/gdb/dwarf2-frame.c 2004-11-15 11:54:57.000000000 -0500 ++++ gdb-6.3/gdb/dwarf2-frame.c 2004-12-08 18:02:23.896409471 -0500 +@@ -705,9 +705,12 @@ dwarf2_frame_cache (struct frame_info *n + table. We need a way of iterating through all the valid + DWARF2 register numbers. */ + if (fs->regs.reg[column].how == DWARF2_FRAME_REG_UNSPECIFIED) +- complaint (&symfile_complaints, +- "Incomplete CFI data; unspecified registers at 0x%s", +- paddr (fs->pc)); ++ { ++ if (0) ++ complaint (&symfile_complaints, ++ "Incomplete CFI data; unspecified registers at 0x%s", ++ paddr (fs->pc)); ++ } + else + cache->reg[regnum] = fs->regs.reg[column]; + } --- gdb-6.3.orig/debian/patches/linux-use-underscore-exit.patch +++ gdb-6.3/debian/patches/linux-use-underscore-exit.patch @@ -0,0 +1,22 @@ +Status: committed upstream after 6.3. Fixes some terminal mangling in +gdbtui. + +2004-12-04 Daniel Jacobowitz + + PR tui/1703 + * linux-nat.c (linux_tracefork_child): Use _exit instead of exit. + Suggested by Joshua Neuheisel. + +Index: gdb-6.3/gdb/linux-nat.c +=================================================================== +--- gdb-6.3.orig/gdb/linux-nat.c 2004-12-08 18:22:04.996973094 -0500 ++++ gdb-6.3/gdb/linux-nat.c 2004-12-08 18:22:20.386956067 -0500 +@@ -147,7 +147,7 @@ linux_tracefork_child (void) + ptrace (PTRACE_TRACEME, 0, 0, 0); + kill (getpid (), SIGSTOP); + fork (); +- exit (0); ++ _exit (0); + } + + /* Wrapper function for waitpid which handles EINTR. */ --- gdb-6.3.orig/debian/patches/bfd-no-kylix-crash.patch +++ gdb-6.3/debian/patches/bfd-no-kylix-crash.patch @@ -0,0 +1,47 @@ +Status: committed upstream after 6.3. + +Fix a crash triggered by Kylix libraries. + +2004-12-06 Daniel Jacobowitz + + Suggested by Fergal Daly : + * simple.c (simple_dummy_multiple_definition): New function. + (bfd_simple_get_relocated_section_contents): Use it. + +Index: src/bfd/simple.c +=================================================================== +RCS file: /cvs/src/src/bfd/simple.c,v +retrieving revision 1.19 +retrieving revision 1.20 +Index: gdb-6.3/bfd/simple.c +=================================================================== +--- gdb-6.3.orig/bfd/simple.c 2004-09-24 03:07:19.000000000 -0400 ++++ gdb-6.3/bfd/simple.c 2004-12-08 18:25:58.415216808 -0500 +@@ -78,6 +78,19 @@ simple_dummy_unattached_reloc (struct bf + return TRUE; + } + ++static bfd_boolean ++simple_dummy_multiple_definition (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, ++ const char *name ATTRIBUTE_UNUSED, ++ bfd *obfd ATTRIBUTE_UNUSED, ++ asection *osec ATTRIBUTE_UNUSED, ++ bfd_vma oval ATTRIBUTE_UNUSED, ++ bfd *nbfd ATTRIBUTE_UNUSED, ++ asection *nsec ATTRIBUTE_UNUSED, ++ bfd_vma nval ATTRIBUTE_UNUSED) ++{ ++ return TRUE; ++} ++ + struct saved_output_info + { + bfd_vma offset; +@@ -172,6 +185,7 @@ bfd_simple_get_relocated_section_content + callbacks.reloc_overflow = simple_dummy_reloc_overflow; + callbacks.reloc_dangerous = simple_dummy_reloc_dangerous; + callbacks.unattached_reloc = simple_dummy_unattached_reloc; ++ callbacks.multiple_definition = simple_dummy_multiple_definition; + + memset (&link_order, 0, sizeof (link_order)); + link_order.next = NULL; --- gdb-6.3.orig/debian/patches/disable-linux-fork-messages.patch +++ gdb-6.3/debian/patches/disable-linux-fork-messages.patch @@ -0,0 +1,46 @@ +Status: Proposed upstream after 6.3, not yet committed. + +2004-12-06 Daniel Jacobowitz + + * linux-nat.c (child_follow_fork): Call target_terminal_ours before + printing output. Use fprintf_unfiltered. Only print output when + debugging. + +Index: gdb-6.3/gdb/linux-nat.c +=================================================================== +--- gdb-6.3.orig/gdb/linux-nat.c 2004-12-08 18:22:20.386956067 -0500 ++++ gdb-6.3/gdb/linux-nat.c 2004-12-08 18:28:49.995585970 -0500 +@@ -347,9 +347,13 @@ child_follow_fork (int follow_child) + also, but they'll be reinserted below. */ + detach_breakpoints (child_pid); + +- fprintf_filtered (gdb_stdout, +- "Detaching after fork from child process %d.\n", +- child_pid); ++ if (debug_linux_nat) ++ { ++ target_terminal_ours (); ++ fprintf_unfiltered (gdb_stdlog, ++ "Detaching after fork from child process %d.\n", ++ child_pid); ++ } + + ptrace (PTRACE_DETACH, child_pid, 0, 0); + +@@ -418,9 +422,13 @@ child_follow_fork (int follow_child) + /* Before detaching from the parent, remove all breakpoints from it. */ + remove_breakpoints (); + +- fprintf_filtered (gdb_stdout, +- "Attaching after fork to child process %d.\n", +- child_pid); ++ if (debug_linux_nat) ++ { ++ target_terminal_ours (); ++ fprintf_unfiltered (gdb_stdlog, ++ "Attaching after fork to child process %d.\n", ++ child_pid); ++ } + + /* If we're vforking, we may want to hold on to the parent until + the child exits or execs. At exec time we can remove the old --- gdb-6.3.orig/debian/patches/bfd-security-fixes.patch +++ gdb-6.3/debian/patches/bfd-security-fixes.patch @@ -0,0 +1,189 @@ +Included in upstream CVS. + +2005-05-29 Daniel Jacobowitz + + Backport from mainline: + 2005-05-29 Jakub Jelinek + * elfcode.h (elf_object_p): Fail if e_shoff != 0, e_shnum == 0 and + first shdr has sh_size == 0. Fail if e_shnum is large to cause + arithmetic overflow when allocating the i_shdr array. + Sanity check sh_link and sh_info fields. Fix e_shstrndx sanity check. + + 2005-05-18 H.J. Lu + * elf.c (group_signature): Undo the last change. Check if the + symbol table section is correct. + + 2005-05-17 Nick Clifton + * elf.c (group_signature): Check for a group section which is + actually a (corrupt) symbol table section in disguise and prevent + an infinite loop from occurring. + + 2005-05-17 Tavis Ormandy + * elf.c (bfd_section_from_shdr): Add sanity check when parsing + dynamic sections. + + 2005-05-09 Alan Modra + * elfcode.h (elf_object_p): Add more sanity checks on elf header. + +Index: gdb-6.3/bfd/elf.c +=================================================================== +--- gdb-6.3.orig/bfd/elf.c 2004-10-14 19:38:08.000000000 -0400 ++++ gdb-6.3/bfd/elf.c 2005-05-29 18:05:28.000000000 -0400 +@@ -438,8 +438,11 @@ group_signature (bfd *abfd, Elf_Internal + Elf_External_Sym_Shndx eshndx; + Elf_Internal_Sym isym; + +- /* First we need to ensure the symbol table is available. */ +- if (! bfd_section_from_shdr (abfd, ghdr->sh_link)) ++ /* First we need to ensure the symbol table is available. Make sure ++ that it is a symbol table section. */ ++ hdr = elf_elfsections (abfd) [ghdr->sh_link]; ++ if (hdr->sh_type != SHT_SYMTAB ++ || ! bfd_section_from_shdr (abfd, ghdr->sh_link)) + return NULL; + + /* Go read the symbol. */ +@@ -1745,6 +1748,9 @@ bfd_section_from_shdr (bfd *abfd, unsign + case SHT_DYNAMIC: /* Dynamic linking information. */ + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return FALSE; ++ if (hdr->sh_link > elf_numsections (abfd) ++ || elf_elfsections (abfd)[hdr->sh_link] == NULL) ++ return FALSE; + if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_STRTAB) + { + Elf_Internal_Shdr *dynsymhdr; +Index: gdb-6.3/bfd/elfcode.h +=================================================================== +--- gdb-6.3.orig/bfd/elfcode.h 2004-07-27 10:20:47.000000000 -0400 ++++ gdb-6.3/bfd/elfcode.h 2005-05-29 18:05:28.000000000 -0400 +@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suit + /* Problems and other issues to resolve. + + (1) BFD expects there to be some fixed number of "sections" in +- the object file. I.E. there is a "section_count" variable in the ++ the object file. I.E. there is a "section_count" variable in the + bfd structure which contains the number of sections. However, ELF + supports multiple "views" of a file. In particular, with current + implementations, executable files typically have two tables, a +@@ -613,8 +613,13 @@ elf_object_p (bfd *abfd) + + if (i_ehdrp->e_shoff != 0) + { ++ bfd_signed_vma where = i_ehdrp->e_shoff; ++ ++ if (where != (file_ptr) where) ++ goto got_wrong_format_error; ++ + /* Seek to the section header table in the file. */ +- if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0) ++ if (bfd_seek (abfd, (file_ptr) where, SEEK_SET) != 0) + goto got_no_match; + + /* Read the first section header at index 0, and convert to internal +@@ -626,11 +631,46 @@ elf_object_p (bfd *abfd) + /* If the section count is zero, the actual count is in the first + section header. */ + if (i_ehdrp->e_shnum == SHN_UNDEF) +- i_ehdrp->e_shnum = i_shdr.sh_size; ++ { ++ i_ehdrp->e_shnum = i_shdr.sh_size; ++ if (i_ehdrp->e_shnum != i_shdr.sh_size ++ || i_ehdrp->e_shnum == 0) ++ goto got_wrong_format_error; ++ } + + /* And similarly for the string table index. */ + if (i_ehdrp->e_shstrndx == SHN_XINDEX) +- i_ehdrp->e_shstrndx = i_shdr.sh_link; ++ { ++ i_ehdrp->e_shstrndx = i_shdr.sh_link; ++ if (i_ehdrp->e_shstrndx != i_shdr.sh_link) ++ goto got_wrong_format_error; ++ } ++ ++ /* Sanity check that we can read all of the section headers. ++ It ought to be good enough to just read the last one. */ ++ if (i_ehdrp->e_shnum != 1) ++ { ++ /* Check that we don't have a totally silly number of sections. */ ++ if (i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (x_shdr) ++ || i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (i_shdr)) ++ goto got_wrong_format_error; ++ ++ where += (i_ehdrp->e_shnum - 1) * sizeof (x_shdr); ++ if (where != (file_ptr) where) ++ goto got_wrong_format_error; ++ if ((bfd_size_type) where <= i_ehdrp->e_shoff) ++ goto got_wrong_format_error; ++ ++ if (bfd_seek (abfd, (file_ptr) where, SEEK_SET) != 0) ++ goto got_no_match; ++ if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)) ++ goto got_no_match; ++ ++ /* Back to where we were. */ ++ where = i_ehdrp->e_shoff + sizeof (x_shdr); ++ if (bfd_seek (abfd, (file_ptr) where, SEEK_SET) != 0) ++ goto got_no_match; ++ } + } + + /* Allocate space for a copy of the section header table in +@@ -674,6 +714,20 @@ elf_object_p (bfd *abfd) + goto got_no_match; + elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex); + ++ /* Sanity check sh_link and sh_info. */ ++ if (i_shdrp[shindex].sh_link >= num_sec ++ || (i_shdrp[shindex].sh_link >= SHN_LORESERVE ++ && i_shdrp[shindex].sh_link <= SHN_HIRESERVE)) ++ goto got_wrong_format_error; ++ ++ if (((i_shdrp[shindex].sh_flags & SHF_INFO_LINK) ++ || i_shdrp[shindex].sh_type == SHT_RELA ++ || i_shdrp[shindex].sh_type == SHT_REL) ++ && (i_shdrp[shindex].sh_info >= num_sec ++ || (i_shdrp[shindex].sh_info >= SHN_LORESERVE ++ && i_shdrp[shindex].sh_info <= SHN_HIRESERVE))) ++ goto got_wrong_format_error; ++ + /* If the section is loaded, but not page aligned, clear + D_PAGED. */ + if (i_shdrp[shindex].sh_size != 0 +@@ -692,6 +746,17 @@ elf_object_p (bfd *abfd) + goto got_no_match; + } + ++ /* A further sanity check. */ ++ if (i_ehdrp->e_shnum != 0) ++ { ++ if (i_ehdrp->e_shstrndx >= elf_numsections (abfd) ++ || (i_ehdrp->e_shstrndx >= SHN_LORESERVE ++ && i_ehdrp->e_shstrndx <= SHN_HIRESERVE)) ++ goto got_wrong_format_error; ++ } ++ else if (i_ehdrp->e_shstrndx != 0) ++ goto got_wrong_format_error; ++ + /* Read in the program headers. */ + if (i_ehdrp->e_phnum == 0) + elf_tdata (abfd)->phdr = NULL; +@@ -1059,7 +1124,7 @@ elf_slurp_symbol_table (bfd *abfd, asymb + symcount); + + /* Slurp in the symbols without the version information, +- since that is more helpful than just quitting. */ ++ since that is more helpful than just quitting. */ + verhdr = NULL; + } + +@@ -1126,7 +1191,7 @@ elf_slurp_symbol_table (bfd *abfd, asymb + sym->symbol.section = bfd_abs_section_ptr; + + /* If this is a relocatable file, then the symbol value is +- already section relative. */ ++ already section relative. */ + if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) + sym->symbol.value -= sym->symbol.section->vma; + --- gdb-6.3.orig/debian/patches/gdbinit-ownership.patch +++ gdb-6.3/debian/patches/gdbinit-ownership.patch @@ -0,0 +1,164 @@ +Index: gdb-6.3/gdb/cli/cli-cmds.c +=================================================================== +--- gdb-6.3.orig/gdb/cli/cli-cmds.c 2005-05-29 19:33:39.000000000 -0400 ++++ gdb-6.3/gdb/cli/cli-cmds.c 2005-05-29 19:33:40.000000000 -0400 +@@ -37,6 +37,7 @@ + #include "objfiles.h" + #include "source.h" + #include "disasm.h" ++#include "gdb_stat.h" + + #include "ui-out.h" + +@@ -50,6 +51,8 @@ + #include "tui/tui.h" /* For tui_active et.al. */ + #endif + ++#include ++ + #ifndef GDBINIT_FILENAME + #define GDBINIT_FILENAME ".gdbinit" + #endif +@@ -423,30 +426,54 @@ cd_command (char *dir, int from_tty) + pwd_command ((char *) 0, 1); + } + ++/* Load a GDB command file whose name is given in ARGS. FROM_TTY may ++ be -1, in which case we are loading a gdbinit file; in that case, ++ be paranoid about unsafe files. */ ++ + void + source_command (char *args, int from_tty) + { +- FILE *stream; ++ FILE *stream = NULL; ++ int fd; + struct cleanup *old_cleanups; + char *file = args; + + if (file == NULL) +- { +- error ("source command requires pathname of file to source."); +- } ++ error ("source command requires pathname of file to source."); + + file = tilde_expand (file); + old_cleanups = make_cleanup (xfree, file); + +- stream = fopen (file, FOPEN_RT); +- if (!stream) ++ fd = open (file, O_RDONLY); ++ if (fd != -1) ++ stream = fdopen (fd, FOPEN_RT); ++ if (stream == NULL) + { +- if (from_tty) ++ if (from_tty > 0) + perror_with_name (file); + else + return; + } + ++#ifdef HAVE_GETUID ++ if (from_tty == -1) ++ { ++ struct stat statbuf; ++ if (fstat (fd, &statbuf) < 0) ++ { ++ perror_with_name (file); ++ fclose (stream); ++ return; ++ } ++ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) ++ { ++ warning ("not using untrusted file \"%s\"", file); ++ fclose (stream); ++ return; ++ } ++ } ++#endif ++ + script_from_file (stream, file); + + do_cleanups (old_cleanups); +Index: gdb-6.3/gdb/main.c +=================================================================== +--- gdb-6.3.orig/gdb/main.c 2005-05-29 19:32:06.000000000 -0400 ++++ gdb-6.3/gdb/main.c 2005-05-29 19:33:40.000000000 -0400 +@@ -609,7 +609,7 @@ extern int gdbtk_test (char *); + + if (!inhibit_gdbinit) + { +- catch_command_errors (source_command, homeinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_command, homeinit, -1, RETURN_MASK_ALL); + } + + /* Do stats; no need to do them elsewhere since we'll only +@@ -695,7 +695,7 @@ extern int gdbtk_test (char *); + || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) + if (!inhibit_gdbinit) + { +- catch_command_errors (source_command, gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_command, gdbinit, -1, RETURN_MASK_ALL); + } + + for (i = 0; i < ncmd; i++) +Index: gdb-6.3/gdb/Makefile.in +=================================================================== +--- gdb-6.3.orig/gdb/Makefile.in 2005-05-29 19:33:40.000000000 -0400 ++++ gdb-6.3/gdb/Makefile.in 2005-05-29 19:33:40.000000000 -0400 +@@ -2729,7 +2729,7 @@ cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(d + $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ + $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ + $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ +- $(tui_h) ++ $(tui_h) $(gdb_stat_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ + $(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \ +Index: gdb-6.3/gdb/config.in +=================================================================== +--- gdb-6.3.orig/gdb/config.in 2004-09-25 05:17:46.000000000 -0400 ++++ gdb-6.3/gdb/config.in 2005-05-30 08:48:31.000000000 -0400 +@@ -1,4 +1,4 @@ +-/* config.in. Generated automatically from configure.in by autoheader. */ ++/* config.in. Generated automatically from configure.in by autoheader 2.13. */ + + /* Define if on AIX 3. + System headers sometimes define this. +@@ -203,6 +203,9 @@ + /* Define if you have the getpagesize function. */ + #undef HAVE_GETPAGESIZE + ++/* Define if you have the getuid function. */ ++#undef HAVE_GETUID ++ + /* Define if you have the monstartup function. */ + #undef HAVE_MONSTARTUP + +Index: gdb-6.3/gdb/configure +=================================================================== +--- gdb-6.3.orig/gdb/configure 2004-10-10 11:55:49.000000000 -0400 ++++ gdb-6.3/gdb/configure 2005-05-30 08:48:19.000000000 -0400 +@@ -6596,7 +6596,7 @@ EOF + + fi + +-for ac_func in canonicalize_file_name realpath ++for ac_func in canonicalize_file_name realpath getuid + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:6603: checking for $ac_func" >&5 +Index: gdb-6.3/gdb/configure.in +=================================================================== +--- gdb-6.3.orig/gdb/configure.in 2004-10-10 11:55:49.000000000 -0400 ++++ gdb-6.3/gdb/configure.in 2005-05-30 08:47:50.000000000 -0400 +@@ -439,7 +439,7 @@ AC_C_INLINE + AC_FUNC_ALLOCA + AC_FUNC_MMAP + AC_FUNC_VFORK +-AC_CHECK_FUNCS(canonicalize_file_name realpath) ++AC_CHECK_FUNCS(canonicalize_file_name realpath getuid) + AC_CHECK_FUNCS(poll) + AC_CHECK_FUNCS(pread64) + AC_CHECK_FUNCS(sbrk) --- gdb-6.3.orig/debian/changelog +++ gdb-6.3/debian/changelog @@ -0,0 +1,835 @@ +gdb (6.3-6ubuntu2) breezy; urgency=low + + * Install the gcore script (Ubuntu 11394). + + -- Matthias Klose Wed, 7 Sep 2005 14:39:39 +0200 + +gdb (6.3-6ubuntu1) breezy; urgency=low + + * Reapplied Ubuntu changes to clean Debian package. + * debian/control.in, debian/rules: Eliminate type handling. + + -- Martin Pitt Wed, 15 Jun 2005 08:24:57 +0000 + +gdb (6.3-6) unstable; urgency=high + + * Do not crash on certain malformed input files [CAN-2005-1704] + (Closes: #308624, #310972). + * Do not load untrusted .gdbinit files [CAN-2005-1705] (Closes: #310728). + + -- Daniel Jacobowitz Sun, 29 May 2005 18:55:44 -0400 + +gdb (6.3-5ubuntu2) breezy; urgency=low + + * Security update: Fix privilege escalation and buffer overflow. + * Added debian/patches/CAN-2005-1704.patch: + - Fix integer overflow and unchecked NULL pointers in BFD parser. + - Patches taken from upstream CVS. + - References: + CAN-2005-1704 + * Added debian/patches/CAN-2005-1705.patch: + - Do not source .gdbinit in the current directory if it does not belong to + the user invoking gdb. + - References: + CAN-2005-1705 + + -- Martin Pitt Fri, 27 May 2005 09:03:32 +0000 + +gdb (6.3-5ubuntu1) hoary; urgency=low + + * Resynchronise with Debian. + + -- Scott James Remnant Fri, 10 Dec 2004 12:47:53 +0000 + +gdb (6.3-5) unstable; urgency=low + + * Fix NPTL debugging using gdbserver. + * Disable the "Incomplete CFI data" warning. + * Really include the menu file this time (Closes: #80010). + * Include a patch to handle strange binaries produced by Kylix + (Closes: #249008). + * Fix printing of fork status messages, and disable them by default + (Closes: #254039). + + -- Daniel Jacobowitz Wed, 8 Dec 2004 18:35:02 -0500 + +gdb (6.3-4ubuntu1) hoary; urgency=low + + * Eliminate use of type-handling (closes: Ubuntu#4132). + + -- Daniel Stone Fri, 26 Nov 2004 12:49:37 +0000 + +gdb (6.3-4) unstable; urgency=low + + * Backport a patch for a warning about the vsyscall DSO. + * Backport a spelling fix for PTRACE_EVENT_VFORK_DONE to fix S/390 + build failure. + + -- Daniel Jacobowitz Mon, 15 Nov 2004 11:52:13 -0500 + +gdb (6.3-3) unstable; urgency=low + + * Add flex to build dependencies for ada-lex.l. + + -- Daniel Jacobowitz Sun, 14 Nov 2004 00:28:18 -0500 + +gdb (6.3-2) unstable; urgency=low + + * Backport a patch for a C++ / stabs debug info crash (Closes: #251322). + * Correct build dependency for gcj (missed a !). + * Correct build dependency for libunwind (it's libunwind7-dev now). + * Update fix for fork tracing. This removes a warning on 2.4 kernels, + and fixes UML debugging (Closes: #271069). + * Fix single-stepping through a call to NULL on SPARC (Closes: #256012). + + -- Daniel Jacobowitz Sat, 13 Nov 2004 16:50:55 -0500 + +gdb (6.3-1) unstable; urgency=low + + * New upstream release (Closes: #259219). + - Give an error for division by 0 (Closes: #280051). + - Includes support for -feliminate-dwarf2-dups. + - Limited support for Ada is included; more to come + (Closes: #39516, #46470, #57876, #85947). + * Update build dependency on texinfo; 4.7-1 could not build GDB. + * Build depend on gcj on all architectures other than mips and mipsel + (Closes: #272327). + * Build depend on libkvm-dev for kfreebsd-gnu (Closes: #264103). + * Add libunwind support on ia64 (Closes: #279596). + * Make the fork tracing checks more robust. Prevents stray processes + on 2.6.10-rc1. + * Add a Debian menu entry for GDB (Closes: #80010). + + -- Daniel Jacobowitz Fri, 12 Nov 2004 18:45:46 -0500 + +gdb (6.1-3) unstable; urgency=low + + * Fix passing and returning of non-trivial C++ objects (Closes: #160459). + * Update hppa patches (Closes: #247948). + * Add a patch for finding C++ member variables in base classes + (Closes: #239535). + * Replace versions of insight which contain gdbtui. Partial fix for + #242498. + + -- Daniel Jacobowitz Thu, 27 May 2004 11:30:23 -0400 + +gdb (6.1-2) unstable; urgency=low + + * Add an NPTL thread-exit patch. Short-lived threads could cause GDB + to leave unattached threads, which would crash as soon as they hit + a breakpoint. + * Testsuite patches - no unexpected FAILs on i386-linux. + + -- Daniel Jacobowitz Mon, 19 Apr 2004 11:43:07 -0400 + +gdb (6.1-1) unstable; urgency=low + + * New upstream version. + * Re-add the -debian suffix to GDB's version number. This got lost in the + transition to CDBS. + * Revised HPPA port. Thanks to Randolph Chung, as usual. + * Run the testsuite on SPARC again. The SPARC port is much improved + (it has been basically rewritten from scratch). + + -- Daniel Jacobowitz Tue, 6 Apr 2004 00:13:00 -0400 + +gdb (6.0-6) unstable; urgency=low + + * Also add DESTDIR to the ranlib invocation. + * Fix typo in moving run.1 manpage. + * Link linux-nat.o on HPPA. + + -- Daniel Jacobowitz Tue, 3 Feb 2004 11:07:27 -0500 + +gdb (6.0-5) unstable; urgency=low + + * Add DESTDIR support to sim/, to fix build failures on targets with a + simulator. + + -- Daniel Jacobowitz Mon, 2 Feb 2004 15:32:23 -0500 + +gdb (6.0-4) unstable; urgency=low + + * Switch to CDBS and quilt. + * Suppress warning about "" on re-run with a vsyscall DSO. + * Import gdb 6.0 CVS branch; fixes a segfault with development GCC + and frequent segfaults when rereading changed binaries + (Closes: #230550). + + -- Daniel Jacobowitz Mon, 2 Feb 2004 10:03:19 -0500 + +gdb (6.0-3) unstable; urgency=low + + * Include instead of on HPPA + (Closes: #208928). + * Support backtraces through the vsyscall DSO on i386. + * Do not run testsuite on hurd-i386 (Closes: #221956). + * Fix up texinfo files so that dh_installinfo puts them in the right + section. + * Update build dependency on texinfo (Closes: #219337). + + -- Daniel Jacobowitz Sun, 25 Jan 2004 18:04:24 -0500 + +gdb (6.0-2) unstable; urgency=low + + * Add build dependency on mig for hurd-i386 (Closes: #216428). + * Don't paginate symbol file progress messages. In combination + with recent changes to dwarf2-frame.c this fixes some potential + internal errors (Closes: #199889). + - 28.symfile-unfiltered.patch + + -- Daniel Jacobowitz Mon, 27 Oct 2003 23:32:39 -0500 + +gdb (6.0-1) unstable; urgency=low + + * New upstream release + - 11.read-var-value.patch merged upstream. + - 12.dwarf-loc-register.patch merged upstream. + - -data-list-changed-registers no longer segfaults (Closes: #204561). + * Include the text of the GFDL in the copyright file (Closes: #212890). + * Include a threading patch which may fix #212949. + - 26.lin-lwp-assert.patch + * Include a patch which should improve Control-C handling for LinuxThreads + on 2.6 kernels. + - 27.lin-lwp-2.6.patch + + -- Daniel Jacobowitz Sat, 4 Oct 2003 17:47:35 -0400 + +gdb (5.3.20030824-1) unstable; urgency=low + + * New upstream CVS snapshot, from the GDB 6.0 branch. + - 27.tui-paginate-backtrace.patch merged upstream. + - 28.minsym-section.patch merged upstream. + - Watchpoint handling bug for ia64 fixed (Closes: #205241). + * Squash some warnings for HPPA. + + -- Daniel Jacobowitz Sun, 24 Aug 2003 14:26:52 -0400 + +gdb (5.3.20030801-1) unstable; urgency=low + + * New upstream CVS snapshot, from the GDB 6.0 branch. + - 26.fix-sparc-build-two.patch merged upstream. + - Includes a fix for backtracing from noreturn functions like abort (). + - Insert a space between the address and code when disassembling, + even if we don't have a function name (Closes: #199672). + * Update HPPA patch again; is anyone ever going to submit this + upstream? Better do it soon. (Closes: #200980). + * Make filtered output paginate correctly again. + - 27.tui-paginate-backtrace.patch + * Fix an internal error on -data-list-changed-registers, and possibly + many others (Closes: #203553). + - 10.selected-frame.patch + * Add two patches for watchpoints in optimized programs (Closes: #203000). + - 11.read-var-value.patch + - 12.dwarf-loc-register.patch + * Add a patch for several shared library single-stepping bugs. + - 28.minsym-section.patch + + -- Daniel Jacobowitz Sun, 3 Aug 2003 23:09:56 -0400 + +gdb (5.3.20030629-2) unstable; urgency=low + + * Yet another sparc build fix. + - 26.fix-sparc-build-two.patch + + -- Daniel Jacobowitz Sun, 29 Jun 2003 17:11:12 -0400 + +gdb (5.3.20030629-1) unstable; urgency=low + + * New upstream CVS snapshot, from the GDB 6.0 branch. + - Remote debugging isn't totally broken any more. + * Remove merge or obsoleted patches. + - Parts of 23.static-thread-apps.patch + - 26.fix-tui-build.patch + - 27.fix-sparc-build-two.patch + - 28.dwarf2-reread-segv.patch + + -- Daniel Jacobowitz Sat, 28 Jun 2003 21:17:13 -0400 + +gdb (5.3.20030606-3) unstable; urgency=low + + * Fix build failure on HPPA. + * Fix a segfault when reread applications (Closes: #197226). + - 28.dwarf2-reread-segv.patch + + -- Daniel Jacobowitz Sun, 22 Jun 2003 14:30:49 -0400 + +gdb (5.3.20030606-2) unstable; urgency=low + + * Add 27.fix-sparc-build-two.patch to fix build failure on sparc. + * Disable the testsuite on sparc, since it's completely broken. + * Conditionalize gcj build dependency for architectures which both + have gcj and run the testsuite. + + -- Daniel Jacobowitz Sat, 14 Jun 2003 12:30:33 -0400 + +gdb (5.3.20030606-1) unstable; urgency=low + + * New upstream snapshot, with lots of nice features. + - Improved prologue analyzer and DWARF-2 frame unwind support for i386. + - Overhauled Alpha support. + - More C++ namespace support (still not complete). + - DW_AT_ranges support - if you've noticed local variables in your code + being missing in GDB, this is the most likely cause. + - Integrated Objective C support, finally! It's got some rough edges + but it works (Closes: #62081, #24598, #57824, #86506). + - "set cp-abi" command for debugging combined v2 and v3 C++ code. + - Some bug fixes in the parsing for gdb --args (Closes: #33361, #193413). + - Support for debug info in separate files, coming soon to a Debian + near you. + * Removed integrated or obsoleted patches: + - 01.const-tilde_expand.patch + - 05.i386-backtrace-to-main.patch + - 08.max-ui-out.patch + - 12.tui-readline.patch + - 15.m68k-build.patch + - 16.use-rl-prefixed-function.patch + - 19.alpha-doublest-correction.patch + - 21.lin-lwp-schedlock.patch + * Disabled some patches which I hope are no longer needed: + - 06.java-testsuite-jmisc.patch + - 11.thread-confused-exit.patch + - 20.alpha-testsuite.patch + - 22.alpha-proc-desc-stack.patch + * Updated HPPA patches for this snapshot. + - 02.gdb-hppa.patch + - 03.hppa-core.patch + - 04.hppa-func-returns.patch + * Add some build fixes for TUI. + - 26.fix-tui-build.patch + * Build with an absolute path to configure, to work around three failing + MI tests. + * Don't bother running the testsuite for two debug formats any more. + * Add build-dependencies for gcj and gobjc, for the testsuite. + * Adjust configure --mandir argument to match more stupid quoting. + * Re-enable thread testsuite on Alpha. + * Enable the testsuite on ia64, hppa, and s390. + + -- Daniel Jacobowitz Sun, 8 Jun 2003 20:15:55 -0400 + +gdb (5.3-2) unstable; urgency=low + + * Fix build on SPARC. + * Fix buid on HPPA. + + -- Daniel Jacobowitz Sat, 4 Jan 2003 01:02:36 -0500 + +gdb (5.3-1) unstable; urgency=low + + * New upstream release. + * Patches updated for new release. + - Patch 14.gdb-maint-its-typo.patch included. + - Patch 17.tui-fixes.patch included. + - Patch 18.threads-much-faster.patch included. + + -- Daniel Jacobowitz Mon, 16 Dec 2002 14:43:03 -0500 + +gdb (5.2.debian90.cvs20021120-4) unstable; urgency=low + + * Fix thread debugging for statically linked applications + (Closes: #170107). + * Prevent a segfault when entering tracepoint actions if you hit EOF + (Closes: #167997). + + -- Daniel Jacobowitz Tue, 3 Dec 2002 14:46:07 -0500 + +gdb (5.2.debian90.cvs20021120-3) unstable; urgency=low + + * Add another Alpha patch for setting breakpoints after the process exits. + * Disable running the thread tests on Alpha (ew). It hangs the build + daemon; the problem appears to be in glibc. It returns nonexistant + and duplicate threads. + + -- Daniel Jacobowitz Sun, 24 Nov 2002 23:16:36 -0500 + +gdb (5.2.debian90.cvs20021120-2) unstable; urgency=low + + * Add patch for testsuite false failures on Alpha. + * Add patch for floating point support on Alpha. + * Add a patch from the CVS HEAD for schedule-lock mode and for software + single step platforms. + * Correct the testsuite to match "help maint dump-me". + + -- Daniel Jacobowitz Sun, 24 Nov 2002 18:11:26 -0500 + +gdb (5.2.debian90.cvs20021120-1) unstable; urgency=low + + * New upstream CVS snapshot from 5.3 CVS branch. + - Builds with new bison (Closes: #169656). + - Fixes crashes without SSE support or when loading core files without + applications. + - TUI no longer crashes if there is no debugging information for main + (Closes: #141491). + - GDB no longer crashes on "info win" if there are no windows + (Closes: #158186). + - Setting some C++ breakpoints works the first time instead of having + to do it twice (Closes: #110684). + * Patches updated for new release. + - Patch 07.manual-vector.dpatch included in CVS. + - Patch 09.mips-linux-buildfixes-aug02.patch included in CVS. + - Patch 10.no-readline-docs.patch removed - we still use readline, + I believe that leaving it as an appendix to the GDB manual is + appropriate. + - Patch 12.tui-readline.patch updated. + - Patch 17.tui-fixes.patch added to fix a TUI problem with -i=mi. + * Remove useless --enable-shared. + * Fix a typo in "help maint dump-me" (Closes: #168495). + * Add a patch to fix build on m68k, from Michael Fedrowitz + (Closes: #163543). + * Added a patch to call rl_filename_completion_function instead of + filename_completion_function, from Matt Chapman + (Closes: #165366). + * Tag GDB version with "-debian" because we apply patches. + * Add a patch which makes debugging threaded applications drastically + (5x - 10x) faster. Whee! + + -- Daniel Jacobowitz Fri, 22 Nov 2002 17:30:26 -0500 + +gdb (5.2.cvs20020818-3) unstable; urgency=low + + * HPPA fix from Randolph Chung (Closes: #158055). + + -- Daniel Jacobowitz Sun, 25 Aug 2002 00:37:34 -0400 + +gdb (5.2.cvs20020818-2) unstable; urgency=low + + * MIPS and MIPSel build fixes. + * Apply and remove patches in numbered order. + * HPPA build fixes. + + -- Daniel Jacobowitz Mon, 19 Aug 2002 10:49:40 -0400 + +gdb (5.2.cvs20020818-1) unstable; urgency=low + + * New upstream CVS snapshot. + - Don't include in TUI (Closes: #145040). + - Don't use libthread_db with core files (Closes: #133778). + * Recompile against current readline package (Closes: #153972). + * Reduce some thread-db errors to warnings + (Closes: #123675, #126614, #134693). + * Bump MAX_UI_OUT_LEVELS for the Hurd (Closes: #145630). + * Include patch from Richard Hirst to improve function return printing + on HPPA. It looks like there's finally a little progress on getting + the HPPA code in upstream... (Closes: #148672). + * Mention Peter Jay Salzman's GDB tutorial in the documentation + (Closes: #151128). + + -- Daniel Jacobowitz Sun, 18 Aug 2002 23:09:46 -0400 + +gdb (5.2.cvs20020401-6) unstable; urgency=medium + + * More HPPA build fixes - I forgot linux-proc.o again + (Closes: #143707). + * Add support for HPPA core files, patch from Randolph Chung + (Closes: #137316). + + -- Daniel Jacobowitz Sun, 21 Apr 2002 10:29:40 -0400 + +gdb (5.2.cvs20020401-5) unstable; urgency=low + + * More HPPA build fixes. + + -- Daniel Jacobowitz Fri, 19 Apr 2002 12:43:56 -0400 + +gdb (5.2.cvs20020401-4) unstable; urgency=medium + + * Add linux-proc.o to NATDEPFILES for S/390; should fix S/390 build. + * Change `value_ptr' to `struct value *' in HPPA patch. Should fix + HPPA build in combination with libc6 2.2.5-4.0.2. + + -- Daniel Jacobowitz Wed, 17 Apr 2002 00:43:32 -0400 + +gdb (5.2.cvs20020401-3) unstable; urgency=low + + * Add a patch to fix initialization on non-multi-arch targets + (particularly Alpha and Sparc). + * Enable testsuite on Alpha and Sparc. + + -- Daniel Jacobowitz Thu, 4 Apr 2002 21:49:24 -0500 + +gdb (5.2.cvs20020401-2) unstable; urgency=low + + * My apologies to all you autobuilders out there. Results were worse than + I feared. Testsuite is now run only on PowerPC and i386 until I can + clean up the results everywhere else. + + -- Daniel Jacobowitz Wed, 3 Apr 2002 17:24:17 -0500 + +gdb (5.2.cvs20020401-1) unstable; urgency=low + + * The "Ahhhhhhhhhhhhhhhhhh!" Release. + * New snapshot from CVS (post-5.2) (yes, I know 5.2 isn't out yet). + - Fixes crash on printing large types + (Closes: #111017, #130592, #131033). + - In one upstream patch and one pending patch, greatly improve + debugging with GCC 2.95. If you've ever breakpointed the + beginning of a function and been frustrated when arguments + printed incorrectly, this release is for you! It should fix most + occurances of that problem. + * Patches from J.H.M. Dassen to use system readline. Slightly tweaked. + - [debian/rules] Build the refcard; figure out patches automatically. + - [debian/use-dynamic-readline.patch] Link against dynamic readline again. + - [debian/no-readline-docs.patch] Remove readline documentation. + - [debian/const-tilde_expand.patch] Bring extern declaration of tilde_expand + in sync with current readline headers. + - [debian/rules] Ensure we don't build against the local readline copy by + mistake; remove generated config.status files. + * Include gdbserver if it is built. + * Include a version of GDB with the TUI interface enabled + (Closes: #137503). + * Run 'make check' during build, for stabs and DWARF-2. + * Add --disable-gdbtk (Closes: #115429). + * Add a patch to prevent a hang while running the Java testsuite if + gcj-3.0 is installed. + * Include simulator in the binary package if one is built (PPC, ARM, + MIPS) (Closes: #123185). + + -- Daniel Jacobowitz Mon, 1 Apr 2002 17:17:30 -0500 + +gdb (5.1.1-1) unstable; urgency=low + + * New upstream release (Closes: #132314). + - Corrected manual licenses (Closes: #129311). + * Apply HPPA patch (Closes: #127301). + * Add patch to fix conflict with new ncurses. + + -- Daniel Jacobowitz Wed, 13 Feb 2002 16:39:32 -0500 + +gdb (5.1-1) unstable; urgency=low + + * New upstream release. + * All patches merged upstream, including (hopefully) everything needed + for S/390. + + -- Daniel Jacobowitz Fri, 7 Dec 2001 13:04:15 -0500 + +gdb (5.0.cvs20011007-3) unstable; urgency=low + + * Add ARM patch (committed to upstream CVS). + + -- Daniel Jacobowitz Wed, 31 Oct 2001 10:59:21 -0500 + +gdb (5.0.cvs20011007-2) unstable; urgency=low + + * Updated S/390 patch from Gerhard Tonn. + + -- Daniel Jacobowitz Mon, 8 Oct 2001 13:55:06 -0400 + +gdb (5.0.cvs20011007-1) unstable; urgency=low + + * New upstream release. + * Remove obsolete patches (gdb-docs, gdb-ppc-core). + * Add S/390 support patch. + * Configure for $(DEB_HOST_GNU_TYPE) (Closes: #109715). + + -- Daniel Jacobowitz Sun, 7 Oct 2001 14:06:20 -0400 + +gdb (5.0.cvs20010729-2) unstable; urgency=low + + * Fix m68k build. Again. (Closes: #107807). + + -- Daniel Jacobowitz Sat, 25 Aug 2001 15:32:16 -0700 + +gdb (5.0.cvs20010729-1) unstable; urgency=low + + * Call dh_installinfo from rules file (Closes: #107119). + * Put info files in "Development" to match other Debian development tools. + * Fix malformed gdbint.info file. + * Use DH_COMPAT=3 to make dh_installinfo work better with wildcards, + and bump debhelper build dependency. + * Update to 5.1 release branch (Closes: #103992). + * Fix PowerPC core files (Re: bug #107072). + * Fix up patch handling in rules file a little bit. + + -- Daniel Jacobowitz Mon, 30 Jul 2001 13:48:27 -0700 + +gdb (5.0.cvs20010704-1) unstable; urgency=low + + * The "Independence Day" release - CVS snapshot from July 4th. + * New maintainer. + * Update build-depends (Closes: #96835, #96897). + * New version includes thread support - for some platforms. I'm not going + to close the related bugs until I've verified it on a few more targets. + * Debhelperize (Closes: #97715, #97593). + * Add Replaces: gdb-arm for upgrades (Closes: #79992). + + -- Daniel Jacobowitz Thu, 5 Jul 2001 12:46:06 -0700 + +gdb (5.0-4) unstable; urgency=low + + * Made almost lintian clean: + - added Section: and Priority: fields in gdb binary package + - info files are now installed in /usr/share/info + - binaries get now stripped + - debian/copyright now refers to '/usr/share/common-licenses' for + full GPL license text + (patch by Domenico Andreoli ) + * added texinfo & tetex-bin to the build-dependencies. + + -- Vincent Renardias Sun, 6 May 2001 21:19:16 +0200 + +gdb (5.0-3) unstable; urgency=low + + * Include upstream README & NEWS files. + closes: #37978 gdb documentation. + * s|usr/doc|usr/share/doc|g. + closes: #69272: gdb: docs should be in /usr/share/doc according policy. + * Fix description. + + -- Vincent Renardias Wed, 16 Aug 2000 21:58:45 +0200 + +gdb (5.0-2) unstable; urgency=low + + * Include patch to get it to work on m68k. + closes: #69185: gdb doesn't build on m68k. + + -- Vincent Renardias Wed, 16 Aug 2000 19:33:16 +0200 + +gdb (5.0-1) unstable; urgency=low + + * New upstream code. + (Foreign patches not re-applied for now. Will see if they + are necessary) + closes: #66221 New major upstream version (5.0) out. + closes: #63337 gdb: Recompilation with libncurse5 needed. + closes: #58450 gdb: Won't compile on PowerPC. + closes: #54738 gdb does not compile on i386 under current glibc. + + -- Vincent Renardias Sun, 13 Aug 2000 01:27:40 +0200 + +gdb (4.18.19990928-1) unstable; urgency=low + + * New upstream code. + Fixes some problems related to the C++ code: + closes: #46125: gdb seg faults calling C++ functions. + closes: #46195: gdb is broken for C++ + closes: #43955: gdb can't resolve virtual methods with new g++ + closes: #36341: gdb: Gives a parse error when casting an expression + * Include patch from David N. Welton : + closes: #45308: gdb: Patch for gdb debian/rules + * ACK NMU: + closes: #39661: gdb is broken on ppc arch. + * Now compiles on non-i386 archs: + closes: #32267 + * Updated my email address. + + -- Vincent Renardias Wed, 29 Sep 1999 17:39:17 +0200 + +gdb (4.18-1.1) unstable; urgency=low + + * Applied some ppc patch i got from the linuxppc gdb. + + -- Sven LUTHER Mon, 14 Jun 1999 19:54:49 +0200 + +gdb (4.18-1) unstable; urgency=low + + * New upstream version! + + -- Vincent Renardias Thu, 22 Apr 1999 17:35:41 +0200 + +gdb (4.17.19981224-3.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low + + * Upgrade to new code. + * Apply HJL's 4.17.0.4 -> 4.17.0.8 patch. + * Fix #30463. + + -- Vincent Renardias Mon, 18 Jan 1999 23:38:36 +0100 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.3) frozen unstable; urgency=low + + * Non-maintainer upload. + * Apply threads patch (dynamically) only if building on i386; the patch + works currently only correct on i386 and breaks compilation at least + on m68k and sparc. + + -- Roman Hodek Fri, 11 Dec 1998 13:56:00 +0100 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.2) unstable; urgency=low + + * Non-maintainer upload. + * debian/rules (checkroot): use tab not spaces, thanks to Roman Hodek + . [#26798] + + -- James Troup Tue, 20 Oct 1998 02:41:26 +0100 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.1) unstable; urgency=low + + * NMU with yet more hideous revision. + * PowerPC support via Matt McLean. + * Clean up corrupted m68k files a little bit - move config/m68k/* to + gdb/config/m68k/* and remove literal ^L's. + + -- Daniel Jacobowitz Fri, 11 Sep 1998 22:40:22 -0400 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low + + * Apply yet another patch to improve Objective-C support (Fix #24599). + + -- Vincent Renardias Wed, 15 Jul 1998 12:34:47 +0200 + +gdb (4.17-3.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low + + * re-integrated gnat support. + (Was repported as a bug against 4.16, patch had been integrated then, + but dropped while switching to version 4.17). + (NB: Not being an ADA expert, I'd appreciate if s/o could confirm + it now works properly, thanx) + + -- Vincent Renardias Fri, 3 Jul 1998 18:46:28 +0200 + +gdb (4.17-2.m68k.objc.threads.hwwp.fpu) unstable; urgency=low + + * Include patch to support debugging of multithreaded programs + (Bug #23823) + Note: Needs a patch to libc6 to work (submitted as #24213). + * Include JH Lu patch to have hardware watchpoint and FPU support + (Fix bug #660!! (40 months old!!!) & bug #16435) + * Bug #8861 also appears to be fixed... Isn't that great? :) + * Now provide the reference card (Bug #20772). + + -- Vincent Renardias Fri, 3 Jul 1998 18:46:28 +0200 + +gdb (4.17-1) unstable; urgency=low + + * Fix #22555 (enable building on sparc) + * Fix #21932 (acknowledge NMU) + + -- Vincent Renardias Mon, 18 May 1998 17:56:10 +0200 + +gdb (4.17-0.1) frozen unstable; urgency=low + + * New upstream release (differences with upstream 4.16.98 are negligable). + * Non-maintainer upload. + * Disabled linking -rpath: + * bfd/configure.in, opcodes/configure.in: applied libtool-rpath-workaround + * gdb/configure.in, gdb/configure: don't use -rpath on Linux. + * regenerate "configure" scripts involved. + + -- J.H.M. Dassen (Ray) Thu, 30 Apr 1998 19:47:34 +0200 + +gdb (4.16.98-1) frozen unstable; urgency=low + + * New upstream code. Only change relevant on Linux: Patch by + H.J. Lu so debugging of shared library works properly (That was + the important patch motivating this upload). + This release _is_ supposed to be the final gdb-4.17 (from the announce: + 'I wanted to make a "this is the release unless something is + very wrong" release and then kick 4.17 out'). + + -- Vincent Renardias Thu, 23 Apr 1998 20:44:36 +0200 + +gdb (4.16.86-1) unstable; urgency=low + + * New upstream code. (still unreleased). + * Re-added the m68k stuff that didn't make it upstream (Bug #19539, #19635). + * Re-added the Objective-C stuff (Bug #19630) + + -- Vincent Renardias Sat, 14 Mar 1998 23:40:06 +0100 + +gdb (4.16.85-2) unstable; urgency=low + + * debian/rules: Also remove gdb/doc/GDBvn.texi and config.log when cleaning up. + * The following has been done by : + * TODO: this version of gdb uses an evil new version of libtool which + forces -rpath. With lesstif, I got around this by replacing the libtool + scripts with those from the Debian libtool package. + * Use dynamic readline library. + * Install with preserved timestamps. + * Clean out .tab.c files missed by "make distclean", so the .diff.gz is + smaller. + * Clean out symlinks, so dpkg-source works after debian/rules build clean. + * Several other minor clean-ups of the rules file. + * Updated FSF address (lintian). + * Bumped Standards-Version. + + -- Vincent Renardias Fri, 6 Mar 1998 20:49:54 +0100 + +gdb (4.16.85-1) unstable; urgency=low + + * New upstream code (Although not released yet). + + -- Vincent Renardias Thu, 5 Mar 1998 20:19:14 +0100 + +gdb (4.16-12) unstable; urgency=low + + * Applied alpha patches (#11841). + + -- Vincent Renardias Mon, 4 Aug 1997 22:28:54 +0200 + +gdb (4.16-11) unstable; urgency=low + + * Included patch to fix bugs (#11552,#11324). + + -- Vincent Renardias Wed, 30 Jul 1997 20:40:01 +0200 + +gdb (4.16-10) unstable; urgency=low + + * Fixed #11136 (support for Ada; + Thanx to Marc Eichin for pointing this patch). + + -- Vincent Renardias Thu, 10 Jul 1997 19:38:07 +0200 + +gdb (4.16-9) unstable; urgency=low + + * Fixed #11037 (compilation on m68k). + + -- Vincent Renardias Sat, 5 Jul 1997 16:14:39 +0200 + +gdb (4.16-8) unstable; urgency=low + + * Compiled with libc6/ncurses3.4/libreadline2.1. + * Fixed #9654 (cosmetic fix). + * Updated debian/control file (now supports Objective-C). + + -- Vincent Renardias Sat, 21 Jun 1997 15:15:13 +0200 + +gdb (4.16-7) unstable; urgency=low + + * Fixed typo. in documentation (Fixes bug #5477). + + -- Vincent Renardias Mon, 7 Apr 1997 16:35:53 +0200 + +gdb (4.16-6) unstable; urgency=low + + * Corrected texinfo documentation (Fixes bug #3823). + * Added upstream ChangeLog file. + + -- Vincent Renardias Sun, 16 Mar 1997 18:32:23 +0100 + +gdb (4.16-5) unstable; urgency=low + + * Included patch for glibc-2.0 support. + + -- Vincent Renardias Sun, 16 Mar 1997 07:46:29 +0100 + +gdb (4.16-4) unstable; urgency=low + + * Included patch for Objective-C support (Fixes bug #7063). + + -- Vincent Renardias Sun, 16 Mar 1997 03:12:13 +0100 + +gdb (4.16-3) unstable; urgency=low + + * New maintainer. + * Included patches for m68k support. + + -- Vincent Renardias Fri, 14 Mar 1997 22:07:58 +0100 + +gdb (4.16-2) unstable; urgency=MEDIUM + + * New caretaker: Stuart Lamble (note: this package is still up + for adoption, as I would prefer not to be maintaining it + full-time.) + * Upgraded to the 2.1.1.0 source format. + * Recompiled, with a corrected procfs.h, to correct problems with + ELF coredumps. + * Reformatted the changelog :-) + + -- Stuart Lamble Sun, 20 Oct 1996 18:48:40 +1000 + +gdb (4.16-1) unstable; urgency=low + + * Updated to new upstream version (Bug#4373) + * Added a simple extended description (Bug#3599) + + -- David Engel --- gdb-6.3.orig/debian/control +++ gdb-6.3/debian/control @@ -0,0 +1,19 @@ +Source: gdb +Maintainer: Daniel Jacobowitz +Section: devel +Priority: standard +Standards-Version: 3.5.3 +Build-Depends: autoconf, libtool, texinfo (>= 4.7-2.2), tetex-bin, libncurses5-dev, libreadline4-dev (>= 4.2a-1), bison, gettext, debhelper (>= 4.1.46), dejagnu, gcj [!mips !mipsel], gobjc, mig [hurd-i386], cdbs (>= 0.4.17), quilt (>= 0.30-1), libkvm-dev [kfreebsd-i386], libunwind7-dev [ia64], flex | flex-old + +Package: gdb +Architecture: any +Section: devel +Depends: ${shlibs:Depends} +Conflicts: gdb-arm +Replaces: gdb-arm, insight (<< 6.1+cvs.2004.04.07-1) +Description: The GNU Debugger + GDB is a source-level debugger, capable of breaking programs at + any specific line, displaying variable values, and determining + where errors occurred. Currently, it works for C, C++, Fortran + Modula 2 and Java programs. A must-have for any serious + programmer. --- gdb-6.3.orig/debian/copyright +++ gdb-6.3/debian/copyright @@ -0,0 +1,401 @@ +This is the Debian GNU/Linux packaged version of the GNU debugger, GDB. + +Earlier versions of this package were assembled by David Engel +, Stuart Lamble , and others. + +GDB is Copyright (C) Free Software Foundation, Inc. + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses'. + +=== + +The GDB manual and associated documentation are also Copyright (C) Free +Software Foundation, Inc. They are distributed under the GNU Free +Documentation License, shown below. + + +GNU Free Documentation License +****************************** + + Version 1.1, March 2000 + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + written document "free" in the sense of freedom: to assure everyone + the effective freedom to copy and redistribute it, with or without + modifying it, either commercially or noncommercially. Secondarily, + this License preserves for the author and publisher a way to get + credit for their work, while not being considered responsible for + modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work that contains a + notice placed by the copyright holder saying it can be distributed + under the terms of this License. The "Document", below, refers to + any such manual or work. Any member of the public is a licensee, + and is addressed as "you." + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter + section of the Document that deals exclusively with the + relationship of the publishers or authors of the Document to the + Document's overall subject (or to related matters) and contains + nothing that could fall directly within that overall subject. + (For example, if the Document is in part a textbook of + mathematics, a Secondary Section may not explain any mathematics.) + The relationship could be a matter of historical connection with + the subject or with related matters, or of legal, commercial, + philosophical, ethical or political position regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, whose contents can be viewed and edited directly + and straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup has been designed + to thwart or discourage subsequent modification by readers is not + Transparent. A copy that is not "Transparent" is called "Opaque." + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML designed for human modification. + Opaque formats include PostScript, PDF, proprietary formats that + can be read and edited only by proprietary word processors, SGML + or XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies of the Document numbering more than + 100, and the Document's license notice requires Cover Texts, you + must enclose the copies in covers that carry, clearly and legibly, + all these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a publicly-accessible + computer-network location containing a complete Transparent copy + of the Document, free of added material, which the general + network-using public has access to download anonymously at no + charge using public-standard network protocols. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that version + gives permission. + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in the + Modified Version, together with at least five of the principal + authors of the Document (all of its principal authors, if it + has less than five). + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + D. Preserve all the copyright notices of the Document. + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified Version + under the terms of this License, in the form shown in the + Addendum below. + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + H. Include an unaltered copy of this License. + I. Preserve the section entitled "History", and its title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. + If there is no section entitled "History" in the Document, + create one stating the title, year, authors, and publisher of + the Document as given on its Title Page, then add an item + describing the Modified Version as stated in the previous + sentence. + J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. + M. Delete any section entitled "Endorsements." Such a section + may not be included in the Modified Version. + N. Do not retitle any existing section as "Endorsements" or to + conflict in title with any Invariant Section. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties-for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition + of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections entitled + "History" in the various original documents, forming one section + entitled "History"; likewise combine any sections entitled + "Acknowledgements", and any sections entitled "Dedications." You + must delete all sections entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, does not as a whole count as a + Modified Version of the Document, provided no compilation + copyright is claimed for the compilation. Such a compilation is + called an "aggregate", and this License does not apply to the + other self-contained works thus compiled with the Document, on + account of their being thus compiled, if they are not themselves + derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one + quarter of the entire aggregate, the Document's Cover Texts may be + placed on covers that surround only the Document within the + aggregate. Otherwise they must appear on covers around the whole + aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License provided that you also include the + original English version of this License. In case of a + disagreement between the translation and the original English + version of this License, the original English version will prevail. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + http://www.gnu.org/copyleft/. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License." + + If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no Front-Cover +Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being +LIST"; likewise for Back-Cover Texts. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. --- gdb-6.3.orig/debian/control.in +++ gdb-6.3/debian/control.in @@ -0,0 +1,19 @@ +Source: gdb +Maintainer: Daniel Jacobowitz +Section: devel +Priority: standard +Standards-Version: 3.5.3 +Build-Depends: autoconf, libtool, texinfo (>= 4.7-2.2), tetex-bin, libncurses5-dev, libreadline4-dev (>= 4.2a-1), bison, gettext, debhelper (>= 4.1.46), dejagnu, gcj [!mips !mipsel], gobjc, mig [hurd-i386], cdbs (>= 0.4.17), quilt (>= 0.30-1), libkvm-dev [kfreebsd-i386], libunwind7-dev [ia64], flex | flex-old + +Package: gdb +Architecture: any +Section: devel +Depends: ${shlibs:Depends} +Conflicts: gdb-arm +Replaces: gdb-arm, insight (<< 6.1+cvs.2004.04.07-1) +Description: The GNU Debugger + GDB is a source-level debugger, capable of breaking programs at + any specific line, displaying variable values, and determining + where errors occurred. Currently, it works for C, C++, Fortran + Modula 2 and Java programs. A must-have for any serious + programmer. --- gdb-6.3.orig/debian/gdb.info +++ gdb-6.3/debian/gdb.info @@ -0,0 +1,3 @@ +objdir/gdb/doc/gdb.info* +objdir/gdb/doc/gdbint.info* +objdir/gdb/doc/stabs.info* --- gdb-6.3.orig/debian/README.Debian +++ gdb-6.3/debian/README.Debian @@ -0,0 +1,6 @@ +GDB is a complex program. It comes with an Info manual (`info gdb' or your +favorite other info browser), which serves as a good command reference. + +There are also a number of books and tutorials devoted to GDB. One +particularly useful guide is Peter Jay Salzman's, at: + http://www.dirac.org/linux/gdb/ --- gdb-6.3.orig/debian/compat +++ gdb-6.3/debian/compat @@ -0,0 +1 @@ +4 --- gdb-6.3.orig/debian/gdb.menu +++ gdb-6.3/debian/gdb.menu @@ -0,0 +1,3 @@ +?package(gdb):needs="text" title="GDB" section="Apps/Programming"\ + hints="Debuggers" command="/usr/bin/gdb" + --- gdb-6.3.orig/debian/rules +++ gdb-6.3/debian/rules @@ -0,0 +1,123 @@ +#!/usr/bin/make -f + +DEB_BUILDDIR := $(shell pwd)/objdir + +# This implements the .deb package creation using debhelper. +include /usr/share/cdbs/1/rules/debhelper.mk + +# This implements building using a configure script and Makefile. +include /usr/share/cdbs/1/class/autotools.mk + +# Quilt-based patches in debian/patches. +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + + +install = /usr/bin/install -p + +# Rather paranoid than sorry. Make the shell exit with an error if an +# untested command fails. +SHELL += -e + +DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM) +DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +run_tests := yes +run_thread_tests := yes + +ifneq ($(DEB_HOST_GNU_SYSTEM),linux) + run_tests := no +endif + +ifeq ($(findstring z$(DEB_HOST_GNU_CPU)z,zpowerpcz zi386z zalphaz zia64z zhppaz zs390z zsparcz),) + run_tests := no +endif + +ifeq ($(DEB_HOST_GNU_CPU),ia64) + arch_config_args := --with-libunwind +endif + +INSTALL = $(install) +export INSTALL + +# We pass srcdir explicitly to avoid an extra '/.' at the end of it. That +# causes a harmless, but ugly, testsuite failure in maint.exp. +DEB_CONFIGURE_EXTRA_FLAGS := $(DEB_HOST_GNU_TYPE) --disable-gdbtk \ + --disable-shared --enable-tui --srcdir=$(shell pwd) \ + $(arch_config_args) + +DEB_MAKE_BUILD_TARGET = all info + +post-patches:: + if ! test -f gdb/version.in.backup; then \ + mv -f gdb/version.in gdb/version.in.backup; \ + sed -e 's/$$/-debian/' < gdb/version.in.backup > gdb/version.in; \ + fi + +# This should probably be common-post-build-arch, but that runs during +# install, under fakeroot, in CDBS 0.4.21. +build/gdb:: check-stamp + $(MAKE) -C objdir/gdb/doc refcard.dvi refcard.ps + +check-stamp: +ifeq ($(run_tests),yes) +ifeq ($(run_thread_tests),no) + echo " $(foreach exp,$(wildcard gdb/testsuite/gdb.threads/*.exp),mv $(exp) $(exp).disabled;)" + $(foreach exp,$(wildcard gdb/testsuite/gdb.threads/*.exp),mv $(exp) $(exp).disabled;) +endif + -$(MAKE) -C objdir/gdb check \ + 2>&1 | tee objdir/check.log +ifeq ($(run_thread_tests),no) + $(foreach exp,$(wildcard gdb/testsuite/gdb.threads/*.exp.disabled),mv $(exp) $(subst .disabled,,$(exp);)) +endif +endif + touch $@ + +clean:: + rm -rf objdir + + if test -f gdb/version.in.backup; then \ + mv -f gdb/version.in.backup gdb/version.in; \ + fi + +# # For snapshots this is appropriate; careful of release tarballs +# # which include .gmo files. +# find -type f -name '*.gmo' | xargs rm -f + + rm -f check-stamp + +binary-post-install/gdb :: + if [ -x debian/gdb/usr/bin/run ]; then \ + mv debian/gdb/usr/bin/run \ + debian/gdb/usr/bin/$(DEB_HOST_GNU_TYPE)-run; \ + mv debian/gdb/usr/share/man/man1/run.1 \ + debian/gdb/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-run.1; \ + fi +ifeq ($(run_tests),yes) + install -d debian/gdb/usr/share/doc/gdb + install -m 644 objdir/check.log \ + debian/gdb/usr/share/doc/gdb/check.log +endif + + rm -rf debian/gdb/usr/include \ + debian/gdb/usr/lib/lib*.* \ + debian/gdb/usr/share/info/annotate.info* \ + debian/gdb/usr/share/info/bfd.info* \ + debian/gdb/usr/share/info/configure.info* \ + debian/gdb/usr/share/info/mmalloc.info* \ + debian/gdb/usr/share/info/standards.info* \ + debian/gdb/usr/share/locale + + install -m 755 gdb/gdb_gcore.sh debian/gdb/usr/bin/gcore + +debian/control:: debian/control.in + cp debian/control.in debian/control +# cat debian/control.in \ +# | sed "s/@kfreebsd@/`type-handling any kfreebsd-gnu`/g" \ +# | sed "s/@gnu@/`type-handling any gnu`/g" \ +# > debian/control + +DEB_INSTALL_DOCS_gdb = gdb/NEWS gdb/README gdb/doc/refcard.tex \ + objdir/gdb/doc/refcard.dvi objdir/gdb/doc/refcard.ps + +DEB_INSTALL_CHANGELOGS_gdb = gdb/ChangeLog