binutils-gdb/ld/scripttempl
H.J. Lu 4a114e3e0c Add compressed debug section support to binutils and ld.
bfd/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>
	    Cary Coutant  <ccoutant@google.com>

	* archive.c (bfd_openr_next_archived_file): Copy BFD_COMPRESS
	and BFD_DECOMPRESS.

	* bfd.c (BFD_COMPRESS): New.
	(BFD_DECOMPRESS): Likewise.
	(BFD_FLAGS_SAVED): Likewise.
	(bfd_preserve_save): Replace BFD_IN_MEMORY with BFD_FLAGS_SAVED.

	* compress.c (bfd_uncompress_section_contents): Removed.
	(get_uncompressed_size): New.
	(decompress_contents): Likewise.
	(bfd_compress_section_contents): Likewise.
	(bfd_get_full_section_contents): Likewise.
	(bfd_is_section_compressed): Likewise.
	(bfd_init_section_decompress_status): Likewise.
	(bfd_init_section_compress_status): Likewise.

	* dwarf2.c (dwarf_debug_sections): New.
	(dwarf_debug_section_enum): Likewise.
	(read_section): Remove section_name and compressed_section_name.
	Add dwarf_debug_section_enum.  Try compressed debug section.
	(read_indirect_string): Updated.
	(read_abbrevs): Likewise.
	(decode_line_info): Likewise.
	(read_debug_ranges): Likewise.
	(find_line): Updated.

	* ecoff.c (bfd_debug_section): Add compress_status and
	compressed_size.

	* elf.c (_bfd_elf_make_section_from_shdr): Call
	bfd_is_section_compressed to check if a DWARF debug section is
	compressed.  Call bfd_init_section_compress_status or
	bfd_init_section_decompress_status if needed.

	* elflink.c (elf_link_input_bfd): Replace bfd_get_section_contents
	with bfd_get_full_section_contents.
	* merge.c (_bfd_add_merge_section): Likewise.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
	* simple.c (bfd_simple_get_relocated_section_contents): Likewise.

	* elfxx-target.h (TARGET_BIG_SYM): Allow BFD_COMPRESS and
	BFD_DECOMPRESS.
	(TARGET_LITTLE_SYM): Likewise.

	* libbfd-in.h (dwarf_debug_section): New.
	(dwarf_debug_sections): Likewise.

	* libbfd.c (_bfd_generic_get_section_contents): Issue an error
	when getting contents on compressed/decompressed section.

	* section.c (COMPRESS_SECTION_NONE): New.
	(COMPRESS_SECTION_DONE): Likewise.
	(DECOMPRESS_SECTION_SIZED): Likewise.
	(BFD_FAKE_SECTION): Add compress_status and compressed_size.
	(bfd_malloc_and_get_section): Replace bfd_get_section_contents
	with bfd_get_full_section_contents.

	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.

binutils/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>

	* addr2line.c (process_file): Set BFD_DECOMPRESS.

	* objcopy.c (do_debug_sections): New.
	(OPTION_COMPRESS_DEBUG_SECTIONS): New.
	(OPTION_DECOMPRESS_DEBUG_SECTIONS): Likewise.
	(copy_options): Add OPTION_COMPRESS_DEBUG_SECTIONS and
	OPTION_DECOMPRESS_DEBUG_SECTIONS.
	(copy_usage): Add --compress-debug-sections and
	--decompress-debug-sections.
	(copy_file): Set BFD_COMPRESS or BFD_DECOMPRESS.
	(copy_section): Replace bfd_get_section_contents with
	bfd_get_full_section_contents.
	(copy_main): Handle OPTION_COMPRESS_DEBUG_SECTIONS and
	OPTION_DECOMPRESS_DEBUG_SECTIONS.  Check do_debug_sections to
	rename DWARF debug sections.

	* objdump.c (load_specific_debug_section): Replace
	bfd_get_section_contents with bfd_get_full_section_contents.
	Remove bfd_uncompress_section_contents.
	(dump_section): Replace bfd_get_section_contents with
	bfd_get_full_section_contents.
	(display_file): Set BFD_DECOMPRESS if needed.

	* readelf.c (uncompress_section_contents): Set buffer to NULL
	to indiate decompression failure.
	(load_specific_debug_section): Always call
	uncompress_section_contents.

	* doc/binutils.texi: Document --compress-debug-sections and
	--decompress-debug-sections.

binutils/testsuite/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>

	* binutils-all/compress.exp: New.
	* binutils-all/dw2-1.S: Likewise.
	* binutils-all/dw2-2.S: Likewise.
	* binutils-all/libdw2-compressed.out: Likewise.
	* binutils-all/libdw2.out: Likewise.

