ChangeLog-Apple   [plain text]

2008-07-01  Greg Clayton  <>

	* archures.c: Added bfd_mach_arm_7.
	* bfd-in2.h: Ditto.
	* cpu-arm.c (arch_info_struct): Added armv7 arch info.
	(architectures): Ditto.
	* mach-o.c (bfd_mach_o_convert_architecture): Added armv7 subtype
	* mach-o.h (bfd_mach_o_cpu_subtype): Ditto.

2009-06-05  Caroline Tice  <>

	HDEFINES apple-darwin systems.

2009-01-26  Jim Ingham  <>

	* mach-o.c (bfd_mach_o_scan_start_address): Don't return a start
	address for something that's not an executable.  You can't set the
	start to be something outside the main executable.
2008-10-20  Jason Molenda  (

	* opncls.c (bfd_fopen): Mark bfd files as close-on-exec so we don't
	leak them into the inferior process.

2008-10-17  Jason Molenda  (

	* mach-o.h (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_DYLD_INFO
	* mach-o.c (bfd_mach_o_write_contents): Ignore them.
	(bfd_mach_o_scan_read_command): Ignore them.

2008-10-07  Jason Molenda  (

	* mach-o.h (bfd_mach_o_filetype): Add entries for MH_DSYM and

2008-10-03  Jason Molenda  (

	* cache.c (bfd_cache_lookup_worker): Print the name of the file
	that has gone away before aborting.

2008-08-20  Jason Molenda  (

	* mach-o.c (bfd_mach_o_core_file_matches_executable_p): Remove
	ATTRIBUTE_UNUSED parameters to function; the compiler would choose to
	do no comparison sometimes and just return 'true'.

2008-08-13  Jim Ingham <>

	* mach-o.c (bfd_mach_o_core_file_matches_executable_p): compare the
	cputypes of the core files & return false if they don't match.
2008-07-22  Jason Molenda  (

	* config.bfd: Put x86_64 support patch back in.

2008-06-27  Jason Molenda  (

	* archures.c: Update to FSF gdb sources from 2007-07-02.
	* bfd-in2.h: Ditto.
	* bfd-in.h: Regenerated.
	* cpu-arm.c: Ditto.

2008-06-26  Jason Molenda  (

	* config.bfd: Remove recognition of x86_64 so we don't build for this
	until it is fully working.

2008-06-26  Jason Molenda  (

	* mach-o.c (bfd_mach_o_scan_read_dysymtab_symbol): Correct expression
	to mask off flag bits from the indirect symbol name index.

2008-06-16  Jason Molenda  (

	* config.bfd: Recognize x86_64 arch.
	* mach-o.c (bfd_mach_o_scan_read_dysymtab_symbol): Strip off the
	indirect symbol bit flags before treating this as an index.
	* po/Make-in: Fix shell typeo.

2008-05-20  Jason Molenda  (

	* mach-o.c (bfd_mach_o_make_bfd_section): The section types are
	constants, not bitfield values.

2008-04-28  Jim Ingham  <>

	* mach-o.c (bfd_mach_o_encrypted_binary): Changed to just return
	the "encrypted" bit in the mach_o_data.
	(bfd_mach_o_scan_read_command): Read the cryptid field out of the
	encryption load command.  This is what tells us if the binary is 
	actually encrypted or not.
	(bfd_mach_o_mkobject): Initialize the encrypted field.
	* mach-o.h (struct mach_o_data): Added encrypted field.
2008-04-28  Jason Molenda  (

	* mach-o.c (bfd_mach_o_encrypted_binary): New function to detect
	the presence of the LC_ENCRYPTION_INFO load command for a given bfd.
	* mach-o.h: Prototype.

2008-03-31  Jason Molenda  (

	* tekhex.c (first_phase): Allocate space for a new symbol name
	in a char* buf and point the record to point to it
	instead of allocating it in the const char* record
	and casting away the constness.

2008-03-27  Jason Molenda  (

	* mach-o.c (bfd_mach_o_write_contents): Ignore them for now.
	(bfd_mach_o_scan_read_command): Ditto.

2007-07-30  Greg Clayton  <>

        * mach-o.c (bfd_mach_o_in_shared_cached_memory): New function.
        (bfd_mach_o_scan_read_dysymtab): Check for memory bfd objects
        in the shared cache and create a LC_DYSYMTAB.nonlocalstabs section
        for them.
        * mach-o.h (bfd_mach_o_in_shared_cached_memory): New prototype.

2007-07-05  Greg Clayton  (
        * archures.c (bfd_mach_arm_6): New value.
        * bfd-in2.h: Regenerate.
        * config.bfd (targ_underscore): Add support for arm darwin targets.
        * cpu-arm.c: (arch_info_struct): Add bfd_mach_arm_6.
        (architectures): Added armv6 architecture.
        * mach-o.c (bfd_mach_o_convert_architecture): Support 
        BFD_MACH_O_CPU_TYPE_ARM as a valid mach cpu type.
        (bfd_mach_o_flavour_from_string): Ditto.
        (bfd_mach_o_scan_read_thread): Ditto.
        (bfd_mach_o_scan_start_address): Ditto.
        (bfd_mach_o_stack_addr): Ditto.
        (bfd_mach_o_arm_flavour_string): New function.
        (bfd_mach_o_arm_flavour_from_string): New function.
        * mach-o.h (bfd_mach_o_arm_thread_flavour): New enum.
        (bfd_mach_o_cpu_subtype): Added arm v4 and v6 cpu subtypes.

2006-04-18  Greg Clayton  (

        * mach-o.c (bfd_mach_o_make_bfd_section): Make any mach-o debug 
        sections have the SEC_HAS_CONTENTS as the only flag.
        * mach-o.h (typedef enum bfd_mach_o_section_type): Add the 
        BFD_MACH_O_S_ATTR_DEBUG definition for debug sections.

2008-01-24  Jason Molenda  (

	* mach-o.c (bfd_mach_o_stub_library): Indicate whether a given bfd
	is a stub library or not (has had its text/data stripped).
	* mach-o.h (enum bfd_mach_o_filetype): Add MH_DYLIB_STUB.  Add
	bfd_mach_o_stub_library prototype.

2008-01-18  Jim Ingham  <>

	mach-o.c (bfd_mach_o_make_bfd_section): Mark the __TEXT.__text
	segment readonly.
2007-08-30  Jason Molenda  (
        Apply Kaz Kojima's patch for CVE-2006-2362:

	2006-04-27  Kaz Kojima  <>

	        PR binutils/2584
        	* tekhex.c (getvalue): Change return type to bfd_boolean and
        	add the new parameter.  Return false if the unexpected character
        	is found.
        	(getsym): Likewise.
        	(first_phase): Change return type to bfd_boolean and return
        	false if the unexpected character is found.  Replace abort
        	with returning false.
        	(pass_over): Change return type to bfd_boolean and the type of
        	the second argument to bfd_boolean (*) (bfd *, int, char *).
        	Return false if FUNC returns false.
        	(tekhex_object_p): Return NULL if pass_over fails.

2007-07-30  Greg Clayton  <>

	* mach-o.c (bfd_mach_o_in_shared_cached_memory): New function.
	(bfd_mach_o_scan_read_dysymtab): Check for memory bfd objects
	in the shared cache and create a LC_DYSYMTAB.nonlocalstabs section
	for them.
	* mach-o.h (bfd_mach_o_in_shared_cached_memory): New prototype.

2006-04-18  Greg Clayton  (

	* mach-o.c (bfd_mach_o_make_bfd_section): Make any mach-o debug 
	sections have the SEC_HAS_CONTENTS as the only flag.
	* mach-o.h (typedef enum bfd_mach_o_section_type): Add the 
	BFD_MACH_O_S_ATTR_DEBUG definition for debug sections.

2007-04-06  Jim Ingham  <>

	* mach-o.c (bfd_mach_o_make_bfd_section, mach_o_scan_read_segment):
	Use the segment_mark field of the bfd_section to differentiate
	sections & segments from the Mach-O load commands.
	* sections.c: Add a comment to segment_mark to indicate we're
	using it this way.
	* bfd-in2.h: Regenerate.
2007-04-03  Jim Ingham  <>

	* archive.c (_bfd_clear_archive_entry): New function.
	(bfd_archive_free_cached_info): New function.
	(bfd_get_elt_at_filepose): Added printf code for tracking
	bfd open's and closes.  Controlled by define BFD_TRACK_OPEN_CLOSE.
	(libbfd-in.h): Declare bfd_archive_free_cached_info.
	(libbfd.h): Regenerate.
	* mach-o.c (bfd_mach_o_openr_next_archived_file): More open/close
	tracking info.
	(mach_o_bfd_thin_free_cached_info): New function.
	(mach_o_bfd_fat_free_cached_info): New function.
	* opncls.c (bfd_fopen): More open and closing tracking.
	(bfd_memopenr): Ditto.
	(bfd_close): Ditto.
2007-03-28  Jason Molenda  (

	* mach-o.c (bfd_mach_o_scan_read_command): Don't mask off LC_REQ_DYLD
	flag from load command type.
	(bfd_mach_o_load_command_types): Add LC_REQ_DYLD flag to
	LC_LOAD_WEAK_DYLIB and LC_REEXPORT_DYLIB so the constants match

2007-03-28  Jason Molenda  (

	* mach-o.c (bfd_mach_o_scan_read_command): Skip LC_RPATH load commands
	for now.

2007-02-09  Jason Molenda  (

	* mach-o.h: Add BFD_MACH_O_LC_REEXPORT_DYLIB load command constant.
	* mach-o.c (bfd_mach_o_write_contents, bfd_mach_o_scan_read_dylib,
	bfd_mach_o_scan_read_command): Handle BFD_MACH_O_LC_REEXPORT_DYLIB.

2007-01-26  Jason Molenda  (

	Import these macro definitions from today's bfd CVS 
	source tree.

2007-01-24  Jason Molenda  (

	* Regenerated with automake 1.9.6.
	* aclocal.m4: Ditto.
	* doc/ Ditto.
	* Regenerated with autoconf 2.61.
	* configure: Ditto.

2006-10-03  Jason Molenda  (

        * mach-o.h: (enum bfd_mach_o_load_command_type): Add new
        * mach-o.c (bfd_mach_o_scan_read_command): Ignore LC_CODE_SIGNATURE

2006-08-18  Greg Clayton  (

	* mach-o.c: Added thread state define macros.
	(bfd_mach_o_i386_flavour_string): Use new thread state define macros.
	(bfd_mach_o_ppc_flavour_string): Ditto.
	(bfd_mach_o_i386_flavour_from_string): New function.
	(bfd_mach_o_ppc_flavour_from_string): New function.
	(bfd_mach_o_flavour_from_string): New function.
	(bfd_mach_o_scan_read_dylinker): Support 64 bit variants.
	* mach-o.h (bfd_mach_o_flavour_from_string): Add prototype.

2006-03-22  Eric Albert  (

	* mach-o.h (bfd_mach_o_i386_thread_flavour): Add the x86-64 and virtual
	* mach-o.c (bfd_mach_o_convert_architecture): Add
	(bfd_mach_o_i386_flavour_string): Add the x86-64 and virtual flavors.
	(bfd_mach_o_scan_start_address): Handle x86-64 thread states.

2006-03-02  Jason Molenda  (

	* archive.c (bfd_generic_openr_next_archived_file): Fix location
	of #endif from previous change for aesthetic correctness - no
	actual change of code.

2006-03-02  Jason Molenda  (

        * archive.c (_bfd_get_elt_at_filepos): Disable code to handle
        nested archives; conflicts with universal + .a archive files.
        (bfd_generic_openr_next_archived_file): Ditto.

2006-02-24  Greg Clayton  (

        * mach-o.c (bfd_mach_o_scan_read_command): read the UUID
        load command for mach-o files and save the UUID into the
        (bfd_mach_o_get_uuid): added this new function to allow
        access to the uuid data.

        * mach-o.h : added uuid field to mach_o_data_struct structure and added
        function prototype for bfd_mach_o_get_uuid().

2006-01-11  Jason Molenda  (

	* mach-o.h (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_UUID.
	* mach-o.c (bfd_mach_o_scan_read_command): Ignore BFD_MACH_O_LC_UUID
	for now.

2005-12-16  Jason Molenda  (

	* cache.c (bfd_cache_close): Remove merge #if 0 fixme.

2005-09-30  Jim Ingham  <>

        * mach-o.h: Add BFD_MACH_O_LC_SEGMENT_64.  
        modify def'n of bfd_mach_o_core_fetch_environment.
        * mach-o.c (bfd_mach_o_scan_read_command): Ignore
        (bfd_mach_o_lookup_section): Handle both 32 and 64 bit
        (bfd_mach_o_core_parse_environment): Use bfd_size_type
        for file sizes, since a 64 bit executable might be loaded
        above 32 bits.
        (bfd_mach_o_core_fetch_environment): Handle both 32 and
        64 bit segments.  Also use bfd_size_type.
        (bfd_mach_o_core_file_failing_command) Ditto.
2005-08-29  Eric Albert  (

        * mach-o.h (bfd_mach_o_i386_thread_flavour): Update values to
        the new ones the kernel is using.
        * mach-o.c (bfd_mach_o_i386_flavour_string): Update accordingly.

2005-07-27  Jim Ingham  <>

        * mach-o.c (mach_o_flatten_sections): Do this for the 64
        bit mach-o as well as the 32 bit.

2005-07-27  Jim Ingham  <>

        * mach-o-target.c: Make the archive entries for the mach_o_be
        and mach_o_le target handle ar archives.  
2005-08-02  Klee Dienes  <>

	* bfd.c (bfd_preserve_save): Remove BFD_IO_FUNCS.
	* bfdwin.c (_bfd_get_file_window_malloc): Only include if needed.
	(bfd_get_file_window): Remove support for BFD_IO_FUNCS.

2005-07-06  Klee Dienes  <>

	* bfd-in.h (BFD_IO_FUNCS): Remove.
	(struct bfd_io_functions): Remove.
	* bfdio.c (bfd_seek): Fix the archive-handling code.
	* libbfd.h (_bfd_window_internal): REFCOUNT should be 30 bits, not
	31, since we have an extra bit in mapped.
	* opncls.c (bfd_funopenr): Remove.
2005-06-21  Klee Dienes  <>

	* bfdwin.c (_bfd_window_internal): The 'mapped' field needs to
	be 2 bits, not just 1.
	* mach-o.c: Fix up some type warnings.

2005-06-17  Klee Dienes  <>

	* cache.c (cache_bread): Revert the change from 06-13.  We'll
	definitely need to revisit this later.
	* bfdio.c (bfd_seek): Don't adjust for archives twice.

2005-06-15  Klee Dienes  <>

	* mach-o.c: Set the "size" field of the sections, not rawsize.

2005-06-13  Klee Dienes  <>

	* bfdio.c: Remove BFD_IO_FUNCS support (it's been replaced in
	the upstream BFD by iovec).  Re-merge the other local changes
	(mostly archive support and error-handling changes) into the new
	upstream sources.
	* cache.c (cache_bread): Change the code to match the comment.
	* Enable AM_BINUTILS_WARNINGS, to pull in
	warnings.m4 and get @WARN_CFLAGS@.
	* format.c (bfd_check_format_matches): Revert to FSF sources
	(there's a good chance we'll need to pull in our local changes later).
	* libbfd-in.h (_bfd_io_close): Add prototype.
	* libbfd.c: Remove duplicate definitions of *_PUT/GET_32/64.
	* libbfd.h: Restore bfd_cache_lookup_null and BFD_CACHE_ITERATOR.
	(_bfd_io_close): Add prototype.  

	* mach-o.c: Update copyright notification.  Fix whitespace to FSF
	sources.  Re-merge local changes into FSF sources.  Add
	definitions of N_TEXT/N_DATA/N_BSS.  Reorganize sources to match
	FSF layout.  Pull in the stabs-parsing code from macosx-tdep.c in
	the GDB sources:
	(macosx_symbol_types): New static data.
	(bfd_mach_o_symbool_type_base): New function.
	(bfd_mach_o_symbol_types_init): New function.
	(bfd_mach_o_symbol_type): New function.
	(bfd_mach_o_get_symbol_info): Update to properly process stabs

	* opncls.c (get_debug_link_info): Remove merge lossage.
	* section.c (SEC_COFF_SHARED_LIBRARY): Remove duplicate definition.
2005-05-11  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_core_parse_environment): Add prototype; make
	static.  Add comment.  Change the behavior to return -2 if we
	can't find the beginning, instead of doing something completely
	(bfd_mach_o_core_fetch_environment): Change to return bfd_boolean.
	Move the "resize the buffer as necessary" logic from
	bfd_mach_o_core_parse_environment.  Also move the code to malloc the
	result buffer.
	* mach-o.h (bfd_mach_o_core_fetch_environment): Update to return bfd_boolean.
2005-03-24  Jason Molenda  (

	* Force AC_FUNC_MMAP's result to 'yes' - it
	needs to run a test case to say 'yes' so cross-host builds
	end up with mmap support turned off.
	* aclocal.m4,, configure, po/ Regenerated.

2004-12-02  Jim Ingham  <>

	* mach-o.h: Reset BFD_MACH_O_CPU_TYPE_POWERPC_64 to the real
	value.  19 is gone...
	* mach-o.c (bfd_mach_o_convert_architecture): Change to
	accomodate new BFD_MACH_O_CPU_TYPE_POWERPC_64.
	(bfd_mach_o_scan_start_address): Add a case for PPC64.
2004-11-24  Jim Ingham  <>

	* mach-o.c (bfd_mach_o_core_fetch_environment): In some cases
	(when the core file is malformed) we can end up exiting the
	main loop without having found the environment.  In that case
	we should return an error code.
2004-11-23  Jim Ingham  <>

	* mach-o.c (bfd_mach_o_scan_read_symtab): Nuke another
	place where we had a hard-coded size for nlist.
2004-11-15  Jim Ingham  <>

	* mach-o.c (bfd_mach_o_scan_read_dysymtab): Don't hard-code
	the size of an nlist entry, get it from the mach-o version
	like everybody else.
2004-11-10  Jason Molenda  (

	* mach-o.c (bfd_mach_o_archive_p): Comment.

2004-10-14  Klee Dienes  <>

	* mach-o.c (BFD_MACH_O_CPU_IS64BIT): New constant.
	* mach-o.c (bfd_mach_o_convert_architecture): Handle the new
	64-bit specifier (bitfield instead of a value of 19).

2004-10-11  Jason Molenda  (

	* mach-o.c (bfd_mach_o_core_file_failing_command): Handle
	return value of 0 correctly.

2004-10-05  Klee Dienes  <>

	* mach-o.h (bfd_mach_o_versoin): Add prototype.
	* mach-o.c (bfd_mach_o_version): New function.
	(bfd_mach_o_core_file_failing_command): Trim off the
	non-command-line part of the string.

2004-09-21  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_core_parse_environment): New function.
	Check for four consecutive null characters, not necessarily a
	null longword (to match the behavior of otool).
	(bfd_mach_o_fetch_environment): Update to use

2004-09-15  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_segment): 64-bit fixes.
	(bfd_mach_o_scan_write_segment): 64-bit fixes.

2004-08-30  Klee Dienes  <>

	* mach-o.h (enum bfd_mach_o_load_command_type): Add
	(enum bfd_mach_o_cpu_subtype): New enumerated type.
	(enum bfd_mach_o_section_type): Add BFD_MACH_O_S_GB_ZEROFILL.
	(struct bfd_mach_o_header): Add 'reserved' and 'version'.
	(struct bfd_mach_o_section): Add 'reserved3'.
	(struct bfd_mach_o_segment_common): Add 'maxprot' and 'initprot'.
	* mach-o.c (bfd_mach_o_scan_read_section_32): Add prototype.
	(bfd_mach_o_scan_read_section_64): Add prototype.
	(bfd_mach_o_scan_write_section_32): Add prototype.
	(bfd_mach_o_scan_write_section_64): Add prototype.
	(bfd_mach_o_scan_read_segment_32): Add prototype.
	(bfd_mach_o_scan_read_segment_64): Add prototype.
	(bfd_mach_o_scan_write_segment_32): Add prototype.
	(bfd_mach_o_scan_write_segment_64): Add prototype.
	(bfd_mach_o_scan_read_section): Add new 'wide' argument.
	(bfd_mach_o_scan_write_section): Add new 'wide' argument.
	(bfd_mach_o_scan_read_segment): Add new 'wide' argument.
	(bfd_mach_o_scan_write_segment): Add new 'wide' argument.
	(bfd_mach_o_write_contents): Update to support Mach-O 2.0.
	(bfd_mach_o_write_header): Update to support Mach-O 2.0.
	(bfd_mach_o_read_header): Update to support Mach-O 2.0.
	(bfd_mach_o_make_bfd_section): Recognize BFD_MACH_O_S_GB_ZEROFILL.
	(bfd_mach_o_scan_read_section_32): New function.
	(bfd_mach_o_scan_write_section_32): New function.
	(bfd_mach_o_scan_read_segment_32): New function.
	(bfd_mach_o_scan_write_segment_32): New function.
	(bfd_mach_o_scan_write_symtab_symbols): Update to support Mach-O 2.0.
	(bfd_mach_o_scan_read_dysymtab): Update to support Mach-O 2.0.
2004-08-24  Jason Molenda  (

	* mach-o.c (bfd_mach_o_scan_read_dysymtab): Create two
	new fake sections, LC_DYSYMTAB.localstabs and LC_DYSYMTAB.nonlocalstabs
        to transmit the information from the DYSYMTAB load command
	that the static link editor is creating.  Do a bunch of sanity
	checks on the provided numbers to make sure the layout is as
	expected before we create these sections.

2004-08-23  Jim Ingham  <>

	* Adding a xvec entry to specify the writeable mode
	when getting the section contents.  Useful for getting
	mmapped files you don't intend to alter.
        * bfd-in2.h: Define the new function, add it to the
	xvec structure & the COPY macro.
	* libbfd-in.h: declare the new _with_mode function.
	* libbfd.c (_bfd_generic_get_section_contents_window_with_mode):
	New func.
	(_bfd_generic_get_section_contents_window): Use the new version
	with writeable == FALSE.
	* section.c (bfd_get_section_contents_in_window_with_mode): New
	* aout-adobe.c, aout-target.h, aout-tic30.c, binary.c,
	bout.c, coff-alpha.c, coff-mips.c, coff-rs6000.c,
	coff64-rs6000.c, elfxx-target.h, i386msdos.c, i386os9k.c,
	ihex.c, mach-o.c, mmo.c, pef.c, ppcboot.c, som.c, srec.c,
	tekhex.c, versados.c, xsym.c: All the clients of
	_bfd_generic_get_section_contents_in_window should be able
	to use the generic version of the with_mode function.

	* bfdwin.c (bfd_get_file_window) have to put a pointer
	to the new data & size in the public as well as the private
	parts of the window.
2004-08-03  Jason Molenda  (

	* mach-o.h: Minor typeo corrections in comment.

2004-07-28  Klee Dienes  <>

	* cpu-powerpc.c (bfd_powerpc_archs): Mark the 970 as a 64-bit

2004-07-19  Klee Dienes  <>
	    Miklos Fazekas <>

	* xsym.c
	New functions, to parse 3.3R0-style CodeWarrior xSym files.
	(Based on code from Miklos Fazekas <>).
	(bfd_sym_read_header, bfd_sym_read_version,
	bfd_sym_fetch_constant_pool_entry, bfd_sym_fetch_type_table_entry,
	Update to recognize and dispatch 3.3R0-version files.
	(Based on code from Miklos Fazekas <>).

	* xsym.h: Remove 'PARAMS' declarations.  Add constants and
	prototypes for 3.3R0-style CodeWarrior xSym files.  
	(Based on code from Miklos Fazekas <>).

2004-06-15  Jason Molenda  (

	* config.bfd (targ_underscore): Set to 'yes' on Darwin platforms
	so cxxfilt will properly handle ld's output.

2004-05-06  Klee Dienes <>

	* mach-o.h (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_POWERPC_64.
	* mach-o.c (bfd_mach_o_convert_architecture): Add subtype
	(machine) support for all architectures, including bfd_mach_ppc64.

2004-04-08  Jason Molenda  (

	* bfdio.c (_bfd_io_close): Pass the return value up the stack.

2003-08-06  Klee Dienes  <>

        * bfdio.c (bfd_get_mtime): When BFD_IN_MEMORY is set, don't try to
        provide a valid mtime (since none exists).

2003-07-22  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_symtab_symbol): Don't subtract 1
	from section, when looking it up in the section array, since we
	already subtracted 1 when reading in the number in the first

2003-05-11  Klee Dienes  <>

	* archures.c (bfd_mach_ppc_970): New value.
	* cpu-powerpc.c (bfd_powerpc_archs): New field for bfd_mach_ppc_970.
	* mach-o.h (bfd_mach_o_section_type): Add

2003-04-25  Klee Dienes  <>

	* Regenerate.
	* configure: Regenerate.
	* po/Make-in: Regenerate.

2003-04-21  Klee Dienes  <>

	* opncls.c (bfd_mmap_file): Don't mark the mtime as cached.

2003-01-13  Klee Dienes  <>

	* bfd-in2.h: Regenerate.

2003-01-07  Klee Dienes  <>

	* (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c.
	(BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c.
	* Regenerate.
	* doc/ Regenerate.

2002-12-17  Klee Dienes  <>

	* opncls.c (bfd_close): Propagate return values from

2002-12-07  Klee Dienes  <>

	* opncls.c: Replace true with TRUE, false with FALSE.

2002-11-18  Klee Dienes  <>

	* (INCLUDES): Remove true/false/free/strdup
	* Regenerate.
	* aout-arm.c: Remove libbfd.h (revert to FSF sources).
	* aout-ns32k.c: Remove libbfd.h (revert to FSF sources).
	* bfd-in2.h: Regenerate.
	* bfd.c: Remove whitespace diff.
	* bfdio.c: Update copyright header.
	* bfdwin.c: Update copyright header.
	* libbfd.h: Regenerate.
	* doc/ Remove duplicate entries for bfdio.c and
	* po/ Ditto (and also sym.c).
2002-11-16  Klee Dienes  <>

	* (INCLUDES): Define true and false here, to
	minimize source diffs.
	* bfd-in2.h: Regenerate.
	* bfd.c (bfd_assert): Revert to FSF sources.
	* bfdwin.c (_bfd_window_internal): Convert to INTERNAL_DEFINITION.
	* cache.c (ALL_BFD_CACHE): Revert to BFD_CACHE_ITERATOR;
	convert to exported definition.
	* config.bfd: Remove whitespace diff.
	* Remove tekhex_vec (revert to FSF sources).
	* libbfd-in.h: Remove definitions of true, false.  Revert
	BFD_ASSERT and bfd_assert to FSF sources.
	* libbfd.c: Remove ARGSUSED (revert to FSF sources).
	* targets.c: Revert to old usage of bfd_assert in BFD_SEND and

2002-11-16  Klee Dienes  <>

	* Define strdup=xstrdup in the Makefile, rather than
	in the sources.
	* bfdio.c: Fix whitespace diffs from the FSF sources.
	* bfdwin.c (_bfd_generic_get_section_contents_in_window): Move
	back to libbfd.c.
	* coff-ppc.c: Revert change from strdup to xstrdup.
	* versados.c: Revert change from strdup to xstrdup.
	* libbfd.c (_bfd_generic_get_section_contents_in_window): Move
	from bfdwin.c.
	* opncls.c: Convert CONST declarations to const.
	* bfd-in2.h: Regenerate.

2002-11-12  Klee Dienes  <>

        * bfd.c (bfd_preserve_save): Preserve BFD_IN_MEMORY and
	BFD_IO_FUNCS in the flags, if set.

2002-11-11  Klee Dienes  <>

	* mach-o.c: Various whitespace fixes.
	* pef.c: Various whitespace fixes.
	* xsym.c: Various whitespace fixes.

2002-11-11  Klee Dienes  <>

	* mach-o.c (bfd_preserve): New structure.  Stores previous bfd
	state in case our parse fails and we need to revert to the
	previous contents.
	(bfd_preserve_save): New function.  Saves the existing bfd state;
	creates a new tdata pointer of the specified size.  Returns true
	on success.
	(bfd_preserve_restore): New function.  Restores the previous bfd
	state, freeing all memory allocated since bfd_save was called.
	(bfd_preserve_finish): New function.  Frees any memory that may
	have been allocated by a bfd_preserve, or by the bfd by targets
	prior to the one currently being called.  To be used when a target
	is planning to return and replace the previous contents of
	(bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish to
	preserve the previous contents of the bfd.
	(bfd_mach_o_core_p): Ditto.

	* pef.c (bfd_preserve, bfd_preserve_save,
	bfd_preserve_restore, bfd_preserve_finish): See comments for
	(bfd_pef_object_p): See comment for bfd_mach_o_object_p.
	(bfd_pef_xlib_object_p): Ditto.

	* xsym.c (bfd_preserve, bfd_preserve_save,
	bfd_preserve_restore, bfd_preserve_finish): See comments for
	(bfd_sym_object_p): See comment for bfd_mach_o_object_p.

2002-11-11  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_symtab_symbol): Desc should be
	signed, but value should not, to match the declarations in the bfd

2002-11-11  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when
	looking for an unused section name; we'll need its original value

2002-11-10  Klee Dienes  <>

	* pef.c: Move version check out of bfd_pef_scan and into
	bfd_pef_object_p.  Only modify tdata if we have already recognized
	the file correctly.  Ditto for bfd_pef_xlib_scan and
	* xsym.c (bfd_sym_scan): New function.  Does the real work of
	parsing an already-recognized xSYM file (moved from
	(bfd_sym_object_p): Only modify tdata if we have already
	recognized the file correctly.
	* xsym.h (bfd_sym_scan): Add prototype.
2002-11-08  Klee Dienes  <>

	* opncls.c (_bfd_delete_bfd): Clear the bfd structure before freeing.
	* cache.c (ALL_BFD_CACHE): New macro.  Iterates through all
	the entries in the BFD cache, from least-recent to most-recent.
	(close_one): Use ALL_BFD_CACHE.

2002-11-05  Klee Dienes  <>

	* doc/Make-in: Re-add support for @USE_NLS@ (to match FSF
	* doc/ Remove definition of MAKEINFO, to match FSF
	* aoutx.h (translate_to_native_sym_flags): Re-add
	commented-out code (it used to cause compiler crashes).
	* Remove old rule for po/ (replaced by
	SRC_POTFILES and BLD_POTFILES) in the FSF sources.
	* targets.c: Revert several target vector discrepancies to FSF
	* section.c (STD_SECTION): Remove whitespace diff from FSF
	* cpu-i960.c: Revert to FSF sources.
	* elf-eh-frame.c: Revert to FSF sources.
	* elf32-fr30.c: Revert to FSF sources.
	* elf32-sh.c: Revert to FSF sources.
	* coffcode.h: Remove stray '\'.
	* libcoff.h: Regenerate.
	* cache.c: Remove a parenthesization diff from the FSF
	* coff-ppc.c: Remove initializers for globals (we now compile
	with -fcommon for shared libraries).
	* config.bfd: Remove obsolete Apple/NeXT BFD targets.
	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Revert
	to FSF sources.

2002-11-02  Klee Dienes  <>

	* mach-o-target.c: Update copyright header.
	* sym.h: Update copyright header.
	* sym.c: Update copyright header.
	* pef.h: Update copyright header.
	* pef.c: Update copyright header. Define BFD_IO_FUNCS to 0 if
	not already defined
	(allows to compile on a FSF tree with BFD_IO_FUNCS support).
	* pef-traceback.h: Update copyright header.
	* mach-o.h: Update copyright header.
	* mach-o.c: Update copyright header. Define BFD_IO_FUNCS to 0
	if not already defined
	(allows to compile on a FSF tree with BFD_IO_FUNCS support).
	(bfd_mach_o_scan_read_symtab_symbol): Desc and value are both
	signed, not unsigned.
	(bfd_mach_o_i386_flavour_string): Convert 'flavour' to an
	'int' before comparing to possibly signed enums.
	(bfd_mach_o_ppc_flavour_string): Convert 'flavour' to an
	'int' before comparing to possibly signed enums.
	(bfd_mach_o_object_p): Ensure that abfd->tdata.mach_o_data is
	restored to NULL in case of error.
	(bfd_mach_o_core_p): Ditto.

2002-11-02  Klee Dienes  <>
	* pef.c (bfd_print_symbol): Print traceback table information for
	"__traceback_X" symbols.
	(bfd_pef_convert_architecture): New function.  Converts a
	PEF-style architecture 4-char 'm68k' or 'pwpc' to a
	(bfd_pef_parse_traceback_table): Add a 'file' argument.  If
	non-NULL, print the parsed traceback information to that file.
	Correctly add the length of the name string to the returned
	traceback table length.  Store the length of the traceback table
	in the user-data field of the parsed symbol.
	(bfd_pef_section_flags): New function.  Select appropriate section
	flags based on the PEF 'kind' of the section.
	(bfd_pef_make_bfd_section): Use bfd_pef_section_flags to set the
	section flags.
	(bfd_pef_print_loader_header): New function.  Print a dump of
	'header' to 'file'.
	(bfd_pef_print_loader_section): New function.  Print a dump of the
	loader section for 'abfd' to 'file'.
	(bfd_pef_scan_start_address): New function.  Fetch the PEF start
	address from the loader section and set it in 'abfd'.
	(bfd_pef_scan): Call bfd_pef_convert_architecture to set the
	architecture.  Call bfd_pef_scan_start_address to set the start
	* pef.h: Add prototypes for new functions.
2002-11-02  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_dylib): Add
	(bfd_mach_o_write_content): Ditto.
	(bfd_mach_o_scan_read_command): Ditto.

2002-11-01  Klee Dienes  <>

	* sym.c (bfd_sym_object_p): Call bfd_set_error and clear the
	private data if the file does not match.

2002-11-01  Klee Dienes  <>
	* mach-o.h (bfd_mach_o_load_comamnd): Add new field
	'type_required', to indicate if the load-command type had the
	LC_REQ_DYLD flag set.
	* mach-o.c (bfd_mach_o_scan_read_command): Set type_required; mask
	out LC_REQ_DYLD from the type field.
	(bfd_mach_o_scan_write_command): Output the type_required bit as
	LC_REQ_DYLD, if set.
2002-11-01  Klee Dienes  <>

	* bfd-in.h: Remove PDO-specific header includes.
	* format.c: Clean up formatting to match FSF sources.
	* hpux-core.c: Remove spurious diff from FSF sources.
	* libbfd-in.h: Remove whitespace diff from FSF sources.
	* libbfd.c: Remove whitespace diff from FSF sources.
	* som.c: Remove HPPA_R_ARG_RELOC, HPPA_R_ADDEND (spurious
	diffs from FSF sources).

2002-10-28  Klee Dienes  <>

	* bfd-in.h: Add declaration for struct stat.
	(bfd_io_functions): Add new method 'stat_func', to implement bfd_stat.
	* bfd-in2.h: Regenerate.
	* bfdio.c (bfd_stat): Instead of returning an error for
	in-memory BFDs, return a zeroed-out stat, with st_size set to the size
	of the in-memory buffer.  For an iofuncs BFD, pass to the
	stat_func method.

2002-10-28  Klee Dienes  <>

	* Regenerate.
	* configure: Regenerate.
	* libbfd-in.h: Include stdio.h, not sysdep.h (sysdep.h brings in too much).
	* libbfd.h: Regenerate.

2002-10-26  Klee Dienes  <>

	* archures.c: Remove PIC support.
	* bfd-in2.h: Remove PIC support.	
	* po/ Remove PIC support.
	* cpu-pic.c: Remove.

2002-10-12  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_symtab_symbol): Desc and value
	must be unsigned, or they'll get sign-extension mauled when
	building with 64-bit BFD.

2002-10-02  Klee Dienes  <>

	* format.c (bfd_check_format_matches): Check that matching is
	non-NULL before using it to return a list of matching targets.

2002-10-01  Klee Dienes  <>

	* libbfd-in.h: Add prototype for _bfd_io_close.
	* libbfd.c: Include "libiberty.h" (for xmalloc).
	* mach-o.c: No longer #define bfd_mach_o_core_file_* (we implement
	them; the #defines were just causing them to have unfortunate
	(bfd_mach_o_convert_architecture): Subtype is an unsigned long,
	not an enum bfd_architecture

	* bfdio.c: Rename bfd_io_close to _bfd_io_close.
	(bfd_bwrite): Actually write the data for the

	* bfd-in.h: (_bfd_get_file_window): Takes a ufile_ptr, not file_ptr.
	* bfdwin.c (_bfd_get_file_window): Ditto.
	(_bfd_get_file_window_mmap): Ditto.
	(_bfd_get_file_window_mmalloc): Ditto.

	* bfdwin.c: Fix compiler warnings.
	* bfdwin.c: Fix compiler warnings.
	* cache.c: Fix compiler warnings.
	* bfdio.c: Fix compiler warnings
	* mach-o.c,h: Fix compiler warnings.
	* pef.c,h: Fix compiler warnings.  Replace calls of xmalloc and
	xfree with bfd_malloc and free, respectively.
	* sym.c,h: Fix compiler warnings.  Convert to K&R-style
	function declarations.

	* Add bfdio.c, bfdwin.c and cache.c to the
	appropriate Makes variable for automatic header and documentation
	* Regenerate.
	* bfd-in2.h: Regenerate.
2002-09-29  Klee Dienes  <>

	* mach-o.c: Update prototypes for static functions.  K&R-ize
	function declarations.
	(bfd_mach_o_write_contents): No longer need to copy sections from
	input file; they're already written by the time this function is
	(bfd_mach_o_scan_write_segment): Just read section information
	from the output file, no need to use a "fake" file specified in
	the header.
	(bfd_mach_o_scan_read_thread): Check for already-loaded threads;
	generate thread names of the form LC_THREAD.FLAVOR.THREADNO.
	(bfd_mach_o_core_fetch_environment): Fix off-by-one error in the
	search for the start of the environment region; need to check all
	the way back to (buff + size - offset), so we use '<='.  Terminate
	search when the entire region has been checked, even if no
	terminator is found at the start of the buffer.
	* mach-o.h: Update prototyles for global functions.		 
	* mach-o-target.c: Update the write vectors in the target
	struction to support core files, not just object files.
2002-09-28  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_core_fetch_environment): Add.
	(bfd_mach_o_stack_addr): Add.
	(bfd_mach_o_core_file_failing_command): Update to use

2002-09-24  Klee Dienes  <>

	* mach-o.c: Add bfd_mach_o_core_file_{failing_command,
	failing_signal, matches_executable_p}.

2002-08-30  Klee Dienes  <>

	* config.bfd: Change powerpc-apple-darwin* to i386-apple-darwin*
	in the recognizer checks for i386 build (fixes typo).

	* configure: Regenerate.
2002-07-08  Jim Ingham <>

	* pef.c (bfd_pef_parse_traceback_tables): Don't malloc space
	for the name field if you are only counting symbols.
	(bfd_pef_parse_symbols): Initialize codebuf to NULL so we don't
	try to free it.

2002-02-20  Jim Ingham <>

	* config.bfd: The i386 architecture has to be the FIRST target
        in the list for the i386 target, since that is how gdb sets the 

2002-01-30  Jim Ingham <>

	* opncls.c (bfd_open): Initialize ret to true so we don't return
	an uninitialized value.
        * config.bfd: Move the defines for powerpc-apple-macos10 BEFORE the
	one for powerpc-*-macos*, so that we don't get the classic Mac OS bfd
	targets for target=powerpc-apple-macos10.

2001-10-31  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_command): process
	BFD_MACH_O_LC_WEAK_DYLIB as if it were

2001-10-30  Klee Dienes  <>

	* mach-o.c (bfd_mach_o_scan_read_command): recognize (and ignore)

	* mach-o.h: add BFD_MACH_O_LC_PREBIND_CKSUM and