gas/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>

	* write.c (compress_debug): Optimize section flags check.

gas/testsuite/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>

	* elf/dwarf2-1.s: Replace .zdebug_abbrev section with
	.debug_abbrev section.
	* elf/dwarf2-2.3: Likewise.

	* elf/dwarf2-1.d: Pass --compress-debug-sections to assembler.
	Updated.
	* elf/dwarf2-2.d: Likewise.

	* gas/i386/i386.exp: Remove xfail on dw2-compress-2 and
	x86-64-dw2-compress-2.

ld/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>

	* ldfile.c (ldfile_try_open_bfd): Set BFD_DECOMPRESS after
	bfd_openr returns.
	* emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Likewise.

	* scripttempl/elf.sc: Include compressed DWARF debug sections.

ld/testsuite/

2010-10-29  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-elf/compress.exp: New.
	* ld-elf/compress1.s: Likewise.
	* ld-elf/compress1a.d: Likewise.
	* ld-elf/compress1b.d: Likewise.
	* ld-elf/compress1c.d: Likewise.
2010-10-29 12:10:39 +00:00
..
README
aix.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
alpha.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
alphavms.sc bfd/ 2010-06-01 09:52:28 +00:00
aout.sc
armaout.sc
armbpabi.sc * scripttempl/armbpabi.sc: Don't combine .init_array.* or 2010-02-27 12:34:25 +00:00
armcoff.sc * scripttempl/armcoff.sc: Revert 2010-09-22 change. 2010-09-24 04:41:12 +00:00
avr.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
crisaout.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
delta68.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
dlx.sc
elf.sc Add compressed debug section support to binutils and ld. 2010-10-29 12:10:39 +00:00
elf32cr16.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elf32cr16c.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elf32crx.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elf32msp430.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elf32msp430_3.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elf32sh-symbian.sc * scripttempl/armbpabi.sc: Don't combine .init_array.* or 2010-02-27 12:34:25 +00:00
elf32xc16x.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
elf32xc16xl.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
elf32xc16xs.sc PR ld/6766 2009-09-13 07:19:18 +00:00
elf64hppa.sc * scripttempl/armbpabi.sc: Don't combine .init_array.* or 2010-02-27 12:34:25 +00:00
elf_chaos.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elfd10v.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elfd30v.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elfi370.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elfm68hc11.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elfm68hc12.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elfmicroblaze.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
elfxtensa.sc * scripttempl/armbpabi.sc: Don't combine .init_array.* or 2010-02-27 12:34:25 +00:00
epocpe.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8300.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8300h.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8300hn.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8300s.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8300sn.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8300sx.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8300sxn.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
h8500.sc
h8500b.sc
h8500c.sc
h8500m.sc
h8500s.sc
hppaelf.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
i386beos.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
i386coff.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
i386go32.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
i386msdos.sc
i860coff.sc
i960.sc
ip2k.sc * scripttempl/armbpabi.sc (ENTRY): Do not define when performing a 2008-02-18 14:53:44 +00:00
iq2000.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
m68kaux.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
m68kcoff.sc
m88kbcs.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
mcorepe.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
mep.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
mips.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
mipsbsd.sc
mmo.sc * scripttempl/mmo.sc: Move assignment to "Main" inside .text 2010-08-31 05:11:29 +00:00
moxie.sc Add new binutils target: moxie 2009-04-16 15:39:48 +00:00
nw.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
or32.sc
pe.sc 2010-09-22 Kai Tietz <kai.tietz@onevision.com> 2010-09-22 08:03:42 +00:00
pep.sc 2010-09-22 Kai Tietz <kai.tietz@onevision.com> 2010-09-22 08:03:42 +00:00
pj.sc
ppcpe.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
psos.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
riscix.sc
sh.sc
sparccoff.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
st2000.sc
tic4xcoff.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
tic30aout.sc
tic30coff.sc
tic54xcoff.sc Revert 2009-09-28 changes. 2009-10-10 04:34:39 +00:00
tic80coff.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00
v850.sc * scripttempl/armbpabi.sc (ENTRY): Do not define when performing a 2008-02-18 14:53:44 +00:00
vanilla.sc
w65.sc
xstormy16.sc * scripttempl/xstormy16.sc (.gcc_except_table): Include sections 2010-06-29 09:43:04 +00:00
z80.sc
z8000.sc Only provide ENTRY on final link. 2009-09-09 11:59:14 +00:00

README

The files in this directory are linker script templates.
genscripts.sh sets some shell variables, then sources
EMULATION.sc, to generate EMULATION.{x,xr,xu,xn,xbn} -- the script
files for default, -r, -Ur, -n, -N.